Contract 0x30E95edE0b3C7Ef147EE97A5e88FdE06311EA11f 8

 
Txn Hash Method
Block
From
To
Value
0x370b59a6f315ee61ab0671ffe9641904f50a3ca17854fe3ca201461738ae69e9Swap And Transfe...72556832023-11-29 23:31:534 hrs 35 mins ago0xc271ff2baffbf9f1e3465f6176ac05f8623c356a IN  0x30e95ede0b3c7ef147ee97a5e88fde06311ea11f0.002554518617894 ETH0.0001584913660.000006448
0x96ed547d854db8abb486c4ab868e746ebc9b56bd6e2073e83e2445089089c6c9Transfer Token72497462023-11-29 20:13:597 hrs 53 mins ago0xb6d00d83158fee6695c72ff9c5e915478a479224 IN  0x30e95ede0b3c7ef147ee97a5e88fde06311ea11f0 ETH0.000284837660.100000051
0xf134b7b3c8a5bdf23b3adf7274842193d84049f6b3a612b5275c525ec321b8e7Swap And Transfe...72440032023-11-29 17:02:3311 hrs 4 mins ago0x94643cacf35d6f478ba36e7c38bffe9eb6e531fc IN  0x30e95ede0b3c7ef147ee97a5e88fde06311ea11f0.012904521534024 ETH0.0001964751340.000000781
0x0d22794609112342bdbecf3acf3c7bc4577f7f8091e204e15608b2a990fc25dfTransfer Token72410142023-11-29 15:22:5512 hrs 44 mins ago0xb6d00d83158fee6695c72ff9c5e915478a479224 IN  0x30e95ede0b3c7ef147ee97a5e88fde06311ea11f0 ETH0.00043878580.100000051
0xcf3237e90d10486efbfd5bb0d84841f0882dc9836cda85291b9ea4ae5a6ce6edSwap And Transfe...72259072023-11-29 6:59:2121 hrs 7 mins ago0x77259366ba576cb32c3ccaa211192d276352e3ad IN  0x30e95ede0b3c7ef147ee97a5e88fde06311ea11f0.002517775611748 ETH0.0001374096630.000002678
0x840795795bc529d5342ef0d26b3779e2e8da408e4551cf7c1db8d161bc66fe62Swap And Transfe...72154972023-11-29 1:12:211 day 2 hrs ago0x2ba32e092ffbfbd80f8804355f4a35d9e3aff547 IN  0x30e95ede0b3c7ef147ee97a5e88fde06311ea11f0.002524749070103 ETH0.0001512128820.000004739
0xaa6e7d970c433eea91f4bedcfb29e0615800d24fb35b49ebaf0ef2fcebd7bf48Swap And Transfe...72077942023-11-28 20:55:351 day 7 hrs ago0x94643cacf35d6f478ba36e7c38bffe9eb6e531fc IN  0x30e95ede0b3c7ef147ee97a5e88fde06311ea11f0.002510997272067 ETH0.0002598797470.000004784
0x3be156f1e25e461acfeeeaaa909e6684e0ad691318e52eb69ba399a0c3e062b2Swap And Transfe...72045552023-11-28 19:07:371 day 8 hrs ago0xd2090e7f414849a300c15ec204c16e51b982f7e2 IN  0x30e95ede0b3c7ef147ee97a5e88fde06311ea11f0.002510997272067 ETH0.0003547529590.10000005
0xc1186bf203422fe5bfc6a2d3c33e5324a8fb0119f30e88ff20df4fd1b32642d8Swap And Transfe...72036942023-11-28 18:38:551 day 9 hrs ago0xd2090e7f414849a300c15ec204c16e51b982f7e2 IN  0x30e95ede0b3c7ef147ee97a5e88fde06311ea11f0.002508200450152 ETH0.000352266730.100000052
0x5eace06727aeace6300f9290fcc3d7cf19fc82dd18a6935a75a74e7316f31e29Swap And Transfe...72035322023-11-28 18:33:311 day 9 hrs ago0xd2090e7f414849a300c15ec204c16e51b982f7e2 IN  0x30e95ede0b3c7ef147ee97a5e88fde06311ea11f0.002508200450152 ETH0.0003454581730.100000051
0x77e4799ff8b009efdd0789959d9454e9969d8d0cdaab0fff7253dc2a590ac333Swap And Transfe...72033282023-11-28 18:26:431 day 9 hrs ago0xd2090e7f414849a300c15ec204c16e51b982f7e2 IN  0x30e95ede0b3c7ef147ee97a5e88fde06311ea11f0.002508200450152 ETH0.0003326594680.100000051
0x5eaa076dc94e7f2c4a798e1002ac5559f443c40a8603aa5d5aff6f703f7c1b37Swap And Transfe...72031722023-11-28 18:21:311 day 9 hrs ago0xd2090e7f414849a300c15ec204c16e51b982f7e2 IN  0x30e95ede0b3c7ef147ee97a5e88fde06311ea11f0.002508200450152 ETH0.0003789763490.100000052
0x86a269919811b2b01ed85a193b71cce0cd8f73416574c86458fed3d4cf327529Swap And Transfe...72030352023-11-28 18:16:571 day 9 hrs ago0x94643cacf35d6f478ba36e7c38bffe9eb6e531fc IN  0x30e95ede0b3c7ef147ee97a5e88fde06311ea11f0.002508200450152 ETH0.0003224969220.000007786
0x1c806a8002007b48348cd3183512a171bc4e822384ca542933d271800703134eSwap And Transfe...72030352023-11-28 18:16:571 day 9 hrs ago0xd2090e7f414849a300c15ec204c16e51b982f7e2 IN  0x30e95ede0b3c7ef147ee97a5e88fde06311ea11f0.002508200450152 ETH0.0003481660940.100000051
0x90ff59f38e981f5493b05805b9ad8008735f5e8832c79820e9eb2f8b6559f8c2Swap And Transfe...72029122023-11-28 18:12:511 day 9 hrs ago0xd2090e7f414849a300c15ec204c16e51b982f7e2 IN  0x30e95ede0b3c7ef147ee97a5e88fde06311ea11f0.002508200450152 ETH0.0003547403790.100000052
0x229b9c999b600dc550d4d56550db7a24ae782b9723d7b474fbff3a436d165bbbSwap And Transfe...72000582023-11-28 16:37:431 day 11 hrs ago0xd2090e7f414849a300c15ec204c16e51b982f7e2 IN  0x30e95ede0b3c7ef147ee97a5e88fde06311ea11f0.002545775281521 ETH0.0002314407530.10000005
0xa915a3b999f428033ef321a6e2831c911bc74c943472400eef24b935e0f9eb56Swap And Transfe...71995612023-11-28 16:21:091 day 11 hrs ago0xd2090e7f414849a300c15ec204c16e51b982f7e2 IN  0x30e95ede0b3c7ef147ee97a5e88fde06311ea11f0.002549158774262 ETH0.000250083310.10000005
0x267339473092873aa64657175ef8938385363a5e6b48900c331c24a0173729daSwap And Transfe...71984392023-11-28 15:43:451 day 12 hrs ago0x2059a96525c364560a806ca035a40c9f379ebca9 IN  0x30e95ede0b3c7ef147ee97a5e88fde06311ea11f0.012917266946352 ETH0.0002280374460.000097011
0xb84a3943de3703761089a75d0491be5b0b8b79c8e5a4ebc5b7cc1f64bf9106a6Swap And Transfe...71842852023-11-28 7:51:571 day 20 hrs ago0x9c928c1b01339ebfaf45d400f793989b60b6331e IN  0x30e95ede0b3c7ef147ee97a5e88fde06311ea11f0.01302469336301 ETH0.0001506918960.100000064
0x3a99fc8363beddac03e83cd5304236f197ad615108deecfcf056406242a96e59Swap And Transfe...71759862023-11-28 3:15:192 days 51 mins ago0x510c154054e076597e4f97671694135682036afd IN  0x30e95ede0b3c7ef147ee97a5e88fde06311ea11f0.002556660714526 ETH0.0001907992640.000000461
0x81509096465df30c736f35b9399c07e37c87f27a214070514230084fb42290ebSwap And Transfe...71758912023-11-28 3:12:092 days 55 mins ago0x510c154054e076597e4f97671694135682036afd IN  0x30e95ede0b3c7ef147ee97a5e88fde06311ea11f0.002556660714526 ETH0.0001978607960.00000838
0x25eb55e6257759ae44a480fdd961067c954983f1d9baca6fcfc19378734d6a2cSwap And Transfe...71669852023-11-27 22:15:172 days 5 hrs ago0xd2090e7f414849a300c15ec204c16e51b982f7e2 IN  0x30e95ede0b3c7ef147ee97a5e88fde06311ea11f0.002557671457136 ETH0.0002177973210.10000005
0xf27781d2de14095ca577546471cd6d5a28f5e254ffdc40541885d41b60d543a7Swap And Transfe...71659522023-11-27 21:40:512 days 6 hrs ago0xcdcecbf8c24856bd3292acd19518669eb23d220d IN  0x30e95ede0b3c7ef147ee97a5e88fde06311ea11f0.002555629221358 ETH0.0002211280840.10000005
0x9ff92f9ae9a7b88f0b74eded0749026d0fa64fc8af3f8b18c9ba3c3c0a4ff60bSwap And Transfe...71659032023-11-27 21:39:132 days 6 hrs ago0xcdcecbf8c24856bd3292acd19518669eb23d220d IN  0x30e95ede0b3c7ef147ee97a5e88fde06311ea11f0.002555558674781 ETH0.0001827775460.100000052
0x766b4b21bd3b672cf4a7c6603e0a20db9fff6bbc5c5d72342c9e5d4d5c58beaaSwap And Transfe...71653132023-11-27 21:19:332 days 6 hrs ago0xcdcecbf8c24856bd3292acd19518669eb23d220d IN  0x30e95ede0b3c7ef147ee97a5e88fde06311ea11f0.00256889438208 ETH0.0002094615830.100000055
[ Download CSV Export 
Latest 25 internal transaction
Parent Txn Hash Block From To Value
0x370b59a6f315ee61ab0671ffe9641904f50a3ca17854fe3ca201461738ae69e972556832023-11-29 23:31:534 hrs 35 mins ago 0x30e95ede0b3c7ef147ee97a5e88fde06311ea11f Uniswap: Universal Router0.002554518617894561 ETH
0xf134b7b3c8a5bdf23b3adf7274842193d84049f6b3a612b5275c525ec321b8e772440032023-11-29 17:02:3311 hrs 4 mins ago 0x30e95ede0b3c7ef147ee97a5e88fde06311ea11f Uniswap: Universal Router0.012904521534024179 ETH
0xcf3237e90d10486efbfd5bb0d84841f0882dc9836cda85291b9ea4ae5a6ce6ed72259072023-11-29 6:59:2121 hrs 7 mins ago 0x30e95ede0b3c7ef147ee97a5e88fde06311ea11f Uniswap: Universal Router0.002517775611748598 ETH
0x840795795bc529d5342ef0d26b3779e2e8da408e4551cf7c1db8d161bc66fe6272154972023-11-29 1:12:211 day 2 hrs ago 0x30e95ede0b3c7ef147ee97a5e88fde06311ea11f Uniswap: Universal Router0.002524749070103673 ETH
0xaa6e7d970c433eea91f4bedcfb29e0615800d24fb35b49ebaf0ef2fcebd7bf4872077942023-11-28 20:55:351 day 7 hrs ago 0x30e95ede0b3c7ef147ee97a5e88fde06311ea11f Uniswap: Universal Router0.002510997272067268 ETH
0x3be156f1e25e461acfeeeaaa909e6684e0ad691318e52eb69ba399a0c3e062b272045552023-11-28 19:07:371 day 8 hrs ago 0x30e95ede0b3c7ef147ee97a5e88fde06311ea11f Uniswap: Universal Router0.002510997272067268 ETH
0xc1186bf203422fe5bfc6a2d3c33e5324a8fb0119f30e88ff20df4fd1b32642d872036942023-11-28 18:38:551 day 9 hrs ago 0x30e95ede0b3c7ef147ee97a5e88fde06311ea11f Uniswap: Universal Router0.002508200450152953 ETH
0x5eace06727aeace6300f9290fcc3d7cf19fc82dd18a6935a75a74e7316f31e2972035322023-11-28 18:33:311 day 9 hrs ago 0x30e95ede0b3c7ef147ee97a5e88fde06311ea11f Uniswap: Universal Router0.002508200450152953 ETH
0x77e4799ff8b009efdd0789959d9454e9969d8d0cdaab0fff7253dc2a590ac33372033282023-11-28 18:26:431 day 9 hrs ago 0x30e95ede0b3c7ef147ee97a5e88fde06311ea11f Uniswap: Universal Router0.002508200450152953 ETH
0x5eaa076dc94e7f2c4a798e1002ac5559f443c40a8603aa5d5aff6f703f7c1b3772031722023-11-28 18:21:311 day 9 hrs ago 0x30e95ede0b3c7ef147ee97a5e88fde06311ea11f Uniswap: Universal Router0.002508200450152953 ETH
0x86a269919811b2b01ed85a193b71cce0cd8f73416574c86458fed3d4cf32752972030352023-11-28 18:16:571 day 9 hrs ago 0x30e95ede0b3c7ef147ee97a5e88fde06311ea11f Uniswap: Universal Router0.002508200450152953 ETH
0x1c806a8002007b48348cd3183512a171bc4e822384ca542933d271800703134e72030352023-11-28 18:16:571 day 9 hrs ago 0x30e95ede0b3c7ef147ee97a5e88fde06311ea11f Uniswap: Universal Router0.002508200450152953 ETH
0x90ff59f38e981f5493b05805b9ad8008735f5e8832c79820e9eb2f8b6559f8c272029122023-11-28 18:12:511 day 9 hrs ago 0x30e95ede0b3c7ef147ee97a5e88fde06311ea11f Uniswap: Universal Router0.002508200450152953 ETH
0x229b9c999b600dc550d4d56550db7a24ae782b9723d7b474fbff3a436d165bbb72000582023-11-28 16:37:431 day 11 hrs ago 0x30e95ede0b3c7ef147ee97a5e88fde06311ea11f Uniswap: Universal Router0.002545775281521489 ETH
0xa915a3b999f428033ef321a6e2831c911bc74c943472400eef24b935e0f9eb5671995612023-11-28 16:21:091 day 11 hrs ago 0x30e95ede0b3c7ef147ee97a5e88fde06311ea11f Uniswap: Universal Router0.002549158774262196 ETH
0x267339473092873aa64657175ef8938385363a5e6b48900c331c24a0173729da71984392023-11-28 15:43:451 day 12 hrs ago 0x30e95ede0b3c7ef147ee97a5e88fde06311ea11f Uniswap: Universal Router0.012917266946352417 ETH
0xb84a3943de3703761089a75d0491be5b0b8b79c8e5a4ebc5b7cc1f64bf9106a671842852023-11-28 7:51:571 day 20 hrs ago 0x30e95ede0b3c7ef147ee97a5e88fde06311ea11f Uniswap: Universal Router0.013024693363010784 ETH
0x3a99fc8363beddac03e83cd5304236f197ad615108deecfcf056406242a96e5971759862023-11-28 3:15:192 days 51 mins ago 0x30e95ede0b3c7ef147ee97a5e88fde06311ea11f Uniswap: Universal Router0.002556660714526599 ETH
0x81509096465df30c736f35b9399c07e37c87f27a214070514230084fb42290eb71758912023-11-28 3:12:092 days 55 mins ago 0x30e95ede0b3c7ef147ee97a5e88fde06311ea11f Uniswap: Universal Router0.002556660714526599 ETH
0x25eb55e6257759ae44a480fdd961067c954983f1d9baca6fcfc19378734d6a2c71669852023-11-27 22:15:172 days 5 hrs ago 0x30e95ede0b3c7ef147ee97a5e88fde06311ea11f Uniswap: Universal Router0.002557671457136647 ETH
0xf27781d2de14095ca577546471cd6d5a28f5e254ffdc40541885d41b60d543a771659522023-11-27 21:40:512 days 6 hrs ago 0x30e95ede0b3c7ef147ee97a5e88fde06311ea11f Uniswap: Universal Router0.00255562922135895 ETH
0x9ff92f9ae9a7b88f0b74eded0749026d0fa64fc8af3f8b18c9ba3c3c0a4ff60b71659032023-11-27 21:39:132 days 6 hrs ago 0x30e95ede0b3c7ef147ee97a5e88fde06311ea11f Uniswap: Universal Router0.002555558674781763 ETH
0x766b4b21bd3b672cf4a7c6603e0a20db9fff6bbc5c5d72342c9e5d4d5c58beaa71653132023-11-27 21:19:332 days 6 hrs ago 0x30e95ede0b3c7ef147ee97a5e88fde06311ea11f Uniswap: Universal Router0.002568894382080521 ETH
0x8287afd2a7d95441382be1081037acf54b0df5eaeacbbeae8de258c8445d28ff71635382023-11-27 20:20:232 days 7 hrs ago 0x30e95ede0b3c7ef147ee97a5e88fde06311ea11f Uniswap: Universal Router0.002584087418927414 ETH
0xe83e7a1b4675e655c849a9c2a04857db3a1f8db12cd9e8b79c4c8a5f575015db71534732023-11-27 14:44:532 days 13 hrs ago 0x30e95ede0b3c7ef147ee97a5e88fde06311ea11f Uniswap: Universal Router0.051016911958460321 ETH
[ Download CSV Export 
Loading

Contract Source Code Verified (Exact Match)

Contract Name:
Transfers

Compiler Version
v0.8.17+commit.8df45f5f

Optimization Enabled:
Yes with 100000 runs

Other Settings:
london EvmVersion, Unlicense license
File 1 of 40 : Ownable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.7.0) (access/Ownable.sol)

pragma solidity ^0.8.0;

import "../utils/Context.sol";

/**
 * @dev Contract module which provides a basic access control mechanism, where
 * there is an account (an owner) that can be granted exclusive access to
 * specific functions.
 *
 * By default, the owner account will be the one that deploys the contract. This
 * can later be changed with {transferOwnership}.
 *
 * This module is used through inheritance. It will make available the modifier
 * `onlyOwner`, which can be applied to your functions to restrict their use to
 * the owner.
 */
abstract contract Ownable is Context {
    address private _owner;

    event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);

    /**
     * @dev Initializes the contract setting the deployer as the initial owner.
     */
    constructor() {
        _transferOwnership(_msgSender());
    }

    /**
     * @dev Throws if called by any account other than the owner.
     */
    modifier onlyOwner() {
        _checkOwner();
        _;
    }

    /**
     * @dev Returns the address of the current owner.
     */
    function owner() public view virtual returns (address) {
        return _owner;
    }

    /**
     * @dev Throws if the sender is not the owner.
     */
    function _checkOwner() internal view virtual {
        require(owner() == _msgSender(), "Ownable: caller is not the owner");
    }

    /**
     * @dev 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.
     */
    function renounceOwnership() public virtual onlyOwner {
        _transferOwnership(address(0));
    }

    /**
     * @dev Transfers ownership of the contract to a new account (`newOwner`).
     * Can only be called by the current owner.
     */
    function transferOwnership(address newOwner) public virtual onlyOwner {
        require(newOwner != address(0), "Ownable: new owner is the zero address");
        _transferOwnership(newOwner);
    }

    /**
     * @dev Transfers ownership of the contract to a new account (`newOwner`).
     * Internal function without access restriction.
     */
    function _transferOwnership(address newOwner) internal virtual {
        address oldOwner = _owner;
        _owner = newOwner;
        emit OwnershipTransferred(oldOwner, newOwner);
    }
}

File 2 of 40 : Pausable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.7.0) (security/Pausable.sol)

pragma solidity ^0.8.0;

import "../utils/Context.sol";

/**
 * @dev Contract module which allows children to implement an emergency stop
 * mechanism that can be triggered by an authorized account.
 *
 * This module is used through inheritance. It will make available the
 * modifiers `whenNotPaused` and `whenPaused`, which can be applied to
 * the functions of your contract. Note that they will not be pausable by
 * simply including this module, only once the modifiers are put in place.
 */
abstract contract Pausable is Context {
    /**
     * @dev Emitted when the pause is triggered by `account`.
     */
    event Paused(address account);

    /**
     * @dev Emitted when the pause is lifted by `account`.
     */
    event Unpaused(address account);

    bool private _paused;

    /**
     * @dev Initializes the contract in unpaused state.
     */
    constructor() {
        _paused = false;
    }

    /**
     * @dev Modifier to make a function callable only when the contract is not paused.
     *
     * Requirements:
     *
     * - The contract must not be paused.
     */
    modifier whenNotPaused() {
        _requireNotPaused();
        _;
    }

    /**
     * @dev Modifier to make a function callable only when the contract is paused.
     *
     * Requirements:
     *
     * - The contract must be paused.
     */
    modifier whenPaused() {
        _requirePaused();
        _;
    }

    /**
     * @dev Returns true if the contract is paused, and false otherwise.
     */
    function paused() public view virtual returns (bool) {
        return _paused;
    }

    /**
     * @dev Throws if the contract is paused.
     */
    function _requireNotPaused() internal view virtual {
        require(!paused(), "Pausable: paused");
    }

    /**
     * @dev Throws if the contract is not paused.
     */
    function _requirePaused() internal view virtual {
        require(paused(), "Pausable: not paused");
    }

    /**
     * @dev Triggers stopped state.
     *
     * Requirements:
     *
     * - The contract must not be paused.
     */
    function _pause() internal virtual whenNotPaused {
        _paused = true;
        emit Paused(_msgSender());
    }

    /**
     * @dev Returns to normal state.
     *
     * Requirements:
     *
     * - The contract must be paused.
     */
    function _unpause() internal virtual whenPaused {
        _paused = false;
        emit Unpaused(_msgSender());
    }
}

File 3 of 40 : ReentrancyGuard.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (security/ReentrancyGuard.sol)

pragma solidity ^0.8.0;

/**
 * @dev Contract module that helps prevent reentrant calls to a function.
 *
 * Inheriting from `ReentrancyGuard` will make the {nonReentrant} modifier
 * available, which can be applied to functions to make sure there are no nested
 * (reentrant) calls to them.
 *
 * Note that because there is a single `nonReentrant` guard, functions marked as
 * `nonReentrant` may not call one another. This can be worked around by making
 * those functions `private`, and then adding `external` `nonReentrant` entry
 * points to them.
 *
 * TIP: If you would like to learn more about reentrancy and alternative ways
 * to protect against it, check out our blog post
 * https://blog.openzeppelin.com/reentrancy-after-istanbul/[Reentrancy After Istanbul].
 */
abstract contract ReentrancyGuard {
    // Booleans are more expensive than uint256 or any type that takes up a full
    // word because each write operation emits an extra SLOAD to first read the
    // slot's contents, replace the bits taken up by the boolean, and then write
    // back. This is the compiler's defense against contract upgrades and
    // pointer aliasing, and it cannot be disabled.

    // The values being non-zero value makes deployment a bit more expensive,
    // but in exchange the refund on every call to nonReentrant will be lower in
    // amount. Since refunds are capped to a percentage of the total
    // transaction's gas, it is best to keep them low in cases like this one, to
    // increase the likelihood of the full refund coming into effect.
    uint256 private constant _NOT_ENTERED = 1;
    uint256 private constant _ENTERED = 2;

    uint256 private _status;

    constructor() {
        _status = _NOT_ENTERED;
    }

    /**
     * @dev Prevents a contract from calling itself, directly or indirectly.
     * Calling a `nonReentrant` function from another `nonReentrant`
     * function is not supported. It is possible to prevent this from happening
     * by making the `nonReentrant` function external, and making it call a
     * `private` function that does the actual work.
     */
    modifier nonReentrant() {
        // On the first call to nonReentrant, _notEntered will be true
        require(_status != _ENTERED, "ReentrancyGuard: reentrant call");

        // Any calls to nonReentrant after this point will fail
        _status = _ENTERED;

        _;

        // By storing the original value once again, a refund is triggered (see
        // https://eips.ethereum.org/EIPS/eip-2200)
        _status = _NOT_ENTERED;
    }
}

File 4 of 40 : IERC1155Receiver.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.5.0) (token/ERC1155/IERC1155Receiver.sol)

pragma solidity ^0.8.0;

import "../../utils/introspection/IERC165.sol";

/**
 * @dev _Available since v3.1._
 */
interface IERC1155Receiver is IERC165 {
    /**
     * @dev Handles the receipt of a single ERC1155 token type. This function is
     * called at the end of a `safeTransferFrom` after the balance has been updated.
     *
     * NOTE: To accept the transfer, this must return
     * `bytes4(keccak256("onERC1155Received(address,address,uint256,uint256,bytes)"))`
     * (i.e. 0xf23a6e61, or its own function selector).
     *
     * @param operator The address which initiated the transfer (i.e. msg.sender)
     * @param from The address which previously owned the token
     * @param id The ID of the token being transferred
     * @param value The amount of tokens being transferred
     * @param data Additional data with no specified format
     * @return `bytes4(keccak256("onERC1155Received(address,address,uint256,uint256,bytes)"))` if transfer is allowed
     */
    function onERC1155Received(
        address operator,
        address from,
        uint256 id,
        uint256 value,
        bytes calldata data
    ) external returns (bytes4);

    /**
     * @dev Handles the receipt of a multiple ERC1155 token types. This function
     * is called at the end of a `safeBatchTransferFrom` after the balances have
     * been updated.
     *
     * NOTE: To accept the transfer(s), this must return
     * `bytes4(keccak256("onERC1155BatchReceived(address,address,uint256[],uint256[],bytes)"))`
     * (i.e. 0xbc197c81, or its own function selector).
     *
     * @param operator The address which initiated the batch transfer (i.e. msg.sender)
     * @param from The address which previously owned the token
     * @param ids An array containing ids of each token being transferred (order and length must match values array)
     * @param values An array containing amounts of each token being transferred (order and length must match ids array)
     * @param data Additional data with no specified format
     * @return `bytes4(keccak256("onERC1155BatchReceived(address,address,uint256[],uint256[],bytes)"))` if transfer is allowed
     */
    function onERC1155BatchReceived(
        address operator,
        address from,
        uint256[] calldata ids,
        uint256[] calldata values,
        bytes calldata data
    ) external returns (bytes4);
}

File 5 of 40 : IERC20.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.6.0) (token/ERC20/IERC20.sol)

pragma solidity ^0.8.0;

/**
 * @dev Interface of the ERC20 standard as defined in the EIP.
 */
