{"compiler":{"version":"0.8.9+commit.e5eed63a"},"language":"Solidity","output":{"abi":[{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"_erc20TokenAddress","type":"address"},{"indexed":false,"internalType":"address[]","name":"_receivers","type":"address[]"},{"indexed":false,"internalType":"uint256[]","name":"_amountsToTransfer","type":"uint256[]"}],"name":"BatchPayment","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"_feeAddress","type":"address"}],"name":"FeeAddressChanged","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"_fee","type":"uint256"}],"name":"FeeChanged","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"_erc20TokenAddress","type":"address"},{"indexed":false,"internalType":"address","name":"_feeAddress","type":"address"},{"indexed":false,"internalType":"uint256","name":"_fees","type":"uint256"}],"name":"FeeCharged","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint8","name":"version","type":"uint8"}],"name":"Initialized","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":false,"internalType":"address","name":"_tokenIn","type":"address"},{"indexed":false,"internalType":"address","name":"_tokenOut","type":"address"},{"indexed":false,"internalType":"uint256","name":"_amountReceived","type":"uint256"}],"name":"SwapFinished","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"_swapRouter","type":"address"},{"indexed":false,"internalType":"bool","name":"_isSwapV2","type":"bool"}],"name":"SwapRouterChanged","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"_version","type":"uint256"}],"name":"UpdatedVersion","type":"event"},{"inputs":[],"name":"MANTISSA","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address[]","name":"_erc20TokenOrigin","type":"address[]"}],"name":"approveTokens","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"fee","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"feeAddress","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_swapRouter","type":"address"},{"internalType":"bool","name":"_isSwapV2","type":"bool"},{"internalType":"address","name":"_feeAddress","type":"address"},{"internalType":"uint256","name":"_fee","type":"uint256"}],"name":"initialize","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"isSwapV2","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"components":[{"internalType":"address","name":"token","type":"address"},{"internalType":"address[]","name":"receivers","type":"address[]"},{"internalType":"uint256[]","name":"amountsToTransfer","type":"uint256[]"}],"internalType":"struct Payroll.Payment[]","name":"_payments","type":"tuple[]"}],"name":"performMultiPayment","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"address","name":"_erc20TokenOrigin","type":"address"},{"internalType":"uint256","name":"_totalAmountToSwap","type":"uint256"},{"internalType":"uint32","name":"_deadline","type":"uint32"},{"components":[{"internalType":"uint256","name":"amountOut","type":"uint256"},{"internalType":"uint256","name":"amountInMax","type":"uint256"},{"internalType":"address[]","name":"path","type":"address[]"}],"internalType":"struct Payroll.SwapV2[]","name":"_swaps","type":"tuple[]"}],"name":"performSwapV2","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_erc20TokenOrigin","type":"address"},{"internalType":"uint256","name":"_totalAmountToSwap","type":"uint256"},{"internalType":"uint32","name":"_deadline","type":"uint32"},{"components":[{"internalType":"uint256","name":"amountOut","type":"uint256"},{"internalType":"uint256","name":"amountInMax","type":"uint256"},{"internalType":"address[]","name":"path","type":"address[]"}],"internalType":"struct Payroll.SwapV2[]","name":"_swaps","type":"tuple[]"},{"components":[{"internalType":"address","name":"token","type":"address"},{"internalType":"address[]","name":"receivers","type":"address[]"},{"internalType":"uint256[]","name":"amountsToTransfer","type":"uint256[]"}],"internalType":"struct Payroll.Payment[]","name":"_payments","type":"tuple[]"}],"name":"performSwapV2AndPayment","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_totalAmountToSwap","type":"uint256"},{"internalType":"uint32","name":"_deadline","type":"uint32"},{"components":[{"internalType":"uint256","name":"amountOut","type":"uint256"},{"internalType":"uint256","name":"amountInMax","type":"uint256"},{"internalType":"address[]","name":"path","type":"address[]"}],"internalType":"struct Payroll.SwapV2[]","name":"_swaps","type":"tuple[]"},{"components":[{"internalType":"address","name":"token","type":"address"},{"internalType":"address[]","name":"receivers","type":"address[]"},{"internalType":"uint256[]","name":"amountsToTransfer","type":"uint256[]"}],"internalType":"struct Payroll.Payment[]","name":"_payments","type":"tuple[]"}],"name":"performSwapV2AndPaymentETH","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_totalAmountToSwap","type":"uint256"},{"internalType":"uint32","name":"_deadline","type":"uint32"},{"components":[{"internalType":"uint256","name":"amountOut","type":"uint256"},{"internalType":"uint256","name":"amountInMax","type":"uint256"},{"internalType":"address[]","name":"path","type":"address[]"}],"internalType":"struct Payroll.SwapV2[]","name":"_swaps","type":"tuple[]"}],"name":"performSwapV2ETH","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"address","name":"_erc20TokenOrigin","type":"address"},{"internalType":"uint256","name":"_totalAmountToSwap","type":"uint256"},{"internalType":"uint32","name":"_deadline","type":"uint32"},{"components":[{"internalType":"uint256","name":"amountOut","type":"uint256"},{"internalType":"uint256","name":"amountInMax","type":"uint256"},{"internalType":"bytes","name":"path","type":"bytes"}],"internalType":"struct Payroll.SwapV3[]","name":"_swaps","type":"tuple[]"}],"name":"performSwapV3","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_erc20TokenOrigin","type":"address"},{"internalType":"uint256","name":"_totalAmountToSwap","type":"uint256"},{"internalType":"uint32","name":"_deadline","type":"uint32"},{"components":[{"internalType":"uint256","name":"amountOut","type":"uint256"},{"internalType":"uint256","name":"amountInMax","type":"uint256"},{"internalType":"bytes","name":"path","type":"bytes"}],"internalType":"struct Payroll.SwapV3[]","name":"_swaps","type":"tuple[]"},{"components":[{"internalType":"address","name":"token","type":"address"},{"internalType":"address[]","name":"receivers","type":"address[]"},{"internalType":"uint256[]","name":"amountsToTransfer","type":"uint256[]"}],"internalType":"struct Payroll.Payment[]","name":"_payments","type":"tuple[]"}],"name":"performSwapV3AndPayment","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_totalAmountToSwap","type":"uint256"},{"internalType":"uint32","name":"_deadline","type":"uint32"},{"components":[{"internalType":"uint256","name":"amountOut","type":"uint256"},{"internalType":"uint256","name":"amountInMax","type":"uint256"},{"internalType":"bytes","name":"path","type":"bytes"}],"internalType":"struct Payroll.SwapV3[]","name":"_swaps","type":"tuple[]"},{"components":[{"internalType":"address","name":"token","type":"address"},{"internalType":"address[]","name":"receivers","type":"address[]"},{"internalType":"uint256[]","name":"amountsToTransfer","type":"uint256[]"}],"internalType":"struct Payroll.Payment[]","name":"_payments","type":"tuple[]"}],"name":"performSwapV3AndPaymentETH","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_totalAmountToSwap","type":"uint256"},{"internalType":"uint32","name":"_deadline","type":"uint32"},{"components":[{"internalType":"uint256","name":"amountOut","type":"uint256"},{"internalType":"uint256","name":"amountInMax","type":"uint256"},{"internalType":"bytes","name":"path","type":"bytes"}],"internalType":"struct Payroll.SwapV3[]","name":"_swaps","type":"tuple[]"}],"name":"performSwapV3ETH","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_fee","type":"uint256"}],"name":"setFee","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_feeAddress","type":"address"}],"name":"setFeeAddress","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_swapRouter","type":"address"},{"internalType":"bool","name":"_isSwapV2","type":"bool"}],"name":"setSwapRouter","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_version","type":"uint256"}],"name":"setVersion","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"swapRouter","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"version","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"stateMutability":"payable","type":"receive"}],"devdoc":{"author":"Think and Dev Team","kind":"dev","methods":{"approveTokens(address[])":{"params":{"_erc20TokenOrigin":"ERC20 token address to approve."}},"initialize(address,bool,address,uint256)":{"params":{"_isSwapV2":"Boolean to specify the version of the router; true means v2, false means v3.","_swapRouter":"Router address to execute swaps."}},"owner()":{"details":"Returns the address of the current owner."},"performMultiPayment((address,address[],uint256[])[])":{"params":{"_payments":"The array of the Payment data."}},"performSwapV2(address,uint256,uint32,(uint256,uint256,address[])[])":{"params":{"_deadline":"The unix timestamp after a swap will fail.","_erc20TokenOrigin":"ERC20 token address to swap for another.","_swaps":"The array of the Swaps data.","_totalAmountToSwap":"Total amount of erc20TokenOrigin to spend in swaps."}},"performSwapV2AndPayment(address,uint256,uint32,(uint256,uint256,address[])[],(address,address[],uint256[])[])":{"params":{"_deadline":"The unix timestamp after a swap will fail.","_erc20TokenOrigin":"ERC20 token address to swap for another.","_payments":"The array of the Payment data.","_swaps":"The array of the Swaps data.","_totalAmountToSwap":"Total amount of erc20TokenOrigin to spend in swaps."}},"performSwapV2AndPaymentETH(uint256,uint32,(uint256,uint256,address[])[],(address,address[],uint256[])[])":{"params":{"_deadline":"The unix timestamp after a swap will fail.","_payments":"The array of the Payment data.","_swaps":"The array of the Swaps data.","_totalAmountToSwap":"Total amount of erc20TokenOrigin to spend in swaps."}},"performSwapV2ETH(uint256,uint32,(uint256,uint256,address[])[])":{"params":{"_deadline":"The unix timestamp after a swap will fail.","_swaps":"The array of the Swaps data.","_totalAmountToSwap":"Total amount of erc20TokenOrigin to spend in swaps."}},"performSwapV3(address,uint256,uint32,(uint256,uint256,bytes)[])":{"params":{"_deadline":"The unix timestamp after a swap will fail.","_erc20TokenOrigin":"ERC20 token address to swap for another.","_swaps":"The array of the Swaps data.","_totalAmountToSwap":"Total amount of erc20TokenOrigin to spend in swaps."}},"performSwapV3AndPayment(address,uint256,uint32,(uint256,uint256,bytes)[],(address,address[],uint256[])[])":{"params":{"_deadline":"The unix timestamp after a swap will fail.","_erc20TokenOrigin":"ERC20 token address to swap for another.","_payments":"The array of the Payment data.","_swaps":"The array of the Swaps data.","_totalAmountToSwap":"Total amount of erc20TokenOrigin to spend in swaps."}},"performSwapV3AndPaymentETH(uint256,uint32,(uint256,uint256,bytes)[],(address,address[],uint256[])[])":{"params":{"_deadline":"The unix timestamp after a swap will fail.","_payments":"The array of the Payment data.","_swaps":"The array of the Swaps data.","_totalAmountToSwap":"Total amount of erc20TokenOrigin to spend in swaps."}},"performSwapV3ETH(uint256,uint32,(uint256,uint256,bytes)[])":{"params":{"_deadline":"The unix timestamp after a swap will fail.","_swaps":"The array of the Swaps data.","_totalAmountToSwap":"Total amount of erc20TokenOrigin to spend in swaps."}},"renounceOwnership()":{"details":"Leaves the contract without owner. It will not be possible to call `onlyOwner` functions anymore. Can only be called by the current owner. NOTE: Renouncing ownership will leave the contract without an owner, thereby removing any functionality that is only available to the owner."},"setFee(uint256)":{"params":{"_fee":"Percentage that will be charged."}},"setFeeAddress(address)":{"params":{"_feeAddress":"Address that will receive the fees."}},"setSwapRouter(address,bool)":{"params":{"_isSwapV2":"Boolean to specify the version of the router; true means v2, false means v3.","_swapRouter":"Router address to execute swaps."}},"transferOwnership(address)":{"details":"Transfers ownership of the contract to a new account (`newOwner`). Can only be called by the current owner."}},"title":"Think and Dev Paymentbox","version":1},"userdoc":{"kind":"user","methods":{"approveTokens(address[])":{"notice":"Approves the following token to be used on swapRouter"},"isSwapV2()":{"notice":"Returns if the contract is working with a v2 Uniswap protocol; true means v2, false means v3."},"performMultiPayment((address,address[],uint256[])[])":{"notice":"Perform the payments to the given addresses and amounts, public method.Available to send ETH or ERC20."},"performSwapV2(address,uint256,uint32,(uint256,uint256,address[])[])":{"notice":"Perform the swap with Uniswap V2 to the given token addresses and amounts.Swap ERC20 to ERC20."},"performSwapV2AndPayment(address,uint256,uint32,(uint256,uint256,address[])[],(address,address[],uint256[])[])":{"notice":"Perform the swap with Uniswap V2 and the transfer to the given addresses.Swap ERC20 to ERC20.Available to send ETH or ERC20."},"performSwapV2AndPaymentETH(uint256,uint32,(uint256,uint256,address[])[],(address,address[],uint256[])[])":{"notice":"Perform the swap with Uniswap V2 and the transfer to the given addresses.Swap ETH to ERC20.Available to send ETH or ERC20."},"performSwapV2ETH(uint256,uint32,(uint256,uint256,address[])[])":{"notice":"Perform the swap with Uniswap V2 to the given token addresses and amounts.Swap ETH to ERC20."},"performSwapV3(address,uint256,uint32,(uint256,uint256,bytes)[])":{"notice":"Perform the swap with Uniswap V3 to the given token addresses and amounts.Swap ERC20 to ERC20."},"performSwapV3AndPayment(address,uint256,uint32,(uint256,uint256,bytes)[],(address,address[],uint256[])[])":{"notice":"Perform the swap with Uniswap V3 and the transfer to the given addresses.Swap ERC20 to ERC20.Available to send ETH or ERC20."},"performSwapV3AndPaymentETH(uint256,uint32,(uint256,uint256,bytes)[],(address,address[],uint256[])[])":{"notice":"Perform the swap with Uniswap V3 and the transfer to the given addresses.Swap ETH to ERC20.Available to send ETH or ERC20."},"performSwapV3ETH(uint256,uint32,(uint256,uint256,bytes)[])":{"notice":"Perform the swap with Uniswap V3 to the given token addresses and amounts.Swap ETH to ERC20."},"setFee(uint256)":{"notice":"Set the fee that will be charged, fees are divided by mantissa"},"setFeeAddress(address)":{"notice":"Set the address that will receive the fees."},"setSwapRouter(address,bool)":{"notice":"Set the SwapRouter and the version to be used."},"swapRouter()":{"notice":"Returns the address of the Uniswap protocol router, it could be v2 or v3."}},"notice":"Swap and transfer multiple ERC20 pairs to multiple accounts in a single transaction. Use any router address of any DEX that uses Uniswap protocol v2 or v3 to make swaps.","version":1}},"settings":{"compilationTarget":{"contracts/Payroll.sol":"Payroll"},"evmVersion":"london","libraries":{},"metadata":{"bytecodeHash":"ipfs","useLiteralContent":true},"optimizer":{"enabled":true,"runs":200},"remappings":[]},"sources":{"@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol":{"content":"// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.7.0) (access/Ownable.sol)\n\npragma solidity ^0.8.0;\n\nimport \"../utils/ContextUpgradeable.sol\";\nimport \"../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 anymore. Can only be called by the current owner.\n     *\n     * NOTE: Renouncing ownership will leave the contract without an owner,\n     * thereby removing any functionality that is only available to the owner.\n     */\n    function renounceOwnership() public virtual onlyOwner {\n        _transferOwnership(address(0));\n    }\n\n    /**\n     * @dev Transfers ownership of the contract to a new account (`newOwner`).\n     * Can only be called by the current owner.\n     */\n    function transferOwnership(address newOwner) public virtual onlyOwner {\n        require(newOwner != address(0), \"Ownable: new owner is the zero address\");\n        _transferOwnership(newOwner);\n    }\n\n    /**\n     * @dev Transfers ownership of the contract to a new account (`newOwner`).\n     * Internal function without access restriction.\n     */\n    function _transferOwnership(address newOwner) internal virtual {\n        address oldOwner = _owner;\n        _owner = newOwner;\n        emit OwnershipTransferred(oldOwner, newOwner);\n    }\n\n    /**\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","keccak256":"0x247c62047745915c0af6b955470a72d1696ebad4352d7d3011aef1a2463cd888","license":"MIT"},"@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol":{"content":"// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.7.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 * ```\n * contract MyToken is ERC20Upgradeable {\n *     function initialize() initializer public {\n *         __ERC20_init(\"MyToken\", \"MTK\");\n *     }\n * }\n * contract MyTokenV2 is MyToken, ERC20PermitUpgradeable {\n *     function initializeV2() reinitializer(2) public {\n *         __ERC20Permit_init(\"MyToken\");\n *     }\n * }\n * ```\n *\n * TIP: To avoid leaving the proxy in an uninitialized state, the initializer function should be called as early as\n * possible by providing the encoded function call as the `_data` argument to {ERC1967Proxy-constructor}.\n *\n * CAUTION: When used with inheritance, manual care must be taken to not invoke a parent initializer twice, or to ensure\n * that all initializers are idempotent. This is not verified automatically as constructors are by Solidity.\n *\n * [CAUTION]\n * ====\n * Avoid leaving a contract uninitialized.\n *\n * An uninitialized contract can be taken over by an attacker. This applies to both a proxy and its implementation\n * contract, which may impact the proxy. To prevent the implementation contract from being used, you should invoke\n * the {_disableInitializers} function in the constructor to automatically lock it when it is deployed:\n *\n * [.hljs-theme-light.nopadding]\n * ```\n * /// @custom:oz-upgrades-unsafe-allow constructor\n * constructor() {\n *     _disableInitializers();\n * }\n * ```\n * ====\n */\nabstract contract Initializable {\n    /**\n     * @dev Indicates that the contract has been initialized.\n     * @custom:oz-retyped-from bool\n     */\n    uint8 private _initialized;\n\n    /**\n     * @dev Indicates that the contract is in the process of being initialized.\n     */\n    bool private _initializing;\n\n    /**\n     * @dev Triggered when the contract has been initialized or reinitialized.\n     */\n    event Initialized(uint8 version);\n\n    /**\n     * @dev A modifier that defines a protected initializer function that can be invoked at most once. In its scope,\n     * `onlyInitializing` functions can be used to initialize parent contracts. Equivalent to `reinitializer(1)`.\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     * `initializer` is equivalent to `reinitializer(1)`, so a reinitializer may be used after the original\n     * initialization step. This is essential to configure modules that are added through upgrades and that require\n     * initialization.\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    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    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","keccak256":"0x0203dcadc5737d9ef2c211d6fa15d18ebc3b30dfa51903b64870b01a062b0b4e","license":"MIT"},"@openzeppelin/contracts-upgradeable/security/ReentrancyGuardUpgradeable.sol":{"content":"// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (security/ReentrancyGuard.sol)\n\npragma solidity ^0.8.0;\nimport \"../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        // On the first call to nonReentrant, _notEntered will be true\n        require(_status != _ENTERED, \"ReentrancyGuard: reentrant call\");\n\n        // Any calls to nonReentrant after this point will fail\n        _status = _ENTERED;\n\n        _;\n\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 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","keccak256":"0x8cc03c5ac17e8a7396e487cda41fc1f1dfdb91db7d528e6da84bee3b6dd7e167","license":"MIT"},"@openzeppelin/contracts-upgradeable/utils/AddressUpgradeable.sol":{"content":"// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.7.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     *\n     * [IMPORTANT]\n     * ====\n     * You shouldn't rely on `isContract` to protect against flash loan attacks!\n     *\n     * Preventing calls from contracts is highly discouraged. It breaks composability, breaks support for smart wallets\n     * like Gnosis Safe, and does not provide security since it can be circumvented by calling from a contract\n     * constructor.\n     * ====\n     */\n    function isContract(address account) internal view returns (bool) {\n        // This method relies on extcodesize/address.code.length, which returns 0\n        // for contracts in construction, since the code is only stored at the end\n        // of the constructor execution.\n\n        return account.code.length > 0;\n    }\n\n    /**\n     * @dev Replacement for Solidity's `transfer`: sends `amount` wei to\n     * `recipient`, forwarding all available gas and reverting on errors.\n     *\n     * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost\n     * of certain opcodes, possibly making contracts go over the 2300 gas limit\n     * imposed by `transfer`, making them unable to receive funds via\n     * `transfer`. {sendValue} removes this limitation.\n     *\n     * https://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more].\n     *\n     * IMPORTANT: because control is transferred to `recipient`, care must be\n     * taken to not create reentrancy vulnerabilities. Consider using\n     * {ReentrancyGuard} or the\n     * https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].\n     */\n    function sendValue(address payable recipient, uint256 amount) internal {\n        require(address(this).balance >= amount, \"Address: insufficient balance\");\n\n        (bool success, ) = recipient.call{value: amount}(\"\");\n        require(success, \"Address: unable to send value, recipient may have reverted\");\n    }\n\n    /**\n     * @dev Performs a Solidity function call using a low level `call`. A\n     * plain `call` is an unsafe replacement for a function call: use this\n     * function instead.\n     *\n     * If `target` reverts with a revert reason, it is bubbled up by this\n     * function (like regular Solidity function calls).\n     *\n     * Returns the raw returned data. To convert to the expected return value,\n     * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`].\n     *\n     * Requirements:\n     *\n     * - `target` must be a contract.\n     * - calling `target` with `data` must not revert.\n     *\n     * _Available since v3.1._\n     */\n    function functionCall(address target, bytes memory data) internal returns (bytes memory) {\n        return functionCall(target, data, \"Address: low-level call failed\");\n    }\n\n    /**\n     * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with\n     * `errorMessage` as a fallback revert reason when `target` reverts.\n     *\n     * _Available since v3.1._\n     */\n    function functionCall(\n        address target,\n        bytes memory data,\n        string memory errorMessage\n    ) internal returns (bytes memory) {\n        return functionCallWithValue(target, data, 0, errorMessage);\n    }\n\n    /**\n     * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\n     * but also transferring `value` wei to `target`.\n     *\n     * Requirements:\n     *\n     * - the calling contract must have an ETH balance of at least `value`.\n     * - the called Solidity function must be `payable`.\n     *\n     * _Available since v3.1._\n     */\n    function functionCallWithValue(\n        address target,\n        bytes memory data,\n        uint256 value\n    ) internal returns (bytes memory) {\n        return functionCallWithValue(target, data, value, \"Address: low-level call with value failed\");\n    }\n\n    /**\n     * @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but\n     * with `errorMessage` as a fallback revert reason when `target` reverts.\n     *\n     * _Available since v3.1._\n     */\n    function functionCallWithValue(\n        address target,\n        bytes memory data,\n        uint256 value,\n        string memory errorMessage\n    ) internal returns (bytes memory) {\n        require(address(this).balance >= value, \"Address: insufficient balance for call\");\n        require(isContract(target), \"Address: call to non-contract\");\n\n        (bool success, bytes memory returndata) = target.call{value: value}(data);\n        return verifyCallResult(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        require(isContract(target), \"Address: static call to non-contract\");\n\n        (bool success, bytes memory returndata) = target.staticcall(data);\n        return verifyCallResult(success, returndata, errorMessage);\n    }\n\n    /**\n     * @dev Tool to verifies that a low level call was successful, and revert if it wasn't, either by bubbling the\n     * revert reason 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            // 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}\n","keccak256":"0x611aa3f23e59cfdd1863c536776407b3e33d695152a266fa7cfb34440a29a8a3","license":"MIT"},"@openzeppelin/contracts-upgradeable/utils/ContextUpgradeable.sol":{"content":"// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (utils/Context.sol)\n\npragma solidity ^0.8.0;\nimport \"../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    /**\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","keccak256":"0x963ea7f0b48b032eef72fe3a7582edf78408d6f834115b9feadd673a4d5bd149","license":"MIT"},"@openzeppelin/contracts/token/ERC20/IERC20.sol":{"content":"// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.6.0) (token/ERC20/IERC20.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @dev Interface of the ERC20 standard as defined in the EIP.\n */\ninterface IERC20 {\n    /**\n     * @dev Emitted when `value` tokens are moved from one account (`from`) to\n     * another (`to`).\n     *\n     * Note that `value` may be zero.\n     */\n    event Transfer(address indexed from, address indexed to, uint256 value);\n\n    /**\n     * @dev Emitted when the allowance of a `spender` for an `owner` is set by\n     * a call to {approve}. `value` is the new allowance.\n     */\n    event Approval(address indexed owner, address indexed spender, uint256 value);\n\n    /**\n     * @dev Returns the amount of tokens in existence.\n     */\n    function totalSupply() external view returns (uint256);\n\n    /**\n     * @dev Returns the amount of tokens owned by `account`.\n     */\n    function balanceOf(address account) external view returns (uint256);\n\n    /**\n     * @dev Moves `amount` tokens from the caller's account to `to`.\n     *\n     * Returns a boolean value indicating whether the operation succeeded.\n     *\n     * Emits a {Transfer} event.\n     */\n    function transfer(address to, uint256 amount) external returns (bool);\n\n    /**\n     * @dev Returns the remaining number of tokens that `spender` will be\n     * allowed to spend on behalf of `owner` through {transferFrom}. This is\n     * zero by default.\n     *\n     * This value changes when {approve} or {transferFrom} are called.\n     */\n    function allowance(address owner, address spender) external view returns (uint256);\n\n    /**\n     * @dev Sets `amount` as the allowance of `spender` over the caller's tokens.\n     *\n     * Returns a boolean value indicating whether the operation succeeded.\n     *\n     * IMPORTANT: Beware that changing an allowance with this method brings the risk\n     * that someone may use both the old and the new allowance by unfortunate\n     * transaction ordering. One possible solution to mitigate this race\n     * condition is to first reduce the spender's allowance to 0 and set the\n     * desired value afterwards:\n     * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729\n     *\n     * Emits an {Approval} event.\n     */\n    function approve(address spender, uint256 amount) external returns (bool);\n\n    /**\n     * @dev Moves `amount` tokens from `from` to `to` using the\n     * allowance mechanism. `amount` is then deducted from the caller's\n     * allowance.\n     *\n     * Returns a boolean value indicating whether the operation succeeded.\n     *\n     * Emits a {Transfer} event.\n     */\n    function transferFrom(\n        address from,\n        address to,\n        uint256 amount\n    ) external returns (bool);\n}\n","keccak256":"0x9750c6b834f7b43000631af5cc30001c5f547b3ceb3635488f140f60e897ea6b","license":"MIT"},"@uniswap/v3-periphery/contracts/libraries/TransferHelper.sol":{"content":"// SPDX-License-Identifier: GPL-2.0-or-later\npragma solidity >=0.6.0;\n\nimport '@openzeppelin/contracts/token/ERC20/IERC20.sol';\n\nlibrary TransferHelper {\n    /// @notice Transfers tokens from the targeted address to the given destination\n    /// @notice Errors with 'STF' if transfer fails\n    /// @param token The contract address of the token to be transferred\n    /// @param from The originating address from which the tokens will be transferred\n    /// @param to The destination address of the transfer\n    /// @param value The amount to be transferred\n    function safeTransferFrom(\n        address token,\n        address from,\n        address to,\n        uint256 value\n    ) internal {\n        (bool success, bytes memory data) =\n            token.call(abi.encodeWithSelector(IERC20.transferFrom.selector, from, to, value));\n        require(success && (data.length == 0 || abi.decode(data, (bool))), 'STF');\n    }\n\n    /// @notice Transfers tokens from msg.sender to a recipient\n    /// @dev Errors with ST if transfer fails\n    /// @param token The contract address of the token which will be transferred\n    /// @param to The recipient of the transfer\n    /// @param value The value of the transfer\n    function safeTransfer(\n        address token,\n        address to,\n        uint256 value\n    ) internal {\n        (bool success, bytes memory data) = token.call(abi.encodeWithSelector(IERC20.transfer.selector, to, value));\n        require(success && (data.length == 0 || abi.decode(data, (bool))), 'ST');\n    }\n\n    /// @notice Approves the stipulated contract to spend the given allowance in the given token\n    /// @dev Errors with 'SA' if transfer fails\n    /// @param token The contract address of the token to be approved\n    /// @param to The target of the approval\n    /// @param value The amount of the given token the target will be allowed to spend\n    function safeApprove(\n        address token,\n        address to,\n        uint256 value\n    ) internal {\n        (bool success, bytes memory data) = token.call(abi.encodeWithSelector(IERC20.approve.selector, to, value));\n        require(success && (data.length == 0 || abi.decode(data, (bool))), 'SA');\n    }\n\n    /// @notice Transfers ETH to the recipient address\n    /// @dev Fails with `STE`\n    /// @param to The destination of the transfer\n    /// @param value The value to be transferred\n    function safeTransferETH(address to, uint256 value) internal {\n        (bool success, ) = to.call{value: value}(new bytes(0));\n        require(success, 'STE');\n    }\n}\n","keccak256":"0x9af98b0908c96320ca6d08b22f0efca864742f6adbe5794cafe2d1d2e808b0cd","license":"GPL-2.0-or-later"},"contracts/BytesLib.sol":{"content":"//SPDX-License-Identifier: AGPL-3.0-or-later\n/*\n * @title Solidity Bytes Arrays Utils\n * @author Gon\u00e7alo S\u00e1 <goncalo.sa@consensys.net>\n *\n * @dev Bytes tightly packed arrays utility library for ethereum contracts written in Solidity.\n *      The library lets you concatenate, slice and type cast bytes arrays both in memory and storage.\n */\npragma solidity ^0.8.0;\n\nlibrary BytesLib {\n    function slice(\n        bytes memory _bytes,\n        uint256 _start,\n        uint256 _length\n    ) internal pure returns (bytes memory) {\n        require(_length + 31 >= _length, \"slice_overflow\");\n        require(_start + _length >= _start, \"slice_overflow\");\n        require(_bytes.length >= _start + _length, \"slice_outOfBounds\");\n\n        bytes memory tempBytes;\n\n        assembly {\n            switch iszero(_length)\n            case 0 {\n                // Get a location of some free memory and store it in tempBytes as\n                // Solidity does for memory variables.\n                tempBytes := mload(0x40)\n\n                // The first word of the slice result is potentially a partial\n                // word read from the original array. To read it, we calculate\n                // the length of that partial word and start copying that many\n                // bytes into the array. The first word we copy will start with\n                // data we don\"t care about, but the last `lengthmod` bytes will\n                // land at the beginning of the contents of the new array. When\n                // we\"re done copying, we overwrite the full first word with\n                // the actual length of the slice.\n                let lengthmod := and(_length, 31)\n\n                // The multiplication in the next line is necessary\n                // because when slicing multiples of 32 bytes (lengthmod == 0)\n                // the following copy loop was copying the origin\"s length\n                // and then ending prematurely not copying everything it should.\n                let mc := add(add(tempBytes, lengthmod), mul(0x20, iszero(lengthmod)))\n                let end := add(mc, _length)\n\n                for {\n                    // The multiplication in the next line has the same exact purpose\n                    // as the one above.\n                    let cc := add(add(add(_bytes, lengthmod), mul(0x20, iszero(lengthmod))), _start)\n                } lt(mc, end) {\n                    mc := add(mc, 0x20)\n                    cc := add(cc, 0x20)\n                } {\n                    mstore(mc, mload(cc))\n                }\n\n                mstore(tempBytes, _length)\n\n                //update free-memory pointer\n                //allocating the array padded to 32 bytes like the compiler does now\n                mstore(0x40, and(add(mc, 31), not(31)))\n            }\n            //if we want a zero-length slice let\"s just return a zero-length array\n            default {\n                tempBytes := mload(0x40)\n                //zero out the 32 bytes slice we are about to return\n                //we need to do it because Solidity does not garbage collect\n                mstore(tempBytes, 0)\n\n                mstore(0x40, add(tempBytes, 0x20))\n            }\n        }\n\n        return tempBytes;\n    }\n\n    function toAddress(bytes memory _bytes, uint256 _start) internal pure returns (address) {\n        require(_start + 20 >= _start, \"toAddress_overflow\");\n        require(_bytes.length >= _start + 20, \"toAddress_outOfBounds\");\n        address tempAddress;\n\n        assembly {\n            tempAddress := div(mload(add(add(_bytes, 0x20), _start)), 0x1000000000000000000000000)\n        }\n\n        return tempAddress;\n    }\n\n    function toUint24(bytes memory _bytes, uint256 _start) internal pure returns (uint24) {\n        require(_start + 3 >= _start, \"toUint24_overflow\");\n        require(_bytes.length >= _start + 3, \"toUint24_outOfBounds\");\n        uint24 tempUint;\n\n        assembly {\n            tempUint := mload(add(add(_bytes, 0x3), _start))\n        }\n\n        return tempUint;\n    }\n}\n","keccak256":"0x10d6970171336bca4c49a63eadbb0aa851b250efc51066ff1ffe77de4254665e","license":"AGPL-3.0-or-later"},"contracts/Payroll.sol":{"content":"//SPDX-License-Identifier: AGPL-3.0-or-later\n\npragma solidity ^0.8.0;\npragma abicoder v2;\n\nimport \"@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol\";\nimport \"@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol\";\nimport \"@openzeppelin/contracts-upgradeable/security/ReentrancyGuardUpgradeable.sol\";\nimport \"./interfaces/IERC20Basic.sol\";\nimport \"./interfaces/IWETH.sol\";\nimport \"./interfaces/IUniswap.sol\";\nimport \"@uniswap/v3-periphery/contracts/libraries/TransferHelper.sol\";\nimport \"./BytesLib.sol\";\n\n/**\n * @title Think and Dev Paymentbox\n * @author Think and Dev Team\n * @notice Swap and transfer multiple ERC20 pairs to multiple accounts in a single transaction.\n * Use any router address of any DEX that uses Uniswap protocol v2 or v3 to make swaps.\n */\ncontract Payroll is Initializable, OwnableUpgradeable, ReentrancyGuardUpgradeable {\n    using BytesLib for bytes;\n    /**\n     * Returns the address of the Uniswap protocol router, it could be v2 or v3.\n     */\n    address public swapRouter;\n    address public feeAddress;\n    uint256 public fee;\n    uint256 public constant MANTISSA = 1e18;\n    uint256 public version;\n\n    /**\n     * Returns if the contract is working with a v2 Uniswap protocol;\n     * true means v2, false means v3.\n     */\n    bool public isSwapV2;\n\n    struct Payment {\n        address token;\n        address[] receivers;\n        uint256[] amountsToTransfer;\n    }\n\n    struct SwapV2 {\n        uint256 amountOut;\n        uint256 amountInMax;\n        address[] path;\n    }\n\n    struct SwapV3 {\n        uint256 amountOut;\n        uint256 amountInMax;\n        bytes path;\n    }\n\n    event SwapRouterChanged(address _swapRouter, bool _isSwapV2);\n    event FeeChanged(uint256 _fee);\n    event UpdatedVersion(uint256 _version);\n    event FeeCharged(address _erc20TokenAddress, address _feeAddress, uint256 _fees);\n    event FeeAddressChanged(address _feeAddress);\n    event BatchPayment(address _erc20TokenAddress, address[] _receivers, uint256[] _amountsToTransfer);\n    event SwapFinished(address _tokenIn, address _tokenOut, uint256 _amountReceived);\n\n    /**\n     * @param _swapRouter Router address to execute swaps.\n     * @param _isSwapV2 Boolean to specify the version of the router; true means v2, false means v3.\n     */\n    function initialize(\n        address _swapRouter,\n        bool _isSwapV2,\n        address _feeAddress,\n        uint256 _fee\n    ) public initializer {\n        __ReentrancyGuard_init();\n        __Ownable_init();\n        _setSwapRouter(_swapRouter, _isSwapV2);\n        _setFeeAddress(_feeAddress);\n        _setFee(_fee);\n        _setVersion(1);\n    }\n\n    /**\n     * Set the fee that will be charged, fees are divided by mantissa\n     * @param _fee Percentage that will be charged.\n     */\n    function setFee(uint256 _fee) external onlyOwner {\n        _setFee(_fee);\n    }\n\n    function setVersion(uint256 _version) external onlyOwner {\n        _setVersion(_version);\n    }\n\n    function _setVersion(uint256 _version) internal {\n        require(_version > 0, \"Payroll: Version can't be 0\");\n        version = _version;\n        emit UpdatedVersion(_version);\n    }\n\n    function _setFee(uint256 _fee) internal {\n        require(_fee < 3e16, \"Payroll: Fee should be less than 3%\");\n        fee = _fee;\n        emit FeeChanged(_fee);\n    }\n\n    /**\n     * Set the address that will receive the fees.\n     * @param _feeAddress Address that will receive the fees.\n     */\n    function setFeeAddress(address _feeAddress) external onlyOwner {\n        _setFeeAddress(_feeAddress);\n    }\n\n    function _setFeeAddress(address _feeAddress) internal {\n        require(_feeAddress != address(0), \"Payroll: Fee address can't be 0\");\n        feeAddress = _feeAddress;\n        emit FeeAddressChanged(_feeAddress);\n    }\n\n    /**\n     * Set the SwapRouter and the version to be used.\n     * @param _swapRouter Router address to execute swaps.\n     * @param _isSwapV2 Boolean to specify the version of the router; true means v2, false means v3.\n     */\n    function setSwapRouter(address _swapRouter, bool _isSwapV2) external onlyOwner {\n        _setSwapRouter(_swapRouter, _isSwapV2);\n    }\n\n    function _setSwapRouter(address _swapRouter, bool _isSwapV2) internal {\n        require(_swapRouter != address(0), \"Payroll: Cannot set a 0 address as swapRouter\");\n        isSwapV2 = _isSwapV2;\n        swapRouter = _swapRouter;\n        emit SwapRouterChanged(_swapRouter, _isSwapV2);\n    }\n\n    /**\n     * Approves the following token to be used on swapRouter\n     * @param _erc20TokenOrigin ERC20 token address to approve.\n     */\n    function approveTokens(address[] calldata _erc20TokenOrigin) external nonReentrant {\n        for (uint256 i = 0; i < _erc20TokenOrigin.length; i++) {\n            // approves the swapRouter to spend totalAmountToSpend of erc20TokenOrigin\n            TransferHelper.safeApprove(_erc20TokenOrigin[i], address(swapRouter), type(uint256).max);\n        }\n    }\n\n    /**\n     * Perform the swap with Uniswap V3 and the transfer to the given addresses.\n     * @param _erc20TokenOrigin ERC20 token address to swap for another.\n     * @param _totalAmountToSwap Total amount of erc20TokenOrigin to spend in swaps.\n     * @param _deadline The unix timestamp after a swap will fail.\n     * @param _swaps The array of the Swaps data.\n     * @param _payments The array of the Payment data.\n     * @notice Swap ERC20 to ERC20.\n     * @notice Available to send ETH or ERC20.\n     */\n    function performSwapV3AndPayment(\n        address _erc20TokenOrigin,\n        uint256 _totalAmountToSwap,\n        uint32 _deadline,\n        SwapV3[] calldata _swaps,\n        Payment[] calldata _payments\n    ) external payable nonReentrant {\n        require(!isSwapV2, \"Payroll: Not uniswapV3\");\n        if (_swaps.length > 0) {\n            _performSwapV3(_erc20TokenOrigin, _totalAmountToSwap, _deadline, _swaps);\n        }\n\n        _performMultiPayment(_payments);\n        refundETH();\n    }\n\n    /**\n     * Perform the swap with Uniswap V3 and the transfer to the given addresses.\n     * @param _totalAmountToSwap Total amount of erc20TokenOrigin to spend in swaps.\n     * @param _deadline The unix timestamp after a swap will fail.\n     * @param _swaps The array of the Swaps data.\n     * @param _payments The array of the Payment data.\n     * @notice Swap ETH to ERC20.\n     * @notice Available to send ETH or ERC20.\n     */\n    function performSwapV3AndPaymentETH(\n        uint256 _totalAmountToSwap,\n        uint32 _deadline,\n        SwapV3[] calldata _swaps,\n        Payment[] calldata _payments\n    ) external payable nonReentrant {\n        require(!isSwapV2, \"Payroll: Not uniswapV3\");\n        if (_swaps.length > 0) {\n            _performSwapV3ETH(_totalAmountToSwap, _deadline, _swaps);\n        }\n\n        _performMultiPayment(_payments);\n        refundETH();\n    }\n\n    /**\n     * Perform the swap with Uniswap V3 to the given token addresses and amounts.\n     * @param _erc20TokenOrigin ERC20 token address to swap for another.\n     * @param _totalAmountToSwap Total amount of erc20TokenOrigin to spend in swaps.\n     * @param _deadline The unix timestamp after a swap will fail.\n     * @param _swaps The array of the Swaps data.\n     * @notice Swap ERC20 to ERC20.\n     */\n    function performSwapV3(\n        address _erc20TokenOrigin,\n        uint256 _totalAmountToSwap,\n        uint32 _deadline,\n        SwapV3[] calldata _swaps\n    ) external nonReentrant {\n        require(!isSwapV2, \"Payroll: Not uniswapV3\");\n        require(_swaps.length > 0, \"Payroll: Empty swaps\");\n        _performSwapV3(_erc20TokenOrigin, _totalAmountToSwap, _deadline, _swaps);\n        refundETH();\n    }\n\n    /**\n     * Perform the swap with Uniswap V3 to the given token addresses and amounts.\n     * @param _totalAmountToSwap Total amount of erc20TokenOrigin to spend in swaps.\n     * @param _deadline The unix timestamp after a swap will fail.\n     * @param _swaps The array of the Swaps data.\n     * @notice Swap ETH to ERC20.\n     */\n    function performSwapV3ETH(\n        uint256 _totalAmountToSwap,\n        uint32 _deadline,\n        SwapV3[] calldata _swaps\n    ) external payable nonReentrant {\n        require(!isSwapV2, \"Payroll: Not uniswapV3\");\n        require(_swaps.length > 0, \"Payroll: Empty swaps\");\n        _performSwapV3ETH(_totalAmountToSwap, _deadline, _swaps);\n        refundETH();\n    }\n\n    function _performSwapV3(\n        address _erc20TokenOrigin,\n        uint256 _totalAmountToSwap,\n        uint32 _deadline,\n        SwapV3[] calldata _swaps\n    ) internal {\n        // transfer the totalAmountToSpend of erc20TokenOrigin from the msg.sender to this contract\n        // msg.sender must approve this contract for erc20TokenOrigin\n        TransferHelper.safeTransferFrom(_erc20TokenOrigin, msg.sender, address(this), _totalAmountToSwap);\n        // Celo does not use V3\n        address weth = IUniswapV3(swapRouter).WETH9();\n        uint256 amountIn = 0;\n\n        for (uint256 i = 0; i < _swaps.length; i++) {\n            require(_swaps[i].path.length > 0, \"Payroll: Empty path\");\n            require(\n                _swaps[i].path.toAddress(_swaps[i].path.length - 20) == _erc20TokenOrigin,\n                \"Payroll: Swap not token origin\"\n            );\n            // get the token to swap, it is at position 0 of the byte array\n            address tokenTo = _swaps[i].path.toAddress(0);\n\n            if (tokenTo == weth) {\n                // if tokenTo is WETH, the contract needs to receive it to convert it to ETH and use it in payments (if needed)\n                // then it will be refunded to msg.sender\n                amountIn = IUniswapV3(swapRouter).exactOutput(\n                    IUniswapV3.ExactOutputParams({\n                        path: _swaps[i].path,\n                        recipient: address(this),\n                        deadline: _deadline,\n                        amountOut: _swaps[i].amountOut,\n                        amountInMaximum: _swaps[i].amountInMax\n                    })\n                );\n\n                // receives WETH, so converts it to ETH\n                IWETH(weth).withdraw(_swaps[i].amountOut);\n            } else {\n                // if tokenTo is any ERC20 the recipient is the msg.sender\n                amountIn = IUniswapV3(swapRouter).exactOutput(\n                    IUniswapV3.ExactOutputParams({\n                        path: _swaps[i].path,\n                        recipient: msg.sender,\n                        deadline: _deadline,\n                        amountOut: _swaps[i].amountOut,\n                        amountInMaximum: _swaps[i].amountInMax\n                    })\n                );\n            }\n\n            emit SwapFinished(_erc20TokenOrigin, tokenTo, amountIn);\n        }\n\n        uint256 leftOver = IERC20Basic(_erc20TokenOrigin).balanceOf(address(this));\n        if (leftOver > 0) {\n            // return the leftover of _erc20TokenOrigin\n            TransferHelper.safeTransfer(_erc20TokenOrigin, msg.sender, leftOver);\n        }\n    }\n\n    function _performSwapV3ETH(\n        uint256 _totalAmountToSwap,\n        uint32 _deadline,\n        SwapV3[] calldata _swaps\n    ) internal {\n        require(msg.value >= _totalAmountToSwap, \"Payroll: Not enough msg.value\");\n        // Celo does not use V3\n        address weth = IUniswapV3(swapRouter).WETH9();\n\n        for (uint256 i = 0; i < _swaps.length; i++) {\n            require(_swaps[i].path.length > 0, \"Payroll: Empty path\");\n            require(_swaps[i].path.toAddress(_swaps[i].path.length - 20) == weth, \"Payroll: Swap not native token\");\n            uint256 amountIn = IUniswapV3(swapRouter).exactOutput{value: _swaps[i].amountInMax}(\n                IUniswapV3.ExactOutputParams({\n                    path: _swaps[i].path,\n                    recipient: msg.sender,\n                    deadline: _deadline,\n                    amountOut: _swaps[i].amountOut,\n                    amountInMaximum: _swaps[i].amountInMax\n                })\n            );\n            emit SwapFinished(address(0), _swaps[i].path.toAddress(0), amountIn);\n        }\n\n        // Explicitly request ETH refound\n        IUniswapV3(swapRouter).refundETH();\n    }\n\n    /**\n     * Perform the swap with Uniswap V2 and the transfer to the given addresses.\n     * @param _erc20TokenOrigin ERC20 token address to swap for another.\n     * @param _totalAmountToSwap Total amount of erc20TokenOrigin to spend in swaps.\n     * @param _deadline The unix timestamp after a swap will fail.\n     * @param _swaps The array of the Swaps data.\n     * @param _payments The array of the Payment data.\n     * @notice Swap ERC20 to ERC20.\n     * @notice Available to send ETH or ERC20.\n     */\n    function performSwapV2AndPayment(\n        address _erc20TokenOrigin,\n        uint256 _totalAmountToSwap,\n        uint32 _deadline,\n        SwapV2[] calldata _swaps,\n        Payment[] calldata _payments\n    ) external payable nonReentrant {\n        require(isSwapV2, \"Payroll: Not uniswapV2\");\n        if (_swaps.length > 0) {\n            _performSwapV2(_erc20TokenOrigin, _totalAmountToSwap, _deadline, _swaps);\n        }\n\n        _performMultiPayment(_payments);\n        refundETH();\n    }\n\n    /**\n     * Perform the swap with Uniswap V2 and the transfer to the given addresses.\n     * @param _totalAmountToSwap Total amount of erc20TokenOrigin to spend in swaps.\n     * @param _deadline The unix timestamp after a swap will fail.\n     * @param _swaps The array of the Swaps data.\n     * @param _payments The array of the Payment data.\n     * @notice Swap ETH to ERC20.\n     * @notice Available to send ETH or ERC20.\n     */\n    function performSwapV2AndPaymentETH(\n        uint256 _totalAmountToSwap,\n        uint32 _deadline,\n        SwapV2[] calldata _swaps,\n        Payment[] calldata _payments\n    ) external payable nonReentrant {\n        require(isSwapV2, \"Payroll: Not uniswapV2\");\n        if (_swaps.length > 0) {\n            _performSwapV2ETH(_totalAmountToSwap, _deadline, _swaps);\n        }\n\n        _performMultiPayment(_payments);\n        refundETH();\n    }\n\n    /**\n     * Perform the swap with Uniswap V2 to the given token addresses and amounts.\n     * @param _erc20TokenOrigin ERC20 token address to swap for another.\n     * @param _totalAmountToSwap Total amount of erc20TokenOrigin to spend in swaps.\n     * @param _deadline The unix timestamp after a swap will fail.\n     * @param _swaps The array of the Swaps data.\n     * @notice Swap ERC20 to ERC20.\n     */\n    function performSwapV2(\n        address _erc20TokenOrigin,\n        uint256 _totalAmountToSwap,\n        uint32 _deadline,\n        SwapV2[] calldata _swaps\n    ) external nonReentrant {\n        require(isSwapV2, \"Payroll: Not uniswapV2\");\n        require(_swaps.length > 0, \"Payroll: Empty swaps\");\n        _performSwapV2(_erc20TokenOrigin, _totalAmountToSwap, _deadline, _swaps);\n        refundETH();\n    }\n\n    /**\n     * Perform the swap with Uniswap V2 to the given token addresses and amounts.\n     * @param _totalAmountToSwap Total amount of erc20TokenOrigin to spend in swaps.\n     * @param _deadline The unix timestamp after a swap will fail.\n     * @param _swaps The array of the Swaps data.\n     * @notice Swap ETH to ERC20.\n     */\n    function performSwapV2ETH(\n        uint256 _totalAmountToSwap,\n        uint32 _deadline,\n        SwapV2[] calldata _swaps\n    ) external payable nonReentrant {\n        require(isSwapV2, \"Payroll: Not uniswapV2\");\n        require(_swaps.length > 0, \"Payroll: Empty swaps\");\n        _performSwapV2ETH(_totalAmountToSwap, _deadline, _swaps);\n        refundETH();\n    }\n\n    function _swapTokensForExactETH(\n        uint256 amountOut,\n        uint256 amountInMax,\n        address[] calldata path,\n        address to,\n        uint256 deadline\n    ) internal virtual returns (uint256 amounts) {\n        return IUniswapV2(swapRouter).swapTokensForExactETH(amountOut, amountInMax, path, to, deadline)[0];\n    }\n\n    function _swapTokensForExactTokens(\n        uint256 amountOut,\n        uint256 amountInMax,\n        address[] calldata path,\n        address to,\n        uint256 deadline\n    ) internal virtual returns (uint256 amounts) {\n        return IUniswapV2(swapRouter).swapTokensForExactTokens(amountOut, amountInMax, path, to, deadline)[0];\n    }\n\n    function _performSwapV2(\n        address _erc20TokenOrigin,\n        uint256 _totalAmountToSwap,\n        uint32 _deadline,\n        SwapV2[] calldata _swaps\n    ) internal {\n        // transfer the totalAmountToSpend of erc20TokenOrigin from the msg.sender to this contract\n        // msg.sender must approve this contract for erc20TokenOrigin\n        TransferHelper.safeTransferFrom(_erc20TokenOrigin, msg.sender, address(this), _totalAmountToSwap);\n        uint256 amountIn = 0;\n        address weth = address(0);\n        // Celo Native currency is an ERC20\n        if (block.chainid != 42220 && block.chainid != 44787) {\n            weth = _weth();\n        }\n\n        for (uint256 i = 0; i < _swaps.length; i++) {\n            require(_swaps[i].path.length > 0, \"Payroll: Empty path\");\n            require(_swaps[i].path[0] == _erc20TokenOrigin, \"Payroll: Swap not token origin\");\n            if (_swaps[i].path[_swaps[i].path.length - 1] == weth) {\n                // if tokenTo is WETH, the contract needs to receive it to use it in payments (if needed)\n                // then it will be refunded to msg.sender\n                amountIn = _swapTokensForExactETH(\n                    _swaps[i].amountOut,\n                    _swaps[i].amountInMax,\n                    _swaps[i].path,\n                    address(this),\n                    _deadline\n                );\n            } else {\n                // if tokenTo is any ERC20 the recipient is the msg.sender\n                amountIn = _swapTokensForExactTokens(\n                    _swaps[i].amountOut,\n                    _swaps[i].amountInMax,\n                    _swaps[i].path,\n                    msg.sender,\n                    _deadline\n                );\n            }\n            emit SwapFinished(_erc20TokenOrigin, _swaps[i].path[_swaps[i].path.length - 1], amountIn);\n        }\n\n        uint256 leftOver = IERC20Basic(_erc20TokenOrigin).balanceOf(address(this));\n        if (leftOver > 0) {\n            // return the leftover of _erc20TokenOrigin\n            TransferHelper.safeTransfer(_erc20TokenOrigin, msg.sender, leftOver);\n        }\n    }\n\n    function _swapETHForExactTokens(\n        uint256 amountOut,\n        uint256 amountInMax,\n        address[] calldata path,\n        address to,\n        uint256 deadline\n    ) internal virtual returns (uint256 amounts) {\n        return IUniswapV2(swapRouter).swapETHForExactTokens{value: amountInMax}(amountOut, path, to, deadline)[0];\n    }\n\n    function _weth() internal view virtual returns (address) {\n        return IUniswapV2(swapRouter).WETH();\n    }\n\n    function _performSwapV2ETH(\n        uint256 _totalAmountToSwap,\n        uint32 _deadline,\n        SwapV2[] calldata _swaps\n    ) internal {\n        require(msg.value >= _totalAmountToSwap, \"Payroll: Not enough msg.value\");\n        // We should not use this method in Celo, instead use _performSwapV2\n        address weth = _weth();\n\n        for (uint256 i = 0; i < _swaps.length; i++) {\n            require(_swaps[i].path.length > 0, \"Payroll: Empty path\");\n            require(_swaps[i].path[0] == weth, \"Payroll: Swap not native token\");\n            // return the amount spend of tokenIn\n            uint256 amountIn = _swapETHForExactTokens(\n                _swaps[i].amountOut,\n                _swaps[i].amountInMax,\n                _swaps[i].path,\n                msg.sender,\n                _deadline\n            );\n            address[] calldata path = _swaps[i].path;\n            emit SwapFinished(address(0), path[path.length - 1], amountIn);\n        }\n    }\n\n    /**\n     * Perform the payments to the given addresses and amounts, public method.\n     * @param _payments The array of the Payment data.\n     * @notice Available to send ETH or ERC20.\n     */\n    function performMultiPayment(Payment[] calldata _payments) external payable nonReentrant {\n        _performMultiPayment(_payments);\n        refundETH();\n    }\n\n    function _performMultiPayment(Payment[] calldata _payments) internal {\n        for (uint256 i = 0; i < _payments.length; i++) {\n            require(_payments[i].amountsToTransfer.length > 0, \"Payroll: No amounts to transfer\");\n            require(\n                _payments[i].amountsToTransfer.length == _payments[i].receivers.length,\n                \"Payroll: Arrays must have same length\"\n            );\n\n            if (_payments[i].token != address(0)) {\n                _performERC20Payment(_payments[i].token, _payments[i].receivers, _payments[i].amountsToTransfer);\n            } else {\n                _performETHPayment(_payments[i].token, _payments[i].receivers, _payments[i].amountsToTransfer);\n            }\n        }\n    }\n\n    /**\n     * Performs the ERC20 payment to the given addresses.\n     * @param _erc20TokenAddress The address of the ERC20 token to transfer.\n     * @param _receivers The array of payment receivers.\n     * @param _amountsToTransfer The array of payments' amounts to perform.\n     * The amount will be transfered to the address on _receivers with the same index.\n     */\n    function _performERC20Payment(\n        address _erc20TokenAddress,\n        address[] calldata _receivers,\n        uint256[] calldata _amountsToTransfer\n    ) internal {\n        uint256 acumulatedFee = 0;\n        uint256 totalAmountSent = 0;\n\n        for (uint256 i = 0; i < _receivers.length; i++) {\n            require(_receivers[i] != address(0), \"Payroll: Cannot send to a 0 address\");\n            totalAmountSent = totalAmountSent + _amountsToTransfer[i];\n            TransferHelper.safeTransferFrom(_erc20TokenAddress, msg.sender, _receivers[i], _amountsToTransfer[i]);\n        }\n        emit BatchPayment(_erc20TokenAddress, _receivers, _amountsToTransfer);\n\n        acumulatedFee = (totalAmountSent * fee) / MANTISSA;\n        if (acumulatedFee > 0) {\n            TransferHelper.safeTransferFrom(_erc20TokenAddress, msg.sender, feeAddress, acumulatedFee);\n        }\n        emit FeeCharged(_erc20TokenAddress, feeAddress, acumulatedFee);\n    }\n\n    /**\n     * Performs the ETH payment to the given addresses.\n     * @param _receivers The array of payment receivers.\n     * @param _amountsToTransfer The array of payments' amounts to perform.\n     * The amount will be transfered to the address on _receivers with the same index.\n     */\n    function _performETHPayment(\n        address _erc20TokenAddress,\n        address[] calldata _receivers,\n        uint256[] calldata _amountsToTransfer\n    ) internal {\n        uint256 acumulatedFee = 0;\n        uint256 totalAmountSent = 0;\n\n        for (uint256 i = 0; i < _receivers.length; i++) {\n            require(_receivers[i] != address(0), \"Payroll: Cannot send to a 0 address\");\n            totalAmountSent = totalAmountSent + _amountsToTransfer[i];\n\n            (bool success, ) = payable(_receivers[i]).call{value: _amountsToTransfer[i]}(\"\");\n            require(success, \"Payroll: ETH transfer failed\");\n        }\n        emit BatchPayment(_erc20TokenAddress, _receivers, _amountsToTransfer);\n\n        acumulatedFee = (totalAmountSent * fee) / MANTISSA;\n        if (acumulatedFee > 0) {\n            totalAmountSent = totalAmountSent + acumulatedFee;\n            (bool success, ) = payable(feeAddress).call{value: acumulatedFee}(\"\");\n            require(success, \"Payroll: ETH fee transfer failed\");\n        }\n        emit FeeCharged(_erc20TokenAddress, feeAddress, acumulatedFee);\n    }\n\n    /**\n     * Perform the refound of the leftover ETH.\n     */\n    function refundETH() internal {\n        uint256 leftOver = address(this).balance;\n        if (leftOver > 1) {\n            (bool success, ) = payable(msg.sender).call{value: leftOver}(\"\");\n            require(success, \"Payroll: ETH leftOver transfer failed\");\n        }\n    }\n\n    receive() external payable {}\n}\n","keccak256":"0x7fe9ef315f52801c505a0f6cf7617c72e41f4ff2e3f70069747d91bd29e4f518","license":"AGPL-3.0-or-later"},"contracts/interfaces/IERC20Basic.sol":{"content":"//SPDX-License-Identifier: AGPL-3.0-or-later\n\npragma solidity ^0.8.0;\n\n/**\n * @title ERC20Basic\n * @dev Simpler version of ERC20 interface\n */\ninterface IERC20Basic {\n    function transferFrom(\n        address from,\n        address to,\n        uint256 value\n    ) external returns (bool);\n\n    function balanceOf(address account) external view returns (uint256);\n\n    event Transfer(address indexed from, address indexed to, uint256 value);\n}\n","keccak256":"0x3c0c04761983cc5575bb5a14f1770526759be908a37ae9daf0ca669de1933756","license":"AGPL-3.0-or-later"},"contracts/interfaces/IUniswap.sol":{"content":"//SPDX-License-Identifier: AGPL-3.0-or-later\n\npragma solidity ^0.8.0;\n\n/**\n * @title UniswapV2\n * @dev Simpler version of Uniswap v2 and v3 protocol interface\n */\ninterface IUniswapV2 {\n    //Uniswap V2\n    function WETH() external pure returns (address);\n\n    function factory() external pure returns (address);\n\n    function swapTokensForExactTokens(\n        uint256 amountOut,\n        uint256 amountInMax,\n        address[] calldata path,\n        address to,\n        uint256 deadline\n    ) external returns (uint256[] memory amounts);\n\n    function swapTokensForExactETH(\n        uint256 amountOut,\n        uint256 amountInMax,\n        address[] calldata path,\n        address to,\n        uint256 deadline\n    ) external returns (uint256[] memory amounts);\n\n    function swapETHForExactTokens(\n        uint256 amountOut,\n        address[] calldata path,\n        address to,\n        uint256 deadline\n    ) external payable returns (uint256[] memory amounts);\n\n    // https://docs.uniswap.org/protocol/V2/reference/smart-contracts/router-02#addliquidity\n    function addLiquidity(\n        address tokenA,\n        address tokenB,\n        uint256 amountADesired,\n        uint256 amountBDesired,\n        uint256 amountAMin,\n        uint256 amountBMin,\n        address to,\n        uint256 deadline\n    )\n        external\n        returns (\n            uint256 amountA,\n            uint256 amountB,\n            uint256 liquidity\n        );\n}\n\n/**\n * @title UniswapV2\n * @dev Simpler version of Uniswap v2 and v3 protocol interface\n */\ninterface IUniswapV3 {\n    //UniswapV3\n    struct ExactOutputSingleParams {\n        address tokenIn;\n        address tokenOut;\n        uint24 fee;\n        address recipient;\n        uint256 deadline;\n        uint256 amountOut;\n        uint256 amountInMaximum;\n        uint160 sqrtPriceLimitX96;\n    }\n\n    struct ExactOutputParams {\n        bytes path;\n        address recipient;\n        uint256 deadline;\n        uint256 amountOut;\n        uint256 amountInMaximum;\n    }\n\n    function WETH9() external pure returns (address);\n\n    function refundETH() external payable;\n\n    /// @notice Swaps as little as possible of one token for `amountOut` of another token\n    /// @param params The parameters necessary for the swap, encoded as `ExactOutputSingleParams` in calldata\n    /// @return amountIn The amount of the input token\n    function exactOutputSingle(ExactOutputSingleParams calldata params) external payable returns (uint256 amountIn);\n\n    /// @notice Swaps as little as possible of one token for `amountOut` of another along the specified path (reversed)\n    /// @param params The parameters necessary for the multi-hop swap, encoded as `ExactOutputParams` in calldata\n    /// @return amountIn The amount of the input token\n    function exactOutput(ExactOutputParams calldata params) external payable returns (uint256 amountIn);\n}\n","keccak256":"0x8f017dee784994bea4e428da9c30ff6c44e031d3dfe0306ed9b46c0a1d59cfa4","license":"AGPL-3.0-or-later"},"contracts/interfaces/IWETH.sol":{"content":"//SPDX-License-Identifier: AGPL-3.0-or-later\n\npragma solidity ^0.8.0;\n\n/**\n * @title IWETH\n * @dev Simpler version of IWETH interface\n */\ninterface IWETH {\n    function withdraw(uint256 _amount) external;\n}\n","keccak256":"0xafa7779041c44ce6d089db1b747f71ad9f6fafacde303bcbf96890e68232bf1c","license":"AGPL-3.0-or-later"}},"version":1}