{"file_path":"contracts/Arbitrator.sol","creation_status":"success","source_code":"// SPDX-License-Identifier: MIT OR Apache-2.0\n\npragma solidity 0.8.25;\n\nimport {OwnableUpgradeable} from \"@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol\";\nimport {UUPSUpgradeable} from \"@openzeppelin/contracts-upgradeable/proxy/utils/UUPSUpgradeable.sol\";\nimport {ReentrancyGuardUpgradeable} from \"@openzeppelin/contracts-upgradeable/security/ReentrancyGuardUpgradeable.sol\";\nimport {DoubleEndedQueueUpgradeable} from \"@openzeppelin/contracts-upgradeable/utils/structs/DoubleEndedQueueUpgradeable.sol\";\nimport {Address} from \"@openzeppelin/contracts/utils/Address.sol\";\nimport {IArbitrator} from \"./interfaces/IArbitrator.sol\";\nimport {IL1Gateway} from \"./interfaces/IL1Gateway.sol\";\nimport {IAdmin} from \"./zksync/l1-contracts/zksync/interfaces/IAdmin.sol\";\nimport {IZkSync} from \"./zksync/l1-contracts/zksync/interfaces/IZkSync.sol\";\nimport {FeeParams} from \"./zksync/l1-contracts/zksync/Storage.sol\";\n\n/// @title Arbitrator contract\n/// @author zk.link\ncontract Arbitrator is IArbitrator, OwnableUpgradeable, UUPSUpgradeable, ReentrancyGuardUpgradeable {\n    using DoubleEndedQueueUpgradeable for DoubleEndedQueueUpgradeable.Bytes32Deque;\n\n    /// @dev The gateway for sending message from ethereum to primary chain\n    IL1Gateway public primaryChainGateway;\n    /// @dev The gateway for sending message from ethereum to secondary chain\n    mapping(IL1Gateway => bool) public secondaryChainGateways;\n    /// @dev A message hash queue waiting to forward to all secondary chains\n    DoubleEndedQueueUpgradeable.Bytes32Deque public primaryChainMessageHashQueue;\n    /// @dev A message hash queue waiting to forward to primary chain\n    mapping(IL1Gateway => DoubleEndedQueueUpgradeable.Bytes32Deque) public secondaryChainMessageHashQueues;\n    /// @notice List of permitted relayers\n    mapping(address relayerAddress => bool isRelayer) public relayers;\n    /// @dev A transient storage value for forwarding message from source chain to target chains\n    bytes32 private finalizeMessageHash;\n    /// @dev A transient storage value for represent a valid message claim\n    uint256 private claiming;\n    /**\n     * @dev This empty reserved space is put in place to allow future versions to add new\n     * variables without shifting down storage in the inheritance chain.\n     * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps\n     */\n    uint256[48] private __gap;\n\n    /// @notice Primary chain gateway init\n    event InitPrimaryChain(IL1Gateway indexed gateway);\n    /// @notice SecondaryChain's status changed\n    event SecondaryChainStatusUpdate(IL1Gateway indexed gateway, bool isActive);\n    /// @notice Relayer's status changed\n    event RelayerStatusUpdate(address indexed relayer, bool isActive);\n    /// @notice Validator's status changed\n    event ValidatorStatusUpdate(IL1Gateway indexed gateway, address validatorAddress, bool isActive);\n    /// @notice Fee params for L1->L2 transactions changed\n    event NewFeeParams(IL1Gateway indexed gateway, FeeParams newFeeParams);\n    /// @notice Emit when receive message from l1 gateway\n    event MessageReceived(uint256 value, bytes callData);\n    /// @notice Emit when forward message to l1 gateway\n    event MessageForwarded(IL1Gateway indexed gateway, uint256 value, bytes callData);\n\n    /// @notice Checks if relayer is active\n    modifier onlyRelayer() {\n        require(relayers[msg.sender], \"Not relayer\"); // relayer is not active\n        _;\n    }\n\n    constructor() {\n        _disableInitializers();\n    }\n\n    function initialize() external initializer {\n        __Ownable_init_unchained();\n        __UUPSUpgradeable_init_unchained();\n        __ReentrancyGuard_init_unchained();\n    }\n\n    function _authorizeUpgrade(address newImplementation) internal override onlyOwner {\n        // can only call by owner\n    }\n\n    /// @notice Return the message hash at a position stored in queue\n    function getMessageHash(IL1Gateway _gateway, uint256 _index) external view returns (bytes32 messageHash) {\n        if (_gateway == primaryChainGateway) {\n            messageHash = primaryChainMessageHashQueue.at(_index);\n        } else {\n            messageHash = secondaryChainMessageHashQueues[_gateway].at(_index);\n        }\n    }\n\n    /// @dev Set primary chain\n    function setPrimaryChainGateway(IL1Gateway _gateway) external onlyOwner {\n        require(address(primaryChainGateway) == address(0), \"Duplicate init gateway\");\n        require(address(_gateway) != address(0), \"Invalid gateway\");\n        primaryChainGateway = _gateway;\n        emit InitPrimaryChain(_gateway);\n    }\n\n    /// @dev Set secondary chain\n    function setSecondaryChainGateway(\n        IL1Gateway _gateway,\n        bool _active,\n        bytes calldata _adapterParams\n    ) external payable onlyOwner {\n        require(_gateway != primaryChainGateway, \"Invalid gateway\");\n        if (_active != secondaryChainGateways[_gateway]) {\n            secondaryChainGateways[_gateway] = _active;\n            bytes memory callData = abi.encodeCall(IZkSync.setSecondaryChainGateway, (address(_gateway), _active));\n            // Forward fee to send message\n            primaryChainGateway.sendMessage{value: msg.value}(0, callData, _adapterParams);\n            emit SecondaryChainStatusUpdate(_gateway, _active);\n        }\n    }\n\n    /// @dev Set relayer\n    function setRelayer(address _relayer, bool _active) external onlyOwner {\n        if (relayers[_relayer] != _active) {\n            relayers[_relayer] = _active;\n            emit RelayerStatusUpdate(_relayer, _active);\n        }\n    }\n\n    /// @dev Set validator for a chain\n    function setValidator(\n        IL1Gateway _gateway,\n        address _validator,\n        bool _active,\n        bytes calldata _adapterParams\n    ) external payable onlyOwner {\n        require(_gateway == primaryChainGateway || secondaryChainGateways[_gateway], \"Invalid gateway\");\n        bytes memory callData = abi.encodeCall(IAdmin.setValidator, (_validator, _active));\n        // Forward fee to send message\n        _gateway.sendMessage{value: msg.value}(0, callData, _adapterParams);\n        emit ValidatorStatusUpdate(_gateway, _validator, _active);\n    }\n\n    function isRelayerActive(address _relayer) external view returns (bool) {\n        return relayers[_relayer];\n    }\n\n    /// @dev Change fee params for a chain\n    function changeFeeParams(\n        IL1Gateway _gateway,\n        FeeParams calldata _newFeeParams,\n        bytes calldata _adapterParams\n    ) external payable onlyOwner {\n        require(_gateway == primaryChainGateway || secondaryChainGateways[_gateway], \"Invalid gateway\");\n        bytes memory callData = abi.encodeCall(IAdmin.changeFeeParams, (_newFeeParams));\n        // Forward fee to send message\n        _gateway.sendMessage{value: msg.value}(0, callData, _adapterParams);\n        emit NewFeeParams(_gateway, _newFeeParams);\n    }\n\n    function enqueueMessage(uint256 _value, bytes calldata _callData) external payable {\n        require(msg.value == _value, \"Invalid msg value\");\n        // store message hash for forwarding\n        bytes32 _finalizeMessageHash = keccak256(abi.encode(_value, _callData));\n        IL1Gateway gateway = IL1Gateway(msg.sender);\n        if (gateway == primaryChainGateway) {\n            primaryChainMessageHashQueue.pushBack(_finalizeMessageHash);\n        } else {\n            require(secondaryChainGateways[gateway], \"Not secondary chain gateway\");\n            secondaryChainMessageHashQueues[gateway].pushBack(_finalizeMessageHash);\n        }\n        emit MessageReceived(_value, _callData);\n    }\n\n    /// @dev This function is called within the `claimMessageCallback` of L1 gateway\n    function receiveMessage(uint256 _value, bytes calldata _callData) external payable {\n        require(msg.value == _value, \"Invalid msg value\");\n        IL1Gateway gateway = IL1Gateway(msg.sender);\n        require(gateway == primaryChainGateway || secondaryChainGateways[gateway], \"Invalid gateway\");\n        uint256 _claiming;\n        assembly {\n            _claiming := tload(claiming.slot)\n        }\n        // Ensure claim start from this contract\n        require(_claiming == 1, \"Claim not from arbitrator\");\n        // Temporary store message hash for forwarding\n        bytes32 _finalizeMessageHash = keccak256(abi.encode(msg.sender, _value, _callData));\n        assembly {\n            tstore(finalizeMessageHash.slot, _finalizeMessageHash)\n        }\n    }\n\n    function forwardMessage(\n        IL1Gateway _gateway,\n        uint256 _value,\n        bytes calldata _callData,\n        bytes calldata _adapterParams\n    ) external payable nonReentrant onlyRelayer {\n        bytes32 _finalizeMessageHash = keccak256(abi.encode(_value, _callData));\n        if (_gateway == primaryChainGateway) {\n            require(_finalizeMessageHash == primaryChainMessageHashQueue.popFront(), \"Invalid finalize message hash\");\n            // Unpack destination chain and final callData\n            (IL1Gateway secondaryChainGateway, bytes memory finalCallData) = abi.decode(_callData, (IL1Gateway, bytes));\n            require(secondaryChainGateways[secondaryChainGateway], \"Invalid secondary chain gateway\");\n            // Forward fee to send message\n            secondaryChainGateway.sendMessage{value: msg.value + _value}(_value, finalCallData, _adapterParams);\n        } else {\n            require(secondaryChainGateways[_gateway], \"Not secondary chain gateway\");\n            require(\n                _finalizeMessageHash == secondaryChainMessageHashQueues[_gateway].popFront(),\n                \"Invalid finalize message hash\"\n            );\n            // Forward fee to send message\n            primaryChainGateway.sendMessage{value: msg.value + _value}(_value, _callData, _adapterParams);\n        }\n        emit MessageForwarded(_gateway, _value, _callData);\n    }\n\n    function claimMessage(\n        address _sourceChainCanonicalMessageService,\n        bytes calldata _sourceChainClaimCallData,\n        IL1Gateway _sourceChainL1Gateway,\n        uint256 _receiveValue,\n        bytes calldata _receiveCallData,\n        bytes calldata _forwardParams\n    ) external payable nonReentrant onlyRelayer {\n        // Set `claiming` to 1 and check it in `receiveMessage`\n        assembly {\n            tstore(claiming.slot, 1)\n        }\n        // Call the claim interface of source chain message service\n        // And it will inner call the `claimMessageCallback` interface of source chain L1Gateway\n        // In the `claimMessageCallback` of L1Gateway, it will inner call `receiveMessage` of Arbitrator\n        // No use of return value\n        Address.functionCall(_sourceChainCanonicalMessageService, _sourceChainClaimCallData);\n\n        // Load the transient `finalizeMessageHash`\n        bytes32 _finalizeMessageHash;\n        assembly {\n            _finalizeMessageHash := tload(finalizeMessageHash.slot)\n        }\n        require(\n            _finalizeMessageHash == keccak256(abi.encode(_sourceChainL1Gateway, _receiveValue, _receiveCallData)),\n            \"Incorrect finalize data\"\n        );\n\n        // The msg value should be equal to the combined cost of all messages delivered from l1 to l2\n        // The excess fees will be refunded to the relayer by rollup canonical message service\n        if (_sourceChainL1Gateway == primaryChainGateway) {\n            // Unpack destination chain and final callData\n            bytes[] memory gatewayDataList = abi.decode(_receiveCallData, (bytes[]));\n            bytes[] memory gatewayForwardParamsList = abi.decode(_forwardParams, (bytes[]));\n            uint256 gatewayLength = gatewayDataList.length;\n            require(gatewayLength == gatewayForwardParamsList.length, \"Invalid forward params length\");\n            uint256 totalCallValue;\n            uint256 totalSendMsgFee;\n            unchecked {\n                for (uint256 i = 0; i < gatewayLength; ++i) {\n                    bytes memory gatewayData = gatewayDataList[i];\n                    bytes memory gatewayForwardParams = gatewayForwardParamsList[i];\n                    (IL1Gateway targetGateway, uint256 targetCallValue, bytes memory targetCallData) = abi.decode(\n                        gatewayData,\n                        (IL1Gateway, uint256, bytes)\n                    );\n                    require(secondaryChainGateways[targetGateway], \"Invalid secondary chain gateway\");\n                    totalCallValue += targetCallValue;\n                    (uint256 sendMsgFee, bytes memory adapterParams) = abi.decode(\n                        gatewayForwardParams,\n                        (uint256, bytes)\n                    );\n                    totalSendMsgFee += sendMsgFee;\n                    // Forward fee to send message\n                    targetGateway.sendMessage{value: sendMsgFee + targetCallValue}(\n                        targetCallValue,\n                        targetCallData,\n                        adapterParams\n                    );\n                    emit MessageForwarded(targetGateway, targetCallValue, targetCallData);\n                }\n            }\n            require(totalCallValue == _receiveValue, \"Invalid call value\");\n            require(totalSendMsgFee == msg.value, \"Invalid send msg fee\");\n        } else {\n            IL1Gateway targetGateway = primaryChainGateway;\n            // Forward fee to send message\n            targetGateway.sendMessage{value: msg.value + _receiveValue}(\n                _receiveValue,\n                _receiveCallData,\n                _forwardParams\n            );\n            emit MessageForwarded(targetGateway, _receiveValue, _receiveCallData);\n        }\n    }\n}\n","deployed_bytecode":"0x60806040526004361015610011575f80fd5b5f803560e01c806304291b5614611b6f5780633532e712146116545780633659cfe6146113b05780633e1c2bcd146113565780634f1ef286146110c5578063512c91df14610efa57806352d1902d14610e375780635300f84114610af4578063715018a614610dda57806373a2218714610d9b57806373f3fe2514610c7c5780638129fc1c14610b3457806383a9f7fc14610af45780638c124d90146107f95780638d57acd0146106825780638da5cb5b1461065957806394bf41de1461062557806394fa9598146105fc5780639885441214610472578063aa9c9ffc146103bb578063d457d5551461024d578063ecd8dc3a146101aa5763f2fde38b14610117575f80fd5b346101a75760203660031901126101a757610130611c9c565b610138612246565b6001600160a01b03811615610153576101509061229e565b80f35b60405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608490fd5b80fd5b50346101a75760403660031901126101a7576101c4611c9c565b6101cc611d70565b906101d5612246565b6001600160a01b0316808352610100602052604083208054919290918115159060ff161515819003610205578480f35b61023e6020927fe783a071195fae2dfbfd4f01d98ca8422e6aa745b183caed1e2958472cbf370f949060ff801983541691151516179055565b604051908152a25f8080808480f35b506003196101003682011261038e5781610265611c9c565b9160c036602319011261038e5760e4356001600160401b0381116103b757610291903690600401611c3c565b909161029b612246565b60fb546001600160a01b039586169516851480156103a1575b6102bd90611dbf565b60405163325fc6b360e11b60208201526102eb816102dd60248201612173565b03601f198101835282611ce0565b853b1561039d576103336103249286946040519687958695636ea9cec960e01b8752886004880152606060248801526064870190611ff5565b92858403016044860152611dfd565b038134875af180156103925761037a575b50507f0cdd348d702bed1b3d70294ca1f3fa42dfc9405e340c0f18422372a899d306d56040518061037481612173565b0390a280f35b61038390611cb2565b61038e57815f610344565b5080fd5b6040513d84823e3d90fd5b8480fd5b5084845260fc602052604084205460ff166102b4565b8280fd5b50346101a75760203660031901126101a7576103d5611c9c565b6103dd612246565b60fb54906001600160a01b0390818316610434571680916103ff821515611dbf565b6001600160a01b0319161760fb557fa3912ed02eb1b413d168965ca8a1bdd05b17ce5109e0e2772b39b2e3c462584e8280a280f35b60405162461bcd60e51b81526020600482015260166024820152754475706c696361746520696e6974206761746577617960501b6044820152606490fd5b5060031960603682011261038e57610488611c9c565b9082610492611d70565b6044356001600160401b0381116103b7576104b1903690600401611c3c565b91906104bb612246565b60fb546001600160a01b039687169695906104da908716881415611dbf565b86855260fc602052604085209560ff8754161515968415159788036104fd578680f35b8461051a61054b96610559939060ff801983541691151516179055565b6040516319b25add60e01b60208201526001600160a01b038b16602482015290151560448201529485906064820190565b03601f198101865285611ce0565b60fb541690813b156105f85785936105996103249260405197889687958695636ea9cec960e01b87528a6004880152606060248801526064870190611ff5565b039134905af18015610392576105e4575b505060207fbae3fb4185e3c244debc44dd226c9d9aee337e81f81d3ccbe6fdee6be9674d8591604051908152a25f80828180808080808680f35b6105ed90611cb2565b6103b757825f6105aa565b8580fd5b50346101a757806003193601126101a75760fb546040516001600160a01b039091168152602090f35b50346101a757806003193601126101a75760fd5460408051600f83810b825260809390931d90920b602083015290f35b0390f35b50346101a757806003193601126101a7576033546040516001600160a01b039091168152602090f35b5060031960803682011261038e57610698611c9c565b90602435906001600160a01b039081831683036107f5576044359182151583036107f55785916064356001600160401b0381116107db576106dd903690600401611c3c565b9190926106e8612246565b8060fb5416971696871480156107df575b61070290611dbf565b604051634623c91d60e01b60208201526001600160a01b0387166024820152851515604482015261073681606481016102dd565b873b1561039d5761076f6103249286946040519687958695636ea9cec960e01b8752886004880152606060248801526064870190611ff5565b038134895af18015610392576107c7575b5050604080516001600160a01b03909316835290151560208301527fe3bb8fe434ed9b5f953f777a1c4519fe4bb733bbda54941b661bef594f3b691a919081908101610374565b6107d090611cb2565b6107db57835f610780565b8380fd5b5086845260fc602052604084205460ff166106f9565b5f80fd5b5060031960803682011261038e5761080f611c9c565b906001600160401b03906024356044358381116105f857610834903690600401611c3c565b9093606435818111610af05761084e903690600401611c3c565b946108576121f0565b338952602095610100875261087260ff60408c205416611e1d565b60405187810190878252604080820152610895816102dd8c8a6060840191611dfd565b51902060fb546001600160a01b039a8b169a919082168b03610a015760fd5480600f0b809160801d600f0b13156109ef576108ff91815f5260fe8b5260405f20915f8354935560016001600160801b031960fd541691016001600160801b03161760fd5514612127565b8589019460408a8703126109eb5789359182168092036107f5578b95898b01359182116109e757610931918b01611d52565b81865260fc895261094860ff604088205416611fa9565b6109528834611e57565b823b156109e7578861098d889661032496604051998a9889978896636ea9cec960e01b88526004880152606060248801526064870190611ff5565b03925af18015610392576109d3575b50505f805160206124a2833981519152936109c8915b6040805195869586528501526040840191611dfd565b0390a2600160c95580f35b6109dc90611cb2565b6105f857855f61099c565b8680fd5b8b80fd5b604051631ed9509560e11b8152600490fd5b9450909150888a5260fc8752610a1d60ff60408c2054166120db565b888a5260ff875260408a20805480600f0b809160801d600f0b13156109ef578b95610a7792825f52600181018b5260405f20925f8454945560016001600160801b031983541691016001600160801b031617905514612127565b60fb5416610a858634611e57565b90803b1561039d5788869288610ab3889660405198899788968795636ea9cec960e01b875260048701611e78565b03925af1801561039257610adc575b50505f805160206124a2833981519152936109c8916109b2565b610ae590611cb2565b6105f857855f610ac2565b8780fd5b50346101a75760203660031901126101a75760209060ff906040906001600160a01b03610b1f611c9c565b16815261010084522054166040519015158152f35b50346101a757806003193601126101a757805460ff8160081c161590818092610c6f575b8015610c58575b15610bfc5760ff198116600117835581610beb575b50610b8560ff835460081c166122e6565b610b8e3361229e565b815490610ba960ff8360081c16610ba4816122e6565b6122e6565b600160c955610bb6575080f35b61ff00191681557f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb3847402498602060405160018152a180f35b61ffff19166101011782555f610b74565b60405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201526d191e481a5b9a5d1a585b1a5e995960921b6064820152608490fd5b50303b158015610b5f5750600160ff821614610b5f565b50600160ff821610610b58565b507f6c3543130e60b15dd1f1f886e61a65ec337da34b356e078fcfe585b5578f39ef610d3c610caa36611c69565b9290610cb7833414611d7f565b6040519360209485810190858252604080820152610cdd816102dd606082018688611dfd565b51902060fb54336001600160a01b0390911603610d425760fd5460801d9081600f0b5f5260fe875260405f20556001600160801b0360fd549160018219910160801b1691161760fd556040805195869586528501526040840191611dfd565b0390a180f35b33885260fc8652610d5960ff60408a2054166120db565b33885260ff86526040882090815460801d9081600f0b5f5260018301885260405f20556001600160801b0382549160018219910160801b1691161790556109b2565b50346101a75760203660031901126101a75760209060ff906040906001600160a01b03610dc6611c9c565b16815260fc84522054166040519015158152f35b50346101a757806003193601126101a757610df3612246565b603380546001600160a01b031981169091555f906001600160a01b03167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e08280a380f35b50346101a757806003193601126101a7577f0000000000000000000000007a0bb4805ecb7fd3c8dabbe4afa0e91cb1761e346001600160a01b03163003610e8f5760206040515f805160206124c28339815191528152f35b60405162461bcd60e51b815260206004820152603860248201527f555550535570677261646561626c653a206d757374206e6f742062652063616c60448201527f6c6564207468726f7567682064656c656761746563616c6c00000000000000006064820152608490fd5b50346101a75760403660031901126101a757610f14611c9c565b60fb54602480359390926001600160a01b039081169216820361105e57505060fd5490600f82900b6001600160ff1b038411611009575f8482019485129112908015821691151617610ff65782600f0b928303610fa2575060801d600f0b811215610f90575f5260fe602052602060405f20545b604051908152f35b604051632d0483c560e21b8152600490fd5b60849060276040519162461bcd60e51b8352602060048401528201527f53616665436173743a2076616c756520646f65736e27742066697420696e20316044820152663238206269747360c81b6064820152fd5b634e487b7160e01b5f9081526011600452fd5b60405162461bcd60e51b8152602060048201526028818401527f53616665436173743a2076616c756520646f65736e27742066697420696e2061604482015267371034b73a191a9b60c11b6064820152608490fd5b90815260ff6020526040902080549091600f82900b6001600160ff1b038511611009575f8582019586129112908015821691151617610ff65783600f0b938403610fa2575060801d600f0b821215610f90576001915f5201602052602060405f2054610f88565b5060403660031901126101a7576110da611c9c565b6024356001600160401b0381116103b7576110f9903690600401611d52565b6001600160a01b037f0000000000000000000000007a0bb4805ecb7fd3c8dabbe4afa0e91cb1761e34811692919061113330851415612019565b61114f5f805160206124c283398151915294828654161461207a565b611157612246565b7f4910fdfa16fed3260ed0e7147f7cc6da11a60208b5b9406d12a635614ffd91435460ff161561118d5750506101509150612375565b82919216604051936352d1902d60e01b85526020948581600481865afa5f9181611327575b506112135760405162461bcd60e51b815260048101879052602e60248201527f45524331393637557067726164653a206e657720696d706c656d656e7461746960448201526d6f6e206973206e6f74205555505360901b6064820152608490fd5b949394036112d05761122482612375565b7fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b5f80a28251158015906112c8575b61125e575b50505080f35b5f806112bf946040519461127186611cc5565b602786527f416464726573733a206c6f772d6c6576656c2064656c65676174652063616c6c81870152660819985a5b195960ca1b604087015281519101845af46112b9612346565b91612404565b505f8080611258565b506001611253565b60405162461bcd60e51b815260048101849052602960248201527f45524331393637557067726164653a20756e737570706f727465642070726f786044820152681a58589b195555525160ba1b6064820152608490fd5b9091508681813d831161134f575b61133f8183611ce0565b810103126107f55751905f6111b2565b503d611335565b50346101a75760203660031901126101a757610655906040906001600160a01b0361137f611c9c565b16815260ff60205220546040519181839260801d90600f0b839092916020906040830194600f0b8352600f0b910152565b50346101a75760208060031936011261038e576113cb611c9c565b6001600160a01b037f0000000000000000000000007a0bb4805ecb7fd3c8dabbe4afa0e91cb1761e3481169061140330831415612019565b61141f5f805160206124c283398151915292828454161461207a565b611427612246565b60405191848301918383106001600160401b03841117611640578260405286845260ff7f4910fdfa16fed3260ed0e7147f7cc6da11a60208b5b9406d12a635614ffd914354165f1461148157505050506101509150612375565b84939416906040516352d1902d60e01b81528681600481865afa5f9181611611575b506115045760405162461bcd60e51b815260048101889052602e60248201527f45524331393637557067726164653a206e657720696d706c656d656e7461746960448201526d6f6e206973206e6f74205555505360901b6064820152608490fd5b959495036115ba5761151583612375565b7fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b5f80a28351158015906115b3575b611550575b5050505080f35b5f80916115a9957f416464726573733a206c6f772d6c6576656c2064656c65676174652063616c6c6040519661158588611cc5565b60278852870152660819985a5b195960ca1b60408701525190845af46112b9612346565b505f808080611549565b505f611544565b60405162461bcd60e51b815260048101859052602960248201527f45524331393637557067726164653a20756e737570706f727465642070726f786044820152681a58589b195555525160ba1b6064820152608490fd5b9091508781813d8311611639575b6116298183611ce0565b810103126107f55751905f6114a3565b503d61161f565b634e487b7160e01b5f52604160045260245ffd5b5060c03660031901126107f557611669611c9c565b6024356001600160401b0381116107f557611688903690600401611c3c565b90916044356001600160a01b03811681036107f5576084356001600160401b0381116107f5576116bc903690600401611c3c565b91909260a4356001600160401b0381116107f5576116e1611712913690600401611c3c565b9790966116ec6121f0565b335f5261010060205261170560ff60405f205416611e1d565b60016101025d3691611d1c565b906040519060408201928284106001600160401b03851117611640575f809161177495604052601e85527f416464726573733a206c6f772d6c6576656c2063616c6c206661696c65640000602086015260208151910182855af16112b9612346565b506101015c604051602081019060018060a01b038416825260643560408201526060808201526117ac816102dd60808201888a611dfd565b51902003611b2a5760fb546001600160a01b0390811691168103611a735750816117dc916117e594930190611ea4565b92810190611ea4565b81519080518203611a2e578392839290835b8281106118905750505050906064350361185657340361181a575b600160c95580f35b60405162461bcd60e51b8152602060048201526014602482015273496e76616c69642073656e64206d73672066656560601b6044820152606490fd5b60405162461bcd60e51b8152602060048201526012602482015271496e76616c69642063616c6c2076616c756560701b6044820152606490fd5b61189a8183611f3b565b51906118a68186611f3b565b51968251830192606081850312611a2a576020810151938a906001600160a01b038616860361038e576040830151926060810151906001600160401b0382116107db5760206118fb9281879501920101611f63565b6001600160a01b038716835260fc60205260408320549094906119209060ff16611fa9565b01988a518b0160408c8203126103b75760208c01519b6040810151906001600160401b03821161039d57602061195c928f948201920101611f63565b91019a6001600160a01b0387163b156103b7576119b583918593604051948580948193636ea9cec960e01b8352836004840152606060248401526119a3606484018d611ff5565b83810360031901604485015290611ff5565b0392016001600160a01b038b165af1801561039257611a16575b505060408051918252602082018190526001946001600160a01b0316925f805160206124a283398151915292918291611a0a91830190611ff5565b0390a2019493946117f7565b611a1f90611cb2565b611a2a57895f6119cf565b8980fd5b60405162461bcd60e51b815260206004820152601d60248201527f496e76616c696420666f727761726420706172616d73206c656e6774680000006044820152606490fd5b93909192611a8360643534611e57565b91853b156107f557604051636ea9cec960e01b8152925f92849283918291611ab391898b60643560048701611e78565b0391885af18015611b1f57611afb575b50905f805160206124a283398151915291611af36040519283926064358452604060208501526040840191611dfd565b0390a2611812565b5f805160206124a283398151915292919450611b1690611cb2565b5f939091611ac3565b6040513d5f823e3d90fd5b60405162461bcd60e51b815260206004820152601760248201527f496e636f72726563742066696e616c697a6520646174610000000000000000006044820152606490fd5b611b7836611c69565b611b83833414611d7f565b60fb546001600160a01b031633148015611c24575b611ba190611dbf565b60016101025c03611bdf57611bd6906102dd604051938492602084019633885260408501526060808501526080840191611dfd565b5190206101015d005b60405162461bcd60e51b815260206004820152601960248201527f436c61696d206e6f742066726f6d2061726269747261746f72000000000000006044820152606490fd5b50335f90815260fc602052604090205460ff16611b98565b9181601f840112156107f5578235916001600160401b0383116107f557602083818601950101116107f557565b9060406003198301126107f55760043591602435906001600160401b0382116107f557611c9891600401611c3c565b9091565b600435906001600160a01b03821682036107f557565b6001600160401b03811161164057604052565b606081019081106001600160401b0382111761164057604052565b90601f801991011681019081106001600160401b0382111761164057604052565b6001600160401b03811161164057601f01601f191660200190565b929192611d2882611d01565b91611d366040519384611ce0565b8294818452818301116107f5578281602093845f960137010152565b9080601f830112156107f557816020611d6d93359101611d1c565b90565b6024359081151582036107f557565b15611d8657565b60405162461bcd60e51b8152602060048201526011602482015270496e76616c6964206d73672076616c756560781b6044820152606490fd5b15611dc657565b60405162461bcd60e51b815260206004820152600f60248201526e496e76616c6964206761746577617960881b6044820152606490fd5b908060209392818452848401375f828201840152601f01601f1916010190565b15611e2457565b60405162461bcd60e51b815260206004820152600b60248201526a2737ba103932b630bcb2b960a91b6044820152606490fd5b91908201809211611e6457565b634e487b7160e01b5f52601160045260245ffd5b9391611d6d9593611e96928652606060208701526060860191611dfd565b926040818503910152611dfd565b9060209081838203126107f55782356001600160401b03938482116107f5570181601f820112156107f557803593808511611640578460051b9060405195611eee86840188611ce0565b86528480870192840101938085116107f557858401925b858410611f16575050505050505090565b83358381116107f5578791611f30848480948a0101611d52565b815201930192611f05565b8051821015611f4f5760209160051b010190565b634e487b7160e01b5f52603260045260245ffd5b81601f820112156107f557805190611f7a82611d01565b92611f886040519485611ce0565b828452602083830101116107f557815f9260208093018386015e8301015290565b15611fb057565b60405162461bcd60e51b815260206004820152601f60248201527f496e76616c6964207365636f6e6461727920636861696e2067617465776179006044820152606490fd5b805180835260209291819084018484015e5f828201840152601f01601f1916010190565b1561202057565b60405162461bcd60e51b815260206004820152602c60248201527f46756e6374696f6e206d7573742062652063616c6c6564207468726f7567682060448201526b19195b1959d85d1958d85b1b60a21b6064820152608490fd5b1561208157565b60405162461bcd60e51b815260206004820152602c60248201527f46756e6374696f6e206d7573742062652063616c6c6564207468726f7567682060448201526b6163746976652070726f787960a01b6064820152608490fd5b156120e257565b60405162461bcd60e51b815260206004820152601b60248201527f4e6f74207365636f6e6461727920636861696e206761746577617900000000006044820152606490fd5b1561212e57565b60405162461bcd60e51b815260206004820152601d60248201527f496e76616c69642066696e616c697a65206d65737361676520686173680000006044820152606490fd5b9060c082019160243560028110156107f557815260443563ffffffff908181168091036107f55760208301526064358181168091036107f55760408301526084358181168091036107f557606083015260a4359081168091036107f557608082015260c435906001600160401b0382168092036107f55760a00152565b600260c9541461220157600260c955565b60405162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c006044820152606490fd5b6033546001600160a01b0316330361225a57565b606460405162461bcd60e51b815260206004820152602060248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152fd5b603380546001600160a01b039283166001600160a01b0319821681179092559091167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e05f80a3565b156122ed57565b60405162461bcd60e51b815260206004820152602b60248201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960448201526a6e697469616c697a696e6760a81b6064820152608490fd5b3d15612370573d9061235782611d01565b916123656040519384611ce0565b82523d5f602084013e565b606090565b803b156123a9575f805160206124c283398151915280546001600160a01b0319166001600160a01b03909216919091179055565b60405162461bcd60e51b815260206004820152602d60248201527f455243313936373a206e657720696d706c656d656e746174696f6e206973206e60448201526c1bdd08184818dbdb9d1c9858dd609a1b6064820152608490fd5b919290156124665750815115612418575090565b3b156124215790565b60405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e74726163740000006044820152606490fd5b8251909150156124795750805190602001fd5b60405162461bcd60e51b81526020600482015290819061249d906024830190611ff5565b0390fdfeb03d059fe6d82de9cf91969df2cc829dcb772fa79e8518cbb4c1f370f4c7f011360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbca2646970667358221220ccf769c0117e8ab6669e5c991ca8c8af6fc240f3e2567041d9be5075588147fb64736f6c63430008190033","optimization_enabled":true,"verified_twin_address_hash":null,"is_verified":true,"compiler_settings":{"compilationTarget":{"contracts/Arbitrator.sol":"Arbitrator"},"evmVersion":"cancun","libraries":{},"metadata":{"bytecodeHash":"ipfs"},"optimizer":{"enabled":true,"runs":200},"remappings":[],"viaIR":true},"optimization_runs":200,"sourcify_repo_url":null,"decoded_constructor_args":null,"compiler_version":"0.8.25+commit.b61c2a91","is_verified_via_verifier_alliance":true,"verified_at":"2024-05-25T20:51:59.213382Z","implementations":[],"proxy_type":null,"external_libraries":[],"creation_bytecode":"0x60a0806040523460d657306080525f549060ff8260081c166084575060ff80821603604b575b60405161251790816100db8239608051818181610e4a0152818161110301526113d50152f35b60ff90811916175f557f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb3847402498602060405160ff8152a15f6025565b62461bcd60e51b815260206004820152602760248201527f496e697469616c697a61626c653a20636f6e747261637420697320696e697469604482015266616c697a696e6760c81b6064820152608490fd5b5f80fdfe60806040526004361015610011575f80fd5b5f803560e01c806304291b5614611b6f5780633532e712146116545780633659cfe6146113b05780633e1c2bcd146113565780634f1ef286146110c5578063512c91df14610efa57806352d1902d14610e375780635300f84114610af4578063715018a614610dda57806373a2218714610d9b57806373f3fe2514610c7c5780638129fc1c14610b3457806383a9f7fc14610af45780638c124d90146107f95780638d57acd0146106825780638da5cb5b1461065957806394bf41de1461062557806394fa9598146105fc5780639885441214610472578063aa9c9ffc146103bb578063d457d5551461024d578063ecd8dc3a146101aa5763f2fde38b14610117575f80fd5b346101a75760203660031901126101a757610130611c9c565b610138612246565b6001600160a01b03811615610153576101509061229e565b80f35b60405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608490fd5b80fd5b50346101a75760403660031901126101a7576101c4611c9c565b6101cc611d70565b906101d5612246565b6001600160a01b0316808352610100602052604083208054919290918115159060ff161515819003610205578480f35b61023e6020927fe783a071195fae2dfbfd4f01d98ca8422e6aa745b183caed1e2958472cbf370f949060ff801983541691151516179055565b604051908152a25f8080808480f35b506003196101003682011261038e5781610265611c9c565b9160c036602319011261038e5760e4356001600160401b0381116103b757610291903690600401611c3c565b909161029b612246565b60fb546001600160a01b039586169516851480156103a1575b6102bd90611dbf565b60405163325fc6b360e11b60208201526102eb816102dd60248201612173565b03601f198101835282611ce0565b853b1561039d576103336103249286946040519687958695636ea9cec960e01b8752886004880152606060248801526064870190611ff5565b92858403016044860152611dfd565b038134875af180156103925761037a575b50507f0cdd348d702bed1b3d70294ca1f3fa42dfc9405e340c0f18422372a899d306d56040518061037481612173565b0390a280f35b61038390611cb2565b61038e57815f610344565b5080fd5b6040513d84823e3d90fd5b8480fd5b5084845260fc602052604084205460ff166102b4565b8280fd5b50346101a75760203660031901126101a7576103d5611c9c565b6103dd612246565b60fb54906001600160a01b0390818316610434571680916103ff821515611dbf565b6001600160a01b0319161760fb557fa3912ed02eb1b413d168965ca8a1bdd05b17ce5109e0e2772b39b2e3c462584e8280a280f35b60405162461bcd60e51b81526020600482015260166024820152754475706c696361746520696e6974206761746577617960501b6044820152606490fd5b5060031960603682011261038e57610488611c9c565b9082610492611d70565b6044356001600160401b0381116103b7576104b1903690600401611c3c565b91906104bb612246565b60fb546001600160a01b039687169695906104da908716881415611dbf565b86855260fc602052604085209560ff8754161515968415159788036104fd578680f35b8461051a61054b96610559939060ff801983541691151516179055565b6040516319b25add60e01b60208201526001600160a01b038b16602482015290151560448201529485906064820190565b03601f198101865285611ce0565b60fb541690813b156105f85785936105996103249260405197889687958695636ea9cec960e01b87528a6004880152606060248801526064870190611ff5565b039134905af18015610392576105e4575b505060207fbae3fb4185e3c244debc44dd226c9d9aee337e81f81d3ccbe6fdee6be9674d8591604051908152a25f80828180808080808680f35b6105ed90611cb2565b6103b757825f6105aa565b8580fd5b50346101a757806003193601126101a75760fb546040516001600160a01b039091168152602090f35b50346101a757806003193601126101a75760fd5460408051600f83810b825260809390931d90920b602083015290f35b0390f35b50346101a757806003193601126101a7576033546040516001600160a01b039091168152602090f35b5060031960803682011261038e57610698611c9c565b90602435906001600160a01b039081831683036107f5576044359182151583036107f55785916064356001600160401b0381116107db576106dd903690600401611c3c565b9190926106e8612246565b8060fb5416971696871480156107df575b61070290611dbf565b604051634623c91d60e01b60208201526001600160a01b0387166024820152851515604482015261073681606481016102dd565b873b1561039d5761076f6103249286946040519687958695636ea9cec960e01b8752886004880152606060248801526064870190611ff5565b038134895af18015610392576107c7575b5050604080516001600160a01b03909316835290151560208301527fe3bb8fe434ed9b5f953f777a1c4519fe4bb733bbda54941b661bef594f3b691a919081908101610374565b6107d090611cb2565b6107db57835f610780565b8380fd5b5086845260fc602052604084205460ff166106f9565b5f80fd5b5060031960803682011261038e5761080f611c9c565b906001600160401b03906024356044358381116105f857610834903690600401611c3c565b9093606435818111610af05761084e903690600401611c3c565b946108576121f0565b338952602095610100875261087260ff60408c205416611e1d565b60405187810190878252604080820152610895816102dd8c8a6060840191611dfd565b51902060fb546001600160a01b039a8b169a919082168b03610a015760fd5480600f0b809160801d600f0b13156109ef576108ff91815f5260fe8b5260405f20915f8354935560016001600160801b031960fd541691016001600160801b03161760fd5514612127565b8589019460408a8703126109eb5789359182168092036107f5578b95898b01359182116109e757610931918b01611d52565b81865260fc895261094860ff604088205416611fa9565b6109528834611e57565b823b156109e7578861098d889661032496604051998a9889978896636ea9cec960e01b88526004880152606060248801526064870190611ff5565b03925af18015610392576109d3575b50505f805160206124a2833981519152936109c8915b6040805195869586528501526040840191611dfd565b0390a2600160c95580f35b6109dc90611cb2565b6105f857855f61099c565b8680fd5b8b80fd5b604051631ed9509560e11b8152600490fd5b9450909150888a5260fc8752610a1d60ff60408c2054166120db565b888a5260ff875260408a20805480600f0b809160801d600f0b13156109ef578b95610a7792825f52600181018b5260405f20925f8454945560016001600160801b031983541691016001600160801b031617905514612127565b60fb5416610a858634611e57565b90803b1561039d5788869288610ab3889660405198899788968795636ea9cec960e01b875260048701611e78565b03925af1801561039257610adc575b50505f805160206124a2833981519152936109c8916109b2565b610ae590611cb2565b6105f857855f610ac2565b8780fd5b50346101a75760203660031901126101a75760209060ff906040906001600160a01b03610b1f611c9c565b16815261010084522054166040519015158152f35b50346101a757806003193601126101a757805460ff8160081c161590818092610c6f575b8015610c58575b15610bfc5760ff198116600117835581610beb575b50610b8560ff835460081c166122e6565b610b8e3361229e565b815490610ba960ff8360081c16610ba4816122e6565b6122e6565b600160c955610bb6575080f35b61ff00191681557f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb3847402498602060405160018152a180f35b61ffff19166101011782555f610b74565b60405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201526d191e481a5b9a5d1a585b1a5e995960921b6064820152608490fd5b50303b158015610b5f5750600160ff821614610b5f565b50600160ff821610610b58565b507f6c3543130e60b15dd1f1f886e61a65ec337da34b356e078fcfe585b5578f39ef610d3c610caa36611c69565b9290610cb7833414611d7f565b6040519360209485810190858252604080820152610cdd816102dd606082018688611dfd565b51902060fb54336001600160a01b0390911603610d425760fd5460801d9081600f0b5f5260fe875260405f20556001600160801b0360fd549160018219910160801b1691161760fd556040805195869586528501526040840191611dfd565b0390a180f35b33885260fc8652610d5960ff60408a2054166120db565b33885260ff86526040882090815460801d9081600f0b5f5260018301885260405f20556001600160801b0382549160018219910160801b1691161790556109b2565b50346101a75760203660031901126101a75760209060ff906040906001600160a01b03610dc6611c9c565b16815260fc84522054166040519015158152f35b50346101a757806003193601126101a757610df3612246565b603380546001600160a01b031981169091555f906001600160a01b03167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e08280a380f35b50346101a757806003193601126101a7577f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03163003610e8f5760206040515f805160206124c28339815191528152f35b60405162461bcd60e51b815260206004820152603860248201527f555550535570677261646561626c653a206d757374206e6f742062652063616c60448201527f6c6564207468726f7567682064656c656761746563616c6c00000000000000006064820152608490fd5b50346101a75760403660031901126101a757610f14611c9c565b60fb54602480359390926001600160a01b039081169216820361105e57505060fd5490600f82900b6001600160ff1b038411611009575f8482019485129112908015821691151617610ff65782600f0b928303610fa2575060801d600f0b811215610f90575f5260fe602052602060405f20545b604051908152f35b604051632d0483c560e21b8152600490fd5b60849060276040519162461bcd60e51b8352602060048401528201527f53616665436173743a2076616c756520646f65736e27742066697420696e20316044820152663238206269747360c81b6064820152fd5b634e487b7160e01b5f9081526011600452fd5b60405162461bcd60e51b8152602060048201526028818401527f53616665436173743a2076616c756520646f65736e27742066697420696e2061604482015267371034b73a191a9b60c11b6064820152608490fd5b90815260ff6020526040902080549091600f82900b6001600160ff1b038511611009575f8582019586129112908015821691151617610ff65783600f0b938403610fa2575060801d600f0b821215610f90576001915f5201602052602060405f2054610f88565b5060403660031901126101a7576110da611c9c565b6024356001600160401b0381116103b7576110f9903690600401611d52565b6001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000811692919061113330851415612019565b61114f5f805160206124c283398151915294828654161461207a565b611157612246565b7f4910fdfa16fed3260ed0e7147f7cc6da11a60208b5b9406d12a635614ffd91435460ff161561118d5750506101509150612375565b82919216604051936352d1902d60e01b85526020948581600481865afa5f9181611327575b506112135760405162461bcd60e51b815260048101879052602e60248201527f45524331393637557067726164653a206e657720696d706c656d656e7461746960448201526d6f6e206973206e6f74205555505360901b6064820152608490fd5b949394036112d05761122482612375565b7fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b5f80a28251158015906112c8575b61125e575b50505080f35b5f806112bf946040519461127186611cc5565b602786527f416464726573733a206c6f772d6c6576656c2064656c65676174652063616c6c81870152660819985a5b195960ca1b604087015281519101845af46112b9612346565b91612404565b505f8080611258565b506001611253565b60405162461bcd60e51b815260048101849052602960248201527f45524331393637557067726164653a20756e737570706f727465642070726f786044820152681a58589b195555525160ba1b6064820152608490fd5b9091508681813d831161134f575b61133f8183611ce0565b810103126107f55751905f6111b2565b503d611335565b50346101a75760203660031901126101a757610655906040906001600160a01b0361137f611c9c565b16815260ff60205220546040519181839260801d90600f0b839092916020906040830194600f0b8352600f0b910152565b50346101a75760208060031936011261038e576113cb611c9c565b6001600160a01b037f000000000000000000000000000000000000000000000000000000000000000081169061140330831415612019565b61141f5f805160206124c283398151915292828454161461207a565b611427612246565b60405191848301918383106001600160401b03841117611640578260405286845260ff7f4910fdfa16fed3260ed0e7147f7cc6da11a60208b5b9406d12a635614ffd914354165f1461148157505050506101509150612375565b84939416906040516352d1902d60e01b81528681600481865afa5f9181611611575b506115045760405162461bcd60e51b815260048101889052602e60248201527f45524331393637557067726164653a206e657720696d706c656d656e7461746960448201526d6f6e206973206e6f74205555505360901b6064820152608490fd5b959495036115ba5761151583612375565b7fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b5f80a28351158015906115b3575b611550575b5050505080f35b5f80916115a9957f416464726573733a206c6f772d6c6576656c2064656c65676174652063616c6c6040519661158588611cc5565b60278852870152660819985a5b195960ca1b60408701525190845af46112b9612346565b505f808080611549565b505f611544565b60405162461bcd60e51b815260048101859052602960248201527f45524331393637557067726164653a20756e737570706f727465642070726f786044820152681a58589b195555525160ba1b6064820152608490fd5b9091508781813d8311611639575b6116298183611ce0565b810103126107f55751905f6114a3565b503d61161f565b634e487b7160e01b5f52604160045260245ffd5b5060c03660031901126107f557611669611c9c565b6024356001600160401b0381116107f557611688903690600401611c3c565b90916044356001600160a01b03811681036107f5576084356001600160401b0381116107f5576116bc903690600401611c3c565b91909260a4356001600160401b0381116107f5576116e1611712913690600401611c3c565b9790966116ec6121f0565b335f5261010060205261170560ff60405f205416611e1d565b60016101025d3691611d1c565b906040519060408201928284106001600160401b03851117611640575f809161177495604052601e85527f416464726573733a206c6f772d6c6576656c2063616c6c206661696c65640000602086015260208151910182855af16112b9612346565b506101015c604051602081019060018060a01b038416825260643560408201526060808201526117ac816102dd60808201888a611dfd565b51902003611b2a5760fb546001600160a01b0390811691168103611a735750816117dc916117e594930190611ea4565b92810190611ea4565b81519080518203611a2e578392839290835b8281106118905750505050906064350361185657340361181a575b600160c95580f35b60405162461bcd60e51b8152602060048201526014602482015273496e76616c69642073656e64206d73672066656560601b6044820152606490fd5b60405162461bcd60e51b8152602060048201526012602482015271496e76616c69642063616c6c2076616c756560701b6044820152606490fd5b61189a8183611f3b565b51906118a68186611f3b565b51968251830192606081850312611a2a576020810151938a906001600160a01b038616860361038e576040830151926060810151906001600160401b0382116107db5760206118fb9281879501920101611f63565b6001600160a01b038716835260fc60205260408320549094906119209060ff16611fa9565b01988a518b0160408c8203126103b75760208c01519b6040810151906001600160401b03821161039d57602061195c928f948201920101611f63565b91019a6001600160a01b0387163b156103b7576119b583918593604051948580948193636ea9cec960e01b8352836004840152606060248401526119a3606484018d611ff5565b83810360031901604485015290611ff5565b0392016001600160a01b038b165af1801561039257611a16575b505060408051918252602082018190526001946001600160a01b0316925f805160206124a283398151915292918291611a0a91830190611ff5565b0390a2019493946117f7565b611a1f90611cb2565b611a2a57895f6119cf565b8980fd5b60405162461bcd60e51b815260206004820152601d60248201527f496e76616c696420666f727761726420706172616d73206c656e6774680000006044820152606490fd5b93909192611a8360643534611e57565b91853b156107f557604051636ea9cec960e01b8152925f92849283918291611ab391898b60643560048701611e78565b0391885af18015611b1f57611afb575b50905f805160206124a283398151915291611af36040519283926064358452604060208501526040840191611dfd565b0390a2611812565b5f805160206124a283398151915292919450611b1690611cb2565b5f939091611ac3565b6040513d5f823e3d90fd5b60405162461bcd60e51b815260206004820152601760248201527f496e636f72726563742066696e616c697a6520646174610000000000000000006044820152606490fd5b611b7836611c69565b611b83833414611d7f565b60fb546001600160a01b031633148015611c24575b611ba190611dbf565b60016101025c03611bdf57611bd6906102dd604051938492602084019633885260408501526060808501526080840191611dfd565b5190206101015d005b60405162461bcd60e51b815260206004820152601960248201527f436c61696d206e6f742066726f6d2061726269747261746f72000000000000006044820152606490fd5b50335f90815260fc602052604090205460ff16611b98565b9181601f840112156107f5578235916001600160401b0383116107f557602083818601950101116107f557565b9060406003198301126107f55760043591602435906001600160401b0382116107f557611c9891600401611c3c565b9091565b600435906001600160a01b03821682036107f557565b6001600160401b03811161164057604052565b606081019081106001600160401b0382111761164057604052565b90601f801991011681019081106001600160401b0382111761164057604052565b6001600160401b03811161164057601f01601f191660200190565b929192611d2882611d01565b91611d366040519384611ce0565b8294818452818301116107f5578281602093845f960137010152565b9080601f830112156107f557816020611d6d93359101611d1c565b90565b6024359081151582036107f557565b15611d8657565b60405162461bcd60e51b8152602060048201526011602482015270496e76616c6964206d73672076616c756560781b6044820152606490fd5b15611dc657565b60405162461bcd60e51b815260206004820152600f60248201526e496e76616c6964206761746577617960881b6044820152606490fd5b908060209392818452848401375f828201840152601f01601f1916010190565b15611e2457565b60405162461bcd60e51b815260206004820152600b60248201526a2737ba103932b630bcb2b960a91b6044820152606490fd5b91908201809211611e6457565b634e487b7160e01b5f52601160045260245ffd5b9391611d6d9593611e96928652606060208701526060860191611dfd565b926040818503910152611dfd565b9060209081838203126107f55782356001600160401b03938482116107f5570181601f820112156107f557803593808511611640578460051b9060405195611eee86840188611ce0565b86528480870192840101938085116107f557858401925b858410611f16575050505050505090565b83358381116107f5578791611f30848480948a0101611d52565b815201930192611f05565b8051821015611f4f5760209160051b010190565b634e487b7160e01b5f52603260045260245ffd5b81601f820112156107f557805190611f7a82611d01565b92611f886040519485611ce0565b828452602083830101116107f557815f9260208093018386015e8301015290565b15611fb057565b60405162461bcd60e51b815260206004820152601f60248201527f496e76616c6964207365636f6e6461727920636861696e2067617465776179006044820152606490fd5b805180835260209291819084018484015e5f828201840152601f01601f1916010190565b1561202057565b60405162461bcd60e51b815260206004820152602c60248201527f46756e6374696f6e206d7573742062652063616c6c6564207468726f7567682060448201526b19195b1959d85d1958d85b1b60a21b6064820152608490fd5b1561208157565b60405162461bcd60e51b815260206004820152602c60248201527f46756e6374696f6e206d7573742062652063616c6c6564207468726f7567682060448201526b6163746976652070726f787960a01b6064820152608490fd5b156120e257565b60405162461bcd60e51b815260206004820152601b60248201527f4e6f74207365636f6e6461727920636861696e206761746577617900000000006044820152606490fd5b1561212e57565b60405162461bcd60e51b815260206004820152601d60248201527f496e76616c69642066696e616c697a65206d65737361676520686173680000006044820152606490fd5b9060c082019160243560028110156107f557815260443563ffffffff908181168091036107f55760208301526064358181168091036107f55760408301526084358181168091036107f557606083015260a4359081168091036107f557608082015260c435906001600160401b0382168092036107f55760a00152565b600260c9541461220157600260c955565b60405162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c006044820152606490fd5b6033546001600160a01b0316330361225a57565b606460405162461bcd60e51b815260206004820152602060248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152fd5b603380546001600160a01b039283166001600160a01b0319821681179092559091167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e05f80a3565b156122ed57565b60405162461bcd60e51b815260206004820152602b60248201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960448201526a6e697469616c697a696e6760a81b6064820152608490fd5b3d15612370573d9061235782611d01565b916123656040519384611ce0565b82523d5f602084013e565b606090565b803b156123a9575f805160206124c283398151915280546001600160a01b0319166001600160a01b03909216919091179055565b60405162461bcd60e51b815260206004820152602d60248201527f455243313936373a206e657720696d706c656d656e746174696f6e206973206e60448201526c1bdd08184818dbdb9d1c9858dd609a1b6064820152608490fd5b919290156124665750815115612418575090565b3b156124215790565b60405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e74726163740000006044820152606490fd5b8251909150156124795750805190602001fd5b60405162461bcd60e51b81526020600482015290819061249d906024830190611ff5565b0390fdfeb03d059fe6d82de9cf91969df2cc829dcb772fa79e8518cbb4c1f370f4c7f011360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbca2646970667358221220ccf769c0117e8ab6669e5c991ca8c8af6fc240f3e2567041d9be5075588147fb64736f6c63430008190033","name":"Arbitrator","is_blueprint":false,"license_type":"none","is_fully_verified":true,"is_verified_via_eth_bytecode_db":true,"language":"solidity","evm_version":"cancun","can_be_visualized_via_sol2uml":true,"is_verified_via_sourcify":false,"additional_sources":[{"file_path":"@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol","source_code":"// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.9.0) (access/Ownable.sol)\n\npragma solidity ^0.8.0;\n\nimport \"../utils/ContextUpgradeable.sol\";\nimport {Initializable} from \"../proxy/utils/Initializable.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 OwnableUpgradeable is Initializable, ContextUpgradeable {\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    function __Ownable_init() internal onlyInitializing {\n        __Ownable_init_unchained();\n    }\n\n    function __Ownable_init_unchained() internal onlyInitializing {\n        _transferOwnership(_msgSender());\n    }\n\n    /**\n     * @dev Throws if called by any account other than the owner.\n     */\n    modifier onlyOwner() {\n        _checkOwner();\n        _;\n    }\n\n    /**\n     * @dev Returns the address of the current owner.\n     */\n    function owner() public view virtual returns (address) {\n        return _owner;\n    }\n\n    /**\n     * @dev Throws if the sender is not the owner.\n     */\n    function _checkOwner() internal view virtual {\n        require(owner() == _msgSender(), \"Ownable: caller is not the owner\");\n    }\n\n    /**\n     * @dev Leaves the contract without owner. It will not be possible to call\n     * `onlyOwner` functions. Can only be called by the current owner.\n     *\n     * NOTE: Renouncing ownership will leave the contract without an owner,\n     * thereby disabling any functionality that is only available to the owner.\n     */\n    function renounceOwnership() public virtual onlyOwner {\n        _transferOwnership(address(0));\n    }\n\n    /**\n     * @dev Transfers ownership of the contract to a new account (`newOwner`).\n     * Can only be called by the current owner.\n     */\n    function transferOwnership(address newOwner) public virtual onlyOwner {\n        require(newOwner != address(0), \"Ownable: new owner is the zero address\");\n        _transferOwnership(newOwner);\n    }\n\n    /**\n     * @dev Transfers ownership of the contract to a new account (`newOwner`).\n     * Internal function without access restriction.\n     */\n    function _transferOwnership(address newOwner) internal virtual {\n        address oldOwner = _owner;\n        _owner = newOwner;\n        emit OwnershipTransferred(oldOwner, newOwner);\n    }\n\n    /**\n     * @dev This empty reserved space is put in place to allow future versions to add new\n     * variables without shifting down storage in the inheritance chain.\n     * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps\n     */\n    uint256[49] private __gap;\n}\n"},{"file_path":"@openzeppelin/contracts-upgradeable/interfaces/IERC1967Upgradeable.sol","source_code":"// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.9.0) (interfaces/IERC1967.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @dev ERC-1967: Proxy Storage Slots. This interface contains the events defined in the ERC.\n *\n * _Available since v4.8.3._\n */\ninterface IERC1967Upgradeable {\n    /**\n     * @dev Emitted when the implementation is upgraded.\n     */\n    event Upgraded(address indexed implementation);\n\n    /**\n     * @dev Emitted when the admin account has changed.\n     */\n    event AdminChanged(address previousAdmin, address newAdmin);\n\n    /**\n     * @dev Emitted when the beacon is changed.\n     */\n    event BeaconUpgraded(address indexed beacon);\n}\n"},{"file_path":"@openzeppelin/contracts-upgradeable/interfaces/draft-IERC1822Upgradeable.sol","source_code":"// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.5.0) (interfaces/draft-IERC1822.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @dev ERC1822: Universal Upgradeable Proxy Standard (UUPS) documents a method for upgradeability through a simplified\n * proxy whose upgrades are fully controlled by the current implementation.\n */\ninterface IERC1822ProxiableUpgradeable {\n    /**\n     * @dev Returns the storage slot that the proxiable contract assumes is being used to store the implementation\n     * address.\n     *\n     * IMPORTANT: A proxy pointing at a proxiable contract should not be considered proxiable itself, because this risks\n     * bricking a proxy that upgrades to it, by delegating to itself until out of gas. Thus it is critical that this\n     * function revert if invoked through a proxy.\n     */\n    function proxiableUUID() external view returns (bytes32);\n}\n"},{"file_path":"@openzeppelin/contracts-upgradeable/proxy/ERC1967/ERC1967UpgradeUpgradeable.sol","source_code":"// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.9.0) (proxy/ERC1967/ERC1967Upgrade.sol)\n\npragma solidity ^0.8.2;\n\nimport \"../beacon/IBeaconUpgradeable.sol\";\nimport \"../../interfaces/IERC1967Upgradeable.sol\";\nimport \"../../interfaces/draft-IERC1822Upgradeable.sol\";\nimport \"../../utils/AddressUpgradeable.sol\";\nimport \"../../utils/StorageSlotUpgradeable.sol\";\nimport {Initializable} from \"../utils/Initializable.sol\";\n\n/**\n * @dev This abstract contract provides getters and event emitting update functions for\n * https://eips.ethereum.org/EIPS/eip-1967[EIP1967] slots.\n *\n * _Available since v4.1._\n */\nabstract contract ERC1967UpgradeUpgradeable is Initializable, IERC1967Upgradeable {\n    // This is the keccak-256 hash of \"eip1967.proxy.rollback\" subtracted by 1\n    bytes32 private constant _ROLLBACK_SLOT = 0x4910fdfa16fed3260ed0e7147f7cc6da11a60208b5b9406d12a635614ffd9143;\n\n    /**\n     * @dev Storage slot with the address of the current implementation.\n     * This is the keccak-256 hash of \"eip1967.proxy.implementation\" subtracted by 1, and is\n     * validated in the constructor.\n     */\n    bytes32 internal constant _IMPLEMENTATION_SLOT = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc;\n\n    function __ERC1967Upgrade_init() internal onlyInitializing {\n    }\n\n    function __ERC1967Upgrade_init_unchained() internal onlyInitializing {\n    }\n    /**\n     * @dev Returns the current implementation address.\n     */\n    function _getImplementation() internal view returns (address) {\n        return StorageSlotUpgradeable.getAddressSlot(_IMPLEMENTATION_SLOT).value;\n    }\n\n    /**\n     * @dev Stores a new address in the EIP1967 implementation slot.\n     */\n    function _setImplementation(address newImplementation) private {\n        require(AddressUpgradeable.isContract(newImplementation), \"ERC1967: new implementation is not a contract\");\n        StorageSlotUpgradeable.getAddressSlot(_IMPLEMENTATION_SLOT).value = newImplementation;\n    }\n\n    /**\n     * @dev Perform implementation upgrade\n     *\n     * Emits an {Upgraded} event.\n     */\n    function _upgradeTo(address newImplementation) internal {\n        _setImplementation(newImplementation);\n        emit Upgraded(newImplementation);\n    }\n\n    /**\n     * @dev Perform implementation upgrade with additional setup call.\n     *\n     * Emits an {Upgraded} event.\n     */\n    function _upgradeToAndCall(address newImplementation, bytes memory data, bool forceCall) internal {\n        _upgradeTo(newImplementation);\n        if (data.length > 0 || forceCall) {\n            AddressUpgradeable.functionDelegateCall(newImplementation, data);\n        }\n    }\n\n    /**\n     * @dev Perform implementation upgrade with security checks for UUPS proxies, and additional setup call.\n     *\n     * Emits an {Upgraded} event.\n     */\n    function _upgradeToAndCallUUPS(address newImplementation, bytes memory data, bool forceCall) internal {\n        // Upgrades from old implementations will perform a rollback test. This test requires the new\n        // implementation to upgrade back to the old, non-ERC1822 compliant, implementation. Removing\n        // this special case will break upgrade paths from old UUPS implementation to new ones.\n        if (StorageSlotUpgradeable.getBooleanSlot(_ROLLBACK_SLOT).value) {\n            _setImplementation(newImplementation);\n        } else {\n            try IERC1822ProxiableUpgradeable(newImplementation).proxiableUUID() returns (bytes32 slot) {\n                require(slot == _IMPLEMENTATION_SLOT, \"ERC1967Upgrade: unsupported proxiableUUID\");\n            } catch {\n                revert(\"ERC1967Upgrade: new implementation is not UUPS\");\n            }\n            _upgradeToAndCall(newImplementation, data, forceCall);\n        }\n    }\n\n    /**\n     * @dev Storage slot with the admin of the contract.\n     * This is the keccak-256 hash of \"eip1967.proxy.admin\" subtracted by 1, and is\n     * validated in the constructor.\n     */\n    bytes32 internal constant _ADMIN_SLOT = 0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103;\n\n    /**\n     * @dev Returns the current admin.\n     */\n    function _getAdmin() internal view returns (address) {\n        return StorageSlotUpgradeable.getAddressSlot(_ADMIN_SLOT).value;\n    }\n\n    /**\n     * @dev Stores a new address in the EIP1967 admin slot.\n     */\n    function _setAdmin(address newAdmin) private {\n        require(newAdmin != address(0), \"ERC1967: new admin is the zero address\");\n        StorageSlotUpgradeable.getAddressSlot(_ADMIN_SLOT).value = newAdmin;\n    }\n\n    /**\n     * @dev Changes the admin of the proxy.\n     *\n     * Emits an {AdminChanged} event.\n     */\n    function _changeAdmin(address newAdmin) internal {\n        emit AdminChanged(_getAdmin(), newAdmin);\n        _setAdmin(newAdmin);\n    }\n\n    /**\n     * @dev The storage slot of the UpgradeableBeacon contract which defines the implementation for this proxy.\n     * This is bytes32(uint256(keccak256('eip1967.proxy.beacon')) - 1)) and is validated in the constructor.\n     */\n    bytes32 internal constant _BEACON_SLOT = 0xa3f0ad74e5423aebfd80d3ef4346578335a9a72aeaee59ff6cb3582b35133d50;\n\n    /**\n     * @dev Returns the current beacon.\n     */\n    function _getBeacon() internal view returns (address) {\n        return StorageSlotUpgradeable.getAddressSlot(_BEACON_SLOT).value;\n    }\n\n    /**\n     * @dev Stores a new beacon in the EIP1967 beacon slot.\n     */\n    function _setBeacon(address newBeacon) private {\n        require(AddressUpgradeable.isContract(newBeacon), \"ERC1967: new beacon is not a contract\");\n        require(\n            AddressUpgradeable.isContract(IBeaconUpgradeable(newBeacon).implementation()),\n            \"ERC1967: beacon implementation is not a contract\"\n        );\n        StorageSlotUpgradeable.getAddressSlot(_BEACON_SLOT).value = newBeacon;\n    }\n\n    /**\n     * @dev Perform beacon upgrade with additional setup call. Note: This upgrades the address of the beacon, it does\n     * not upgrade the implementation contained in the beacon (see {UpgradeableBeacon-_setImplementation} for that).\n     *\n     * Emits a {BeaconUpgraded} event.\n     */\n    function _upgradeBeaconToAndCall(address newBeacon, bytes memory data, bool forceCall) internal {\n        _setBeacon(newBeacon);\n        emit BeaconUpgraded(newBeacon);\n        if (data.length > 0 || forceCall) {\n            AddressUpgradeable.functionDelegateCall(IBeaconUpgradeable(newBeacon).implementation(), data);\n        }\n    }\n\n    /**\n     * @dev This empty reserved space is put in place to allow future versions to add new\n     * variables without shifting down storage in the inheritance chain.\n     * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps\n     */\n    uint256[50] private __gap;\n}\n"},{"file_path":"@openzeppelin/contracts-upgradeable/proxy/beacon/IBeaconUpgradeable.sol","source_code":"// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (proxy/beacon/IBeacon.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @dev This is the interface that {BeaconProxy} expects of its beacon.\n */\ninterface IBeaconUpgradeable {\n    /**\n     * @dev Must return an address that can be used as a delegate call target.\n     *\n     * {BeaconProxy} will check that this address is a contract.\n     */\n    function implementation() external view returns (address);\n}\n"},{"file_path":"@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol","source_code":"// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.9.0) (proxy/utils/Initializable.sol)\n\npragma solidity ^0.8.2;\n\nimport \"../../utils/AddressUpgradeable.sol\";\n\n/**\n * @dev This is a base contract to aid in writing upgradeable contracts, or any kind of contract that will be deployed\n * behind a proxy. Since proxied contracts do not make use of a constructor, it's common to move constructor logic to an\n * external initializer function, usually called `initialize`. It then becomes necessary to protect this initializer\n * function so it can only be called once. The {initializer} modifier provided by this contract will have this effect.\n *\n * The initialization functions use a version number. Once a version number is used, it is consumed and cannot be\n * reused. This mechanism prevents re-execution of each \"step\" but allows the creation of new initialization steps in\n * case an upgrade adds a module that needs to be initialized.\n *\n * For example:\n *\n * [.hljs-theme-light.nopadding]\n * ```solidity\n * contract MyToken is ERC20Upgradeable {\n *     function initialize() initializer public {\n *         __ERC20_init(\"MyToken\", \"MTK\");\n *     }\n * }\n *\n * contract MyTokenV2 is MyToken, ERC20PermitUpgradeable {\n *     function initializeV2() reinitializer(2) public {\n *         __ERC20Permit_init(\"MyToken\");\n *     }\n * }\n * ```\n *\n * TIP: To avoid leaving the proxy in an uninitialized state, the initializer function should be called as early as\n * possible by providing the encoded function call as the `_data` argument to {ERC1967Proxy-constructor}.\n *\n * CAUTION: When used with inheritance, manual care must be taken to not invoke a parent initializer twice, or to ensure\n * that all initializers are idempotent. This is not verified automatically as constructors are by Solidity.\n *\n * [CAUTION]\n * ====\n * Avoid leaving a contract uninitialized.\n *\n * An uninitialized contract can be taken over by an attacker. This applies to both a proxy and its implementation\n * contract, which may impact the proxy. To prevent the implementation contract from being used, you should invoke\n * the {_disableInitializers} function in the constructor to automatically lock it when it is deployed:\n *\n * [.hljs-theme-light.nopadding]\n * ```\n * /// @custom:oz-upgrades-unsafe-allow constructor\n * constructor() {\n *     _disableInitializers();\n * }\n * ```\n * ====\n */\nabstract contract Initializable {\n    /**\n     * @dev Indicates that the contract has been initialized.\n     * @custom:oz-retyped-from bool\n     */\n    uint8 private _initialized;\n\n    /**\n     * @dev Indicates that the contract is in the process of being initialized.\n     */\n    bool private _initializing;\n\n    /**\n     * @dev Triggered when the contract has been initialized or reinitialized.\n     */\n    event Initialized(uint8 version);\n\n    /**\n     * @dev A modifier that defines a protected initializer function that can be invoked at most once. In its scope,\n     * `onlyInitializing` functions can be used to initialize parent contracts.\n     *\n     * Similar to `reinitializer(1)`, except that functions marked with `initializer` can be nested in the context of a\n     * constructor.\n     *\n     * Emits an {Initialized} event.\n     */\n    modifier initializer() {\n        bool isTopLevelCall = !_initializing;\n        require(\n            (isTopLevelCall && _initialized < 1) || (!AddressUpgradeable.isContract(address(this)) && _initialized == 1),\n            \"Initializable: contract is already initialized\"\n        );\n        _initialized = 1;\n        if (isTopLevelCall) {\n            _initializing = true;\n        }\n        _;\n        if (isTopLevelCall) {\n            _initializing = false;\n            emit Initialized(1);\n        }\n    }\n\n    /**\n     * @dev A modifier that defines a protected reinitializer function that can be invoked at most once, and only if the\n     * contract hasn't been initialized to a greater version before. In its scope, `onlyInitializing` functions can be\n     * used to initialize parent contracts.\n     *\n     * A reinitializer may be used after the original initialization step. This is essential to configure modules that\n     * are added through upgrades and that require initialization.\n     *\n     * When `version` is 1, this modifier is similar to `initializer`, except that functions marked with `reinitializer`\n     * cannot be nested. If one is invoked in the context of another, execution will revert.\n     *\n     * Note that versions can jump in increments greater than 1; this implies that if multiple reinitializers coexist in\n     * a contract, executing them in the right order is up to the developer or operator.\n     *\n     * WARNING: setting the version to 255 will prevent any future reinitialization.\n     *\n     * Emits an {Initialized} event.\n     */\n    modifier reinitializer(uint8 version) {\n        require(!_initializing && _initialized < version, \"Initializable: contract is already initialized\");\n        _initialized = version;\n        _initializing = true;\n        _;\n        _initializing = false;\n        emit Initialized(version);\n    }\n\n    /**\n     * @dev Modifier to protect an initialization function so that it can only be invoked by functions with the\n     * {initializer} and {reinitializer} modifiers, directly or indirectly.\n     */\n    modifier onlyInitializing() {\n        require(_initializing, \"Initializable: contract is not initializing\");\n        _;\n    }\n\n    /**\n     * @dev Locks the contract, preventing any future reinitialization. This cannot be part of an initializer call.\n     * Calling this in the constructor of a contract will prevent that contract from being initialized or reinitialized\n     * to any version. It is recommended to use this to lock implementation contracts that are designed to be called\n     * through proxies.\n     *\n     * Emits an {Initialized} event the first time it is successfully executed.\n     */\n    function _disableInitializers() internal virtual {\n        require(!_initializing, \"Initializable: contract is initializing\");\n        if (_initialized != type(uint8).max) {\n            _initialized = type(uint8).max;\n            emit Initialized(type(uint8).max);\n        }\n    }\n\n    /**\n     * @dev Returns the highest version that has been initialized. See {reinitializer}.\n     */\n    function _getInitializedVersion() internal view returns (uint8) {\n        return _initialized;\n    }\n\n    /**\n     * @dev Returns `true` if the contract is currently initializing. See {onlyInitializing}.\n     */\n    function _isInitializing() internal view returns (bool) {\n        return _initializing;\n    }\n}\n"},{"file_path":"@openzeppelin/contracts-upgradeable/proxy/utils/UUPSUpgradeable.sol","source_code":"// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.9.0) (proxy/utils/UUPSUpgradeable.sol)\n\npragma solidity ^0.8.0;\n\nimport \"../../interfaces/draft-IERC1822Upgradeable.sol\";\nimport \"../ERC1967/ERC1967UpgradeUpgradeable.sol\";\nimport {Initializable} from \"./Initializable.sol\";\n\n/**\n * @dev An upgradeability mechanism designed for UUPS proxies. The functions included here can perform an upgrade of an\n * {ERC1967Proxy}, when this contract is set as the implementation behind such a proxy.\n *\n * A security mechanism ensures that an upgrade does not turn off upgradeability accidentally, although this risk is\n * reinstated if the upgrade retains upgradeability but removes the security mechanism, e.g. by replacing\n * `UUPSUpgradeable` with a custom implementation of upgrades.\n *\n * The {_authorizeUpgrade} function must be overridden to include access restriction to the upgrade mechanism.\n *\n * _Available since v4.1._\n */\nabstract contract UUPSUpgradeable is Initializable, IERC1822ProxiableUpgradeable, ERC1967UpgradeUpgradeable {\n    /// @custom:oz-upgrades-unsafe-allow state-variable-immutable state-variable-assignment\n    address private immutable __self = address(this);\n\n    /**\n     * @dev Check that the execution is being performed through a delegatecall call and that the execution context is\n     * a proxy contract with an implementation (as defined in ERC1967) pointing to self. This should only be the case\n     * for UUPS and transparent proxies that are using the current contract as their implementation. Execution of a\n     * function through ERC1167 minimal proxies (clones) would not normally pass this test, but is not guaranteed to\n     * fail.\n     */\n    modifier onlyProxy() {\n        require(address(this) != __self, \"Function must be called through delegatecall\");\n        require(_getImplementation() == __self, \"Function must be called through active proxy\");\n        _;\n    }\n\n    /**\n     * @dev Check that the execution is not being performed through a delegate call. This allows a function to be\n     * callable on the implementing contract but not through proxies.\n     */\n    modifier notDelegated() {\n        require(address(this) == __self, \"UUPSUpgradeable: must not be called through delegatecall\");\n        _;\n    }\n\n    function __UUPSUpgradeable_init() internal onlyInitializing {\n    }\n\n    function __UUPSUpgradeable_init_unchained() internal onlyInitializing {\n    }\n    /**\n     * @dev Implementation of the ERC1822 {proxiableUUID} function. This returns the storage slot used by the\n     * implementation. It is used to validate the implementation's compatibility when performing an upgrade.\n     *\n     * IMPORTANT: A proxy pointing at a proxiable contract should not be considered proxiable itself, because this risks\n     * bricking a proxy that upgrades to it, by delegating to itself until out of gas. Thus it is critical that this\n     * function revert if invoked through a proxy. This is guaranteed by the `notDelegated` modifier.\n     */\n    function proxiableUUID() external view virtual override notDelegated returns (bytes32) {\n        return _IMPLEMENTATION_SLOT;\n    }\n\n    /**\n     * @dev Upgrade the implementation of the proxy to `newImplementation`.\n     *\n     * Calls {_authorizeUpgrade}.\n     *\n     * Emits an {Upgraded} event.\n     *\n     * @custom:oz-upgrades-unsafe-allow-reachable delegatecall\n     */\n    function upgradeTo(address newImplementation) public virtual onlyProxy {\n        _authorizeUpgrade(newImplementation);\n        _upgradeToAndCallUUPS(newImplementation, new bytes(0), false);\n    }\n\n    /**\n     * @dev Upgrade the implementation of the proxy to `newImplementation`, and subsequently execute the function call\n     * encoded in `data`.\n     *\n     * Calls {_authorizeUpgrade}.\n     *\n     * Emits an {Upgraded} event.\n     *\n     * @custom:oz-upgrades-unsafe-allow-reachable delegatecall\n     */\n    function upgradeToAndCall(address newImplementation, bytes memory data) public payable virtual onlyProxy {\n        _authorizeUpgrade(newImplementation);\n        _upgradeToAndCallUUPS(newImplementation, data, true);\n    }\n\n    /**\n     * @dev Function that should revert when `msg.sender` is not authorized to upgrade the contract. Called by\n     * {upgradeTo} and {upgradeToAndCall}.\n     *\n     * Normally, this function will use an xref:access.adoc[access control] modifier such as {Ownable-onlyOwner}.\n     *\n     * ```solidity\n     * function _authorizeUpgrade(address) internal override onlyOwner {}\n     * ```\n     */\n    function _authorizeUpgrade(address newImplementation) internal virtual;\n\n    /**\n     * @dev This empty reserved space is put in place to allow future versions to add new\n     * variables without shifting down storage in the inheritance chain.\n     * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps\n     */\n    uint256[50] private __gap;\n}\n"},{"file_path":"@openzeppelin/contracts-upgradeable/security/ReentrancyGuardUpgradeable.sol","source_code":"// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.9.0) (security/ReentrancyGuard.sol)\n\npragma solidity ^0.8.0;\nimport {Initializable} from \"../proxy/utils/Initializable.sol\";\n\n/**\n * @dev Contract module that helps prevent reentrant calls to a function.\n *\n * Inheriting from `ReentrancyGuard` will make the {nonReentrant} modifier\n * available, which can be applied to functions to make sure there are no nested\n * (reentrant) calls to them.\n *\n * Note that because there is a single `nonReentrant` guard, functions marked as\n * `nonReentrant` may not call one another. This can be worked around by making\n * those functions `private`, and then adding `external` `nonReentrant` entry\n * points to them.\n *\n * TIP: If you would like to learn more about reentrancy and alternative ways\n * to protect against it, check out our blog post\n * https://blog.openzeppelin.com/reentrancy-after-istanbul/[Reentrancy After Istanbul].\n */\nabstract contract ReentrancyGuardUpgradeable is Initializable {\n    // Booleans are more expensive than uint256 or any type that takes up a full\n    // word because each write operation emits an extra SLOAD to first read the\n    // slot's contents, replace the bits taken up by the boolean, and then write\n    // back. This is the compiler's defense against contract upgrades and\n    // pointer aliasing, and it cannot be disabled.\n\n    // The values being non-zero value makes deployment a bit more expensive,\n    // but in exchange the refund on every call to nonReentrant will be lower in\n    // amount. Since refunds are capped to a percentage of the total\n    // transaction's gas, it is best to keep them low in cases like this one, to\n    // increase the likelihood of the full refund coming into effect.\n    uint256 private constant _NOT_ENTERED = 1;\n    uint256 private constant _ENTERED = 2;\n\n    uint256 private _status;\n\n    function __ReentrancyGuard_init() internal onlyInitializing {\n        __ReentrancyGuard_init_unchained();\n    }\n\n    function __ReentrancyGuard_init_unchained() internal onlyInitializing {\n        _status = _NOT_ENTERED;\n    }\n\n    /**\n     * @dev Prevents a contract from calling itself, directly or indirectly.\n     * Calling a `nonReentrant` function from another `nonReentrant`\n     * function is not supported. It is possible to prevent this from happening\n     * by making the `nonReentrant` function external, and making it call a\n     * `private` function that does the actual work.\n     */\n    modifier nonReentrant() {\n        _nonReentrantBefore();\n        _;\n        _nonReentrantAfter();\n    }\n\n    function _nonReentrantBefore() private {\n        // On the first call to nonReentrant, _status will be _NOT_ENTERED\n        require(_status != _ENTERED, \"ReentrancyGuard: reentrant call\");\n\n        // Any calls to nonReentrant after this point will fail\n        _status = _ENTERED;\n    }\n\n    function _nonReentrantAfter() private {\n        // By storing the original value once again, a refund is triggered (see\n        // https://eips.ethereum.org/EIPS/eip-2200)\n        _status = _NOT_ENTERED;\n    }\n\n    /**\n     * @dev Returns true if the reentrancy guard is currently set to \"entered\", which indicates there is a\n     * `nonReentrant` function in the call stack.\n     */\n    function _reentrancyGuardEntered() internal view returns (bool) {\n        return _status == _ENTERED;\n    }\n\n    /**\n     * @dev This empty reserved space is put in place to allow future versions to add new\n     * variables without shifting down storage in the inheritance chain.\n     * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps\n     */\n    uint256[49] private __gap;\n}\n"},{"file_path":"@openzeppelin/contracts-upgradeable/utils/AddressUpgradeable.sol","source_code":"// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.9.0) (utils/Address.sol)\n\npragma solidity ^0.8.1;\n\n/**\n * @dev Collection of functions related to the address type\n */\nlibrary AddressUpgradeable {\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     * Furthermore, `isContract` will also return true if the target contract within\n     * the same transaction is already scheduled for destruction by `SELFDESTRUCT`,\n     * which only has an effect at the end of a transaction.\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://consensys.net/diligence/blog/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.8.0/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(address target, bytes memory data, uint256 value) 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"},{"file_path":"@openzeppelin/contracts-upgradeable/utils/ContextUpgradeable.sol","source_code":"// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.9.4) (utils/Context.sol)\n\npragma solidity ^0.8.0;\nimport {Initializable} from \"../proxy/utils/Initializable.sol\";\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 ContextUpgradeable is Initializable {\n    function __Context_init() internal onlyInitializing {\n    }\n\n    function __Context_init_unchained() internal onlyInitializing {\n    }\n    function _msgSender() internal view virtual returns (address) {\n        return msg.sender;\n    }\n\n    function _msgData() internal view virtual returns (bytes calldata) {\n        return msg.data;\n    }\n\n    function _contextSuffixLength() internal view virtual returns (uint256) {\n        return 0;\n    }\n\n    /**\n     * @dev This empty reserved space is put in place to allow future versions to add new\n     * variables without shifting down storage in the inheritance chain.\n     * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps\n     */\n    uint256[50] private __gap;\n}\n"},{"file_path":"@openzeppelin/contracts-upgradeable/utils/StorageSlotUpgradeable.sol","source_code":"// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.9.0) (utils/StorageSlot.sol)\n// This file was procedurally generated from scripts/generate/templates/StorageSlot.js.\n\npragma solidity ^0.8.0;\n\n/**\n * @dev Library for reading and writing primitive types to specific storage slots.\n *\n * Storage slots are often used to avoid storage conflict when dealing with upgradeable contracts.\n * This library helps with reading and writing to such slots without the need for inline assembly.\n *\n * The functions in this library return Slot structs that contain a `value` member that can be used to read or write.\n *\n * Example usage to set ERC1967 implementation slot:\n * ```solidity\n * contract ERC1967 {\n *     bytes32 internal constant _IMPLEMENTATION_SLOT = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc;\n *\n *     function _getImplementation() internal view returns (address) {\n *         return StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value;\n *     }\n *\n *     function _setImplementation(address newImplementation) internal {\n *         require(Address.isContract(newImplementation), \"ERC1967: new implementation is not a contract\");\n *         StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value = newImplementation;\n *     }\n * }\n * ```\n *\n * _Available since v4.1 for `address`, `bool`, `bytes32`, `uint256`._\n * _Available since v4.9 for `string`, `bytes`._\n */\nlibrary StorageSlotUpgradeable {\n    struct AddressSlot {\n        address value;\n    }\n\n    struct BooleanSlot {\n        bool value;\n    }\n\n    struct Bytes32Slot {\n        bytes32 value;\n    }\n\n    struct Uint256Slot {\n        uint256 value;\n    }\n\n    struct StringSlot {\n        string value;\n    }\n\n    struct BytesSlot {\n        bytes value;\n    }\n\n    /**\n     * @dev Returns an `AddressSlot` with member `value` located at `slot`.\n     */\n    function getAddressSlot(bytes32 slot) internal pure returns (AddressSlot storage r) {\n        /// @solidity memory-safe-assembly\n        assembly {\n            r.slot := slot\n        }\n    }\n\n    /**\n     * @dev Returns an `BooleanSlot` with member `value` located at `slot`.\n     */\n    function getBooleanSlot(bytes32 slot) internal pure returns (BooleanSlot storage r) {\n        /// @solidity memory-safe-assembly\n        assembly {\n            r.slot := slot\n        }\n    }\n\n    /**\n     * @dev Returns an `Bytes32Slot` with member `value` located at `slot`.\n     */\n    function getBytes32Slot(bytes32 slot) internal pure returns (Bytes32Slot storage r) {\n        /// @solidity memory-safe-assembly\n        assembly {\n            r.slot := slot\n        }\n    }\n\n    /**\n     * @dev Returns an `Uint256Slot` with member `value` located at `slot`.\n     */\n    function getUint256Slot(bytes32 slot) internal pure returns (Uint256Slot storage r) {\n        /// @solidity memory-safe-assembly\n        assembly {\n            r.slot := slot\n        }\n    }\n\n    /**\n     * @dev Returns an `StringSlot` with member `value` located at `slot`.\n     */\n    function getStringSlot(bytes32 slot) internal pure returns (StringSlot storage r) {\n        /// @solidity memory-safe-assembly\n        assembly {\n            r.slot := slot\n        }\n    }\n\n    /**\n     * @dev Returns an `StringSlot` representation of the string storage pointer `store`.\n     */\n    function getStringSlot(string storage store) internal pure returns (StringSlot storage r) {\n        /// @solidity memory-safe-assembly\n        assembly {\n            r.slot := store.slot\n        }\n    }\n\n    /**\n     * @dev Returns an `BytesSlot` with member `value` located at `slot`.\n     */\n    function getBytesSlot(bytes32 slot) internal pure returns (BytesSlot storage r) {\n        /// @solidity memory-safe-assembly\n        assembly {\n            r.slot := slot\n        }\n    }\n\n    /**\n     * @dev Returns an `BytesSlot` representation of the bytes storage pointer `store`.\n     */\n    function getBytesSlot(bytes storage store) internal pure returns (BytesSlot storage r) {\n        /// @solidity memory-safe-assembly\n        assembly {\n            r.slot := store.slot\n        }\n    }\n}\n"},{"file_path":"@openzeppelin/contracts-upgradeable/utils/math/SafeCastUpgradeable.sol","source_code":"// 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 SafeCastUpgradeable {\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"},{"file_path":"@openzeppelin/contracts-upgradeable/utils/structs/DoubleEndedQueueUpgradeable.sol","source_code":"// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.9.0) (utils/structs/DoubleEndedQueue.sol)\npragma solidity ^0.8.4;\n\nimport \"../math/SafeCastUpgradeable.sol\";\n\n/**\n * @dev A sequence of items with the ability to efficiently push and pop items (i.e. insert and remove) on both ends of\n * the sequence (called front and back). Among other access patterns, it can be used to implement efficient LIFO and\n * FIFO queues. Storage use is optimized, and all operations are O(1) constant time. This includes {clear}, given that\n * the existing queue contents are left in storage.\n *\n * The struct is called `Bytes32Deque`. Other types can be cast to and from `bytes32`. This data structure can only be\n * used in storage, and not in memory.\n * ```solidity\n * DoubleEndedQueue.Bytes32Deque queue;\n * ```\n *\n * _Available since v4.6._\n */\nlibrary DoubleEndedQueueUpgradeable {\n    /**\n     * @dev An operation (e.g. {front}) couldn't be completed due to the queue being empty.\n     */\n    error Empty();\n\n    /**\n     * @dev An operation (e.g. {at}) couldn't be completed due to an index being out of bounds.\n     */\n    error OutOfBounds();\n\n    /**\n     * @dev Indices are signed integers because the queue can grow in any direction. They are 128 bits so begin and end\n     * are packed in a single storage slot for efficient access. Since the items are added one at a time we can safely\n     * assume that these 128-bit indices will not overflow, and use unchecked arithmetic.\n     *\n     * Struct members have an underscore prefix indicating that they are \"private\" and should not be read or written to\n     * directly. Use the functions provided below instead. Modifying the struct manually may violate assumptions and\n     * lead to unexpected behavior.\n     *\n     * Indices are in the range [begin, end) which means the first item is at data[begin] and the last item is at\n     * data[end - 1].\n     */\n    struct Bytes32Deque {\n        int128 _begin;\n        int128 _end;\n        mapping(int128 => bytes32) _data;\n    }\n\n    /**\n     * @dev Inserts an item at the end of the queue.\n     */\n    function pushBack(Bytes32Deque storage deque, bytes32 value) internal {\n        int128 backIndex = deque._end;\n        deque._data[backIndex] = value;\n        unchecked {\n            deque._end = backIndex + 1;\n        }\n    }\n\n    /**\n     * @dev Removes the item at the end of the queue and returns it.\n     *\n     * Reverts with `Empty` if the queue is empty.\n     */\n    function popBack(Bytes32Deque storage deque) internal returns (bytes32 value) {\n        if (empty(deque)) revert Empty();\n        int128 backIndex;\n        unchecked {\n            backIndex = deque._end - 1;\n        }\n        value = deque._data[backIndex];\n        delete deque._data[backIndex];\n        deque._end = backIndex;\n    }\n\n    /**\n     * @dev Inserts an item at the beginning of the queue.\n     */\n    function pushFront(Bytes32Deque storage deque, bytes32 value) internal {\n        int128 frontIndex;\n        unchecked {\n            frontIndex = deque._begin - 1;\n        }\n        deque._data[frontIndex] = value;\n        deque._begin = frontIndex;\n    }\n\n    /**\n     * @dev Removes the item at the beginning of the queue and returns it.\n     *\n     * Reverts with `Empty` if the queue is empty.\n     */\n    function popFront(Bytes32Deque storage deque) internal returns (bytes32 value) {\n        if (empty(deque)) revert Empty();\n        int128 frontIndex = deque._begin;\n        value = deque._data[frontIndex];\n        delete deque._data[frontIndex];\n        unchecked {\n            deque._begin = frontIndex + 1;\n        }\n    }\n\n    /**\n     * @dev Returns the item at the beginning of the queue.\n     *\n     * Reverts with `Empty` if the queue is empty.\n     */\n    function front(Bytes32Deque storage deque) internal view returns (bytes32 value) {\n        if (empty(deque)) revert Empty();\n        int128 frontIndex = deque._begin;\n        return deque._data[frontIndex];\n    }\n\n    /**\n     * @dev Returns the item at the end of the queue.\n     *\n     * Reverts with `Empty` if the queue is empty.\n     */\n    function back(Bytes32Deque storage deque) internal view returns (bytes32 value) {\n        if (empty(deque)) revert Empty();\n        int128 backIndex;\n        unchecked {\n            backIndex = deque._end - 1;\n        }\n        return deque._data[backIndex];\n    }\n\n    /**\n     * @dev Return the item at a position in the queue given by `index`, with the first item at 0 and last item at\n     * `length(deque) - 1`.\n     *\n     * Reverts with `OutOfBounds` if the index is out of bounds.\n     */\n    function at(Bytes32Deque storage deque, uint256 index) internal view returns (bytes32 value) {\n        // int256(deque._begin) is a safe upcast\n        int128 idx = SafeCastUpgradeable.toInt128(int256(deque._begin) + SafeCastUpgradeable.toInt256(index));\n        if (idx >= deque._end) revert OutOfBounds();\n        return deque._data[idx];\n    }\n\n    /**\n     * @dev Resets the queue back to being empty.\n     *\n     * NOTE: The current items are left behind in storage. This does not affect the functioning of the queue, but misses\n     * out on potential gas refunds.\n     */\n    function clear(Bytes32Deque storage deque) internal {\n        deque._begin = 0;\n        deque._end = 0;\n    }\n\n    /**\n     * @dev Returns the number of items in the queue.\n     */\n    function length(Bytes32Deque storage deque) internal view returns (uint256) {\n        // The interface preserves the invariant that begin <= end so we assume this will not overflow.\n        // We also assume there are at most int256.max items in the queue.\n        unchecked {\n            return uint256(int256(deque._end) - int256(deque._begin));\n        }\n    }\n\n    /**\n     * @dev Returns true if the queue is empty.\n     */\n    function empty(Bytes32Deque storage deque) internal view returns (bool) {\n        return deque._end <= deque._begin;\n    }\n}\n"},{"file_path":"@openzeppelin/contracts/utils/Address.sol","source_code":"// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.9.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     * Furthermore, `isContract` will also return true if the target contract within\n     * the same transaction is already scheduled for destruction by `SELFDESTRUCT`,\n     * which only has an effect at the end of a transaction.\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://consensys.net/diligence/blog/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.8.0/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(address target, bytes memory data, uint256 value) 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"},{"file_path":"contracts/interfaces/IArbitrator.sol","source_code":"// SPDX-License-Identifier: MIT OR Apache-2.0\npragma solidity ^0.8.0;\n\nimport {IL1Gateway} from \"./IL1Gateway.sol\";\n\ninterface IArbitrator {\n    /// @notice Return true if relayer is active\n    function isRelayerActive(address _relayer) external view returns (bool);\n\n    /// @notice Return the primary chain gateway\n    function primaryChainGateway() external view returns (IL1Gateway);\n\n    /// @notice Enqueue message from EthereumGateway\n    /// @dev Used by EthereumGateway to temporarily store message\n    /// @param _value The msg value\n    /// @param _callData The call data\n    function enqueueMessage(uint256 _value, bytes calldata _callData) external payable;\n\n    /// @notice Deliver message from one L1 gateway to another L1 gateway\n    /// @dev Used by L1Gateways to deliver message\n    /// @param _value The msg value\n    /// @param _callData The call data\n    function receiveMessage(uint256 _value, bytes calldata _callData) external payable;\n\n    /// @notice Forward message from one L1 gateway to another L1 gateway\n    /// @param _gateway The message source gateway\n    /// @param _value The msg value\n    /// @param _callData The call data\n    /// @param _adapterParams Some params need to call canonical message service\n    function forwardMessage(\n        IL1Gateway _gateway,\n        uint256 _value,\n        bytes calldata _callData,\n        bytes calldata _adapterParams\n    ) external payable;\n\n    /// @notice Claim a message of source chain and deliver it to the target chain\n    /// @param _sourceChainCanonicalMessageService The message service to claim message\n    /// @param _sourceChainClaimCallData The call data that need to claim message from source chain\n    /// @param _sourceChainL1Gateway The msg.sender passed in the `receiveMessage` interface\n    /// @param _receiveValue The value passed in the `receiveMessage` interface\n    /// @param _receiveCallData The call data passed in the `receiveMessage` interface\n    /// @param _forwardParams Some params need to call canonical message service of target chain\n    function claimMessage(\n        address _sourceChainCanonicalMessageService,\n        bytes calldata _sourceChainClaimCallData,\n        IL1Gateway _sourceChainL1Gateway,\n        uint256 _receiveValue,\n        bytes calldata _receiveCallData,\n        bytes calldata _forwardParams\n    ) external payable;\n}\n"},{"file_path":"contracts/interfaces/IGateway.sol","source_code":"// SPDX-License-Identifier: MIT OR Apache-2.0\npragma solidity ^0.8.0;\n\ninterface IGateway {\n    /// @return Remote gateway\n    function getRemoteGateway() external view returns (address);\n}\n"},{"file_path":"contracts/interfaces/IL1Gateway.sol","source_code":"// SPDX-License-Identifier: MIT OR Apache-2.0\npragma solidity ^0.8.0;\n\nimport {IGateway} from \"./IGateway.sol\";\n\ninterface IL1Gateway is IGateway {\n    /// @notice Send message to remote gateway\n    /// @param _value The msg value\n    /// @param _callData The call data\n    /// @param _adapterParams Some params need to call canonical message service\n    function sendMessage(uint256 _value, bytes calldata _callData, bytes calldata _adapterParams) external payable;\n}\n"},{"file_path":"contracts/interfaces/IL2Gateway.sol","source_code":"// SPDX-License-Identifier: MIT OR Apache-2.0\npragma solidity ^0.8.0;\n\nimport {IGateway} from \"./IGateway.sol\";\n\ninterface IL2Gateway is IGateway {\n    /// @notice Emit when sending a message\n    event L2GatewayMessageSent(uint256 value, bytes callData);\n\n    /// @notice Send message to remote gateway\n    /// @param _value The msg value\n    /// @param _callData The call data\n    function sendMessage(uint256 _value, bytes calldata _callData) external payable;\n}\n"},{"file_path":"contracts/zksync/l1-contracts/zksync/Storage.sol","source_code":"// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\n/// @dev The log passed from L2\n/// @param l2ShardId The shard identifier, 0 - rollup, 1 - porter. All other values are not used but are reserved for\n/// the future\n/// @param isService A boolean flag that is part of the log along with `key`, `value`, and `sender` address.\n/// This field is required formally but does not have any special meaning.\n/// @param txNumberInBatch The L2 transaction number in the batch, in which the log was sent\n/// @param sender The L2 address which sent the log\n/// @param key The 32 bytes of information that was sent in the log\n/// @param value The 32 bytes of information that was sent in the log\n// Both `key` and `value` are arbitrary 32-bytes selected by the log sender\nstruct L2Log {\n    uint8 l2ShardId;\n    bool isService;\n    uint16 txNumberInBatch;\n    address sender;\n    bytes32 key;\n    bytes32 value;\n}\n\n/// @dev An arbitrary length message passed from L2\n/// @notice Under the hood it is `L2Log` sent from the special system L2 contract\n/// @param txNumberInBatch The L2 transaction number in the batch, in which the message was sent\n/// @param sender The address of the L2 account from which the message was passed\n/// @param data An arbitrary length message\nstruct L2Message {\n    uint16 txNumberInBatch;\n    address sender;\n    bytes data;\n}\n\n/// @notice The struct that describes whether users will be charged for pubdata for L1->L2 transactions.\n/// @param Rollup The users are charged for pubdata & it is priced based on the gas price on Ethereum.\n/// @param Validium The pubdata is considered free with regard to the L1 gas price.\nenum PubdataPricingMode {\n    Rollup,\n    Validium\n}\n\n/// @notice The fee params for L1->L2 transactions for the network.\n/// @param pubdataPricingMode How the users will charged for pubdata in L1->L2 transactions.\n/// @param batchOverheadL1Gas The amount of L1 gas required to process the batch (except for the calldata).\n/// @param maxPubdataPerBatch The maximal number of pubdata that can be emitted per batch.\n/// @param priorityTxMaxPubdata The maximal amount of pubdata a priority transaction is allowed to publish.\n/// It can be slightly less than maxPubdataPerBatch in order to have some margin for the bootloader execution.\n/// @param minimalL2GasPrice The minimal L2 gas price to be used by L1->L2 transactions. It should represent\n/// the price that a single unit of compute costs.\nstruct FeeParams {\n    PubdataPricingMode pubdataPricingMode;\n    uint32 batchOverheadL1Gas;\n    uint32 maxPubdataPerBatch;\n    uint32 maxL2GasPerBatch;\n    uint32 priorityTxMaxPubdata;\n    uint64 minimalL2GasPrice;\n}\n\n/// @dev The sync status for priority op of secondary chain\n/// @param hash The cumulative canonicalTxHash\n/// @param amount The cumulative l2 value\nstruct SecondaryChainSyncStatus {\n    bytes32 hash;\n    uint256 amount;\n}\n"},{"file_path":"contracts/zksync/l1-contracts/zksync/interfaces/IAdmin.sol","source_code":"// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\nimport {FeeParams} from \"../Storage.sol\";\nimport {IL2Gateway} from \"../../../../interfaces/IL2Gateway.sol\";\n\n/// @title The interface of the Admin Contract that controls access rights for contract management.\n/// @author Matter Labs\n/// @custom:security-contact security@matterlabs.dev\ninterface IAdmin {\n    /// @notice Init gateway\n    /// @param _gateway The gateway on local chain\n    function setGateway(IL2Gateway _gateway) external;\n\n    /// @notice Change validator status (active or not active)\n    /// @param _validator Validator address\n    /// @param _active Active flag\n    function setValidator(address _validator, bool _active) external;\n\n    /// @notice Change the fee params for L1->L2 transactions\n    /// @param _newFeeParams The new fee params\n    function changeFeeParams(FeeParams calldata _newFeeParams) external;\n}\n"},{"file_path":"contracts/zksync/l1-contracts/zksync/interfaces/IZkSync.sol","source_code":"// SPDX-License-Identifier: MIT OR Apache-2.0\n\npragma solidity ^0.8.0;\n\ninterface IZkSync {\n    /// @notice Update secondary chain status\n    /// @param _gateway The secondary chain gateway\n    /// @param _active Active flag\n    function setSecondaryChainGateway(address _gateway, bool _active) external;\n\n    /// @notice Receive sync status from secondary chain\n    /// @param _secondaryChainGateway The secondary chain gateway address\n    /// @param _newTotalSyncedPriorityTxs New sync point\n    /// @param _syncHash New sync hash\n    /// @param _forwardEthAmount The difference eth amount between two sync points\n    function syncL2Requests(\n        address _secondaryChainGateway,\n        uint256 _newTotalSyncedPriorityTxs,\n        bytes32 _syncHash,\n        uint256 _forwardEthAmount\n    ) external payable;\n}\n"}],"certified":false,"conflicting_implementations":null,"abi":[{"inputs":[],"stateMutability":"nonpayable","type":"constructor"},{"inputs":[],"name":"Empty","type":"error"},{"inputs":[],"name":"OutOfBounds","type":"error"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"previousAdmin","type":"address"},{"indexed":false,"internalType":"address","name":"newAdmin","type":"address"}],"name":"AdminChanged","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"beacon","type":"address"}],"name":"BeaconUpgraded","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"contract IL1Gateway","name":"gateway","type":"address"}],"name":"InitPrimaryChain","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint8","name":"version","type":"uint8"}],"name":"Initialized","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"contract IL1Gateway","name":"gateway","type":"address"},{"indexed":false,"internalType":"uint256","name":"value","type":"uint256"},{"indexed":false,"internalType":"bytes","name":"callData","type":"bytes"}],"name":"MessageForwarded","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"value","type":"uint256"},{"indexed":false,"internalType":"bytes","name":"callData","type":"bytes"}],"name":"MessageReceived","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"contract IL1Gateway","name":"gateway","type":"address"},{"components":[{"internalType":"enum PubdataPricingMode","name":"pubdataPricingMode","type":"uint8"},{"internalType":"uint32","name":"batchOverheadL1Gas","type":"uint32"},{"internalType":"uint32","name":"maxPubdataPerBatch","type":"uint32"},{"internalType":"uint32","name":"maxL2GasPerBatch","type":"uint32"},{"internalType":"uint32","name":"priorityTxMaxPubdata","type":"uint32"},{"internalType":"uint64","name":"minimalL2GasPrice","type":"uint64"}],"indexed":false,"internalType":"struct FeeParams","name":"newFeeParams","type":"tuple"}],"name":"NewFeeParams","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"relayer","type":"address"},{"indexed":false,"internalType":"bool","name":"isActive","type":"bool"}],"name":"RelayerStatusUpdate","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"contract IL1Gateway","name":"gateway","type":"address"},{"indexed":false,"internalType":"bool","name":"isActive","type":"bool"}],"name":"SecondaryChainStatusUpdate","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"implementation","type":"address"}],"name":"Upgraded","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"contract IL1Gateway","name":"gateway","type":"address"},{"indexed":false,"internalType":"address","name":"validatorAddress","type":"address"},{"indexed":false,"internalType":"bool","name":"isActive","type":"bool"}],"name":"ValidatorStatusUpdate","type":"event"},{"inputs":[{"internalType":"contract IL1Gateway","name":"_gateway","type":"address"},{"components":[{"internalType":"enum PubdataPricingMode","name":"pubdataPricingMode","type":"uint8"},{"internalType":"uint32","name":"batchOverheadL1Gas","type":"uint32"},{"internalType":"uint32","name":"maxPubdataPerBatch","type":"uint32"},{"internalType":"uint32","name":"maxL2GasPerBatch","type":"uint32"},{"internalType":"uint32","name":"priorityTxMaxPubdata","type":"uint32"},{"internalType":"uint64","name":"minimalL2GasPrice","type":"uint64"}],"internalType":"struct FeeParams","name":"_newFeeParams","type":"tuple"},{"internalType":"bytes","name":"_adapterParams","type":"bytes"}],"name":"changeFeeParams","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"address","name":"_sourceChainCanonicalMessageService","type":"address"},{"internalType":"bytes","name":"_sourceChainClaimCallData","type":"bytes"},{"internalType":"contract IL1Gateway","name":"_sourceChainL1Gateway","type":"address"},{"internalType":"uint256","name":"_receiveValue","type":"uint256"},{"internalType":"bytes","name":"_receiveCallData","type":"bytes"},{"internalType":"bytes","name":"_forwardParams","type":"bytes"}],"name":"claimMessage","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_value","type":"uint256"},{"internalType":"bytes","name":"_callData","type":"bytes"}],"name":"enqueueMessage","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"contract IL1Gateway","name":"_gateway","type":"address"},{"internalType":"uint256","name":"_value","type":"uint256"},{"internalType":"bytes","name":"_callData","type":"bytes"},{"internalType":"bytes","name":"_adapterParams","type":"bytes"}],"name":"forwardMessage","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"contract IL1Gateway","name":"_gateway","type":"address"},{"internalType":"uint256","name":"_index","type":"uint256"}],"name":"getMessageHash","outputs":[{"internalType":"bytes32","name":"messageHash","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"initialize","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_relayer","type":"address"}],"name":"isRelayerActive","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"primaryChainGateway","outputs":[{"internalType":"contract IL1Gateway","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"primaryChainMessageHashQueue","outputs":[{"internalType":"int128","name":"_begin","type":"int128"},{"internalType":"int128","name":"_end","type":"int128"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"proxiableUUID","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_value","type":"uint256"},{"internalType":"bytes","name":"_callData","type":"bytes"}],"name":"receiveMessage","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"address","name":"relayerAddress","type":"address"}],"name":"relayers","outputs":[{"internalType":"bool","name":"isRelayer","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"contract IL1Gateway","name":"","type":"address"}],"name":"secondaryChainGateways","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"contract IL1Gateway","name":"","type":"address"}],"name":"secondaryChainMessageHashQueues","outputs":[{"internalType":"int128","name":"_begin","type":"int128"},{"internalType":"int128","name":"_end","type":"int128"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"contract IL1Gateway","name":"_gateway","type":"address"}],"name":"setPrimaryChainGateway","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_relayer","type":"address"},{"internalType":"bool","name":"_active","type":"bool"}],"name":"setRelayer","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"contract IL1Gateway","name":"_gateway","type":"address"},{"internalType":"bool","name":"_active","type":"bool"},{"internalType":"bytes","name":"_adapterParams","type":"bytes"}],"name":"setSecondaryChainGateway","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"contract IL1Gateway","name":"_gateway","type":"address"},{"internalType":"address","name":"_validator","type":"address"},{"internalType":"bool","name":"_active","type":"bool"},{"internalType":"bytes","name":"_adapterParams","type":"bytes"}],"name":"setValidator","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newImplementation","type":"address"}],"name":"upgradeTo","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newImplementation","type":"address"},{"internalType":"bytes","name":"data","type":"bytes"}],"name":"upgradeToAndCall","outputs":[],"stateMutability":"payable","type":"function"}],"is_changed_bytecode":false,"is_partially_verified":false,"constructor_args":null}