interface IERC20 {
    /**
     * @dev Emitted when `value` tokens are moved from one account (`from`) to
     * another (`to`).
     *
     * Note that `value` may be zero.
     */
    event Transfer(address indexed from, address indexed to, uint256 value);

    /**
     * @dev Emitted when the allowance of a `spender` for an `owner` is set by
     * a call to {approve}. `value` is the new allowance.
     */
    event Approval(address indexed owner, address indexed spender, uint256 value);

    /**
     * @dev Returns the amount of tokens in existence.
     */
    function totalSupply() external view returns (uint256);

    /**
     * @dev Returns the amount of tokens owned by `account`.
     */
    function balanceOf(address account) external view returns (uint256);

    /**
     * @dev Moves `amount` tokens from the caller's account to `to`.
     *
     * Returns a boolean value indicating whether the operation succeeded.
     *
     * Emits a {Transfer} event.
     */
    function transfer(address to, uint256 amount) external returns (bool);

    /**
     * @dev Returns the remaining number of tokens that `spender` will be
     * allowed to spend on behalf of `owner` through {transferFrom}. This is
     * zero by default.
     *
     * This value changes when {approve} or {transferFrom} are called.
     */
    function allowance(address owner, address spender) external view returns (uint256);

    /**
     * @dev Sets `amount` as the allowance of `spender` over the caller's tokens.
     *
     * Returns a boolean value indicating whether the operation succeeded.
     *
     * IMPORTANT: Beware that changing an allowance with this method brings the risk
     * that someone may use both the old and the new allowance by unfortunate
     * transaction ordering. One possible solution to mitigate this race
     * condition is to first reduce the spender's allowance to 0 and set the
     * desired value afterwards:
     * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729
     *
     * Emits an {Approval} event.
     */
    function approve(address spender, uint256 amount) external returns (bool);

    /**
     * @dev Moves `amount` tokens from `from` to `to` using the
     * allowance mechanism. `amount` is then deducted from the caller's
     * allowance.
     *
     * Returns a boolean value indicating whether the operation succeeded.
     *
     * Emits a {Transfer} event.
     */
    function transferFrom(
        address from,
        address to,
        uint256 amount
    ) external returns (bool);
}

File 6 of 40 : draft-IERC20Permit.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (token/ERC20/extensions/draft-IERC20Permit.sol)

pragma solidity ^0.8.0;

/**
 * @dev Interface of the ERC20 Permit extension allowing approvals to be made via signatures, as defined in
 * https://eips.ethereum.org/EIPS/eip-2612[EIP-2612].
 *
 * Adds the {permit} method, which can be used to change an account's ERC20 allowance (see {IERC20-allowance}) by
 * presenting a message signed by the account. By not relying on {IERC20-approve}, the token holder account doesn't
 * need to send a transaction, and thus is not required to hold Ether at all.
 */
interface IERC20Permit {
    /**
     * @dev Sets `value` as the allowance of `spender` over ``owner``'s tokens,
     * given ``owner``'s signed approval.
     *
     * IMPORTANT: The same issues {IERC20-approve} has related to transaction
     * ordering also apply here.
     *
     * Emits an {Approval} event.
     *
     * Requirements:
     *
     * - `spender` cannot be the zero address.
     * - `deadline` must be a timestamp in the future.
     * - `v`, `r` and `s` must be a valid `secp256k1` signature from `owner`
     * over the EIP712-formatted function arguments.
     * - the signature must use ``owner``'s current nonce (see {nonces}).
     *
     * For more information on the signature format, see the
     * https://eips.ethereum.org/EIPS/eip-2612#specification[relevant EIP
     * section].
     */
    function permit(
        address owner,
        address spender,
        uint256 value,
        uint256 deadline,
        uint8 v,
        bytes32 r,
        bytes32 s
    ) external;

    /**
     * @dev Returns the current nonce for `owner`. This value must be
     * included whenever a signature is generated for {permit}.
     *
     * Every successful call to {permit} increases ``owner``'s nonce by one. This
     * prevents a signature from being used multiple times.
     */
    function nonces(address owner) external view returns (uint256);

    /**
     * @dev Returns the domain separator used in the encoding of the signature for {permit}, as defined by {EIP712}.
     */
    // solhint-disable-next-line func-name-mixedcase
    function DOMAIN_SEPARATOR() external view returns (bytes32);
}

File 7 of 40 : SafeERC20.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.7.0) (token/ERC20/utils/SafeERC20.sol)

pragma solidity ^0.8.0;

import "../IERC20.sol";
import "../extensions/draft-IERC20Permit.sol";
import "../../../utils/Address.sol";

/**
 * @title SafeERC20
 * @dev Wrappers around ERC20 operations that throw on failure (when the token
 * contract returns false). Tokens that return no value (and instead revert or
 * throw on failure) are also supported, non-reverting calls are assumed to be
 * successful.
 * To use this library you can add a `using SafeERC20 for IERC20;` statement to your contract,
 * which allows you to call the safe operations as `token.safeTransfer(...)`, etc.
 */
library SafeERC20 {
    using Address for address;

    function safeTransfer(
        IERC20 token,
        address to,
        uint256 value
    ) internal {
        _callOptionalReturn(token, abi.encodeWithSelector(token.transfer.selector, to, value));
    }

    function safeTransferFrom(
        IERC20 token,
        address from,
        address to,
        uint256 value
    ) internal {
        _callOptionalReturn(token, abi.encodeWithSelector(token.transferFrom.selector, from, to, value));
    }

    /**
     * @dev Deprecated. This function has issues similar to the ones found in
     * {IERC20-approve}, and its usage is discouraged.
     *
     * Whenever possible, use {safeIncreaseAllowance} and
     * {safeDecreaseAllowance} instead.
     */
    function safeApprove(
        IERC20 token,
        address spender,
        uint256 value
    ) internal {
        // safeApprove should only be called when setting an initial allowance,
        // or when resetting it to zero. To increase and decrease it, use
        // 'safeIncreaseAllowance' and 'safeDecreaseAllowance'
        require(
            (value == 0) || (token.allowance(address(this), spender) == 0),
            "SafeERC20: approve from non-zero to non-zero allowance"
        );
        _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, value));
    }

    function safeIncreaseAllowance(
        IERC20 token,
        address spender,
        uint256 value
    ) internal {
        uint256 newAllowance = token.allowance(address(this), spender) + value;
        _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance));
    }

    function safeDecreaseAllowance(
        IERC20 token,
        address spender,
        uint256 value
    ) internal {
        unchecked {
            uint256 oldAllowance = token.allowance(address(this), spender);
            require(oldAllowance >= value, "SafeERC20: decreased allowance below zero");
            uint256 newAllowance = oldAllowance - value;
            _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance));
        }
    }

    function safePermit(
        IERC20Permit token,
        address owner,
        address spender,
        uint256 value,
        uint256 deadline,
        uint8 v,
        bytes32 r,
        bytes32 s
    ) internal {
        uint256 nonceBefore = token.nonces(owner);
        token.permit(owner, spender, value, deadline, v, r, s);
        uint256 nonceAfter = token.nonces(owner);
        require(nonceAfter == nonceBefore + 1, "SafeERC20: permit did not succeed");
    }

    /**
     * @dev Imitates a Solidity high-level call (i.e. a regular function call to a contract), relaxing the requirement
     * on the return value: the return value is optional (but if data is returned, it must not be false).
     * @param token The token targeted by the call.
     * @param data The call data (encoded using abi.encode or one of its variants).
     */
    function _callOptionalReturn(IERC20 token, bytes memory data) private {
        // We need to perform a low level call here, to bypass Solidity's return data size checking mechanism, since
        // we're implementing it ourselves. We use {Address.functionCall} to perform this call, which verifies that
        // the target address contains contract code and also asserts for success in the low-level call.

        bytes memory returndata = address(token).functionCall(data, "SafeERC20: low-level call failed");
        if (returndata.length > 0) {
            // Return data is optional
            require(abi.decode(returndata, (bool)), "SafeERC20: ERC20 operation did not succeed");
        }
    }
}

File 8 of 40 : IERC721Receiver.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.6.0) (token/ERC721/IERC721Receiver.sol)

pragma solidity ^0.8.0;

/**
 * @title ERC721 token receiver interface
 * @dev Interface for any contract that wants to support safeTransfers
 * from ERC721 asset contracts.
 */
interface IERC721Receiver {
    /**
     * @dev Whenever an {IERC721} `tokenId` token is transferred to this contract via {IERC721-safeTransferFrom}
     * by `operator` from `from`, this function is called.
     *
     * It must return its Solidity selector to confirm the token transfer.
     * If any other value is returned or the interface is not implemented by the recipient, the transfer will be reverted.
     *
     * The selector can be obtained in Solidity with `IERC721Receiver.onERC721Received.selector`.
     */
    function onERC721Received(
        address operator,
        address from,
        uint256 tokenId,
        bytes calldata data
    ) external returns (bytes4);
}

File 9 of 40 : Address.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.7.0) (utils/Address.sol)

pragma solidity ^0.8.1;

/**
 * @dev Collection of functions related to the address type
 */
library Address {
    /**
     * @dev Returns true if `account` is a contract.
     *
     * [IMPORTANT]
     * ====
     * It is unsafe to assume that an address for which this function returns
     * false is an externally-owned account (EOA) and not a contract.
     *
     * Among others, `isContract` will return false for the following
     * types of addresses:
     *
     *  - an externally-owned account
     *  - a contract in construction
     *  - an address where a contract will be created
     *  - an address where a contract lived, but was destroyed
     * ====
     *
     * [IMPORTANT]
     * ====
     * You shouldn't rely on `isContract` to protect against flash loan attacks!
     *
     * Preventing calls from contracts is highly discouraged. It breaks composability, breaks support for smart wallets
     * like Gnosis Safe, and does not provide security since it can be circumvented by calling from a contract
     * constructor.
     * ====
     */
    function isContract(address account) internal view returns (bool) {
        // This method relies on extcodesize/address.code.length, which returns 0
        // for contracts in construction, since the code is only stored at the end
        // of the constructor execution.

        return account.code.length > 0;
    }

    /**
     * @dev Replacement for Solidity's `transfer`: sends `amount` wei to
     * `recipient`, forwarding all available gas and reverting on errors.
     *
     * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost
     * of certain opcodes, possibly making contracts go over the 2300 gas limit
     * imposed by `transfer`, making them unable to receive funds via
     * `transfer`. {sendValue} removes this limitation.
     *
     * https://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more].
     *
     * IMPORTANT: because control is transferred to `recipient`, care must be
     * taken to not create reentrancy vulnerabilities. Consider using
     * {ReentrancyGuard} or the
     * https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].
     */
    function sendValue(address payable recipient, uint256 amount) internal {
        require(address(this).balance >= amount, "Address: insufficient balance");

        (bool success, ) = recipient.call{value: amount}("");
        require(success, "Address: unable to send value, recipient may have reverted");
    }

    /**
     * @dev Performs a Solidity function call using a low level `call`. A
     * plain `call` is an unsafe replacement for a function call: use this
     * function instead.
     *
     * If `target` reverts with a revert reason, it is bubbled up by this
     * function (like regular Solidity function calls).
     *
     * Returns the raw returned data. To convert to the expected return value,
     * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`].
     *
     * Requirements:
     *
     * - `target` must be a contract.
     * - calling `target` with `data` must not revert.
     *
     * _Available since v3.1._
     */
    function functionCall(address target, bytes memory data) internal returns (bytes memory) {
        return functionCall(target, data, "Address: low-level call failed");
    }

    /**
     * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with
     * `errorMessage` as a fallback revert reason when `target` reverts.
     *
     * _Available since v3.1._
     */
    function functionCall(
        address target,
        bytes memory data,
        string memory errorMessage
    ) internal returns (bytes memory) {
        return functionCallWithValue(target, data, 0, errorMessage);
    }

    /**
     * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
     * but also transferring `value` wei to `target`.
     *
     * Requirements:
     *
     * - the calling contract must have an ETH balance of at least `value`.
     * - the called Solidity function must be `payable`.
     *
     * _Available since v3.1._
     */
    function functionCallWithValue(
        address target,
        bytes memory data,
        uint256 value
    ) internal returns (bytes memory) {
        return functionCallWithValue(target, data, value, "Address: low-level call with value failed");
    }

    /**
     * @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but
     * with `errorMessage` as a fallback revert reason when `target` reverts.
     *
     * _Available since v3.1._
     */
    function functionCallWithValue(
        address target,
        bytes memory data,
        uint256 value,
        string memory errorMessage
    ) internal returns (bytes memory) {
        require(address(this).balance >= value, "Address: insufficient balance for call");
        require(isContract(target), "Address: call to non-contract");

        (bool success, bytes memory returndata) = target.call{value: value}(data);
        return verifyCallResult(success, returndata, errorMessage);
    }

    /**
     * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
     * but performing a static call.
     *
     * _Available since v3.3._
     */
    function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) {
        return functionStaticCall(target, data, "Address: low-level static call failed");
    }

    /**
     * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],
     * but performing a static call.
     *
     * _Available since v3.3._
     */
    function functionStaticCall(
        address target,
        bytes memory data,
        string memory errorMessage
    ) internal view returns (bytes memory) {
        require(isContract(target), "Address: static call to non-contract");

        (bool success, bytes memory returndata) = target.staticcall(data);
        return verifyCallResult(success, returndata, errorMessage);
    }

    /**
     * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
     * but performing a delegate call.
     *
     * _Available since v3.4._
     */
    function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) {
        return functionDelegateCall(target, data, "Address: low-level delegate call failed");
    }

    /**
     * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],
     * but performing a delegate call.
     *
     * _Available since v3.4._
     */
    function functionDelegateCall(
        address target,
        bytes memory data,
        string memory errorMessage
    ) internal returns (bytes memory) {
        require(isContract(target), "Address: delegate call to non-contract");

        (bool success, bytes memory returndata) = target.delegatecall(data);
        return verifyCallResult(success, returndata, errorMessage);
    }

    /**
     * @dev Tool to verifies that a low level call was successful, and revert if it wasn't, either by bubbling the
     * revert reason using the provided one.
     *
     * _Available since v4.3._
     */
    function verifyCallResult(
        bool success,
        bytes memory returndata,
        string memory errorMessage
    ) internal pure returns (bytes memory) {
        if (success) {
            return returndata;
        } else {
            // Look for revert reason and bubble it up if present
            if (returndata.length > 0) {
                // The easiest way to bubble the revert reason is using memory via assembly
                /// @solidity memory-safe-assembly
                assembly {
                    let returndata_size := mload(returndata)
                    revert(add(32, returndata), returndata_size)
                }
            } else {
                revert(errorMessage);
            }
        }
    }
}

File 10 of 40 : Context.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (utils/Context.sol)

pragma solidity ^0.8.0;

/**
 * @dev Provides information about the current execution context, including the
 * sender of the transaction and its data. While these are generally available
 * via msg.sender and msg.data, they should not be accessed in such a direct
 * manner, since when dealing with meta-transactions the account sending and
 * paying for execution may not be the actual sender (as far as an application
 * is concerned).
 *
 * This contract is only required for intermediate, library-like contracts.
 */
abstract contract Context {
    function _msgSender() internal view virtual returns (address) {
        return msg.sender;
    }

    function _msgData() internal view virtual returns (bytes calldata) {
        return msg.data;
    }
}

File 11 of 40 : Strings.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.7.0) (utils/Strings.sol)

pragma solidity ^0.8.0;

/**
 * @dev String operations.
 */
library Strings {
    bytes16 private constant _HEX_SYMBOLS = "0123456789abcdef";
    uint8 private constant _ADDRESS_LENGTH = 20;

    /**
     * @dev Converts a `uint256` to its ASCII `string` decimal representation.
     */
    function toString(uint256 value) internal pure returns (string memory) {
        // Inspired by OraclizeAPI's implementation - MIT licence
        // https://github.com/oraclize/ethereum-api/blob/b42146b063c7d6ee1358846c198246239e9360e8/oraclizeAPI_0.4.25.sol

        if (value == 0) {
            return "0";
        }
        uint256 temp = value;
        uint256 digits;
        while (temp != 0) {
            digits++;
            temp /= 10;
        }
        bytes memory buffer = new bytes(digits);
        while (value != 0) {
            digits -= 1;
            buffer[digits] = bytes1(uint8(48 + uint256(value % 10)));
            value /= 10;
        }
        return string(buffer);
    }

    /**
     * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation.
     */
    function toHexString(uint256 value) internal pure returns (string memory) {
        if (value == 0) {
            return "0x00";
        }
        uint256 temp = value;
        uint256 length = 0;
        while (temp != 0) {
            length++;
            temp >>= 8;
        }
        return toHexString(value, length);
    }

    /**
     * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation with fixed length.
     */
    function toHexString(uint256 value, uint256 length) internal pure returns (string memory) {
        bytes memory buffer = new bytes(2 * length + 2);
        buffer[0] = "0";
        buffer[1] = "x";
        for (uint256 i = 2 * length + 1; i > 1; --i) {
            buffer[i] = _HEX_SYMBOLS[value & 0xf];
            value >>= 4;
        }
        require(value == 0, "Strings: hex length insufficient");
        return string(buffer);
    }

    /**
     * @dev Converts an `address` with fixed length of 20 bytes to its not checksummed ASCII `string` hexadecimal representation.
     */
    function toHexString(address addr) internal pure returns (string memory) {
        return toHexString(uint256(uint160(addr)), _ADDRESS_LENGTH);
    }
}

File 12 of 40 : ECDSA.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.7.3) (utils/cryptography/ECDSA.sol)

pragma solidity ^0.8.0;

import "../Strings.sol";

/**
 * @dev Elliptic Curve Digital Signature Algorithm (ECDSA) operations.
 *
 * These functions can be used to verify that a message was signed by the holder
 * of the private keys of a given address.
 */
library ECDSA {
    enum RecoverError {
        NoError,
        InvalidSignature,
        InvalidSignatureLength,
        InvalidSignatureS,
        InvalidSignatureV
    }

    function _throwError(RecoverError error) private pure {
        if (error == RecoverError.NoError) {
            return; // no error: do nothing
        } else if (error == RecoverError.InvalidSignature) {
            revert("ECDSA: invalid signature");
        } else if (error == RecoverError.InvalidSignatureLength) {
            revert("ECDSA: invalid signature length");
        } else if (error == RecoverError.InvalidSignatureS) {
            revert("ECDSA: invalid signature 's' value");
        } else if (error == RecoverError.InvalidSignatureV) {
            revert("ECDSA: invalid signature 'v' value");
        }
    }

    /**
     * @dev Returns the address that signed a hashed message (`hash`) with
     * `signature` or error string. This address can then be used for verification purposes.
     *
     * The `ecrecover` EVM opcode allows for malleable (non-unique) signatures:
     * this function rejects them by requiring the `s` value to be in the lower
     * half order, and the `v` value to be either 27 or 28.
     *
     * IMPORTANT: `hash` _must_ be the result of a hash operation for the
     * verification to be secure: it is possible to craft signatures that
     * recover to arbitrary addresses for non-hashed data. A safe way to ensure
     * this is by receiving a hash of the original message (which may otherwise
     * be too long), and then calling {toEthSignedMessageHash} on it.
     *
     * Documentation for signature generation:
     * - with https://web3js.readthedocs.io/en/v1.3.4/web3-eth-accounts.html#sign[Web3.js]
     * - with https://docs.ethers.io/v5/api/signer/#Signer-signMessage[ethers]
     *
     * _Available since v4.3._
     */
    function tryRecover(bytes32 hash, bytes memory signature) internal pure returns (address, RecoverError) {
        if (signature.length == 65) {
            bytes32 r;
            bytes32 s;
            uint8 v;
            // ecrecover takes the signature parameters, and the only way to get them
            // currently is to use assembly.
            /// @solidity memory-safe-assembly
            assembly {
                r := mload(add(signature, 0x20))
                s := mload(add(signature, 0x40))
                v := byte(0, mload(add(signature, 0x60)))
            }
            return tryRecover(hash, v, r, s);
        } else {
            return (address(0), RecoverError.InvalidSignatureLength);
        }
    }

    /**
     * @dev Returns the address that signed a hashed message (`hash`) with
     * `signature`. This address can then be used for verification purposes.
     *
     * The `ecrecover` EVM opcode allows for malleable (non-unique) signatures:
     * this function rejects them by requiring the `s` value to be in the lower
     * half order, and the `v` value to be either 27 or 28.
     *
     * IMPORTANT: `hash` _must_ be the result of a hash operation for the
     * verification to be secure: it is possible to craft signatures that
     * recover to arbitrary addresses for non-hashed data. A safe way to ensure
     * this is by receiving a hash of the original message (which may otherwise
     * be too long), and then calling {toEthSignedMessageHash} on it.
     */
    function recover(bytes32 hash, bytes memory signature) internal pure returns (address) {
        (address recovered, RecoverError error) = tryRecover(hash, signature);
        _throwError(error);
        return recovered;
    }

    /**
     * @dev Overload of {ECDSA-tryRecover} that receives the `r` and `vs` short-signature fields separately.
     *
     * See https://eips.ethereum.org/EIPS/eip-2098[EIP-2098 short signatures]
     *
     * _Available since v4.3._
     */
    function tryRecover(
        bytes32 hash,
        bytes32 r,
        bytes32 vs
    ) internal pure returns (address, RecoverError) {
        bytes32 s = vs & bytes32(0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff);
        uint8 v = uint8((uint256(vs) >> 255) + 27);
        return tryRecover(hash, v, r, s);
    }

    /**
     * @dev Overload of {ECDSA-recover} that receives the `r and `vs` short-signature fields separately.
     *
     * _Available since v4.2._
     */
    function recover(
        bytes32 hash,
        bytes32 r,
        bytes32 vs
    ) internal pure returns (address) {
        (address recovered, RecoverError error) = tryRecover(hash, r, vs);
        _throwError(error);
        return recovered;
    }

    /**
     * @dev Overload of {ECDSA-tryRecover} that receives the `v`,
     * `r` and `s` signature fields separately.
     *
     * _Available since v4.3._
     */
    function tryRecover(
        bytes32 hash,
        uint8 v,
        bytes32 r,
        bytes32 s
    ) internal pure returns (address, RecoverError) {
        // EIP-2 still allows signature malleability for ecrecover(). Remove this possibility and make the signature
        // unique. Appendix F in the Ethereum Yellow paper (https://ethereum.github.io/yellowpaper/paper.pdf), defines
        // the valid range for s in (301): 0 < s < secp256k1n ÷ 2 + 1, and for v in (302): v ∈ {27, 28}. Most
        // signatures from current libraries generate a unique signature with an s-value in the lower half order.
        //
        // If your library generates malleable signatures, such as s-values in the upper range, calculate a new s-value
        // with 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEBAAEDCE6AF48A03BBFD25E8CD0364141 - s1 and flip v from 27 to 28 or
        // vice versa. If your library also generates signatures with 0/1 for v instead 27/28, add 27 to v to accept
        // these malleable signatures as well.
        if (uint256(s) > 0x7FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF5D576E7357A4501DDFE92F46681B20A0) {
            return (address(0), RecoverError.InvalidSignatureS);
        }
        if (v != 27 && v != 28) {
            return (address(0), RecoverError.InvalidSignatureV);
        }

        // If the signature is valid (and not malleable), return the signer address
        address signer = ecrecover(hash, v, r, s);
        if (signer == address(0)) {
            return (address(0), RecoverError.InvalidSignature);
        }

        return (signer, RecoverError.NoError);
    }

    /**
     * @dev Overload of {ECDSA-recover} that receives the `v`,
     * `r` and `s` signature fields separately.
     */
    function recover(
        bytes32 hash,
        uint8 v,
        bytes32 r,
        bytes32 s
    ) internal pure returns (address) {
        (address recovered, RecoverError error) = tryRecover(hash, v, r, s);
        _throwError(error);
        return recovered;
    }

    /**
     * @dev Returns an Ethereum Signed Message, created from a `hash`. This
     * produces hash corresponding to the one signed with the
     * https://eth.wiki/json-rpc/API#eth_sign[`eth_sign`]
     * JSON-RPC method as part of EIP-191.
     *
     * See {recover}.
     */
    function toEthSignedMessageHash(bytes32 hash) internal pure returns (bytes32) {
        // 32 is the length in bytes of hash,
        // enforced by the type signature above
        return keccak256(abi.encodePacked("\x19Ethereum Signed Message:\n32", hash));
    }

    /**
     * @dev Returns an Ethereum Signed Message, created from `s`. This
     * produces hash corresponding to the one signed with the
     * https://eth.wiki/json-rpc/API#eth_sign[`eth_sign`]
     * JSON-RPC method as part of EIP-191.
     *
     * See {recover}.
     */
    function toEthSignedMessageHash(bytes memory s) internal pure returns (bytes32) {
        return keccak256(abi.encodePacked("\x19Ethereum Signed Message:\n", Strings.toString(s.length), s));
    }

    /**
     * @dev Returns an Ethereum Signed Typed Data, created from a
     * `domainSeparator` and a `structHash`. This produces hash corresponding
     * to the one signed with the
     * https://eips.ethereum.org/EIPS/eip-712[`eth_signTypedData`]
     * JSON-RPC method as part of EIP-712.
     *
     * See {recover}.
     */
    function toTypedDataHash(bytes32 domainSeparator, bytes32 structHash) internal pure returns (bytes32) {
        return keccak256(abi.encodePacked("\x19\x01", domainSeparator, structHash));
    }
}

File 13 of 40 : IERC165.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (utils/introspection/IERC165.sol)

pragma solidity ^0.8.0;

/**
 * @dev Interface of the ERC165 standard, as defined in the
 * https://eips.ethereum.org/EIPS/eip-165[EIP].
 *
 * Implementers can declare support of contract interfaces, which can then be
 * queried by others ({ERC165Checker}).
 *
 * For an implementation, see {ERC165}.
 */
interface IERC165 {
    /**
     * @dev Returns true if this contract implements the interface defined by
     * `interfaceId`. See the corresponding
     * https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified[EIP section]
     * to learn more about how these ids are created.
     *
     * This function call must use less than 30 000 gas.
     */
    function supportsInterface(bytes4 interfaceId) external view returns (bool);
}

File 14 of 40 : IRewardsCollector.sol
// SPDX-License-Identifier: GPL-3.0-or-later
pragma solidity ^0.8.15;

import {ERC20} from 'solmate/src/tokens/ERC20.sol';

