Contract 0xa19b3b22f29E23e4c04678C94CFC3e8f202137d8 5

 

Contract Overview

Balance:
0 ETH

ETH Value:
$0.00

Token:
Txn Hash Method
Block
From
To
Value [Txn Fee]
0x0f244d43cdd35d5e3b3cf313e3c00bc017572a2729229ef6464efc39244029abUnwind Pairs127413592022-05-23 0:46:233 days 13 hrs ago0x4bb4c1b0745ef7b4642feeccd0740dec417ca0a0 IN  0xa19b3b22f29e23e4c04678c94cfc3e8f202137d80 ETH0.000631860754 ETH
0xb49ef5b9ce8f3fd82b8459f3e82b8480a678cb2a917a87a2531002e84fc726dbUnwind Pairs124256292022-05-18 19:58:367 days 17 hrs ago0x4bb4c1b0745ef7b4642feeccd0740dec417ca0a0 IN  0xa19b3b22f29e23e4c04678c94cfc3e8f202137d80 ETH0.000584015051 ETH
0xe4478d8544dd7a04bf99aecbeb4d19e75606a764a40cb97be0d69a04a9531123Unwind Pairs124256022022-05-18 19:58:367 days 17 hrs ago0x4bb4c1b0745ef7b4642feeccd0740dec417ca0a0 IN  0xa19b3b22f29e23e4c04678c94cfc3e8f202137d80 ETH0.0006031059 ETH
0x9a6773391c03ad684eab05a2fdb1ad2ecf5e67d9c21f9d14ccdaa42c6790ca78Unwind Pairs124255872022-05-18 19:58:367 days 17 hrs ago0x4bb4c1b0745ef7b4642feeccd0740dec417ca0a0 IN  0xa19b3b22f29e23e4c04678c94cfc3e8f202137d80 ETH0.000264054744 ETH
0x583ad8c5807aa3ae2fb206af38530fc51e8ad0123134b8272b4d5298b042d3d7Unwind Pairs116626732022-05-10 3:12:5316 days 10 hrs ago0x4bb4c1b0745ef7b4642feeccd0740dec417ca0a0 IN  0xa19b3b22f29e23e4c04678c94cfc3e8f202137d80 ETH0.00146061684 ETH
0x32636cb4045a6ca6e6187df5c53db59b61e30729dd058980cc5b3eb3a4ce60aaBuy Weth115371412022-05-08 21:46:4917 days 16 hrs ago0x4bb4c1b0745ef7b4642feeccd0740dec417ca0a0 IN  0xa19b3b22f29e23e4c04678c94cfc3e8f202137d80 ETH0.00023081545 ETH
0x3cd9195b7a7e296dda20c62a0790264e214e4da812723b0f837121564b7c71d7Buy Weth115371272022-05-08 21:46:4917 days 16 hrs ago0x4bb4c1b0745ef7b4642feeccd0740dec417ca0a0 IN  0xa19b3b22f29e23e4c04678c94cfc3e8f202137d80 ETH0.000189826246 ETH
0x09c93d86d8f48d657ca8d25a07eff6addc23f9b1500d15591886b46697c5ff38Buy Weth115371172022-05-08 21:46:0417 days 16 hrs ago0x4bb4c1b0745ef7b4642feeccd0740dec417ca0a0 IN  0xa19b3b22f29e23e4c04678c94cfc3e8f202137d80 ETH0.000190690306 ETH
0x87725aca4428e70593ae8ce74f5fe1236aa45351f3a5406d0a1bfac1c92965c7Buy Weth115371042022-05-08 21:46:0417 days 16 hrs ago0x4bb4c1b0745ef7b4642feeccd0740dec417ca0a0 IN  0xa19b3b22f29e23e4c04678c94cfc3e8f202137d80 ETH0.000190710805 ETH
0x308129557197f81ec61997792bc0ddf5bbf38aa1c8e5d03ad6db433a64e4533fBuy Weth115370902022-05-08 21:46:0417 days 16 hrs ago0x4bb4c1b0745ef7b4642feeccd0740dec417ca0a0 IN  0xa19b3b22f29e23e4c04678c94cfc3e8f202137d80 ETH0.000190557067 ETH
0x81d77ba75b4df1ca71084904e85d3fa7fc329a1eefc430ab58ac95ada15a2095Buy Weth115370832022-05-08 21:45:3917 days 16 hrs ago0x4bb4c1b0745ef7b4642feeccd0740dec417ca0a0 IN  0xa19b3b22f29e23e4c04678c94cfc3e8f202137d80 ETH0.000190342405 ETH
0x533400f12475b38480cca69cb5586bfb1c5556ce445b449f021dc09307912917Burn Pairs115370712022-05-08 21:45:3917 days 16 hrs ago0x4bb4c1b0745ef7b4642feeccd0740dec417ca0a0 IN  0xa19b3b22f29e23e4c04678c94cfc3e8f202137d80 ETH0.000238516549 ETH
0x164e169e56c756a71d0640af9bb713a4f7e2f0eac105fe90e64583819ac58ef6Unwind Pairs115370562022-05-08 21:44:2117 days 16 hrs ago0x4bb4c1b0745ef7b4642feeccd0740dec417ca0a0 IN  0xa19b3b22f29e23e4c04678c94cfc3e8f202137d80 ETH0.000303202362 ETH
0xf1a036d65d05c19b0e6014bf966744d5ea6e97301572dc7d35c7c60c37adc1b0Unwind Pairs115360092022-05-08 21:16:2717 days 16 hrs ago0x4bb4c1b0745ef7b4642feeccd0740dec417ca0a0 IN  0xa19b3b22f29e23e4c04678c94cfc3e8f202137d80 ETH0.000568926768 ETH
0xac49c783ea2091856af558d4416e046c2fd0db5324e394cfb410054d33322219Unwind Pairs115359942022-05-08 21:15:5617 days 16 hrs ago0x4bb4c1b0745ef7b4642feeccd0740dec417ca0a0 IN  0xa19b3b22f29e23e4c04678c94cfc3e8f202137d80 ETH0.000602961332 ETH
0xd943b75a94b5740a308781015716da46840f7c1f16230dfccbe75daacfcccc2fUnwind Pairs115359722022-05-08 21:15:5617 days 16 hrs ago0x4bb4c1b0745ef7b4642feeccd0740dec417ca0a0 IN  0xa19b3b22f29e23e4c04678c94cfc3e8f202137d80 ETH0.000468110119 ETH
0xcff2856a8851ccf5634f5425ce04ffa51e296e10a3aa0f7da831c3779a35bc30Unwind Pairs115359552022-05-08 21:15:1417 days 16 hrs ago0x4bb4c1b0745ef7b4642feeccd0740dec417ca0a0 IN  0xa19b3b22f29e23e4c04678c94cfc3e8f202137d80 ETH0.000373044546 ETH
0x78b3170c1b257b14388559baf52c7ebcf382a7d1b22526267a4ea92f3203feebBurn Pairs115359412022-05-08 21:14:5517 days 16 hrs ago0x4bb4c1b0745ef7b4642feeccd0740dec417ca0a0 IN  0xa19b3b22f29e23e4c04678c94cfc3e8f202137d80 ETH0.00024510577 ETH
0x2dc2a91c557fb96ff15783c50175da9a9172db928273a2838b8c466f9838a14dUnwind Pairs115359312022-05-08 21:14:2017 days 16 hrs ago0x4bb4c1b0745ef7b4642feeccd0740dec417ca0a0 IN  0xa19b3b22f29e23e4c04678c94cfc3e8f202137d80 ETH0.000255368604 ETH
0x3883609bfd1307f96122be38fac52bfb549694e4be238dd50a93711eb28a47adUnwind Pairs115359062022-05-08 21:13:5817 days 16 hrs ago0x4bb4c1b0745ef7b4642feeccd0740dec417ca0a0 IN  0xa19b3b22f29e23e4c04678c94cfc3e8f202137d80 ETH0.00023831516 ETH
0xb61a6881105ac1d4d2f2044d89955734ca77e477a3bcb6c59049ddcc9beb96a1Unwind Pairs115358912022-05-08 21:12:5917 days 16 hrs ago0x4bb4c1b0745ef7b4642feeccd0740dec417ca0a0 IN  0xa19b3b22f29e23e4c04678c94cfc3e8f202137d80 ETH0.00036427654 ETH
0x9daf1cdb87bb3e02a2668d16585e1df6d47b948c2f024030a2bfa492fdf684a7Burn Pairs115358812022-05-08 21:12:5917 days 16 hrs ago0x4bb4c1b0745ef7b4642feeccd0740dec417ca0a0 IN  0xa19b3b22f29e23e4c04678c94cfc3e8f202137d80 ETH0.000234786912 ETH
0x8161fcb10f0cb42b849a542e01ed6b4cfb0f799d3d3da40a44b763011c69b62eBurn Pairs115358632022-05-08 21:12:0517 days 16 hrs ago0x4bb4c1b0745ef7b4642feeccd0740dec417ca0a0 IN  0xa19b3b22f29e23e4c04678c94cfc3e8f202137d80 ETH0.000243745513 ETH
0x73d1c30e6f980d3556c0e9a97ec219cde5d730484c782c0dbf38f66590180156Burn Pairs115358522022-05-08 21:12:0517 days 16 hrs ago0x4bb4c1b0745ef7b4642feeccd0740dec417ca0a0 IN  0xa19b3b22f29e23e4c04678c94cfc3e8f202137d80 ETH0.000259587799 ETH
0x366741051d6c09ef57bbd9579f270ebf55325c4474e9b3edd78e205d1b08a5afUnwind Pairs115358422022-05-08 21:12:0517 days 16 hrs ago0x4bb4c1b0745ef7b4642feeccd0740dec417ca0a0 IN  0xa19b3b22f29e23e4c04678c94cfc3e8f202137d80 ETH0.000315353856 ETH
[ Download CSV Export 
Latest 25 internal transaction
Parent Txn Hash Block From To Value
0x0f244d43cdd35d5e3b3cf313e3c00bc017572a2729229ef6464efc39244029ab127413592022-05-23 0:46:233 days 13 hrs ago 0xa19b3b22f29e23e4c04678c94cfc3e8f202137d8 0x3f770ac673856f105b586bb393d122721265ad460 ETH
0x0f244d43cdd35d5e3b3cf313e3c00bc017572a2729229ef6464efc39244029ab127413592022-05-23 0:46:233 days 13 hrs ago 0xa19b3b22f29e23e4c04678c94cfc3e8f202137d8 0xf31e1ae27e7cd057c1d6795a5a083e0453d39b500 ETH
0x0f244d43cdd35d5e3b3cf313e3c00bc017572a2729229ef6464efc39244029ab127413592022-05-23 0:46:233 days 13 hrs ago 0xa19b3b22f29e23e4c04678c94cfc3e8f202137d8 0x3f770ac673856f105b586bb393d122721265ad460 ETH
0x0f244d43cdd35d5e3b3cf313e3c00bc017572a2729229ef6464efc39244029ab127413592022-05-23 0:46:233 days 13 hrs ago 0xa19b3b22f29e23e4c04678c94cfc3e8f202137d8 0x3f770ac673856f105b586bb393d122721265ad460 ETH
0x0f244d43cdd35d5e3b3cf313e3c00bc017572a2729229ef6464efc39244029ab127413592022-05-23 0:46:233 days 13 hrs ago 0xa19b3b22f29e23e4c04678c94cfc3e8f202137d8 0xeec2be5c91ae7f8a338e1e5f3b5de49d07afdc810 ETH
0x0f244d43cdd35d5e3b3cf313e3c00bc017572a2729229ef6464efc39244029ab127413592022-05-23 0:46:233 days 13 hrs ago 0xa19b3b22f29e23e4c04678c94cfc3e8f202137d8 0x1efb3f88bc88f03fd1804a5c53b7141bbef5ded80 ETH
0x0f244d43cdd35d5e3b3cf313e3c00bc017572a2729229ef6464efc39244029ab127413592022-05-23 0:46:233 days 13 hrs ago 0xa19b3b22f29e23e4c04678c94cfc3e8f202137d80x8f93eaae544e8f5eb077a1e09c1554067d9e2ca80 ETH
0x0f244d43cdd35d5e3b3cf313e3c00bc017572a2729229ef6464efc39244029ab127413592022-05-23 0:46:233 days 13 hrs ago 0xa19b3b22f29e23e4c04678c94cfc3e8f202137d80x3e6648c5a70a150a88bce65f4ad4d506fe15d2af0 ETH
0x0f244d43cdd35d5e3b3cf313e3c00bc017572a2729229ef6464efc39244029ab127413592022-05-23 0:46:233 days 13 hrs ago 0xa19b3b22f29e23e4c04678c94cfc3e8f202137d80x8f93eaae544e8f5eb077a1e09c1554067d9e2ca80 ETH
0x0f244d43cdd35d5e3b3cf313e3c00bc017572a2729229ef6464efc39244029ab127413592022-05-23 0:46:233 days 13 hrs ago 0xa19b3b22f29e23e4c04678c94cfc3e8f202137d80x8f93eaae544e8f5eb077a1e09c1554067d9e2ca80 ETH
0x0f244d43cdd35d5e3b3cf313e3c00bc017572a2729229ef6464efc39244029ab127413592022-05-23 0:46:233 days 13 hrs ago 0xa19b3b22f29e23e4c04678c94cfc3e8f202137d80x8f93eaae544e8f5eb077a1e09c1554067d9e2ca80 ETH
0x0f244d43cdd35d5e3b3cf313e3c00bc017572a2729229ef6464efc39244029ab127413592022-05-23 0:46:233 days 13 hrs ago 0xa19b3b22f29e23e4c04678c94cfc3e8f202137d80x692a0b300366d1042679397e40f3d2cb4b8f7d300 ETH
0x0f244d43cdd35d5e3b3cf313e3c00bc017572a2729229ef6464efc39244029ab127413592022-05-23 0:46:233 days 13 hrs ago 0xa19b3b22f29e23e4c04678c94cfc3e8f202137d8 0xda10009cbd5d07dd0cecc66161fc93d7c9000da10 ETH
0x0f244d43cdd35d5e3b3cf313e3c00bc017572a2729229ef6464efc39244029ab127413592022-05-23 0:46:233 days 13 hrs ago 0xa19b3b22f29e23e4c04678c94cfc3e8f202137d80x692a0b300366d1042679397e40f3d2cb4b8f7d300 ETH
0x0f244d43cdd35d5e3b3cf313e3c00bc017572a2729229ef6464efc39244029ab127413592022-05-23 0:46:233 days 13 hrs ago 0xa19b3b22f29e23e4c04678c94cfc3e8f202137d80x692a0b300366d1042679397e40f3d2cb4b8f7d300 ETH
0x0f244d43cdd35d5e3b3cf313e3c00bc017572a2729229ef6464efc39244029ab127413592022-05-23 0:46:233 days 13 hrs ago 0xa19b3b22f29e23e4c04678c94cfc3e8f202137d80x692a0b300366d1042679397e40f3d2cb4b8f7d300 ETH
0x0f244d43cdd35d5e3b3cf313e3c00bc017572a2729229ef6464efc39244029ab127413592022-05-23 0:46:233 days 13 hrs ago 0xa19b3b22f29e23e4c04678c94cfc3e8f202137d80xcb0e5bfa72bbb4d16ab5aa0c60601c438f04b4ad0 ETH
0x0f244d43cdd35d5e3b3cf313e3c00bc017572a2729229ef6464efc39244029ab127413592022-05-23 0:46:233 days 13 hrs ago 0xa19b3b22f29e23e4c04678c94cfc3e8f202137d8 0xfd086bc7cd5c481dcc9c85ebe478a1c0b69fcbb90 ETH
0x0f244d43cdd35d5e3b3cf313e3c00bc017572a2729229ef6464efc39244029ab127413592022-05-23 0:46:233 days 13 hrs ago 0xa19b3b22f29e23e4c04678c94cfc3e8f202137d80xcb0e5bfa72bbb4d16ab5aa0c60601c438f04b4ad0 ETH
0x0f244d43cdd35d5e3b3cf313e3c00bc017572a2729229ef6464efc39244029ab127413592022-05-23 0:46:233 days 13 hrs ago 0xa19b3b22f29e23e4c04678c94cfc3e8f202137d80xcb0e5bfa72bbb4d16ab5aa0c60601c438f04b4ad0 ETH
0x0f244d43cdd35d5e3b3cf313e3c00bc017572a2729229ef6464efc39244029ab127413592022-05-23 0:46:233 days 13 hrs ago 0xa19b3b22f29e23e4c04678c94cfc3e8f202137d80xcb0e5bfa72bbb4d16ab5aa0c60601c438f04b4ad0 ETH
0x0f244d43cdd35d5e3b3cf313e3c00bc017572a2729229ef6464efc39244029ab127413592022-05-23 0:46:233 days 13 hrs ago 0xa19b3b22f29e23e4c04678c94cfc3e8f202137d80xb7e50106a5bd3cf21af210a755f9c8740890a8c90 ETH
0x0f244d43cdd35d5e3b3cf313e3c00bc017572a2729229ef6464efc39244029ab127413592022-05-23 0:46:233 days 13 hrs ago 0xa19b3b22f29e23e4c04678c94cfc3e8f202137d8Treasure DAO: Magic Token0 ETH
0x0f244d43cdd35d5e3b3cf313e3c00bc017572a2729229ef6464efc39244029ab127413592022-05-23 0:46:233 days 13 hrs ago 0xa19b3b22f29e23e4c04678c94cfc3e8f202137d80xb7e50106a5bd3cf21af210a755f9c8740890a8c90 ETH
0x0f244d43cdd35d5e3b3cf313e3c00bc017572a2729229ef6464efc39244029ab127413592022-05-23 0:46:233 days 13 hrs ago 0xa19b3b22f29e23e4c04678c94cfc3e8f202137d80xb7e50106a5bd3cf21af210a755f9c8740890a8c90 ETH
[ Download CSV Export 
Loading

Contract Source Code Verified (Exact Match)

Contract Name:
WethMaker

Compiler Version
v0.8.10+commit.fc410830

Optimization Enabled:
Yes with 99999 runs

Other Settings:
default evmVersion

Contract Source Code (Solidity Standard Json-Input format)

File 1 of 6 : WethMaker.sol
// SPDX-License-Identifier: GPL-3.0-or-later

pragma solidity >=0.8.0;

import "./Unwindooor.sol";

/// @notice Contract for selling received tokens into weth. Deploy on secondary networks.
contract WethMaker is Unwindooor {

    event SetBridge(address indexed token, address bridge);

    address public immutable weth;

    mapping(address => address) public bridges;

    constructor(
        address owner,
        address user,
        address factory,
        address _weth
    ) Unwindooor(owner, user, factory) {
        weth = _weth;
    }

    function setBridge(address token, address bridge) external onlyOwner {
        bridges[token] = bridge;
        emit SetBridge(token, bridge);
    }

    // Exchange token for weth or its bridge token (which gets converted into weth in subsequent transactions).
    function buyWeth(
        address[] calldata tokens,
        uint256[] calldata amountsIn,
        uint256[] calldata minimumOuts
    ) external onlyTrusted {
        for (uint256 i = 0; i < tokens.length; i++) {

            address tokenIn = tokens[i];
            address outToken = bridges[tokenIn] == address(0) ? weth : bridges[tokenIn];
            if (_swap(tokenIn, outToken, amountsIn[i], address(this)) < minimumOuts[i]) revert SlippageProtection();
            
        }
    }

    function _swap(
        address tokenIn,
        address tokenOut,
        uint256 amountIn,
        address to
    ) internal returns (uint256 outAmount) {

        IUniV2 pair = IUniV2(_pairFor(tokenIn, tokenOut));
        _safeTransfer(tokenIn, address(pair), amountIn);

        (uint256 reserve0, uint256 reserve1, ) = pair.getReserves();

        if (tokenIn < tokenOut) {

            outAmount = _getAmountOut(amountIn, reserve0, reserve1);
            pair.swap(0, outAmount, to, "");

        } else {

            outAmount = _getAmountOut(amountIn, reserve1, reserve0);
            pair.swap(outAmount, 0, to, "");

        }

    }

    // Allow the owner to withdraw the funds and bridge them to mainnet.
    function withdraw(address token, address to, uint256 _value) onlyOwner external {
        if (token != address(0)) {
            _safeTransfer(token, to, _value);
        } else {
            (bool success, ) = to.call{value: _value}("");
            require(success);
        }
    }

    function doAction(address to, uint256 _value, bytes memory data) onlyOwner external {
        (bool success, ) = to.call{value: _value}(data);
        require(success);
    }

    receive() external payable {}

}

File 2 of 6 : Unwindooor.sol
// SPDX-License-Identifier: GPL-3.0-or-later

pragma solidity >=0.8.0;

import "./Auth.sol";
import "./interfaces/IUniV2.sol";
import "./interfaces/IUniV2Factory.sol";

/// @notice Contract for withdrawing LP positions.
/// @dev Calling unwindPairs() withdraws the LP position into one of the two tokens
contract Unwindooor is Auth {

    error SlippageProtection();
    error TransferFailed();

    bytes4 private constant TRANSFER_SELECTOR = bytes4(keccak256(bytes('transfer(address,uint256)')));

    IUniV2Factory public immutable factory;

    constructor(
        address owner,
        address user,
        address factoryAddress
    ) Auth(owner, user) {
        factory = IUniV2Factory(factoryAddress);
    }

    // We remove liquidity and sell tokensB[i] for tokensA[i].
    function unwindPairs(
        address[] calldata tokensA,
        address[] calldata tokensB,
        uint256[] calldata amounts,
        uint256[] calldata minimumOuts
    ) external onlyTrusted {
        for (uint256 i = 0; i < tokensA.length; i++) {
            
            address tokenA = tokensA[i];
            address tokenB = tokensB[i];
            bool keepToken0 = tokenA < tokenB;
            address pair = _pairFor(tokenA, tokenB);

            if (_unwindPair(IUniV2(pair), amounts[i], keepToken0, tokenB) < minimumOuts[i]) revert SlippageProtection();
        }
    }

    // Burn liquidity and sell one of the tokens for the other.
    function _unwindPair(
        IUniV2 pair,
        uint256 amount,
        bool keepToken0,
        address tokenToSell
    ) private returns (uint256 amountOut) {

        pair.transfer(address(pair), amount);
        (uint256 amount0, uint256 amount1) = pair.burn(address(this));
        (uint112 reserve0, uint112 reserve1,) = pair.getReserves();

        if (keepToken0) {
            _safeTransfer(tokenToSell, address(pair), amount1);
            amountOut = _getAmountOut(amount1, uint256(reserve1), uint256(reserve0));
            pair.swap(amountOut, 0, address(this), "");
            amountOut += amount0;
        } else {
            _safeTransfer(tokenToSell, address(pair), amount0);
            amountOut = _getAmountOut(amount0, uint256(reserve0), uint256(reserve1));
            pair.swap(0, amountOut, address(this), "");
            amountOut += amount1;
        }
    }

    // In case we don't want to sell one of the tokens for the other.
    function burnPairs(
        IUniV2[] calldata lpTokens,
        uint256[] calldata amounts,
        uint256[] calldata minimumOut0,
        uint256[] calldata minimumOut1
    ) external onlyTrusted {
        for (uint256 i = 0; i < lpTokens.length; i++) {
            IUniV2 pair = lpTokens[i];
            pair.transfer(address(pair), amounts[i]);
            (uint256 amount0, uint256 amount1) = pair.burn(address(this));
            if (amount0 < minimumOut0[i] || amount1 < minimumOut1[i]) revert SlippageProtection();
        }
    }

    function _getAmountOut(
        uint256 amountIn,
        uint256 reserveIn,
        uint256 reserveOut
    ) internal pure returns (uint256) {
        uint256 amountInWithFee = amountIn * 997;
        uint256 numerator = amountInWithFee * reserveOut;
        uint256 denominator = reserveIn * 1000 + amountInWithFee;
        return numerator / denominator;
    }

    function _safeTransfer(address token, address to, uint value) internal {
        (bool success, bytes memory data) = token.call(abi.encodeWithSelector(TRANSFER_SELECTOR, to, value));
        if (!success || (data.length != 0 && !abi.decode(data, (bool)))) revert TransferFailed();
    }

    function _pairFor(address tokenA, address tokenB) internal view returns (address pair) {
        (address token0, address token1) = tokenA < tokenB ? (tokenA, tokenB) : (tokenB, tokenA);
        pair = address(uint160(uint256(keccak256(abi.encodePacked(
            hex'ff',
            factory,
            keccak256(abi.encodePacked(token0, token1)),
            hex'e18a34eb0e04b04f7a0ac29a6e80748dca96319b42c54d679cb821dca90c6303' // init code hash
        )))));
    }

}

File 3 of 6 : Auth.sol
// SPDX-License-Identifier: GPL-3.0-or-later

pragma solidity >=0.8.0;

abstract contract Auth {

    event SetOwner(address indexed owner);
    event SetTrusted(address indexed user, bool isTrusted);

    address public owner;

    mapping(address => bool) public trusted;

    error OnlyOwner();
    error OnlyTrusted();

    modifier onlyOwner() {
        if (msg.sender != owner) revert OnlyOwner();
        _;
    }

    modifier onlyTrusted() {
        if (!trusted[msg.sender]) revert OnlyTrusted();
        _;
    }

    constructor(address newOwner, address trustedUser) {
        owner = newOwner;
        trusted[trustedUser] = true;

        emit SetOwner(owner);
        emit SetTrusted(trustedUser, true);
    }

    function setOwner(address newOwner) external onlyOwner {
        owner = newOwner;
        emit SetOwner(newOwner);
    }

    function setTrusted(address user, bool isTrusted) external onlyOwner {
        trusted[user] = isTrusted;
        emit SetTrusted(user, isTrusted);
    }

}

File 4 of 6 : IUniV2.sol
// SPDX-License-Identifier: GPL-3.0-or-later

import "./IERC20.sol";

interface IUniV2 is IERC20 {
    function totalSupply() external view returns (uint256);
    function getReserves() external view returns (uint112 _reserve0, uint112 _reserve1, uint32 _blockTimestampLast);
    function burn(address to) external returns (uint256 amount0, uint256 amount1);
    function swap(uint amount0Out, uint amount1Out, address to, bytes calldata data) external;
    function token0() external view returns (address);
    function token1() external view returns (address);
}

File 5 of 6 : IUniV2Factory.sol
// SPDX-License-Identifier: GPL-3.0-or-later

interface IUniV2Factory {
    function getPair(address tokenA, address tokenB) external view returns (address);
}

File 6 of 6 : IERC20.sol
// SPDX-License-Identifier: GPL-3.0-or-later

interface IERC20 {
    function transferFrom(address sender, address recipient, uint256 amount) external returns (bool);
    function transfer(address recipient, uint256 amount) external returns (bool);
    function balanceOf(address addy) external view returns (uint256);
}

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

Contract ABI

[{"inputs":[{"internalType":"address","name":"owner","type":"address"},{"internalType":"address","name":"user","type":"address"},{"internalType":"address","name":"factory","type":"address"},{"internalType":"address","name":"_weth","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"inputs":[],"name":"OnlyOwner","type":"error"},{"inputs":[],"name":"OnlyTrusted","type":"error"},{"inputs":[],"name":"SlippageProtection","type":"error"},{"inputs":[],"name":"TransferFailed","type":"error"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"token","type":"address"},{"indexed":false,"internalType":"address","name":"bridge","type":"address"}],"name":"SetBridge","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"owner","type":"address"}],"name":"SetOwner","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"user","type":"address"},{"indexed":false,"internalType":"bool","name":"isTrusted","type":"bool"}],"name":"SetTrusted","type":"event"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"bridges","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"contract IUniV2[]","name":"lpTokens","type":"address[]"},{"internalType":"uint256[]","name":"amounts","type":"uint256[]"},{"internalType":"uint256[]","name":"minimumOut0","type":"uint256[]"},{"internalType":"uint256[]","name":"minimumOut1","type":"uint256[]"}],"name":"burnPairs","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address[]","name":"tokens","type":"address[]"},{"internalType":"uint256[]","name":"amountsIn","type":"uint256[]"},{"internalType":"uint256[]","name":"minimumOuts","type":"uint256[]"}],"name":"buyWeth","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"_value","type":"uint256"},{"internalType":"bytes","name":"data","type":"bytes"}],"name":"doAction","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"factory","outputs":[{"internalType":"contract IUniV2Factory","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"token","type":"address"},{"internalType":"address","name":"bridge","type":"address"}],"name":"setBridge","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"setOwner","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"user","type":"address"},{"internalType":"bool","name":"isTrusted","type":"bool"}],"name":"setTrusted","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"trusted","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address[]","name":"tokensA","type":"address[]"},{"internalType":"address[]","name":"tokensB","type":"address[]"},{"internalType":"uint256[]","name":"amounts","type":"uint256[]"},{"internalType":"uint256[]","name":"minimumOuts","type":"uint256[]"}],"name":"unwindPairs","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"weth","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"token","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"_value","type":"uint256"}],"name":"withdraw","outputs":[],"stateMutability":"nonpayable","type":"function"},{"stateMutability":"payable","type":"receive"}]

