creation_sourcecode: {{
    "language": "Solidity",
    "sources": {
      "contracts/bridge/L1Helper.sol": {
        "content": "// SPDX-License-Identifier: MIT\r\n\r\npragma solidity ^0.7.0;\r\npragma abicoder v2;\r\n\r\nimport \"omnibridge/contracts/helpers/WETHOmnibridgeRouter.sol\";\r\n\r\n/// @dev Extension for original WETHOmnibridgeRouter that stores ZkLockPool account registrations.\r\ncontract L1Helper is WETHOmnibridgeRouter {\r\n  event PublicKey(address indexed owner, bytes key);\r\n\r\n  struct Account {\r\n    address owner;\r\n    bytes publicKey;\r\n  }\r\n\r\n  constructor(\r\n    IOmnibridge _bridge,\r\n    IWETH _weth,\r\n    address _owner\r\n  ) WETHOmnibridgeRouter(_bridge, _weth, _owner) {}\r\n\r\n  /** @dev Registers provided public key and its owner in pool\r\n   * @param _account pair of address and key\r\n   */\r\n  function register(Account memory _account) public {\r\n    require(_account.owner == msg.sender, \"only owner can be registered\");\r\n    _register(_account);\r\n  }\r\n\r\n  /**\r\n   * @dev Wraps native assets and relays wrapped ERC20 tokens to the other chain.\r\n   * It also calls receiver on other side with the _data provided.\r\n   * @param _receiver bridged assets receiver on the other side of the bridge.\r\n   * @param _data data for the call of receiver on other side.\r\n   * @param _account ZkLockPool account data\r\n   */\r\n  function wrapAndRelayTokens(\r\n    address _receiver,\r\n    bytes memory _data,\r\n    Account memory _account\r\n  ) public payable {\r\n    WETH.deposit{ value: msg.value }();\r\n    bridge.relayTokensAndCall(address(WETH), _receiver, msg.value, _data);\r\n\r\n    if (_account.owner == msg.sender) {\r\n      _register(_account);\r\n    }\r\n  }\r\n\r\n  function _register(Account memory _account) internal {\r\n    emit PublicKey(_account.owner, _account.publicKey);\r\n  }\r\n}"
      },
      "omnibridge/contracts/helpers/WETHOmnibridgeRouter.sol": {
        "content": "pragma solidity 0.7.5;\r\n\r\nimport \"../interfaces/IOmnibridge.sol\";\r\nimport \"../interfaces/IWETH.sol\";\r\nimport \"../libraries/AddressHelper.sol\";\r\nimport \"../libraries/Bytes.sol\";\r\nimport \"../upgradeable_contracts/modules/OwnableModule.sol\";\r\nimport \"../upgradeable_contracts/Claimable.sol\";\r\n\r\n/**\r\n * @title WETHOmnibridgeRouter\r\n * @dev Omnibridge extension for processing native and wrapped native assets.\r\n * Intended to work with WETH/WBNB/WXDAI tokens, see:\r\n *   https://etherscan.io/address/0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2\r\n *   https://bscscan.com/address/0xbb4CdB9CBd36B01bD1cBaEBF2De08d9173bc095c\r\n *   https://blockscout.com/poa/xdai/address/0xe91D153E0b41518A2Ce8Dd3D7944Fa863463a97d\r\n */\r\ncontract WETHOmnibridgeRouter is OwnableModule, Claimable {\r\n    IOmnibridge public immutable bridge;\r\n    IWETH public immutable WETH;\r\n\r\n    /**\r\n     * @dev Initializes this contract.\r\n     * @param _bridge address of the HomeOmnibridge/ForeignOmnibridge contract.\r\n     * @param _weth address of the WETH token used for wrapping/unwrapping native coins (e.g. WETH/WBNB/WXDAI).\r\n     * @param _owner address of the contract owner.\r\n     */\r\n    constructor(\r\n        IOmnibridge _bridge,\r\n        IWETH _weth,\r\n        address _owner\r\n    ) OwnableModule(_owner) {\r\n        bridge = _bridge;\r\n        WETH = _weth;\r\n        _weth.approve(address(_bridge), uint256(-1));\r\n    }\r\n\r\n    /**\r\n     * @dev Wraps native assets and relays wrapped ERC20 tokens to the other chain.\r\n     * Call msg.sender will receive assets on the other side of the bridge.\r\n     */\r\n    function wrapAndRelayTokens() external payable {\r\n        wrapAndRelayTokens(msg.sender);\r\n    }\r\n\r\n    /**\r\n     * @dev Wraps native assets and relays wrapped ERC20 tokens to the other chain.\r\n     * @param _receiver bridged assets receiver on the other side of the bridge.\r\n     */\r\n    function wrapAndRelayTokens(address _receiver) public payable {\r\n        WETH.deposit{ value: msg.value }();\r\n        bridge.relayTokens(address(WETH), _receiver, msg.value);\r\n    }\r\n\r\n\r\n    /**\r\n    * @dev Wraps native assets and relays wrapped ERC20 tokens to the other chain.\r\n    * It also calls receiver on other side with the _data provided.\r\n    * @param _receiver bridged assets receiver on the other side of the bridge.\r\n    * @param _data data for the call of receiver on other side.\r\n    */\r\n    function wrapAndRelayTokens(address _receiver, bytes memory _data) public payable {\r\n        WETH.deposit{ value: msg.value }();\r\n        bridge.relayTokensAndCall(address(WETH), _receiver, msg.value, _data);\r\n    }\r\n\r\n    /**\r\n     * @dev Bridged callback function used for unwrapping received tokens.\r\n     * Can only be called by the associated Omnibridge contract.\r\n     * @param _token bridged token contract address, should be WETH.\r\n     * @param _value amount of bridged/received tokens.\r\n     * @param _data extra data passed alongside with relayTokensAndCall on the other side of the bridge.\r\n     * Should contain coins receiver address.\r\n     */\r\n    function onTokenBridged(\r\n        address _token,\r\n        uint256 _value,\r\n        bytes memory _data\r\n    ) external virtual {\r\n        require(_token == address(WETH));\r\n        require(msg.sender == address(bridge));\r\n        require(_data.length == 20);\r\n\r\n        WETH.withdraw(_value);\r\n\r\n        AddressHelper.safeSendValue(payable(Bytes.bytesToAddress(_data)), _value);\r\n    }\r\n\r\n    /**\r\n     * @dev Claims stuck coins/tokens.\r\n     * Only contract owner can call this method.\r\n     * @param _token address of claimed token contract, address(0) for native coins.\r\n     * @param _to address of tokens receiver\r\n     */\r\n    function claimTokens(address _token, address _to) external onlyOwner {\r\n        claimValues(_token, _to);\r\n    }\r\n\r\n    /**\r\n     * @dev Ether receive function.\r\n     * Should be only called from the WETH contract when withdrawing native coins. Will revert otherwise.\r\n     */\r\n    receive() external payable {\r\n        require(msg.sender == address(WETH));\r\n    }\r\n}\r\n"
      },
      "omnibridge/contracts/interfaces/IOmnibridge.sol": {
        "content": "pragma solidity 0.7.5;\r\n\r\ninterface IOmnibridge {\r\n    function relayTokens(\r\n        address _token,\r\n        address _receiver,\r\n        uint256 _value\r\n    ) external;\r\n\r\n    function relayTokensAndCall(\r\n        address token,\r\n        address _receiver,\r\n        uint256 _value,\r\n        bytes memory _data\r\n    ) external;\r\n}\r\n"
      },
      "omnibridge/contracts/interfaces/IWETH.sol": {
        "content": "pragma solidity 0.7.5;\r\n\r\ninterface IWETH {\r\n    function deposit() external payable;\r\n\r\n    function withdraw(uint256 _value) external;\r\n\r\n    function approve(address _to, uint256 _value) external;\r\n}\r\n"
      },
      "omnibridge/contracts/libraries/AddressHelper.sol": {
        "content": "pragma solidity 0.7.5;\r\n\r\nimport \"../upgradeable_contracts/Sacrifice.sol\";\r\n\r\n/**\r\n * @title AddressHelper\r\n * @dev Helper methods for Address type.\r\n */\r\nlibrary AddressHelper {\r\n    /**\r\n     * @dev Try to send native tokens to the address. If it fails, it will force the transfer by creating a selfdestruct contract\r\n     * @param _receiver address that will receive the native tokens\r\n     * @param _value the amount of native tokens to send\r\n     */\r\n    function safeSendValue(address payable _receiver, uint256 _value) internal {\r\n        if (!(_receiver).send(_value)) {\r\n            new Sacrifice{ value: _value }(_receiver);\r\n        }\r\n    }\r\n}\r\n"
      },
      "omnibridge/contracts/libraries/Bytes.sol": {
        "content": "pragma solidity 0.7.5;\r\n\r\n/**\r\n * @title Bytes\r\n * @dev Helper methods to transform bytes to other solidity types.\r\n */\r\nlibrary Bytes {\r\n    /**\r\n     * @dev Truncate bytes array if its size is more than 20 bytes.\r\n     * NOTE: This function does not perform any checks on the received parameter.\r\n     * Make sure that the _bytes argument has a correct length, not less than 20 bytes.\r\n     * A case when _bytes has length less than 20 will lead to the undefined behaviour,\r\n     * since assembly will read data from memory that is not related to the _bytes argument.\r\n     * @param _bytes to be converted to address type\r\n     * @return addr address included in the firsts 20 bytes of the bytes array in parameter.\r\n     */\r\n    function bytesToAddress(bytes memory _bytes) internal pure returns (address addr) {\r\n        assembly {\r\n            addr := mload(add(_bytes, 20))\r\n        }\r\n    }\r\n}\r\n"
      },
      "omnibridge/contracts/upgradeable_contracts/modules/OwnableModule.sol": {
        "content": "pragma solidity 0.7.5;\r\n\r\nimport \"@openzeppelin/contracts/utils/Address.sol\";\r\n\r\n/**\r\n * @title OwnableModule\r\n * @dev Common functionality for multi-token extension non-upgradeable module.\r\n */\r\ncontract OwnableModule {\r\n    address public owner;\r\n\r\n    /**\r\n     * @dev Initializes this contract.\r\n     * @param _owner address of the owner that is allowed to perform additional actions on the particular module.\r\n     */\r\n    constructor(address _owner) {\r\n        owner = _owner;\r\n    }\r\n\r\n    /**\r\n     * @dev Throws if sender is not the owner of this contract.\r\n     */\r\n    modifier onlyOwner {\r\n        require(msg.sender == owner);\r\n        _;\r\n    }\r\n\r\n    /**\r\n     * @dev Changes the owner of this contract.\r\n     * @param _newOwner address of the new owner.\r\n     */\r\n    function transferOwnership(address _newOwner) external onlyOwner {\r\n        owner = _newOwner;\r\n    }\r\n}\r\n"
      },
      "omnibridge/contracts/upgradeable_contracts/Claimable.sol": {
        "content": "pragma solidity 0.7.5;\r\n\r\nimport \"@openzeppelin/contracts/token/ERC20/SafeERC20.sol\";\r\nimport \"../libraries/AddressHelper.sol\";\r\n\r\n/**\r\n * @title Claimable\r\n * @dev Implementation of the claiming utils that can be useful for withdrawing accidentally sent tokens that are not used in bridge operations.\r\n */\r\ncontract Claimable {\r\n    using SafeERC20 for IERC20;\r\n\r\n    /**\r\n     * Throws if a given address is equal to address(0)\r\n     */\r\n    modifier validAddress(address _to) {\r\n        require(_to != address(0));\r\n        _;\r\n    }\r\n\r\n    /**\r\n     * @dev Withdraws the erc20 tokens or native coins from this contract.\r\n     * Caller should additionally check that the claimed token is not a part of bridge operations (i.e. that token != erc20token()).\r\n     * @param _token address of the claimed token or address(0) for native coins.\r\n     * @param _to address of the tokens/coins receiver.\r\n     */\r\n    function claimValues(address _token, address _to) internal validAddress(_to) {\r\n        if (_token == address(0)) {\r\n            claimNativeCoins(_to);\r\n        } else {\r\n            claimErc20Tokens(_token, _to);\r\n        }\r\n    }\r\n\r\n    /**\r\n     * @dev Internal function for withdrawing all native coins from the contract.\r\n     * @param _to address of the coins receiver.\r\n     */\r\n    function claimNativeCoins(address _to) internal {\r\n        uint256 value = address(this).balance;\r\n        AddressHelper.safeSendValue(payable(_to), value);\r\n    }\r\n\r\n    /**\r\n     * @dev Internal function for withdrawing all tokens of some particular ERC20 contract from this contract.\r\n     * @param _token address of the claimed ERC20 token.\r\n     * @param _to address of the tokens receiver.\r\n     */\r\n    function claimErc20Tokens(address _token, address _to) internal {\r\n        IERC20 token = IERC20(_token);\r\n        uint256 balance = token.balanceOf(address(this));\r\n        token.safeTransfer(_to, balance);\r\n    }\r\n}\r\n"
      },
      "omnibridge/contracts/upgradeable_contracts/Sacrifice.sol": {
        "content": "pragma solidity 0.7.5;\r\n\r\ncontract Sacrifice {\r\n    constructor(address payable _recipient) payable {\r\n        selfdestruct(_recipient);\r\n    }\r\n}\r\n"
      },
      "@openzeppelin/contracts/utils/Address.sol": {
        "content": "// SPDX-License-Identifier: MIT\r\n\r\npragma solidity ^0.7.0;\r\n\r\n/**\r\n * @dev Collection of functions related to the address type\r\n */\r\nlibrary Address {\r\n    /**\r\n     * @dev Returns true if `account` is a contract.\r\n     *\r\n     * [IMPORTANT]\r\n     * ====\r\n     * It is unsafe to assume that an address for which this function returns\r\n     * false is an externally-owned account (EOA) and not a contract.\r\n     *\r\n     * Among others, `isContract` will return false for the following\r\n     * types of addresses:\r\n     *\r\n     *  - an externally-owned account\r\n     *  - a contract in construction\r\n     *  - an address where a contract will be created\r\n     *  - an address where a contract lived, but was destroyed\r\n     * ====\r\n     */\r\n    function isContract(address account) internal view returns (bool) {\r\n        // This method relies on extcodesize, which returns 0 for contracts in\r\n        // construction, since the code is only stored at the end of the\r\n        // constructor execution.\r\n\r\n        uint256 size;\r\n        // solhint-disable-next-line no-inline-assembly\r\n        assembly { size := extcodesize(account) }\r\n        return size > 0;\r\n    }\r\n\r\n    /**\r\n     * @dev Replacement for Solidity's `transfer`: sends `amount` wei to\r\n     * `recipient`, forwarding all available gas and reverting on errors.\r\n     *\r\n     * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost\r\n     * of certain opcodes, possibly making contracts go over the 2300 gas limit\r\n     * imposed by `transfer`, making them unable to receive funds via\r\n     * `transfer`. {sendValue} removes this limitation.\r\n     *\r\n     * https://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more].\r\n     *\r\n     * IMPORTANT: because control is transferred to `recipient`, care must be\r\n     * taken to not create reentrancy vulnerabilities. Consider using\r\n     * {ReentrancyGuard} or the\r\n     * https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].\r\n     */\r\n    function sendValue(address payable recipient, uint256 amount) internal {\r\n        require(address(this).balance >= amount, \"Address: insufficient balance\");\r\n\r\n        // solhint-disable-next-line avoid-low-level-calls, avoid-call-value\r\n        (bool success, ) = recipient.call{ value: amount }(\"\");\r\n        require(success, \"Address: unable to send value, recipient may have reverted\");\r\n    }\r\n\r\n    /**\r\n     * @dev Performs a Solidity function call using a low level `call`. A\r\n     * plain`call` is an unsafe replacement for a function call: use this\r\n     * function instead.\r\n     *\r\n     * If `target` reverts with a revert reason, it is bubbled up by this\r\n     * function (like regular Solidity function calls).\r\n     *\r\n     * Returns the raw returned data. To convert to the expected return value,\r\n     * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`].\r\n     *\r\n     * Requirements:\r\n     *\r\n     * - `target` must be a contract.\r\n     * - calling `target` with `data` must not revert.\r\n     *\r\n     * _Available since v3.1._\r\n     */\r\n    function functionCall(address target, bytes memory data) internal returns (bytes memory) {\r\n      return functionCall(target, data, \"Address: low-level call failed\");\r\n    }\r\n\r\n    /**\r\n     * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with\r\n     * `errorMessage` as a fallback revert reason when `target` reverts.\r\n     *\r\n     * _Available since v3.1._\r\n     */\r\n    function functionCall(address target, bytes memory data, string memory errorMessage) internal returns (bytes memory) {\r\n        return functionCallWithValue(target, data, 0, errorMessage);\r\n    }\r\n\r\n    /**\r\n     * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\r\n     * but also transferring `value` wei to `target`.\r\n     *\r\n     * Requirements:\r\n     *\r\n     * - the calling contract must have an ETH balance of at least `value`.\r\n     * - the called Solidity function must be `payable`.\r\n     *\r\n     * _Available since v3.1._\r\n     */\r\n    function functionCallWithValue(address target, bytes memory data, uint256 value) internal returns (bytes memory) {\r\n        return functionCallWithValue(target, data, value, \"Address: low-level call with value failed\");\r\n    }\r\n\r\n    /**\r\n     * @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but\r\n     * with `errorMessage` as a fallback revert reason when `target` reverts.\r\n     *\r\n     * _Available since v3.1._\r\n     */\r\n    function functionCallWithValue(address target, bytes memory data, uint256 value, string memory errorMessage) internal returns (bytes memory) {\r\n        require(address(this).balance >= value, \"Address: insufficient balance for call\");\r\n        require(isContract(target), \"Address: call to non-contract\");\r\n\r\n        // solhint-disable-next-line avoid-low-level-calls\r\n        (bool success, bytes memory returndata) = target.call{ value: value }(data);\r\n        return _verifyCallResult(success, returndata, errorMessage);\r\n    }\r\n\r\n    /**\r\n     * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\r\n     * but performing a static call.\r\n     *\r\n     * _Available since v3.3._\r\n     */\r\n    function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) {\r\n        return functionStaticCall(target, data, \"Address: low-level static call failed\");\r\n    }\r\n\r\n    /**\r\n     * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\r\n     * but performing a static call.\r\n     *\r\n     * _Available since v3.3._\r\n     */\r\n    function functionStaticCall(address target, bytes memory data, string memory errorMessage) internal view returns (bytes memory) {\r\n        require(isContract(target), \"Address: static call to non-contract\");\r\n\r\n        // solhint-disable-next-line avoid-low-level-calls\r\n        (bool success, bytes memory returndata) = target.staticcall(data);\r\n        return _verifyCallResult(success, returndata, errorMessage);\r\n    }\r\n\r\n    /**\r\n     * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\r\n     * but performing a delegate call.\r\n     *\r\n     * _Available since v3.4._\r\n     */\r\n    function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) {\r\n        return functionDelegateCall(target, data, \"Address: low-level delegate call failed\");\r\n    }\r\n\r\n    /**\r\n     * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\r\n     * but performing a delegate call.\r\n     *\r\n     * _Available since v3.4._\r\n     */\r\n    function functionDelegateCall(address target, bytes memory data, string memory errorMessage) internal returns (bytes memory) {\r\n        require(isContract(target), \"Address: delegate call to non-contract\");\r\n\r\n        // solhint-disable-next-line avoid-low-level-calls\r\n        (bool success, bytes memory returndata) = target.delegatecall(data);\r\n        return _verifyCallResult(success, returndata, errorMessage);\r\n    }\r\n\r\n    function _verifyCallResult(bool success, bytes memory returndata, string memory errorMessage) private pure returns(bytes memory) {\r\n        if (success) {\r\n            return returndata;\r\n        } else {\r\n            // Look for revert reason and bubble it up if present\r\n            if (returndata.length > 0) {\r\n                // The easiest way to bubble the revert reason is using memory via assembly\r\n\r\n                // solhint-disable-next-line no-inline-assembly\r\n                assembly {\r\n                    let returndata_size := mload(returndata)\r\n                    revert(add(32, returndata), returndata_size)\r\n                }\r\n            } else {\r\n                revert(errorMessage);\r\n            }\r\n        }\r\n    }\r\n}\r\n"
      },
      "@openzeppelin/contracts/token/ERC20/SafeERC20.sol": {
        "content": "// SPDX-License-Identifier: MIT\r\n\r\npragma solidity ^0.7.0;\r\n\r\nimport \"./IERC20.sol\";\r\nimport \"../../math/SafeMath.sol\";\r\nimport \"../../utils/Address.sol\";\r\n\r\n/**\r\n * @title SafeERC20\r\n * @dev Wrappers around ERC20 operations that throw on failure (when the token\r\n * contract returns false). Tokens that return no value (and instead revert or\r\n * throw on failure) are also supported, non-reverting calls are assumed to be\r\n * successful.\r\n * To use this library you can add a `using SafeERC20 for IERC20;` statement to your contract,\r\n * which allows you to call the safe operations as `token.safeTransfer(...)`, etc.\r\n */\r\nlibrary SafeERC20 {\r\n    using SafeMath for uint256;\r\n    using Address for address;\r\n\r\n    function safeTransfer(IERC20 token, address to, uint256 value) internal {\r\n        _callOptionalReturn(token, abi.encodeWithSelector(token.transfer.selector, to, value));\r\n    }\r\n\r\n    function safeTransferFrom(IERC20 token, address from, address to, uint256 value) internal {\r\n        _callOptionalReturn(token, abi.encodeWithSelector(token.transferFrom.selector, from, to, value));\r\n    }\r\n\r\n    /**\r\n     * @dev Deprecated. This function has issues similar to the ones found in\r\n     * {IERC20-approve}, and its usage is discouraged.\r\n     *\r\n     * Whenever possible, use {safeIncreaseAllowance} and\r\n     * {safeDecreaseAllowance} instead.\r\n     */\r\n    function safeApprove(IERC20 token, address spender, uint256 value) internal {\r\n        // safeApprove should only be called when setting an initial allowance,\r\n        // or when resetting it to zero. To increase and decrease it, use\r\n        // 'safeIncreaseAllowance' and 'safeDecreaseAllowance'\r\n        // solhint-disable-next-line max-line-length\r\n        require((value == 0) || (token.allowance(address(this), spender) == 0),\r\n            \"SafeERC20: approve from non-zero to non-zero allowance\"\r\n        );\r\n        _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, value));\r\n    }\r\n\r\n    function safeIncreaseAllowance(IERC20 token, address spender, uint256 value) internal {\r\n        uint256 newAllowance = token.allowance(address(this), spender).add(value);\r\n        _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance));\r\n    }\r\n\r\n    function safeDecreaseAllowance(IERC20 token, address spender, uint256 value) internal {\r\n        uint256 newAllowance = token.allowance(address(this), spender).sub(value, \"SafeERC20: decreased allowance below zero\");\r\n        _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance));\r\n    }\r\n\r\n    /**\r\n     * @dev Imitates a Solidity high-level call (i.e. a regular function call to a contract), relaxing the requirement\r\n     * on the return value: the return value is optional (but if data is returned, it must not be false).\r\n     * @param token The token targeted by the call.\r\n     * @param data The call data (encoded using abi.encode or one of its variants).\r\n     */\r\n    function _callOptionalReturn(IERC20 token, bytes memory data) private {\r\n        // We need to perform a low level call here, to bypass Solidity's return data size checking mechanism, since\r\n        // we're implementing it ourselves. We use {Address.functionCall} to perform this call, which verifies that\r\n        // the target address contains contract code and also asserts for success in the low-level call.\r\n\r\n        bytes memory returndata = address(token).functionCall(data, \"SafeERC20: low-level call failed\");\r\n        if (returndata.length > 0) { // Return data is optional\r\n            // solhint-disable-next-line max-line-length\r\n            require(abi.decode(returndata, (bool)), \"SafeERC20: ERC20 operation did not succeed\");\r\n        }\r\n    }\r\n}\r\n"
      },
      "@openzeppelin/contracts/token/ERC20/IERC20.sol": {
        "content": "// SPDX-License-Identifier: MIT\r\n\r\npragma solidity ^0.7.0;\r\n\r\n/**\r\n * @dev Interface of the ERC20 standard as defined in the EIP.\r\n */\r\ninterface IERC20 {\r\n    /**\r\n     * @dev Returns the amount of tokens in existence.\r\n     */\r\n    function totalSupply() external view returns (uint256);\r\n\r\n    /**\r\n     * @dev Returns the amount of tokens owned by `account`.\r\n     */\r\n    function balanceOf(address account) external view returns (uint256);\r\n\r\n    /**\r\n     * @dev Moves `amount` tokens from the caller's account to `recipient`.\r\n     *\r\n     * Returns a boolean value indicating whether the operation succeeded.\r\n     *\r\n     * Emits a {Transfer} event.\r\n     */\r\n    function transfer(address recipient, uint256 amount) external returns (bool);\r\n\r\n    /**\r\n     * @dev Returns the remaining number of tokens that `spender` will be\r\n     * allowed to spend on behalf of `owner` through {transferFrom}. This is\r\n     * zero by default.\r\n     *\r\n     * This value changes when {approve} or {transferFrom} are called.\r\n     */\r\n    function allowance(address owner, address spender) external view returns (uint256);\r\n\r\n    /**\r\n     * @dev Sets `amount` as the allowance of `spender` over the caller's tokens.\r\n     *\r\n     * Returns a boolean value indicating whether the operation succeeded.\r\n     *\r\n     * IMPORTANT: Beware that changing an allowance with this method brings the risk\r\n     * that someone may use both the old and the new allowance by unfortunate\r\n     * transaction ordering. One possible solution to mitigate this race\r\n     * condition is to first reduce the spender's allowance to 0 and set the\r\n     * desired value afterwards:\r\n     * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729\r\n     *\r\n     * Emits an {Approval} event.\r\n     */\r\n    function approve(address spender, uint256 amount) external returns (bool);\r\n\r\n    /**\r\n     * @dev Moves `amount` tokens from `sender` to `recipient` using the\r\n     * allowance mechanism. `amount` is then deducted from the caller's\r\n     * allowance.\r\n     *\r\n     * Returns a boolean value indicating whether the operation succeeded.\r\n     *\r\n     * Emits a {Transfer} event.\r\n     */\r\n    function transferFrom(address sender, address recipient, uint256 amount) external returns (bool);\r\n\r\n    /**\r\n     * @dev Emitted when `value` tokens are moved from one account (`from`) to\r\n     * another (`to`).\r\n     *\r\n     * Note that `value` may be zero.\r\n     */\r\n    event Transfer(address indexed from, address indexed to, uint256 value);\r\n\r\n    /**\r\n     * @dev Emitted when the allowance of a `spender` for an `owner` is set by\r\n     * a call to {approve}. `value` is the new allowance.\r\n     */\r\n    event Approval(address indexed owner, address indexed spender, uint256 value);\r\n}\r\n"
      },
      "@openzeppelin/contracts/math/SafeMath.sol": {
        "content": "// SPDX-License-Identifier: MIT\r\n\r\npragma solidity ^0.7.0;\r\n\r\n/**\r\n * @dev Wrappers over Solidity's arithmetic operations with added overflow\r\n * checks.\r\n *\r\n * Arithmetic operations in Solidity wrap on overflow. This can easily result\r\n * in bugs, because programmers usually assume that an overflow raises an\r\n * error, which is the standard behavior in high level programming languages.\r\n * `SafeMath` restores this intuition by reverting the transaction when an\r\n * operation overflows.\r\n *\r\n * Using this library instead of the unchecked operations eliminates an entire\r\n * class of bugs, so it's recommended to use it always.\r\n */\r\nlibrary SafeMath {\r\n    /**\r\n     * @dev Returns the addition of two unsigned integers, with an overflow flag.\r\n     *\r\n     * _Available since v3.4._\r\n     */\r\n    function tryAdd(uint256 a, uint256 b) internal pure returns (bool, uint256) {\r\n        uint256 c = a + b;\r\n        if (c < a) return (false, 0);\r\n        return (true, c);\r\n    }\r\n\r\n    /**\r\n     * @dev Returns the substraction of two unsigned integers, with an overflow flag.\r\n     *\r\n     * _Available since v3.4._\r\n     */\r\n    function trySub(uint256 a, uint256 b) internal pure returns (bool, uint256) {\r\n        if (b > a) return (false, 0);\r\n        return (true, a - b);\r\n    }\r\n\r\n    /**\r\n     * @dev Returns the multiplication of two unsigned integers, with an overflow flag.\r\n     *\r\n     * _Available since v3.4._\r\n     */\r\n    function tryMul(uint256 a, uint256 b) internal pure returns (bool, uint256) {\r\n        // Gas optimization: this is cheaper than requiring 'a' not being zero, but the\r\n        // benefit is lost if 'b' is also tested.\r\n        // See: https://github.com/OpenZeppelin/openzeppelin-contracts/pull/522\r\n        if (a == 0) return (true, 0);\r\n        uint256 c = a * b;\r\n        if (c / a != b) return (false, 0);\r\n        return (true, c);\r\n    }\r\n\r\n    /**\r\n     * @dev Returns the division of two unsigned integers, with a division by zero flag.\r\n     *\r\n     * _Available since v3.4._\r\n     */\r\n    function tryDiv(uint256 a, uint256 b) internal pure returns (bool, uint256) {\r\n        if (b == 0) return (false, 0);\r\n        return (true, a / b);\r\n    }\r\n\r\n    /**\r\n     * @dev Returns the remainder of dividing two unsigned integers, with a division by zero flag.\r\n     *\r\n     * _Available since v3.4._\r\n     */\r\n    function tryMod(uint256 a, uint256 b) internal pure returns (bool, uint256) {\r\n        if (b == 0) return (false, 0);\r\n        return (true, a % b);\r\n    }\r\n\r\n    /**\r\n     * @dev Returns the addition of two unsigned integers, reverting on\r\n     * overflow.\r\n     *\r\n     * Counterpart to Solidity's `+` operator.\r\n     *\r\n     * Requirements:\r\n     *\r\n     * - Addition cannot overflow.\r\n     */\r\n    function add(uint256 a, uint256 b) internal pure returns (uint256) {\r\n        uint256 c = a + b;\r\n        require(c >= a, \"SafeMath: addition overflow\");\r\n        return c;\r\n    }\r\n\r\n    /**\r\n     * @dev Returns the subtraction of two unsigned integers, reverting on\r\n     * overflow (when the result is negative).\r\n     *\r\n     * Counterpart to Solidity's `-` operator.\r\n     *\r\n     * Requirements:\r\n     *\r\n     * - Subtraction cannot overflow.\r\n     */\r\n    function sub(uint256 a, uint256 b) internal pure returns (uint256) {\r\n        require(b <= a, \"SafeMath: subtraction overflow\");\r\n        return a - b;\r\n    }\r\n\r\n    /**\r\n     * @dev Returns the multiplication of two unsigned integers, reverting on\r\n     * overflow.\r\n     *\r\n     * Counterpart to Solidity's `*` operator.\r\n     *\r\n     * Requirements:\r\n     *\r\n     * - Multiplication cannot overflow.\r\n     */\r\n    function mul(uint256 a, uint256 b) internal pure returns (uint256) {\r\n        if (a == 0) return 0;\r\n        uint256 c = a * b;\r\n        require(c / a == b, \"SafeMath: multiplication overflow\");\r\n        return c;\r\n    }\r\n\r\n    /**\r\n     * @dev Returns the integer division of two unsigned integers, reverting on\r\n     * division by zero. The result is rounded towards zero.\r\n     *\r\n     * Counterpart to Solidity's `/` operator. Note: this function uses a\r\n     * `revert` opcode (which leaves remaining gas untouched) while Solidity\r\n     * uses an invalid opcode to revert (consuming all remaining gas).\r\n     *\r\n     * Requirements:\r\n     *\r\n     * - The divisor cannot be zero.\r\n     */\r\n    function div(uint256 a, uint256 b) internal pure returns (uint256) {\r\n        require(b > 0, \"SafeMath: division by zero\");\r\n        return a / b;\r\n    }\r\n\r\n    /**\r\n     * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo),\r\n     * reverting when dividing by zero.\r\n     *\r\n     * Counterpart to Solidity's `%` operator. This function uses a `revert`\r\n     * opcode (which leaves remaining gas untouched) while Solidity uses an\r\n     * invalid opcode to revert (consuming all remaining gas).\r\n     *\r\n     * Requirements:\r\n     *\r\n     * - The divisor cannot be zero.\r\n     */\r\n    function mod(uint256 a, uint256 b) internal pure returns (uint256) {\r\n        require(b > 0, \"SafeMath: modulo by zero\");\r\n        return a % b;\r\n    }\r\n\r\n    /**\r\n     * @dev Returns the subtraction of two unsigned integers, reverting with custom message on\r\n     * overflow (when the result is negative).\r\n     *\r\n     * CAUTION: This function is deprecated because it requires allocating memory for the error\r\n     * message unnecessarily. For custom revert reasons use {trySub}.\r\n     *\r\n     * Counterpart to Solidity's `-` operator.\r\n     *\r\n     * Requirements:\r\n     *\r\n     * - Subtraction cannot overflow.\r\n     */\r\n    function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {\r\n        require(b <= a, errorMessage);\r\n        return a - b;\r\n    }\r\n\r\n    /**\r\n     * @dev Returns the integer division of two unsigned integers, reverting with custom message on\r\n     * division by zero. The result is rounded towards zero.\r\n     *\r\n     * CAUTION: This function is deprecated because it requires allocating memory for the error\r\n     * message unnecessarily. For custom revert reasons use {tryDiv}.\r\n     *\r\n     * Counterpart to Solidity's `/` operator. Note: this function uses a\r\n     * `revert` opcode (which leaves remaining gas untouched) while Solidity\r\n     * uses an invalid opcode to revert (consuming all remaining gas).\r\n     *\r\n     * Requirements:\r\n     *\r\n     * - The divisor cannot be zero.\r\n     */\r\n    function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {\r\n        require(b > 0, errorMessage);\r\n        return a / b;\r\n    }\r\n\r\n    /**\r\n     * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo),\r\n     * reverting with custom message when dividing by zero.\r\n     *\r\n     * CAUTION: This function is deprecated because it requires allocating memory for the error\r\n     * message unnecessarily. For custom revert reasons use {tryMod}.\r\n     *\r\n     * Counterpart to Solidity's `%` operator. This function uses a `revert`\r\n     * opcode (which leaves remaining gas untouched) while Solidity uses an\r\n     * invalid opcode to revert (consuming all remaining gas).\r\n     *\r\n     * Requirements:\r\n     *\r\n     * - The divisor cannot be zero.\r\n     */\r\n    function mod(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {\r\n        require(b > 0, errorMessage);\r\n        return a % b;\r\n    }\r\n}\r\n"
      }
    },
    "settings": {
      "optimizer": {
        "enabled": true,
        "runs": 200
      },
      "outputSelection": {
        "*": {
          "*": [
            "evm.bytecode",
            "evm.deployedBytecode",
            "devdoc",
            "userdoc",
            "metadata",
            "abi"
          ]
        }
      },
      "libraries": {}
    }
  }}