Contract 0x235Fda2564977c0158EE084f9B5c50a59Bf1656f 1

 
 
Txn Hash
Method
Block
From
To
Value
0x98786a2ebbdf6702c2040a6775fb44bd87459f635f82afadb3f7db3b8d39fa9fAffilliate Withd...129005972021-07-26 7:50:40428 days 12 hrs agoENS Name doohick.eth IN  0x235fda2564977c0158ee084f9b5c50a59bf1656f0 Ether0.0010814827
0xe9dbd6ef3eee2d500c4988b5358e8f97b1c1e4e0743c561c020fc4a047b1d687Renounce Ownersh...126569072021-06-18 6:40:58466 days 13 hrs ago0xa0863436913b1b439ccaa6fbf89408116c1dde29 IN  0x235fda2564977c0158ee084f9b5c50a59bf1656f0 Ether0.0004488316
0xfeb900adeb9507f029bd13fc4b1e5e063355cea38c16c6a938a62294f8b16d53Zap Out With Per...126049392021-06-10 5:46:33474 days 14 hrs ago0x301150fe2af68dedfc94e0fb665435921177eff8 IN  0x235fda2564977c0158ee084f9b5c50a59bf1656f0 Ether0.000440539
0x8f6a93267e9f1503f064517e6a38eb21bb58bd0933be705366b11a9b6cb6ed83Toggle Contract ...126034452021-06-10 0:03:06474 days 20 hrs ago0xa0863436913b1b439ccaa6fbf89408116c1dde29 IN  0x235fda2564977c0158ee084f9b5c50a59bf1656f0 Ether0.0003973315
0x274aac26de48deab2f9a8a1772c5fc0edc3bc3f0a6175d529dc3305a5c82c82eZap Out126031852021-06-09 23:06:41474 days 21 hrs ago0xdc2462fb375bde1454017293eace4df1a58f57e0 IN  0x235fda2564977c0158ee084f9b5c50a59bf1656f0 Ether0.0076417812.11
0x275a215a5ca014264fe1688c55fab6ca4274ffa2429b483ca5b7378dc4d1940aZap Out With Per...126030092021-06-09 22:29:36474 days 21 hrs ago0xd9df9bb5ea3051733a1c29a4b8ff130502ed9efe IN  0x235fda2564977c0158ee084f9b5c50a59bf1656f0 Ether0.0078791417
0xc40bd830bceca4dbb88cf9ceb02e9f4e1fc2c5293f884fd540cd7ebcad3cf2aaZap Out126029352021-06-09 22:13:09474 days 22 hrs agoENS Name nikola.eth IN  0x235fda2564977c0158ee084f9b5c50a59bf1656f0 Ether0.005011614
0x705c0f97ba83bcdc2585721e56ce2d07dd2c960f30808275be812571a63fa49cZap Out With Per...126024822021-06-09 20:30:56474 days 23 hrs agoENS Name forkedlogic.eth IN  0x235fda2564977c0158ee084f9b5c50a59bf1656f0 Ether0.00786717
0x6299aa6c8a4d6a9f882cdc8d4b056b579cb6e3718d0452457770dac110e3511bZap Out126024782021-06-09 20:30:11474 days 23 hrs ago0x2bc9dfc10e7035864412bb0c602d8449da48226a IN  0x235fda2564977c0158ee084f9b5c50a59bf1656f0 Ether0.007438821
0x22511f7e2eb48ed7938ce3a9e15a181c8505772021f09e106d2eee40d409f952Zap Out With Per...126024262021-06-09 20:19:11474 days 23 hrs ago0x776bc79274d03546050062ecc6d52a82d8c10282 IN  0x235fda2564977c0158ee084f9b5c50a59bf1656f0 Ether0.0132027630
0xc0e6a1764ac3e82e404f48c3a22bebe23b599064af5b5f3910262d991176dfddZap Out2Pair Tok...126024242021-06-09 20:17:04474 days 23 hrs ago0xf53cab0c6f25f48f985d1e2c40e03fc7c1963364 IN  0x235fda2564977c0158ee084f9b5c50a59bf1656f0 Ether0.0055888521
0xd8d3741935b8c9ae20c8898fa3595e54f027e35566a1e48fac690710e6532c30Zap Out With Per...126024192021-06-09 20:16:06475 days ago0xf53cab0c6f25f48f985d1e2c40e03fc7c1963364 IN  0x235fda2564977c0158ee084f9b5c50a59bf1656f0 Ether0.0091465515
0x14d21dbe966abfaaa2492948c4504a8732c65abab5de5036136bf0440ce286ceZap Out126021752021-06-09 19:26:16475 days 50 mins ago0xaed0577301dfb0df8dad5ebb65c3895d59708c3f IN  0x235fda2564977c0158ee084f9b5c50a59bf1656f0 Ether0.0086929424
0x56492362620f146d8d8363011c8008251d2f79acfa32728d583e92e4cc83969aZap Out2Pair Tok...126021352021-06-09 19:16:49475 days 1 hr ago0x7530c8b86b2e6f0c71b1b9a105a31bc15183c179 IN  0x235fda2564977c0158ee084f9b5c50a59bf1656f0 Ether0.0063650128
0x68d5f61d75f225b76832b0b5091e6cd67f087e2083f884dcaac933b4400d08eeZap Out With Per...126020652021-06-09 18:59:36475 days 1 hr agoENS Name faderaudi.eth IN  0x235fda2564977c0158ee084f9b5c50a59bf1656f0 Ether0.0102138321.9
0x52b648d5cac2cf579a6b468e25c411a124d07076df99bcfd70dcf16d8f3c2dadZap Out126020512021-06-09 18:56:22475 days 1 hr ago0xaed0577301dfb0df8dad5ebb65c3895d59708c3f IN  0x235fda2564977c0158ee084f9b5c50a59bf1656f0 Ether0.0063754718
0x0882ae56c6e8b699e9a8f4c1eee4b3d675ca28ee716ae37b5ac156800a7e756dZap Out2Pair Tok...126020222021-06-09 18:50:16475 days 1 hr ago0x91701e0da66fdbc8eac9d3c8bbcf36b85deb1232 IN  0x235fda2564977c0158ee084f9b5c50a59bf1656f0 Ether0.0031457215
0xa8168c32ad6be6bf53e7cda63546e3c98d02d6ecbbe7f849fba22ed7e09119ccZap Out2Pair Tok...126014902021-06-09 16:52:42475 days 3 hrs agoENS Name dloftus.eth IN  0x235fda2564977c0158ee084f9b5c50a59bf1656f0 Ether0.0095144646.15
0x34a7caee7cb5aae460c763fe97c1f74d4c2fed2a8d8b9b687b9008a6be069444Zap Out126014112021-06-09 16:34:03475 days 3 hrs agoENS Name lolicon.eth IN  0x235fda2564977c0158ee084f9b5c50a59bf1656f0 Ether0.0137275739
0xf4f50f76efc76b496cac707b424c9b0632378c4a88eb9d95e58fdeb1dcbb49b4Zap Out With Per...126012772021-06-09 16:06:04475 days 4 hrs agoENS Name askmarion.eth IN  0x235fda2564977c0158ee084f9b5c50a59bf1656f0 Ether0.0182129640
0x9b4ce795ce9cd3b4cfeb65096cba785f8d6a7f3fe74fdd0d6c8d9f587ad5aadcZap Out With Per...126008742021-06-09 14:32:22475 days 5 hrs agoENS Name bernardjambon.eth IN  0x235fda2564977c0158ee084f9b5c50a59bf1656f0 Ether0.0049161212
0xabc277e8e751c8cb7cc8ca1551676a2ccbd71b041a31d47c97a4493b6fb8a43cZap Out With Per...126007022021-06-09 13:57:33475 days 6 hrs ago0xb1606b66f4ce54e1fdea708ace79a1787aa9c5a7 IN  0x235fda2564977c0158ee084f9b5c50a59bf1656f0 Ether0.0113942124.9
0x63630ce940b05ba19cc8031d1b6e358a4edf5b9bcbda5c2275ef740a954a6110Zap Out With Per...126006782021-06-09 13:52:34475 days 6 hrs ago0x31fca1d8410a2496e671d23618d6fe7df571e54b IN  0x235fda2564977c0158ee084f9b5c50a59bf1656f0 Ether0.0146913519
0x8c68dae9e5902aff52487b87a0cfc0e252e78be46207f94691e05fe805912551Zap Out126005962021-06-09 13:31:44475 days 6 hrs agoENS Name batmannetopyr.eth IN  0x235fda2564977c0158ee084f9b5c50a59bf1656f0 Ether0.009296225
0xef54ff2b801a91c98cd3eab98d56ad6080b8b9b60de8850fff8e7f2232cb2086Zap Out126003462021-06-09 12:33:46475 days 7 hrs ago0x5c8bd73c11f3c4d20af8393da38d99c096c06dcf IN  0x235fda2564977c0158ee084f9b5c50a59bf1656f0 Ether0.00952725
[ Download CSV Export 
Latest 25 internal transaction
Parent Txn Hash Block From To Value
0x275a215a5ca014264fe1688c55fab6ca4274ffa2429b483ca5b7378dc4d1940a126030092021-06-09 22:29:36474 days 21 hrs ago 0x235fda2564977c0158ee084f9b5c50a59bf1656f0xd9df9bb5ea3051733a1c29a4b8ff130502ed9efe0.13147998 Ether
0x275a215a5ca014264fe1688c55fab6ca4274ffa2429b483ca5b7378dc4d1940a126030092021-06-09 22:29:36474 days 21 hrs ago 0x: Exchange Proxy Flash Wallet 0x235fda2564977c0158ee084f9b5c50a59bf1656f0.06617404 Ether
0x275a215a5ca014264fe1688c55fab6ca4274ffa2429b483ca5b7378dc4d1940a126030092021-06-09 22:29:36474 days 21 hrs ago Wrapped Ether 0x235fda2564977c0158ee084f9b5c50a59bf1656f0.06530594 Ether
0xc40bd830bceca4dbb88cf9ceb02e9f4e1fc2c5293f884fd540cd7ebcad3cf2aa126029352021-06-09 22:13:09474 days 22 hrs ago 0x235fda2564977c0158ee084f9b5c50a59bf1656fENS Name nikola.eth1.02648102 Ether
0xc40bd830bceca4dbb88cf9ceb02e9f4e1fc2c5293f884fd540cd7ebcad3cf2aa126029352021-06-09 22:13:09474 days 22 hrs ago 0x: Exchange Proxy Flash Wallet 0x235fda2564977c0158ee084f9b5c50a59bf1656f0.51242349 Ether
0xc40bd830bceca4dbb88cf9ceb02e9f4e1fc2c5293f884fd540cd7ebcad3cf2aa126029352021-06-09 22:13:09474 days 22 hrs ago Wrapped Ether 0x235fda2564977c0158ee084f9b5c50a59bf1656f0.51405752 Ether
0x705c0f97ba83bcdc2585721e56ce2d07dd2c960f30808275be812571a63fa49c126024822021-06-09 20:30:56474 days 23 hrs ago 0x235fda2564977c0158ee084f9b5c50a59bf1656fENS Name forkedlogic.eth1.12067831 Ether
0x705c0f97ba83bcdc2585721e56ce2d07dd2c960f30808275be812571a63fa49c126024822021-06-09 20:30:56474 days 23 hrs ago 0x: Exchange Proxy Flash Wallet 0x235fda2564977c0158ee084f9b5c50a59bf1656f0.56212656 Ether
0x705c0f97ba83bcdc2585721e56ce2d07dd2c960f30808275be812571a63fa49c126024822021-06-09 20:30:56474 days 23 hrs ago Wrapped Ether 0x235fda2564977c0158ee084f9b5c50a59bf1656f0.55855174 Ether
0x6299aa6c8a4d6a9f882cdc8d4b056b579cb6e3718d0452457770dac110e3511b126024782021-06-09 20:30:11474 days 23 hrs ago 0x235fda2564977c0158ee084f9b5c50a59bf1656f0x2bc9dfc10e7035864412bb0c602d8449da48226a1.34794452 Ether
0x6299aa6c8a4d6a9f882cdc8d4b056b579cb6e3718d0452457770dac110e3511b126024782021-06-09 20:30:11474 days 23 hrs ago 0x: Exchange Proxy Flash Wallet 0x235fda2564977c0158ee084f9b5c50a59bf1656f0.67295534 Ether
0x6299aa6c8a4d6a9f882cdc8d4b056b579cb6e3718d0452457770dac110e3511b126024782021-06-09 20:30:11474 days 23 hrs ago Wrapped Ether 0x235fda2564977c0158ee084f9b5c50a59bf1656f0.67498917 Ether
0xc0e6a1764ac3e82e404f48c3a22bebe23b599064af5b5f3910262d991176dfdd126024242021-06-09 20:17:04474 days 23 hrs ago 0x235fda2564977c0158ee084f9b5c50a59bf1656f0xf53cab0c6f25f48f985d1e2c40e03fc7c19633640.5029678 Ether
0xc0e6a1764ac3e82e404f48c3a22bebe23b599064af5b5f3910262d991176dfdd126024242021-06-09 20:17:04474 days 23 hrs ago SushiSwap: Router 0x235fda2564977c0158ee084f9b5c50a59bf1656f0.5029678 Ether
0xd8d3741935b8c9ae20c8898fa3595e54f027e35566a1e48fac690710e6532c30126024192021-06-09 20:16:06475 days ago 0x: Exchange Proxy Flash Wallet 0x235fda2564977c0158ee084f9b5c50a59bf1656f0.50312175 Ether
0x14d21dbe966abfaaa2492948c4504a8732c65abab5de5036136bf0440ce286ce126021752021-06-09 19:26:16475 days 50 mins ago 0x235fda2564977c0158ee084f9b5c50a59bf1656f0xaed0577301dfb0df8dad5ebb65c3895d59708c3f0.0855911 Ether
0x14d21dbe966abfaaa2492948c4504a8732c65abab5de5036136bf0440ce286ce126021752021-06-09 19:26:16475 days 50 mins ago 0x: Exchange Proxy Flash Wallet 0x235fda2564977c0158ee084f9b5c50a59bf1656f0.04273124 Ether
0x14d21dbe966abfaaa2492948c4504a8732c65abab5de5036136bf0440ce286ce126021752021-06-09 19:26:16475 days 50 mins ago Wrapped Ether 0x235fda2564977c0158ee084f9b5c50a59bf1656f0.04285986 Ether
0x56492362620f146d8d8363011c8008251d2f79acfa32728d583e92e4cc83969a126021352021-06-09 19:16:49475 days 1 hr ago 0x235fda2564977c0158ee084f9b5c50a59bf1656f0x7530c8b86b2e6f0c71b1b9a105a31bc15183c1795.37169625 Ether
0x56492362620f146d8d8363011c8008251d2f79acfa32728d583e92e4cc83969a126021352021-06-09 19:16:49475 days 1 hr ago SushiSwap: Router 0x235fda2564977c0158ee084f9b5c50a59bf1656f5.37169625 Ether
0x68d5f61d75f225b76832b0b5091e6cd67f087e2083f884dcaac933b4400d08ee126020652021-06-09 18:59:36475 days 1 hr ago 0x235fda2564977c0158ee084f9b5c50a59bf1656fENS Name faderaudi.eth0.49489248 Ether
0x68d5f61d75f225b76832b0b5091e6cd67f087e2083f884dcaac933b4400d08ee126020652021-06-09 18:59:36475 days 1 hr ago 0x: Exchange Proxy Flash Wallet 0x235fda2564977c0158ee084f9b5c50a59bf1656f0.2477317 Ether
0x68d5f61d75f225b76832b0b5091e6cd67f087e2083f884dcaac933b4400d08ee126020652021-06-09 18:59:36475 days 1 hr ago Wrapped Ether 0x235fda2564977c0158ee084f9b5c50a59bf1656f0.24716078 Ether
0x52b648d5cac2cf579a6b468e25c411a124d07076df99bcfd70dcf16d8f3c2dad126020512021-06-09 18:56:22475 days 1 hr ago 0x235fda2564977c0158ee084f9b5c50a59bf1656f0xaed0577301dfb0df8dad5ebb65c3895d59708c3f0.04036351 Ether
0x52b648d5cac2cf579a6b468e25c411a124d07076df99bcfd70dcf16d8f3c2dad126020512021-06-09 18:56:22475 days 1 hr ago 0x: Exchange Proxy Flash Wallet 0x235fda2564977c0158ee084f9b5c50a59bf1656f0.02015143 Ether
[ Download CSV Export 
Loading

Contract Source Code Verified (Exact Match)

Contract Name:
Sushiswap_ZapOut_General_V3

Compiler Version
v0.8.4+commit.c7e474f2

Optimization Enabled:
Yes with 200 runs

Other Settings:
default evmVersion, GNU GPLv2 license
File 1 of 8 : Sushiswap_ZapOut_General_V3.sol
// ███████╗░█████╗░██████╗░██████╗░███████╗██████╗░░░░███████╗██╗
// ╚════██║██╔══██╗██╔══██╗██╔══██╗██╔════╝██╔══██╗░░░██╔════╝██║
// ░░███╔═╝███████║██████╔╝██████╔╝█████╗░░██████╔╝░░░█████╗░░██║
// ██╔══╝░░██╔══██║██╔═══╝░██╔═══╝░██╔══╝░░██╔══██╗░░░██╔══╝░░██║
// ███████╗██║░░██║██║░░░░░██║░░░░░███████╗██║░░██║██╗██║░░░░░██║
// ╚══════╝╚═╝░░╚═╝╚═╝░░░░░╚═╝░░░░░╚══════╝╚═╝░░╚═╝╚═╝╚═╝░░░░░╚═╝
// Copyright (C) 2021 zapper

// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Affero General Public License as published by
// the Free Software Foundation, either version 2 of the License, or
// (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
// GNU Affero General Public License for more details.
//
// Visit <https://www.gnu.org/licenses/>for a copy of the GNU Affero General Public License

///@author Zapper
///@notice this contract implements one click removal of liquidity from Sushiswap pools, receiving ETH, ERC20 or both.
// SPDX-License-Identifier: GPL-2.0

pragma solidity ^0.8.0;
import "../_base/ZapOutBaseV3.sol";

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

interface IUniswapV2Router02 {
    function WETH() external pure returns (address);

    function removeLiquidity(
        address tokenA,
        address tokenB,
        uint256 liquidity,
        uint256 amountAMin,
        uint256 amountBMin,
        address to,
        uint256 deadline
    ) external returns (uint256 amountA, uint256 amountB);

    function removeLiquidityETH(
        address token,
        uint256 liquidity,
        uint256 amountTokenMin,
        uint256 amountETHMin,
        address to,
        uint256 deadline
    ) external returns (uint256 amountToken, uint256 amountETH);
}

interface IUniswapV2Pair {
    function token0() external pure returns (address);

    function token1() external pure returns (address);

    function balanceOf(address user) external view returns (uint256);

    function totalSupply() external view returns (uint256);

    function getReserves()
        external
        view
        returns (
            uint112 _reserve0,
            uint112 _reserve1,
            uint32 _blockTimestampLast
        );

    function permit(
        address owner,
        address spender,
        uint256 value,
        uint256 deadline,
        uint8 v,
        bytes32 r,
        bytes32 s
    ) external;
}

interface IWETH {
    function withdraw(uint256 wad) external;
}

contract Sushiswap_ZapOut_General_V3 is ZapOutBaseV3 {
    using SafeERC20 for IERC20;

    uint256 private constant deadline =
        0xf000000000000000000000000000000000000000000000000000000000000000;

    IUniswapV2Router02 private constant sushiswapRouter =
        IUniswapV2Router02(0xd9e1cE17f2641f24aE83637ab66a2cca9C378B9F);
    IUniswapV2Factory private constant sushiswapFactory =
        IUniswapV2Factory(0xC0AEe478e3658e2610c5F7A4A2E1777cE9e4f2Ac);

    address private constant wethTokenAddress =
        address(0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2);

    constructor(uint256 _goodwill, uint256 _affiliateSplit)
        ZapBaseV2(_goodwill, _affiliateSplit)
    {
        // 0x exchange
        approvedTargets[0xDef1C0ded9bec7F1a1670819833240f027b25EfF] = true;
    }

    event zapOut(
        address sender,
        address pool,
        address token,
        uint256 tokensRec
    );

    /**
        @notice Zap out in both tokens
        @param fromPoolAddress Pool from which to remove liquidity
        @param incomingLP Quantity of LP to remove from pool
        @param affiliate Affiliate address
        @return amountA Quantity of tokenA received after zapout
        @return amountB Quantity of tokenB received after zapout
    */
    function ZapOut2PairToken(
        address fromPoolAddress,
        uint256 incomingLP,
        address affiliate
    ) public stopInEmergency returns (uint256 amountA, uint256 amountB) {
        IUniswapV2Pair pair = IUniswapV2Pair(fromPoolAddress);

        require(address(pair) != address(0), "Pool Cannot be Zero Address");

        // get reserves
        address token0 = pair.token0();
        address token1 = pair.token1();

        IERC20(fromPoolAddress).safeTransferFrom(
            msg.sender,
            address(this),
            incomingLP
        );

        _approveToken(fromPoolAddress, address(sushiswapRouter), incomingLP);

        if (token0 == wethTokenAddress || token1 == wethTokenAddress) {
            address _token = token0 == wethTokenAddress ? token1 : token0;
            (amountA, amountB) = sushiswapRouter.removeLiquidityETH(
                _token,
                incomingLP,
                1,
                1,
                address(this),
                deadline
            );

            // subtract goodwill
            uint256 tokenGoodwill =
                _subtractGoodwill(_token, amountA, affiliate, true);
            uint256 ethGoodwill =
                _subtractGoodwill(ETHAddress, amountB, affiliate, true);

            // send tokens
            IERC20(_token).safeTransfer(msg.sender, amountA - tokenGoodwill);
            Address.sendValue(payable(msg.sender), amountB - ethGoodwill);
        } else {
            (amountA, amountB) = sushiswapRouter.removeLiquidity(
                token0,
                token1,
                incomingLP,
                1,
                1,
                address(this),
                deadline
            );

            // subtract goodwill
            uint256 tokenAGoodwill =
                _subtractGoodwill(token0, amountA, affiliate, true);
            uint256 tokenBGoodwill =
                _subtractGoodwill(token1, amountB, affiliate, true);

            // send tokens
            IERC20(token0).safeTransfer(msg.sender, amountA - tokenAGoodwill);
            IERC20(token1).safeTransfer(msg.sender, amountB - tokenBGoodwill);
        }
        emit zapOut(msg.sender, fromPoolAddress, token0, amountA);
        emit zapOut(msg.sender, fromPoolAddress, token1, amountB);
    }

    /**
    @notice Zap out in a single token
    @param toTokenAddress Address of desired token
    @param fromPoolAddress Pool from which to remove liquidity
    @param incomingLP Quantity of LP to remove from pool
    @param minTokensRec Minimum quantity of tokens to receive
    @param swapTargets Execution targets for swaps
    @param swapData DEX swap data
    @param affiliate Affiliate address
    @param shouldSellEntireBalance If True transfers entrire allowable amount from another contract
    */
    function ZapOut(
        address toTokenAddress,
        address fromPoolAddress,
        uint256 incomingLP,
        uint256 minTokensRec,
        address[] memory swapTargets,
        bytes[] memory swapData,
        address affiliate,
        bool shouldSellEntireBalance
    ) public stopInEmergency returns (uint256 tokensRec) {
        (uint256 amount0, uint256 amount1) =
            _removeLiquidity(
                fromPoolAddress,
                incomingLP,
                shouldSellEntireBalance
            );

        //swaps tokens to token
        tokensRec = _swapTokens(
            fromPoolAddress,
            amount0,
            amount1,
            toTokenAddress,
            swapTargets,
            swapData
        );
        require(tokensRec >= minTokensRec, "High Slippage");

        uint256 totalGoodwillPortion;

        // transfer toTokens to sender
        if (toTokenAddress == address(0)) {
            totalGoodwillPortion = _subtractGoodwill(
                ETHAddress,
                tokensRec,
                affiliate,
                true
            );

            payable(msg.sender).transfer(tokensRec - totalGoodwillPortion);
        } else {
            totalGoodwillPortion = _subtractGoodwill(
                toTokenAddress,
                tokensRec,
                affiliate,
                true
            );

            IERC20(toTokenAddress).safeTransfer(
                msg.sender,
                tokensRec - totalGoodwillPortion
            );
        }

        tokensRec = tokensRec - totalGoodwillPortion;

        emit zapOut(msg.sender, fromPoolAddress, toTokenAddress, tokensRec);

        return tokensRec;
    }

    /**
    @notice Zap out in both tokens with permit
    @param fromPoolAddress Pool from which to remove liquidity
    @param incomingLP Quantity of LP to remove from pool
    @param affiliate Affiliate address to share fees
    @param permitData Encoded permit data, which contains owner, spender, value, deadline, r,s,v values 
    @return amountA Quantity of tokenA received
    @return amountB Quantity of tokenB received
    */
    function ZapOut2PairTokenWithPermit(
        address fromPoolAddress,
        uint256 incomingLP,
        address affiliate,
        bytes calldata permitData
    ) external stopInEmergency returns (uint256 amountA, uint256 amountB) {
        // permit
        _validatePool(fromPoolAddress);
        (bool success, ) = fromPoolAddress.call(permitData);
        require(success, "Could Not Permit");

        (amountA, amountB) = ZapOut2PairToken(
            fromPoolAddress,
            incomingLP,
            affiliate
        );
    }

    /**
    @notice Zap out in a single token with permit
    @param toTokenAddress Address of desired token
    @param fromPoolAddress Pool from which to remove liquidity
    @param incomingLP Quantity of LP to remove from pool
    @param minTokensRec Minimum quantity of tokens to receive
    @param swapTargets Execution targets for swaps
    @param swapData DEX swap data
    @param affiliate Affiliate address
    */
    function ZapOutWithPermit(
        address toTokenAddress,
        address fromPoolAddress,
        uint256 incomingLP,
        uint256 minTokensRec,
        bytes memory permitData,
        address[] memory swapTargets,
        bytes[] memory swapData,
        address affiliate
    ) public stopInEmergency returns (uint256) {
        // permit
        _validatePool(fromPoolAddress);
        (bool success, ) = fromPoolAddress.call(permitData);
        require(success, "Could Not Permit");

        return (
            ZapOut(
                toTokenAddress,
                fromPoolAddress,
                incomingLP,
                minTokensRec,
                swapTargets,
                swapData,
                affiliate,
                false
            )
        );
    }

    function _validatePool(address poolAddress) internal view {
        IUniswapV2Pair pair = IUniswapV2Pair(poolAddress);
        address token0 = pair.token0();
        address token1 = pair.token1();

        address retrievedAddress = sushiswapFactory.getPair(token0, token1);

        require(retrievedAddress == poolAddress, "Invalid Pool Address");
    }

    function _removeLiquidity(
        address fromPoolAddress,
        uint256 incomingLP,
        bool shouldSellEntireBalance
    ) internal returns (uint256 amount0, uint256 amount1) {
        IUniswapV2Pair pair = IUniswapV2Pair(fromPoolAddress);

        require(address(pair) != address(0), "Pool Cannot be Zero Address");

        address token0 = pair.token0();
        address token1 = pair.token1();

        _pullTokens(fromPoolAddress, incomingLP, shouldSellEntireBalance);

        _approveToken(fromPoolAddress, address(sushiswapRouter), incomingLP);

        (amount0, amount1) = sushiswapRouter.removeLiquidity(
            token0,
            token1,
            incomingLP,
            1,
            1,
            address(this),
            deadline
        );
        require(amount0 > 0 && amount1 > 0, "Removed Insufficient Liquidity");
    }

    function _swapTokens(
        address fromPoolAddress,
        uint256 amount0,
        uint256 amount1,
        address toToken,
        address[] memory swapTargets,
        bytes[] memory swapData
    ) internal returns (uint256 tokensBought) {
        address token0 = IUniswapV2Pair(fromPoolAddress).token0();
        address token1 = IUniswapV2Pair(fromPoolAddress).token1();

        //swap token0 to toToken
        if (token0 == toToken) {
            tokensBought = tokensBought + amount0;
        } else {
            //swap token using 0x swap
            tokensBought =
                tokensBought +
                _fillQuote(
                    token0,
                    toToken,
                    amount0,
                    swapTargets[0],
                    swapData[0]
                );
        }

        //swap token1 to toToken
        if (token1 == toToken) {
            tokensBought = tokensBought + amount1;
        } else {
            //swap token using 0x swap
            tokensBought =
                tokensBought +
                _fillQuote(
                    token1,
                    toToken,
                    amount1,
                    swapTargets[1],
                    swapData[1]
                );
        }
    }

    function _fillQuote(
        address fromTokenAddress,
        address toToken,
        uint256 amount,
        address swapTarget,
        bytes memory swapData
    ) internal returns (uint256) {
        if (fromTokenAddress == wethTokenAddress && toToken == address(0)) {
            IWETH(wethTokenAddress).withdraw(amount);
            return amount;
        }

        uint256 valueToSend;
        if (fromTokenAddress == address(0)) {
            valueToSend = amount;
        } else {
            _approveToken(fromTokenAddress, swapTarget, amount);
        }

        uint256 initialBalance = _getBalance(toToken);

        require(approvedTargets[swapTarget], "Target not Authorized");
        (bool success, ) = swapTarget.call{ value: valueToSend }(swapData);
        require(success, "Error Swapping Tokens");

        uint256 finalBalance = _getBalance(toToken) - initialBalance;

        require(finalBalance > 0, "Swapped to Invalid Intermediate");

        return finalBalance;
    }

    /**
        @notice Utility function to determine quantity and addresses of tokens being removed
        @param fromPoolAddress Pool from which to remove liquidity
        @param liquidity Quantity of LP tokens to remove.
        @return amountA Quantity of tokenA removed
        @return amountB Quantity of tokenB removed
        @return token0 Address of the underlying token to be removed
        @return token1 Address of the underlying token to be removed
    */
    function removeLiquidityReturn(address fromPoolAddress, uint256 liquidity)
        external
        view
        returns (
            uint256 amountA,
            uint256 amountB,
            address token0,
            address token1
        )
    {
        IUniswapV2Pair pair = IUniswapV2Pair(fromPoolAddress);
        token0 = pair.token0();
        token1 = pair.token1();

        uint256 balance0 = IERC20(token0).balanceOf(fromPoolAddress);
        uint256 balance1 = IERC20(token1).balanceOf(fromPoolAddress);

        uint256 _totalSupply = pair.totalSupply();

        amountA = (liquidity * balance0) / _totalSupply;
        amountB = (liquidity * balance1) / _totalSupply;
    }
}

File 2 of 8 : ZapBaseV2.sol
// SPDX-License-Identifier: GPL-2.0
pragma solidity ^0.8.0;

import "../oz/0.8.0/access/Ownable.sol";
import "../oz/0.8.0/token/ERC20/utils/SafeERC20.sol";

abstract contract ZapBaseV2 is Ownable {
    using SafeERC20 for IERC20;
    bool public stopped = false;

    // if true, goodwill is not deducted
    mapping(address => bool) public feeWhitelist;

    uint256 public goodwill;
    // % share of goodwill (0-100 %)
    uint256 affiliateSplit;
    // restrict affiliates
    mapping(address => bool) public affiliates;
    // affiliate => token => amount
    mapping(address => mapping(address => uint256)) public affiliateBalance;
    // token => amount
    mapping(address => uint256) public totalAffiliateBalance;
    // swapTarget => approval status
    mapping(address => bool) public approvedTargets;

    address internal constant ETHAddress =
        0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE;

    constructor(uint256 _goodwill, uint256 _affiliateSplit) {
        goodwill = _goodwill;
        affiliateSplit = _affiliateSplit;
    }

    // circuit breaker modifiers
    modifier stopInEmergency {
        if (stopped) {
            revert("Temporarily Paused");
        } else {
            _;
        }
    }

    function _getBalance(address token)
        internal
        view
        returns (uint256 balance)
    {
        if (token == address(0)) {
            balance = address(this).balance;
        } else {
            balance = IERC20(token).balanceOf(address(this));
        }
    }

    function _approveToken(address token, address spender) internal {
        IERC20 _token = IERC20(token);
        if (_token.allowance(address(this), spender) > 0) return;
        else {
            _token.safeApprove(spender, type(uint256).max);
        }
    }

    function _approveToken(
        address token,
        address spender,
        uint256 amount
    ) internal {
        IERC20(token).safeApprove(spender, 0);
        IERC20(token).safeApprove(spender, amount);
    }

    // - to Pause the contract
    function toggleContractActive() public onlyOwner {
        stopped = !stopped;
    }

    function set_feeWhitelist(address zapAddress, bool status)
        external
        onlyOwner
    {
        feeWhitelist[zapAddress] = status;
    }

    function set_new_goodwill(uint256 _new_goodwill) public onlyOwner {
        require(
            _new_goodwill >= 0 && _new_goodwill <= 100,
            "GoodWill Value not allowed"
        );
        goodwill = _new_goodwill;
    }

    function set_new_affiliateSplit(uint256 _new_affiliateSplit)
        external
        onlyOwner
    {
        require(
            _new_affiliateSplit <= 100,
            "Affiliate Split Value not allowed"
        );
        affiliateSplit = _new_affiliateSplit;
    }

    function set_affiliate(address _affiliate, bool _status)
        external
        onlyOwner
    {
        affiliates[_affiliate] = _status;
    }

    ///@notice Withdraw goodwill share, retaining affilliate share
    function withdrawTokens(address[] calldata tokens) external onlyOwner {
        for (uint256 i = 0; i < tokens.length; i++) {
            uint256 qty;

            if (tokens[i] == ETHAddress) {
                qty = address(this).balance - totalAffiliateBalance[tokens[i]];

                Address.sendValue(payable(owner()), qty);
            } else {
                qty =
                    IERC20(tokens[i]).balanceOf(address(this)) -
                    totalAffiliateBalance[tokens[i]];
                IERC20(tokens[i]).safeTransfer(owner(), qty);
            }
        }
    }

    ///@notice Withdraw affilliate share, retaining goodwill share
    function affilliateWithdraw(address[] calldata tokens) external {
        uint256 tokenBal;
        for (uint256 i = 0; i < tokens.length; i++) {
            tokenBal = affiliateBalance[msg.sender][tokens[i]];
            affiliateBalance[msg.sender][tokens[i]] = 0;
            totalAffiliateBalance[tokens[i]] =
                totalAffiliateBalance[tokens[i]] -
                tokenBal;

            if (tokens[i] == ETHAddress) {
                Address.sendValue(payable(msg.sender), tokenBal);
            } else {
                IERC20(tokens[i]).safeTransfer(msg.sender, tokenBal);
            }
        }
    }

    function setApprovedTargets(
        address[] calldata targets,
        bool[] calldata isApproved
    ) external onlyOwner {
        require(targets.length == isApproved.length, "Invalid Input length");

        for (uint256 i = 0; i < targets.length; i++) {
            approvedTargets[targets[i]] = isApproved[i];
        }
    }

    receive() external payable {
        require(msg.sender != tx.origin, "Do not send ETH directly");
    }
}

File 3 of 8 : ZapOutBaseV3.sol
// SPDX-License-Identifier: GPL-2.0

pragma solidity ^0.8.0;
import "./ZapBaseV2.sol";

abstract contract ZapOutBaseV3 is ZapBaseV2 {
    using SafeERC20 for IERC20;

    /**
        @dev Transfer tokens from msg.sender to this contract
        @param token The ERC20 token to transfer to this contract
        @param shouldSellEntireBalance If True transfers entrire allowable amount from another contract
        @return Quantity of tokens transferred to this contract
     */
    function _pullTokens(
        address token,
        uint256 amount,
        bool shouldSellEntireBalance
    ) internal returns (uint256) {
        if (shouldSellEntireBalance) {
            require(
                Address.isContract(msg.sender),
                "ERR: shouldSellEntireBalance is true for EOA"
            );

            uint256 allowance =
                IERC20(token).allowance(msg.sender, address(this));
            IERC20(token).safeTransferFrom(
                msg.sender,
                address(this),
                allowance
            );

            return allowance;
        } else {
            IERC20(token).safeTransferFrom(msg.sender, address(this), amount);

            return amount;
        }
    }

    function _subtractGoodwill(
        address token,
        uint256 amount,
        address affiliate,
        bool enableGoodwill
    ) internal returns (uint256 totalGoodwillPortion) {
        bool whitelisted = feeWhitelist[msg.sender];
        if (enableGoodwill && !whitelisted && goodwill > 0) {
            totalGoodwillPortion = (amount * goodwill) / 10000;

            if (affiliates[affiliate]) {
                if (token == address(0)) {
                    token = ETHAddress;
                }

                uint256 affiliatePortion =
                    (totalGoodwillPortion * affiliateSplit) / 100;
                affiliateBalance[affiliate][token] += affiliatePortion;
                totalAffiliateBalance[token] += affiliatePortion;
            }
        }
    }
}

File 4 of 8 : Ownable.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.0;

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

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

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

    /**
     * @dev Initializes the contract setting the deployer as the initial owner.
     */
    constructor() {
        address msgSender = _msgSender();
        _owner = msgSender;
        emit OwnershipTransferred(address(0), msgSender);
    }

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

    /**
     * @dev Throws if called by any account other than the owner.
     */
    modifier onlyOwner() {
        require(owner() == _msgSender(), "Ownable: caller is not the owner");
        _;
    }

    /**
     * @dev Leaves the contract without owner. It will not be possible to call
     * `onlyOwner` functions anymore. Can only be called by the current owner.
     *
     * NOTE: Renouncing ownership will leave the contract without an owner,
     * thereby removing any functionality that is only available to the owner.
     */
    function renounceOwnership() public virtual onlyOwner {
        emit OwnershipTransferred(_owner, address(0));
        _owner = address(0);
    }

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

File 5 of 8 : IERC20.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.0;

/**
 * @dev Interface of the ERC20 standard as defined in the EIP.
 */
interface IERC20 {
    /**
     * @dev Returns the amount of tokens in existence.
     */
    function totalSupply() external view returns (uint256);

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

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

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

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

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

    /**
     * @dev Emitted when `value` tokens are moved from one account (`from`) to
     * another (`to`).
     *
     * Note that `value` may be zero.
     */
    event Transfer(address indexed from, address indexed to, uint256 value);

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

File 6 of 8 : SafeERC20.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.0;

import "../IERC20.sol";
import "../../../utils/Address.sol";

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

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

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

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

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

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

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

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

File 7 of 8 : Address.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.0;

/**
 * @dev Collection of functions related to the address type
 */
library Address {
    /**
     * @dev Returns true if `account` is a contract.
     *
     * [IMPORTANT]
     * ====
     * It is unsafe to assume that an address for which this function returns
     * false is an externally-owned account (EOA) and not a contract.
     *
     * Among others, `isContract` will return false for the following
     * types of addresses:
     *
     *  - an externally-owned account
     *  - a contract in construction
     *  - an address where a contract will be created
     *  - an address where a contract lived, but was destroyed
     * ====
     */
    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;
    }

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

        // solhint-disable-next-line avoid-low-level-calls, avoid-call-value
        (bool success, ) = recipient.call{ value: amount }("");
        require(
            success,
            "Address: unable to send value, recipient may have reverted"
        );
    }

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

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

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

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

        // solhint-disable-next-line avoid-low-level-calls
        (bool success, bytes memory returndata) =
            target.call{ value: value }(data);
        return _verifyCallResult(success, returndata, errorMessage);
    }

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

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

        // solhint-disable-next-line avoid-low-level-calls
        (bool success, bytes memory returndata) = target.staticcall(data);
        return _verifyCallResult(success, returndata, errorMessage);
    }

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

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

        // solhint-disable-next-line avoid-low-level-calls
        (bool success, bytes memory returndata) = target.delegatecall(data);
        return _verifyCallResult(success, returndata, errorMessage);
    }

    function _verifyCallResult(
        bool success,
        bytes memory returndata,
        string memory errorMessage
    ) private pure returns (bytes memory) {
        if (success) {
            return returndata;
        } else {
            // Look for revert reason and bubble it up if present
            if (returndata.length > 0) {
                // The easiest way to bubble the revert reason is using memory via assembly

                // solhint-disable-next-line no-inline-assembly
                assembly {
                    let returndata_size := mload(returndata)
                    revert(add(32, returndata), returndata_size)
                }
            } else {
                revert(errorMessage);
            }
        }
    }
}