60c06040523480156200001157600080fd5b5060405162001d5a38038062001d5a833981016040819052620000349162000126565b600080546001600160a01b0319166001600160a01b038681169190911782558481168252600160208190526040808420805460ff1916909217909155825490518793879387938693869391909216917f167d3e9c1016ab80e58802ca9da10ce5c6a0f4debc46a2e7a2cd9e56899a4fb59190a2604051600181526001600160a01b038216907f878d105ed19c01e992a54459c2f04ba19432ac45600b42ce340d0342722074369060200160405180910390a250506001600160a01b039081166080529290921660a05250620001839350505050565b80516001600160a01b03811681146200012157600080fd5b919050565b600080600080608085870312156200013d57600080fd5b620001488562000109565b9350620001586020860162000109565b9250620001686040860162000109565b9150620001786060860162000109565b905092959194509250565b60805160a051611ba3620001b7600039600081816101360152610a470152600081816102810152610cf10152611ba36000f3fe6080604052600436106100d65760003560e01c80638e9be9f41161007f578063c45a015511610059578063c45a01551461026f578063ced67f0c146102a3578063d9caed12146102e6578063f32a12ac1461030657600080fd5b80638e9be9f41461020f5780639d22ae8c1461022f5780639dd8a81c1461024f57600080fd5b806354a0af17116100b057806354a0af17146101825780636e9821c2146101a25780638da5cb5b146101e257600080fd5b806313af4035146100e2578063248091c0146101045780633fc8cef31461012457600080fd5b366100dd57005b600080fd5b3480156100ee57600080fd5b506101026100fd3660046115b9565b610326565b005b34801561011057600080fd5b5061010261011f366004611629565b6103e4565b34801561013057600080fd5b506101587f000000000000000000000000000000000000000000000000000000000000000081565b60405173ffffffffffffffffffffffffffffffffffffffff90911681526020015b60405180910390f35b34801561018e57600080fd5b5061010261019d36600461171c565b61065d565b3480156101ae57600080fd5b506101d26101bd3660046115b9565b60016020526000908152604090205460ff1681565b6040519015158152602001610179565b3480156101ee57600080fd5b506000546101589073ffffffffffffffffffffffffffffffffffffffff1681565b34801561021b57600080fd5b5061010261022a366004611629565b61072c565b34801561023b57600080fd5b5061010261024a366004611807565b61088c565b34801561025b57600080fd5b5061010261026a366004611840565b61096a565b34801561027b57600080fd5b506101587f000000000000000000000000000000000000000000000000000000000000000081565b3480156102af57600080fd5b506101586102be3660046115b9565b60026020526000908152604090205473ffffffffffffffffffffffffffffffffffffffff1681565b3480156102f257600080fd5b506101026103013660046118da565b610afc565b34801561031257600080fd5b50610102610321366004611929565b610b9b565b60005473ffffffffffffffffffffffffffffffffffffffff163314610377576040517f5fc483c500000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b600080547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff8316908117825560405190917f167d3e9c1016ab80e58802ca9da10ce5c6a0f4debc46a2e7a2cd9e56899a4fb591a250565b3360009081526001602052604090205460ff1661042d576040517fcf1119ab00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60005b8781101561065257600089898381811061044c5761044c611957565b905060200201602081019061046191906115b9565b90508073ffffffffffffffffffffffffffffffffffffffff1663a9059cbb828a8a8681811061049257610492611957565b6040517fffffffff0000000000000000000000000000000000000000000000000000000060e087901b16815273ffffffffffffffffffffffffffffffffffffffff909416600485015260200291909101356024830152506044016020604051808303816000875af115801561050b573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061052f9190611986565b506040517f89afcb44000000000000000000000000000000000000000000000000000000008152306004820152600090819073ffffffffffffffffffffffffffffffffffffffff8416906389afcb449060240160408051808303816000875af11580156105a0573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906105c491906119a3565b915091508787858181106105da576105da611957565b9050602002013582108061060557508585858181106105fb576105fb611957565b9050602002013581105b1561063c576040517f17d431f400000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b505050808061064a906119f6565b915050610430565b505050505050505050565b60005473ffffffffffffffffffffffffffffffffffffffff1633146106ae576040517f5fc483c500000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60008373ffffffffffffffffffffffffffffffffffffffff1683836040516106d69190611a2f565b60006040518083038185875af1925050503d8060008114610713576040519150601f19603f3d011682016040523d82523d6000602084013e610718565b606091505b505090508061072657600080fd5b50505050565b3360009081526001602052604090205460ff16610775576040517fcf1119ab00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60005b8781101561065257600089898381811061079457610794611957565b90506020020160208101906107a991906115b9565b905060008888848181106107bf576107bf611957565b90506020020160208101906107d491906115b9565b905073ffffffffffffffffffffffffffffffffffffffff8082169083161060006107fe8484610c6f565b905086868681811061081257610812611957565b9050602002013561083d828b8b8981811061082f5761082f611957565b905060200201358587610df6565b1015610875576040517f17d431f400000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b505050508080610884906119f6565b915050610778565b60005473ffffffffffffffffffffffffffffffffffffffff1633146108dd576040517f5fc483c500000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b73ffffffffffffffffffffffffffffffffffffffff82811660008181526002602090815260409182902080547fffffffffffffffffffffffff0000000000000000000000000000000000000000169486169485179055905192835290917f8357797ab855a0bad5103ea8bd2f21f986350e94d73f143ae114db8f0db5a93a91015b60405180910390a25050565b3360009081526001602052604090205460ff166109b3576040517fcf1119ab00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60005b85811015610af35760008787838181106109d2576109d2611957565b90506020020160208101906109e791906115b9565b73ffffffffffffffffffffffffffffffffffffffff808216600090815260026020526040812054929350911615610a455773ffffffffffffffffffffffffffffffffffffffff80831660009081526002602052604090205416610a67565b7f00000000000000000000000000000000000000000000000000000000000000005b9050848484818110610a7b57610a7b611957565b90506020020135610aa683838a8a88818110610a9957610a99611957565b905060200201353061117c565b1015610ade576040517f17d431f400000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b50508080610aeb906119f6565b9150506109b6565b50505050505050565b60005473ffffffffffffffffffffffffffffffffffffffff163314610b4d576040517f5fc483c500000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b73ffffffffffffffffffffffffffffffffffffffff831615610b7957610b748383836113d0565b505050565b60008273ffffffffffffffffffffffffffffffffffffffff16826040516106d6565b60005473ffffffffffffffffffffffffffffffffffffffff163314610bec576040517f5fc483c500000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b73ffffffffffffffffffffffffffffffffffffffff821660008181526001602090815260409182902080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff001685151590811790915591519182527f878d105ed19c01e992a54459c2f04ba19432ac45600b42ce340d034272207436910161095e565b60008060008373ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff1610610cae578385610cb1565b84845b6040517fffffffffffffffffffffffffffffffffffffffff000000000000000000000000606084811b8216602084015283901b16603482015291935091507f00000000000000000000000000000000000000000000000000000000000000009060480160405160208183030381529060405280519060200120604051602001610db79291907fff00000000000000000000000000000000000000000000000000000000000000815260609290921b7fffffffffffffffffffffffffffffffffffffffff00000000000000000000000016600183015260158201527fe18a34eb0e04b04f7a0ac29a6e80748dca96319b42c54d679cb821dca90c6303603582015260550190565b604080517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0818403018152919052805160209091012095945050505050565b6040517fa9059cbb00000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff8516600482018190526024820185905260009163a9059cbb906044016020604051808303816000875af1158015610e6c573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e909190611986565b506040517f89afcb44000000000000000000000000000000000000000000000000000000008152306004820152600090819073ffffffffffffffffffffffffffffffffffffffff8816906389afcb449060240160408051808303816000875af1158015610f01573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610f2591906119a3565b915091506000808873ffffffffffffffffffffffffffffffffffffffff16630902f1ac6040518163ffffffff1660e01b8152600401606060405180830381865afa158015610f77573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610f9b9190611a8d565b5091509150861561108d57610fb1868a856113d0565b610fdc83826dffffffffffffffffffffffffffff16846dffffffffffffffffffffffffffff16611545565b6040517f022c0d9f0000000000000000000000000000000000000000000000000000000081526004810182905260006024820181905230604483015260806064830152608482015290955073ffffffffffffffffffffffffffffffffffffffff8a169063022c0d9f9060a401600060405180830381600087803b15801561106257600080fd5b505af1158015611076573d6000803e3d6000fd5b5050505083856110869190611add565b9450611170565b611098868a866113d0565b6110c384836dffffffffffffffffffffffffffff16836dffffffffffffffffffffffffffff16611545565b6040517f022c0d9f0000000000000000000000000000000000000000000000000000000081526000600482018190526024820183905230604483015260806064830152608482015290955073ffffffffffffffffffffffffffffffffffffffff8a169063022c0d9f9060a401600060405180830381600087803b15801561114957600080fd5b505af115801561115d573d6000803e3d6000fd5b50505050828561116d9190611add565b94505b50505050949350505050565b6000806111898686610c6f565b90506111968682866113d0565b6000808273ffffffffffffffffffffffffffffffffffffffff16630902f1ac6040518163ffffffff1660e01b8152600401606060405180830381865afa1580156111e4573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906112089190611a8d565b506dffffffffffffffffffffffffffff1691506dffffffffffffffffffffffffffff1691508673ffffffffffffffffffffffffffffffffffffffff168873ffffffffffffffffffffffffffffffffffffffff1610156113155761126c868383611545565b6040517f022c0d9f0000000000000000000000000000000000000000000000000000000081526000600482018190526024820183905273ffffffffffffffffffffffffffffffffffffffff88811660448401526080606484015260848301919091529195509084169063022c0d9f9060a401600060405180830381600087803b1580156112f857600080fd5b505af115801561130c573d6000803e3d6000fd5b505050506113c5565b611320868284611545565b6040517f022c0d9f0000000000000000000000000000000000000000000000000000000081526004810182905260006024820181905273ffffffffffffffffffffffffffffffffffffffff88811660448401526080606484015260848301919091529195509084169063022c0d9f9060a401600060405180830381600087803b1580156113ac57600080fd5b505af11580156113c0573d6000803e3d6000fd5b505050505b505050949350505050565b604080518082018252601981527f7472616e7366657228616464726573732c75696e743235362900000000000000602091820152815173ffffffffffffffffffffffffffffffffffffffff85811660248301526044808301869052845180840390910181526064909201845291810180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167fa9059cbb00000000000000000000000000000000000000000000000000000000179052915160009283928716916114979190611a2f565b6000604051808303816000865af19150503d80600081146114d4576040519150601f19603f3d011682016040523d82523d6000602084013e6114d9565b606091505b509150915081158061150757508051158015906115075750808060200190518101906115059190611986565b155b1561153e576040517f90b8ec1800000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5050505050565b600080611554856103e5611af5565b905060006115628483611af5565b9050600082611573876103e8611af5565b61157d9190611add565b90506115898183611b32565b979650505050505050565b73ffffffffffffffffffffffffffffffffffffffff811681146115b657600080fd5b50565b6000602082840312156115cb57600080fd5b81356115d681611594565b9392505050565b60008083601f8401126115ef57600080fd5b50813567ffffffffffffffff81111561160757600080fd5b6020830191508360208260051b850101111561162257600080fd5b9250929050565b6000806000806000806000806080898b03121561164557600080fd5b883567ffffffffffffffff8082111561165d57600080fd5b6116698c838d016115dd565b909a50985060208b013591508082111561168257600080fd5b61168e8c838d016115dd565b909850965060408b01359150808211156116a757600080fd5b6116b38c838d016115dd565b909650945060608b01359150808211156116cc57600080fd5b506116d98b828c016115dd565b999c989b5096995094979396929594505050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b60008060006060848603121561173157600080fd5b833561173c81611594565b925060208401359150604084013567ffffffffffffffff8082111561176057600080fd5b818601915086601f83011261177457600080fd5b813581811115611786576117866116ed565b604051601f82017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0908116603f011681019083821181831017156117cc576117cc6116ed565b816040528281528960208487010111156117e557600080fd5b8260208601602083013760006020848301015280955050505050509250925092565b6000806040838503121561181a57600080fd5b823561182581611594565b9150602083013561183581611594565b809150509250929050565b6000806000806000806060878903121561185957600080fd5b863567ffffffffffffffff8082111561187157600080fd5b61187d8a838b016115dd565b9098509650602089013591508082111561189657600080fd5b6118a28a838b016115dd565b909650945060408901359150808211156118bb57600080fd5b506118c889828a016115dd565b979a9699509497509295939492505050565b6000806000606084860312156118ef57600080fd5b83356118fa81611594565b9250602084013561190a81611594565b929592945050506040919091013590565b80151581146115b657600080fd5b6000806040838503121561193c57600080fd5b823561194781611594565b915060208301356118358161191b565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b60006020828403121561199857600080fd5b81516115d68161191b565b600080604083850312156119b657600080fd5b505080516020909101519092909150565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b60007fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff821415611a2857611a286119c7565b5060010190565b6000825160005b81811015611a505760208186018101518583015201611a36565b81811115611a5f576000828501525b509190910192915050565b80516dffffffffffffffffffffffffffff81168114611a8857600080fd5b919050565b600080600060608486031215611aa257600080fd5b611aab84611a6a565b9250611ab960208501611a6a565b9150604084015163ffffffff81168114611ad257600080fd5b809150509250925092565b60008219821115611af057611af06119c7565b500190565b6000817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0483118215151615611b2d57611b2d6119c7565b500290565b600082611b68577f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b50049056fea2646970667358221220822f210a7504114693c5861ca20fdc857719a6e6246b16c6612d519a3ad370fb64736f6c634300080a003300000000000000000000000058b4b6951e9174f153635574076241315d7d350300000000000000000000000010025a49f69ba9445e9b81d0003b235ee629115f000000000000000000000000c35dadb65012ec5796536bd9864ed8773abc74c400000000000000000000000082af49447d8a07e3bd95bd0d56f35241523fbab1

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

