Contract 0x2801a71605b5E25816235C7f3Cb779F4c9dD60Ee 2

 
Ad
Crypto.com
Txn Hash Method
Block
From
To
Value
0xd7a25e23fbe25070048e37a0c34ad58db334c8d44d3f9e781ef00d310ae2c041Zap In132524082021-09-18 22:24:0017 hrs 57 mins ago0xe87db83e9563161ae58daa9be62de5883959372f IN  0x2801a71605b5e25816235c7f3cb779f4c9dd60ee0.04 Ether0.01808874 45
0x14a5b5bd123681d80ee549f18dfbaa981617696ec944ef3b7f52302b31b27097Zap Out132482082021-09-18 7:01:001 day 9 hrs agoENS Name willhamilton.eth IN  0x2801a71605b5e25816235c7f3cb779f4c9dd60ee0 Ether0.04062508 40
0x09f20468a34fcb7773e049a4c83a3cb31949d2a233c3ddec5bda0c8c5c327c41Zap In132400222021-09-17 0:28:382 days 15 hrs ago0x0f1042f57e2aad1855457bd8efb3bd2263612992 IN  0x2801a71605b5e25816235c7f3cb779f4c9dd60ee0.28 Ether0.022134322 59
0x4a9966bf3d747470600190c787f621c5c32ad0e657d6d186b35a11f822346541Zap In132395232021-09-16 22:41:542 days 17 hrs agoENS Name linkfighterog.eth IN  0x2801a71605b5e25816235c7f3cb779f4c9dd60ee0 Ether0.02384231553
0x45f370d8e0418b37fdd8fae863d3d4be5bd92fd0a9e9322e9c6521f33e691dcbZap Out132321732021-09-15 19:23:233 days 20 hrs ago0x28c24141ec700667099bf1369bf1befd1faf1d03 IN  0x2801a71605b5e25816235c7f3cb779f4c9dd60ee0 Ether0.031503192638 74.241499947
0x54f8a722a06f6ffeca68ff46afd58f67b41f6efce90f90e81655a5574cd9bc25Zap Out132314852021-09-15 16:48:103 days 23 hrs ago0x910a4f57d4de4924c31fbccd9243a23939b00e75 IN  0x2801a71605b5e25816235c7f3cb779f4c9dd60ee0 Ether0.0259799274
0x15648c39d2f6ed7d74bcaf0f900c895cc461ea58f33683aa6575e9cfa8b996a1Zap In132313212021-09-15 16:11:224 days 10 mins ago0x4316d175db9b7bcc6edd00513f0389dfa967bd77 IN  0x2801a71605b5e25816235c7f3cb779f4c9dd60ee0 Ether0.041486057106 100.096890421
0xd38218c0a450e1962345482820753947cb0df20b31097dd46d39242140304a8bZap Out132294252021-09-15 9:12:074 days 7 hrs ago0x397c16c3512392e28a1ccdf2e10e27d802edbfca IN  0x2801a71605b5e25816235c7f3cb779f4c9dd60ee0 Ether0.014295142197 37.61691441
0xfb561dfcf7b7ccb2bf06f25d5999197e70c8e2e92ea048d4775490e4b11da1caZap Out132262292021-09-14 21:20:584 days 19 hrs ago0xaf4e0fe30ec67d6957f89815a044d7d49422a8d2 IN  0x2801a71605b5e25816235c7f3cb779f4c9dd60ee0 Ether0.034795686 86
0x28f6e6253d6c986fdfcc836ed656d1ba64c2d1ece16d27aa3ea646c04a6d68b6Zap In132253832021-09-14 18:15:484 days 22 hrs ago0x6c1667b508d712976069aedcdb34cf74da095606 IN  0x2801a71605b5e25816235c7f3cb779f4c9dd60ee0.2 Ether0.02154885658
0x8004de9a3ca4e6010de704e741eed3ae3b6e0c86e2e80c123e075b48c72b06dfZap In132157242021-09-13 6:21:536 days 9 hrs ago0x855a608b74bcbc2551e53fb872ca2f09565eb196 IN  0x2801a71605b5e25816235c7f3cb779f4c9dd60ee0.03 Ether0.02706984868
0x2ac72f31a559b162ac83cea8edf89d189dd8e5b8a28e5b9671422fc10b14711aZap In132157082021-09-13 6:17:246 days 10 hrs ago0x855a608b74bcbc2551e53fb872ca2f09565eb196 IN  0x2801a71605b5e25816235c7f3cb779f4c9dd60ee0.0112453 Ether0.03123604872
0xc7967d6847b872d0aed058935e18fab7373104c63fab2276c1e4ac50e183f6d9Zap In132138872021-09-12 23:16:316 days 17 hrs ago0x9e0099f1a3367c1a3521fb39c52a403e6197e458 IN  0x2801a71605b5e25816235c7f3cb779f4c9dd60ee0 Ether0.01693258749
0xe3eeee395a53d07004ce0a824d7bf269f10c9a55c784a6d7561fbc4da09ce587Zap Out132110042021-09-12 12:36:467 days 3 hrs ago0x60342cf272c6d66ee2cc5a5143fe9fb069f06ad3 IN  0x2801a71605b5e25816235c7f3cb779f4c9dd60ee0 Ether0.00998193 42
0xc094a9643fbc6d3cb6608aeff731cb9c1404d87f1a4108bc0b5f89873912c868Zap In132088152021-09-12 4:37:017 days 11 hrs ago0x3cb304fe409312a93fdbf86ab260d04ef0d67823 IN  0x2801a71605b5e25816235c7f3cb779f4c9dd60ee0 Ether0.019007514 54
0x2ce251f255ff209ff7957aa88616b4cde1874d29bd9b5c6b0893e7b44827ce86Zap Out132069232021-09-11 21:35:377 days 18 hrs ago0x6700e4fef54c4a642d9cc429dee77980e00333f7 IN  0x2801a71605b5e25816235c7f3cb779f4c9dd60ee0 Ether0.01696262448
0x3ca2cb5c047f0d1a4d52aebadd981a6b6bb39a2483c82f38c232563352d6b295Zap In132052452021-09-11 15:27:108 days 54 mins agoENS Name linkfighterog.eth IN  0x2801a71605b5e25816235c7f3cb779f4c9dd60ee0 Ether0.01473082254
0x495fb518a1cdcbb989fdf4f6b4c8be7ae331b76fffc7e2116dd92c02100e96e7Zap Out132014352021-09-11 1:05:328 days 15 hrs ago0xbb33317a84ff0ec762f5e1145aa4bfe78183b782 IN  0x2801a71605b5e25816235c7f3cb779f4c9dd60ee0 Ether0.02366534469
0xa2e1e6468bb4a11c376748279a658d0fba48812581c3cb7267e595a5430c8522Zap In132012882021-09-11 0:32:318 days 15 hrs ago0x2f52362c266c1df356a2313f79e4be4e7de281cc IN  0x2801a71605b5e25816235c7f3cb779f4c9dd60ee0 Ether0.028430348 62
0xbc7436182df120f26bf213a1d9a256a21d571b5af31a1a0c29edb0f6c2fc8c9dZap Out131952772021-09-10 2:18:099 days 14 hrs ago0xe321bd63cde8ea046b382f82964575f2a5586474 IN  0x2801a71605b5e25816235c7f3cb779f4c9dd60ee0 Ether0.059091259762 96.904278132
0x8e2d3ebf29ccb25541feb49894f0f9268fda7deb5856776f630a495f01c8e513Zap In131930242021-09-09 18:01:009 days 22 hrs ago0x0c34c5d1115f6804df1b7ae48db8c1ecf8ecdeec IN  0x2801a71605b5e25816235c7f3cb779f4c9dd60ee0 Ether0.052291784142
0x2d3b34976a737a74bc5bc820382f2835e24e7e52f359d42875b28aebd1c0c57eZap In131905812021-09-09 8:55:1110 days 7 hrs ago0x295611934d70c0542c4311d466be56ed3a48de84 IN  0x2801a71605b5e25816235c7f3cb779f4c9dd60ee0 Ether0.034152252102
0x68477c4344bb28f206d11133884479b7ed1efc761e174b688e12ee5684c5dfdeZap Out131883662021-09-09 0:33:5910 days 15 hrs ago0x2a9d15df3c3722fdb0a15b2fea55d2b50ae2a154 IN  0x2801a71605b5e25816235c7f3cb779f4c9dd60ee0 Ether0.054814125 125
0xa0ed9cae1e2fbea2abb9c119005fdaaf52d7347a29a31d6e627c5eeea40e0b5bZap In131851902021-09-08 12:48:2211 days 3 hrs ago0xf5b27776c9b95201f82d1a0bd2812e1bdd107567 IN  0x2801a71605b5e25816235c7f3cb779f4c9dd60ee0.03601 Ether0.0343203 84
0xf88aa4f27803a23f3e6548c55faac90423218b1d1630a5aa6a2f98cc9d772959Zap In131789562021-09-07 13:40:5012 days 2 hrs ago0x397c16c3512392e28a1ccdf2e10e27d802edbfca IN  0x2801a71605b5e25816235c7f3cb779f4c9dd60ee0 Ether0.02955246 85
[ Download CSV Export 
Latest 25 internal transaction
Parent Txn Hash Block From To Value
0xd7a25e23fbe25070048e37a0c34ad58db334c8d44d3f9e781ef00d310ae2c041132524082021-09-18 22:24:0017 hrs 57 mins ago 0x2801a71605b5e25816235c7f3cb779f4c9dd60ee 0x: Exchange Proxy0.04 Ether
0x09f20468a34fcb7773e049a4c83a3cb31949d2a233c3ddec5bda0c8c5c327c41132400222021-09-17 0:28:382 days 15 hrs ago 0x2801a71605b5e25816235c7f3cb779f4c9dd60ee 0x: Exchange Proxy0.28 Ether
0x28f6e6253d6c986fdfcc836ed656d1ba64c2d1ece16d27aa3ea646c04a6d68b6132253832021-09-14 18:15:484 days 22 hrs ago 0x2801a71605b5e25816235c7f3cb779f4c9dd60ee 0x: Exchange Proxy0.2 Ether
0x8004de9a3ca4e6010de704e741eed3ae3b6e0c86e2e80c123e075b48c72b06df132157242021-09-13 6:21:536 days 9 hrs ago 0x2801a71605b5e25816235c7f3cb779f4c9dd60ee 0x: Exchange Proxy0.03 Ether
0x2ac72f31a559b162ac83cea8edf89d189dd8e5b8a28e5b9671422fc10b14711a132157082021-09-13 6:17:246 days 10 hrs ago 0x2801a71605b5e25816235c7f3cb779f4c9dd60ee 0x: Exchange Proxy0.0112453 Ether
0x495fb518a1cdcbb989fdf4f6b4c8be7ae331b76fffc7e2116dd92c02100e96e7132014352021-09-11 1:05:328 days 15 hrs ago 0x2801a71605b5e25816235c7f3cb779f4c9dd60ee0xbb33317a84ff0ec762f5e1145aa4bfe78183b7820.100006565435111408 Ether
0x495fb518a1cdcbb989fdf4f6b4c8be7ae331b76fffc7e2116dd92c02100e96e7132014352021-09-11 1:05:328 days 15 hrs ago Wrapped Ether 0x2801a71605b5e25816235c7f3cb779f4c9dd60ee0.100006565435111408 Ether
0xa0ed9cae1e2fbea2abb9c119005fdaaf52d7347a29a31d6e627c5eeea40e0b5b131851902021-09-08 12:48:2211 days 3 hrs ago 0x2801a71605b5e25816235c7f3cb779f4c9dd60ee 0x: Exchange Proxy0.03601 Ether
0x0ad4d3778e8921eadc7f326660001d7aead851b062094a7a72f83fcd8aca6df1131583352021-09-04 9:13:4615 days 7 hrs ago 0x2801a71605b5e25816235c7f3cb779f4c9dd60eeENS Name m1r4c13.eth15.204540979608745107 Ether
0x0ad4d3778e8921eadc7f326660001d7aead851b062094a7a72f83fcd8aca6df1131583352021-09-04 9:13:4615 days 7 hrs ago 0x22f9dcf4647084d6c31b2765f6910cd85c178c18 0x2801a71605b5e25816235c7f3cb779f4c9dd60ee15.204540979608745107 Ether
0xb04f2458122f8c2f4041837fb4ed0da3e8d05b8830d3811b5d30b8ef8fff4178131488862021-09-02 21:59:4816 days 18 hrs ago 0x2801a71605b5e25816235c7f3cb779f4c9dd60ee 0x: Exchange Proxy7.68 Ether
0x20ed75a5ac2cd67eba2ca4ef1c84df9f29a0a344066992bcdf1e99e62d53d7de131359202021-08-31 22:05:3918 days 18 hrs ago 0x2801a71605b5e25816235c7f3cb779f4c9dd60ee Wrapped Ether0.03 Ether
0x71739401a21bb02f51cd94cdf5b2075549214a061a77d9ad8eea74bc542c53f8131206082021-08-29 13:25:0421 days 2 hrs ago 0x2801a71605b5e25816235c7f3cb779f4c9dd60ee0x797af86fa19aa24f26eefd535462de25722738320.013333168304689548 Ether
0x71739401a21bb02f51cd94cdf5b2075549214a061a77d9ad8eea74bc542c53f8131206082021-08-29 13:25:0421 days 2 hrs ago 0x22f9dcf4647084d6c31b2765f6910cd85c178c18 0x2801a71605b5e25816235c7f3cb779f4c9dd60ee0.013333168304689548 Ether
0x29bd8ea5bb69084775508cb354291ef2dc915e4286923ee97174065abea0c8e2131161102021-08-28 20:34:1021 days 19 hrs ago 0x2801a71605b5e25816235c7f3cb779f4c9dd60ee Wrapped Ether0.25 Ether
0x06dba0bbfa8a818a969100359d001ca61d4bcc0e4bdced296b4719725a84c961130883532021-08-24 13:40:1826 days 2 hrs ago 0x2801a71605b5e25816235c7f3cb779f4c9dd60ee 0x: Exchange Proxy1 Ether
0x1d2f83a136f594e89b0ae90d7631a2f5624f41100a4d0e77d43c78753dcab2c2130862182021-08-24 5:46:4526 days 10 hrs ago 0x2801a71605b5e25816235c7f3cb779f4c9dd60ee 0x: Exchange Proxy3 Ether
0xd34d48dabdde22b27e1e4b2b1f1e6028b6f8da78edc1460ec46b0f221dc7f171130787162021-08-23 1:43:4427 days 14 hrs ago 0x2801a71605b5e25816235c7f3cb779f4c9dd60ee 0x: Exchange Proxy0.1 Ether
0xd204b3c57f85d7120e0bd66640198e96172d40e38376f23bac1f90a61998c7db130772352021-08-22 20:19:2527 days 20 hrs ago 0x2801a71605b5e25816235c7f3cb779f4c9dd60ee 0x: Exchange Proxy1.91 Ether
0x3a888a6d08e14e1a9c64e295b16f7babe586cd037d5fbab357e92de4cce55ec3130680642021-08-21 10:25:3429 days 5 hrs ago 0x2801a71605b5e25816235c7f3cb779f4c9dd60ee 0x: Exchange Proxy0.005 Ether
0xc034894424eb9c1c1b4cd52d9cf1ddee66bcbf4626a057eda756cfd36e63e6df130637722021-08-20 18:39:1929 days 21 hrs ago 0x2801a71605b5e25816235c7f3cb779f4c9dd60ee 0x: Exchange Proxy0.07 Ether
0x97b64d4cd95fc88fdb63b34769dac8cf9bee09a6686c29927484d1173305188f130548502021-08-19 9:17:2731 days 7 hrs ago 0x2801a71605b5e25816235c7f3cb779f4c9dd60ee 0x: Exchange Proxy0.0004 Ether
0xd34fe58c0fe65ef4f5fcf27b08228e5af6eff0dbf5a82ab227dadf2306dd3d03130539392021-08-19 5:54:2531 days 10 hrs ago 0x2801a71605b5e25816235c7f3cb779f4c9dd60eeENS Name sassal.eth0.300014936124361619 Ether
0xd34fe58c0fe65ef4f5fcf27b08228e5af6eff0dbf5a82ab227dadf2306dd3d03130539392021-08-19 5:54:2531 days 10 hrs ago Wrapped Ether 0x2801a71605b5e25816235c7f3cb779f4c9dd60ee0.300014936124361619 Ether
0xdf20001d816ee3ecd82199628543f9c8d64c93574475b32a94921c8b756a8d10130423362021-08-17 11:07:0833 days 5 hrs ago 0x2801a71605b5e25816235c7f3cb779f4c9dd60ee0x5e623977e333ccb13f7ca8be8a322e72f64bb0db0.177166598114807767 Ether
[ Download CSV Export 
Loading

Contract Source Code Verified (Exact Match)

Contract Name:
Aave_Zap_V1_0_2

Compiler Version
v0.8.4+commit.c7e474f2

Optimization Enabled:
Yes with 200 runs

Other Settings:
default evmVersion, GNU GPLv2 license
File 1 of 11 : AaveInterface.sol
// SPDX-License-Identifier: agpl-3.0
pragma solidity ^0.8.0;

interface ILendingPool {
    /**
     * @dev Deposits an `amount` of underlying asset into the reserve, receiving in return overlying aTokens.
     * - E.g. User deposits 100 USDC and gets in return 100 aUSDC
     * @param asset The address of the underlying asset to deposit
     * @param amount The amount to be deposited
     * @param onBehalfOf The address that will receive the aTokens, same as msg.sender if the user
     *   wants to receive them on his own wallet, or a different address if the beneficiary of aTokens
     *   is a different wallet
     * @param referralCode Code used to register the integrator originating the operation, for potential rewards.
     *   0 if the action is executed directly by the user, without any middle-man
     **/
    function deposit(
        address asset,
        uint256 amount,
        address onBehalfOf,
        uint16 referralCode
    ) external;

    /**
     * @dev Withdraws an `amount` of underlying asset from the reserve, burning the equivalent aTokens owned
     * E.g. User has 100 aUSDC, calls withdraw() and receives 100 USDC, burning the 100 aUSDC
     * @param asset The address of the underlying asset to withdraw
     * @param amount The underlying amount to be withdrawn
     *   - Send the value type(uint256).max in order to withdraw the whole aToken balance
     * @param to Address that will receive the underlying, same as msg.sender if the user
     *   wants to receive it on his own wallet, or a different address if the beneficiary is a
     *   different wallet
     * @return The final amount withdrawn
     **/
    function withdraw(
        address asset,
        uint256 amount,
        address to
    ) external returns (uint256);

    /**
     * @notice Repays a borrowed `amount` on a specific reserve, burning the equivalent debt tokens owned
     * - E.g. User repays 100 USDC, burning 100 variable/stable debt tokens of the `onBehalfOf` address
     * @param asset The address of the borrowed underlying asset previously borrowed
     * @param amount The amount to repay
     * - Send the value type(uint256).max in order to repay the whole debt for `asset` on the specific `debtMode`
     * @param rateMode The interest rate mode at of the debt the user wants to repay: 1 for Stable, 2 for Variable
     * @param onBehalfOf Address of the user who will get his debt reduced/removed. Should be the address of the
     * user calling the function if he wants to reduce/remove his own debt, or the address of any other
     * other borrower whose debt should be removed
     * @return The final amount repaid
     **/
    function repay(
        address asset,
        uint256 amount,
        uint256 rateMode,
        address onBehalfOf
    ) external returns (uint256);
}

interface IAToken {
    function POOL() external returns (address);

    function UNDERLYING_ASSET_ADDRESS() external returns (address);

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

File 2 of 11 : Aave_Zap_V1.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.
//

///@author Zapper
///@notice This contract deposits and withdraws assets to/from Aave
// SPDX-License-Identifier: GPL-2.0

pragma solidity ^0.8.0;
import "../_base/ZapInBaseV3_1.sol";
import "../_base/ZapOutBaseV3_1.sol";
import "./AaveInterface.sol";

interface IWETH {
    function deposit() external payable;

    function withdraw(uint256 wad) external;
}

contract Aave_Zap_V1_0_2 is ZapInBaseV3_1, ZapOutBaseV3_1 {
    using SafeERC20 for IERC20;

    uint256 private constant deadline =
        0xf000000000000000000000000000000000000000000000000000000000000000;

    uint256 private constant permitAllowance = 79228162514260000000000000000;

    address private constant wethTokenAddress =
        0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2;

    //@dev targets must be Zaps (not tokens!!!)
    constructor(
        address[] memory targets,
        uint256 _goodwill,
        uint256 _affiliateSplit
    ) ZapBaseV2_1(_goodwill, _affiliateSplit) {
        approvedTargets[0xDef1C0ded9bec7F1a1670819833240f027b25EfF] = true;
        for (uint256 i = 0; i < targets.length; i++) {
            approvedTargets[targets[i]] = true;
        }
    }

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

    /**
    @notice This function deposits assets into aave with ETH or ERC20 tokens
    @param fromToken The token used for entry (address(0) if ether)
    @param amountIn The amount of fromToken to invest
    @param aToken Address of the aToken
    @param minATokens The minimum acceptable quantity aTokens to receive. Reverts otherwise
    @param swapTarget Excecution target for the swap or zap
    @param swapData DEX or Zap data. Must swap to aToken underlying address
    @param affiliate Affiliate address
    @return aTokensRec Quantity of aTokens received
     */
    function ZapIn(
        address fromToken,
        uint256 amountIn,
        address aToken,
        uint256 minATokens,
        address swapTarget,
        bytes calldata swapData,
        address affiliate
    ) external payable stopInEmergency returns (uint256 aTokensRec) {
        uint256 toInvest = _pullTokens(fromToken, amountIn, affiliate, true);

        address toToken = getUnderlyingToken(aToken);

        uint256 tokensBought =
            _fillQuote(fromToken, toToken, toInvest, swapTarget, swapData);

        (aTokensRec) = enterAave(aToken, tokensBought, minATokens);

        emit zapIn(msg.sender, aToken, aTokensRec);
    }

    function enterAave(
        address aToken,
        uint256 underlyingAmount,
        uint256 minATokens
    ) internal returns (uint256 aTokensRec) {
        ILendingPool lendingPool = getLendingPool(aToken);

        address underlyingToken = getUnderlyingToken(aToken);

        uint256 initialBalance = IERC20(aToken).balanceOf(msg.sender);

        _approveToken(underlyingToken, address(lendingPool), underlyingAmount);

        lendingPool.deposit(underlyingToken, underlyingAmount, msg.sender, 151);

        aTokensRec = IERC20(aToken).balanceOf(msg.sender) - initialBalance;

        require(aTokensRec > minATokens, "High Slippage");
    }

    /**
    @notice This function withdraws assets from aave, receiving tokens or ETH with permit
    @param fromToken The aToken being withdrawn
    @param amountIn The quantity of fromToken to withdraw
    @param toToken Address of the token to receive (0 address if ETH)
    @param minToTokens The minimum acceptable quantity tokens to receive. Reverts otherwise
    @param permitSig Signature for permit
    @param swapTarget Excecution target for the swap or zap
    @param swapData DEX or Zap data
    @param affiliate Affiliate address
    @return tokensRec Quantity of aTokens received
     */
    function ZapOutWithPermit(
        address fromToken,
        uint256 amountIn,
        address toToken,
        uint256 minToTokens,
        bytes calldata permitSig,
        address swapTarget,
        bytes calldata swapData,
        address affiliate
    ) external stopInEmergency returns (uint256) {
        _permit(fromToken, permitAllowance, permitSig);

        return (
            ZapOut(
                fromToken,
                amountIn,
                toToken,
                minToTokens,
                swapTarget,
                swapData,
                affiliate
            )
        );
    }

    function _permit(
        address aToken,
        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)))
        }
        IAToken(aToken).permit(
            msg.sender,
            address(this),
            amountIn,
            deadline,
            v,
            r,
            s
        );
    }

    /**
    @notice This function withdraws assets from aave, receiving tokens or ETH
    @param fromToken The aToken being withdrawn
    @param amountIn The quantity of fromToken to withdraw
    @param toToken Address of the token to receive (0 address if ETH)
    @param minToTokens The minimum acceptable quantity tokens to receive. Reverts otherwise
    @param swapTarget Excecution target for the swap or zap
    @param swapData DEX or Zap data
    @param affiliate Affiliate address
    @return tokensRec Quantity of aTokens received
     */
    function ZapOut(
        address fromToken,
        uint256 amountIn,
        address toToken,
        uint256 minToTokens,
        address swapTarget,
        bytes calldata swapData,
        address affiliate
    ) public stopInEmergency returns (uint256 tokensRec) {
        amountIn = _pullTokens(fromToken, amountIn);

        uint256 underlyingRec = exitAave(fromToken, amountIn);

        address underlyingToken = getUnderlyingToken(fromToken);

        tokensRec = _fillQuote(
            underlyingToken,
            toToken,
            underlyingRec,
            swapTarget,
            swapData
        );

        require(tokensRec >= minToTokens, "High Slippage");

        uint256 totalGoodwillPortion;

        if (toToken == address(0)) {
            totalGoodwillPortion = _subtractGoodwill(
                ETHAddress,
                tokensRec,
                affiliate,
                true
            );

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

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

        tokensRec = tokensRec - totalGoodwillPortion;

        emit zapOut(msg.sender, toToken, tokensRec);
    }

    function exitAave(address aToken, uint256 aTokenAmount)
        internal
        returns (uint256 tokensRec)
    {
        address underlyingToken = getUnderlyingToken(aToken);

        ILendingPool lendingPool = getLendingPool(aToken);

        tokensRec = lendingPool.withdraw(
            underlyingToken,
            aTokenAmount,
            address(this)
        );
    }

    function _fillQuote(
        address fromToken,
        address toToken,
        uint256 _amount,
        address swapTarget,
        bytes memory swapData
    ) internal returns (uint256 amountBought) {
        if (fromToken == toToken) {
            return _amount;
        }

        if (fromToken == address(0) && toToken == wethTokenAddress) {
            IWETH(wethTokenAddress).deposit{ value: _amount }();
            return _amount;
        }

        if (fromToken == wethTokenAddress && toToken == address(0)) {
            IWETH(wethTokenAddress).withdraw(_amount);
            return _amount;
        }

        uint256 valueToSend;
        if (fromToken == address(0)) {
            valueToSend = _amount;
        } else {
            _approveToken(fromToken, swapTarget, _amount);
        }

        uint256 initialBalance = _getBalance(toToken);

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

        amountBought = _getBalance(toToken) - initialBalance;

        require(amountBought > 0, "Swapped To Invalid Intermediate");
    }

    function getUnderlyingToken(address aToken) public returns (address) {
        return IAToken(aToken).UNDERLYING_ASSET_ADDRESS();
    }

    function getLendingPool(address aToken) internal returns (ILendingPool) {
        return ILendingPool(IAToken(aToken).POOL());
    }
}