File 8 of 8 : Context.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.0;

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

    function _msgData() internal view virtual returns (bytes calldata) {
        this; // silence state mutability warning without generating bytecode - see https://github.com/ethereum/solidity/issues/2691
        return msg.data;
    }
}

Settings
{
  "evmVersion": "istanbul",
  "libraries": {},
  "metadata": {
    "bytecodeHash": "ipfs",
    "useLiteralContent": true
  },
  "optimizer": {
    "enabled": true,
    "runs": 200
  },
  "remappings": [],
  "outputSelection": {
    "*": {
      "*": [
        "evm.bytecode",
        "evm.deployedBytecode",
        "abi"
      ]
    }
  }
}

Contract Security Audit

Contract ABI

[{"inputs":[{"internalType":"uint256","name":"_goodwill","type":"uint256"},{"internalType":"uint256","name":"_affiliateSplit","type":"uint256"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"sender","type":"address"},{"indexed":false,"internalType":"address","name":"pool","type":"address"},{"indexed":false,"internalType":"address","name":"token","type":"address"},{"indexed":false,"internalType":"uint256","name":"tokensRec","type":"uint256"}],"name":"zapOut","type":"event"},{"inputs":[{"internalType":"address","name":"toTokenAddress","type":"address"},{"internalType":"address","name":"fromPoolAddress","type":"address"},{"internalType":"uint256","name":"incomingLP","type":"uint256"},{"internalType":"uint256","name":"minTokensRec","type":"uint256"},{"internalType":"address[]","name":"swapTargets","type":"address[]"},{"internalType":"bytes[]","name":"swapData","type":"bytes[]"},{"internalType":"address","name":"affiliate","type":"address"},{"internalType":"bool","name":"shouldSellEntireBalance","type":"bool"}],"name":"ZapOut","outputs":[{"internalType":"uint256","name":"tokensRec","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"fromPoolAddress","type":"address"},{"internalType":"uint256","name":"incomingLP","type":"uint256"},{"internalType":"address","name":"affiliate","type":"address"}],"name":"ZapOut2PairToken","outputs":[{"internalType":"uint256","name":"amountA","type":"uint256"},{"internalType":"uint256","name":"amountB","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"fromPoolAddress","type":"address"},{"internalType":"uint256","name":"incomingLP","type":"uint256"},{"internalType":"address","name":"affiliate","type":"address"},{"internalType":"bytes","name":"permitData","type":"bytes"}],"name":"ZapOut2PairTokenWithPermit","outputs":[{"internalType":"uint256","name":"amountA","type":"uint256"},{"internalType":"uint256","name":"amountB","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"toTokenAddress","type":"address"},{"internalType":"address","name":"fromPoolAddress","type":"address"},{"internalType":"uint256","name":"incomingLP","type":"uint256"},{"internalType":"uint256","name":"minTokensRec","type":"uint256"},{"internalType":"bytes","name":"permitData","type":"bytes"},{"internalType":"address[]","name":"swapTargets","type":"address[]"},{"internalType":"bytes[]","name":"swapData","type":"bytes[]"},{"internalType":"address","name":"affiliate","type":"address"}],"name":"ZapOutWithPermit","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"},{"internalType":"address","name":"","type":"address"}],"name":"affiliateBalance","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"affiliates","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address[]","name":"tokens","type":"address[]"}],"name":"affilliateWithdraw","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"approvedTargets","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"feeWhitelist","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"goodwill","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"fromPoolAddress","type":"address"},{"internalType":"uint256","name":"liquidity","type":"uint256"}],"name":"removeLiquidityReturn","outputs":[{"internalType":"uint256","name":"amountA","type":"uint256"},{"internalType":"uint256","name":"amountB","type":"uint256"},{"internalType":"address","name":"token0","type":"address"},{"internalType":"address","name":"token1","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address[]","name":"targets","type":"address[]"},{"internalType":"bool[]","name":"isApproved","type":"bool[]"}],"name":"setApprovedTargets","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_affiliate","type":"address"},{"internalType":"bool","name":"_status","type":"bool"}],"name":"set_affiliate","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"zapAddress","type":"address"},{"internalType":"bool","name":"status","type":"bool"}],"name":"set_feeWhitelist","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_new_affiliateSplit","type":"uint256"}],"name":"set_new_affiliateSplit","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_new_goodwill","type":"uint256"}],"name":"set_new_goodwill","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"stopped","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"toggleContractActive","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"totalAffiliateBalance","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address[]","name":"tokens","type":"address[]"}],"name":"withdrawTokens","outputs":[],"stateMutability":"nonpayable","type":"function"},{"stateMutability":"payable","type":"receive"}]

