ETH Price: $2,025.19 (-2.41%)
 

Overview

ETH Balance

0 ETH

Eth Value

$0.00

More Info

Private Name Tags

Multichain Info

No addresses found
Transaction Hash
Method
Block
From
To
Set Fee179420592023-08-18 13:46:11923 days ago1692366371IN
0x0fA226e8...2aAD2eBcF
0 ETH0.0017451725.01643168
Add Token With T...179410242023-08-18 10:17:35923 days ago1692353855IN
0x0fA226e8...2aAD2eBcF
0 ETH0.000770616.6881526
Add Token With T...179410222023-08-18 10:17:11923 days ago1692353831IN
0x0fA226e8...2aAD2eBcF
0 ETH0.0007945417.20658572
Add Token With T...179410182023-08-18 10:16:23923 days ago1692353783IN
0x0fA226e8...2aAD2eBcF
0 ETH0.0007650216.57157665

Advanced mode:
Parent Transaction Hash Method Block
From
To
View All Internal Transactions
Loading...
Loading
Loading...
Loading
Cross-Chain Transactions

Block Transaction Difficulty Gas Used Reward
View All Blocks Produced

Validator Index Block Amount
View All Withdrawals

Transaction Hash Block Value Eth2 PubKey Valid
View All Deposits
Loading...
Loading

Contract Source Code Verified (Exact Match)

Contract Name:
TSAggregatorUniswapV2

Compiler Version
v0.8.17+commit.8df45f5f

Optimization Enabled:
Yes with 10000 runs

Other Settings:
default evmVersion
// SPDX-License-Identifier: MIT
pragma solidity 0.8.17;

import { SafeTransferLib } from "../lib/SafeTransferLib.sol";
import { TSAggregator } from "./TSAggregator.sol";
import { IThorchainRouter } from "./interfaces/IThorchainRouter.sol";
import { IUniswapRouterV2 } from "./interfaces/IUniswapRouterV2extended.sol";
import { Owners } from "./Owners.sol";

contract TSAggregatorUniswapV2 is Owners, TSAggregator {
    using SafeTransferLib for address;

    address public weth;
    IUniswapRouterV2 public swapRouter;

    mapping(address => bool) public tokensWithTransferFee;

    event SwapIn(address from, address token, uint256 amount, uint256 out, uint256 fee, address vault, string memo);
    event SwapOut(address to, address token, uint256 amount, uint256 fee);

    constructor(
      address _ttp, address _weth, address _swapRouter
    ) TSAggregator(_ttp) {
        weth = _weth;
        swapRouter = IUniswapRouterV2(_swapRouter);
        _setOwner(msg.sender, true);
    }

    function addTokenWithTransferFee(address token) external isOwner {
        tokensWithTransferFee[token] = true;
    }

    function swapIn(
        address router,
        address vault,
        string calldata memo,
        address token,
        uint amount,
        uint amountOutMin,
        uint deadline
    ) public nonReentrant {
        tokenTransferProxy.transferTokens(token, msg.sender, address(this), amount);
        token.safeApprove(address(swapRouter), 0); // USDT quirk
        token.safeApprove(address(swapRouter), amount);

        address[] memory path = new address[](2);
        path[0] = token;
        path[1] = weth;

        if(tokensWithTransferFee[token]) {
            swapRouter.swapExactTokensForETHSupportingFeeOnTransferTokens(
                amount,
                amountOutMin,
                path,
                address(this),
                deadline
            );
        } else {
            swapRouter.swapExactTokensForETH(
                amount,
                amountOutMin,
                path,
                address(this),
                deadline
            );
        }

        uint256 out = address(this).balance;
        {
            uint256 outMinusFee = skimFee(out);
            IThorchainRouter(router).depositWithExpiry{value: outMinusFee}(
                payable(vault),
                address(0),
                outMinusFee,
                memo,
                deadline
            );
        }
        emit SwapIn(msg.sender, token, amount, out+getFee(out), getFee(out), vault, memo);
    }

    function swapOut(address token, address to, uint256 amountOutMin) public payable nonReentrant {
        uint256 amount = skimFee(msg.value);
        address[] memory path = new address[](2);
        path[0] = weth;
        path[1] = token;

        if(tokensWithTransferFee[token]) {
            swapRouter.swapExactETHForTokensSupportingFeeOnTransferTokens{value: amount}(
                _parseAmountOutMin(amountOutMin),
                path,
                to,
                type(uint).max // deadline
            );
        } else {
            swapRouter.swapExactETHForTokens{value: amount}(
                _parseAmountOutMin(amountOutMin),
                path,
                to,
                type(uint).max // deadline
            );
        }

        emit SwapOut(to, token, msg.value, msg.value-amount);
    }
}

// SPDX-License-Identifier: AGPL-3.0-only
pragma solidity >=0.8.0;

