Contract 0xa19b3b22f29e23e4c04678c94cfc3e8f202137d8 5

 

Contract Overview

Balance:
0 ETH

ETH Value:
$0.00

Token:
Txn Hash Method
Block
From
To
Value [Txn Fee]
0xf3947df99b164c6bbe6be64eb455398f2d0ffc8ee23f83d6b9c092f5a4383b1cUnwind Pairs285455412022-10-05 16:33:3114 hrs 21 mins ago0x4bb4c1b0745ef7b4642feeccd0740dec417ca0a0 IN  0xa19b3b22f29e23e4c04678c94cfc3e8f202137d80 ETH0.00022642
0x1f2675c3e439dfe9675bc972612f01789bed5d12f8a36872d9fc4421b7da246eUnwind Pairs285455042022-10-05 16:33:1114 hrs 22 mins ago0x4bb4c1b0745ef7b4642feeccd0740dec417ca0a0 IN  0xa19b3b22f29e23e4c04678c94cfc3e8f202137d80 ETH0.00025246
0xca1a8b62bed35190bb212f73f4cc6fd04765de46ad5c501cb7ce0eb31359b345Unwind Pairs285454812022-10-05 16:32:5114 hrs 22 mins ago0x4bb4c1b0745ef7b4642feeccd0740dec417ca0a0 IN  0xa19b3b22f29e23e4c04678c94cfc3e8f202137d80 ETH0.00022748
0xab12a8548abaaa5c44e08af692a609b1ac217cf23520ae35f8ea2131a5c0d3ddUnwind Pairs285454522022-10-05 16:32:2714 hrs 22 mins ago0x4bb4c1b0745ef7b4642feeccd0740dec417ca0a0 IN  0xa19b3b22f29e23e4c04678c94cfc3e8f202137d80 ETH0.00013106
0xaea5f5952df2a722b3cc87c5bfc0dd74d3cd7d350eeb9c97422c6825bbcb71baUnwind Pairs250444032022-09-17 19:13:5218 days 11 hrs ago0x4bb4c1b0745ef7b4642feeccd0740dec417ca0a0 IN  0xa19b3b22f29e23e4c04678c94cfc3e8f202137d80 ETH0.00005362
0x3acee63565612d47bd08ffb6d3ab84931e536d591afb975cef517851e2df3502Unwind Pairs250443582022-09-17 19:13:3118 days 11 hrs ago0x4bb4c1b0745ef7b4642feeccd0740dec417ca0a0 IN  0xa19b3b22f29e23e4c04678c94cfc3e8f202137d80 ETH0.00005601
0x0ff8e0948da60c5c47241e30c3f7376cac8e0524c75eee1b117d094571aa564dBuy Weth250443402022-09-17 19:13:0918 days 11 hrs ago0x4bb4c1b0745ef7b4642feeccd0740dec417ca0a0 IN  0xa19b3b22f29e23e4c04678c94cfc3e8f202137d80 ETH0.00004566
0xc34b149db5f89a9ea1be1835c95cbd3911e379eef4dbaa6d7e51ac319c9da95dBuy Weth250443152022-09-17 19:12:5018 days 11 hrs ago0x4bb4c1b0745ef7b4642feeccd0740dec417ca0a0 IN  0xa19b3b22f29e23e4c04678c94cfc3e8f202137d80 ETH0.00004609
0xfe1594c767912870bbd8dd90663d6aacbc9a9385460a68791fac9be806434ff5Unwind Pairs250442612022-09-17 19:12:1218 days 11 hrs ago0x4bb4c1b0745ef7b4642feeccd0740dec417ca0a0 IN  0xa19b3b22f29e23e4c04678c94cfc3e8f202137d80 ETH0.00005536
0xc20c480b68a79fad1ba4ba786e13d914eba62f56948986b2edfd2e169c36bb02Unwind Pairs250442182022-09-17 19:11:4218 days 11 hrs ago0x4bb4c1b0745ef7b4642feeccd0740dec417ca0a0 IN  0xa19b3b22f29e23e4c04678c94cfc3e8f202137d80 ETH0.00006949
0xe3b961ae8c767d8f5020c4213335ec5e05bc6be44b79cc1d20c1f1ec950bdf1eUnwind Pairs250441912022-09-17 19:11:1918 days 11 hrs ago0x4bb4c1b0745ef7b4642feeccd0740dec417ca0a0 IN  0xa19b3b22f29e23e4c04678c94cfc3e8f202137d80 ETH0.00005222
0x554e63041127ab0d2a12ee0489eed053cead9cc2360428ca6cb3901cee99c5e2Unwind Pairs250441722022-09-17 19:11:0118 days 11 hrs ago0x4bb4c1b0745ef7b4642feeccd0740dec417ca0a0 IN  0xa19b3b22f29e23e4c04678c94cfc3e8f202137d80 ETH0.00005352
0xa5cf9dce0d08500850c3e582680ff58e152d23efbb2ace55ca2e579a3a94323cUnwind Pairs250441522022-09-17 19:10:4418 days 11 hrs ago0x4bb4c1b0745ef7b4642feeccd0740dec417ca0a0 IN  0xa19b3b22f29e23e4c04678c94cfc3e8f202137d80 ETH0.00005589
0x2332f6a409d867db67f70f6ffd023f67d62b60d7c7b5c9773c48380cbef2d2f8Unwind Pairs250441222022-09-17 19:10:1918 days 11 hrs ago0x4bb4c1b0745ef7b4642feeccd0740dec417ca0a0 IN  0xa19b3b22f29e23e4c04678c94cfc3e8f202137d80 ETH0.00005456
0xac3c9577082c766baa3ce972f88f166e52b5a5b8666002fa5999025007d18d87Unwind Pairs250440892022-09-17 19:09:5318 days 11 hrs ago0x4bb4c1b0745ef7b4642feeccd0740dec417ca0a0 IN  0xa19b3b22f29e23e4c04678c94cfc3e8f202137d80 ETH0.00007056
0xa031ed1421476d11e9ea816564b1ddac42c3616e9eebf17711b23627dc2f4399Unwind Pairs250440672022-09-17 19:09:3718 days 11 hrs ago0x4bb4c1b0745ef7b4642feeccd0740dec417ca0a0 IN  0xa19b3b22f29e23e4c04678c94cfc3e8f202137d80 ETH0.00006692
0x89c3a0183e53ae41d2792f587a1396738bb5e66c91ee52ecc297c19633d6ac81Unwind Pairs250440402022-09-17 19:09:2418 days 11 hrs ago0x4bb4c1b0745ef7b4642feeccd0740dec417ca0a0 IN  0xa19b3b22f29e23e4c04678c94cfc3e8f202137d80 ETH0.00006712
0x3454d329455db070adb5004de8aae3ae70af7a53e042c4ce3de10b8fc1df9714Unwind Pairs250440142022-09-17 19:09:0818 days 11 hrs ago0x4bb4c1b0745ef7b4642feeccd0740dec417ca0a0 IN  0xa19b3b22f29e23e4c04678c94cfc3e8f202137d80 ETH0.00006979
0x4ce190864917a9788b920461c966d3094e8036bcbfb977e794a6d7e9d2f4dcbdUnwind Pairs250439962022-09-17 19:08:5818 days 11 hrs ago0x4bb4c1b0745ef7b4642feeccd0740dec417ca0a0 IN  0xa19b3b22f29e23e4c04678c94cfc3e8f202137d80 ETH0.00005497
0x4979490628d64361270dca72604109f809fda2882847a4ad96a60a52a805f7c1Unwind Pairs250439412022-09-17 19:08:2618 days 11 hrs ago0x4bb4c1b0745ef7b4642feeccd0740dec417ca0a0 IN  0xa19b3b22f29e23e4c04678c94cfc3e8f202137d80 ETH0.00005753
0x93d473a326d6b0e1a06433286fe84e98d7e86f17c31656feafd4c54cdf1c278dUnwind Pairs250438952022-09-17 19:08:0418 days 11 hrs ago0x4bb4c1b0745ef7b4642feeccd0740dec417ca0a0 IN  0xa19b3b22f29e23e4c04678c94cfc3e8f202137d80 ETH0.00007411
0x45a0c3074cac337f1d108bdc37c565087d792589efa0dd7b0674bb8b924e1577Unwind Pairs250438332022-09-17 19:07:3018 days 11 hrs ago0x4bb4c1b0745ef7b4642feeccd0740dec417ca0a0 IN  0xa19b3b22f29e23e4c04678c94cfc3e8f202137d80 ETH0.00007747
0xe7be068e1e5258e4e847431b97e4c6c058df86e3aa449ac9027a110e260f0745Unwind Pairs250438132022-09-17 19:07:1318 days 11 hrs ago0x4bb4c1b0745ef7b4642feeccd0740dec417ca0a0 IN  0xa19b3b22f29e23e4c04678c94cfc3e8f202137d80 ETH0.00007887
0x03d0e1f86555336503486bbc2712f69aa1fef90fcc5ce081451493e7841a7d23Unwind Pairs250437672022-09-17 19:06:4018 days 11 hrs ago0x4bb4c1b0745ef7b4642feeccd0740dec417ca0a0 IN  0xa19b3b22f29e23e4c04678c94cfc3e8f202137d80 ETH0.00005486
0x7ca56386bd15c3e19828b814be744c41c990d6af4dc6788fb7405288d5acf19eUnwind Pairs250437462022-09-17 19:06:1918 days 11 hrs ago0x4bb4c1b0745ef7b4642feeccd0740dec417ca0a0 IN  0xa19b3b22f29e23e4c04678c94cfc3e8f202137d80 ETH0.00007174
[ Download CSV Export 
Latest 25 internal transaction
Parent Txn Hash Block From To Value
0xf3947df99b164c6bbe6be64eb455398f2d0ffc8ee23f83d6b9c092f5a4383b1c285455412022-10-05 16:33:3114 hrs 21 mins ago 0xa19b3b22f29e23e4c04678c94cfc3e8f202137d80x3221022e37029923ace4235d812273c5a42c322d0 ETH
0xf3947df99b164c6bbe6be64eb455398f2d0ffc8ee23f83d6b9c092f5a4383b1c285455412022-10-05 16:33:3114 hrs 21 mins ago 0xa19b3b22f29e23e4c04678c94cfc3e8f202137d80xd4d42f0b6def4ce0383636770ef773390d85c61a0 ETH
0xf3947df99b164c6bbe6be64eb455398f2d0ffc8ee23f83d6b9c092f5a4383b1c285455412022-10-05 16:33:3114 hrs 21 mins ago 0xa19b3b22f29e23e4c04678c94cfc3e8f202137d80x3221022e37029923ace4235d812273c5a42c322d0 ETH
0xf3947df99b164c6bbe6be64eb455398f2d0ffc8ee23f83d6b9c092f5a4383b1c285455412022-10-05 16:33:3114 hrs 21 mins ago 0xa19b3b22f29e23e4c04678c94cfc3e8f202137d80x3221022e37029923ace4235d812273c5a42c322d0 ETH
0xf3947df99b164c6bbe6be64eb455398f2d0ffc8ee23f83d6b9c092f5a4383b1c285455412022-10-05 16:33:3114 hrs 21 mins ago 0xa19b3b22f29e23e4c04678c94cfc3e8f202137d80x3221022e37029923ace4235d812273c5a42c322d0 ETH
0xf3947df99b164c6bbe6be64eb455398f2d0ffc8ee23f83d6b9c092f5a4383b1c285455412022-10-05 16:33:3114 hrs 21 mins ago 0xa19b3b22f29e23e4c04678c94cfc3e8f202137d80x515e252b2b5c22b4b2b6df66c2ebeea871aa4d690 ETH
0xf3947df99b164c6bbe6be64eb455398f2d0ffc8ee23f83d6b9c092f5a4383b1c285455412022-10-05 16:33:3114 hrs 21 mins ago 0xa19b3b22f29e23e4c04678c94cfc3e8f202137d80x2f2a2543b76a4166549f7aab2e75bef0aefc5b0f0 ETH
0xf3947df99b164c6bbe6be64eb455398f2d0ffc8ee23f83d6b9c092f5a4383b1c285455412022-10-05 16:33:3114 hrs 21 mins ago 0xa19b3b22f29e23e4c04678c94cfc3e8f202137d80x515e252b2b5c22b4b2b6df66c2ebeea871aa4d690 ETH
0xf3947df99b164c6bbe6be64eb455398f2d0ffc8ee23f83d6b9c092f5a4383b1c285455412022-10-05 16:33:3114 hrs 21 mins ago 0xa19b3b22f29e23e4c04678c94cfc3e8f202137d80x515e252b2b5c22b4b2b6df66c2ebeea871aa4d690 ETH
0xf3947df99b164c6bbe6be64eb455398f2d0ffc8ee23f83d6b9c092f5a4383b1c285455412022-10-05 16:33:3114 hrs 21 mins ago 0xa19b3b22f29e23e4c04678c94cfc3e8f202137d80x515e252b2b5c22b4b2b6df66c2ebeea871aa4d690 ETH
0xf3947df99b164c6bbe6be64eb455398f2d0ffc8ee23f83d6b9c092f5a4383b1c285455412022-10-05 16:33:3114 hrs 21 mins ago 0xa19b3b22f29e23e4c04678c94cfc3e8f202137d80xcb0e5bfa72bbb4d16ab5aa0c60601c438f04b4ad0 ETH
0xf3947df99b164c6bbe6be64eb455398f2d0ffc8ee23f83d6b9c092f5a4383b1c285455412022-10-05 16:33:3114 hrs 21 mins ago 0xa19b3b22f29e23e4c04678c94cfc3e8f202137d8 0xfd086bc7cd5c481dcc9c85ebe478a1c0b69fcbb90 ETH
0xf3947df99b164c6bbe6be64eb455398f2d0ffc8ee23f83d6b9c092f5a4383b1c285455412022-10-05 16:33:3114 hrs 21 mins ago 0xa19b3b22f29e23e4c04678c94cfc3e8f202137d80xcb0e5bfa72bbb4d16ab5aa0c60601c438f04b4ad0 ETH
0xf3947df99b164c6bbe6be64eb455398f2d0ffc8ee23f83d6b9c092f5a4383b1c285455412022-10-05 16:33:3114 hrs 21 mins ago 0xa19b3b22f29e23e4c04678c94cfc3e8f202137d80xcb0e5bfa72bbb4d16ab5aa0c60601c438f04b4ad0 ETH
0xf3947df99b164c6bbe6be64eb455398f2d0ffc8ee23f83d6b9c092f5a4383b1c285455412022-10-05 16:33:3114 hrs 21 mins ago 0xa19b3b22f29e23e4c04678c94cfc3e8f202137d80xcb0e5bfa72bbb4d16ab5aa0c60601c438f04b4ad0 ETH
0xf3947df99b164c6bbe6be64eb455398f2d0ffc8ee23f83d6b9c092f5a4383b1c285455412022-10-05 16:33:3114 hrs 21 mins ago 0xa19b3b22f29e23e4c04678c94cfc3e8f202137d8 0x24704aff49645d32655a76df6d407e02d146dafc0 ETH
0xf3947df99b164c6bbe6be64eb455398f2d0ffc8ee23f83d6b9c092f5a4383b1c285455412022-10-05 16:33:3114 hrs 21 mins ago 0xa19b3b22f29e23e4c04678c94cfc3e8f202137d8 Radiant: RDNT Token0 ETH
0xf3947df99b164c6bbe6be64eb455398f2d0ffc8ee23f83d6b9c092f5a4383b1c285455412022-10-05 16:33:3114 hrs 21 mins ago 0xa19b3b22f29e23e4c04678c94cfc3e8f202137d8 0x24704aff49645d32655a76df6d407e02d146dafc0 ETH
0xf3947df99b164c6bbe6be64eb455398f2d0ffc8ee23f83d6b9c092f5a4383b1c285455412022-10-05 16:33:3114 hrs 21 mins ago 0xa19b3b22f29e23e4c04678c94cfc3e8f202137d8 0x24704aff49645d32655a76df6d407e02d146dafc0 ETH
0xf3947df99b164c6bbe6be64eb455398f2d0ffc8ee23f83d6b9c092f5a4383b1c285455412022-10-05 16:33:3114 hrs 21 mins ago 0xa19b3b22f29e23e4c04678c94cfc3e8f202137d8 0x24704aff49645d32655a76df6d407e02d146dafc0 ETH
0x1f2675c3e439dfe9675bc972612f01789bed5d12f8a36872d9fc4421b7da246e285455042022-10-05 16:33:1114 hrs 22 mins ago 0xa19b3b22f29e23e4c04678c94cfc3e8f202137d80x692a0b300366d1042679397e40f3d2cb4b8f7d300 ETH
0x1f2675c3e439dfe9675bc972612f01789bed5d12f8a36872d9fc4421b7da246e285455042022-10-05 16:33:1114 hrs 22 mins ago 0xa19b3b22f29e23e4c04678c94cfc3e8f202137d8 0xda10009cbd5d07dd0cecc66161fc93d7c9000da10 ETH
0x1f2675c3e439dfe9675bc972612f01789bed5d12f8a36872d9fc4421b7da246e285455042022-10-05 16:33:1114 hrs 22 mins ago 0xa19b3b22f29e23e4c04678c94cfc3e8f202137d80x692a0b300366d1042679397e40f3d2cb4b8f7d300 ETH
0x1f2675c3e439dfe9675bc972612f01789bed5d12f8a36872d9fc4421b7da246e285455042022-10-05 16:33:1114 hrs 22 mins ago 0xa19b3b22f29e23e4c04678c94cfc3e8f202137d80x692a0b300366d1042679397e40f3d2cb4b8f7d300 ETH
0x1f2675c3e439dfe9675bc972612f01789bed5d12f8a36872d9fc4421b7da246e285455042022-10-05 16:33:1114 hrs 22 mins ago 0xa19b3b22f29e23e4c04678c94cfc3e8f202137d80x692a0b300366d1042679397e40f3d2cb4b8f7d300 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
Make sure to use the "Vote Down" button for any spammy posts, and the "Vote Up" for interesting conversations.