00000000000000000000000058b4b6951e9174f153635574076241315d7d350300000000000000000000000010025a49f69ba9445e9b81d0003b235ee629115f000000000000000000000000c35dadb65012ec5796536bd9864ed8773abc74c400000000000000000000000082af49447d8a07e3bd95bd0d56f35241523fbab1

-----Decoded View---------------
Arg [0] : owner (address): 0x58b4b6951e9174f153635574076241315d7d3503
Arg [1] : user (address): 0x10025a49f69ba9445e9b81d0003b235ee629115f
Arg [2] : factory (address): 0xc35dadb65012ec5796536bd9864ed8773abc74c4
Arg [3] : _weth (address): 0x82af49447d8a07e3bd95bd0d56f35241523fbab1

-----Encoded View---------------
4 Constructor Arguments found :
Arg [0] : 00000000000000000000000058b4b6951e9174f153635574076241315d7d3503
Arg [1] : 00000000000000000000000010025a49f69ba9445e9b81d0003b235ee629115f
Arg [2] : 000000000000000000000000c35dadb65012ec5796536bd9864ed8773abc74c4
Arg [3] : 00000000000000000000000082af49447d8a07e3bd95bd0d56f35241523fbab1


Block Transaction Gas Used Reward
Age Block Fee Address BC Fee Address Voting Power Jailed Incoming
Block Uncle Number Difficulty Gas Used Reward
Loading
Loading
Make sure to use the "Vote Down" button for any spammy posts, and the "Vote Up" for interesting conversations.