File 3 of 11 : ZapBaseV2_1.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";
import "../oz/0.8.0/token/ERC20/extensions/IERC20Metadata.sol";

abstract contract ZapBaseV2_1 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;

    address internal constant ZapperAdmin =
        0x3CE37278de6388532C3949ce4e886F365B14fB56;

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

    // circuit breaker modifiers
    modifier stopInEmergency {
        if (stopped) {
            revert("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];
        }
    }

    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;
            }
        }
    }

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

File 4 of 11 : ZapInBaseV3_1.sol
// SPDX-License-Identifier: GPL-2.0

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

abstract contract ZapInBaseV3_1 is ZapBaseV2_1 {
    using SafeERC20 for IERC20;

    /**
    @dev Transfer tokens (including ETH) from msg.sender to this contract
    @param token The ERC20 token to transfer to this contract (0 address if ETH)
    @return Quantity of tokens transferred to this contract
     */
    function _pullTokens(
        address token,
        uint256 amount,
        address affiliate,
        bool enableGoodwill
    ) internal returns (uint256) {
        uint256 totalGoodwillPortion;

        if (token == address(0)) {
            require(msg.value > 0, "No eth sent");

            // subtract goodwill
            totalGoodwillPortion = _subtractGoodwill(
                ETHAddress,
                msg.value,
                affiliate,
                enableGoodwill
            );

            return msg.value - totalGoodwillPortion;
        }

        require(amount > 0, "Invalid token amount");
        require(msg.value == 0, "Eth sent with token");

        //transfer token

        IERC20(token).safeTransferFrom(msg.sender, address(this), amount);

        // subtract goodwill
        totalGoodwillPortion = _subtractGoodwill(
            token,
            amount,
            affiliate,
            enableGoodwill
        );

        return amount - totalGoodwillPortion;
    }
}

