Contract 0x4bF331Aa2BfB0869315fB81a350d109F4839f81b

 

Contract Overview

Balance:
0 BNB

BNB Value:
$0.00

Token:
Txn Hash
Block
From
To
Value [Txn Fee]
0x5663b5a90dbc7a73dba98652889971054c530b22fd60f32a63c46c81a73b120082469282021-06-13 0:17:344 mins ago0xb07af1844a80548a1e3edc5fdd59144ba769c870 IN  0x4bf331aa2bfb0869315fb81a350d109f4839f81b0 BNB0.0025176305
0xa2f7e2fdf546374f74d6f24ddfa78b0b042c958f86add234bf9f11096f976f7682456812021-06-12 23:15:101 hr 6 mins ago0x1a74108958c18bb519d05a878ca92ea1dd18e1b2 IN  0x4bf331aa2bfb0869315fb81a350d109f4839f81b0 BNB0.003622707
0x5b66bf3b56f5b97e2dff654f9217fe2bae8f2c124ae5c4f8490dfce4546b344782456202021-06-12 23:12:071 hr 9 mins ago0x25132de651514b6c417c734558694fc576294d03 IN  0x4bf331aa2bfb0869315fb81a350d109f4839f81b0 BNB0.002505591
0x9e0edf99396fc30a4e7dc68c761260606604e4723347c681b3aaad6a4ea294c582453542021-06-12 22:58:491 hr 22 mins ago0xcba95c48589781c337b3e2fbdd118b649bbe935b IN  0x4bf331aa2bfb0869315fb81a350d109f4839f81b0 BNB0.0025089185
0x0260cb261bf75fbc41e7db18d4721a47bf5428275e5f3e07c09aec69d093dc9282434712021-06-12 21:23:032 hrs 58 mins ago0x61f69a15a2b59f60c43bfa95a31999056bd80339 IN  0x4bf331aa2bfb0869315fb81a350d109f4839f81b0 BNB0.002281735
0xc30f48ab772569af5c207c61fa01b78e7f9d3446e1f35f2a865a348eef9b852082433422021-06-12 21:16:363 hrs 5 mins ago0xd638353b083008610a34c73aa33b90a325ce50af IN  0x4bf331aa2bfb0869315fb81a350d109f4839f81b0 BNB0.0025154855
0x2d667a902dd0162a98729a57490c922acdb84c0837d226344c3c75adf918ed9882433282021-06-12 21:15:543 hrs 5 mins ago0x641d98a95dc91b93651b10ff6f9c125fffa28bae IN  0x4bf331aa2bfb0869315fb81a350d109f4839f81b0 BNB0.00235275
0x3101a95e8d54f4579795a332da88655ba0c7ba3206a86043e80b883866ee673c82431302021-06-12 21:05:243 hrs 16 mins ago0xf46e4d8b51514862ce30dad93f8923a1de1baac1 IN  0x4bf331aa2bfb0869315fb81a350d109f4839f81b0 BNB0.002588025
0x10949580939d2738b08da04772f999c1c7ed81aa9a57790ef02772403c153eea82412712021-06-12 19:31:554 hrs 49 mins ago0x86e2f67b092a8fcfbe0ff5a61d2577c4df07332e IN  0x4bf331aa2bfb0869315fb81a350d109f4839f81b0 BNB0.00229233
0x0d13ba0fed77354fbc50d9f548376e805a69b517fb08b9460431f2be1dcd6c0782410082021-06-12 19:18:455 hrs 2 mins ago0x0602a3f56c665538922e266f58aba1ac8dccbc48 IN  0x4bf331aa2bfb0869315fb81a350d109f4839f81b0 BNB0.003699311
0xfb2164aded5204ffd3f012c8ff08e0d2eddcfdfb7d3bbd59cec45e6d7441290f82409312021-06-12 19:14:545 hrs 6 mins ago0xfa8cc1a625f14848fc89d77938b13dbe4791be0a IN  0x4bf331aa2bfb0869315fb81a350d109f4839f81b0 BNB0.00221983
0x780d8e94f60e8597a80dd8032098f13d300fbf008c8810a71888d6174bbcdea682408012021-06-12 19:08:085 hrs 13 mins ago0x944308ee1922ece9838ae43b041f6c931de1b3a9 IN  0x4bf331aa2bfb0869315fb81a350d109f4839f81b0 BNB0.002228815
0x8da5ea118563d3c6d6e084820729f3f39bf37a56ef354a697f55637f0122ada182407872021-06-12 19:07:265 hrs 14 mins ago0xee2e806b2adb48cebea5ccc3cb0dc110c2a1c768 IN  0x4bf331aa2bfb0869315fb81a350d109f4839f81b0 BNB0.0025932445
0x1f1dadf0c3d42a71573b4d45e6f6752114f3eaa20a5b5b8e2529242deb1f62a482406422021-06-12 19:00:115 hrs 21 mins ago0xd978e6d8d7c1cbd53b6311f63b5b7284ecae793a IN  0x4bf331aa2bfb0869315fb81a350d109f4839f81b0 BNB0.00228025
0xe5a1ae899868bee55851a714a735a3b0067f7e0d692daad72b34cbe440695ac082405132021-06-12 18:53:445 hrs 27 mins ago0xc4cfa2ac48a2e7ecc101942246c3ec4bc888a357 IN  0x4bf331aa2bfb0869315fb81a350d109f4839f81b0 BNB0.00221983
0xf5329011f9755a21ee8ceeac7724b47167e09d4d1cf232ebad7d9a43aa31e6e182404112021-06-12 18:48:385 hrs 33 mins ago0x87bba9346f5a1d1c6042f3a6a881538bc7d60ffc IN  0x4bf331aa2bfb0869315fb81a350d109f4839f81b0 BNB0.00228025
0xcf5b2704184da382daac9876edc9a2633c58f99ef287e9e4eda64511b2598f7d82403782021-06-12 18:46:595 hrs 34 mins ago0xb81c60a977a5e492892431f8e33debb495ad52f7 IN  0x4bf331aa2bfb0869315fb81a350d109f4839f81b0 BNB0.002286565
0x56f09b1caa64aba6992f1ab2112d4effe65f0a152c6a4e4ba6795473ae09727682402932021-06-12 18:42:445 hrs 38 mins ago0x9f7138cd4eb2df17f33e8c7abe1476ab03a5b147 IN  0x4bf331aa2bfb0869315fb81a350d109f4839f81b0 BNB0.002228155
0xd091e5eda03374798e47bc1ee9a474cc599c281f970834e6ca480123637c6fab82401822021-06-12 18:37:115 hrs 44 mins ago0x024661aded7b7ea9c486e7a218f80bfa6b8c4579 IN  0x4bf331aa2bfb0869315fb81a350d109f4839f81b0 BNB0.00221983
0xcda218e5c3ddc84f6ce299c325d3c1a223bb15afd033434c4326b9487db94c7b82400842021-06-12 18:32:175 hrs 49 mins ago0xbc035dd57ff87244050a60b30eeb58ff3c1c083d IN  0x4bf331aa2bfb0869315fb81a350d109f4839f81b0 BNB0.00221983
0x389cd142960109b4274edaa83588d7a125ba6ca183ca338df559d4a94c868bfc82399792021-06-12 18:26:505 hrs 54 mins ago0xd3b90b90d15672376046850839756d626136dac0 IN  0x4bf331aa2bfb0869315fb81a350d109f4839f81b0 BNB0.00221983
0x82b6a12bd3f4a50b65579bd99aa0e2c245e7698dd8b9ecef543f3b1362a1cf5882395152021-06-12 18:02:366 hrs 19 mins ago0x5dc2c366706bf35ceccc1b2eaca8b19cc9170428 IN  0x4bf331aa2bfb0869315fb81a350d109f4839f81b0 BNB0.002221255
0x79b28f97ca0c63881ffa6568d603b125409e160e662d4f41705e087bbdf2c9c082394752021-06-12 18:00:366 hrs 21 mins ago0x5dc2c366706bf35ceccc1b2eaca8b19cc9170428 IN  0x4bf331aa2bfb0869315fb81a350d109f4839f81b0 BNB0.002477445
0xdd6a19ee41e64a83002fe1e775f5582eeffa2d4d73928f37276f1dfaf95ff3da82389702021-06-12 17:35:016 hrs 46 mins ago0x34f688599b3dc786e5c8e8207f7deb4ee9cb7acf IN  0x4bf331aa2bfb0869315fb81a350d109f4839f81b0 BNB0.0039546705
0x3a6d9ae0864e3dd86128f564288b495d784eeb613df985049bbc417570dfe14182387562021-06-12 17:24:196 hrs 57 mins ago0x7f5e90f827abeac6fe0c00a60e33feb3a51aebd4 IN  0x4bf331aa2bfb0869315fb81a350d109f4839f81b0 BNB0.0025099745
[ Download CSV Export 
Latest 25 internal transaction
Parent Txn Hash Block From To Value
0x5663b5a90dbc7a73dba98652889971054c530b22fd60f32a63c46c81a73b120082469282021-06-13 0:17:344 mins ago 0x4bf331aa2bfb0869315fb81a350d109f4839f81b0xb07af1844a80548a1e3edc5fdd59144ba769c8700.016022907323566263 BNB
0x5663b5a90dbc7a73dba98652889971054c530b22fd60f32a63c46c81a73b120082469282021-06-13 0:17:344 mins ago 0xdb6f1920a889355780af7570773609bd8cb1f498 0x4bf331aa2bfb0869315fb81a350d109f4839f81b0.008002030131453214 BNB
0x5663b5a90dbc7a73dba98652889971054c530b22fd60f32a63c46c81a73b120082469282021-06-13 0:17:344 mins ago Binance: WBNB Token 0x4bf331aa2bfb0869315fb81a350d109f4839f81b0.008020877192113049 BNB
0xa2f7e2fdf546374f74d6f24ddfa78b0b042c958f86add234bf9f11096f976f7682456812021-06-12 23:15:101 hr 6 mins ago 0x4bf331aa2bfb0869315fb81a350d109f4839f81b0x1a74108958c18bb519d05a878ca92ea1dd18e1b20.029267508182432918 BNB
0xa2f7e2fdf546374f74d6f24ddfa78b0b042c958f86add234bf9f11096f976f7682456812021-06-12 23:15:101 hr 6 mins ago 0xdb6f1920a889355780af7570773609bd8cb1f498 0x4bf331aa2bfb0869315fb81a350d109f4839f81b0.014652539767214953 BNB
0xa2f7e2fdf546374f74d6f24ddfa78b0b042c958f86add234bf9f11096f976f7682456812021-06-12 23:15:101 hr 6 mins ago 0xdb6f1920a889355780af7570773609bd8cb1f498 0x4bf331aa2bfb0869315fb81a350d109f4839f81b0.014614968415217965 BNB
0x5b66bf3b56f5b97e2dff654f9217fe2bae8f2c124ae5c4f8490dfce4546b344782456202021-06-12 23:12:071 hr 9 mins ago 0x4bf331aa2bfb0869315fb81a350d109f4839f81b0x25132de651514b6c417c734558694fc576294d030.048440729563102548 BNB
0x5b66bf3b56f5b97e2dff654f9217fe2bae8f2c124ae5c4f8490dfce4546b344782456202021-06-12 23:12:071 hr 9 mins ago Binance: WBNB Token 0x4bf331aa2bfb0869315fb81a350d109f4839f81b0.024218989049695129 BNB
0x5b66bf3b56f5b97e2dff654f9217fe2bae8f2c124ae5c4f8490dfce4546b344782456202021-06-12 23:12:071 hr 9 mins ago 0xdb6f1920a889355780af7570773609bd8cb1f498 0x4bf331aa2bfb0869315fb81a350d109f4839f81b0.024221740513407419 BNB
0x9e0edf99396fc30a4e7dc68c761260606604e4723347c681b3aaad6a4ea294c582453542021-06-12 22:58:491 hr 22 mins ago 0x4bf331aa2bfb0869315fb81a350d109f4839f81b0xcba95c48589781c337b3e2fbdd118b649bbe935b0.000936098791013704 BNB
0x9e0edf99396fc30a4e7dc68c761260606604e4723347c681b3aaad6a4ea294c582453542021-06-12 22:58:491 hr 22 mins ago Binance: WBNB Token 0x4bf331aa2bfb0869315fb81a350d109f4839f81b0.000468446299371791 BNB
0x9e0edf99396fc30a4e7dc68c761260606604e4723347c681b3aaad6a4ea294c582453542021-06-12 22:58:491 hr 22 mins ago 0xdb6f1920a889355780af7570773609bd8cb1f498 0x4bf331aa2bfb0869315fb81a350d109f4839f81b0.000467652491641913 BNB
0x0260cb261bf75fbc41e7db18d4721a47bf5428275e5f3e07c09aec69d093dc9282434712021-06-12 21:23:032 hrs 58 mins ago 0x4bf331aa2bfb0869315fb81a350d109f4839f81b0x61f69a15a2b59f60c43bfa95a31999056bd803390.000948097698292736 BNB
0x0260cb261bf75fbc41e7db18d4721a47bf5428275e5f3e07c09aec69d093dc9282434712021-06-12 21:23:032 hrs 58 mins ago Binance: WBNB Token 0x4bf331aa2bfb0869315fb81a350d109f4839f81b0.000473451028654058 BNB
0x0260cb261bf75fbc41e7db18d4721a47bf5428275e5f3e07c09aec69d093dc9282434712021-06-12 21:23:032 hrs 58 mins ago 0xdb6f1920a889355780af7570773609bd8cb1f498 0x4bf331aa2bfb0869315fb81a350d109f4839f81b0.000474646669638678 BNB
0xc30f48ab772569af5c207c61fa01b78e7f9d3446e1f35f2a865a348eef9b852082433422021-06-12 21:16:363 hrs 5 mins ago 0x4bf331aa2bfb0869315fb81a350d109f4839f81b0xd638353b083008610a34c73aa33b90a325ce50af1.097057557742004422 BNB
0xc30f48ab772569af5c207c61fa01b78e7f9d3446e1f35f2a865a348eef9b852082433422021-06-12 21:16:363 hrs 5 mins ago Binance: WBNB Token 0x4bf331aa2bfb0869315fb81a350d109f4839f81b0.548917850284497299 BNB
0xc30f48ab772569af5c207c61fa01b78e7f9d3446e1f35f2a865a348eef9b852082433422021-06-12 21:16:363 hrs 5 mins ago 0xdb6f1920a889355780af7570773609bd8cb1f498 0x4bf331aa2bfb0869315fb81a350d109f4839f81b0.548139707457507123 BNB
0x2d667a902dd0162a98729a57490c922acdb84c0837d226344c3c75adf918ed9882433282021-06-12 21:15:543 hrs 5 mins ago 0x4bf331aa2bfb0869315fb81a350d109f4839f81b0x641d98a95dc91b93651b10ff6f9c125fffa28bae0.011853041939789829 BNB
0x2d667a902dd0162a98729a57490c922acdb84c0837d226344c3c75adf918ed9882433282021-06-12 21:15:543 hrs 5 mins ago Binance: WBNB Token 0x4bf331aa2bfb0869315fb81a350d109f4839f81b0.005925790474488392 BNB
0x2d667a902dd0162a98729a57490c922acdb84c0837d226344c3c75adf918ed9882433282021-06-12 21:15:543 hrs 5 mins ago 0xdb6f1920a889355780af7570773609bd8cb1f498 0x4bf331aa2bfb0869315fb81a350d109f4839f81b0.005927251465301437 BNB
0x3101a95e8d54f4579795a332da88655ba0c7ba3206a86043e80b883866ee673c82431302021-06-12 21:05:243 hrs 16 mins ago 0x4bf331aa2bfb0869315fb81a350d109f4839f81b0xf46e4d8b51514862ce30dad93f8923a1de1baac10.02367440789794218 BNB
0x3101a95e8d54f4579795a332da88655ba0c7ba3206a86043e80b883866ee673c82431302021-06-12 21:05:243 hrs 16 mins ago Binance: WBNB Token 0x4bf331aa2bfb0869315fb81a350d109f4839f81b0.011850154444954648 BNB
0x3101a95e8d54f4579795a332da88655ba0c7ba3206a86043e80b883866ee673c82431302021-06-12 21:05:243 hrs 16 mins ago 0xdb6f1920a889355780af7570773609bd8cb1f498 0x4bf331aa2bfb0869315fb81a350d109f4839f81b0.011824253452987532 BNB
0x10949580939d2738b08da04772f999c1c7ed81aa9a57790ef02772403c153eea82412712021-06-12 19:31:554 hrs 49 mins ago 0x4bf331aa2bfb0869315fb81a350d109f4839f81b0x86e2f67b092a8fcfbe0ff5a61d2577c4df07332e0.024256925088906751 BNB
[ Download CSV Export 
Loading

Contract Source Code Verified (Exact Match)

Contract Name:
Pancakeswap_ZapOut_V3

Compiler Version
v0.8.4+commit.c7e474f2

Optimization Enabled:
Yes with 200 runs

Other Settings:
default evmVersion, GNU GPLv2 license

Contract Source Code (Solidity Standard Json-Input format)

File 1 of 8 : Pancakeswap_ZapOut_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 removes liquidity from Pancakeswap pools on BSC, receiving ETH, tokens 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 Pancakeswap_ZapOut_V3 is ZapOutBaseV3 {
    using SafeERC20 for IERC20;

    uint256 private constant deadline =
        0xf000000000000000000000000000000000000000000000000000000000000000;

    uint256 private constant permitAllowance = 79228162514260000000000000000;

    IUniswapV2Router02 private constant pancakeswapRouter =
        IUniswapV2Router02(0x10ED43C718714eb63d5aA57B78B54704E256024E);
    IUniswapV2Factory private constant pancakeswapFactoryAddress =
        IUniswapV2Factory(0xcA143Ce32Fe78f1f7019d7d551a6402fC5350c73);

    address private constant wbnbTokenAddress =
        0xbb4CdB9CBd36B01bD1cBaEBF2De08d9173bc095c;

    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(pancakeswapRouter), incomingLP);

        if (token0 == wbnbTokenAddress || token1 == wbnbTokenAddress) {
            address _token = token0 == wbnbTokenAddress ? token1 : token0;
            (amountA, amountB) = pancakeswapRouter.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) = pancakeswapRouter.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 permitSig Signature for permit
    @return amountA Quantity of tokenA received
    @return amountB Quantity of tokenB received
    */
    function ZapOut2PairTokenWithPermit(
        address fromPoolAddress,
        uint256 incomingLP,
        address affiliate,
        bytes calldata permitSig
    ) external stopInEmergency returns (uint256 amountA, uint256 amountB) {
        // permit
        _permit(fromPoolAddress, permitAllowance, permitSig);

        (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 permitSig Signature for permit
    @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 calldata permitSig,
        address[] memory swapTargets,
        bytes[] memory swapData,
        address affiliate
    ) public stopInEmergency returns (uint256) {
        // permit
        _permit(fromPoolAddress, permitAllowance, permitSig);

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

    function _permit(
        address fromPoolAddress,
        uint256 amountIn,
        bytes memory permitSig
    ) internal {
        require(permitSig.length == 65, "Invalid signature length");

        bytes32 r;
        bytes32 s;
        uint8 v;
        assembly {
            r := mload(add(permitSig, 32))
            s := mload(add(permitSig, 64))
            v := byte(0, mload(add(permitSig, 96)))
        }
        IUniswapV2Pair(fromPoolAddress).permit(
            msg.sender,
            address(this),
            amountIn,
            deadline,
            v,
            r,
            s
        );
    }

    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(pancakeswapRouter), incomingLP);

        (amount0, amount1) = pancakeswapRouter.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 == wbnbTokenAddress && toToken == address(0)) {
            IWETH(wbnbTokenAddress).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 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":"permitSig","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":"permitSig","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"}]

60806040526000805460ff60a01b191690553480156200001e57600080fd5b5060405162003271380380620032718339810160408190526200004191620000e0565b600080546001600160a01b03191633908117825560405184928492918291907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908290a350600291909155600355505073def1c0ded9bec7f1a1670819833240f027b25eff60005260076020527ff6019cd1944dc466e824190b288e5a63528dd4c9a6d8cbd707956fd30d2f1e0d805460ff1916600117905562000104565b60008060408385031215620000f3578182fd5b505080516020909101519092909150565b61315d80620001146000396000f3fe6080604052600436106101445760003560e01c8063715018a6116100b65780639779d1a61161006f5780639779d1a614610435578063cfd7789c14610465578063d408f6571461049a578063f21d3ab5146104ca578063f2fde38b146104ea578063fbec27bf1461050a57600080fd5b8063715018a61461034857806375f12b211461035d5780637ee992831461037e5780638da5cb5b146103cd57806391027c5b146103f55780639735a6341461041557600080fd5b8063247482ba11610108578063247482ba146102725780633ff428c7146102925780634f51e294146102b2578063550bfa56146102f25780635de0398e146103125780635ecb16cd1461032857600080fd5b806301e980d4146101a55780630dc9de85146101c55780631385d24c146101e55780631781261f146101fa57806318b135e31461024557600080fd5b366101a0573332141561019e5760405162461bcd60e51b815260206004820152601860248201527f446f206e6f742073656e6420455448206469726563746c79000000000000000060448201526064015b60405180910390fd5b005b600080fd5b3480156101b157600080fd5b5061019e6101c0366004612e5e565b61052a565b3480156101d157600080fd5b5061019e6101e0366004612d7d565b6105b4565b3480156101f157600080fd5b5061019e61080f565b34801561020657600080fd5b50610232610215366004612aab565b600560209081526000928352604080842090915290825290205481565b6040519081526020015b60405180910390f35b34801561025157600080fd5b50610232610260366004612a73565b60066020526000908152604090205481565b34801561027e57600080fd5b5061023261028d366004612ae3565b61085a565b34801561029e57600080fd5b5061019e6102ad366004612c73565b6109dc565b3480156102be57600080fd5b506102e26102cd366004612a73565b60046020526000908152604090205460ff1681565b604051901515815260200161023c565b3480156102fe57600080fd5b5061019e61030d366004612e5e565b610a31565b34801561031e57600080fd5b5061023260025481565b34801561033457600080fd5b5061019e610343366004612d7d565b610ab1565b34801561035457600080fd5b5061019e610d22565b34801561036957600080fd5b506000546102e290600160a01b900460ff1681565b34801561038a57600080fd5b5061039e610399366004612ca0565b610d96565b6040805194855260208501939093526001600160a01b039182169284019290925216606082015260800161023c565b3480156103d957600080fd5b506000546040516001600160a01b03909116815260200161023c565b34801561040157600080fd5b50610232610410366004612ba4565b611035565b34801561042157600080fd5b5061019e610430366004612dbd565b6110cc565b34801561044157600080fd5b506102e2610450366004612a73565b60076020526000908152604090205460ff1681565b34801561047157600080fd5b50610485610480366004612d0c565b6111f6565b6040805192835260208301919091520161023c565b3480156104a657600080fd5b506102e26104b5366004612a73565b60016020526000908152604090205460ff1681565b3480156104d657600080fd5b506104856104e5366004612ccb565b611289565b3480156104f657600080fd5b5061019e610505366004612a73565b611742565b34801561051657600080fd5b5061019e610525366004612c73565b61182c565b6000546001600160a01b031633146105545760405162461bcd60e51b815260040161019590612f96565b60648111156105af5760405162461bcd60e51b815260206004820152602160248201527f416666696c696174652053706c69742056616c7565206e6f7420616c6c6f77656044820152601960fa1b6064820152608401610195565b600355565b6000805b8281101561080957336000908152600560205260408120908585848181106105f057634e487b7160e01b600052603260045260246000fd5b90506020020160208101906106059190612a73565b6001600160a01b0316815260208082019290925260409081016000908120543382526005909352908120919350908186868581811061065457634e487b7160e01b600052603260045260246000fd5b90506020020160208101906106699190612a73565b6001600160a01b03166001600160a01b031681526020019081526020016000208190555081600660008686858181106106b257634e487b7160e01b600052603260045260246000fd5b90506020020160208101906106c79190612a73565b6001600160a01b03166001600160a01b03168152602001908152602001600020546106f29190613077565b6006600086868581811061071657634e487b7160e01b600052603260045260246000fd5b905060200201602081019061072b9190612a73565b6001600160a01b0316815260208101919091526040016000205573eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee84848381811061077a57634e487b7160e01b600052603260045260246000fd5b905060200201602081019061078f9190612a73565b6001600160a01b031614156107ad576107a83383611881565b6107f7565b6107f733838686858181106107d257634e487b7160e01b600052603260045260246000fd5b90506020020160208101906107e79190612a73565b6001600160a01b0316919061199a565b80610801816130ba565b9150506105b8565b50505050565b6000546001600160a01b031633146108395760405162461bcd60e51b815260040161019590612f96565b6000805460ff60a01b198116600160a01b9182900460ff1615909102179055565b60008054600160a01b900460ff16156108855760405162461bcd60e51b815260040161019590612f6a565b6000806108938a8a866119fd565b915091506108a58a83838e8b8b611c70565b9250878310156108e75760405162461bcd60e51b815260206004820152600d60248201526c4869676820536c69707061676560981b6044820152606401610195565b60006001600160a01b038c166109565761091873eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee85886001611e84565b9050336108fc6109288387613077565b6040518115909202916000818181858888f19350505050158015610950573d6000803e3d6000fd5b50610984565b6109638c85886001611e84565b9050610984336109738387613077565b6001600160a01b038f16919061199a565b61098e8185613077565b93507ff2d3e32195f8631c70e1d996c9bd5d4a3369d0580786dcd662bf13139310355d338c8e876040516109c59493929190612ecd565b60405180910390a150505098975050505050505050565b6000546001600160a01b03163314610a065760405162461bcd60e51b815260040161019590612f96565b6001600160a01b03919091166000908152600460205260409020805460ff1916911515919091179055565b6000546001600160a01b03163314610a5b5760405162461bcd60e51b815260040161019590612f96565b6064811115610aac5760405162461bcd60e51b815260206004820152601a60248201527f476f6f6457696c6c2056616c7565206e6f7420616c6c6f7765640000000000006044820152606401610195565b600255565b6000546001600160a01b03163314610adb5760405162461bcd60e51b815260040161019590612f96565b60005b81811015610d1d57600073eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee848484818110610b1d57634e487b7160e01b600052603260045260246000fd5b9050602002016020810190610b329190612a73565b6001600160a01b03161415610bc05760066000858585818110610b6557634e487b7160e01b600052603260045260246000fd5b9050602002016020810190610b7a9190612a73565b6001600160a01b03168152602081019190915260400160002054610b9e9047613077565b9050610bbb610bb56000546001600160a01b031690565b82611881565b610d0a565b60066000858585818110610be457634e487b7160e01b600052603260045260246000fd5b9050602002016020810190610bf99190612a73565b6001600160a01b03166001600160a01b0316815260200190815260200160002054848484818110610c3a57634e487b7160e01b600052603260045260246000fd5b9050602002016020810190610c4f9190612a73565b6040516370a0823160e01b81523060048201526001600160a01b0391909116906370a082319060240160206040518083038186803b158015610c9057600080fd5b505afa158015610ca4573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610cc89190612e76565b610cd29190613077565b9050610d0a610ce96000546001600160a01b031690565b828686868181106107d257634e487b7160e01b600052603260045260246000fd5b5080610d15816130ba565b915050610ade565b505050565b6000546001600160a01b03163314610d4c5760405162461bcd60e51b815260040161019590612f96565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6000806000806000869050806001600160a01b0316630dfe16816040518163ffffffff1660e01b815260040160206040518083038186803b158015610dda57600080fd5b505afa158015610dee573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e129190612a8f565b9250806001600160a01b031663d21220a76040518163ffffffff1660e01b815260040160206040518083038186803b158015610e4d57600080fd5b505afa158015610e61573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e859190612a8f565b6040516370a0823160e01b81526001600160a01b0389811660048301529193506000918516906370a082319060240160206040518083038186803b158015610ecc57600080fd5b505afa158015610ee0573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610f049190612e76565b6040516370a0823160e01b81526001600160a01b038a811660048301529192506000918516906370a082319060240160206040518083038186803b158015610f4b57600080fd5b505afa158015610f5f573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610f839190612e76565b90506000836001600160a01b03166318160ddd6040518163ffffffff1660e01b815260040160206040518083038186803b158015610fc057600080fd5b505afa158015610fd4573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610ff89190612e76565b905080611005848b613058565b61100f9190613038565b97508061101c838b613058565b6110269190613038565b96505050505092959194509250565b60008054600160a01b900460ff16156110605760405162461bcd60e51b815260040161019590612f6a565b6110ad896bfffffffffff096fb4da2000088888080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250611faf92505050565b6110be8a8a8a8a888888600061085a565b9a9950505050505050505050565b6000546001600160a01b031633146110f65760405162461bcd60e51b815260040161019590612f96565b82811461113c5760405162461bcd60e51b8152602060048201526014602482015273092dcecc2d8d2c84092dce0eae840d8cadccee8d60631b6044820152606401610195565b60005b838110156111ef5782828281811061116757634e487b7160e01b600052603260045260246000fd5b905060200201602081019061117c9190612e26565b600760008787858181106111a057634e487b7160e01b600052603260045260246000fd5b90506020020160208101906111b59190612a73565b6001600160a01b031681526020810191909152604001600020805460ff1916911515919091179055806111e7816130ba565b91505061113f565b5050505050565b600080548190600160a01b900460ff16156112235760405162461bcd60e51b815260040161019590612f6a565b611270876bfffffffffff096fb4da2000086868080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250611faf92505050565b61127b878787611289565b909890975095505050505050565b600080548190600160a01b900460ff16156112b65760405162461bcd60e51b815260040161019590612f6a565b846001600160a01b03811661130d5760405162461bcd60e51b815260206004820152601b60248201527f506f6f6c2043616e6e6f74206265205a65726f204164647265737300000000006044820152606401610195565b6000816001600160a01b0316630dfe16816040518163ffffffff1660e01b815260040160206040518083038186803b15801561134857600080fd5b505afa15801561135c573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906113809190612a8f565b90506000826001600160a01b031663d21220a76040518163ffffffff1660e01b815260040160206040518083038186803b1580156113bd57600080fd5b505afa1580156113d1573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906113f59190612a8f565b905061140c6001600160a01b03891633308a6120a4565b61142b887310ed43c718714eb63d5aa57b78b54704e256024e896120dc565b6001600160a01b03821673bb4cdb9cbd36b01bd1cbaebf2de08d9173bc095c148061147257506001600160a01b03811673bb4cdb9cbd36b01bd1cbaebf2de08d9173bc095c145b156115cd5760006001600160a01b03831673bb4cdb9cbd36b01bd1cbaebf2de08d9173bc095c146114a357826114a5565b815b604051629d473b60e21b81526001600160a01b0382166004820152602481018a90526001604482018190526064820152306084820152600f60fc1b60a48201529091507310ed43c718714eb63d5aa57b78b54704e256024e906302751cec9060c4016040805180830381600087803b15801561152057600080fd5b505af1158015611534573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906115589190612e8e565b9096509450600061156c82888a6001611e84565b9050600061159173eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee888b6001611e84565b90506115b2336115a1848b613077565b6001600160a01b038616919061199a565b6115c5336115c0838a613077565b611881565b5050506116bd565b604051635d5155ef60e11b81527310ed43c718714eb63d5aa57b78b54704e256024e9063baa2abde9061161590859085908c9060019081903090600f60fc1b90600401612ef7565b6040805180830381600087803b15801561162e57600080fd5b505af1158015611642573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906116669190612e8e565b9095509350600061167a8387896001611e84565b9050600061168b83878a6001611e84565b90506116ac3361169b848a613077565b6001600160a01b038716919061199a565b6116ba336115a18389613077565b50505b7ff2d3e32195f8631c70e1d996c9bd5d4a3369d0580786dcd662bf13139310355d338984886040516116f29493929190612ecd565b60405180910390a17ff2d3e32195f8631c70e1d996c9bd5d4a3369d0580786dcd662bf13139310355d3389838760405161172f9493929190612ecd565b60405180910390a1505050935093915050565b6000546001600160a01b0316331461176c5760405162461bcd60e51b815260040161019590612f96565b6001600160a01b0381166117d15760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608401610195565b600080546040516001600160a01b03808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a3600080546001600160a01b0319166001600160a01b0392909216919091179055565b6000546001600160a01b031633146118565760405162461bcd60e51b815260040161019590612f96565b6001600160a01b03919091166000908152600160205260409020805460ff1916911515919091179055565b804710156118d15760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a20696e73756666696369656e742062616c616e63650000006044820152606401610195565b6000826001600160a01b03168260405160006040518083038185875af1925050503d806000811461191e576040519150601f19603f3d011682016040523d82523d6000602084013e611923565b606091505b5050905080610d1d5760405162461bcd60e51b815260206004820152603a60248201527f416464726573733a20756e61626c6520746f2073656e642076616c75652c207260448201527f6563697069656e74206d617920686176652072657665727465640000000000006064820152608401610195565b6040516001600160a01b038316602482015260448101829052610d1d90849063a9059cbb60e01b906064015b60408051601f198184030181529190526020810180516001600160e01b03166001600160e01b031990931692909217909152612105565b600080846001600160a01b038116611a575760405162461bcd60e51b815260206004820152601b60248201527f506f6f6c2043616e6e6f74206265205a65726f204164647265737300000000006044820152606401610195565b6000816001600160a01b0316630dfe16816040518163ffffffff1660e01b815260040160206040518083038186803b158015611a9257600080fd5b505afa158015611aa6573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611aca9190612a8f565b90506000826001600160a01b031663d21220a76040518163ffffffff1660e01b815260040160206040518083038186803b158015611b0757600080fd5b505afa158015611b1b573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611b3f9190612a8f565b9050611b4c8888886121d7565b50611b6c887310ed43c718714eb63d5aa57b78b54704e256024e896120dc565b604051635d5155ef60e11b81527310ed43c718714eb63d5aa57b78b54704e256024e9063baa2abde90611bb490859085908c9060019081903090600f60fc1b90600401612ef7565b6040805180830381600087803b158015611bcd57600080fd5b505af1158015611be1573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611c059190612e8e565b90955093508415801590611c195750600084115b611c655760405162461bcd60e51b815260206004820152601e60248201527f52656d6f76656420496e73756666696369656e74204c697175696469747900006044820152606401610195565b505050935093915050565b600080876001600160a01b0316630dfe16816040518163ffffffff1660e01b815260040160206040518083038186803b158015611cac57600080fd5b505afa158015611cc0573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611ce49190612a8f565b90506000886001600160a01b031663d21220a76040518163ffffffff1660e01b815260040160206040518083038186803b158015611d2157600080fd5b505afa158015611d35573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611d599190612a8f565b9050856001600160a01b0316826001600160a01b03161415611d8657611d7f8884613020565b9250611df0565b611de382878a88600081518110611dad57634e487b7160e01b600052603260045260246000fd5b602002602001015188600081518110611dd657634e487b7160e01b600052603260045260246000fd5b60200260200101516122ff565b611ded9084613020565b92505b856001600160a01b0316816001600160a01b03161415611e1b57611e148784613020565b9250611e78565b611e6b81878988600181518110611e4257634e487b7160e01b600052603260045260246000fd5b602002602001015188600181518110611dd657634e487b7160e01b600052603260045260246000fd5b611e759084613020565b92505b50509695505050505050565b3360009081526001602052604081205460ff16828015611ea2575080155b8015611eb057506000600254115b15611fa65761271060025486611ec69190613058565b611ed09190613038565b6001600160a01b03851660009081526004602052604090205490925060ff1615611fa6576001600160a01b038616611f1a5773eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee95505b6000606460035484611f2c9190613058565b611f369190613038565b6001600160a01b038087166000908152600560209081526040808320938c16835292905290812080549293508392909190611f72908490613020565b90915550506001600160a01b03871660009081526006602052604081208054839290611f9f908490613020565b9091555050505b50949350505050565b80516041146120005760405162461bcd60e51b815260206004820152601860248201527f496e76616c6964207369676e6174757265206c656e67746800000000000000006044820152606401610195565b60208101516040808301516060840151915163d505accf60e01b815233600482015230602482015260448101869052600f60fc1b606482015260009290921a6084830181905260a4830184905260c4830182905290916001600160a01b0387169063d505accf9060e401600060405180830381600087803b15801561208457600080fd5b505af1158015612098573d6000803e3d6000fd5b50505050505050505050565b6040516001600160a01b03808516602483015283166044820152606481018290526108099085906323b872dd60e01b906084016119c6565b6120f16001600160a01b038416836000612553565b610d1d6001600160a01b0384168383612553565b600061215a826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b03166126779092919063ffffffff16565b805190915015610d1d57808060200190518101906121789190612e42565b610d1d5760405162461bcd60e51b815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e6044820152691bdd081cdd58d8d9595960b21b6064820152608401610195565b600081156122e057333b6122425760405162461bcd60e51b815260206004820152602c60248201527f4552523a2073686f756c6453656c6c456e7469726542616c616e63652069732060448201526b7472756520666f7220454f4160a01b6064820152608401610195565b604051636eb1769f60e11b81523360048201523060248201526000906001600160a01b0386169063dd62ed3e9060440160206040518083038186803b15801561228a57600080fd5b505afa15801561229e573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906122c29190612e76565b90506122d96001600160a01b0386163330846120a4565b90506122f8565b6122f56001600160a01b0385163330866120a4565b50815b9392505050565b60006001600160a01b03861673bb4cdb9cbd36b01bd1cbaebf2de08d9173bc095c14801561233457506001600160a01b038516155b156123a657604051632e1a7d4d60e01b81526004810185905273bb4cdb9cbd36b01bd1cbaebf2de08d9173bc095c90632e1a7d4d90602401600060405180830381600087803b15801561238657600080fd5b505af115801561239a573d6000803e3d6000fd5b5050505083905061254a565b60006001600160a01b0387166123bd5750836123c8565b6123c88785876120dc565b60006123d38761268e565b6001600160a01b03861660009081526007602052604090205490915060ff166124365760405162461bcd60e51b815260206004820152601560248201527415185c99d95d081b9bdd08105d5d1a1bdc9a5e9959605a1b6044820152606401610195565b6000856001600160a01b031683866040516124519190612eb1565b60006040518083038185875af1925050503d806000811461248e576040519150601f19603f3d011682016040523d82523d6000602084013e612493565b606091505b50509050806124dc5760405162461bcd60e51b81526020600482015260156024820152744572726f72205377617070696e6720546f6b656e7360581b6044820152606401610195565b6000826124e88a61268e565b6124f29190613077565b9050600081116125445760405162461bcd60e51b815260206004820152601f60248201527f5377617070656420746f20496e76616c696420496e7465726d656469617465006044820152606401610195565b93505050505b95945050505050565b8015806125dc5750604051636eb1769f60e11b81523060048201526001600160a01b03838116602483015284169063dd62ed3e9060440160206040518083038186803b1580156125a257600080fd5b505afa1580156125b6573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906125da9190612e76565b155b6126475760405162461bcd60e51b815260206004820152603660248201527f5361666545524332303a20617070726f76652066726f6d206e6f6e2d7a65726f60448201527520746f206e6f6e2d7a65726f20616c6c6f77616e636560501b6064820152608401610195565b6040516001600160a01b038316602482015260448101829052610d1d90849063095ea7b360e01b906064016119c6565b60606126868484600085612724565b949350505050565b60006001600160a01b0382166126a5575047919050565b6040516370a0823160e01b81523060048201526001600160a01b038316906370a082319060240160206040518083038186803b1580156126e457600080fd5b505afa1580156126f8573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061271c9190612e76565b90505b919050565b6060824710156127855760405162461bcd60e51b815260206004820152602660248201527f416464726573733a20696e73756666696369656e742062616c616e636520666f6044820152651c8818d85b1b60d21b6064820152608401610195565b843b6127d35760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e74726163740000006044820152606401610195565b600080866001600160a01b031685876040516127ef9190612eb1565b60006040518083038185875af1925050503d806000811461282c576040519150601f19603f3d011682016040523d82523d6000602084013e612831565b606091505b509150915061284182828661284c565b979650505050505050565b6060831561285b5750816122f8565b82511561286b5782518084602001fd5b8160405162461bcd60e51b81526004016101959190612f37565b803561271f81613101565b60008083601f8401126128a1578182fd5b50813567ffffffffffffffff8111156128b8578182fd5b6020830191508360208260051b85010111156128d357600080fd5b9250929050565b600082601f8301126128ea578081fd5b813560206128ff6128fa83612ffc565b612fcb565b80838252828201915082860187848660051b890101111561291e578586fd5b855b8581101561294557813561293381613101565b84529284019290840190600101612920565b5090979650505050505050565b6000601f8381840112612963578182fd5b823560206129736128fa83612ffc565b80838252828201915082870188848660051b8a01011115612992578687fd5b865b85811015612a2557813567ffffffffffffffff808211156129b357898afd5b818b0191508b603f8301126129c657898afd5b868201356040828211156129dc576129dc6130eb565b6129ed828c01601f19168a01612fcb565b92508183528d81838601011115612a02578b8cfd5b818185018a85013750810187018a90528552509284019290840190600101612994565b509098975050505050505050565b60008083601f840112612a44578182fd5b50813567ffffffffffffffff811115612a5b578182fd5b6020830191508360208285010111156128d357600080fd5b600060208284031215612a84578081fd5b81356122f881613101565b600060208284031215612aa0578081fd5b81516122f881613101565b60008060408385031215612abd578081fd5b8235612ac881613101565b91506020830135612ad881613101565b809150509250929050565b600080600080600080600080610100898b031215612aff578384fd5b8835612b0a81613101565b97506020890135612b1a81613101565b96506040890135955060608901359450608089013567ffffffffffffffff80821115612b44578586fd5b612b508c838d016128da565b955060a08b0135915080821115612b65578485fd5b50612b728b828c01612952565b93505060c0890135612b8381613101565b915060e0890135612b9381613119565b809150509295985092959890939650565b60008060008060008060008060006101008a8c031215612bc2578081fd5b612bcb8a612885565b9850612bd960208b01612885565b975060408a0135965060608a0135955060808a013567ffffffffffffffff80821115612c03578283fd5b612c0f8d838e01612a33565b909750955060a08c0135915080821115612c27578283fd5b612c338d838e016128da565b945060c08c0135915080821115612c48578283fd5b50612c558c828d01612952565b925050612c6460e08b01612885565b90509295985092959850929598565b60008060408385031215612c85578182fd5b8235612c9081613101565b91506020830135612ad881613119565b60008060408385031215612cb2578182fd5b8235612cbd81613101565b946020939093013593505050565b600080600060608486031215612cdf578081fd5b8335612cea81613101565b9250602084013591506040840135612d0181613101565b809150509250925092565b600080600080600060808688031215612d23578283fd5b8535612d2e81613101565b9450602086013593506040860135612d4581613101565b9250606086013567ffffffffffffffff811115612d60578182fd5b612d6c88828901612a33565b969995985093965092949392505050565b60008060208385031215612d8f578182fd5b823567ffffffffffffffff811115612da5578283fd5b612db185828601612890565b90969095509350505050565b60008060008060408587031215612dd2578182fd5b843567ffffffffffffffff80821115612de9578384fd5b612df588838901612890565b90965094506020870135915080821115612e0d578384fd5b50612e1a87828801612890565b95989497509550505050565b600060208284031215612e37578081fd5b81356122f881613119565b600060208284031215612e53578081fd5b81516122f881613119565b600060208284031215612e6f578081fd5b5035919050565b600060208284031215612e87578081fd5b5051919050565b60008060408385031215612ea0578182fd5b505080516020909101519092909150565b60008251612ec381846020870161308e565b9190910192915050565b6001600160a01b039485168152928416602084015292166040820152606081019190915260800190565b6001600160a01b039788168152958716602087015260408601949094526060850192909252608084015290921660a082015260c081019190915260e00190565b6020815260008251806020840152612f5681604085016020870161308e565b601f01601f19169190910160400192915050565b60208082526012908201527115195b5c1bdc985c9a5b1e4814185d5cd95960721b604082015260600190565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b604051601f8201601f1916810167ffffffffffffffff81118282101715612ff457612ff46130eb565b604052919050565b600067ffffffffffffffff821115613016576130166130eb565b5060051b60200190565b60008219821115613033576130336130d5565b500190565b60008261305357634e487b7160e01b81526012600452602481fd5b500490565b6000816000190483118215151615613072576130726130d5565b500290565b600082821015613089576130896130d5565b500390565b60005b838110156130a9578181015183820152602001613091565b838111156108095750506000910152565b60006000198214156130ce576130ce6130d5565b5060010190565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052604160045260246000fd5b6001600160a01b038116811461311657600080fd5b50565b801515811461311657600080fdfea2646970667358221220ec8ad01335306328dd1699c8f26917f495f8be69debc1b11da8ba482f1b4877764736f6c6343000804003300000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000

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

00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000

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


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