/// @notice Safe ETH and ERC20 transfer library that gracefully handles missing return values.
/// @author Solmate (https://github.com/Rari-Capital/solmate/blob/main/src/utils/SafeTransferLib.sol)
/// @author Modified from Gnosis (https://github.com/gnosis/gp-v2-contracts/blob/main/src/contracts/libraries/GPv2SafeERC20.sol)
/// @dev Use with caution! Some functions in this library knowingly create dirty bits at the destination of the free memory pointer.
library SafeTransferLib {
    /*///////////////////////////////////////////////////////////////
                            ETH OPERATIONS
    //////////////////////////////////////////////////////////////*/

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

        assembly {
            // Transfer the ETH and store if it succeeded or not.
            callStatus := call(gas(), to, amount, 0, 0, 0, 0)
        }

        require(callStatus, "ETH_TRANSFER_FAILED");
    }

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

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

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

            // Write the abi-encoded calldata to memory piece by piece:
            mstore(freeMemoryPointer, 0x23b872dd00000000000000000000000000000000000000000000000000000000) // Begin with the function selector.
            mstore(add(freeMemoryPointer, 4), and(from, 0xffffffffffffffffffffffffffffffffffffffff)) // Mask and append the "from" argument.
            mstore(add(freeMemoryPointer, 36), and(to, 0xffffffffffffffffffffffffffffffffffffffff)) // Mask and append the "to" argument.
            mstore(add(freeMemoryPointer, 68), amount) // Finally append the "amount" argument. No mask as it's a full 32 byte value.

            // Call the token and store if it succeeded or not.
            // We use 100 because the calldata length is 4 + 32 * 3.
            callStatus := call(gas(), token, 0, freeMemoryPointer, 100, 0, 0)
        }

        require(didLastOptionalReturnCallSucceed(callStatus), "TRANSFER_FROM_FAILED");
    }

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

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

            // Write the abi-encoded calldata to memory piece by piece:
            mstore(freeMemoryPointer, 0xa9059cbb00000000000000000000000000000000000000000000000000000000) // Begin with the function selector.
            mstore(add(freeMemoryPointer, 4), and(to, 0xffffffffffffffffffffffffffffffffffffffff)) // Mask and append the "to" argument.
            mstore(add(freeMemoryPointer, 36), amount) // Finally append the "amount" argument. No mask as it's a full 32 byte value.

            // Call the token and store if it succeeded or not.
            // We use 68 because the calldata length is 4 + 32 * 2.
            callStatus := call(gas(), token, 0, freeMemoryPointer, 68, 0, 0)
        }

        require(didLastOptionalReturnCallSucceed(callStatus), "TRANSFER_FAILED");
    }

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

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

            // Write the abi-encoded calldata to memory piece by piece:
            mstore(freeMemoryPointer, 0x095ea7b300000000000000000000000000000000000000000000000000000000) // Begin with the function selector.
            mstore(add(freeMemoryPointer, 4), and(to, 0xffffffffffffffffffffffffffffffffffffffff)) // Mask and append the "to" argument.
            mstore(add(freeMemoryPointer, 36), amount) // Finally append the "amount" argument. No mask as it's a full 32 byte value.

            // Call the token and store if it succeeded or not.
            // We use 68 because the calldata length is 4 + 32 * 2.
            callStatus := call(gas(), token, 0, freeMemoryPointer, 68, 0, 0)
        }

        require(didLastOptionalReturnCallSucceed(callStatus), "APPROVE_FAILED");
    }

    /*///////////////////////////////////////////////////////////////
                         INTERNAL HELPER LOGIC
    //////////////////////////////////////////////////////////////*/

    function didLastOptionalReturnCallSucceed(bool callStatus) private pure returns (bool success) {
        assembly {
            // Get how many bytes the call returned.
            let returnDataSize := returndatasize()

            // If the call reverted:
            if iszero(callStatus) {
                // Copy the revert message into memory.
                returndatacopy(0, 0, returnDataSize)

                // Revert with the same message.
                revert(0, returnDataSize)
            }

            switch returnDataSize
            case 32 {
                // Copy the return data into memory.
                returndatacopy(0, 0, returnDataSize)

                // Set success to whether it returned true.
                success := iszero(iszero(mload(0)))
            }
            case 0 {
                // There was no return data.
                success := 1
            }
            default {
                // It returned some malformed input.
                success := 0
            }
        }
    }
}

// SPDX-License-Identifier: MIT
pragma solidity 0.8.17;

import { SafeTransferLib } from "../lib/SafeTransferLib.sol";
import { ReentrancyGuard } from "../lib/ReentrancyGuard.sol";
import { Owners } from "./Owners.sol";
import { TSAggregatorTokenTransferProxy } from './TSAggregatorTokenTransferProxy.sol';