File 5 of 11 : ZapOutBaseV3_1.sol
// SPDX-License-Identifier: GPL-2.0

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

abstract contract ZapOutBaseV3_1 is ZapBaseV2_1 {
    using SafeERC20 for IERC20;

    /**
    @dev Transfer tokens from msg.sender to this contract
    @param token The ERC20 token to transfer to this contract
    @return Quantity of tokens transferred to this contract
     */
    function _pullTokens(address token, uint256 amount)
        internal
        returns (uint256)
    {
        IERC20(token).safeTransferFrom(msg.sender, address(this), amount);

        return amount;
    }
}

File 6 of 11 : 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 7 of 11 : 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 8 of 11 : IERC20Metadata.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.0;

import "../IERC20.sol";

/**
 * @dev Interface for the optional metadata functions from the ERC20 standard.
 *
 * _Available since v4.1._
 */
interface IERC20Metadata is IERC20 {
    /**
     * @dev Returns the name of the token.
     */
    function name() external view returns (string memory);

    /**
     * @dev Returns the symbol of the token.
     */
    function symbol() external view returns (string memory);

    /**
     * @dev Returns the decimals places of the token.
     */
    function decimals() external view returns (uint8);
}

File 9 of 11 : 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 10 of 11 : 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 11 of 11 : 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":"address[]","name":"targets","type":"address[]"},{"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":"token","type":"address"},{"indexed":false,"internalType":"uint256","name":"tokensRec","type":"uint256"}],"name":"zapIn","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"sender","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":"fromToken","type":"address"},{"internalType":"uint256","name":"amountIn","type":"uint256"},{"internalType":"address","name":"aToken","type":"address"},{"internalType":"uint256","name":"minATokens","type":"uint256"},{"internalType":"address","name":"swapTarget","type":"address"},{"internalType":"bytes","name":"swapData","type":"bytes"},{"internalType":"address","name":"affiliate","type":"address"}],"name":"ZapIn","outputs":[{"internalType":"uint256","name":"aTokensRec","type":"uint256"}],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"address","name":"fromToken","type":"address"},{"internalType":"uint256","name":"amountIn","type":"uint256"},{"internalType":"address","name":"toToken","type":"address"},{"internalType":"uint256","name":"minToTokens","type":"uint256"},{"internalType":"address","name":"swapTarget","type":"address"},{"internalType":"bytes","name":"swapData","type":"bytes"},{"internalType":"address","name":"affiliate","type":"address"}],"name":"ZapOut","outputs":[{"internalType":"uint256","name":"tokensRec","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"fromToken","type":"address"},{"internalType":"uint256","name":"amountIn","type":"uint256"},{"internalType":"address","name":"toToken","type":"address"},{"internalType":"uint256","name":"minToTokens","type":"uint256"},{"internalType":"bytes","name":"permitSig","type":"bytes"},{"internalType":"address","name":"swapTarget","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":[{"internalType":"address","name":"aToken","type":"address"}],"name":"getUnderlyingToken","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"nonpayable","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":[],"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"}]