/// @title LooksRare Rewards Collector
/// @notice Implements a permissionless call to fetch LooksRare rewards earned by Universal Router users
/// and transfers them to an external rewards distributor contract
interface IRewardsCollector {
    /// @notice Fetches users' LooksRare rewards and sends them to the distributor contract
    /// @param looksRareClaim The data required by LooksRare to claim reward tokens
    function collectRewards(bytes calldata looksRareClaim) external;
}

File 15 of 40 : IUniversalRouter.sol
// SPDX-License-Identifier: GPL-3.0-or-later
pragma solidity ^0.8.17;

import {IERC721Receiver} from '@openzeppelin/contracts/token/ERC721/IERC721Receiver.sol';
import {IERC1155Receiver} from '@openzeppelin/contracts/token/ERC1155/IERC1155Receiver.sol';
import {IRewardsCollector} from './IRewardsCollector.sol';

interface IUniversalRouter is IRewardsCollector, IERC721Receiver, IERC1155Receiver {
    /// @notice Thrown when a required command has failed
    error ExecutionFailed(uint256 commandIndex, bytes message);

    /// @notice Thrown when attempting to send ETH directly to the contract
    error ETHNotAccepted();

    /// @notice Thrown when executing commands with an expired deadline
    error TransactionDeadlinePassed();

    /// @notice Thrown when attempting to execute commands and an incorrect number of inputs are provided
    error LengthMismatch();

    /// @notice Executes encoded commands along with provided inputs. Reverts if deadline has expired.
    /// @param commands A set of concatenated commands, each 1 byte in length
    /// @param inputs An array of byte strings containing abi encoded inputs for each command
    /// @param deadline The deadline by which the transaction must be executed
    function execute(bytes calldata commands, bytes[] calldata inputs, uint256 deadline) external payable;
}

File 16 of 40 : IWETH9.sol
// SPDX-License-Identifier: GPL-3.0-or-later
pragma solidity ^0.8.4;

import {IERC20} from '@openzeppelin/contracts/token/ERC20/IERC20.sol';

/// @title Interface for WETH9
interface IWETH9 is IERC20 {
    /// @notice Deposit ether to get wrapped ether
    function deposit() external payable;

    /// @notice Withdraw wrapped ether to get ether
    function withdraw(uint256) external;
}

File 17 of 40 : Commands.sol
// SPDX-License-Identifier: GPL-3.0-or-later
pragma solidity ^0.8.17;

/// @title Commands
/// @notice Command Flags used to decode commands
library Commands {
    // Masks to extract certain bits of commands
    bytes1 internal constant FLAG_ALLOW_REVERT = 0x80;
    bytes1 internal constant COMMAND_TYPE_MASK = 0x3f;

    // Command Types. Maximum supported command at this moment is 0x3f.

    // Command Types where value<0x08, executed in the first nested-if block
    uint256 constant V3_SWAP_EXACT_IN = 0x00;
    uint256 constant V3_SWAP_EXACT_OUT = 0x01;
    uint256 constant PERMIT2_TRANSFER_FROM = 0x02;
    uint256 constant PERMIT2_PERMIT_BATCH = 0x03;
    uint256 constant SWEEP = 0x04;
    uint256 constant TRANSFER = 0x05;
    uint256 constant PAY_PORTION = 0x06;
    // COMMAND_PLACEHOLDER = 0x07;

    // The commands are executed in nested if blocks to minimise gas consumption
    // The following constant defines one of the boundaries where the if blocks split commands
    uint256 constant FIRST_IF_BOUNDARY = 0x08;

    // Command Types where 0x08<=value<=0x0f, executed in the second nested-if block
    uint256 constant V2_SWAP_EXACT_IN = 0x08;
    uint256 constant V2_SWAP_EXACT_OUT = 0x09;
    uint256 constant PERMIT2_PERMIT = 0x0a;
    uint256 constant WRAP_ETH = 0x0b;
    uint256 constant UNWRAP_WETH = 0x0c;
    uint256 constant PERMIT2_TRANSFER_FROM_BATCH = 0x0d;
    uint256 constant BALANCE_CHECK_ERC20 = 0x0e;
    // COMMAND_PLACEHOLDER = 0x0f;

    // The commands are executed in nested if blocks to minimise gas consumption
    // The following constant defines one of the boundaries where the if blocks split commands
    uint256 constant SECOND_IF_BOUNDARY = 0x10;

    // Command Types where 0x10<=value<0x18, executed in the third nested-if block
    uint256 constant SEAPORT_V1_5 = 0x10;
    uint256 constant LOOKS_RARE_V2 = 0x11;
    uint256 constant NFTX = 0x12;
    uint256 constant CRYPTOPUNKS = 0x13;
    // 0x14;
    uint256 constant OWNER_CHECK_721 = 0x15;
    uint256 constant OWNER_CHECK_1155 = 0x16;
    uint256 constant SWEEP_ERC721 = 0x17;

    // The commands are executed in nested if blocks to minimise gas consumption
    // The following constant defines one of the boundaries where the if blocks split commands
    uint256 constant THIRD_IF_BOUNDARY = 0x18;

    // Command Types where 0x18<=value<=0x1f, executed in the final nested-if block
    uint256 constant X2Y2_721 = 0x18;
    uint256 constant SUDOSWAP = 0x19;
    uint256 constant NFT20 = 0x1a;
    uint256 constant X2Y2_1155 = 0x1b;
    uint256 constant FOUNDATION = 0x1c;
    uint256 constant SWEEP_ERC1155 = 0x1d;
    uint256 constant ELEMENT_MARKET = 0x1e;
    // COMMAND_PLACEHOLDER = 0x1f;

    // The commands are executed in nested if blocks to minimise gas consumption
    // The following constant defines one of the boundaries where the if blocks split commands
    uint256 constant FOURTH_IF_BOUNDARY = 0x20;

    // Command Types where 0x20<=value
    uint256 constant SEAPORT_V1_4 = 0x20;
    uint256 constant EXECUTE_SUB_PLAN = 0x21;
    uint256 constant APPROVE_ERC20 = 0x22;
    uint256 constant WRAP_STETH = 0x23;
    uint256 constant UNWRAP_STETH = 0x24;

    // COMMAND_PLACEHOLDER for 0x25 to 0x3f (all unused)
}

File 18 of 40 : Constants.sol
// SPDX-License-Identifier: GPL-3.0-or-later
pragma solidity ^0.8.17;

import {IWETH9} from '../interfaces/external/IWETH9.sol';

/// @title Constant state
/// @notice Constant state used by the Universal Router
library Constants {
    /// @dev Used for identifying cases when this contract's balance of a token is to be used as an input
    /// This value is equivalent to 1<<255, i.e. a singular 1 in the most significant bit.
    uint256 internal constant CONTRACT_BALANCE = 0x8000000000000000000000000000000000000000000000000000000000000000;

    /// @dev Used for identifying cases when a v2 pair has already received input tokens
    uint256 internal constant ALREADY_PAID = 0;

    /// @dev Used as a flag for identifying the transfer of ETH instead of a token
    address internal constant ETH = address(0);

    /// @dev Used as a flag for identifying that msg.sender should be used, saves gas by sending more 0 bytes
    address internal constant MSG_SENDER = address(1);

    /// @dev Used as a flag for identifying address(this) should be used, saves gas by sending more 0 bytes
    address internal constant ADDRESS_THIS = address(2);

    /// @dev The length of the bytes encoded address
    uint256 internal constant ADDR_SIZE = 20;

    /// @dev The length of the bytes encoded fee
    uint256 internal constant V3_FEE_SIZE = 3;

    /// @dev The offset of a single token address (20) and pool fee (3)
    uint256 internal constant NEXT_V3_POOL_OFFSET = ADDR_SIZE + V3_FEE_SIZE;

    /// @dev The offset of an encoded pool key
    /// Token (20) + Fee (3) + Token (20) = 43
    uint256 internal constant V3_POP_OFFSET = NEXT_V3_POOL_OFFSET + ADDR_SIZE;

    /// @dev The minimum length of an encoding that contains 2 or more pools
    uint256 internal constant MULTIPLE_V3_POOLS_MIN_LENGTH = V3_POP_OFFSET + NEXT_V3_POOL_OFFSET;
}

File 19 of 40 : IUniswapV3SwapCallback.sol
// SPDX-License-Identifier: GPL-2.0-or-later
pragma solidity >=0.5.0;

/// @title Callback for IUniswapV3PoolActions#swap
/// @notice Any contract that calls IUniswapV3PoolActions#swap must implement this interface
interface IUniswapV3SwapCallback {
    /// @notice Called to `msg.sender` after executing a swap via IUniswapV3Pool#swap.
    /// @dev In the implementation you must pay the pool tokens owed for the swap.
    /// The caller of this method must be checked to be a UniswapV3Pool deployed by the canonical UniswapV3Factory.
    /// amount0Delta and amount1Delta can both be 0 if no tokens were swapped.
    /// @param amount0Delta The amount of token0 that was sent (negative) or must be received (positive) by the pool by
    /// the end of the swap. If positive, the callback must send that amount of token0 to the pool.
    /// @param amount1Delta The amount of token1 that was sent (negative) or must be received (positive) by the pool by
    /// the end of the swap. If positive, the callback must send that amount of token1 to the pool.
    /// @param data Any data passed through by the caller via the IUniswapV3PoolActions#swap call
    function uniswapV3SwapCallback(
        int256 amount0Delta,
        int256 amount1Delta,
        bytes calldata data
    ) external;
}

File 20 of 40 : IPeripheryPayments.sol
// SPDX-License-Identifier: GPL-2.0-or-later
pragma solidity >=0.7.5;

/// @title Periphery Payments
/// @notice Functions to ease deposits and withdrawals of ETH
interface IPeripheryPayments {
    /// @notice Unwraps the contract's WETH9 balance and sends it to recipient as ETH.
    /// @dev The amountMinimum parameter prevents malicious contracts from stealing WETH9 from users.
    /// @param amountMinimum The minimum amount of WETH9 to unwrap
    /// @param recipient The address receiving ETH
    function unwrapWETH9(uint256 amountMinimum, address recipient) external payable;

    /// @notice Refunds any ETH balance held by this contract to the `msg.sender`
    /// @dev Useful for bundling with mint or increase liquidity that uses ether, or exact output swaps
    /// that use ether for the input amount
    function refundETH() external payable;

    /// @notice Transfers the full amount of a token held by this contract to recipient
    /// @dev The amountMinimum parameter prevents malicious contracts from stealing the token from users
    /// @param token The contract address of the token which will be transferred to `recipient`
    /// @param amountMinimum The minimum amount of token required for a transfer
    /// @param recipient The destination address of the token
    function sweepToken(
        address token,
        uint256 amountMinimum,
        address recipient
    ) external payable;
}

File 21 of 40 : ISwapRouter.sol
// SPDX-License-Identifier: GPL-2.0-or-later
pragma solidity >=0.7.5;
pragma abicoder v2;

import '@uniswap/v3-core/contracts/interfaces/callback/IUniswapV3SwapCallback.sol';

/// @title Router token swapping functionality
/// @notice Functions for swapping tokens via Uniswap V3
interface ISwapRouter is IUniswapV3SwapCallback {
    struct ExactInputSingleParams {
        address tokenIn;
        address tokenOut;
        uint24 fee;
        address recipient;
        uint256 deadline;
        uint256 amountIn;
        uint256 amountOutMinimum;
        uint160 sqrtPriceLimitX96;
    }

    /// @notice Swaps `amountIn` of one token for as much as possible of another token
    /// @param params The parameters necessary for the swap, encoded as `ExactInputSingleParams` in calldata
    /// @return amountOut The amount of the received token
    function exactInputSingle(ExactInputSingleParams calldata params) external payable returns (uint256 amountOut);

    struct ExactInputParams {
        bytes path;
        address recipient;
        uint256 deadline;
        uint256 amountIn;
        uint256 amountOutMinimum;
    }

    /// @notice Swaps `amountIn` of one token for as much as possible of another along the specified path
    /// @param params The parameters necessary for the multi-hop swap, encoded as `ExactInputParams` in calldata
    /// @return amountOut The amount of the received token
    function exactInput(ExactInputParams calldata params) external payable returns (uint256 amountOut);

    struct ExactOutputSingleParams {
        address tokenIn;
        address tokenOut;
        uint24 fee;
        address recipient;
        uint256 deadline;
        uint256 amountOut;
        uint256 amountInMaximum;
        uint160 sqrtPriceLimitX96;
    }

    /// @notice Swaps as little as possible of one token for `amountOut` of another token
    /// @param params The parameters necessary for the swap, encoded as `ExactOutputSingleParams` in calldata
    /// @return amountIn The amount of the input token
    function exactOutputSingle(ExactOutputSingleParams calldata params) external payable returns (uint256 amountIn);

    struct ExactOutputParams {
        bytes path;
        address recipient;
        uint256 deadline;
        uint256 amountOut;
        uint256 amountInMaximum;
    }

    /// @notice Swaps as little as possible of one token for `amountOut` of another along the specified path (reversed)
    /// @param params The parameters necessary for the multi-hop swap, encoded as `ExactOutputParams` in calldata
    /// @return amountIn The amount of the input token
    function exactOutput(ExactOutputParams calldata params) external payable returns (uint256 amountIn);
}

File 22 of 40 : ITransfers.sol
// SPDX-License-Identifier: UNLICENSED
pragma solidity ^0.8.17;

import "../permit2/src/interfaces/ISignatureTransfer.sol";

// @notice Description of the transfer
// @member recipientAmount Amount of currency to transfer
// @member deadline The timestamp by when the transfer must be in a block.
// @member chainId The chain which the transfer must occur on.
// @member recipient The address which will receive the funds.
// @member recipientCurrency The currency address that amount is priced in.
// @member refundDestination The address which will receive any refunds. If blank, this will be msg.sender.
// @member feeAmount The fee value (in currency) to send to the operator.
// @member id An ID which can be used to track payments.
// @member operator The address of the operator (who created and signed the intent).
// @member signature A hash of all the other struct properties signed by the operator.
// @member prefix An alternate signature prefix to use instead of the standard EIP-191 "\x19Ethereum Signed Message:\n"
// @dev signature=keccak256(encodePacked(...allPropsInOrderExceptSignatureAndPrefix, chainId, _msgSender(), address(transfersContract))
struct TransferIntent {
    uint256 recipientAmount;
    uint256 deadline;
    address payable recipient;
    address recipientCurrency;
    address refundDestination;
    uint256 feeAmount;
    bytes16 id;
    address operator;
    bytes signature;
    bytes prefix;
}

struct Permit2SignatureTransferData {
    ISignatureTransfer.PermitTransferFrom permit;
    ISignatureTransfer.SignatureTransferDetails transferDetails;
    bytes signature;
}

// @title Transfers Contract
// @notice Functions for making checked transfers between accounts
interface ITransfers {
    // @notice Emitted when a transfer is completed
    // @param operator The operator for the transfer intent
    // @param id The ID of the transfer intent
    // @param recipient Who recieved the funds.
    // @param sender Who sent the funds.
    // @param spentAmount How much the payer sent
    // @param spentCurrency What currency the payer sent
    event Transferred(
        address indexed operator,
        bytes16 id,
        address recipient,
        address sender,
        uint256 spentAmount,
        address spentCurrency
    );

    // @notice Raised when a native currency transfer fails
    // @param recipient Who the transfer was intended for
    // @param amount The amount of the transfer
    // @param isRefund Whether the transfer was part of a refund
    // @param data The data returned from the failed call
    error NativeTransferFailed(address recipient, uint256 amount, bool isRefund, bytes data);

    // @notice Emitted when an operator is registered
    // @param operator The operator that was registered
    // @param feeDestination The new fee destination for the operator
    event OperatorRegistered(address operator, address feeDestination);

    // @notice Emitted when an operator is unregistered
    // @param operator The operator that was registered
    event OperatorUnregistered(address operator);

    // @notice Raised when the operator in the intent is not registered
    error OperatorNotRegistered();

    // @notice Raised when the intent signature is invalid
    error InvalidSignature();

    // @notice Raised when the invalid amount of native currency is provided
    // @param difference The surplus (or deficit) amount sent
    error InvalidNativeAmount(int256 difference);

    // @notice Raised when the payer does not have enough of the payment token
    // @param difference The balance deficit
    error InsufficientBalance(uint256 difference);

    // @notice Raised when the payer has not approved enough of the payment token
    // @param difference The allowance deficit
    error InsufficientAllowance(uint256 difference);

    // @notice Raised when providing an intent with the incorrect currency. e.g. a USDC intent to `wrapAndTransfer`
    // @param attemptedCurrency The currency the payer attempted to pay with
    error IncorrectCurrency(address attemptedCurrency);

    // @notice Raised when the permit2 transfer details are incorrect
    error InvalidTransferDetails();

    // @notice Raised when an intent is paid past its deadline
    error ExpiredIntent();

    // @notice Raised when an intent's recipient is the null address
    error NullRecipient();

    // @notice Raised when an intent has already been processed
    error AlreadyProcessed();

    // @notice Raised when a swap fails and returns a reason string
    // @param reason The error reason returned from the swap
    error SwapFailedString(string reason);

    // @notice Raised when a swap fails and returns another error
    // @param reason The error reason returned from the swap
    error SwapFailedBytes(bytes reason);

    // @notice Send the exact amount of the native currency from the sender to the recipient.
    // @dev The intent's recipient currency must be the native currency.
    // @param _intent The intent which describes the transfer
    function transferNative(TransferIntent calldata _intent) external payable;

    // @notice Transfer the exact amount of any ERC-20 token from the sender to the recipient.
    // @dev The intent's recipient currency must be an ERC-20 token matching the one in `_signatureTransferData`.
    // @dev The user must have approved the Permit2 contract for at least `_intent.recipientAmount + _intent.feeAmount`
    //      with the `_intent.recipientCurrency` ERC-20 contract prior to invoking.
    // @param _intent The intent which describes the transfer
    function transferToken(
        TransferIntent calldata _intent,
        Permit2SignatureTransferData calldata _signatureTransferData
    ) external;

    // @notice Transfer the exact amount of any ERC-20 token from the sender to the recipient.
    // @dev The intent's recipient currency must be an ERC-20 token.
    // @dev The user must have approved this contract for at least `_intent.recipientAmount + _intent.feeAmount`
    //      with the `_intent.recipientCurrency` ERC-20 contract prior to invoking.
    // @param _intent The intent which describes the transfer
    function transferTokenPreApproved(TransferIntent calldata _intent) external;

    // @notice Takes native currency (e.g. ETH) from the sender and sends wrapped currency (e.g. wETH) to the recipient.
    // @dev The intent's recipient currency must be the wrapped native currency.
    // @param _intent The intent which describes the transfer
    function wrapAndTransfer(TransferIntent calldata _intent) external payable;

    // @notice Takes wrapped currency (e.g. wETH) from the sender and sends native currency (e.g. ETH) to the recipient.
    // @dev The intent's recipient currency must be the native currency.
    // @dev The user must have approved the Permit2 contract for at least `_intent.recipientAmount + _intent.feeAmount`
    //      with the wETH contract prior to invoking.
    // @param _intent The intent which describes the transfer
    // @param _signatureTransferData The signed Permit2 transfer data for the payment
    function unwrapAndTransfer(
        TransferIntent calldata _intent,
        Permit2SignatureTransferData calldata _signatureTransferData
    ) external;

    // @notice Takes wrapped currency (e.g. wETH) from the sender and sends native currency (e.g. ETH) to the recipient.
    // @dev The intent's recipient currency must be the native currency.
    // @dev The user must have approved this contract for at least `_intent.recipientAmount + _intent.feeAmount` with the wETH contract prior to invoking.
    // @param _intent The intent which describes the transfer
    function unwrapAndTransferPreApproved(TransferIntent calldata _intent) external;

    // @notice Allows the sender to pay for an intent with a swap from the native currency using Uniswap.
    // @param _intent The intent which describes the transfer
    // @param poolFeesTier The Uniswap pool fee the user wishes to pay. See: https://docs.uniswap.org/protocol/concepts/V3-overview/fees#pool-fees-tiers
    function swapAndTransferUniswapV3Native(TransferIntent calldata _intent, uint24 poolFeesTier) external payable;

    // @notice Allows the sender to pay for an intent with a swap from any ERC-20 token using Uniswap.
    // @dev The user must have approved the Permit2 contract for at least `_signatureTransferData.transferDetails.requestedAmount`
    //      with the `_signatureTransferData.permit.permitted.token` ERC-20 contract prior to invoking.
    // @param _intent The intent which describes the transfer
    // @param _signatureTransferData The signed Permit2 transfer data for the payment
    // @param poolFeesTier The Uniswap pool fee the user wishes to pay. See: https://docs.uniswap.org/protocol/concepts/V3-overview/fees#pool-fees-tiers
    function swapAndTransferUniswapV3Token(
        TransferIntent calldata _intent,
        Permit2SignatureTransferData calldata _signatureTransferData,
        uint24 poolFeesTier
    ) external;

    // @notice Allows the sender to pay for an intent with a swap from any ERC-20 token using Uniswap.
    // @dev The user must have approved this contract for at least `maxWillingToPay` with the `_tokenIn` ERC-20 contract prior to invoking.
    // @param _intent The intent which describes the transfer
    // @param _tokenIn The currency address which the sender wishes to pay for the intent.
    // @param maxWillingToPay The maximum amount of _tokenIn the sender is willing to pay.
    // @param poolFeesTier The Uniswap pool fee the user wishes to pay. See: https://docs.uniswap.org/protocol/concepts/V3-overview/fees#pool-fees-tiers
    function swapAndTransferUniswapV3TokenPreApproved(
        TransferIntent calldata _intent,
        address _tokenIn,
        uint256 maxWillingToPay,
        uint24 poolFeesTier
    ) external;
}

File 23 of 40 : IUniswapRouter.sol
// SPDX-License-Identifier: UNLICENSED
pragma solidity ^0.8.17;

import "@uniswap/v3-periphery/contracts/interfaces/ISwapRouter.sol";
import "@uniswap/v3-periphery/contracts/interfaces/IPeripheryPayments.sol";

interface IUniswapRouter is ISwapRouter, IPeripheryPayments {}

File 24 of 40 : IWrappedNativeCurrency.sol
// SPDX-License-Identifier: UNLICENSED
pragma solidity ^0.8.17;

import "@openzeppelin/contracts/token/ERC20/IERC20.sol";

// @title Represented wrapped (e.g. wETH) currencies
interface IWrappedNativeCurrency is IERC20 {
    function deposit() external payable;

    function withdraw(uint256) external;
}

File 25 of 40 : ERC20.sol
// SPDX-License-Identifier: AGPL-3.0-only
pragma solidity >=0.8.0;

/// @notice Modern and gas efficient ERC20 + EIP-2612 implementation.
/// @author Solmate (https://github.com/transmissions11/solmate/blob/main/src/tokens/ERC20.sol)
/// @author Modified from Uniswap (https://github.com/Uniswap/uniswap-v2-core/blob/master/contracts/UniswapV2ERC20.sol)
/// @dev Do not manually set balances without updating totalSupply, as the sum of all user balances must not exceed it.
abstract contract ERC20 {
    /*//////////////////////////////////////////////////////////////
                                 EVENTS
    //////////////////////////////////////////////////////////////*/

    event Transfer(address indexed from, address indexed to, uint256 amount);

    event Approval(address indexed owner, address indexed spender, uint256 amount);

    /*//////////////////////////////////////////////////////////////
                            METADATA STORAGE
    //////////////////////////////////////////////////////////////*/

    string public name;

    string public symbol;

    uint8 public immutable decimals;

    /*//////////////////////////////////////////////////////////////
                              ERC20 STORAGE
    //////////////////////////////////////////////////////////////*/

    uint256 public totalSupply;

    mapping(address => uint256) public balanceOf;

    mapping(address => mapping(address => uint256)) public allowance;

    /*//////////////////////////////////////////////////////////////
                            EIP-2612 STORAGE
    //////////////////////////////////////////////////////////////*/

    uint256 internal immutable INITIAL_CHAIN_ID;

    bytes32 internal immutable INITIAL_DOMAIN_SEPARATOR;

    mapping(address => uint256) public nonces;

    /*//////////////////////////////////////////////////////////////
                               CONSTRUCTOR
    //////////////////////////////////////////////////////////////*/

    constructor(
        string memory _name,
        string memory _symbol,
        uint8 _decimals
    ) {
        name = _name;
        symbol = _symbol;
        decimals = _decimals;

        INITIAL_CHAIN_ID = block.chainid;
        INITIAL_DOMAIN_SEPARATOR = computeDomainSeparator();
    }

    /*//////////////////////////////////////////////////////////////
                               ERC20 LOGIC
    //////////////////////////////////////////////////////////////*/

    function approve(address spender, uint256 amount) public virtual returns (bool) {
        allowance[msg.sender][spender] = amount;

        emit Approval(msg.sender, spender, amount);

        return true;
    }

    function transfer(address to, uint256 amount) public virtual returns (bool) {
        balanceOf[msg.sender] -= amount;

        // Cannot overflow because the sum of all user
        // balances can't exceed the max uint256 value.
        unchecked {
            balanceOf[to] += amount;
        }

        emit Transfer(msg.sender, to, amount);

        return true;
    }

    function transferFrom(
        address from,
        address to,
        uint256 amount
    ) public virtual returns (bool) {
        uint256 allowed = allowance[from][msg.sender]; // Saves gas for limited approvals.

        if (allowed != type(uint256).max) allowance[from][msg.sender] = allowed - amount;

        balanceOf[from] -= amount;

        // Cannot overflow because the sum of all user
        // balances can't exceed the max uint256 value.
        unchecked {
            balanceOf[to] += amount;
        }

        emit Transfer(from, to, amount);

        return true;
    }

    /*//////////////////////////////////////////////////////////////
                             EIP-2612 LOGIC
    //////////////////////////////////////////////////////////////*/

    function permit(
        address owner,
        address spender,
        uint256 value,
        uint256 deadline,
        uint8 v,
        bytes32 r,
        bytes32 s
    ) public virtual {
        require(deadline >= block.timestamp, "PERMIT_DEADLINE_EXPIRED");

        // Unchecked because the only math done is incrementing
        // the owner's nonce which cannot realistically overflow.
        unchecked {
            address recoveredAddress = ecrecover(
                keccak256(
                    abi.encodePacked(
                        "\x19\x01",
                        DOMAIN_SEPARATOR(),
                        keccak256(
                            abi.encode(
                                keccak256(
                                    "Permit(address owner,address spender,uint256 value,uint256 nonce,uint256 deadline)"
                                ),
                                owner,
                                spender,
                                value,
                                nonces[owner]++,
                                deadline
                            )
                        )
                    )
                ),
                v,
                r,
                s
            );

            require(recoveredAddress != address(0) && recoveredAddress == owner, "INVALID_SIGNER");

            allowance[recoveredAddress][spender] = value;
        }

        emit Approval(owner, spender, value);
    }

    function DOMAIN_SEPARATOR() public view virtual returns (bytes32) {
        return block.chainid == INITIAL_CHAIN_ID ? INITIAL_DOMAIN_SEPARATOR : computeDomainSeparator();
    }

    function computeDomainSeparator() internal view virtual returns (bytes32) {
        return
            keccak256(
                abi.encode(
                    keccak256("EIP712Domain(string name,string version,uint256 chainId,address verifyingContract)"),
                    keccak256(bytes(name)),
                    keccak256("1"),
                    block.chainid,
                    address(this)
                )
            );
    }

    /*//////////////////////////////////////////////////////////////
                        INTERNAL MINT/BURN LOGIC
    //////////////////////////////////////////////////////////////*/

    function _mint(address to, uint256 amount) internal virtual {
        totalSupply += amount;

        // Cannot overflow because the sum of all user
        // balances can't exceed the max uint256 value.
        unchecked {
            balanceOf[to] += amount;
        }

        emit Transfer(address(0), to, amount);
    }

    function _burn(address from, uint256 amount) internal virtual {
        balanceOf[from] -= amount;

        // Cannot underflow because a user's balance
        // will never be larger than the total supply.
        unchecked {
            totalSupply -= amount;
        }

        emit Transfer(from, address(0), amount);
    }
}