abstract contract TSAggregator is Owners, ReentrancyGuard {
    using SafeTransferLib for address;

    event FeeSet(uint256 fee, address feeRecipient);

    uint256 public fee;
    address public feeRecipient;
    TSAggregatorTokenTransferProxy public tokenTransferProxy;

    constructor(address _tokenTransferProxy) {
        _setOwner(msg.sender, true);
        tokenTransferProxy = TSAggregatorTokenTransferProxy(_tokenTransferProxy);
    }

    // Needed for the swap router to be able to send back ETH
    receive() external payable {}

    function setFee(uint256 _fee, address _feeRecipient) external isOwner {
        require(_fee <= 1000, "fee can not be more than 10%");
        fee = _fee;
        feeRecipient = _feeRecipient;
        emit FeeSet(_fee, _feeRecipient);
    }

    function skimFee(uint256 amount) internal returns (uint256) {
        uint256 amountFee = getFee(amount);
        if (amountFee > 0) {
            feeRecipient.safeTransferETH(amountFee);
            amount -= amountFee;
        }
        return amount;
    }

    function getFee(uint256 amount) internal view returns (uint256) {
        if (fee != 0 && feeRecipient != address(0)) {
            return (amount * fee) / 10000;
        }
        return 0;
    }

    // Parse amountOutMin treating the last 2 digits as an exponent
    // So 1504 = 150000. This allows for compressed memos on chains
    // with limited space like Bitcoin
    function _parseAmountOutMin(uint256 amount) internal pure returns (uint256) {
      return amount / 100 * (10 ** (amount % 100));
    }
}

// SPDX-License-Identifier: MIT
pragma solidity 0.8.17;

interface IThorchainRouter {
    function depositWithExpiry(
        address payable vault,
        address asset,
        uint amount,
        string memory memo,
        uint expiration
    ) external payable;
}

// SPDX-License-Identifier: MIT
pragma solidity 0.8.17;

interface IUniswapRouterV2 {
    function WETH() external view returns (address);
    function swapExactTokensForETH(
        uint256 amountIn,
        uint256 amountOutMin,
        address[] calldata path,
        address to,
        uint256 deadline
    ) external;
    function swapExactTokensForTokens(
        uint256 amountIn,
        uint256 amountOutMin,
        address[] calldata path,
        address to,
        uint256 deadline
    ) external;
    function swapExactETHForTokens(
        uint amountOutMin,
        address[] calldata path,
        address to, uint deadline
    ) external payable;
    function swapExactTokensForTokensSupportingFeeOnTransferTokens(
        uint amountIn,
        uint amountOutMin,
        address[] calldata path,
        address to,
        uint deadline
    ) external;
    function swapExactETHForTokensSupportingFeeOnTransferTokens(
        uint amountOutMin,
        address[] calldata path,
        address to,
        uint deadline
    ) external payable;
    function swapExactTokensForETHSupportingFeeOnTransferTokens(
        uint amountIn,
        uint amountOutMin,
        address[] calldata path,
        address to,
        uint deadline
    ) external;
}

// SPDX-License-Identifier: MIT
pragma solidity 0.8.17;

abstract contract Owners {
    event OwnerSet(address indexed owner, bool active);

    mapping(address => bool) public owners;

    modifier isOwner() {
        require(owners[msg.sender], "Unauthorized");
        _;
    }

    function _setOwner(address owner, bool active) internal virtual {
      owners[owner] = active;
      emit OwnerSet(owner, active);
    }

    function setOwner(address owner, bool active) external virtual isOwner {
      _setOwner(owner, active);
    }
}

File 7 of 8 : ReentrancyGuard.sol
// SPDX-License-Identifier: AGPL-3.0-only
pragma solidity >=0.8.0;

/// @notice Gas optimized reentrancy protection for smart contracts.
/// @author Solmate (https://github.com/Rari-Capital/solmate/blob/main/src/utils/ReentrancyGuard.sol)
/// @author Modified from OpenZeppelin (https://github.com/OpenZeppelin/openzeppelin-contracts/blob/master/contracts/security/ReentrancyGuard.sol)
abstract contract ReentrancyGuard {
    uint256 private locked = 1;

    modifier nonReentrant() {
        require(locked == 1, "REENTRANCY");

        locked = 2;

        _;

        locked = 1;
    }
}

// SPDX-License-Identifier: MIT
pragma solidity 0.8.17;

import { SafeTransferLib } from "../lib/SafeTransferLib.sol";
import { Owners } from "./Owners.sol";

contract TSAggregatorTokenTransferProxy is Owners {
    using SafeTransferLib for address;

    constructor() {
        _setOwner(msg.sender, true);
    }

    function transferTokens(address token, address from, address to, uint256 amount) external isOwner {
        require(from == tx.origin || _isContract(from), "Invalid from address");
        token.safeTransferFrom(from, to, amount);
    }

    function _isContract(address account) internal view returns (bool) {
        // This method relies on extcodesize, which returns 0 for contracts in
        // construction, since the code is only stored at the end of the
        // constructor execution.
        uint256 size;
        // solhint-disable-next-line no-inline-assembly
        assembly { size := extcodesize(account) }
        return size > 0;
    }
}