60806040526000805460ff60a01b191690553480156200001e57600080fd5b5060405162003415380380620034158339810160408190526200004191620000e0565b600080546001600160a01b03191633908117825560405184928492918291907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908290a350600291909155600355505073def1c0ded9bec7f1a1670819833240f027b25eff60005260076020527ff6019cd1944dc466e824190b288e5a63528dd4c9a6d8cbd707956fd30d2f1e0d805460ff1916600117905562000104565b60008060408385031215620000f3578182fd5b505080516020909101519092909150565b61330180620001146000396000f3fe6080604052600436106101445760003560e01c8063715018a6116100b65780639779d1a61161006f5780639779d1a614610435578063cfd7789c14610465578063d408f6571461049a578063f21d3ab5146104ca578063f2fde38b146104ea578063fbec27bf1461050a57600080fd5b8063715018a61461034857806375f12b211461035d5780637ee992831461037e5780638da5cb5b146103cd57806391027c5b146103f55780639735a6341461041557600080fd5b8063247482ba11610108578063247482ba146102725780633ff428c7146102925780634f51e294146102b2578063550bfa56146102f25780635de0398e146103125780635ecb16cd1461032857600080fd5b806301e980d4146101a55780630dc9de85146101c55780631385d24c146101e55780631781261f146101fa57806318b135e31461024557600080fd5b366101a0573332141561019e5760405162461bcd60e51b815260206004820152601860248201527f446f206e6f742073656e6420455448206469726563746c79000000000000000060448201526064015b60405180910390fd5b005b600080fd5b3480156101b157600080fd5b5061019e6101c0366004612ff2565b61052a565b3480156101d157600080fd5b5061019e6101e0366004612f11565b6105b4565b3480156101f157600080fd5b5061019e61080f565b34801561020657600080fd5b50610232610215366004612c1b565b600560209081526000928352604080842090915290825290205481565b6040519081526020015b60405180910390f35b34801561025157600080fd5b50610232610260366004612be3565b60066020526000908152604090205481565b34801561027e57600080fd5b5061023261028d366004612c53565b61085a565b34801561029e57600080fd5b5061019e6102ad366004612dde565b6109dc565b3480156102be57600080fd5b506102e26102cd366004612be3565b60046020526000908152604090205460ff1681565b604051901515815260200161023c565b3480156102fe57600080fd5b5061019e61030d366004612ff2565b610a31565b34801561031e57600080fd5b5061023260025481565b34801561033457600080fd5b5061019e610343366004612f11565b610ab1565b34801561035457600080fd5b5061019e610d22565b34801561036957600080fd5b506000546102e290600160a01b900460ff1681565b34801561038a57600080fd5b5061039e610399366004612e0b565b610d96565b6040805194855260208501939093526001600160a01b039182169284019290925216606082015260800161023c565b3480156103d957600080fd5b506000546040516001600160a01b03909116815260200161023c565b34801561040157600080fd5b50610232610410366004612d14565b611035565b34801561042157600080fd5b5061019e610430366004612f51565b611128565b34801561044157600080fd5b506102e2610450366004612be3565b60076020526000908152604090205460ff1681565b34801561047157600080fd5b50610485610480366004612e77565b611252565b6040805192835260208301919091520161023c565b3480156104a657600080fd5b506102e26104b5366004612be3565b60016020526000908152604090205460ff1681565b3480156104d657600080fd5b506104856104e5366004612e36565b611344565b3480156104f657600080fd5b5061019e610505366004612be3565b6117fd565b34801561051657600080fd5b5061019e610525366004612dde565b6118e7565b6000546001600160a01b031633146105545760405162461bcd60e51b81526004016101959061313a565b60648111156105af5760405162461bcd60e51b815260206004820152602160248201527f416666696c696174652053706c69742056616c7565206e6f7420616c6c6f77656044820152601960fa1b6064820152608401610195565b600355565b6000805b8281101561080957336000908152600560205260408120908585848181106105f057634e487b7160e01b600052603260045260246000fd5b90506020020160208101906106059190612be3565b6001600160a01b0316815260208082019290925260409081016000908120543382526005909352908120919350908186868581811061065457634e487b7160e01b600052603260045260246000fd5b90506020020160208101906106699190612be3565b6001600160a01b03166001600160a01b031681526020019081526020016000208190555081600660008686858181106106b257634e487b7160e01b600052603260045260246000fd5b90506020020160208101906106c79190612be3565b6001600160a01b03166001600160a01b03168152602001908152602001600020546106f2919061321b565b6006600086868581811061071657634e487b7160e01b600052603260045260246000fd5b905060200201602081019061072b9190612be3565b6001600160a01b0316815260208101919091526040016000205573eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee84848381811061077a57634e487b7160e01b600052603260045260246000fd5b905060200201602081019061078f9190612be3565b6001600160a01b031614156107ad576107a8338361193c565b6107f7565b6107f733838686858181106107d257634e487b7160e01b600052603260045260246000fd5b90506020020160208101906107e79190612be3565b6001600160a01b03169190611a55565b806108018161325e565b9150506105b8565b50505050565b6000546001600160a01b031633146108395760405162461bcd60e51b81526004016101959061313a565b6000805460ff60a01b198116600160a01b9182900460ff1615909102179055565b60008054600160a01b900460ff16156108855760405162461bcd60e51b81526004016101959061310e565b6000806108938a8a86611ab8565b915091506108a58a83838e8b8b611d2b565b9250878310156108e75760405162461bcd60e51b815260206004820152600d60248201526c4869676820536c69707061676560981b6044820152606401610195565b60006001600160a01b038c166109565761091873eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee85886001611f3f565b9050336108fc610928838761321b565b6040518115909202916000818181858888f19350505050158015610950573d6000803e3d6000fd5b50610984565b6109638c85886001611f3f565b905061098433610973838761321b565b6001600160a01b038f169190611a55565b61098e818561321b565b93507ff2d3e32195f8631c70e1d996c9bd5d4a3369d0580786dcd662bf13139310355d338c8e876040516109c59493929190613071565b60405180910390a150505098975050505050505050565b6000546001600160a01b03163314610a065760405162461bcd60e51b81526004016101959061313a565b6001600160a01b03919091166000908152600460205260409020805460ff1916911515919091179055565b6000546001600160a01b03163314610a5b5760405162461bcd60e51b81526004016101959061313a565b6064811115610aac5760405162461bcd60e51b815260206004820152601a60248201527f476f6f6457696c6c2056616c7565206e6f7420616c6c6f7765640000000000006044820152606401610195565b600255565b6000546001600160a01b03163314610adb5760405162461bcd60e51b81526004016101959061313a565b60005b81811015610d1d57600073eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee848484818110610b1d57634e487b7160e01b600052603260045260246000fd5b9050602002016020810190610b329190612be3565b6001600160a01b03161415610bc05760066000858585818110610b6557634e487b7160e01b600052603260045260246000fd5b9050602002016020810190610b7a9190612be3565b6001600160a01b03168152602081019190915260400160002054610b9e904761321b565b9050610bbb610bb56000546001600160a01b031690565b8261193c565b610d0a565b60066000858585818110610be457634e487b7160e01b600052603260045260246000fd5b9050602002016020810190610bf99190612be3565b6001600160a01b03166001600160a01b0316815260200190815260200160002054848484818110610c3a57634e487b7160e01b600052603260045260246000fd5b9050602002016020810190610c4f9190612be3565b6040516370a0823160e01b81523060048201526001600160a01b0391909116906370a082319060240160206040518083038186803b158015610c9057600080fd5b505afa158015610ca4573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610cc8919061300a565b610cd2919061321b565b9050610d0a610ce96000546001600160a01b031690565b828686868181106107d257634e487b7160e01b600052603260045260246000fd5b5080610d158161325e565b915050610ade565b505050565b6000546001600160a01b03163314610d4c5760405162461bcd60e51b81526004016101959061313a565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6000806000806000869050806001600160a01b0316630dfe16816040518163ffffffff1660e01b815260040160206040518083038186803b158015610dda57600080fd5b505afa158015610dee573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e129190612bff565b9250806001600160a01b031663d21220a76040518163ffffffff1660e01b815260040160206040518083038186803b158015610e4d57600080fd5b505afa158015610e61573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e859190612bff565b6040516370a0823160e01b81526001600160a01b0389811660048301529193506000918516906370a082319060240160206040518083038186803b158015610ecc57600080fd5b505afa158015610ee0573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610f04919061300a565b6040516370a0823160e01b81526001600160a01b038a811660048301529192506000918516906370a082319060240160206040518083038186803b158015610f4b57600080fd5b505afa158015610f5f573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610f83919061300a565b90506000836001600160a01b03166318160ddd6040518163ffffffff1660e01b815260040160206040518083038186803b158015610fc057600080fd5b505afa158015610fd4573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610ff8919061300a565b905080611005848b6131fc565b61100f91906131dc565b97508061101c838b6131fc565b61102691906131dc565b96505050505092959194509250565b60008054600160a01b900460ff16156110605760405162461bcd60e51b81526004016101959061310e565b6110698861206a565b6000886001600160a01b0316866040516110839190613055565b6000604051808303816000865af19150503d80600081146110c0576040519150601f19603f3d011682016040523d82523d6000602084013e6110c5565b606091505b50509050806111095760405162461bcd60e51b815260206004820152601060248201526f10dbdd5b1908139bdd0814195c9b5a5d60821b6044820152606401610195565b61111a8a8a8a8a898989600061085a565b9a9950505050505050505050565b6000546001600160a01b031633146111525760405162461bcd60e51b81526004016101959061313a565b8281146111985760405162461bcd60e51b8152602060048201526014602482015273092dcecc2d8d2c84092dce0eae840d8cadccee8d60631b6044820152606401610195565b60005b8381101561124b578282828181106111c357634e487b7160e01b600052603260045260246000fd5b90506020020160208101906111d89190612fba565b600760008787858181106111fc57634e487b7160e01b600052603260045260246000fd5b90506020020160208101906112119190612be3565b6001600160a01b031681526020810191909152604001600020805460ff1916911515919091179055806112438161325e565b91505061119b565b5050505050565b600080548190600160a01b900460ff161561127f5760405162461bcd60e51b81526004016101959061310e565b6112888761206a565b6000876001600160a01b031685856040516112a4929190613045565b6000604051808303816000865af19150503d80600081146112e1576040519150601f19603f3d011682016040523d82523d6000602084013e6112e6565b606091505b505090508061132a5760405162461bcd60e51b815260206004820152601060248201526f10dbdd5b1908139bdd0814195c9b5a5d60821b6044820152606401610195565b611335888888611344565b90999098509650505050505050565b600080548190600160a01b900460ff16156113715760405162461bcd60e51b81526004016101959061310e565b846001600160a01b0381166113c85760405162461bcd60e51b815260206004820152601b60248201527f506f6f6c2043616e6e6f74206265205a65726f204164647265737300000000006044820152606401610195565b6000816001600160a01b0316630dfe16816040518163ffffffff1660e01b815260040160206040518083038186803b15801561140357600080fd5b505afa158015611417573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061143b9190612bff565b90506000826001600160a01b031663d21220a76040518163ffffffff1660e01b815260040160206040518083038186803b15801561147857600080fd5b505afa15801561148c573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906114b09190612bff565b90506114c76001600160a01b03891633308a61224a565b6114e68873d9e1ce17f2641f24ae83637ab66a2cca9c378b9f89612282565b6001600160a01b03821673c02aaa39b223fe8d0a0e5c4f27ead9083c756cc2148061152d57506001600160a01b03811673c02aaa39b223fe8d0a0e5c4f27ead9083c756cc2145b156116885760006001600160a01b03831673c02aaa39b223fe8d0a0e5c4f27ead9083c756cc21461155e5782611560565b815b604051629d473b60e21b81526001600160a01b0382166004820152602481018a90526001604482018190526064820152306084820152600f60fc1b60a482015290915073d9e1ce17f2641f24ae83637ab66a2cca9c378b9f906302751cec9060c4016040805180830381600087803b1580156115db57600080fd5b505af11580156115ef573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906116139190613022565b9096509450600061162782888a6001611f3f565b9050600061164c73eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee888b6001611f3f565b905061166d3361165c848b61321b565b6001600160a01b0386169190611a55565b6116803361167b838a61321b565b61193c565b505050611778565b604051635d5155ef60e11b815273d9e1ce17f2641f24ae83637ab66a2cca9c378b9f9063baa2abde906116d090859085908c9060019081903090600f60fc1b9060040161309b565b6040805180830381600087803b1580156116e957600080fd5b505af11580156116fd573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906117219190613022565b909550935060006117358387896001611f3f565b9050600061174683878a6001611f3f565b905061176733611756848a61321b565b6001600160a01b0387169190611a55565b6117753361165c838961321b565b50505b7ff2d3e32195f8631c70e1d996c9bd5d4a3369d0580786dcd662bf13139310355d338984886040516117ad9493929190613071565b60405180910390a17ff2d3e32195f8631c70e1d996c9bd5d4a3369d0580786dcd662bf13139310355d338983876040516117ea9493929190613071565b60405180910390a1505050935093915050565b6000546001600160a01b031633146118275760405162461bcd60e51b81526004016101959061313a565b6001600160a01b03811661188c5760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608401610195565b600080546040516001600160a01b03808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a3600080546001600160a01b0319166001600160a01b0392909216919091179055565b6000546001600160a01b031633146119115760405162461bcd60e51b81526004016101959061313a565b6001600160a01b03919091166000908152600160205260409020805460ff1916911515919091179055565b8047101561198c5760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a20696e73756666696369656e742062616c616e63650000006044820152606401610195565b6000826001600160a01b03168260405160006040518083038185875af1925050503d80600081146119d9576040519150601f19603f3d011682016040523d82523d6000602084013e6119de565b606091505b5050905080610d1d5760405162461bcd60e51b815260206004820152603a60248201527f416464726573733a20756e61626c6520746f2073656e642076616c75652c207260448201527f6563697069656e74206d617920686176652072657665727465640000000000006064820152608401610195565b6040516001600160a01b038316602482015260448101829052610d1d90849063a9059cbb60e01b906064015b60408051601f198184030181529190526020810180516001600160e01b03166001600160e01b0319909316929092179091526122ab565b600080846001600160a01b038116611b125760405162461bcd60e51b815260206004820152601b60248201527f506f6f6c2043616e6e6f74206265205a65726f204164647265737300000000006044820152606401610195565b6000816001600160a01b0316630dfe16816040518163ffffffff1660e01b815260040160206040518083038186803b158015611b4d57600080fd5b505afa158015611b61573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611b859190612bff565b90506000826001600160a01b031663d21220a76040518163ffffffff1660e01b815260040160206040518083038186803b158015611bc257600080fd5b505afa158015611bd6573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611bfa9190612bff565b9050611c0788888861237d565b50611c278873d9e1ce17f2641f24ae83637ab66a2cca9c378b9f89612282565b604051635d5155ef60e11b815273d9e1ce17f2641f24ae83637ab66a2cca9c378b9f9063baa2abde90611c6f90859085908c9060019081903090600f60fc1b9060040161309b565b6040805180830381600087803b158015611c8857600080fd5b505af1158015611c9c573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611cc09190613022565b90955093508415801590611cd45750600084115b611d205760405162461bcd60e51b815260206004820152601e60248201527f52656d6f76656420496e73756666696369656e74204c697175696469747900006044820152606401610195565b505050935093915050565b600080876001600160a01b0316630dfe16816040518163ffffffff1660e01b815260040160206040518083038186803b158015611d6757600080fd5b505afa158015611d7b573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611d9f9190612bff565b90506000886001600160a01b031663d21220a76040518163ffffffff1660e01b815260040160206040518083038186803b158015611ddc57600080fd5b505afa158015611df0573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611e149190612bff565b9050856001600160a01b0316826001600160a01b03161415611e4157611e3a88846131c4565b9250611eab565b611e9e82878a88600081518110611e6857634e487b7160e01b600052603260045260246000fd5b602002602001015188600081518110611e9157634e487b7160e01b600052603260045260246000fd5b60200260200101516124a5565b611ea890846131c4565b92505b856001600160a01b0316816001600160a01b03161415611ed657611ecf87846131c4565b9250611f33565b611f2681878988600181518110611efd57634e487b7160e01b600052603260045260246000fd5b602002602001015188600181518110611e9157634e487b7160e01b600052603260045260246000fd5b611f3090846131c4565b92505b50509695505050505050565b3360009081526001602052604081205460ff16828015611f5d575080155b8015611f6b57506000600254115b156120615761271060025486611f8191906131fc565b611f8b91906131dc565b6001600160a01b03851660009081526004602052604090205490925060ff1615612061576001600160a01b038616611fd55773eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee95505b6000606460035484611fe791906131fc565b611ff191906131dc565b6001600160a01b038087166000908152600560209081526040808320938c1683529290529081208054929350839290919061202d9084906131c4565b90915550506001600160a01b0387166000908152600660205260408120805483929061205a9084906131c4565b9091555050505b50949350505050565b60008190506000816001600160a01b0316630dfe16816040518163ffffffff1660e01b815260040160206040518083038186803b1580156120aa57600080fd5b505afa1580156120be573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906120e29190612bff565b90506000826001600160a01b031663d21220a76040518163ffffffff1660e01b815260040160206040518083038186803b15801561211f57600080fd5b505afa158015612133573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906121579190612bff565b60405163e6a4390560e01b81526001600160a01b0380851660048301528216602482015290915060009073c0aee478e3658e2610c5f7a4a2e1777ce9e4f2ac9063e6a439059060440160206040518083038186803b1580156121b857600080fd5b505afa1580156121cc573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906121f09190612bff565b9050846001600160a01b0316816001600160a01b03161461124b5760405162461bcd60e51b8152602060048201526014602482015273496e76616c696420506f6f6c204164647265737360601b6044820152606401610195565b6040516001600160a01b03808516602483015283166044820152606481018290526108099085906323b872dd60e01b90608401611a81565b6122976001600160a01b0384168360006126f9565b610d1d6001600160a01b03841683836126f9565b6000612300826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b031661281d9092919063ffffffff16565b805190915015610d1d578080602001905181019061231e9190612fd6565b610d1d5760405162461bcd60e51b815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e6044820152691bdd081cdd58d8d9595960b21b6064820152608401610195565b6000811561248657333b6123e85760405162461bcd60e51b815260206004820152602c60248201527f4552523a2073686f756c6453656c6c456e7469726542616c616e63652069732060448201526b7472756520666f7220454f4160a01b6064820152608401610195565b604051636eb1769f60e11b81523360048201523060248201526000906001600160a01b0386169063dd62ed3e9060440160206040518083038186803b15801561243057600080fd5b505afa158015612444573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612468919061300a565b905061247f6001600160a01b03861633308461224a565b905061249e565b61249b6001600160a01b03851633308661224a565b50815b9392505050565b60006001600160a01b03861673c02aaa39b223fe8d0a0e5c4f27ead9083c756cc21480156124da57506001600160a01b038516155b1561254c57604051632e1a7d4d60e01b81526004810185905273c02aaa39b223fe8d0a0e5c4f27ead9083c756cc290632e1a7d4d90602401600060405180830381600087803b15801561252c57600080fd5b505af1158015612540573d6000803e3d6000fd5b505050508390506126f0565b60006001600160a01b03871661256357508361256e565b61256e878587612282565b600061257987612834565b6001600160a01b03861660009081526007602052604090205490915060ff166125dc5760405162461bcd60e51b815260206004820152601560248201527415185c99d95d081b9bdd08105d5d1a1bdc9a5e9959605a1b6044820152606401610195565b6000856001600160a01b031683866040516125f79190613055565b60006040518083038185875af1925050503d8060008114612634576040519150601f19603f3d011682016040523d82523d6000602084013e612639565b606091505b50509050806126825760405162461bcd60e51b81526020600482015260156024820152744572726f72205377617070696e6720546f6b656e7360581b6044820152606401610195565b60008261268e8a612834565b612698919061321b565b9050600081116126ea5760405162461bcd60e51b815260206004820152601f60248201527f5377617070656420746f20496e76616c696420496e7465726d656469617465006044820152606401610195565b93505050505b95945050505050565b8015806127825750604051636eb1769f60e11b81523060048201526001600160a01b03838116602483015284169063dd62ed3e9060440160206040518083038186803b15801561274857600080fd5b505afa15801561275c573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612780919061300a565b155b6127ed5760405162461bcd60e51b815260206004820152603660248201527f5361666545524332303a20617070726f76652066726f6d206e6f6e2d7a65726f60448201527520746f206e6f6e2d7a65726f20616c6c6f77616e636560501b6064820152608401610195565b6040516001600160a01b038316602482015260448101829052610d1d90849063095ea7b360e01b90606401611a81565b606061282c84846000856128ca565b949350505050565b60006001600160a01b03821661284b575047919050565b6040516370a0823160e01b81523060048201526001600160a01b038316906370a082319060240160206040518083038186803b15801561288a57600080fd5b505afa15801561289e573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906128c2919061300a565b90505b919050565b60608247101561292b5760405162461bcd60e51b815260206004820152602660248201527f416464726573733a20696e73756666696369656e742062616c616e636520666f6044820152651c8818d85b1b60d21b6064820152608401610195565b843b6129795760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e74726163740000006044820152606401610195565b600080866001600160a01b031685876040516129959190613055565b60006040518083038185875af1925050503d80600081146129d2576040519150601f19603f3d011682016040523d82523d6000602084013e6129d7565b606091505b50915091506129e78282866129f2565b979650505050505050565b60608315612a0157508161249e565b825115612a115782518084602001fd5b8160405162461bcd60e51b815260040161019591906130db565b80356128c5816132a5565b60008083601f840112612a47578182fd5b50813567ffffffffffffffff811115612a5e578182fd5b6020830191508360208260051b8501011115612a7957600080fd5b9250929050565b600082601f830112612a90578081fd5b81356020612aa5612aa0836131a0565b61316f565b80838252828201915082860187848660051b8901011115612ac4578586fd5b855b85811015612aeb578135612ad9816132a5565b84529284019290840190600101612ac6565b5090979650505050505050565b600082601f830112612b08578081fd5b81356020612b18612aa0836131a0565b80838252828201915082860187848660051b8901011115612b37578586fd5b855b85811015612aeb57813567ffffffffffffffff811115612b57578788fd5b612b658a87838c0101612b78565b8552509284019290840190600101612b39565b600082601f830112612b88578081fd5b813567ffffffffffffffff811115612ba257612ba261328f565b612bb5601f8201601f191660200161316f565b818152846020838601011115612bc9578283fd5b816020850160208301379081016020019190915292915050565b600060208284031215612bf4578081fd5b813561249e816132a5565b600060208284031215612c10578081fd5b815161249e816132a5565b60008060408385031215612c2d578081fd5b8235612c38816132a5565b91506020830135612c48816132a5565b809150509250929050565b600080600080600080600080610100898b031215612c6f578384fd5b8835612c7a816132a5565b97506020890135612c8a816132a5565b96506040890135955060608901359450608089013567ffffffffffffffff80821115612cb4578586fd5b612cc08c838d01612a80565b955060a08b0135915080821115612cd5578485fd5b50612ce28b828c01612af8565b93505060c0890135612cf3816132a5565b915060e0890135612d03816132bd565b809150509295985092959890939650565b600080600080600080600080610100898b031215612d30578384fd5b612d3989612a2b565b9750612d4760208a01612a2b565b96506040890135955060608901359450608089013567ffffffffffffffff80821115612d71578586fd5b612d7d8c838d01612b78565b955060a08b0135915080821115612d92578485fd5b612d9e8c838d01612a80565b945060c08b0135915080821115612db3578384fd5b50612dc08b828c01612af8565b925050612dcf60e08a01612a2b565b90509295985092959890939650565b60008060408385031215612df0578182fd5b8235612dfb816132a5565b91506020830135612c48816132bd565b60008060408385031215612e1d578182fd5b8235612e28816132a5565b946020939093013593505050565b600080600060608486031215612e4a578081fd5b8335612e55816132a5565b9250602084013591506040840135612e6c816132a5565b809150509250925092565b600080600080600060808688031215612e8e578283fd5b8535612e99816132a5565b9450602086013593506040860135612eb0816132a5565b9250606086013567ffffffffffffffff80821115612ecc578283fd5b818801915088601f830112612edf578283fd5b813581811115612eed578384fd5b896020828501011115612efe578384fd5b9699959850939650602001949392505050565b60008060208385031215612f23578182fd5b823567ffffffffffffffff811115612f39578283fd5b612f4585828601612a36565b90969095509350505050565b60008060008060408587031215612f66578182fd5b843567ffffffffffffffff80821115612f7d578384fd5b612f8988838901612a36565b90965094506020870135915080821115612fa1578384fd5b50612fae87828801612a36565b95989497509550505050565b600060208284031215612fcb578081fd5b813561249e816132bd565b600060208284031215612fe7578081fd5b815161249e816132bd565b600060208284031215613003578081fd5b5035919050565b60006020828403121561301b578081fd5b5051919050565b60008060408385031215613034578182fd5b505080516020909101519092909150565b8183823760009101908152919050565b60008251613067818460208701613232565b9190910192915050565b6001600160a01b039485168152928416602084015292166040820152606081019190915260800190565b6001600160a01b039788168152958716602087015260408601949094526060850192909252608084015290921660a082015260c081019190915260e00190565b60208152600082518060208401526130fa816040850160208701613232565b601f01601f19169190910160400192915050565b60208082526012908201527115195b5c1bdc985c9a5b1e4814185d5cd95960721b604082015260600190565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b604051601f8201601f1916810167ffffffffffffffff811182821017156131985761319861328f565b604052919050565b600067ffffffffffffffff8211156131ba576131ba61328f565b5060051b60200190565b600082198211156131d7576131d7613279565b500190565b6000826131f757634e487b7160e01b81526012600452602481fd5b500490565b600081600019048311821515161561321657613216613279565b500290565b60008282101561322d5761322d613279565b500390565b60005b8381101561324d578181015183820152602001613235565b838111156108095750506000910152565b600060001982141561327257613272613279565b5060010190565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052604160045260246000fd5b6001600160a01b03811681146132ba57600080fd5b50565b80151581146132ba57600080fdfea2646970667358221220911cf24cce53b3b4ab2e5f2c7f13e8e8d9020e59697ba36753542d22d8f736ca64736f6c6343000804003300000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000

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

00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000

-----Decoded View---------------
Arg [0] : _goodwill (uint256): 0
Arg [1] : _affiliateSplit (uint256): 0

-----Encoded View---------------
2 Constructor Arguments found :
Arg [0] : 0000000000000000000000000000000000000000000000000000000000000000
Arg [1] : 0000000000000000000000000000000000000000000000000000000000000000


Block Transaction Difficulty Gas Used Reward
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.

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.