File 26 of 40 : SafeTransferLib.sol
// SPDX-License-Identifier: AGPL-3.0-only
pragma solidity >=0.8.0;

import {ERC20} from "../tokens/ERC20.sol";

/// @notice Safe ETH and ERC20 transfer library that gracefully handles missing return values.
/// @author Solmate (https://github.com/transmissions11/solmate/blob/main/src/utils/SafeTransferLib.sol)
/// @dev Use with caution! Some functions in this library knowingly create dirty bits at the destination of the free memory pointer.
/// @dev Note that none of the functions in this library check that a token has code at all! That responsibility is delegated to the caller.
library SafeTransferLib {
    /*//////////////////////////////////////////////////////////////
                             ETH OPERATIONS
    //////////////////////////////////////////////////////////////*/

    function safeTransferETH(address to, uint256 amount) internal {
        bool success;

        /// @solidity memory-safe-assembly
        assembly {
            // Transfer the ETH and store if it succeeded or not.
            success := call(gas(), to, amount, 0, 0, 0, 0)
        }

        require(success, "ETH_TRANSFER_FAILED");
    }

    /*//////////////////////////////////////////////////////////////
                            ERC20 OPERATIONS
    //////////////////////////////////////////////////////////////*/

    function safeTransferFrom(
        ERC20 token,
        address from,
        address to,
        uint256 amount
    ) internal {
        bool success;

        /// @solidity memory-safe-assembly
        assembly {
            // Get a pointer to some free memory.
            let freeMemoryPointer := mload(0x40)

            // Write the abi-encoded calldata into memory, beginning with the function selector.
            mstore(freeMemoryPointer, 0x23b872dd00000000000000000000000000000000000000000000000000000000)
            mstore(add(freeMemoryPointer, 4), from) // Append the "from" argument.
            mstore(add(freeMemoryPointer, 36), to) // Append the "to" argument.
            mstore(add(freeMemoryPointer, 68), amount) // Append the "amount" argument.

            success := and(
                // Set success to whether the call reverted, if not we check it either
                // returned exactly 1 (can't just be non-zero data), or had no return data.
                or(and(eq(mload(0), 1), gt(returndatasize(), 31)), iszero(returndatasize())),
                // We use 100 because the length of our calldata totals up like so: 4 + 32 * 3.
                // We use 0 and 32 to copy up to 32 bytes of return data into the scratch space.
                // Counterintuitively, this call must be positioned second to the or() call in the
                // surrounding and() call or else returndatasize() will be zero during the computation.
                call(gas(), token, 0, freeMemoryPointer, 100, 0, 32)
            )
        }

        require(success, "TRANSFER_FROM_FAILED");
    }

    function safeTransfer(
        ERC20 token,
        address to,
        uint256 amount
    ) internal {
        bool success;

        /// @solidity memory-safe-assembly
        assembly {
            // Get a pointer to some free memory.
            let freeMemoryPointer := mload(0x40)

            // Write the abi-encoded calldata into memory, beginning with the function selector.
            mstore(freeMemoryPointer, 0xa9059cbb00000000000000000000000000000000000000000000000000000000)
            mstore(add(freeMemoryPointer, 4), to) // Append the "to" argument.
            mstore(add(freeMemoryPointer, 36), amount) // Append the "amount" argument.

            success := and(
                // Set success to whether the call reverted, if not we check it either
                // returned exactly 1 (can't just be non-zero data), or had no return data.
                or(and(eq(mload(0), 1), gt(returndatasize(), 31)), iszero(returndatasize())),
                // We use 68 because the length of our calldata totals up like so: 4 + 32 * 2.
                // We use 0 and 32 to copy up to 32 bytes of return data into the scratch space.
                // Counterintuitively, this call must be positioned second to the or() call in the
                // surrounding and() call or else returndatasize() will be zero during the computation.
                call(gas(), token, 0, freeMemoryPointer, 68, 0, 32)
            )
        }

        require(success, "TRANSFER_FAILED");
    }

    function safeApprove(
        ERC20 token,
        address to,
        uint256 amount
    ) internal {
        bool success;

        /// @solidity memory-safe-assembly
        assembly {
            // Get a pointer to some free memory.
            let freeMemoryPointer := mload(0x40)

            // Write the abi-encoded calldata into memory, beginning with the function selector.
            mstore(freeMemoryPointer, 0x095ea7b300000000000000000000000000000000000000000000000000000000)
            mstore(add(freeMemoryPointer, 4), to) // Append the "to" argument.
            mstore(add(freeMemoryPointer, 36), amount) // Append the "amount" argument.

            success := and(
                // Set success to whether the call reverted, if not we check it either
                // returned exactly 1 (can't just be non-zero data), or had no return data.
                or(and(eq(mload(0), 1), gt(returndatasize(), 31)), iszero(returndatasize())),
                // We use 68 because the length of our calldata totals up like so: 4 + 32 * 2.
                // We use 0 and 32 to copy up to 32 bytes of return data into the scratch space.
                // Counterintuitively, this call must be positioned second to the or() call in the
                // surrounding and() call or else returndatasize() will be zero during the computation.
                call(gas(), token, 0, freeMemoryPointer, 68, 0, 32)
            )
        }

        require(success, "APPROVE_FAILED");
    }
}

File 27 of 40 : AllowanceTransfer.sol
// SPDX-License-Identifier: MIT
pragma solidity 0.8.17;

import {ERC20} from "../solmate/tokens/ERC20.sol";
import {SafeTransferLib} from "../solmate/utils/SafeTransferLib.sol";
import {PermitHash} from "./libraries/PermitHash.sol";
import {SignatureVerification} from "./libraries/SignatureVerification.sol";
import {EIP712} from "./EIP712.sol";
import {IAllowanceTransfer} from "../src/interfaces/IAllowanceTransfer.sol";
import {SignatureExpired, InvalidNonce} from "./PermitErrors.sol";
import {Allowance} from "./libraries/Allowance.sol";

contract AllowanceTransfer is IAllowanceTransfer, EIP712 {
    using SignatureVerification for bytes;
    using SafeTransferLib for ERC20;
    using PermitHash for PermitSingle;
    using PermitHash for PermitBatch;
    using Allowance for PackedAllowance;

    /// @notice Maps users to tokens to spender addresses and information about the approval on the token
    /// @dev Indexed in the order of token owner address, token address, spender address
    /// @dev The stored word saves the allowed amount, expiration on the allowance, and nonce
    mapping(address => mapping(address => mapping(address => PackedAllowance))) public allowance;

    /// @inheritdoc IAllowanceTransfer
    function approve(address token, address spender, uint160 amount, uint48 expiration) external {
        PackedAllowance storage allowed = allowance[msg.sender][token][spender];
        allowed.updateAmountAndExpiration(amount, expiration);
        emit Approval(msg.sender, token, spender, amount, expiration);
    }

    /// @inheritdoc IAllowanceTransfer
    function permit(address owner, PermitSingle memory permitSingle, bytes calldata signature) external {
        if (block.timestamp > permitSingle.sigDeadline) revert SignatureExpired(permitSingle.sigDeadline);

        // Verify the signer address from the signature.
        signature.verify(_hashTypedData(permitSingle.hash()), owner);

        _updateApproval(permitSingle.details, owner, permitSingle.spender);
    }

    /// @inheritdoc IAllowanceTransfer
    function permit(address owner, PermitBatch memory permitBatch, bytes calldata signature) external {
        if (block.timestamp > permitBatch.sigDeadline) revert SignatureExpired(permitBatch.sigDeadline);

        // Verify the signer address from the signature.
        signature.verify(_hashTypedData(permitBatch.hash()), owner);

        address spender = permitBatch.spender;
        unchecked {
            uint256 length = permitBatch.details.length;
            for (uint256 i = 0; i < length; ++i) {
                _updateApproval(permitBatch.details[i], owner, spender);
            }
        }
    }

    /// @inheritdoc IAllowanceTransfer
    function transferFrom(address from, address to, uint160 amount, address token) external {
        _transfer(from, to, amount, token);
    }

    /// @inheritdoc IAllowanceTransfer
    function transferFrom(AllowanceTransferDetails[] calldata transferDetails) external {
        unchecked {
            uint256 length = transferDetails.length;
            for (uint256 i = 0; i < length; ++i) {
                AllowanceTransferDetails memory transferDetail = transferDetails[i];
                _transfer(transferDetail.from, transferDetail.to, transferDetail.amount, transferDetail.token);
            }
        }
    }

    /// @notice Internal function for transferring tokens using stored allowances
    /// @dev Will fail if the allowed timeframe has passed
    function _transfer(address from, address to, uint160 amount, address token) private {
        PackedAllowance storage allowed = allowance[from][token][msg.sender];

        if (block.timestamp > allowed.expiration) revert AllowanceExpired(allowed.expiration);

        uint256 maxAmount = allowed.amount;
        if (maxAmount != type(uint160).max) {
            if (amount > maxAmount) {
                revert InsufficientAllowance(maxAmount);
            } else {
                unchecked {
                    allowed.amount = uint160(maxAmount) - amount;
                }
            }
        }

        // Transfer the tokens from the from address to the recipient.
        ERC20(token).safeTransferFrom(from, to, amount);
    }

    /// @inheritdoc IAllowanceTransfer
    function lockdown(TokenSpenderPair[] calldata approvals) external {
        address owner = msg.sender;
        // Revoke allowances for each pair of spenders and tokens.
        unchecked {
            uint256 length = approvals.length;
            for (uint256 i = 0; i < length; ++i) {
                address token = approvals[i].token;
                address spender = approvals[i].spender;

                allowance[owner][token][spender].amount = 0;
                emit Lockdown(owner, token, spender);
            }
        }
    }

    /// @inheritdoc IAllowanceTransfer
    function invalidateNonces(address token, address spender, uint48 newNonce) external {
        uint48 oldNonce = allowance[msg.sender][token][spender].nonce;

        if (newNonce <= oldNonce) revert InvalidNonce();

        // Limit the amount of nonces that can be invalidated in one transaction.
        unchecked {
            uint48 delta = newNonce - oldNonce;
            if (delta > type(uint16).max) revert ExcessiveInvalidation();
        }

        allowance[msg.sender][token][spender].nonce = newNonce;
        emit NonceInvalidation(msg.sender, token, spender, newNonce, oldNonce);
    }

    /// @notice Sets the new values for amount, expiration, and nonce.
    /// @dev Will check that the signed nonce is equal to the current nonce and then incrememnt the nonce value by 1.
    /// @dev Emits a Permit event.
    function _updateApproval(PermitDetails memory details, address owner, address spender) private {
        uint48 nonce = details.nonce;
        address token = details.token;
        uint160 amount = details.amount;
        uint48 expiration = details.expiration;
        PackedAllowance storage allowed = allowance[owner][token][spender];

        if (allowed.nonce != nonce) revert InvalidNonce();

        allowed.updateAll(amount, expiration, nonce);
        emit Permit(owner, token, spender, amount, expiration, nonce);
    }
}

File 28 of 40 : EIP712.sol
// SPDX-License-Identifier: MIT
pragma solidity 0.8.17;

/// @notice EIP712 helpers for permit2
/// @dev Maintains cross-chain replay protection in the event of a fork
/// @dev Reference: https://github.com/OpenZeppelin/openzeppelin-contracts/blob/master/contracts/utils/cryptography/EIP712.sol
contract EIP712 {
    // Cache the domain separator as an immutable value, but also store the chain id that it
    // corresponds to, in order to invalidate the cached domain separator if the chain id changes.
    bytes32 private immutable _CACHED_DOMAIN_SEPARATOR;
    uint256 private immutable _CACHED_CHAIN_ID;

    bytes32 private constant _HASHED_NAME = keccak256("Permit2");
    bytes32 private constant _TYPE_HASH =
        keccak256("EIP712Domain(string name,uint256 chainId,address verifyingContract)");

    constructor() {
        _CACHED_CHAIN_ID = block.chainid;
        _CACHED_DOMAIN_SEPARATOR = _buildDomainSeparator(_TYPE_HASH, _HASHED_NAME);
    }

    /// @notice Returns the domain separator for the current chain.
    /// @dev Uses cached version if chainid and address are unchanged from construction.
    function DOMAIN_SEPARATOR() public view returns (bytes32) {
        return block.chainid == _CACHED_CHAIN_ID
            ? _CACHED_DOMAIN_SEPARATOR
            : _buildDomainSeparator(_TYPE_HASH, _HASHED_NAME);
    }

    /// @notice Builds a domain separator using the current chainId and contract address.
    function _buildDomainSeparator(bytes32 typeHash, bytes32 nameHash) private view returns (bytes32) {
        return keccak256(abi.encode(typeHash, nameHash, block.chainid, address(this)));
    }

    /// @notice Creates an EIP-712 typed data hash
    function _hashTypedData(bytes32 dataHash) internal view returns (bytes32) {
        return keccak256(abi.encodePacked("\x19\x01", DOMAIN_SEPARATOR(), dataHash));
    }
}

File 29 of 40 : Permit2.sol
// SPDX-License-Identifier: MIT
pragma solidity 0.8.17;

import {SignatureTransfer} from "./SignatureTransfer.sol";
import {AllowanceTransfer} from "./AllowanceTransfer.sol";

/// @notice Permit2 handles signature-based transfers in SignatureTransfer and allowance-based transfers in AllowanceTransfer.
/// @dev Users must approve Permit2 before calling any of the transfer functions.
contract Permit2 is SignatureTransfer, AllowanceTransfer {
// Permit2 unifies the two contracts so users have maximal flexibility with their approval.
}

File 30 of 40 : PermitErrors.sol
// SPDX-License-Identifier: MIT
pragma solidity 0.8.17;

/// @notice Shared errors between signature based transfers and allowance based transfers.

/// @notice Thrown when validating an inputted signature that is stale
/// @param signatureDeadline The timestamp at which a signature is no longer valid
error SignatureExpired(uint256 signatureDeadline);

/// @notice Thrown when validating that the inputted nonce has not been used
error InvalidNonce();

File 31 of 40 : SignatureTransfer.sol
// SPDX-License-Identifier: MIT
pragma solidity 0.8.17;

import {ISignatureTransfer} from "./interfaces/ISignatureTransfer.sol";
import {SignatureExpired, InvalidNonce} from "./PermitErrors.sol";
import {ERC20} from "../solmate/tokens/ERC20.sol";
import {SafeTransferLib} from "../solmate/utils/SafeTransferLib.sol";
import {SignatureVerification} from "./libraries/SignatureVerification.sol";
import {PermitHash} from "./libraries/PermitHash.sol";
import {EIP712} from "./EIP712.sol";

contract SignatureTransfer is ISignatureTransfer, EIP712 {
    using SignatureVerification for bytes;
    using SafeTransferLib for ERC20;
    using PermitHash for PermitTransferFrom;
    using PermitHash for PermitBatchTransferFrom;

    /// @inheritdoc ISignatureTransfer
    mapping(address => mapping(uint256 => uint256)) public nonceBitmap;

    /// @inheritdoc ISignatureTransfer
    function permitTransferFrom(
        PermitTransferFrom memory permit,
        SignatureTransferDetails calldata transferDetails,
        address owner,
        bytes calldata signature
    ) external {
        _permitTransferFrom(permit, transferDetails, owner, permit.hash(), signature);
    }

    /// @inheritdoc ISignatureTransfer
    function permitWitnessTransferFrom(
        PermitTransferFrom memory permit,
        SignatureTransferDetails calldata transferDetails,
        address owner,
        bytes32 witness,
        string calldata witnessTypeString,
        bytes calldata signature
    ) external {
        _permitTransferFrom(
            permit, transferDetails, owner, permit.hashWithWitness(witness, witnessTypeString), signature
        );
    }

    /// @notice Transfers a token using a signed permit message.
    /// @dev If to is the zero address, the tokens are sent to the spender.
    /// @param permit The permit data signed over by the owner
    /// @param dataHash The EIP-712 hash of permit data to include when checking signature
    /// @param owner The owner of the tokens to transfer
    /// @param transferDetails The spender's requested transfer details for the permitted token
    /// @param signature The signature to verify
    function _permitTransferFrom(
        PermitTransferFrom memory permit,
        SignatureTransferDetails calldata transferDetails,
        address owner,
        bytes32 dataHash,
        bytes calldata signature
    ) private {
        uint256 requestedAmount = transferDetails.requestedAmount;

        if (block.timestamp > permit.deadline) revert SignatureExpired(permit.deadline);
        if (requestedAmount > permit.permitted.amount) revert InvalidAmount(permit.permitted.amount);

        _useUnorderedNonce(owner, permit.nonce);

        signature.verify(_hashTypedData(dataHash), owner);

        ERC20(permit.permitted.token).safeTransferFrom(owner, transferDetails.to, requestedAmount);
    }

    /// @inheritdoc ISignatureTransfer
    function permitTransferFrom(
        PermitBatchTransferFrom memory permit,
        SignatureTransferDetails[] calldata transferDetails,
        address owner,
        bytes calldata signature
    ) external {
        _permitTransferFrom(permit, transferDetails, owner, permit.hash(), signature);
    }

    /// @inheritdoc ISignatureTransfer
    function permitWitnessTransferFrom(
        PermitBatchTransferFrom memory permit,
        SignatureTransferDetails[] calldata transferDetails,
        address owner,
        bytes32 witness,
        string calldata witnessTypeString,
        bytes calldata signature
    ) external {
        _permitTransferFrom(
            permit, transferDetails, owner, permit.hashWithWitness(witness, witnessTypeString), signature
        );
    }

    /// @notice Transfers tokens using a signed permit messages
    /// @dev If to is the zero address, the tokens are sent to the spender
    /// @param permit The permit data signed over by the owner
    /// @param dataHash The EIP-712 hash of permit data to include when checking signature
    /// @param owner The owner of the tokens to transfer
    /// @param signature The signature to verify
    function _permitTransferFrom(
        PermitBatchTransferFrom memory permit,
        SignatureTransferDetails[] calldata transferDetails,
        address owner,
        bytes32 dataHash,
        bytes calldata signature
    ) private {
        uint256 numPermitted = permit.permitted.length;

        if (block.timestamp > permit.deadline) revert SignatureExpired(permit.deadline);
        if (numPermitted != transferDetails.length) revert LengthMismatch();

        _useUnorderedNonce(owner, permit.nonce);
        signature.verify(_hashTypedData(dataHash), owner);

        unchecked {
            for (uint256 i = 0; i < numPermitted; ++i) {
                TokenPermissions memory permitted = permit.permitted[i];
                uint256 requestedAmount = transferDetails[i].requestedAmount;

                if (requestedAmount > permitted.amount) revert InvalidAmount(permitted.amount);

                if (requestedAmount != 0) {
                    // allow spender to specify which of the permitted tokens should be transferred
                    ERC20(permitted.token).safeTransferFrom(owner, transferDetails[i].to, requestedAmount);
                }
            }
        }
    }

    /// @inheritdoc ISignatureTransfer
    function invalidateUnorderedNonces(uint256 wordPos, uint256 mask) external {
        nonceBitmap[msg.sender][wordPos] |= mask;

        emit UnorderedNonceInvalidation(msg.sender, wordPos, mask);
    }

    /// @notice Returns the index of the bitmap and the bit position within the bitmap. Used for unordered nonces
    /// @param nonce The nonce to get the associated word and bit positions
    /// @return wordPos The word position or index into the nonceBitmap
    /// @return bitPos The bit position
    /// @dev The first 248 bits of the nonce value is the index of the desired bitmap
    /// @dev The last 8 bits of the nonce value is the position of the bit in the bitmap
    function bitmapPositions(uint256 nonce) private pure returns (uint256 wordPos, uint256 bitPos) {
        wordPos = uint248(nonce >> 8);
        bitPos = uint8(nonce);
    }

    /// @notice Checks whether a nonce is taken and sets the bit at the bit position in the bitmap at the word position
    /// @param from The address to use the nonce at
    /// @param nonce The nonce to spend
    function _useUnorderedNonce(address from, uint256 nonce) internal {
        (uint256 wordPos, uint256 bitPos) = bitmapPositions(nonce);
        uint256 bit = 1 << bitPos;
        uint256 flipped = nonceBitmap[from][wordPos] ^= bit;

        if (flipped & bit == 0) revert InvalidNonce();
    }
}

File 32 of 40 : IAllowanceTransfer.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.17;

/// @title AllowanceTransfer
/// @notice Handles ERC20 token permissions through signature based allowance setting and ERC20 token transfers by checking allowed amounts
/// @dev Requires user's token approval on the Permit2 contract
interface IAllowanceTransfer {
    /// @notice Thrown when an allowance on a token has expired.
    /// @param deadline The timestamp at which the allowed amount is no longer valid
    error AllowanceExpired(uint256 deadline);

    /// @notice Thrown when an allowance on a token has been depleted.
    /// @param amount The maximum amount allowed
    error InsufficientAllowance(uint256 amount);

    /// @notice Thrown when too many nonces are invalidated.
    error ExcessiveInvalidation();

    /// @notice Emits an event when the owner successfully invalidates an ordered nonce.
    event NonceInvalidation(
        address indexed owner, address indexed token, address indexed spender, uint48 newNonce, uint48 oldNonce
    );

    /// @notice Emits an event when the owner successfully sets permissions on a token for the spender.
    event Approval(
        address indexed owner, address indexed token, address indexed spender, uint160 amount, uint48 expiration
    );

    /// @notice Emits an event when the owner successfully sets permissions using a permit signature on a token for the spender.
    event Permit(
        address indexed owner,
        address indexed token,
        address indexed spender,
        uint160 amount,
        uint48 expiration,
        uint48 nonce
    );

    /// @notice Emits an event when the owner sets the allowance back to 0 with the lockdown function.
    event Lockdown(address indexed owner, address token, address spender);

    /// @notice The permit data for a token
    struct PermitDetails {
        // ERC20 token address
        address token;
        // the maximum amount allowed to spend
        uint160 amount;
        // timestamp at which a spender's token allowances become invalid
        uint48 expiration;
        // an incrementing value indexed per owner,token,and spender for each signature
        uint48 nonce;
    }

    /// @notice The permit message signed for a single token allownce
    struct PermitSingle {
        // the permit data for a single token alownce
        PermitDetails details;
        // address permissioned on the allowed tokens
        address spender;
        // deadline on the permit signature
        uint256 sigDeadline;
    }

    /// @notice The permit message signed for multiple token allowances
    struct PermitBatch {
        // the permit data for multiple token allowances
        PermitDetails[] details;
        // address permissioned on the allowed tokens
        address spender;
        // deadline on the permit signature
        uint256 sigDeadline;
    }

    /// @notice The saved permissions
    /// @dev This info is saved per owner, per token, per spender and all signed over in the permit message
    /// @dev Setting amount to type(uint160).max sets an unlimited approval
    struct PackedAllowance {
        // amount allowed
        uint160 amount;
        // permission expiry
        uint48 expiration;
        // an incrementing value indexed per owner,token,and spender for each signature
        uint48 nonce;
    }

    /// @notice A token spender pair.
    struct TokenSpenderPair {
        // the token the spender is approved
        address token;
        // the spender address
        address spender;
    }

    /// @notice Details for a token transfer.
    struct AllowanceTransferDetails {
        // the owner of the token
        address from;
        // the recipient of the token
        address to;
        // the amount of the token
        uint160 amount;
        // the token to be transferred
        address token;
    }

    /// @notice A mapping from owner address to token address to spender address to PackedAllowance struct, which contains details and conditions of the approval.
    /// @notice The mapping is indexed in the above order see: allowance[ownerAddress][tokenAddress][spenderAddress]
    /// @dev The packed slot holds the allowed amount, expiration at which the allowed amount is no longer valid, and current nonce thats updated on any signature based approvals.
    function allowance(address, address, address) external view returns (uint160, uint48, uint48);

    /// @notice Approves the spender to use up to amount of the specified token up until the expiration
    /// @param token The token to approve
    /// @param spender The spender address to approve
    /// @param amount The approved amount of the token
    /// @param expiration The timestamp at which the approval is no longer valid
    /// @dev The packed allowance also holds a nonce, which will stay unchanged in approve
    /// @dev Setting amount to type(uint160).max sets an unlimited approval
    function approve(address token, address spender, uint160 amount, uint48 expiration) external;

    /// @notice Permit a spender to a given amount of the owners token via the owner's EIP-712 signature
    /// @dev May fail if the owner's nonce was invalidated in-flight by invalidateNonce
    /// @param owner The owner of the tokens being approved
    /// @param permitSingle Data signed over by the owner specifying the terms of approval
    /// @param signature The owner's signature over the permit data
    function permit(address owner, PermitSingle memory permitSingle, bytes calldata signature) external;

    /// @notice Permit a spender to the signed amounts of the owners tokens via the owner's EIP-712 signature
    /// @dev May fail if the owner's nonce was invalidated in-flight by invalidateNonce
    /// @param owner The owner of the tokens being approved
    /// @param permitBatch Data signed over by the owner specifying the terms of approval
    /// @param signature The owner's signature over the permit data
    function permit(address owner, PermitBatch memory permitBatch, bytes calldata signature) external;