Settings
{
  "optimizer": {
    "enabled": true,
    "runs": 10000
  },
  "outputSelection": {
    "*": {
      "*": [
        "evm.bytecode",
        "evm.deployedBytecode",
        "devdoc",
        "userdoc",
        "metadata",
        "abi"
      ]
    }
  },
  "libraries": {}
}

Contract Security Audit

Contract ABI

API
[{"inputs":[{"internalType":"address","name":"_ttp","type":"address"},{"internalType":"address","name":"_weth","type":"address"},{"internalType":"address","name":"_swapRouter","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"fee","type":"uint256"},{"indexed":false,"internalType":"address","name":"feeRecipient","type":"address"}],"name":"FeeSet","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"owner","type":"address"},{"indexed":false,"internalType":"bool","name":"active","type":"bool"}],"name":"OwnerSet","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"from","type":"address"},{"indexed":false,"internalType":"address","name":"token","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"out","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"fee","type":"uint256"},{"indexed":false,"internalType":"address","name":"vault","type":"address"},{"indexed":false,"internalType":"string","name":"memo","type":"string"}],"name":"SwapIn","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"to","type":"address"},{"indexed":false,"internalType":"address","name":"token","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"fee","type":"uint256"}],"name":"SwapOut","type":"event"},{"inputs":[{"internalType":"address","name":"token","type":"address"}],"name":"addTokenWithTransferFee","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"fee","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"feeRecipient","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"owners","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_fee","type":"uint256"},{"internalType":"address","name":"_feeRecipient","type":"address"}],"name":"setFee","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"},{"internalType":"bool","name":"active","type":"bool"}],"name":"setOwner","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"router","type":"address"},{"internalType":"address","name":"vault","type":"address"},{"internalType":"string","name":"memo","type":"string"},{"internalType":"address","name":"token","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"uint256","name":"amountOutMin","type":"uint256"},{"internalType":"uint256","name":"deadline","type":"uint256"}],"name":"swapIn","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"token","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"amountOutMin","type":"uint256"}],"name":"swapOut","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[],"name":"swapRouter","outputs":[{"internalType":"contract IUniswapRouterV2","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"tokenTransferProxy","outputs":[{"internalType":"contract TSAggregatorTokenTransferProxy","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"tokensWithTransferFee","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"weth","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"stateMutability":"payable","type":"receive"}]

6080604052600180553480156200001557600080fd5b506040516200170538038062001705833981016040819052620000389162000111565b826200004633600162000097565b600480546001600160a01b03199081166001600160a01b0393841617909155600580548216858416179055600680549091169183169190911790556200008e33600162000097565b5050506200015b565b6001600160a01b03821660008181526020818152604091829020805460ff191685151590811790915591519182527ff74826f11048fa8ecf33e91132bf280f6582ed97548a84e426b56e98526b9316910160405180910390a25050565b80516001600160a01b03811681146200010c57600080fd5b919050565b6000806000606084860312156200012757600080fd5b6200013284620000f4565b92506200014260208501620000f4565b91506200015260408501620000f4565b90509250925092565b61159a806200016b6000396000f3fe6080604052600436106100cb5760003560e01c8063516c731c11610074578063c31c9c071161004e578063c31c9c071461026d578063ddca3f431461029a578063e4d0c7f0146102be57600080fd5b8063516c731c146101fd57806386702df71461021d578063b4f2e8b81461024d57600080fd5b80633fc8cef3116100a55780633fc8cef31461019057806346904840146101bd57806348c314f4146101ea57600080fd5b8063022914a7146100d75780630eefdbad1461011c57806324e7571b1461016e57600080fd5b366100d257005b600080fd5b3480156100e357600080fd5b506101076100f2366004610fe7565b60006020819052908152604090205460ff1681565b60405190151581526020015b60405180910390f35b34801561012857600080fd5b506004546101499073ffffffffffffffffffffffffffffffffffffffff1681565b60405173ffffffffffffffffffffffffffffffffffffffff9091168152602001610113565b34801561017a57600080fd5b5061018e610189366004610fe7565b6102de565b005b34801561019c57600080fd5b506005546101499073ffffffffffffffffffffffffffffffffffffffff1681565b3480156101c957600080fd5b506003546101499073ffffffffffffffffffffffffffffffffffffffff1681565b61018e6101f8366004611009565b6103ab565b34801561020957600080fd5b5061018e610218366004611045565b6106bb565b34801561022957600080fd5b50610107610238366004610fe7565b60076020526000908152604090205460ff1681565b34801561025957600080fd5b5061018e610268366004611081565b610742565b34801561027957600080fd5b506006546101499073ffffffffffffffffffffffffffffffffffffffff1681565b3480156102a657600080fd5b506102b060025481565b604051908152602001610113565b3480156102ca57600080fd5b5061018e6102d93660046110ad565b6108ad565b3360009081526020819052604090205460ff1661035c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600c60248201527f556e617574686f72697a6564000000000000000000000000000000000000000060448201526064015b60405180910390fd5b73ffffffffffffffffffffffffffffffffffffffff16600090815260076020526040902080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00166001179055565b600154600114610417576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600a60248201527f5245454e5452414e4359000000000000000000000000000000000000000000006044820152606401610353565b6002600155600061042734610cd6565b60408051600280825260608201835292935060009290916020830190803683375050600554825192935073ffffffffffffffffffffffffffffffffffffffff169183915060009061047a5761047a61116c565b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff168152505084816001815181106104c8576104c861116c565b73ffffffffffffffffffffffffffffffffffffffff92831660209182029290920181019190915290861660009081526007909152604090205460ff16156105aa5760065473ffffffffffffffffffffffffffffffffffffffff1663b6f9de958361053186610d21565b84887fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6040518663ffffffff1660e01b815260040161057394939291906111ec565b6000604051808303818588803b15801561058c57600080fd5b505af11580156105a0573d6000803e3d6000fd5b5050505050610647565b60065473ffffffffffffffffffffffffffffffffffffffff16637ff36ab5836105d286610d21565b84887fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6040518663ffffffff1660e01b815260040161061494939291906111ec565b6000604051808303818588803b15801561062d57600080fd5b505af1158015610641573d6000803e3d6000fd5b50505050505b7f61fad1e4996f793deb2a6b2d07c7fe999e0ce4a95e1ca4662fd430f1c5244019848634610675868261125d565b6040805173ffffffffffffffffffffffffffffffffffffffff958616815294909316602085015291830152606082015260800160405180910390a1505060018055505050565b3360009081526020819052604090205460ff16610734576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600c60248201527f556e617574686f72697a656400000000000000000000000000000000000000006044820152606401610353565b61073e8282610d54565b5050565b3360009081526020819052604090205460ff166107bb576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600c60248201527f556e617574686f72697a656400000000000000000000000000000000000000006044820152606401610353565b6103e8821115610827576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601c60248201527f6665652063616e206e6f74206265206d6f7265207468616e20313025000000006044820152606401610353565b6002829055600380547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff83169081179091556040805184815260208101929092527fc8242dc5446855370b781abbfc5d882af1d1a3cc29143216aba3558feb0ce925910160405180910390a15050565b600154600114610919576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600a60248201527f5245454e5452414e4359000000000000000000000000000000000000000000006044820152606401610353565b6002600155600480546040517f68155ec100000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff87811693820193909352336024820152306044820152606481018690529116906368155ec190608401600060405180830381600087803b1580156109a057600080fd5b505af11580156109b4573d6000803e3d6000fd5b50506006546109e0925073ffffffffffffffffffffffffffffffffffffffff8781169250166000610ddc565b600654610a079073ffffffffffffffffffffffffffffffffffffffff868116911685610ddc565b6040805160028082526060820183526000926020830190803683370190505090508481600081518110610a3c57610a3c61116c565b73ffffffffffffffffffffffffffffffffffffffff9283166020918202929092010152600554825191169082906001908110610a7a57610a7a61116c565b73ffffffffffffffffffffffffffffffffffffffff92831660209182029290920181019190915290861660009081526007909152604090205460ff1615610b50576006546040517f791ac94700000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff9091169063791ac94790610b199087908790869030908990600401611270565b600060405180830381600087803b158015610b3357600080fd5b505af1158015610b47573d6000803e3d6000fd5b50505050610be1565b6006546040517f18cbafe500000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff909116906318cbafe590610bae9087908790869030908990600401611270565b600060405180830381600087803b158015610bc857600080fd5b505af1158015610bdc573d6000803e3d6000fd5b505050505b476000610bed82610cd6565b90508a73ffffffffffffffffffffffffffffffffffffffff166344bc937b828c6000858e8e8b6040518863ffffffff1660e01b8152600401610c3496959493929190611302565b6000604051808303818588803b158015610c4d57600080fd5b505af1158015610c61573d6000803e3d6000fd5b5050505050507fd0905d621f104066424412dcaf4dd7189ca00660fc08a026e5927026b8afa82c338787610c9485610ea9565b610c9e9086611355565b610ca786610ea9565b8e8e8e604051610cbe989796959493929190611368565b60405180910390a15050600180555050505050505050565b600080610ce283610ea9565b90508015610d1a57600354610d0d9073ffffffffffffffffffffffffffffffffffffffff1682610efd565b610d17818461125d565b92505b5090919050565b6000610d2e6064836113f9565b610d3990600a61152d565b610d44606484611539565b610d4e919061154d565b92915050565b73ffffffffffffffffffffffffffffffffffffffff82166000818152602081815260409182902080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff001685151590811790915591519182527ff74826f11048fa8ecf33e91132bf280f6582ed97548a84e426b56e98526b9316910160405180910390a25050565b60006040517f095ea7b300000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff841660048201528260248201526000806044836000895af1915050610e3d81610f77565b610ea3576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600e60248201527f415050524f56455f4641494c45440000000000000000000000000000000000006044820152606401610353565b50505050565b6000600254600014158015610ed5575060035473ffffffffffffffffffffffffffffffffffffffff1615155b15610ef55761271060025483610eeb919061154d565b610d4e9190611539565b506000919050565b600080600080600085875af1905080610f72576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601360248201527f4554485f5452414e534645525f4641494c4544000000000000000000000000006044820152606401610353565b505050565b60003d82610f8957806000803e806000fd5b8060208114610fa1578015610fb25760009250610fb7565b816000803e60005115159250610fb7565b600192505b5050919050565b803573ffffffffffffffffffffffffffffffffffffffff81168114610fe257600080fd5b919050565b600060208284031215610ff957600080fd5b61100282610fbe565b9392505050565b60008060006060848603121561101e57600080fd5b61102784610fbe565b925061103560208501610fbe565b9150604084013590509250925092565b6000806040838503121561105857600080fd5b61106183610fbe565b91506020830135801515811461107657600080fd5b809150509250929050565b6000806040838503121561109457600080fd5b823591506110a460208401610fbe565b90509250929050565b60008060008060008060008060e0898b0312156110c957600080fd5b6110d289610fbe565b97506110e060208a01610fbe565b9650604089013567ffffffffffffffff808211156110fd57600080fd5b818b0191508b601f83011261111157600080fd5b81358181111561112057600080fd5b8c602082850101111561113257600080fd5b60208301985080975050505061114a60608a01610fbe565b979a96995094979396956080850135955060a08501359460c001359350915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b600081518084526020808501945080840160005b838110156111e157815173ffffffffffffffffffffffffffffffffffffffff16875295820195908201906001016111af565b509495945050505050565b848152608060208201526000611205608083018661119b565b73ffffffffffffffffffffffffffffffffffffffff949094166040830152506060015292915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b81810381811115610d4e57610d4e61122e565b85815284602082015260a06040820152600061128f60a083018661119b565b73ffffffffffffffffffffffffffffffffffffffff94909416606083015250608001529392505050565b8183528181602085013750600060208284010152600060207fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0601f840116840101905092915050565b600073ffffffffffffffffffffffffffffffffffffffff808916835280881660208401525085604083015260a0606083015261134260a0830185876112b9565b9050826080830152979650505050505050565b80820180821115610d4e57610d4e61122e565b600073ffffffffffffffffffffffffffffffffffffffff808b168352808a16602084015288604084015287606084015286608084015280861660a08401525060e060c08301526113bc60e0830184866112b9565b9a9950505050505050505050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b600082611408576114086113ca565b500690565b600181815b8085111561146657817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0482111561144c5761144c61122e565b8085161561145957918102915b93841c9390800290611412565b509250929050565b60008261147d57506001610d4e565b8161148a57506000610d4e565b81600181146114a057600281146114aa576114c6565b6001915050610d4e565b60ff8411156114bb576114bb61122e565b50506001821b610d4e565b5060208310610133831016604e8410600b84101617156114e9575081810a610d4e565b6114f3838361140d565b807fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff048211156115255761152561122e565b029392505050565b6000611002838361146e565b600082611548576115486113ca565b500490565b8082028115828204841417610d4e57610d4e61122e56fea26469706673582212207f069269589ed98adcafb5520619a1340a250064a0253d307ba1e7c670e43e5b64736f6c63430008110033000000000000000000000000f892fef9da200d9e84c9b0647ecff0f34633abe8000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc20000000000000000000000007a250d5630b4cf539739df2c5dacb4c659f2488d

Deployed Bytecode

0x6080604052600436106100cb5760003560e01c8063516c731c11610074578063c31c9c071161004e578063c31c9c071461026d578063ddca3f431461029a578063e4d0c7f0146102be57600080fd5b8063516c731c146101fd57806386702df71461021d578063b4f2e8b81461024d57600080fd5b80633fc8cef3116100a55780633fc8cef31461019057806346904840146101bd57806348c314f4146101ea57600080fd5b8063022914a7146100d75780630eefdbad1461011c57806324e7571b1461016e57600080fd5b366100d257005b600080fd5b3480156100e357600080fd5b506101076100f2366004610fe7565b60006020819052908152604090205460ff1681565b60405190151581526020015b60405180910390f35b34801561012857600080fd5b506004546101499073ffffffffffffffffffffffffffffffffffffffff1681565b60405173ffffffffffffffffffffffffffffffffffffffff9091168152602001610113565b34801561017a57600080fd5b5061018e610189366004610fe7565b6102de565b005b34801561019c57600080fd5b506005546101499073ffffffffffffffffffffffffffffffffffffffff1681565b3480156101c957600080fd5b506003546101499073ffffffffffffffffffffffffffffffffffffffff1681565b61018e6101f8366004611009565b6103ab565b34801561020957600080fd5b5061018e610218366004611045565b6106bb565b34801561022957600080fd5b50610107610238366004610fe7565b60076020526000908152604090205460ff1681565b34801561025957600080fd5b5061018e610268366004611081565b610742565b34801561027957600080fd5b506006546101499073ffffffffffffffffffffffffffffffffffffffff1681565b3480156102a657600080fd5b506102b060025481565b604051908152602001610113565b3480156102ca57600080fd5b5061018e6102d93660046110ad565b6108ad565b3360009081526020819052604090205460ff1661035c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600c60248201527f556e617574686f72697a6564000000000000000000000000000000000000000060448201526064015b60405180910390fd5b73ffffffffffffffffffffffffffffffffffffffff16600090815260076020526040902080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00166001179055565b600154600114610417576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600a60248201527f5245454e5452414e4359000000000000000000000000000000000000000000006044820152606401610353565b6002600155600061042734610cd6565b60408051600280825260608201835292935060009290916020830190803683375050600554825192935073ffffffffffffffffffffffffffffffffffffffff169183915060009061047a5761047a61116c565b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff168152505084816001815181106104c8576104c861116c565b73ffffffffffffffffffffffffffffffffffffffff92831660209182029290920181019190915290861660009081526007909152604090205460ff16156105aa5760065473ffffffffffffffffffffffffffffffffffffffff1663b6f9de958361053186610d21565b84887fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6040518663ffffffff1660e01b815260040161057394939291906111ec565b6000604051808303818588803b15801561058c57600080fd5b505af11580156105a0573d6000803e3d6000fd5b5050505050610647565b60065473ffffffffffffffffffffffffffffffffffffffff16637ff36ab5836105d286610d21565b84887fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6040518663ffffffff1660e01b815260040161061494939291906111ec565b6000604051808303818588803b15801561062d57600080fd5b505af1158015610641573d6000803e3d6000fd5b50505050505b7f61fad1e4996f793deb2a6b2d07c7fe999e0ce4a95e1ca4662fd430f1c5244019848634610675868261125d565b6040805173ffffffffffffffffffffffffffffffffffffffff958616815294909316602085015291830152606082015260800160405180910390a1505060018055505050565b3360009081526020819052604090205460ff16610734576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600c60248201527f556e617574686f72697a656400000000000000000000000000000000000000006044820152606401610353565b61073e8282610d54565b5050565b3360009081526020819052604090205460ff166107bb576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600c60248201527f556e617574686f72697a656400000000000000000000000000000000000000006044820152606401610353565b6103e8821115610827576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601c60248201527f6665652063616e206e6f74206265206d6f7265207468616e20313025000000006044820152606401610353565b6002829055600380547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff83169081179091556040805184815260208101929092527fc8242dc5446855370b781abbfc5d882af1d1a3cc29143216aba3558feb0ce925910160405180910390a15050565b600154600114610919576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600a60248201527f5245454e5452414e4359000000000000000000000000000000000000000000006044820152606401610353565b6002600155600480546040517f68155ec100000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff87811693820193909352336024820152306044820152606481018690529116906368155ec190608401600060405180830381600087803b1580156109a057600080fd5b505af11580156109b4573d6000803e3d6000fd5b50506006546109e0925073ffffffffffffffffffffffffffffffffffffffff8781169250166000610ddc565b600654610a079073ffffffffffffffffffffffffffffffffffffffff868116911685610ddc565b6040805160028082526060820183526000926020830190803683370190505090508481600081518110610a3c57610a3c61116c565b73ffffffffffffffffffffffffffffffffffffffff9283166020918202929092010152600554825191169082906001908110610a7a57610a7a61116c565b73ffffffffffffffffffffffffffffffffffffffff92831660209182029290920181019190915290861660009081526007909152604090205460ff1615610b50576006546040517f791ac94700000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff9091169063791ac94790610b199087908790869030908990600401611270565b600060405180830381600087803b158015610b3357600080fd5b505af1158015610b47573d6000803e3d6000fd5b50505050610be1565b6006546040517f18cbafe500000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff909116906318cbafe590610bae9087908790869030908990600401611270565b600060405180830381600087803b158015610bc857600080fd5b505af1158015610bdc573d6000803e3d6000fd5b505050505b476000610bed82610cd6565b90508a73ffffffffffffffffffffffffffffffffffffffff166344bc937b828c6000858e8e8b6040518863ffffffff1660e01b8152600401610c3496959493929190611302565b6000604051808303818588803b158015610c4d57600080fd5b505af1158015610c61573d6000803e3d6000fd5b5050505050507fd0905d621f104066424412dcaf4dd7189ca00660fc08a026e5927026b8afa82c338787610c9485610ea9565b610c9e9086611355565b610ca786610ea9565b8e8e8e604051610cbe989796959493929190611368565b60405180910390a15050600180555050505050505050565b600080610ce283610ea9565b90508015610d1a57600354610d0d9073ffffffffffffffffffffffffffffffffffffffff1682610efd565b610d17818461125d565b92505b5090919050565b6000610d2e6064836113f9565b610d3990600a61152d565b610d44606484611539565b610d4e919061154d565b92915050565b73ffffffffffffffffffffffffffffffffffffffff82166000818152602081815260409182902080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff001685151590811790915591519182527ff74826f11048fa8ecf33e91132bf280f6582ed97548a84e426b56e98526b9316910160405180910390a25050565b60006040517f095ea7b300000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff841660048201528260248201526000806044836000895af1915050610e3d81610f77565b610ea3576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600e60248201527f415050524f56455f4641494c45440000000000000000000000000000000000006044820152606401610353565b50505050565b6000600254600014158015610ed5575060035473ffffffffffffffffffffffffffffffffffffffff1615155b15610ef55761271060025483610eeb919061154d565b610d4e9190611539565b506000919050565b600080600080600085875af1905080610f72576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601360248201527f4554485f5452414e534645525f4641494c4544000000000000000000000000006044820152606401610353565b505050565b60003d82610f8957806000803e806000fd5b8060208114610fa1578015610fb25760009250610fb7565b816000803e60005115159250610fb7565b600192505b5050919050565b803573ffffffffffffffffffffffffffffffffffffffff81168114610fe257600080fd5b919050565b600060208284031215610ff957600080fd5b61100282610fbe565b9392505050565b60008060006060848603121561101e57600080fd5b61102784610fbe565b925061103560208501610fbe565b9150604084013590509250925092565b6000806040838503121561105857600080fd5b61106183610fbe565b91506020830135801515811461107657600080fd5b809150509250929050565b6000806040838503121561109457600080fd5b823591506110a460208401610fbe565b90509250929050565b60008060008060008060008060e0898b0312156110c957600080fd5b6110d289610fbe565b97506110e060208a01610fbe565b9650604089013567ffffffffffffffff808211156110fd57600080fd5b818b0191508b601f83011261111157600080fd5b81358181111561112057600080fd5b8c602082850101111561113257600080fd5b60208301985080975050505061114a60608a01610fbe565b979a96995094979396956080850135955060a08501359460c001359350915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b600081518084526020808501945080840160005b838110156111e157815173ffffffffffffffffffffffffffffffffffffffff16875295820195908201906001016111af565b509495945050505050565b848152608060208201526000611205608083018661119b565b73ffffffffffffffffffffffffffffffffffffffff949094166040830152506060015292915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b81810381811115610d4e57610d4e61122e565b85815284602082015260a06040820152600061128f60a083018661119b565b73ffffffffffffffffffffffffffffffffffffffff94909416606083015250608001529392505050565b8183528181602085013750600060208284010152600060207fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0601f840116840101905092915050565b600073ffffffffffffffffffffffffffffffffffffffff808916835280881660208401525085604083015260a0606083015261134260a0830185876112b9565b9050826080830152979650505050505050565b80820180821115610d4e57610d4e61122e565b600073ffffffffffffffffffffffffffffffffffffffff808b168352808a16602084015288604084015287606084015286608084015280861660a08401525060e060c08301526113bc60e0830184866112b9565b9a9950505050505050505050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b600082611408576114086113ca565b500690565b600181815b8085111561146657817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0482111561144c5761144c61122e565b8085161561145957918102915b93841c9390800290611412565b509250929050565b60008261147d57506001610d4e565b8161148a57506000610d4e565b81600181146114a057600281146114aa576114c6565b6001915050610d4e565b60ff8411156114bb576114bb61122e565b50506001821b610d4e565b5060208310610133831016604e8410600b84101617156114e9575081810a610d4e565b6114f3838361140d565b807fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff048211156115255761152561122e565b029392505050565b6000611002838361146e565b600082611548576115486113ca565b500490565b8082028115828204841417610d4e57610d4e61122e56fea26469706673582212207f069269589ed98adcafb5520619a1340a250064a0253d307ba1e7c670e43e5b64736f6c63430008110033

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

000000000000000000000000f892fef9da200d9e84c9b0647ecff0f34633abe8000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc20000000000000000000000007a250d5630b4cf539739df2c5dacb4c659f2488d

-----Decoded View---------------
Arg [0] : _ttp (address): 0xF892Fef9dA200d9E84c9b0647ecFF0F34633aBe8
Arg [1] : _weth (address): 0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2
Arg [2] : _swapRouter (address): 0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D

-----Encoded View---------------
3 Constructor Arguments found :
Arg [0] : 000000000000000000000000f892fef9da200d9e84c9b0647ecff0f34633abe8
Arg [1] : 000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc2
Arg [2] : 0000000000000000000000007a250d5630b4cf539739df2c5dacb4c659f2488d


Block Uncle Number Difficulty Gas Used Reward
View All Uncles
Loading...
Loading
Loading...
Loading
Loading...
Loading
[ Download: CSV Export  ]

A contract address hosts a smart contract, which is a set of code stored on the blockchain that runs when predetermined conditions are met. Learn more about addresses in our Knowledge Base.