60806040526000805460ff60a01b191690553480156200001e57600080fd5b50604051620029413803806200294183398101604081905262000041916200017a565b600080546001600160a01b03191633908117825560405184928492918291907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908290a35060029190915560035573def1c0ded9bec7f1a1670819833240f027b25eff600090815260076020527ff6019cd1944dc466e824190b288e5a63528dd4c9a6d8cbd707956fd30d2f1e0d805460ff191660011790555b835181101562000153576001600760008684815181106200010c57634e487b7160e01b600052603260045260246000fd5b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff1916911515919091179055806200014a8162000261565b915050620000db565b505050506200029f565b80516001600160a01b03811681146200017557600080fd5b919050565b6000806000606084860312156200018f578283fd5b83516001600160401b0380821115620001a6578485fd5b818601915086601f830112620001ba578485fd5b8151602082821115620001d157620001d162000289565b8160051b604051601f19603f83011681018181108682111715620001f957620001f962000289565b604052838152828101945085830182870184018c10156200021857898afd5b8996505b84871015620002455762000230816200015d565b8652600196909601959483019483016200021c565b5091890151604090990151919a98995090979650505050505050565b60006000198214156200028257634e487b7160e01b81526011600452602481fd5b5060010190565b634e487b7160e01b600052604160045260246000fd5b61269280620002af6000396000f3fe6080604052600436106101395760003560e01c8063691bcc88116100ab5780639462f4281161006f5780639462f428146103dc5780639735a634146103fc5780639779d1a61461041c578063d408f6571461044c578063f2fde38b1461047c578063fbec27bf1461049c57600080fd5b8063691bcc881461033d57806369a7e57b14610375578063715018a61461038857806375f12b211461039d5780638da5cb5b146103be57600080fd5b80633ff428c7116100fd5780633ff428c71461026757806346d4b548146102875780634f51e294146102a7578063550bfa56146102e75780635de0398e146103075780635ecb16cd1461031d57600080fd5b806301e980d41461019a5780630dc9de85146101ba5780631385d24c146101da5780631781261f146101ef57806318b135e31461023a57600080fd5b3661019557333214156101935760405162461bcd60e51b815260206004820152601860248201527f446f206e6f742073656e6420455448206469726563746c79000000000000000060448201526064015b60405180910390fd5b005b600080fd5b3480156101a657600080fd5b506101936101b5366004612497565b6104bc565b3480156101c657600080fd5b506101936101d53660046123b6565b610546565b3480156101e657600080fd5b506101936107a1565b3480156101fb57600080fd5b5061022761020a3660046121e3565b600560209081526000928352604080842090915290825290205481565b6040519081526020015b60405180910390f35b34801561024657600080fd5b506102276102553660046121ab565b60066020526000908152604090205481565b34801561027357600080fd5b5061019361028236600461221b565b6107ec565b34801561029357600080fd5b506102276102a2366004612248565b610841565b3480156102b357600080fd5b506102d76102c23660046121ab565b60046020526000908152604090205460ff1681565b6040519015158152602001610231565b3480156102f357600080fd5b50610193610302366004612497565b610a1b565b34801561031357600080fd5b5061022760025481565b34801561032957600080fd5b506101936103383660046123b6565b610a9b565b34801561034957600080fd5b5061035d6103583660046121ab565b610d0c565b6040516001600160a01b039091168152602001610231565b610227610383366004612248565b610d87565b34801561039457600080fd5b50610193610e6b565b3480156103a957600080fd5b506000546102d790600160a01b900460ff1681565b3480156103ca57600080fd5b506000546001600160a01b031661035d565b3480156103e857600080fd5b506102276103f73660046122e8565b610edf565b34801561040857600080fd5b506101936104173660046123f6565b610f76565b34801561042857600080fd5b506102d76104373660046121ab565b60076020526000908152604090205460ff1681565b34801561045857600080fd5b506102d76104673660046121ab565b60016020526000908152604090205460ff1681565b34801561048857600080fd5b506101936104973660046121ab565b6110a0565b3480156104a857600080fd5b506101936104b736600461221b565b61118a565b6000546001600160a01b031633146104e65760405162461bcd60e51b815260040161018a90612536565b60648111156105415760405162461bcd60e51b815260206004820152602160248201527f416666696c696174652053706c69742056616c7565206e6f7420616c6c6f77656044820152601960fa1b606482015260840161018a565b600355565b6000805b8281101561079b573360009081526005602052604081209085858481811061058257634e487b7160e01b600052603260045260246000fd5b905060200201602081019061059791906121ab565b6001600160a01b031681526020808201929092526040908101600090812054338252600590935290812091935090818686858181106105e657634e487b7160e01b600052603260045260246000fd5b90506020020160208101906105fb91906121ab565b6001600160a01b03166001600160a01b0316815260200190815260200160002081905550816006600086868581811061064457634e487b7160e01b600052603260045260246000fd5b905060200201602081019061065991906121ab565b6001600160a01b03166001600160a01b031681526020019081526020016000205461068491906125c2565b600660008686858181106106a857634e487b7160e01b600052603260045260246000fd5b90506020020160208101906106bd91906121ab565b6001600160a01b0316815260208101919091526040016000205573eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee84848381811061070c57634e487b7160e01b600052603260045260246000fd5b905060200201602081019061072191906121ab565b6001600160a01b0316141561073f5761073a33836111df565b610789565b610789338386868581811061076457634e487b7160e01b600052603260045260246000fd5b905060200201602081019061077991906121ab565b6001600160a01b031691906112f8565b8061079381612605565b91505061054a565b50505050565b6000546001600160a01b031633146107cb5760405162461bcd60e51b815260040161018a90612536565b6000805460ff60a01b198116600160a01b9182900460ff1615909102179055565b6000546001600160a01b031633146108165760405162461bcd60e51b815260040161018a90612536565b6001600160a01b03919091166000908152600460205260409020805460ff1916911515919091179055565b60008054600160a01b900460ff161561086c5760405162461bcd60e51b815260040161018a90612516565b610876898961135b565b975060006108848a8a611378565b905060006108918b610d0c565b90506108d6818a848a8a8a8080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525061142692505050565b9250878310156109185760405162461bcd60e51b815260206004820152600d60248201526c4869676820536c69707061676560981b604482015260640161018a565b60006001600160a01b038a166109875761094973eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee8587600161173e565b9050336108fc61095983876125c2565b6040518115909202916000818181858888f19350505050158015610981573d6000803e3d6000fd5b506109b5565b6109948a8587600161173e565b90506109b5336109a483876125c2565b6001600160a01b038d1691906112f8565b6109bf81856125c2565b604080513381526001600160a01b038d1660208201529081018290529094507fa51973a21dd19abaad8194f70440e180b7c5784c9828663e69dcbb57d7575bea906060015b60405180910390a150505098975050505050505050565b6000546001600160a01b03163314610a455760405162461bcd60e51b815260040161018a90612536565b6064811115610a965760405162461bcd60e51b815260206004820152601a60248201527f476f6f6457696c6c2056616c7565206e6f7420616c6c6f776564000000000000604482015260640161018a565b600255565b6000546001600160a01b03163314610ac55760405162461bcd60e51b815260040161018a90612536565b60005b81811015610d0757600073eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee848484818110610b0757634e487b7160e01b600052603260045260246000fd5b9050602002016020810190610b1c91906121ab565b6001600160a01b03161415610baa5760066000858585818110610b4f57634e487b7160e01b600052603260045260246000fd5b9050602002016020810190610b6491906121ab565b6001600160a01b03168152602081019190915260400160002054610b8890476125c2565b9050610ba5610b9f6000546001600160a01b031690565b826111df565b610cf4565b60066000858585818110610bce57634e487b7160e01b600052603260045260246000fd5b9050602002016020810190610be391906121ab565b6001600160a01b03166001600160a01b0316815260200190815260200160002054848484818110610c2457634e487b7160e01b600052603260045260246000fd5b9050602002016020810190610c3991906121ab565b6040516370a0823160e01b81523060048201526001600160a01b0391909116906370a082319060240160206040518083038186803b158015610c7a57600080fd5b505afa158015610c8e573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610cb291906124af565b610cbc91906125c2565b9050610cf4610cd36000546001600160a01b031690565b8286868681811061076457634e487b7160e01b600052603260045260246000fd5b5080610cff81612605565b915050610ac8565b505050565b6000816001600160a01b031663b16a19de6040518163ffffffff1660e01b8152600401602060405180830381600087803b158015610d4957600080fd5b505af1158015610d5d573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d8191906121c7565b92915050565b60008054600160a01b900460ff1615610db25760405162461bcd60e51b815260040161018a90612516565b6000610dc18a8a856001611869565b90506000610dce89610d0c565b90506000610e158c83858b8b8b8080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525061142692505050565b9050610e228a828b6119b0565b604080513381526001600160a01b038d1660208201529081018290529094507f7f31d76771556dce5ab39ba5b60664743da2629a75c474e9445734b7ad34087d90606001610a04565b6000546001600160a01b03163314610e955760405162461bcd60e51b815260040161018a90612536565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b60008054600160a01b900460ff1615610f0a5760405162461bcd60e51b815260040161018a90612516565b610f578b6bfffffffffff096fb4da2000089898080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250611b9092505050565b610f678b8b8b8b89898989610841565b9b9a5050505050505050505050565b6000546001600160a01b03163314610fa05760405162461bcd60e51b815260040161018a90612536565b828114610fe65760405162461bcd60e51b8152602060048201526014602482015273092dcecc2d8d2c84092dce0eae840d8cadccee8d60631b604482015260640161018a565b60005b838110156110995782828281811061101157634e487b7160e01b600052603260045260246000fd5b9050602002016020810190611026919061245f565b6007600087878581811061104a57634e487b7160e01b600052603260045260246000fd5b905060200201602081019061105f91906121ab565b6001600160a01b031681526020810191909152604001600020805460ff19169115159190911790558061109181612605565b915050610fe9565b5050505050565b6000546001600160a01b031633146110ca5760405162461bcd60e51b815260040161018a90612536565b6001600160a01b03811661112f5760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b606482015260840161018a565b600080546040516001600160a01b03808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a3600080546001600160a01b0319166001600160a01b0392909216919091179055565b6000546001600160a01b031633146111b45760405162461bcd60e51b815260040161018a90612536565b6001600160a01b03919091166000908152600160205260409020805460ff1916911515919091179055565b8047101561122f5760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a20696e73756666696369656e742062616c616e6365000000604482015260640161018a565b6000826001600160a01b03168260405160006040518083038185875af1925050503d806000811461127c576040519150601f19603f3d011682016040523d82523d6000602084013e611281565b606091505b5050905080610d075760405162461bcd60e51b815260206004820152603a60248201527f416464726573733a20756e61626c6520746f2073656e642076616c75652c207260448201527f6563697069656e74206d61792068617665207265766572746564000000000000606482015260840161018a565b6040516001600160a01b038316602482015260448101829052610d0790849063a9059cbb60e01b906064015b60408051601f198184030181529190526020810180516001600160e01b03166001600160e01b031990931692909217909152611c85565b60006113726001600160a01b038416333085611d57565b50919050565b60008061138484610d0c565b9050600061139185611d8f565b604051631a4ca37b60e21b81526001600160a01b03848116600483015260248201879052306044830152919250908216906369328dec90606401602060405180830381600087803b1580156113e557600080fd5b505af11580156113f9573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061141d91906124af565b95945050505050565b6000846001600160a01b0316866001600160a01b0316141561144957508261141d565b6001600160a01b03861615801561147c57506001600160a01b03851673c02aaa39b223fe8d0a0e5c4f27ead9083c756cc2145b156114f15773c02aaa39b223fe8d0a0e5c4f27ead9083c756cc26001600160a01b031663d0e30db0856040518263ffffffff1660e01b81526004016000604051808303818588803b1580156114d057600080fd5b505af11580156114e4573d6000803e3d6000fd5b505050505083905061141d565b6001600160a01b03861673c02aaa39b223fe8d0a0e5c4f27ead9083c756cc214801561152457506001600160a01b038516155b1561159657604051632e1a7d4d60e01b81526004810185905273c02aaa39b223fe8d0a0e5c4f27ead9083c756cc290632e1a7d4d90602401600060405180830381600087803b15801561157657600080fd5b505af115801561158a573d6000803e3d6000fd5b5050505083905061141d565b60006001600160a01b0387166115ad5750836115b8565b6115b8878587611dcc565b60006115c387611df5565b6001600160a01b03861660009081526007602052604090205490915060ff166116265760405162461bcd60e51b815260206004820152601560248201527415185c99d95d081b9bdd08105d5d1a1bdc9a5e9959605a1b604482015260640161018a565b6000856001600160a01b0316838660405161164191906124c7565b60006040518083038185875af1925050503d806000811461167e576040519150601f19603f3d011682016040523d82523d6000602084013e611683565b606091505b50509050806116cc5760405162461bcd60e51b81526020600482015260156024820152744572726f72205377617070696e6720546f6b656e7360581b604482015260640161018a565b816116d689611df5565b6116e091906125c2565b9350600084116117325760405162461bcd60e51b815260206004820152601f60248201527f5377617070656420546f20496e76616c696420496e7465726d65646961746500604482015260640161018a565b50505095945050505050565b3360009081526001602052604081205460ff1682801561175c575080155b801561176a57506000600254115b15611860576127106002548661178091906125a3565b61178a9190612583565b6001600160a01b03851660009081526004602052604090205490925060ff1615611860576001600160a01b0386166117d45773eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee95505b60006064600354846117e691906125a3565b6117f09190612583565b6001600160a01b038087166000908152600560209081526040808320938c1683529290529081208054929350839290919061182c90849061256b565b90915550506001600160a01b0387166000908152600660205260408120805483929061185990849061256b565b9091555050505b50949350505050565b6000806001600160a01b0386166118ec57600034116118b85760405162461bcd60e51b815260206004820152600b60248201526a139bc8195d1a081cd95b9d60aa1b604482015260640161018a565b6118d873eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee34868661173e565b90506118e481346125c2565b9150506119a8565b600085116119335760405162461bcd60e51b8152602060048201526014602482015273125b9d985b1a59081d1bdad95b88185b5bdd5b9d60621b604482015260640161018a565b34156119775760405162461bcd60e51b815260206004820152601360248201527222ba341039b2b73a103bb4ba34103a37b5b2b760691b604482015260640161018a565b61198c6001600160a01b038716333088611d57565b6119988686868661173e565b90506119a481866125c2565b9150505b949350505050565b6000806119bc85611d8f565b905060006119c986610d0c565b6040516370a0823160e01b81523360048201529091506000906001600160a01b038816906370a082319060240160206040518083038186803b158015611a0e57600080fd5b505afa158015611a22573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611a4691906124af565b9050611a53828488611dcc565b60405163e8eda9df60e01b81526001600160a01b038381166004830152602482018890523360448301526097606483015284169063e8eda9df90608401600060405180830381600087803b158015611aaa57600080fd5b505af1158015611abe573d6000803e3d6000fd5b50506040516370a0823160e01b81523360048201528392506001600160a01b038a1691506370a082319060240160206040518083038186803b158015611b0357600080fd5b505afa158015611b17573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611b3b91906124af565b611b4591906125c2565b9350848411611b865760405162461bcd60e51b815260206004820152600d60248201526c4869676820536c69707061676560981b604482015260640161018a565b5050509392505050565b8051604114611be15760405162461bcd60e51b815260206004820152601860248201527f496e76616c6964207369676e6174757265206c656e6774680000000000000000604482015260640161018a565b60208101516040808301516060840151915163d505accf60e01b815233600482015230602482015260448101869052600f60fc1b606482015260009290921a6084830181905260a4830184905260c4830182905290916001600160a01b0387169063d505accf9060e401600060405180830381600087803b158015611c6557600080fd5b505af1158015611c79573d6000803e3d6000fd5b50505050505050505050565b6000611cda826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b0316611e839092919063ffffffff16565b805190915015610d075780806020019051810190611cf8919061247b565b610d075760405162461bcd60e51b815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e6044820152691bdd081cdd58d8d9595960b21b606482015260840161018a565b6040516001600160a01b038085166024830152831660448201526064810182905261079b9085906323b872dd60e01b90608401611324565b6000816001600160a01b0316637535d2466040518163ffffffff1660e01b8152600401602060405180830381600087803b158015610d4957600080fd5b611de16001600160a01b038416836000611e9c565b610d076001600160a01b0384168383611e9c565b60006001600160a01b038216611e0c575047919050565b6040516370a0823160e01b81523060048201526001600160a01b038316906370a082319060240160206040518083038186803b158015611e4b57600080fd5b505afa158015611e5f573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d8191906124af565b6060611e928484600085611fc0565b90505b9392505050565b801580611f255750604051636eb1769f60e11b81523060048201526001600160a01b03838116602483015284169063dd62ed3e9060440160206040518083038186803b158015611eeb57600080fd5b505afa158015611eff573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611f2391906124af565b155b611f905760405162461bcd60e51b815260206004820152603660248201527f5361666545524332303a20617070726f76652066726f6d206e6f6e2d7a65726f60448201527520746f206e6f6e2d7a65726f20616c6c6f77616e636560501b606482015260840161018a565b6040516001600160a01b038316602482015260448101829052610d0790849063095ea7b360e01b90606401611324565b6060824710156120215760405162461bcd60e51b815260206004820152602660248201527f416464726573733a20696e73756666696369656e742062616c616e636520666f6044820152651c8818d85b1b60d21b606482015260840161018a565b843b61206f5760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e7472616374000000604482015260640161018a565b600080866001600160a01b0316858760405161208b91906124c7565b60006040518083038185875af1925050503d80600081146120c8576040519150601f19603f3d011682016040523d82523d6000602084013e6120cd565b606091505b50915091506120dd8282866120e8565b979650505050505050565b606083156120f7575081611e95565b8251156121075782518084602001fd5b8160405162461bcd60e51b815260040161018a91906124e3565b60008083601f840112612132578182fd5b50813567ffffffffffffffff811115612149578182fd5b6020830191508360208260051b850101111561216457600080fd5b9250929050565b60008083601f84011261217c578182fd5b50813567ffffffffffffffff811115612193578182fd5b60208301915083602082850101111561216457600080fd5b6000602082840312156121bc578081fd5b8135611e9581612636565b6000602082840312156121d8578081fd5b8151611e9581612636565b600080604083850312156121f5578081fd5b823561220081612636565b9150602083013561221081612636565b809150509250929050565b6000806040838503121561222d578182fd5b823561223881612636565b915060208301356122108161264e565b60008060008060008060008060e0898b031215612263578384fd5b883561226e81612636565b975060208901359650604089013561228581612636565b955060608901359450608089013561229c81612636565b935060a089013567ffffffffffffffff8111156122b7578384fd5b6122c38b828c0161216b565b90945092505060c08901356122d781612636565b809150509295985092959890939650565b6000806000806000806000806000806101008b8d031215612307578182fd5b8a3561231281612636565b995060208b0135985060408b013561232981612636565b975060608b0135965060808b013567ffffffffffffffff8082111561234c578384fd5b6123588e838f0161216b565b909850965060a08d0135915061236d82612636565b90945060c08c01359080821115612382578384fd5b5061238f8d828e0161216b565b90945092505060e08b01356123a381612636565b809150509295989b9194979a5092959850565b600080602083850312156123c8578182fd5b823567ffffffffffffffff8111156123de578283fd5b6123ea85828601612121565b90969095509350505050565b6000806000806040858703121561240b578384fd5b843567ffffffffffffffff80821115612422578586fd5b61242e88838901612121565b90965094506020870135915080821115612446578384fd5b5061245387828801612121565b95989497509550505050565b600060208284031215612470578081fd5b8135611e958161264e565b60006020828403121561248c578081fd5b8151611e958161264e565b6000602082840312156124a8578081fd5b5035919050565b6000602082840312156124c0578081fd5b5051919050565b600082516124d98184602087016125d9565b9190910192915050565b60208152600082518060208401526125028160408501602087016125d9565b601f01601f19169190910160400192915050565b60208082526006908201526514185d5cd95960d21b604082015260600190565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b6000821982111561257e5761257e612620565b500190565b60008261259e57634e487b7160e01b81526012600452602481fd5b500490565b60008160001904831182151516156125bd576125bd612620565b500290565b6000828210156125d4576125d4612620565b500390565b60005b838110156125f45781810151838201526020016125dc565b8381111561079b5750506000910152565b600060001982141561261957612619612620565b5060010190565b634e487b7160e01b600052601160045260246000fd5b6001600160a01b038116811461264b57600080fd5b50565b801515811461264b57600080fdfea26469706673582212208b7e72faf7769d5dc77a154c75dd78bdcb7ed43a30a2c08248a6814122b0ee9a64736f6c634300080400330000000000000000000000000000000000000000000000000000000000000060000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000

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

0000000000000000000000000000000000000000000000000000000000000060000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000

-----Decoded View---------------

-----Encoded View---------------
4 Constructor Arguments found :
Arg [0] : 0000000000000000000000000000000000000000000000000000000000000060
Arg [1] : 0000000000000000000000000000000000000000000000000000000000000000
Arg [2] : 0000000000000000000000000000000000000000000000000000000000000000
Arg [3] : 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.