    /// @notice Transfer approved tokens from one address to another
    /// @param from The address to transfer from
    /// @param to The address of the recipient
    /// @param amount The amount of the token to transfer
    /// @param token The token address to transfer
    /// @dev Requires the from address to have approved at least the desired amount
    /// of tokens to msg.sender.
    function transferFrom(address from, address to, uint160 amount, address token) external;

    /// @notice Transfer approved tokens in a batch
    /// @param transferDetails Array of owners, recipients, amounts, and tokens for the transfers
    /// @dev Requires the from addresses to have approved at least the desired amount
    /// of tokens to msg.sender.
    function transferFrom(AllowanceTransferDetails[] calldata transferDetails) external;

    /// @notice Enables performing a "lockdown" of the sender's Permit2 identity
    /// by batch revoking approvals
    /// @param approvals Array of approvals to revoke.
    function lockdown(TokenSpenderPair[] calldata approvals) external;

    /// @notice Invalidate nonces for a given (token, spender) pair
    /// @param token The token to invalidate nonces for
    /// @param spender The spender to invalidate nonces for
    /// @param newNonce The new nonce to set. Invalidates all nonces less than it.
    /// @dev Can't invalidate more than 2**16 nonces per transaction.
    function invalidateNonces(address token, address spender, uint48 newNonce) external;
}

File 33 of 40 : IERC1271.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.17;

interface IERC1271 {
    /// @dev Should return whether the signature provided is valid for the provided data
    /// @param hash      Hash of the data to be signed
    /// @param signature Signature byte array associated with _data
    /// @return magicValue The bytes4 magic value 0x1626ba7e
    function isValidSignature(bytes32 hash, bytes memory signature) external view returns (bytes4 magicValue);
}

File 34 of 40 : ISignatureTransfer.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.17;

/// @title SignatureTransfer
/// @notice Handles ERC20 token transfers through signature based actions
/// @dev Requires user's token approval on the Permit2 contract
interface ISignatureTransfer {
    /// @notice Thrown when the requested amount for a transfer is larger than the permissioned amount
    /// @param maxAmount The maximum amount a spender can request to transfer
    error InvalidAmount(uint256 maxAmount);

    /// @notice Thrown when the number of tokens permissioned to a spender does not match the number of tokens being transferred
    /// @dev If the spender does not need to transfer the number of tokens permitted, the spender can request amount 0 to be transferred
    error LengthMismatch();

    /// @notice Emits an event when the owner successfully invalidates an unordered nonce.
    event UnorderedNonceInvalidation(address indexed owner, uint256 word, uint256 mask);

    /// @notice The token and amount details for a transfer signed in the permit transfer signature
    struct TokenPermissions {
        // ERC20 token address
        address token;
        // the maximum amount that can be spent
        uint256 amount;
    }

    /// @notice The signed permit message for a single token transfer
    struct PermitTransferFrom {
        TokenPermissions permitted;
        // a unique value for every token owner's signature to prevent signature replays
        uint256 nonce;
        // deadline on the permit signature
        uint256 deadline;
    }

    /// @notice Specifies the recipient address and amount for batched transfers.
    /// @dev Recipients and amounts correspond to the index of the signed token permissions array.
    /// @dev Reverts if the requested amount is greater than the permitted signed amount.
    struct SignatureTransferDetails {
        // recipient address
        address to;
        // spender requested amount
        uint256 requestedAmount;
    }

    /// @notice Used to reconstruct the signed permit message for multiple token transfers
    /// @dev Do not need to pass in spender address as it is required that it is msg.sender
    /// @dev Note that a user still signs over a spender address
    struct PermitBatchTransferFrom {
        // the tokens and corresponding amounts permitted for a transfer
        TokenPermissions[] permitted;
        // a unique value for every token owner's signature to prevent signature replays
        uint256 nonce;
        // deadline on the permit signature
        uint256 deadline;
    }

    /// @notice A map from token owner address and a caller specified word index to a bitmap. Used to set bits in the bitmap to prevent against signature replay protection
    /// @dev Uses unordered nonces so that permit messages do not need to be spent in a certain order
    /// @dev The mapping is indexed first by the token owner, then by an index specified in the nonce
    /// @dev It returns a uint256 bitmap
    /// @dev The index, or wordPosition is capped at type(uint248).max
    function nonceBitmap(address, uint256) external view returns (uint256);

    /// @notice Transfers a token using a signed permit message
    /// @dev Reverts if the requested amount is greater than the permitted signed amount
    /// @param permit The permit data signed over by the owner
    /// @param owner The owner of the tokens to transfer
    /// @param transferDetails The spender's requested transfer details for the permitted token
    /// @param signature The signature to verify
    function permitTransferFrom(
        PermitTransferFrom memory permit,
        SignatureTransferDetails calldata transferDetails,
        address owner,
        bytes calldata signature
    ) external;

    /// @notice Transfers a token using a signed permit message
    /// @notice Includes extra data provided by the caller to verify signature over
    /// @dev The witness type string must follow EIP712 ordering of nested structs and must include the TokenPermissions type definition
    /// @dev Reverts if the requested amount is greater than the permitted signed amount
    /// @param permit The permit data signed over by the owner
    /// @param owner The owner of the tokens to transfer
    /// @param transferDetails The spender's requested transfer details for the permitted token
    /// @param witness Extra data to include when checking the user signature
    /// @param witnessTypeString The EIP-712 type definition for remaining string stub of the typehash
    /// @param signature The signature to verify
    function permitWitnessTransferFrom(
        PermitTransferFrom memory permit,
        SignatureTransferDetails calldata transferDetails,
        address owner,
        bytes32 witness,
        string calldata witnessTypeString,
        bytes calldata signature
    ) external;

    /// @notice Transfers multiple tokens using a signed permit message
    /// @param permit The permit data signed over by the owner
    /// @param owner The owner of the tokens to transfer
    /// @param transferDetails Specifies the recipient and requested amount for the token transfer
    /// @param signature The signature to verify
    function permitTransferFrom(
        PermitBatchTransferFrom memory permit,
        SignatureTransferDetails[] calldata transferDetails,
        address owner,
        bytes calldata signature
    ) external;

    /// @notice Transfers multiple tokens using a signed permit message
    /// @dev The witness type string must follow EIP712 ordering of nested structs and must include the TokenPermissions type definition
    /// @notice Includes extra data provided by the caller to verify signature over
    /// @param permit The permit data signed over by the owner
    /// @param owner The owner of the tokens to transfer
    /// @param transferDetails Specifies the recipient and requested amount for the token transfer
    /// @param witness Extra data to include when checking the user signature
    /// @param witnessTypeString The EIP-712 type definition for remaining string stub of the typehash
    /// @param signature The signature to verify
    function permitWitnessTransferFrom(
        PermitBatchTransferFrom memory permit,
        SignatureTransferDetails[] calldata transferDetails,
        address owner,
        bytes32 witness,
        string calldata witnessTypeString,
        bytes calldata signature
    ) external;

    /// @notice Invalidates the bits specified in mask for the bitmap at the word position
    /// @dev The wordPos is maxed at type(uint248).max
    /// @param wordPos A number to index the nonceBitmap at
    /// @param mask A bitmap masked against msg.sender's current bitmap at the word position
    function invalidateUnorderedNonces(uint256 wordPos, uint256 mask) external;
}

File 35 of 40 : Allowance.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.17;

import {IAllowanceTransfer} from "../interfaces/IAllowanceTransfer.sol";

library Allowance {
    // note if the expiration passed is 0, then it the approval set to the block.timestamp
    uint256 private constant BLOCK_TIMESTAMP_EXPIRATION = 0;

    /// @notice Sets the allowed amount, expiry, and nonce of the spender's permissions on owner's token.
    /// @dev Nonce is incremented.
    /// @dev If the inputted expiration is 0, the stored expiration is set to block.timestamp
    function updateAll(
        IAllowanceTransfer.PackedAllowance storage allowed,
        uint160 amount,
        uint48 expiration,
        uint48 nonce
    ) internal {
        uint48 storedNonce;
        unchecked {
            storedNonce = nonce + 1;
        }

        uint48 storedExpiration = expiration == BLOCK_TIMESTAMP_EXPIRATION ? uint48(block.timestamp) : expiration;

        uint256 word = pack(amount, storedExpiration, storedNonce);
        assembly {
            sstore(allowed.slot, word)
        }
    }

    /// @notice Sets the allowed amount and expiry of the spender's permissions on owner's token.
    /// @dev Nonce does not need to be incremented.
    function updateAmountAndExpiration(
        IAllowanceTransfer.PackedAllowance storage allowed,
        uint160 amount,
        uint48 expiration
    ) internal {
        // If the inputted expiration is 0, the allowance only lasts the duration of the block.
        allowed.expiration = expiration == 0 ? uint48(block.timestamp) : expiration;
        allowed.amount = amount;
    }

    /// @notice Computes the packed slot of the amount, expiration, and nonce that make up PackedAllowance
    function pack(uint160 amount, uint48 expiration, uint48 nonce) internal pure returns (uint256 word) {
        word = (uint256(nonce) << 208) | uint256(expiration) << 160 | amount;
    }
}

File 36 of 40 : PermitHash.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.17;

import {IAllowanceTransfer} from "../interfaces/IAllowanceTransfer.sol";
import {ISignatureTransfer} from "../interfaces/ISignatureTransfer.sol";

library PermitHash {
    bytes32 public constant _PERMIT_DETAILS_TYPEHASH =
        keccak256("PermitDetails(address token,uint160 amount,uint48 expiration,uint48 nonce)");

    bytes32 public constant _PERMIT_SINGLE_TYPEHASH = keccak256(
        "PermitSingle(PermitDetails details,address spender,uint256 sigDeadline)PermitDetails(address token,uint160 amount,uint48 expiration,uint48 nonce)"
    );

    bytes32 public constant _PERMIT_BATCH_TYPEHASH = keccak256(
        "PermitBatch(PermitDetails[] details,address spender,uint256 sigDeadline)PermitDetails(address token,uint160 amount,uint48 expiration,uint48 nonce)"
    );

    bytes32 public constant _TOKEN_PERMISSIONS_TYPEHASH = keccak256("TokenPermissions(address token,uint256 amount)");

    bytes32 public constant _PERMIT_TRANSFER_FROM_TYPEHASH = keccak256(
        "PermitTransferFrom(TokenPermissions permitted,address spender,uint256 nonce,uint256 deadline)TokenPermissions(address token,uint256 amount)"
    );

    bytes32 public constant _PERMIT_BATCH_TRANSFER_FROM_TYPEHASH = keccak256(
        "PermitBatchTransferFrom(TokenPermissions[] permitted,address spender,uint256 nonce,uint256 deadline)TokenPermissions(address token,uint256 amount)"
    );

    string public constant _TOKEN_PERMISSIONS_TYPESTRING = "TokenPermissions(address token,uint256 amount)";

    string public constant _PERMIT_TRANSFER_FROM_WITNESS_TYPEHASH_STUB =
        "PermitWitnessTransferFrom(TokenPermissions permitted,address spender,uint256 nonce,uint256 deadline,";

    string public constant _PERMIT_BATCH_WITNESS_TRANSFER_FROM_TYPEHASH_STUB =
        "PermitBatchWitnessTransferFrom(TokenPermissions[] permitted,address spender,uint256 nonce,uint256 deadline,";

    function hash(IAllowanceTransfer.PermitSingle memory permitSingle) internal pure returns (bytes32) {
        bytes32 permitHash = _hashPermitDetails(permitSingle.details);
        return
            keccak256(abi.encode(_PERMIT_SINGLE_TYPEHASH, permitHash, permitSingle.spender, permitSingle.sigDeadline));
    }

    function hash(IAllowanceTransfer.PermitBatch memory permitBatch) internal pure returns (bytes32) {
        uint256 numPermits = permitBatch.details.length;
        bytes32[] memory permitHashes = new bytes32[](numPermits);
        for (uint256 i = 0; i < numPermits; ++i) {
            permitHashes[i] = _hashPermitDetails(permitBatch.details[i]);
        }
        return keccak256(
            abi.encode(
                _PERMIT_BATCH_TYPEHASH,
                keccak256(abi.encodePacked(permitHashes)),
                permitBatch.spender,
                permitBatch.sigDeadline
            )
        );
    }

    function hash(ISignatureTransfer.PermitTransferFrom memory permit) internal view returns (bytes32) {
        bytes32 tokenPermissionsHash = _hashTokenPermissions(permit.permitted);
        return keccak256(
            abi.encode(_PERMIT_TRANSFER_FROM_TYPEHASH, tokenPermissionsHash, msg.sender, permit.nonce, permit.deadline)
        );
    }

    function hash(ISignatureTransfer.PermitBatchTransferFrom memory permit) internal view returns (bytes32) {
        uint256 numPermitted = permit.permitted.length;
        bytes32[] memory tokenPermissionHashes = new bytes32[](numPermitted);

        for (uint256 i = 0; i < numPermitted; ++i) {
            tokenPermissionHashes[i] = _hashTokenPermissions(permit.permitted[i]);
        }

        return keccak256(
            abi.encode(
                _PERMIT_BATCH_TRANSFER_FROM_TYPEHASH,
                keccak256(abi.encodePacked(tokenPermissionHashes)),
                msg.sender,
                permit.nonce,
                permit.deadline
            )
        );
    }

    function hashWithWitness(
        ISignatureTransfer.PermitTransferFrom memory permit,
        bytes32 witness,
        string calldata witnessTypeString
    ) internal view returns (bytes32) {
        bytes32 typeHash = keccak256(abi.encodePacked(_PERMIT_TRANSFER_FROM_WITNESS_TYPEHASH_STUB, witnessTypeString));

        bytes32 tokenPermissionsHash = _hashTokenPermissions(permit.permitted);
        return keccak256(abi.encode(typeHash, tokenPermissionsHash, msg.sender, permit.nonce, permit.deadline, witness));
    }

    function hashWithWitness(
        ISignatureTransfer.PermitBatchTransferFrom memory permit,
        bytes32 witness,
        string calldata witnessTypeString
    ) internal view returns (bytes32) {
        bytes32 typeHash =
            keccak256(abi.encodePacked(_PERMIT_BATCH_WITNESS_TRANSFER_FROM_TYPEHASH_STUB, witnessTypeString));

        uint256 numPermitted = permit.permitted.length;
        bytes32[] memory tokenPermissionHashes = new bytes32[](numPermitted);

        for (uint256 i = 0; i < numPermitted; ++i) {
            tokenPermissionHashes[i] = _hashTokenPermissions(permit.permitted[i]);
        }

        return keccak256(
            abi.encode(
                typeHash,
                keccak256(abi.encodePacked(tokenPermissionHashes)),
                msg.sender,
                permit.nonce,
                permit.deadline,
                witness
            )
        );
    }

    function _hashPermitDetails(IAllowanceTransfer.PermitDetails memory details) private pure returns (bytes32) {
        return keccak256(abi.encode(_PERMIT_DETAILS_TYPEHASH, details));
    }

    function _hashTokenPermissions(ISignatureTransfer.TokenPermissions memory permitted)
        private
        pure
        returns (bytes32)
    {
        return keccak256(abi.encode(_TOKEN_PERMISSIONS_TYPEHASH, permitted));
    }
}

File 37 of 40 : SignatureVerification.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.17;

import {IERC1271} from "../interfaces/IERC1271.sol";

library SignatureVerification {
    /// @notice Thrown when the passed in signature is not a valid length
    error InvalidSignatureLength();

    /// @notice Thrown when the recovered signer is equal to the zero address
    error InvalidSignature();

    /// @notice Thrown when the recovered signer does not equal the claimedSigner
    error InvalidSigner();

    /// @notice Thrown when the recovered contract signature is incorrect
    error InvalidContractSignature();

    bytes32 constant UPPER_BIT_MASK = (0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff);

    function verify(bytes calldata signature, bytes32 hash, address claimedSigner) internal view {
        bytes32 r;
        bytes32 s;
        uint8 v;

        if (claimedSigner.code.length == 0) {
            if (signature.length == 65) {
                (r, s) = abi.decode(signature, (bytes32, bytes32));
                v = uint8(signature[64]);
            } else if (signature.length == 64) {
                // EIP-2098
                bytes32 vs;
                (r, vs) = abi.decode(signature, (bytes32, bytes32));
                s = vs & UPPER_BIT_MASK;
                v = uint8(uint256(vs >> 255)) + 27;
            } else {
                revert InvalidSignatureLength();
            }
            address signer = ecrecover(hash, v, r, s);
            if (signer == address(0)) revert InvalidSignature();
            if (signer != claimedSigner) revert InvalidSigner();
        } else {
            bytes4 magicValue = IERC1271(claimedSigner).isValidSignature(hash, signature);
            if (magicValue != IERC1271.isValidSignature.selector) revert InvalidContractSignature();
        }
    }
}

File 38 of 40 : Transfers.sol
// SPDX-License-Identifier: UNLICENSED
pragma solidity ^0.8.17;

import "@openzeppelin/contracts/token/ERC20/IERC20.sol";
import "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol";
import "@openzeppelin/contracts/security/Pausable.sol";
import "@openzeppelin/contracts/security/ReentrancyGuard.sol";
import "@openzeppelin/contracts/utils/cryptography/ECDSA.sol";
import "@openzeppelin/contracts/access/Ownable.sol";
import "@openzeppelin/contracts/utils/Context.sol";
import "@uniswap/universal-router/contracts/interfaces/IUniversalRouter.sol";
import {Commands as UniswapCommands} from "@uniswap/universal-router/contracts/libraries/Commands.sol";
import {Constants as UniswapConstants} from "@uniswap/universal-router/contracts/libraries/Constants.sol";
import "@uniswap/v3-periphery/contracts/interfaces/ISwapRouter.sol";
import "../interfaces/IWrappedNativeCurrency.sol";
import "../interfaces/ITransfers.sol";
import "../interfaces/IUniswapRouter.sol";
import "../utils/Sweepable.sol";
import "../permit2/src/Permit2.sol";

// Uniswap error selectors, used to surface information when swaps fail
// Pulled from @uniswap/universal-router/out/V3SwapRouter.sol/V3SwapRouter.json after compiling with forge
bytes32 constant V3_INVALID_SWAP = keccak256(hex"316cf0eb");
bytes32 constant V3_TOO_LITTLE_RECEIVED = keccak256(hex"39d35496");
bytes32 constant V3_TOO_MUCH_REQUESTED = keccak256(hex"739dbe52");
bytes32 constant V3_INVALID_AMOUNT_OUT = keccak256(hex"d4e0248e");
bytes32 constant V3_INVALID_CALLER = keccak256(hex"32b13d91");

// @inheritdoc ITransfers
contract Transfers is Context, Ownable, Pausable, ReentrancyGuard, Sweepable, ITransfers {
    using SafeERC20 for IERC20;
    using SafeERC20 for IWrappedNativeCurrency;

    // @dev Map of operator addresses and fee destinations.
    mapping(address => address) private feeDestinations;

    // @dev Map of operator addresses to a map of transfer intent ids that have been processed
    mapping(address => mapping(bytes16 => bool)) private processedTransferIntents;

    // @dev Represents native token of a chain (e.g. ETH or MATIC)
    address private immutable NATIVE_CURRENCY = address(0);

    // @dev Uniswap on-chain contract
    IUniversalRouter private immutable uniswap;

    // @dev permit2 SignatureTransfer contract address. Used for tranferring tokens with a signature instead of a full transaction.
    // See: https://github.com/Uniswap/permit2
    Permit2 public immutable permit2;

    // @dev Canonical wrapped token for this chain. e.g. (wETH or wMATIC).
    IWrappedNativeCurrency private immutable wrappedNativeCurrency;

    // @param _uniswap The address of the Uniswap V3 swap router
    // @param _wrappedNativeCurrency The address of the wrapped token for this chain
    constructor(
        IUniversalRouter _uniswap,
        Permit2 _permit2,
        address _initialOperator,
        address _initialFeeDestination,
        IWrappedNativeCurrency _wrappedNativeCurrency
    ) {
        uniswap = _uniswap;
        permit2 = _permit2;
        wrappedNativeCurrency = _wrappedNativeCurrency;

        // Sets an initial operator to enable immediate payment processing
        feeDestinations[_initialOperator] = _initialFeeDestination;
    }

    // @dev Raises errors if the intent is invalid
    // @param _intent The intent to validate
    modifier validIntent(TransferIntent calldata _intent) {
        bytes32 hash = keccak256(
            abi.encodePacked(
                _intent.recipientAmount,
                _intent.deadline,
                _intent.recipient,
                _intent.recipientCurrency,
                _intent.refundDestination,
                _intent.feeAmount,
                _intent.id,
                _intent.operator,
                block.chainid,
                _msgSender(),
                address(this)
            )
        );

        bytes32 signedMessageHash;
        if (_intent.prefix.length == 0) {
            // Use 'default' message prefix.
            signedMessageHash = ECDSA.toEthSignedMessageHash(hash);
        } else {
            // Use custom message prefix.
            signedMessageHash = keccak256(abi.encodePacked(_intent.prefix, hash));
        }

        address signer = ECDSA.recover(signedMessageHash, _intent.signature);

        if (signer != _intent.operator) {
            revert InvalidSignature();
        }

        if (_intent.deadline < block.timestamp) {
            revert ExpiredIntent();
        }

        if (_intent.recipient == address(0)) {
            revert NullRecipient();
        }

        if (processedTransferIntents[_intent.operator][_intent.id]) {
            revert AlreadyProcessed();
        }

        _;
    }

    // @dev Raises an error if the operator in the transfer intent is not registered.
    // @param _intent The intent to validate
    modifier operatorIsRegistered(TransferIntent calldata _intent) {
        if (feeDestinations[_intent.operator] == address(0)) revert OperatorNotRegistered();

        _;
    }

    modifier exactValueSent(TransferIntent calldata _intent) {
        // Make sure the correct value was sent
        uint256 neededAmount = _intent.recipientAmount + _intent.feeAmount;
        if (msg.value > neededAmount) {
            revert InvalidNativeAmount(int256(msg.value - neededAmount));
        } else if (msg.value < neededAmount) {
            revert InvalidNativeAmount(-int256(neededAmount - msg.value));
        }

        _;
    }

    // @inheritdoc ITransfers
    function transferNative(TransferIntent calldata _intent)
        external
        payable
        override
        nonReentrant
        whenNotPaused
        validIntent(_intent)
        operatorIsRegistered(_intent)
        exactValueSent(_intent)
    {
        // Make sure the recipient wants the native currency
        if (_intent.recipientCurrency != NATIVE_CURRENCY) revert IncorrectCurrency(NATIVE_CURRENCY);

        // Complete the payment
        transferFundsToDestinations(_intent);
        succeedPayment(_intent, msg.value, NATIVE_CURRENCY);
    }

    // @inheritdoc ITransfers
    function transferToken(
        TransferIntent calldata _intent,
        Permit2SignatureTransferData calldata _signatureTransferData
    ) external override nonReentrant whenNotPaused validIntent(_intent) operatorIsRegistered(_intent) {
        // Make sure the recipient wants a token and the payer is sending it
        if (
            _intent.recipientCurrency == NATIVE_CURRENCY ||
            _signatureTransferData.permit.permitted.token != _intent.recipientCurrency
        ) {
            revert IncorrectCurrency(_signatureTransferData.permit.permitted.token);
        }

        // Make sure the payer has enough of the payment token
        IERC20 erc20 = IERC20(_intent.recipientCurrency);
        uint256 neededAmount = _intent.recipientAmount + _intent.feeAmount;
        uint256 payerBalance = erc20.balanceOf(_msgSender());
        if (payerBalance < neededAmount) {
            revert InsufficientBalance(neededAmount - payerBalance);
        }

        // Make sure the payer is transferring the right amount to this contract
        if (
            _signatureTransferData.transferDetails.to != address(this) ||
            _signatureTransferData.transferDetails.requestedAmount != neededAmount
        ) {
            revert InvalidTransferDetails();
        }

        // Transfer the payment token to this contract
        permit2.permitTransferFrom(
            _signatureTransferData.permit,
            _signatureTransferData.transferDetails,
            _msgSender(),
            _signatureTransferData.signature
        );

        // Complete the payment
        transferFundsToDestinations(_intent);
        succeedPayment(_intent, neededAmount, _intent.recipientCurrency);
    }

    // @inheritdoc ITransfers
    function transferTokenPreApproved(TransferIntent calldata _intent)
        external
        override
        nonReentrant
        whenNotPaused
        validIntent(_intent)
        operatorIsRegistered(_intent)
    {
        // Make sure the recipient wants a token
        if (_intent.recipientCurrency == NATIVE_CURRENCY) {
            revert IncorrectCurrency(_intent.recipientCurrency);
        }

        // Make sure the payer has enough of the payment token
        IERC20 erc20 = IERC20(_intent.recipientCurrency);
        uint256 neededAmount = _intent.recipientAmount + _intent.feeAmount;
        uint256 payerBalance = erc20.balanceOf(_msgSender());
        if (payerBalance < neededAmount) {
            revert InsufficientBalance(neededAmount - payerBalance);
        }

        // Make sure the payer has approved this contract for a sufficient transfer
        uint256 allowance = erc20.allowance(_msgSender(), address(this));
        if (allowance < neededAmount) {
            revert InsufficientAllowance(neededAmount - allowance);
        }

        // Transfer the payment token to this contract
        erc20.safeTransferFrom(_msgSender(), address(this), neededAmount);

        // Complete the payment
        transferFundsToDestinations(_intent);
        succeedPayment(_intent, neededAmount, _intent.recipientCurrency);
    }

    // @inheritdoc ITransfers
    // @dev Wraps msg.value into wrapped token and transfers to recipient.
    function wrapAndTransfer(TransferIntent calldata _intent)
        external
        payable
        override
        nonReentrant
        whenNotPaused
        validIntent(_intent)
        operatorIsRegistered(_intent)
        exactValueSent(_intent)
    {
        // Make sure the recipient wants to receive the wrapped native currency
        if (_intent.recipientCurrency != address(wrappedNativeCurrency)) {
            revert IncorrectCurrency(NATIVE_CURRENCY);
        }

        // Wrap the sent native currency
        wrappedNativeCurrency.deposit{value: msg.value}();

        // Complete the payment
        transferFundsToDestinations(_intent);
        succeedPayment(_intent, msg.value, NATIVE_CURRENCY);
    }

    // @inheritdoc ITransfers
    // @dev Requires _msgSender() to have approved this contract to use the wrapped token.
    // @dev Unwraps into native token and transfers native token (e.g. ETH) to _intent.recipient.
    function unwrapAndTransfer(
        TransferIntent calldata _intent,
        Permit2SignatureTransferData calldata _signatureTransferData
    ) external override nonReentrant whenNotPaused validIntent(_intent) operatorIsRegistered(_intent) {
        // Make sure the recipient wants the native currency and that the payer is
        // sending the wrapped native currency
        if (
            _intent.recipientCurrency != NATIVE_CURRENCY ||
            _signatureTransferData.permit.permitted.token != address(wrappedNativeCurrency)
        ) {
            revert IncorrectCurrency(_signatureTransferData.permit.permitted.token);
        }

        // Make sure the payer has enough of the wrapped native currency
        uint256 neededAmount = _intent.recipientAmount + _intent.feeAmount;
        uint256 payerBalance = wrappedNativeCurrency.balanceOf(_msgSender());
        if (payerBalance < neededAmount) {
            revert InsufficientBalance(neededAmount - payerBalance);
        }

        // Make sure the payer is transferring the right amount of the wrapped native currency to the contract
        if (
            _signatureTransferData.transferDetails.to != address(this) ||
            _signatureTransferData.transferDetails.requestedAmount != neededAmount
        ) {
            revert InvalidTransferDetails();
        }

        // Transfer the payer's wrapped native currency to the contract
        permit2.permitTransferFrom(
            _signatureTransferData.permit,
            _signatureTransferData.transferDetails,
            _msgSender(),
            _signatureTransferData.signature
        );

        // Complete the payment
        unwrapAndTransferFundsToDestinations(_intent);
        succeedPayment(_intent, neededAmount, address(wrappedNativeCurrency));
    }

    // @inheritdoc ITransfers
    // @dev Requires _msgSender() to have approved this contract to use the wrapped token.
    // @dev Unwraps into native token and transfers native token (e.g. ETH) to _intent.recipient.
    function unwrapAndTransferPreApproved(TransferIntent calldata _intent)
        external
        override
        nonReentrant
        whenNotPaused
        validIntent(_intent)
        operatorIsRegistered(_intent)
    {
        // Make sure the recipient wants the native currency
        if (_intent.recipientCurrency != NATIVE_CURRENCY) {
            revert IncorrectCurrency(address(wrappedNativeCurrency));
        }

        // Make sure the payer has enough of the wrapped native currency
        uint256 neededAmount = _intent.recipientAmount + _intent.feeAmount;
        uint256 payerBalance = wrappedNativeCurrency.balanceOf(_msgSender());
        if (payerBalance < neededAmount) {
            revert InsufficientBalance(neededAmount - payerBalance);
        }

        // Make sure the payer has approved this contract for a sufficient transfer
        uint256 allowance = wrappedNativeCurrency.allowance(_msgSender(), address(this));
        if (allowance < neededAmount) {
            revert InsufficientAllowance(neededAmount - allowance);
        }

        // Transfer the payer's wrapped native currency to the contract
        wrappedNativeCurrency.safeTransferFrom(_msgSender(), address(this), neededAmount);

        // Complete the payment
        unwrapAndTransferFundsToDestinations(_intent);
        succeedPayment(_intent, neededAmount, address(wrappedNativeCurrency));
    }

    /*------------------------------------------------------------------*\
    | Swap and Transfer
    \*------------------------------------------------------------------*/

    // @inheritdoc ITransfers
    function swapAndTransferUniswapV3Native(TransferIntent calldata _intent, uint24 poolFeesTier)
        external
        payable
        override
        nonReentrant
        whenNotPaused
        validIntent(_intent)
        operatorIsRegistered(_intent)
    {
        // Perform the swap
        uint256 amountSwapped = swapTokens(_intent, address(wrappedNativeCurrency), msg.value, poolFeesTier);

        // Complete the payment
        succeedPayment(_intent, amountSwapped, NATIVE_CURRENCY);
    }

    // @inheritdoc ITransfers
    function swapAndTransferUniswapV3Token(
        TransferIntent calldata _intent,
        Permit2SignatureTransferData calldata _signatureTransferData,
        uint24 poolFeesTier
    ) external override nonReentrant whenNotPaused validIntent(_intent) operatorIsRegistered(_intent) {
        IERC20 tokenIn = IERC20(_signatureTransferData.permit.permitted.token);

        // Make sure a swap is actually required
        if (address(tokenIn) == _intent.recipientCurrency) {
            revert IncorrectCurrency(address(tokenIn));
        }

        // Make sure the transfer is to this contract
        if (_signatureTransferData.transferDetails.to != address(this)) {
            revert InvalidTransferDetails();
        }

        // Transfer the payer's tokens to this contract
        permit2.permitTransferFrom(
            _signatureTransferData.permit,
            _signatureTransferData.transferDetails,
            _msgSender(),
            _signatureTransferData.signature
        );

        // Perform the swap
        uint256 maxWillingToPay = _signatureTransferData.transferDetails.requestedAmount;
        uint256 amountSwapped = swapTokens(_intent, address(tokenIn), maxWillingToPay, poolFeesTier);

        // Complete the payment
        succeedPayment(_intent, amountSwapped, address(tokenIn));
    }

    // @inheritdoc ITransfers
    function swapAndTransferUniswapV3TokenPreApproved(
        TransferIntent calldata _intent,
        address _tokenIn,
        uint256 maxWillingToPay,
        uint24 poolFeesTier
    ) external override nonReentrant whenNotPaused validIntent(_intent) operatorIsRegistered(_intent) {
        IERC20 tokenIn = IERC20(_tokenIn);

        // Make sure a swap is actually required
        if (address(tokenIn) == _intent.recipientCurrency) {
            revert IncorrectCurrency(address(tokenIn));
        }

        // Make sure the payer has enough of the payment token
        uint256 payerBalance = tokenIn.balanceOf(_msgSender());
        if (payerBalance < maxWillingToPay) {
            revert InsufficientBalance(maxWillingToPay - payerBalance);
        }

        // Make sure the payer has approved this contract for a sufficient transfer
        uint256 allowance = tokenIn.allowance(_msgSender(), address(this));
        if (allowance < maxWillingToPay) {
            revert InsufficientAllowance(maxWillingToPay - allowance);
        }

        // Transfer the payment token to this contract
        tokenIn.safeTransferFrom(_msgSender(), address(this), maxWillingToPay);

        // Perform the swap
        uint256 amountSwapped = swapTokens(_intent, address(tokenIn), maxWillingToPay, poolFeesTier);

        // Complete the payment
        succeedPayment(_intent, amountSwapped, address(tokenIn));
    }

    function swapTokens(
        TransferIntent calldata _intent,
        address tokenIn,
        uint256 maxAmountWillingToPay,
        uint24 poolFeesTier
    ) internal returns (uint256) {
        // If the seller is requesting native currency, we need to swap for the wrapped
        // version of that currency first, then unwrap it and send it to the seller.
        address tokenOut = _intent.recipientCurrency == NATIVE_CURRENCY
            ? address(wrappedNativeCurrency)
            : _intent.recipientCurrency;

        // Figure out the total output needed from the swap
        uint256 neededAmount = _intent.recipientAmount + _intent.feeAmount;

        // Parameters and shared inputs for the universal router
        bytes memory uniswap_commands;
        bytes[] memory uniswap_inputs;
        bytes memory swapPath = abi.encodePacked(tokenOut, poolFeesTier, tokenIn);
        bytes memory swapParams = abi.encode(address(uniswap), neededAmount, maxAmountWillingToPay, swapPath, false);
        bytes memory transferToRecipient = abi.encode(
            _intent.recipientCurrency,
            _intent.recipient,
            _intent.recipientAmount
        );
        bytes memory collectFees = abi.encode(
            _intent.recipientCurrency,
            feeDestinations[_intent.operator],
            _intent.feeAmount
        );

        // The payer's and router's balances before this transaction, used to calculate the amount consumed by the swap
        uint256 payerBalanceBefore;
        uint256 routerBalanceBefore;

        // Populate the commands and inputs for the universal router
        if (msg.value > 0) {
            payerBalanceBefore = _msgSender().balance + msg.value;
            routerBalanceBefore = address(uniswap).balance;

            // Paying with ETH, merchant wants tokenOut
            uniswap_commands = abi.encodePacked(
                bytes1(uint8(UniswapCommands.WRAP_ETH)),
                bytes1(uint8(UniswapCommands.V3_SWAP_EXACT_OUT)),
                bytes1(uint8(UniswapCommands.TRANSFER)),
                bytes1(uint8(UniswapCommands.TRANSFER)),
                bytes1(uint8(UniswapCommands.UNWRAP_WETH)), // for the payer refund
                bytes1(uint8(UniswapCommands.SWEEP))
            );
            uniswap_inputs = new bytes[](6);
            uniswap_inputs[0] = abi.encode(address(uniswap), msg.value);
            uniswap_inputs[1] = swapParams;
            uniswap_inputs[2] = collectFees;
            uniswap_inputs[3] = transferToRecipient;
            uniswap_inputs[4] = abi.encode(address(uniswap), 0);
            uniswap_inputs[5] = abi.encode(UniswapConstants.ETH, _msgSender(), 0);
        } else {
            payerBalanceBefore = IERC20(tokenIn).balanceOf(_msgSender()) + maxAmountWillingToPay;
            routerBalanceBefore = IERC20(tokenIn).balanceOf(address(uniswap));

            if (_intent.recipientCurrency == NATIVE_CURRENCY) {
                // Paying with token, merchant wants ETH
                uniswap_commands = abi.encodePacked(
                    bytes1(uint8(UniswapCommands.V3_SWAP_EXACT_OUT)),
                    bytes1(uint8(UniswapCommands.UNWRAP_WETH)), // for the recipient
                    bytes1(uint8(UniswapCommands.TRANSFER)),
                    bytes1(uint8(UniswapCommands.TRANSFER)),
                    bytes1(uint8(UniswapCommands.SWEEP))
                );
                uniswap_inputs = new bytes[](5);
                uniswap_inputs[0] = swapParams;
                uniswap_inputs[1] = abi.encode(address(uniswap), neededAmount);
                uniswap_inputs[2] = collectFees;
                uniswap_inputs[3] = transferToRecipient;
                uniswap_inputs[4] = abi.encode(tokenIn, _msgSender(), 0);
            } else {
                // Paying with token, merchant wants tokenOut
                uniswap_commands = abi.encodePacked(
                    bytes1(uint8(UniswapCommands.V3_SWAP_EXACT_OUT)),
                    bytes1(uint8(UniswapCommands.TRANSFER)),
                    bytes1(uint8(UniswapCommands.TRANSFER)),
                    bytes1(uint8(UniswapCommands.SWEEP))
                );
                uniswap_inputs = new bytes[](4);
                uniswap_inputs[0] = swapParams;
                uniswap_inputs[1] = collectFees;
                uniswap_inputs[2] = transferToRecipient;
                uniswap_inputs[3] = abi.encode(tokenIn, _msgSender(), 0);
            }

            // Send the input tokens to Uniswap for the swap
            IERC20(tokenIn).safeTransfer(address(uniswap), maxAmountWillingToPay);
        }

        // Perform the swap
        try uniswap.execute{value: msg.value}(uniswap_commands, uniswap_inputs, _intent.deadline) {
            // Calculate and return how much of the input token was consumed by the swap. The router
            // could have had a balance of the input token prior to this transaction, which would have
            // been swept to the payer. This amount, if any, must be accounted for so we don't underflow
            // and assume that negative amount of the input token was consumed by the swap.
            uint256 payerBalanceAfter;
            uint256 routerBalanceAfter;
            if (msg.value > 0) {
                payerBalanceAfter = _msgSender().balance;
                routerBalanceAfter = address(uniswap).balance;
            } else {
                payerBalanceAfter = IERC20(tokenIn).balanceOf(_msgSender());
                routerBalanceAfter = IERC20(tokenIn).balanceOf(address(uniswap));
            }
            return (payerBalanceBefore + routerBalanceBefore) - (payerBalanceAfter + routerBalanceAfter);
        } catch Error(string memory reason) {
            revert SwapFailedString(reason);
        } catch (bytes memory reason) {
            bytes32 reasonHash = keccak256(reason);
            if (reasonHash == V3_INVALID_SWAP) {
                revert SwapFailedString("V3InvalidSwap");
            } else if (reasonHash == keccak256(hex"39d35496")) {
                revert SwapFailedString("V3TooLittleReceived");
            } else if (reasonHash == keccak256(hex"739dbe52")) {
                revert SwapFailedString("V3TooMuchRequested");
            } else if (reasonHash == keccak256(hex"d4e0248e")) {
                revert SwapFailedString("V3InvalidAmountOut");
            } else if (reasonHash == keccak256(hex"32b13d91")) {
                revert SwapFailedString("V3InvalidCaller");
            } else {
                revert SwapFailedBytes(reason);
            }
        }
    }

    function transferFundsToDestinations(TransferIntent calldata _intent) internal {
        if (_intent.recipientCurrency == NATIVE_CURRENCY) {
            sendNative(_intent.recipient, _intent.recipientAmount, false);
            sendNative(feeDestinations[_intent.operator], _intent.feeAmount, false);
        } else {
            IERC20 requestedCurrency = IERC20(_intent.recipientCurrency);
            requestedCurrency.safeTransfer(_intent.recipient, _intent.recipientAmount);
            requestedCurrency.safeTransfer(feeDestinations[_intent.operator], _intent.feeAmount);
        }
    }

    function unwrapAndTransferFundsToDestinations(TransferIntent calldata _intent) internal {
        if (_intent.recipientCurrency == NATIVE_CURRENCY) {
            wrappedNativeCurrency.withdraw(_intent.recipientAmount + _intent.feeAmount);
        }
        transferFundsToDestinations(_intent);
    }

    function succeedPayment(
        TransferIntent calldata _intent,
        uint256 spentAmount,
        address spentCurrency
    ) internal {
        processedTransferIntents[_intent.operator][_intent.id] = true;
        emit Transferred(_intent.operator, _intent.id, _intent.recipient, _msgSender(), spentAmount, spentCurrency);
    }

    function sendNative(
        address destination,
        uint256 amount,
        bool isRefund
    ) internal {
        (bool success, bytes memory data) = payable(destination).call{value: amount}("");
        if (!success) {
            revert NativeTransferFailed(destination, amount, isRefund, data);
        }
    }

    // @notice Registers an operator with a custom fee destination.
    function registerOperatorWithFeeDestination(address _feeDestination) public {
        feeDestinations[_msgSender()] = _feeDestination;

        emit OperatorRegistered(_msgSender(), _feeDestination);
    }

    // @notice Registers an operator, using the operator's address as the fee destination.
    function registerOperator() public {
        feeDestinations[_msgSender()] = _msgSender();

        emit OperatorRegistered(_msgSender(), feeDestinations[_msgSender()]);
    }

    function unregisterOperator() public {
        delete feeDestinations[_msgSender()];

        emit OperatorUnregistered(_msgSender());
    }

    // @notice Allows the owner to pause the contract.
    function pause() public onlyOwner {
        _pause();
    }

    // @notice Allows the owner to un-pause the contract.
    function unpause() public onlyOwner {
        _unpause();
    }

    // @dev Required as Uniswap can transfer native tokens to our contract.
    receive() external payable {}
}

File 39 of 40 : Sweepable.sol
// SPDX-License-Identifier: UNLICENSED
pragma solidity ^0.8.17;

import "@openzeppelin/contracts/utils/Context.sol";
import "@openzeppelin/contracts/access/Ownable.sol";
import "@openzeppelin/contracts/token/ERC20/IERC20.sol";
import "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol";

// @title Sweepable contract
// @notice Implements a role that can sweep stuck funds to an address provided
//   at the time of the call
abstract contract Sweepable is Context, Ownable {
    using SafeERC20 for IERC20;

    // @dev The address of the current sweeper
    address private _sweeper;

    // @dev Restricts the caller to the current sweeper
    modifier onlySweeper() {
        require(sweeper() == _msgSender(), "Sweepable: not the sweeper");
        _;
    }

    // @dev Returns the current sweeper
    function sweeper() public view virtual returns (address) {
        return _sweeper;
    }

    // @dev Sets the sweeper
    // @notice To remove the sweeper role entirely, set this to the zero address.
    function setSweeper(address newSweeper) public virtual onlyOwner {
        _sweeper = newSweeper;
    }

    // @dev Sweeps the entire ETH balance to `destination`
    function sweepETH(address payable destination) public virtual onlySweeper {
        uint256 balance = address(this).balance;
        require(balance > 0, "Sweepable: zero balance");
        (bool success, ) = destination.call{value: balance}("");
        require(success, "Sweepable: transfer error");
    }

    // @dev Sweeps a specific ETH `amount` to `destination`
    function sweepETHAmount(address payable destination, uint256 amount) public virtual onlySweeper {
        uint256 balance = address(this).balance;
        require(balance >= amount, "Sweepable: insufficient balance");
        (bool success, ) = destination.call{value: amount}("");
        require(success, "Sweepable: transfer error");
    }

    // @dev Sweeps the entire token balance to `destination`
    function sweepToken(address _token, address destination) public virtual onlySweeper {
        IERC20 token = IERC20(_token);
        uint256 balance = token.balanceOf(address(this));
        require(balance > 0, "Sweepable: zero balance");
        token.safeTransfer(destination, balance);
    }

    // @dev Sweeps a specific token `amount` to `destination`
    function sweepTokenAmount(
        address _token,
        address destination,
        uint256 amount
    ) public virtual onlySweeper {
        IERC20 token = IERC20(_token);
        uint256 balance = token.balanceOf(address(this));
        require(balance >= amount, "Sweepable: insufficient balance");
        token.safeTransfer(destination, amount);
    }
}

File 40 of 40 : ERC20.sol
// SPDX-License-Identifier: AGPL-3.0-only
pragma solidity >=0.8.0;

/// @notice Modern and gas efficient ERC20 + EIP-2612 implementation.
/// @author Solmate (https://github.com/transmissions11/solmate/blob/main/src/tokens/ERC20.sol)
/// @author Modified from Uniswap (https://github.com/Uniswap/uniswap-v2-core/blob/master/contracts/UniswapV2ERC20.sol)
/// @dev Do not manually set balances without updating totalSupply, as the sum of all user balances must not exceed it.
abstract contract ERC20 {
    /*//////////////////////////////////////////////////////////////
                                 EVENTS
    //////////////////////////////////////////////////////////////*/

    event Transfer(address indexed from, address indexed to, uint256 amount);

    event Approval(address indexed owner, address indexed spender, uint256 amount);

    /*//////////////////////////////////////////////////////////////
                            METADATA STORAGE
    //////////////////////////////////////////////////////////////*/

    string public name;

    string public symbol;

    uint8 public immutable decimals;

    /*//////////////////////////////////////////////////////////////
                              ERC20 STORAGE
    //////////////////////////////////////////////////////////////*/

    uint256 public totalSupply;

    mapping(address => uint256) public balanceOf;

    mapping(address => mapping(address => uint256)) public allowance;

    /*//////////////////////////////////////////////////////////////
                            EIP-2612 STORAGE
    //////////////////////////////////////////////////////////////*/

    uint256 internal immutable INITIAL_CHAIN_ID;

    bytes32 internal immutable INITIAL_DOMAIN_SEPARATOR;

    mapping(address => uint256) public nonces;

    /*//////////////////////////////////////////////////////////////
                               CONSTRUCTOR
    //////////////////////////////////////////////////////////////*/

    constructor(
        string memory _name,
        string memory _symbol,
        uint8 _decimals
    ) {
        name = _name;
        symbol = _symbol;
        decimals = _decimals;

        INITIAL_CHAIN_ID = block.chainid;
        INITIAL_DOMAIN_SEPARATOR = computeDomainSeparator();
    }

    /*//////////////////////////////////////////////////////////////
                               ERC20 LOGIC
    //////////////////////////////////////////////////////////////*/

    function approve(address spender, uint256 amount) public virtual returns (bool) {
        allowance[msg.sender][spender] = amount;

        emit Approval(msg.sender, spender, amount);

        return true;
    }

    function transfer(address to, uint256 amount) public virtual returns (bool) {
        balanceOf[msg.sender] -= amount;

        // Cannot overflow because the sum of all user
        // balances can't exceed the max uint256 value.
        unchecked {
            balanceOf[to] += amount;
        }

        emit Transfer(msg.sender, to, amount);

        return true;
    }

    function transferFrom(
        address from,
        address to,
        uint256 amount
    ) public virtual returns (bool) {
        uint256 allowed = allowance[from][msg.sender]; // Saves gas for limited approvals.

        if (allowed != type(uint256).max) allowance[from][msg.sender] = allowed - amount;

        balanceOf[from] -= amount;

        // Cannot overflow because the sum of all user
        // balances can't exceed the max uint256 value.
        unchecked {
            balanceOf[to] += amount;
        }

        emit Transfer(from, to, amount);

        return true;
    }

    /*//////////////////////////////////////////////////////////////
                             EIP-2612 LOGIC
    //////////////////////////////////////////////////////////////*/

    function permit(
        address owner,
        address spender,
        uint256 value,
        uint256 deadline,
        uint8 v,
        bytes32 r,
        bytes32 s
    ) public virtual {
        require(deadline >= block.timestamp, "PERMIT_DEADLINE_EXPIRED");

        // Unchecked because the only math done is incrementing
        // the owner's nonce which cannot realistically overflow.
        unchecked {
            address recoveredAddress = ecrecover(
                keccak256(
                    abi.encodePacked(
                        "\x19\x01",
                        DOMAIN_SEPARATOR(),
                        keccak256(
                            abi.encode(
                                keccak256(
                                    "Permit(address owner,address spender,uint256 value,uint256 nonce,uint256 deadline)"
                                ),
                                owner,
                                spender,
                                value,
                                nonces[owner]++,
                                deadline
                            )
                        )
                    )
                ),
                v,
                r,
                s
            );

            require(recoveredAddress != address(0) && recoveredAddress == owner, "INVALID_SIGNER");

            allowance[recoveredAddress][spender] = value;
        }

        emit Approval(owner, spender, value);
    }

    function DOMAIN_SEPARATOR() public view virtual returns (bytes32) {
        return block.chainid == INITIAL_CHAIN_ID ? INITIAL_DOMAIN_SEPARATOR : computeDomainSeparator();
    }

    function computeDomainSeparator() internal view virtual returns (bytes32) {
        return
            keccak256(
                abi.encode(
                    keccak256("EIP712Domain(string name,string version,uint256 chainId,address verifyingContract)"),
                    keccak256(bytes(name)),
                    keccak256("1"),
                    block.chainid,
                    address(this)
                )
            );
    }

    /*//////////////////////////////////////////////////////////////
                        INTERNAL MINT/BURN LOGIC
    //////////////////////////////////////////////////////////////*/

    function _mint(address to, uint256 amount) internal virtual {
        totalSupply += amount;

        // Cannot overflow because the sum of all user
        // balances can't exceed the max uint256 value.
        unchecked {
            balanceOf[to] += amount;
        }

        emit Transfer(address(0), to, amount);
    }

    function _burn(address from, uint256 amount) internal virtual {
        balanceOf[from] -= amount;

        // Cannot underflow because a user's balance
        // will never be larger than the total supply.
        unchecked {
            totalSupply -= amount;
        }

        emit Transfer(from, address(0), amount);
    }
}

Settings
{
  "evmVersion": "london",
  "libraries": {},
  "metadata": {
    "bytecodeHash": "ipfs",
    "useLiteralContent": true
  },
  "optimizer": {
    "enabled": true,
    "runs": 100000
  },
  "remappings": [],
  "viaIR": true,
  "outputSelection": {
    "*": {
      "*": [
        "evm.bytecode",
        "evm.deployedBytecode",
        "devdoc",
        "userdoc",
        "metadata",
        "abi"
      ]
    }
  }
}

Contract Security Audit

Contract ABI

[{"inputs":[{"internalType":"contract IUniversalRouter","name":"_uniswap","type":"address"},{"internalType":"contract Permit2","name":"_permit2","type":"address"},{"internalType":"address","name":"_initialOperator","type":"address"},{"internalType":"address","name":"_initialFeeDestination","type":"address"},{"internalType":"contract IWrappedNativeCurrency","name":"_wrappedNativeCurrency","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"inputs":[],"name":"AlreadyProcessed","type":"error"},{"inputs":[],"name":"ExpiredIntent","type":"error"},{"inputs":[{"internalType":"address","name":"attemptedCurrency","type":"address"}],"name":"IncorrectCurrency","type":"error"},{"inputs":[{"internalType":"uint256","name":"difference","type":"uint256"}],"name":"InsufficientAllowance","type":"error"},{"inputs":[{"internalType":"uint256","name":"difference","type":"uint256"}],"name":"InsufficientBalance","type":"error"},{"inputs":[{"internalType":"int256","name":"difference","type":"int256"}],"name":"InvalidNativeAmount","type":"error"},{"inputs":[],"name":"InvalidSignature","type":"error"},{"inputs":[],"name":"InvalidTransferDetails","type":"error"},{"inputs":[{"internalType":"address","name":"recipient","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"bool","name":"isRefund","type":"bool"},{"internalType":"bytes","name":"data","type":"bytes"}],"name":"NativeTransferFailed","type":"error"},{"inputs":[],"name":"NullRecipient","type":"error"},{"inputs":[],"name":"OperatorNotRegistered","type":"error"},{"inputs":[{"internalType":"bytes","name":"reason","type":"bytes"}],"name":"SwapFailedBytes","type":"error"},{"inputs":[{"internalType":"string","name":"reason","type":"string"}],"name":"SwapFailedString","type":"error"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"operator","type":"address"},{"indexed":false,"internalType":"address","name":"feeDestination","type":"address"}],"name":"OperatorRegistered","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"operator","type":"address"}],"name":"OperatorUnregistered","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":"account","type":"address"}],"name":"Paused","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"operator","type":"address"},{"indexed":false,"internalType":"bytes16","name":"id","type":"bytes16"},{"indexed":false,"internalType":"address","name":"recipient","type":"address"},{"indexed":false,"internalType":"address","name":"sender","type":"address"},{"indexed":false,"internalType":"uint256","name":"spentAmount","type":"uint256"},{"indexed":false,"internalType":"address","name":"spentCurrency","type":"address"}],"name":"Transferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"account","type":"address"}],"name":"Unpaused","type":"event"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"pause","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"paused","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"permit2","outputs":[{"internalType":"contract Permit2","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"registerOperator","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_feeDestination","type":"address"}],"name":"registerOperatorWithFeeDestination","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newSweeper","type":"address"}],"name":"setSweeper","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"components":[{"internalType":"uint256","name":"recipientAmount","type":"uint256"},{"internalType":"uint256","name":"deadline","type":"uint256"},{"internalType":"address payable","name":"recipient","type":"address"},{"internalType":"address","name":"recipientCurrency","type":"address"},{"internalType":"address","name":"refundDestination","type":"address"},{"internalType":"uint256","name":"feeAmount","type":"uint256"},{"internalType":"bytes16","name":"id","type":"bytes16"},{"internalType":"address","name":"operator","type":"address"},{"internalType":"bytes","name":"signature","type":"bytes"},{"internalType":"bytes","name":"prefix","type":"bytes"}],"internalType":"struct TransferIntent","name":"_intent","type":"tuple"},{"internalType":"uint24","name":"poolFeesTier","type":"uint24"}],"name":"swapAndTransferUniswapV3Native","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"components":[{"internalType":"uint256","name":"recipientAmount","type":"uint256"},{"internalType":"uint256","name":"deadline","type":"uint256"},{"internalType":"address payable","name":"recipient","type":"address"},{"internalType":"address","name":"recipientCurrency","type":"address"},{"internalType":"address","name":"refundDestination","type":"address"},{"internalType":"uint256","name":"feeAmount","type":"uint256"},{"internalType":"bytes16","name":"id","type":"bytes16"},{"internalType":"address","name":"operator","type":"address"},{"internalType":"bytes","name":"signature","type":"bytes"},{"internalType":"bytes","name":"prefix","type":"bytes"}],"internalType":"struct TransferIntent","name":"_intent","type":"tuple"},{"components":[{"components":[{"components":[{"internalType":"address","name":"token","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"internalType":"struct ISignatureTransfer.TokenPermissions","name":"permitted","type":"tuple"},{"internalType":"uint256","name":"nonce","type":"uint256"},{"internalType":"uint256","name":"deadline","type":"uint256"}],"internalType":"struct ISignatureTransfer.PermitTransferFrom","name":"permit","type":"tuple"},{"components":[{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"requestedAmount","type":"uint256"}],"internalType":"struct ISignatureTransfer.SignatureTransferDetails","name":"transferDetails","type":"tuple"},{"internalType":"bytes","name":"signature","type":"bytes"}],"internalType":"struct Permit2SignatureTransferData","name":"_signatureTransferData","type":"tuple"},{"internalType":"uint24","name":"poolFeesTier","type":"uint24"}],"name":"swapAndTransferUniswapV3Token","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"components":[{"internalType":"uint256","name":"recipientAmount","type":"uint256"},{"internalType":"uint256","name":"deadline","type":"uint256"},{"internalType":"address payable","name":"recipient","type":"address"},{"internalType":"address","name":"recipientCurrency","type":"address"},{"internalType":"address","name":"refundDestination","type":"address"},{"internalType":"uint256","name":"feeAmount","type":"uint256"},{"internalType":"bytes16","name":"id","type":"bytes16"},{"internalType":"address","name":"operator","type":"address"},{"internalType":"bytes","name":"signature","type":"bytes"},{"internalType":"bytes","name":"prefix","type":"bytes"}],"internalType":"struct TransferIntent","name":"_intent","type":"tuple"},{"internalType":"address","name":"_tokenIn","type":"address"},{"internalType":"uint256","name":"maxWillingToPay","type":"uint256"},{"internalType":"uint24","name":"poolFeesTier","type":"uint24"}],"name":"swapAndTransferUniswapV3TokenPreApproved","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address payable","name":"destination","type":"address"}],"name":"sweepETH","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address payable","name":"destination","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"sweepETHAmount","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_token","type":"address"},{"internalType":"address","name":"destination","type":"address"}],"name":"sweepToken","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_token","type":"address"},{"internalType":"address","name":"destination","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"sweepTokenAmount","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"sweeper","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"components":[{"internalType":"uint256","name":"recipientAmount","type":"uint256"},{"internalType":"uint256","name":"deadline","type":"uint256"},{"internalType":"address payable","name":"recipient","type":"address"},{"internalType":"address","name":"recipientCurrency","type":"address"},{"internalType":"address","name":"refundDestination","type":"address"},{"internalType":"uint256","name":"feeAmount","type":"uint256"},{"internalType":"bytes16","name":"id","type":"bytes16"},{"internalType":"address","name":"operator","type":"address"},{"internalType":"bytes","name":"signature","type":"bytes"},{"internalType":"bytes","name":"prefix","type":"bytes"}],"internalType":"struct TransferIntent","name":"_intent","type":"tuple"}],"name":"transferNative","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"components":[{"internalType":"uint256","name":"recipientAmount","type":"uint256"},{"internalType":"uint256","name":"deadline","type":"uint256"},{"internalType":"address payable","name":"recipient","type":"address"},{"internalType":"address","name":"recipientCurrency","type":"address"},{"internalType":"address","name":"refundDestination","type":"address"},{"internalType":"uint256","name":"feeAmount","type":"uint256"},{"internalType":"bytes16","name":"id","type":"bytes16"},{"internalType":"address","name":"operator","type":"address"},{"internalType":"bytes","name":"signature","type":"bytes"},{"internalType":"bytes","name":"prefix","type":"bytes"}],"internalType":"struct TransferIntent","name":"_intent","type":"tuple"},{"components":[{"components":[{"components":[{"internalType":"address","name":"token","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"internalType":"struct ISignatureTransfer.TokenPermissions","name":"permitted","type":"tuple"},{"internalType":"uint256","name":"nonce","type":"uint256"},{"internalType":"uint256","name":"deadline","type":"uint256"}],"internalType":"struct ISignatureTransfer.PermitTransferFrom","name":"permit","type":"tuple"},{"components":[{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"requestedAmount","type":"uint256"}],"internalType":"struct ISignatureTransfer.SignatureTransferDetails","name":"transferDetails","type":"tuple"},{"internalType":"bytes","name":"signature","type":"bytes"}],"internalType":"struct Permit2SignatureTransferData","name":"_signatureTransferData","type":"tuple"}],"name":"transferToken","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"components":[{"internalType":"uint256","name":"recipientAmount","type":"uint256"},{"internalType":"uint256","name":"deadline","type":"uint256"},{"internalType":"address payable","name":"recipient","type":"address"},{"internalType":"address","name":"recipientCurrency","type":"address"},{"internalType":"address","name":"refundDestination","type":"address"},{"internalType":"uint256","name":"feeAmount","type":"uint256"},{"internalType":"bytes16","name":"id","type":"bytes16"},{"internalType":"address","name":"operator","type":"address"},{"internalType":"bytes","name":"signature","type":"bytes"},{"internalType":"bytes","name":"prefix","type":"bytes"}],"internalType":"struct TransferIntent","name":"_intent","type":"tuple"}],"name":"transferTokenPreApproved","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"unpause","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"unregisterOperator","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"components":[{"internalType":"uint256","name":"recipientAmount","type":"uint256"},{"internalType":"uint256","name":"deadline","type":"uint256"},{"internalType":"address payable","name":"recipient","type":"address"},{"internalType":"address","name":"recipientCurrency","type":"address"},{"internalType":"address","name":"refundDestination","type":"address"},{"internalType":"uint256","name":"feeAmount","type":"uint256"},{"internalType":"bytes16","name":"id","type":"bytes16"},{"internalType":"address","name":"operator","type":"address"},{"internalType":"bytes","name":"signature","type":"bytes"},{"internalType":"bytes","name":"prefix","type":"bytes"}],"internalType":"struct TransferIntent","name":"_intent","type":"tuple"},{"components":[{"components":[{"components":[{"internalType":"address","name":"token","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"internalType":"struct ISignatureTransfer.TokenPermissions","name":"permitted","type":"tuple"},{"internalType":"uint256","name":"nonce","type":"uint256"},{"internalType":"uint256","name":"deadline","type":"uint256"}],"internalType":"struct ISignatureTransfer.PermitTransferFrom","name":"permit","type":"tuple"},{"components":[{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"requestedAmount","type":"uint256"}],"internalType":"struct ISignatureTransfer.SignatureTransferDetails","name":"transferDetails","type":"tuple"},{"internalType":"bytes","name":"signature","type":"bytes"}],"internalType":"struct Permit2SignatureTransferData","name":"_signatureTransferData","type":"tuple"}],"name":"unwrapAndTransfer","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"components":[{"internalType":"uint256","name":"recipientAmount","type":"uint256"},{"internalType":"uint256","name":"deadline","type":"uint256"},{"internalType":"address payable","name":"recipient","type":"address"},{"internalType":"address","name":"recipientCurrency","type":"address"},{"internalType":"address","name":"refundDestination","type":"address"},{"internalType":"uint256","name":"feeAmount","type":"uint256"},{"internalType":"bytes16","name":"id","type":"bytes16"},{"internalType":"address","name":"operator","type":"address"},{"internalType":"bytes","name":"signature","type":"bytes"},{"internalType":"bytes","name":"prefix","type":"bytes"}],"internalType":"struct TransferIntent","name":"_intent","type":"tuple"}],"name":"unwrapAndTransferPreApproved","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"components":[{"internalType":"uint256","name":"recipientAmount","type":"uint256"},{"internalType":"uint256","name":"deadline","type":"uint256"},{"internalType":"address payable","name":"recipient","type":"address"},{"internalType":"address","name":"recipientCurrency","type":"address"},{"internalType":"address","name":"refundDestination","type":"address"},{"internalType":"uint256","name":"feeAmount","type":"uint256"},{"internalType":"bytes16","name":"id","type":"bytes16"},{"internalType":"address","name":"operator","type":"address"},{"internalType":"bytes","name":"signature","type":"bytes"},{"internalType":"bytes","name":"prefix","type":"bytes"}],"internalType":"struct TransferIntent","name":"_intent","type":"tuple"}],"name":"wrapAndTransfer","outputs":[],"stateMutability":"payable","type":"function"},{"stateMutability":"payable","type":"receive"}]

610100346200021657601f620056b438819003918201601f19168301916001600160401b038311848410176200021b5780849260a09460405283398101031262000216578051906001600160a01b0380831683036200021657602082015181811681036200021657620000756040840162000231565b906080620000866060860162000231565b940151838116810362000216576040928491600093845498865199338682167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e08980a36001600160a81b0319163360ff60a01b191617865560018055608086905260a05260c05260e05216815260036020522080546001600160a01b0319169190921617905561546d908162000247823960805181818161040e01528181610e4d0152818161195e01528181611d160152818161222e01528181612766015281816127d901528181612e5601528181613d3101528181614a4501528181614f720152615057015260a051818181613e560152818161401001528181614141015281816142050152818161429e0152818161437d01528181614749015281816147ff015281816149d901528181614b9c0152614c84015260c05181818161137001528181611de0015281816122e50152612b66015260e051818181610e81015281816110080152818161193101528181611d5201528181611f24015281816126e801528181613d78015261508a0152f35b600080fd5b634e487b7160e01b600052604160045260246000fd5b51906001600160a01b0382168203620002165756fe6080604052600436101561001b575b361561001957600080fd5b005b60e060008035821c6304e0fc368114612bfa5780631163b2b014612b8a57806312261ee714612b1b57806323d4c2ba14612a99578063258836fe146129a95780632acde0981461290b5780633f4ba83a1461281757806347a8c9641461246a5780635c975abb146124275780636614eb7114611fe9578063715018a614611f4c57806380747a8314611ab75780638456cb5914611a0e57806386489553146119895780638bf122da146117b65780638da5cb5b146117655780639189a59e14611713578063a54180af14611616578063a876b89a14611588578063b8d8e489146114c0578063ccba8aac1461106a578063e536814714610bdc578063f2fda4ae146106e0578063f2fde38b146105a65763fc8f31e01461013c57505061000e565b61014536613001565b906001546002141561015690613184565b6002600155610163613447565b81359160209283820135936040830161017b816131e9565b91606085019761018a896131e9565b92610197608088016131e9565b60a08801359560c08901936101ab8561320a565b908a01966101b8886131e9565b928d8b6040519586958d8c8801998a973097339746976102799b9a9894999590918b9792989398885260208801527fffffffffffffffffffffffffffffffffffffffff000000000000000000000000809a81988280978160609d8e1b1660408401528c1b169060540152891b1660688c0152607c8b01527fffffffffffffffffffffffffffffffff0000000000000000000000000000000016609c8a0152851b1660ac88015260c0870152821b1660e08501521b1660f48201526101080190565b037fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0810182526102a990826132ce565b519020986101208801996102bd8b8a61330f565b9050156000149a6102f8916103009c61056d576102da91506137d3565b6102f26102eb6101008c018c61330f565b369161339a565b906136d9565b9a909a6134b4565b73ffffffffffffffffffffffffffffffffffffffff998a80610321886131e9565b1691160361054357421161051a5761033989916131e9565b16156104f05787610349846131e9565b168752600482527fffffffffffffffffffffffffffffffff0000000000000000000000000000000061037e604089209261320a565b168752815260ff6040872054166104c6578661039b6003936131e9565b16865252846040852054161561049c576103b4916133d1565b938434116000146103f95760246103cb863461340d565b604051907fb06a5d510000000000000000000000000000000000000000000000000000000082526004820152fd5b84803410610487575061040b906131e9565b907f000000000000000000000000000000000000000000000000000000000000000091848316948591160361045657908161044861044f93614f4a565b3490615120565b6001805580f35b602484604051907f6453b66b0000000000000000000000000000000000000000000000000000000082526004820152fd5b6103cb610497602492349061340d565b61341a565b60046040517f25ec6c1f000000000000000000000000000000000000000000000000000000008152fd5b60046040517f57eee766000000000000000000000000000000000000000000000000000000008152fd5b60046040517fdf99255c000000000000000000000000000000000000000000000000000000008152fd5b60046040517e80add4000000000000000000000000000000000000000000000000000000008152fd5b60046040517f8baa579f000000000000000000000000000000000000000000000000000000008152fd5b61059e61057c6040938d61330f565b84919451938185928c84019788378201908b82015203898101845201826132ce565b5190206102da565b50346106dd5760207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126106dd576105de613052565b6105e6613105565b73ffffffffffffffffffffffffffffffffffffffff80911690811561065957600054827fffffffffffffffffffffffff0000000000000000000000000000000000000000821617600055167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0600080a380f35b60846040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201527f64647265737300000000000000000000000000000000000000000000000000006064820152fd5b80fd5b50346106dd577ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc906080823601126106dd576004359167ffffffffffffffff8311610bd8576101409083360301126106dd5761073a613075565b6044359262ffffff6064351660643503610ae75761075d60026001541415613184565b600260015561076a613447565b6108f3610779604483016131e9565b926064830193836108eb61078c876131e9565b6108b161079b608485016131e9565b916108856107ab60c4870161320a565b9160e48701976107ba896131e9565b956040519687958a6004019e8f93309633964696602460a4860135950135903560208d019a9894999590918b9792989398885260208801527fffffffffffffffffffffffffffffffffffffffff000000000000000000000000809a81988280978160609d8e1b1660408401528c1b169060540152891b1660688c0152607c8b01527fffffffffffffffffffffffffffffffff0000000000000000000000000000000016609c8a0152851b1660ac88015260c0870152821b1660e08501521b1660f48201526101080190565b037fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe081018352826132ce565b602081519101206101248301906108c8828961330f565b15159050610b9c576108da91506137d3565b6102f26102eb61010485018961330f565b9490946134b4565b73ffffffffffffffffffffffffffffffffffffffff938480610914856131e9565b16911603610543574260248201351061051a5783610934604483016131e9565b16156104f05783610944836131e9565b16875260046020527fffffffffffffffffffffffffffffffff0000000000000000000000000000000061097d60c460408a20930161320a565b16875260205260ff6040872054166104c65761099983916131e9565b1685526003602052816040862054161561049c57816109b99116936131e9565b168214610b6b576040517f70a08231000000000000000000000000000000000000000000000000000000008152336004820152602081602481865afa908115610af4578491610b39575b50848110610aff57506040517fdd62ed3e000000000000000000000000000000000000000000000000000000008152336004820152306024820152602081604481865afa908115610af4578491610abd575b50848110610a835750610a7d84610a7261044f95963033876138d6565b606435908484613d03565b90615120565b610a8f6024918661340d565b604051907ff96fb0710000000000000000000000000000000000000000000000000000000082526004820152fd5b90506020813d602011610aec575b81610ad8602093836132ce565b81010312610ae7575185610a55565b600080fd5b3d9150610acb565b6040513d86823e3d90fd5b610b0b6024918661340d565b604051907f926653510000000000000000000000000000000000000000000000000000000082526004820152fd5b90506020813d602011610b63575b81610b54602093836132ce565b81010312610ae7575185610a03565b3d9150610b47565b602482604051907f6453b66b0000000000000000000000000000000000000000000000000000000082526004820152fd5b610bd0610bab6040938a61330f565b84919451938185926020840197883782019060208201520360208101845201826132ce565b5190206108da565b5080fd5b50346106dd57610beb36613001565b9160015460021415610bfc90613184565b6002600155610c09613447565b8235602091829182860135916040870190610c23826131e9565b906060890192610c32846131e9565b95610c3f60808c016131e9565b968b8960a0820135998a9360c0840197610c588961320a565b9401988b610c658b6131e9565b60408051968701928352602083018a9052606093841b7fffffffffffffffffffffffffffffffffffffffff0000000000000000000000009081169184019190915293831b8416605483015293821b83166068820152607c8101969096527fffffffffffffffffffffffffffffffff00000000000000000000000000000000909416609c86015290831b811660ac8501524660c085015233831b811660e08501523090921b90911660f4830152806101088301037fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe081018252610d4790826132ce565b5190208b6101208101610d5a818361330f565b905015600014610d949b610d8c946102f2936102eb9361102f5750610d7f91506137d3565b925b61010081019061330f565b9890986134b4565b73ffffffffffffffffffffffffffffffffffffffff978880610db5876131e9565b1691160361054357421161051a57610dcd87916131e9565b16156104f05785610ddd836131e9565b168852600487527fffffffffffffffffffffffffffffffff00000000000000000000000000000000610e1260408a209261320a565b168852865260ff6040882054166104c657610e2d85916131e9565b16865260038552836040872054161561049c57610e49906131e9565b83807f000000000000000000000000000000000000000000000000000000000000000016911603610fdc5790610e7e916133d1565b907f000000000000000000000000000000000000000000000000000000000000000016916040517f70a082310000000000000000000000000000000000000000000000000000000081523360048201528181602481875afa908115610f98578591610faf575b50828110610fa357506040517fdd62ed3e0000000000000000000000000000000000000000000000000000000081523360048201523060248201528181604481875afa918215610f98578592610f6a575b5050818110610f5e575061044f9293610f50823033866138d6565b610f5981615031565b615120565b610a8f9060249261340d565b90809250813d8311610f91575b610f8181836132ce565b81010312610ae757513880610f35565b503d610f77565b6040513d87823e3d90fd5b610b0b6024918461340d565b90508181813d8311610fd5575b610fc681836132ce565b81010312610ae7575138610ee4565b503d610fbc565b602483604051907f6453b66b0000000000000000000000000000000000000000000000000000000082527f0000000000000000000000000000000000000000000000000000000000000000166004820152fd5b604061103e611061928861330f565b8295919551948186928484019889378201908382015203908101845201826132ce565b51902092610d81565b509034610bd8577ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc6060813601126114325767ffffffffffffffff80600435116114bc5761014082600435360301126114bc576024351161143257602435360301126106dd5760443562ffffff81168103610ae7576110ee60026001541415613184565b60026001556110fb613447565b6111096044600435016131e9565b61126461125c60646004350192611214611122856131e9565b916108856111346084600435016131e9565b9161114360c46004350161320a565b9261115260e4600435016131e9565b6040805160048035908101356020830152602481013592820192909252606094851b7fffffffffffffffffffffffffffffffffffffffff0000000000000000000000009081168683015298851b8916607482015292841b8816608884015260a40135609c8301527fffffffffffffffffffffffffffffffff0000000000000000000000000000000090941660bc82015292811b851660cc8401524660e084015233811b851661010084015230901b909316610114820152918290610128820190565b6020815191012061012460043501906112328260043560040161330f565b151590506114a05761124491506137d3565b6102f26102eb6101046004350160043560040161330f565b9190916134b4565b73ffffffffffffffffffffffffffffffffffffffff90818061128a60e4600435016131e9565b169116036105435742602460043501351061051a57806112ae6044600435016131e9565b16156104f057806112c360e4600435016131e9565b1684526004602052604084207fffffffffffffffffffffffffffffffff000000000000000000000000000000006112fe60c46004350161320a565b16855260205260ff6040852054166104c6578061131f60e4600435016131e9565b1684526003602052806040852054161561049c576024356004018161134e81611347846131e9565b16946131e9565b16831461146f576084602435013083611366836131e9565b16036114455785927f000000000000000000000000000000000000000000000000000000000000000016916113a060c4602435018261330f565b939091813b15611441578580946113e8604051978896879586947f30f28b7a000000000000000000000000000000000000000000000000000000008652339160048701613843565b03925af180156114365761141e575b505061141361044f9260a4602435013583600435600401613d03565b600435600401615120565b61142790613237565b6114325782386113f7565b8280fd5b6040513d84823e3d90fd5b8580fd5b60046040517fed5c6561000000000000000000000000000000000000000000000000000000008152fd5b602483604051907f6453b66b0000000000000000000000000000000000000000000000000000000082526004820152fd5b6114b4610bab60409360043560040161330f565b519020611244565b8380fd5b50346106dd5760207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126106dd577fa453db612af59e5521d6ab9284dc3e2d06af286eb1b1b7b771fce4716c19f2c161158261151c613052565b3380855260036020908152604080872080547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff959095169485179055805192835290820192909252918291820190565b0390a180f35b50346106dd57807ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126106dd573381526003602052604081207fffffffffffffffffffffffff000000000000000000000000000000000000000081541690557f6f42117a557500c705ddf040a619d86f39101e6b74ac20d7b3e5943ba473fc7f6020604051338152a180f35b50346106dd5760607ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126106dd5761164e613052565b611656613075565b906044359073ffffffffffffffffffffffffffffffffffffffff90611680826002541633146152a3565b1691604051927f70a08231000000000000000000000000000000000000000000000000000000008452306004850152602084602481845afa938415610f985785946116de575b506116d6836116db9510156153d2565b614eeb565b80f35b93506020843d821161170b575b816116f8602093836132ce565b81010312610ae7579251926116d66116c6565b3d91506116eb565b50346106dd57807ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126106dd57602073ffffffffffffffffffffffffffffffffffffffff60025416604051908152f35b50346106dd57807ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126106dd5773ffffffffffffffffffffffffffffffffffffffff6020915416604051908152f35b507ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc604081360112610bd85767ffffffffffffffff60043511610bd85761014090600435360301126106dd5762ffffff6024351660243503610ae75761182160026001541415613184565b600260015561182e613447565b61185361125c6118426044600435016131e9565b6112146111226064600435016131e9565b73ffffffffffffffffffffffffffffffffffffffff90818061187960e4600435016131e9565b169116036105435742602460043501351061051a578061189d6044600435016131e9565b16156104f057806118b260e4600435016131e9565b1682526004602052604082207fffffffffffffffffffffffffffffffff000000000000000000000000000000006118ed60c46004350161320a565b16835260205260ff6040832054166104c6578061190e60e4600435016131e9565b1682526003602052806040832054161561049c5761195c61044f916024359034907f000000000000000000000000000000000000000000000000000000000000000016600435600401613d03565b7f000000000000000000000000000000000000000000000000000000000000000090600435600401615120565b50346106dd5760407ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126106dd576116db818080806119c8613052565b6024359073ffffffffffffffffffffffffffffffffffffffff906119f1826002541633146152a3565b6119fd834710156153d2565b165af1611a08613afb565b5061536d565b50346106dd57807ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126106dd57611a45613105565b611a4d613447565b740100000000000000000000000000000000000000007fffffffffffffffffffffff00ffffffffffffffffffffffffffffffffffffffff8254161781557f62e78cea01bee320cd4e420270b5ea74000d11b0c9f74754ebdbfc544b05a2586020604051338152a180f35b509034610bd857611ac736613098565b60019291925460021415611ada90613184565b6002600155611ae7613447565b8235602092839182860135916040870190611b01826131e9565b906060890192611b10846131e9565b95611b1d60808c016131e9565b968b8960a0820135998a9360c0840197611b368961320a565b9401988b611b438b6131e9565b60408051968701928352602083018a9052606093841b7fffffffffffffffffffffffffffffffffffffffff0000000000000000000000009081169184019190915293831b8416605483015293821b83166068820152607c8101969096527fffffffffffffffffffffffffffffffff00000000000000000000000000000000909416609c86015290831b811660ac8501524660c085015233831b811660e08501523090921b90911660f4830152806101088301037fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe081018252611c2590826132ce565b5190208b6101208101611c38818361330f565b905015600014611c5d9b610d8c946102f2936102eb9361102f5750610d7f91506137d3565b73ffffffffffffffffffffffffffffffffffffffff978880611c7e876131e9565b1691160361054357421161051a57611c9687916131e9565b16156104f05785611ca6836131e9565b168a52600488527fffffffffffffffffffffffffffffffff00000000000000000000000000000000611cdb60408c209261320a565b168a52875260ff60408a2054166104c657611cf685916131e9565b16885260038652836040892054161561049c57611d12906131e9565b83167f0000000000000000000000000000000000000000000000000000000000000000841614801590611f16575b611edb5790611d4e916133d1565b91817f000000000000000000000000000000000000000000000000000000000000000016936040517f70a082310000000000000000000000000000000000000000000000000000000081523360048201528181602481895afa918215611ed0578892611ea2575b5050838110611e965750608081013083611dce836131e9565b1614801590611e88575b6114455786927f00000000000000000000000000000000000000000000000000000000000000001691611e0e60c082018261330f565b939091813b1561144157858094611e56604051978896879586947f30f28b7a000000000000000000000000000000000000000000000000000000008652339160048701613843565b03925af1801561143657611e74575b505082610f5961044f94615031565b611e7d90613237565b6114bc578338611e65565b508360a08301351415611dd8565b610b0b6024918561340d565b90809250813d8311611ec9575b611eb981836132ce565b81010312610ae757513880611db5565b503d611eaf565b6040513d8a823e3d90fd5b602483611ee7866131e9565b6040517f6453b66b00000000000000000000000000000000000000000000000000000000815291166004820152fd5b50611f20846131e9565b83167f000000000000000000000000000000000000000000000000000000000000000084161415611d40565b50346106dd57807ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126106dd57611f83613105565b600073ffffffffffffffffffffffffffffffffffffffff81547fffffffffffffffffffffffff000000000000000000000000000000000000000081168355167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e08280a380f35b509034610bd857611ff936613098565b61200860026001541415613184565b6002600155612015613447565b612161612024604084016131e9565b93612159606085019561211f612039886131e9565b61088561204860808a016131e9565b61205460c08b0161320a565b92612060888c016131e9565b604080518d356020808301919091528e013591810191909152606097881b7fffffffffffffffffffffffffffffffffffffffff0000000000000000000000009081168983015292881b8316607482015292871b8216608884015260a08c0135609c8401527fffffffffffffffffffffffffffffffff0000000000000000000000000000000090941660bc83015292851b831660cc8201524660e082015233851b83166101008201523090941b9091166101148401528290610128820190565b60208151910120610120860190612136828861330f565b151590506124105761214891506137d3565b6102f26102eb61010088018861330f565b9290926134b4565b73ffffffffffffffffffffffffffffffffffffffff9182806121848488016131e9565b16911603610543574260208501351061051a57816121a4604086016131e9565b16156104f057816121b68286016131e9565b1686526004602052604086207fffffffffffffffffffffffffffffffff000000000000000000000000000000006121ef60c0870161320a565b16875260205260ff6040872054166104c65761220d829185016131e9565b1685526003602052806040862054161561049c5761222a846131e9565b81167f000000000000000000000000000000000000000000000000000000000000000082161480156123f1575b6123e65780612265856131e9565b16916024602061227a60a087013587356133d1565b94604051928380927f70a082310000000000000000000000000000000000000000000000000000000082523360048301525afa9081156123db5787916123a9575b50838110611e9657506080810130836122d3836131e9565b161480159061239b575b6114455786927f0000000000000000000000000000000000000000000000000000000000000000169161231360c082018261330f565b939091813b156114415785809461235b604051978896879586947f30f28b7a000000000000000000000000000000000000000000000000000000008652339160048701613843565b03925af1801561143657612387575b505061238161044f9361237c84614f4a565b6131e9565b91615120565b61239090613237565b6114bc57833861236a565b508360a083013514156122dd565b90506020813d6020116123d3575b816123c4602093836132ce565b81010312610ae75751386122bb565b3d91506123b7565b6040513d89823e3d90fd5b611ee76024926131e9565b506123fb826131e9565b8180612406876131e9565b1691161415612257565b61241f610bab6040938961330f565b519020612148565b50346106dd57807ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126106dd5760ff6020915460a01c166040519015158152f35b5061247436613001565b6001546002141561248490613184565b6002600155612491613447565b80356020908183013591604084016124a8816131e9565b9160608601976124b7896131e9565b926124c4608089016131e9565b60a08901359560c08a01936124d88561320a565b908b01966124e5886131e9565b604080518981018d8152602081018f9052606096871b7fffffffffffffffffffffffffffffffffffffffff0000000000000000000000009081169382019390935293861b8216605485015295851b81166068840152607c83018b90527fffffffffffffffffffffffffffffffff00000000000000000000000000000000909316609c830152831b821660ac8201524660c082015233831b821660e08201523090921b1660f482015290806101088301037fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0810182526125c490826132ce565b519020968861012081016125d8818361330f565b90501560001499610d8c926126079b61280057506125f691506137d3565b6102f26102eb6101008d018d61330f565b73ffffffffffffffffffffffffffffffffffffffff978880612628886131e9565b1691160361054357421161051a5761264087916131e9565b16156104f05785612650846131e9565b168852600482527fffffffffffffffffffffffffffffffff0000000000000000000000000000000061268560408a209261320a565b168852815260ff6040882054166104c657846126a26003936131e9565b16875252826040862054161561049c576126bb916133d1565b938434116000146126d25760246103cb863461340d565b8480341061048757506126e582916131e9565b817f00000000000000000000000000000000000000000000000000000000000000001692839116036127ad575082813b156106dd57600491604051928380927fd0e30db000000000000000000000000000000000000000000000000000000000825234905af180156127a25761278d575b508061276461044f92614f4a565b7f0000000000000000000000000000000000000000000000000000000000000000903490615120565b9161279b61044f9293613237565b9190612756565b6040513d85823e3d90fd5b602490604051907f6453b66b0000000000000000000000000000000000000000000000000000000082527f0000000000000000000000000000000000000000000000000000000000000000166004820152fd5b61057c60409361280f9261330f565b5190206125f6565b50346106dd57807ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126106dd5761284e613105565b805460ff8160a01c16156128ad577fffffffffffffffffffffff00ffffffffffffffffffffffffffffffffffffffff1681557f5db9ee0a495bf2e6ff9c91a7834c1ba4fdd244a5e8aa4e537bd38aeae4b073aa6020604051338152a180f35b60646040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601460248201527f5061757361626c653a206e6f74207061757365640000000000000000000000006044820152fd5b50346106dd57807ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126106dd573380825260036020908152604080842080547fffffffffffffffffffffffff000000000000000000000000000000000000000016841790558051838152918201929092527fa453db612af59e5521d6ab9284dc3e2d06af286eb1b1b7b771fce4716c19f2c19181908101611582565b50346106dd5760407ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126106dd576129e1613052565b6129e9613075565b9073ffffffffffffffffffffffffffffffffffffffff90612a0f826002541633146152a3565b16604051917f70a08231000000000000000000000000000000000000000000000000000000008352306004840152602083602481855afa918215610af4578492612a64575b6116db93506116d6831515615308565b91506020833d8211612a91575b81612a7e602093836132ce565b810103126114bc576116db925191612a54565b3d9150612a71565b50346106dd5760207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126106dd5773ffffffffffffffffffffffffffffffffffffffff612ae6613052565b612aee613105565b167fffffffffffffffffffffffff0000000000000000000000000000000000000000600254161760025580f35b50346106dd57807ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126106dd57602060405173ffffffffffffffffffffffffffffffffffffffff7f0000000000000000000000000000000000000000000000000000000000000000168152f35b50346106dd5760207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126106dd576116db81808080612bc9613052565b73ffffffffffffffffffffffffffffffffffffffff612bed816002541633146152a3565b47916119fd831515615308565b50346106dd57612c0936613001565b60015460021415612c1990613184565b6002600155612c26613447565b80356020908183013594604084019584612c3f886131e9565b926060820198612c4e8a6131e9565b94612c5b608085016131e9565b908860a0860135978892888b60c08a0198612c758a61320a565b9a0199612c818b6131e9565b6040805197880193845260208401949094527fffffffffffffffffffffffffffffffffffffffff000000000000000000000000606095861b81169484019490945294841b8316605483015296831b82166068820152607c8101959095527fffffffffffffffffffffffffffffffff00000000000000000000000000000000909516609c85015290811b841660ac8401524660c084015233811b841660e084015230901b90921660f482015290806101088301037fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe081018252612d6390826132ce565b51902093886101208101612d77818361330f565b90501560001496612d9592612d9d98612fd057506125f691506137d3565b9590956134b4565b73ffffffffffffffffffffffffffffffffffffffff948580612dbe876131e9565b1691160361054357421161051a57612dd684916131e9565b16156104f05782612de6836131e9565b168852600486527fffffffffffffffffffffffffffffffff00000000000000000000000000000000612e1b60408a209261320a565b168852855260ff6040882054166104c657612e3682916131e9565b16865260038452806040872054161561049c57612e52876131e9565b81167f0000000000000000000000000000000000000000000000000000000000000000821614612fc45790612e9191612e8a886131e9565b16926133d1565b916040517f70a082310000000000000000000000000000000000000000000000000000000081523360048201528181602481865afa908115612f8c578691612f97575b50838110611e9657506040517fdd62ed3e0000000000000000000000000000000000000000000000000000000081523360048201523060248201528181604481865afa918215612f8c578692612f5a575b5050828110612f4e575061044f9394612f458361238193309033906138d6565b61237c84614f4a565b610a8f6024918461340d565b90809250813d8311612f85575b612f7181836132ce565b81010312612f8157513880612f25565b8480fd5b503d612f67565b6040513d88823e3d90fd5b90508181813d8311612fbd575b612fae81836132ce565b81010312611441575138612ed4565b503d612fa4565b602490611ee7886131e9565b612fdf60409361280f9261330f565b8d8592955194828693838501988937830191820152038d8101845201826132ce565b7ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc90602082820112610ae7576004359167ffffffffffffffff8311610ae7578261014092030112610ae75760040190565b6004359073ffffffffffffffffffffffffffffffffffffffff82168203610ae757565b6024359073ffffffffffffffffffffffffffffffffffffffff82168203610ae757565b907ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc91604083820112610ae75767ffffffffffffffff90600435828111610ae757610140858284030112610ae75760040193602435928311610ae7578260e092030112610ae75760040190565b73ffffffffffffffffffffffffffffffffffffffff60005416330361312657565b60646040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602060248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152fd5b1561318b57565b60646040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c006044820152fd5b3573ffffffffffffffffffffffffffffffffffffffff81168103610ae75790565b357fffffffffffffffffffffffffffffffff0000000000000000000000000000000081168103610ae75790565b67ffffffffffffffff811161324b57604052565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6060810190811067ffffffffffffffff82111761324b57604052565b6040810190811067ffffffffffffffff82111761324b57604052565b6080810190811067ffffffffffffffff82111761324b57604052565b90601f7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0910116810190811067ffffffffffffffff82111761324b57604052565b9035907fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe181360301821215610ae7570180359067ffffffffffffffff8211610ae757602001918136038313610ae757565b67ffffffffffffffff811161324b57601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe01660200190565b9291926133a682613360565b916133b460405193846132ce565b829481845281830111610ae7578281602093846000960137010152565b919082018092116133de57565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b919082039182116133de57565b7f800000000000000000000000000000000000000000000000000000000000000081146133de5760000390565b60ff60005460a01c1661345657565b60646040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601060248201527f5061757361626c653a20706175736564000000000000000000000000000000006044820152fd5b60058110156136aa57806134c55750565b6001810361352b5760646040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601860248201527f45434453413a20696e76616c6964207369676e617475726500000000000000006044820152fd5b600281036135915760646040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601f60248201527f45434453413a20696e76616c6964207369676e6174757265206c656e677468006044820152fd5b6003810361361d5760846040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602260248201527f45434453413a20696e76616c6964207369676e6174757265202773272076616c60448201527f75650000000000000000000000000000000000000000000000000000000000006064820152fd5b60041461362657565b60846040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602260248201527f45434453413a20696e76616c6964207369676e6174757265202776272076616c60448201527f75650000000000000000000000000000000000000000000000000000000000006064820152fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602160045260246000fd5b90604181511460001461370757613703916020820151906060604084015193015160001a90613711565b9091565b5050600090600290565b9291907f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a083116137c75760ff16601b811415806137bc575b6137b0579160809493916020936040519384528484015260408301526060820152600093849182805260015afa156137a357815173ffffffffffffffffffffffffffffffffffffffff81161561379d579190565b50600190565b50604051903d90823e3d90fd5b50505050600090600490565b50601c811415613749565b50505050600090600390565b60405160208101917f19457468657265756d205369676e6564204d6573736167653a0a3332000000008352603c820152603c81526138108161327a565b51902090565b803573ffffffffffffffffffffffffffffffffffffffff8116809103610ae7578252602090810135910152565b9394907fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0936138ab601f94606073ffffffffffffffffffffffffffffffffffffffff946138908a82613816565b604081013560408b0152013560608901526080880190613816565b1660c0850152806101008060e087015285015280610120958686013760008582860101520116010190565b6040517f23b872dd00000000000000000000000000000000000000000000000000000000602082015273ffffffffffffffffffffffffffffffffffffffff9283166024820152929091166044830152606482019290925261396b9161396682608481015b037fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe081018452836132ce565b61396d565b565b73ffffffffffffffffffffffffffffffffffffffff169060405161399081613296565b6020928382527f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c656484830152803b15613a9d57906139e59160008481959282888195519301915af16139df613afb565b90613b89565b8051806139f3575b50505050565b81849181010312610bd857820151908115918215036106dd5750613a19578080806139ed565b608490604051907f08c379a00000000000000000000000000000000000000000000000000000000082526004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e60448201527f6f742073756363656564000000000000000000000000000000000000000000006064820152fd5b606484604051907f08c379a00000000000000000000000000000000000000000000000000000000082526004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e74726163740000006044820152fd5b3d15613b26573d90613b0c82613360565b91613b1a60405193846132ce565b82523d6000602084013e565b606090565b919082519283825260005b848110613b755750507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0601f8460006020809697860101520116010190565b602081830181015184830182015201613b36565b90919015613b95575090565b815115613ba55750805190602001fd5b613be3906040519182917f08c379a0000000000000000000000000000000000000000000000000000000008352602060048401526024830190613b2b565b0390fd5b805115613bf45760200190565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b805160011015613bf45760400190565b805160021015613bf45760600190565b805160031015613bf45760800190565b805160041015613bf45760a00190565b805160051015613bf45760c00190565b600060443d10613cef576040517ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc91823d016004833e815167ffffffffffffffff918282113d602484011117613cf257818401948551938411613cfa573d85010160208487010111613cf25750613cef929101602001906132ce565b90565b949350505050565b50949350505050565b90939291600094600093613d19606085016131e9565b73ffffffffffffffffffffffffffffffffffffffff807f000000000000000000000000000000000000000000000000000000000000000016911614600014614ed457613e98613ecd73ffffffffffffffffffffffffffffffffffffffff7f0000000000000000000000000000000000000000000000000000000000000000165b7fffffff0000000000000000000000000000000000000000000000000000000000613dc960a089013589356133d1565b947fffffffffffffffffffffffffffffffffffffffff0000000000000000000000006040519360601b16602084015260e81b1660348201527fffffffffffffffffffffffffffffffffffffffff0000000000000000000000008560601b166037820152602b8152613e398161327a565b60405192839173ffffffffffffffffffffffffffffffffffffffff7f000000000000000000000000000000000000000000000000000000000000000016602084015285604084015287606084015260a0608084015260c0830190613b2b565b600060a08301527fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe082820301825203826132ce565b613ed9606086016131e9565b9173ffffffffffffffffffffffffffffffffffffffff613efb604088016131e9565b81604051951660208601521660408401528535606084015260608352613f20836132b2565b613f2c606087016131e9565b9473ffffffffffffffffffffffffffffffffffffffff613f4e60e089016131e9565b166000526003602052613fe573ffffffffffffffffffffffffffffffffffffffff60406000205416613fb960405198899260a08c0135916020850160409194939294606082019573ffffffffffffffffffffffffffffffffffffffff80921683521660208201520152565b037fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe081018852876132ce565b3415614930575050613ff83433316133d1565b9473ffffffffffffffffffffffffffffffffffffffff7f00000000000000000000000000000000000000000000000000000000000000001631946040517f0b0000000000000000000000000000000000000000000000000000000000000060208201527f010000000000000000000000000000000000000000000000000000000000000060218201527f050000000000000000000000000000000000000000000000000000000000000080602283015260238201527f0c0000000000000000000000000000000000000000000000000000000000000060248201527f040000000000000000000000000000000000000000000000000000000000000060258201526006815261410681613296565b93604051918260e081011067ffffffffffffffff60e08501111761324b5760e083016040526006835260005b60c0811061491f5750604080517f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff1660208201523491810191909152929461428593869392919061419b8160608101610885565b6141a485613be7565b526141ae84613be7565b506141b884613c23565b526141c283613c23565b506141cc83613c33565b526141d682613c33565b506141e082613c43565b526141ea81613c43565b5060405173ffffffffffffffffffffffffffffffffffffffff7f0000000000000000000000000000000000000000000000000000000000000000166020820152600060408201526040815261423e8161327a565b61424782613c53565b5261425181613c53565b50604051600060208201523360408201526000606082015260608152614276816132b2565b61427f82613c63565b52613c63565b505b73ffffffffffffffffffffffffffffffffffffffff7f0000000000000000000000000000000000000000000000000000000000000000163b15610ae7579091614304926040519384927f3593564c000000000000000000000000000000000000000000000000000000008452606060048501526064840190613b2b565b7ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc838203016024840152815180825260208201916020808360051b8301019401926000915b8383106148ce575050505050819060206000940135604483015203813473ffffffffffffffffffffffffffffffffffffffff7f0000000000000000000000000000000000000000000000000000000000000000165af190816148ba575b50614716575050506001908060033d11614706575b6308c379a0146146b2575b506143cd57565b6143d5613afb565b805160208201207f865c3ff234d3d0edd202666a7ee80e1df8991d5f3d0735c47363eaf02da248f681036144615760646040517f8a627c1600000000000000000000000000000000000000000000000000000000815260206004820152600d60248201527f5633496e76616c696453776170000000000000000000000000000000000000006044820152fd5b7f7949afa5f7d1aca4443eae437acb1046b7439815697e5489cca05d226a192b1381036144e65760646040517f8a627c1600000000000000000000000000000000000000000000000000000000815260206004820152601360248201527f5633546f6f4c6974746c655265636569766564000000000000000000000000006044820152fd5b7f6c00b934adb0b7404a228838c719adfbb4e9deac0b09dc9249e888189cb51f6a810361456b5760646040517f8a627c1600000000000000000000000000000000000000000000000000000000815260206004820152601260248201527f5633546f6f4d75636852657175657374656400000000000000000000000000006044820152fd5b7f483c13bc9b4251bad271f371298893f2995abed398de6edf3108289714194b8981036145f05760646040517f8a627c1600000000000000000000000000000000000000000000000000000000815260206004820152601260248201527f5633496e76616c6964416d6f756e744f757400000000000000000000000000006044820152fd5b7ff14c0a0eab0cabeb85cee7eed6c1c3d990aa7959546121092a1062bf3a5d7841036146745760646040517f8a627c1600000000000000000000000000000000000000000000000000000000815260206004820152600f60248201527f5633496e76616c696443616c6c657200000000000000000000000000000000006044820152fd5b613be3906040519182917f917827e1000000000000000000000000000000000000000000000000000000008352602060048401526024830190613b2b565b6146ba613c73565b90816146c657506143c6565b613be39250506040519182917f8a627c16000000000000000000000000000000000000000000000000000000008352602060048401526024830190613b2b565b50600481803e805160e01c6143bb565b93945090929091341561477c575050614776613cef9261477033319373ffffffffffffffffffffffffffffffffffffffff7f00000000000000000000000000000000000000000000000000000000000000001631926133d1565b926133d1565b9061340d565b6040517f70a0823100000000000000000000000000000000000000000000000000000000808252336004830152939273ffffffffffffffffffffffffffffffffffffffff1690602081602481855afa80156127a2578390614887575b6020915094602460405180948193825273ffffffffffffffffffffffffffffffffffffffff7f00000000000000000000000000000000000000000000000000000000000000001660048301525afa91821561487b5791614845575b50613cef9361477692614770916133d1565b9390506020843d602011614873575b81614861602093836132ce565b81010312610ae7579251614770614833565b3d9150614854565b604051903d90823e3d90fd5b506020813d6020116148b2575b816148a1602093836132ce565b81010312610ae757602090516147d8565b3d9150614894565b6148c5919550613237565b600093386143a6565b9193969550919360208061490c837fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe086600196030187528a51613b2b565b9801930193019092879596949293614349565b806060602080938701015201614132565b6040969196959395517f70a0823100000000000000000000000000000000000000000000000000000000815233600482015260208160248173ffffffffffffffffffffffffffffffffffffffff8a165afa8015614e92578290600090614e9e575b61499b92506133d1565b966040517f70a0823100000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff7f000000000000000000000000000000000000000000000000000000000000000016600482015260208160248173ffffffffffffffffffffffffffffffffffffffff8b165afa908115614e9257600091614e60575b509673ffffffffffffffffffffffffffffffffffffffff7f00000000000000000000000000000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff614a86606087016131e9565b1603614cd6576040517f010000000000000000000000000000000000000000000000000000000000000060208201527f0c0000000000000000000000000000000000000000000000000000000000000060218201527f050000000000000000000000000000000000000000000000000000000000000080602283015260238201527f0400000000000000000000000000000000000000000000000000000000000000602482015260058152614b3a81613296565b95604051928360c081011067ffffffffffffffff60c08601111761324b5760c084016040526005845260005b60a08110614cc55750918391610885614be7614c6b95614cc098979a614b8b87613be7565b52614b9586613be7565b50604080517f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff166020820152908101919091529182906060820190565b614bf084613c23565b52614bfa83613c23565b50614c0483613c33565b52614c0e82613c33565b50614c1882613c43565b52614c2281613c43565b5060405173ffffffffffffffffffffffffffffffffffffffff891660208201523360408201526000606082015260608152614c5c816132b2565b614c6582613c53565b52613c53565b505b73ffffffffffffffffffffffffffffffffffffffff7f00000000000000000000000000000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff8716614eeb565b614287565b806060602080938801015201614b66565b9050604051907f010000000000000000000000000000000000000000000000000000000000000060208301527f050000000000000000000000000000000000000000000000000000000000000080602184015260228301527f040000000000000000000000000000000000000000000000000000000000000060238301526004825281604081011067ffffffffffffffff60408401111761324b5781956040830160e084011067ffffffffffffffff60e08501111761324b5760e083016040526004604084015260005b60808110614e50575082614e4a9260409283614cc097960198614dc4858501613be7565b52614dd0848401613be7565b50614ddc848401613c23565b52614de8838301613c23565b50614df4838301613c33565b52614e00828201613c33565b50815173ffffffffffffffffffffffffffffffffffffffff8a16602082015233838201526000606082015260608152614e38816132b2565b614e43838301613c43565b5201613c43565b50614c6d565b6060848201810152602001614da0565b90506020813d602011614e8a575b81614e7b602093836132ce565b81010312610ae7575138614a2c565b3d9150614e6e565b6040513d6000823e3d90fd5b50506020813d602011614ecc575b81614eb9602093836132ce565b81010312610ae7578161499b9151614991565b3d9150614eac565b613e98613ecd614ee6606087016131e9565b613d99565b6040517fa9059cbb00000000000000000000000000000000000000000000000000000000602082015273ffffffffffffffffffffffffffffffffffffffff9092166024830152604482019290925261396b91613966826064810161393a565b60608101614f57816131e9565b73ffffffffffffffffffffffffffffffffffffffff919082167f0000000000000000000000000000000000000000000000000000000000000000831603614fdf57509060a061396b92614fb9614faf604085016131e9565b8285359116615222565b80614fc660e085016131e9565b1660005260036020526040600020541691013590615222565b9160a082614fef61396b956131e9565b169261500b615000604085016131e9565b828535911686614eeb565b8061501860e085016131e9565b1660005260036020526040600020541691013591614eeb565b61503d606082016131e9565b73ffffffffffffffffffffffffffffffffffffffff9081167f0000000000000000000000000000000000000000000000000000000000000000821614615088575b5061396b90614f4a565b7f000000000000000000000000000000000000000000000000000000000000000016906150ba60a082013582356133d1565b823b15610ae7576000926024849260405195869384927f2e1a7d4d00000000000000000000000000000000000000000000000000000000845260048401525af1918215614e925761396b92615111575b509061507e565b61511a90613237565b3861510a565b9160a0907fb7ee4fafa10d16ee883a136a3dcc9179d8e6041ba71cc29c2b0bce4f7bdd6e869260e085019073ffffffffffffffffffffffffffffffffffffffff9283918261516d856131e9565b16600052600460205282886151fe60406151f76151f160c0836000209501997fffffffffffffffffffffffffffffffff0000000000000000000000000000000095866151b88d61320a565b166000526020528360002060017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff008254161790556131e9565b9861320a565b9b016131e9565b906040519a168a5216602089015233604089015260608801521660808601521692a2565b73ffffffffffffffffffffffffffffffffffffffff16600080808085855af1615249613afb565b901561525457505050565b613be3906040519384937f28688b550000000000000000000000000000000000000000000000000000000085526004850152602484015260006044840152608060648401526084830190613b2b565b156152aa57565b60646040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601a60248201527f537765657061626c653a206e6f742074686520737765657065720000000000006044820152fd5b1561530f57565b60646040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601760248201527f537765657061626c653a207a65726f2062616c616e63650000000000000000006044820152fd5b1561537457565b60646040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601960248201527f537765657061626c653a207472616e73666572206572726f72000000000000006044820152fd5b156153d957565b60646040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601f60248201527f537765657061626c653a20696e73756666696369656e742062616c616e6365006044820152fdfea2646970667358221220349bf76106d7fb486c96a6cf9345f0f14d780276047d54733278c55dd56e1cdc64736f6c63430008110033000000000000000000000000198ef79f1f515f02dfe9e3115ed9fc07183f02fc000000000000000000000000000000000022d473030f116ddee9f6b43ac78ba30000000000000000000000008fccc78dae0a8f93b0fe6799de888d4c57e273db0000000000000000000000006d8675a52438849d90241cb639fba41bdc3329c80000000000000000000000004200000000000000000000000000000000000006

Constructor Arguments (ABI-Encoded and is the last bytes of the Contract Creation Code above)

000000000000000000000000198ef79f1f515f02dfe9e3115ed9fc07183f02fc000000000000000000000000000000000022d473030f116ddee9f6b43ac78ba30000000000000000000000008fccc78dae0a8f93b0fe6799de888d4c57e273db0000000000000000000000006d8675a52438849d90241cb639fba41bdc3329c80000000000000000000000004200000000000000000000000000000000000006

-----Decoded View---------------
Arg [0] : _uniswap (address): 0x198EF79F1F515F02dFE9e3115eD9fC07183f02fC
Arg [1] : _permit2 (address): 0x000000000022D473030F116dDEE9F6B43aC78BA3
Arg [2] : _initialOperator (address): 0x8fcCC78Dae0a8f93B0fE6799de888d4C57e273db
Arg [3] : _initialFeeDestination (address): 0x6D8675A52438849d90241cB639fba41bDC3329c8
Arg [4] : _wrappedNativeCurrency (address): 0x4200000000000000000000000000000000000006

-----Encoded View---------------
5 Constructor Arguments found :
Arg [0] : 000000000000000000000000198ef79f1f515f02dfe9e3115ed9fc07183f02fc
Arg [1] : 000000000000000000000000000000000022d473030f116ddee9f6b43ac78ba3
Arg [2] : 0000000000000000000000008fccc78dae0a8f93b0fe6799de888d4c57e273db
Arg [3] : 0000000000000000000000006d8675a52438849d90241cb639fba41bdc3329c8
Arg [4] : 0000000000000000000000004200000000000000000000000000000000000006


Block Transaction Difficulty Gas Used Reward
Block Uncle Number Difficulty Gas Used Reward
Loading
Make sure to use the "Vote Down" button for any spammy posts, and the "Vote Up" for interesting conversations.