ETH Price: $3,474.91 (+4.91%)

Contract

0xc2C171bD6FC3B5885b589ed8b4d135F31085e973
 

Overview

ETH Balance

0 ETH

Eth Value

$0.00

Token Holdings

Multichain Info

1 address found via
Transaction Hash
Method
Block
From
To
Collect190680742024-01-23 8:05:59305 days ago1705997159IN
0xc2C171bD...31085e973
0 ETH0.012579110.99158911
Collect190680432024-01-23 7:59:35305 days ago1705996775IN
0xc2C171bD...31085e973
0 ETH0.005548510.41483055
Collect190680272024-01-23 7:56:11305 days ago1705996571IN
0xc2C171bD...31085e973
0 ETH0.0043962911.29055163
Collect190679922024-01-23 7:49:11305 days ago1705996151IN
0xc2C171bD...31085e973
0 ETH0.0026863410.85647339
Portal In186722992023-11-28 19:47:11360 days ago1701200831IN
0xc2C171bD...31085e973
0 ETH0.0306888750.17997792
Portal In186722512023-11-28 19:37:35360 days ago1701200255IN
0xc2C171bD...31085e973
0 ETH0.0559699747.24396637
Portal In186680872023-11-28 5:37:23361 days ago1701149843IN
0xc2C171bD...31085e973
0 ETH0.0159977231.08231187
Portal In186592512023-11-26 23:55:11362 days ago1701042911IN
0xc2C171bD...31085e973
0 ETH0.0097625623.23617446
Portal In186578452023-11-26 19:12:35362 days ago1701025955IN
0xc2C171bD...31085e973
0 ETH0.0403867430.65318995
Portal In185525682023-11-12 1:30:23377 days ago1699752623IN
0xc2C171bD...31085e973
0 ETH0.0120277222.04046088
Portal In185525642023-11-12 1:29:35377 days ago1699752575IN
0xc2C171bD...31085e973
0 ETH0.0136579420.21168639
Portal In184803722023-11-01 22:55:23387 days ago1698879323IN
0xc2C171bD...31085e973
0 ETH0.0179399838.86033179
Portal In184803372023-11-01 22:48:23387 days ago1698878903IN
0xc2C171bD...31085e973
0 ETH0.016364534.43159234
Portal In184373642023-10-26 22:27:23393 days ago1698359243IN
0xc2C171bD...31085e973
0 ETH0.0179135818.77814938
Portal In184188422023-10-24 8:10:59396 days ago1698135059IN
0xc2C171bD...31085e973
0 ETH0.0067600813.8239304
Portal In184095722023-10-23 1:01:23397 days ago1698022883IN
0xc2C171bD...31085e973
0 ETH0.0081970810.4404057
Portal In184095622023-10-23 0:59:23397 days ago1698022763IN
0xc2C171bD...31085e973
0 ETH0.008401178.18102032
Portal In183704012023-10-17 13:30:23403 days ago1697549423IN
0xc2C171bD...31085e973
0 ETH0.0110137511.60379801
Portal In183688302023-10-17 8:14:35403 days ago1697530475IN
0xc2C171bD...31085e973
0 ETH0.004575145.87388392
Portal In183351152023-10-12 15:04:47408 days ago1697123087IN
0xc2C171bD...31085e973
0 ETH0.0079357512.26886297
Portal In183303912023-10-11 23:13:11408 days ago1697065991IN
0xc2C171bD...31085e973
0 ETH0.0074052110.3852926
Portal In182796992023-10-04 21:00:23415 days ago1696453223IN
0xc2C171bD...31085e973
0 ETH0.004729310.23563064
Portal In182578072023-10-01 19:35:11418 days ago1696188911IN
0xc2C171bD...31085e973
0 ETH0.00294666.57207211
Portal In182484462023-09-30 12:12:59420 days ago1696075979IN
0xc2C171bD...31085e973
0 ETH0.003398147.57851355
Portal In182333262023-09-28 9:25:35422 days ago1695893135IN
0xc2C171bD...31085e973
0 ETH0.0049839611.11569436
View all transactions

Latest 25 internal transactions (View All)

Advanced mode:
Parent Transaction Hash Block From To
190679922024-01-23 7:49:11305 days ago1705996151
0xc2C171bD...31085e973
0.39833948 ETH
174739922023-06-13 22:17:59528 days ago1686694679
0xc2C171bD...31085e973
0.00997 ETH
172608012023-05-14 21:36:35558 days ago1684100195
0xc2C171bD...31085e973
0.15952 ETH
165412652023-02-02 12:58:23660 days ago1675342703
0xc2C171bD...31085e973
0.12623202 ETH
164873462023-01-26 0:15:35667 days ago1674692135
0xc2C171bD...31085e973
0.997 ETH
163360492023-01-04 21:15:23688 days ago1672866923
0xc2C171bD...31085e973
1.45562 ETH
162213872022-12-19 21:20:11704 days ago1671484811
0xc2C171bD...31085e973
0.3988 ETH
162115582022-12-18 12:24:47706 days ago1671366287
0xc2C171bD...31085e973
0.45141174 ETH
162097572022-12-18 6:22:59706 days ago1671344579
0xc2C171bD...31085e973
1.4955 ETH
162081632022-12-18 1:01:47706 days ago1671325307
0xc2C171bD...31085e973
0.47856 ETH
162076272022-12-17 23:13:59706 days ago1671318839
0xc2C171bD...31085e973
0.22931 ETH
162070832022-12-17 21:24:47706 days ago1671312287
0xc2C171bD...31085e973
0.997 ETH
162067532022-12-17 20:17:59706 days ago1671308279
0xc2C171bD...31085e973
0.61814 ETH
162041832022-12-17 11:41:35707 days ago1671277295
0xc2C171bD...31085e973
0.997 ETH
162041402022-12-17 11:32:59707 days ago1671276779
0xc2C171bD...31085e973
0.997 ETH
162002322022-12-16 22:27:23707 days ago1671229643
0xc2C171bD...31085e973
0.0997 ETH
161956662022-12-16 7:08:35708 days ago1671174515
0xc2C171bD...31085e973
0.194415 ETH
161902382022-12-15 12:57:11709 days ago1671109031
0xc2C171bD...31085e973
0.078763 ETH
161888192022-12-15 8:11:59709 days ago1671091919
0xc2C171bD...31085e973
0.12961 ETH
161790612022-12-13 23:29:23710 days ago1670974163
0xc2C171bD...31085e973
0.0997 ETH
161789732022-12-13 23:11:47710 days ago1670973107
0xc2C171bD...31085e973
0.037886 ETH
161745802022-12-13 8:26:23711 days ago1670919983
0xc2C171bD...31085e973
0.237286 ETH
161744642022-12-13 8:03:11711 days ago1670918591
0xc2C171bD...31085e973
0.31904 ETH
161677312022-12-12 9:27:11712 days ago1670837231
0xc2C171bD...31085e973
1.994 ETH
161666082022-12-12 5:41:35712 days ago1670823695
0xc2C171bD...31085e973
0.330007 ETH
View All Internal Transactions
Loading...
Loading

Contract Source Code Verified (Exact Match)

Contract Name:
YearnPartnerPortalIn

Compiler Version
v0.8.11+commit.d7f03943

Optimization Enabled:
Yes with 1000 runs

Other Settings:
default evmVersion, GNU GPLv3 license
File 1 of 10 : YearnPartnerPortalIn.sol
/// Copyright (C) 2022 Portals.fi

/// @author Portals.fi
/// @notice This contract adds liquidity to Yearn Vaults using any ERC20 token or the network token.

/// SPDX-License-Identifier: GPL-3.0
pragma solidity 0.8.11;

import "../base/PortalBaseV1_1.sol";
import "./interface/IYearnPartnerTracker.sol";

/// Thrown when insufficient liquidity is received after deposit
/// @param buyAmount The amount of liquidity received
/// @param minBuyAmount The minimum acceptable quantity of liquidity received
error InsufficientBuy(uint256 buyAmount, uint256 minBuyAmount);

contract YearnPartnerPortalIn is PortalBaseV1_1 {
    using SafeTransferLib for address;
    using SafeTransferLib for ERC20;

    IYearnPartnerTracker immutable YearnPartnerTracker;

    /// @notice Emitted when a portal is entered
    /// @param sellToken The ERC20 token address to spend (address(0) if network token)
    /// @param sellAmount The quantity of sellToken to Portal in
    /// @param buyToken The ERC20 token address to buy (address(0) if network token)
    /// @param buyAmount The quantity of buyToken received
    /// @param fee The fee in BPS
    /// @param sender The msg.sender
    /// @param partner The front end operator address
    event PortalIn(
        address sellToken,
        uint256 sellAmount,
        address buyToken,
        uint256 buyAmount,
        uint256 fee,
        address indexed sender,
        address indexed partner
    );

    constructor(
        bytes32 protocolId,
        PortalType portalType,
        IPortalRegistry registry,
        address exchange,
        address wrappedNetworkToken,
        uint256 fee,
        IYearnPartnerTracker yearnPartnerTracker
    )
        PortalBaseV1_1(
            protocolId,
            portalType,
            registry,
            exchange,
            wrappedNetworkToken,
            fee
        )
    {
        YearnPartnerTracker = yearnPartnerTracker;
    }

    /// @notice Add liquidity to Yearn like vaults with network tokens/ERC20 tokens
    /// @param sellToken The ERC20 token address to spend (address(0) if network token)
    /// @param sellAmount The quantity of sellToken to Portal in
    /// @param intermediateToken The intermediate token to swap to (must be the vault underlying token)
    /// @param buyToken The vault token address (i.e. the vault token)
    /// @param minBuyAmount The minimum quantity of buyTokens to receive. Reverts otherwise
    /// @param target The excecution target for the intermediate swap
    /// @param data  The encoded call for the intermediate swap
    /// @param partner The front end operator address
    /// @param yearnAffiliate The Yearn affiliate address
    /// @return buyAmount The quantity of buyToken acquired
    function portalIn(
        address sellToken,
        uint256 sellAmount,
        address intermediateToken,
        address buyToken,
        uint256 minBuyAmount,
        address target,
        bytes calldata data,
        address partner,
        address yearnAffiliate
    ) external payable pausable returns (uint256 buyAmount) {
        uint256 amount = _transferFromCaller(sellToken, sellAmount);
        amount = _getFeeAmount(amount, fee);
        amount = _execute(sellToken, amount, intermediateToken, target, data);

        uint256 balance = _getBalance(address(this), buyToken);

        _approve(intermediateToken, address(YearnPartnerTracker), amount);
        YearnPartnerTracker.deposit(buyToken, yearnAffiliate, amount);

        buyAmount = _getBalance(address(this), buyToken) - balance;

        if (buyAmount < minBuyAmount)
            revert InsufficientBuy(buyAmount, minBuyAmount);

        ERC20(buyToken).safeTransfer(msg.sender, buyAmount);

        emit PortalIn(
            sellToken,
            sellAmount,
            buyToken,
            buyAmount,
            fee,
            msg.sender,
            partner
        );
    }
}

File 2 of 10 : Ownable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (access/Ownable.sol)

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() {
        _transferOwnership(_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 {
        _transferOwnership(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");
        _transferOwnership(newOwner);
    }

    /**
     * @dev Transfers ownership of the contract to a new account (`newOwner`).
     * Internal function without access restriction.
     */
    function _transferOwnership(address newOwner) internal virtual {
        address oldOwner = _owner;
        _owner = newOwner;
        emit OwnershipTransferred(oldOwner, newOwner);
    }
}

File 3 of 10 : Context.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (utils/Context.sol)

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) {
        return msg.data;
    }
}

File 4 of 10 : PortalBaseV1_1.sol
/// Copyright (C) 2022 Portals.fi

/// @author Portals.fi
/// @notice Base contract inherited by Portals

/// SPDX-License-Identifier: GPL-3.0
pragma solidity 0.8.11;

import "@openzeppelin/contracts/access/Ownable.sol";
import "../libraries/solmate/utils/SafeTransferLib.sol";
import "../interface/IWETH.sol";
import "../interface/IPortalFactory.sol";
import "../interface/IPortalRegistry.sol";

abstract contract PortalBaseV1_1 is Ownable {
    using SafeTransferLib for address;
    using SafeTransferLib for ERC20;

    // Active status of this contract. If false, contract is active (i.e un-paused)
    bool public paused;

    // Fee in basis points (bps)
    uint256 public fee;

    // Address of the Portal Registry
    IPortalRegistry public registry;

    // Address of the exchange used for swaps
    address public immutable exchange;

    // Address of the wrapped network token (e.g. WETH, wMATIC, wFTM, wAVAX, etc.)
    address public immutable wrappedNetworkToken;

    // Circuit breaker
    modifier pausable() {
        require(!paused, "Paused");
        _;
    }

    constructor(
        bytes32 protocolId,
        PortalType portalType,
        IPortalRegistry _registry,
        address _exchange,
        address _wrappedNetworkToken,
        uint256 _fee
    ) {
        wrappedNetworkToken = _wrappedNetworkToken;
        setFee(_fee);
        exchange = _exchange;
        registry = _registry;
        registry.addPortal(address(this), portalType, protocolId);
        transferOwnership(registry.owner());
    }

    /// @notice Transfers tokens or the network token from the caller to this contract
    /// @param token The address of the token to transfer (address(0) if network token)
    /// @param quantity The quantity of tokens to transfer from the caller
    /// @dev quantity must == msg.value when token == address(0)
    /// @dev msg.value must == 0 when token != address(0)
    /// @return The quantity of tokens or network tokens transferred from the caller to this contract
    function _transferFromCaller(address token, uint256 quantity)
        internal
        virtual
        returns (uint256)
    {
        if (token == address(0)) {
            require(
                msg.value > 0 && msg.value == quantity,
                "Invalid quantity or msg.value"
            );

            return msg.value;
        }

        require(
            quantity > 0 && msg.value == 0,
            "Invalid quantity or msg.value"
        );

        ERC20(token).safeTransferFrom(msg.sender, address(this), quantity);

        return quantity;
    }

    /// @notice Returns the quantity of tokens or network tokens after accounting for the fee
    /// @param quantity The quantity of tokens to subtract the fee from
    /// @param feeBps The fee in basis points (BPS)
    /// @return The quantity of tokens or network tokens to transact with less the fee
    function _getFeeAmount(uint256 quantity, uint256 feeBps)
        internal
        view
        returns (uint256)
    {
        return
            registry.isPortal(msg.sender)
                ? quantity
                : quantity - (quantity * feeBps) / 10000;
    }

    /// @notice Executes swap or portal data at the target address
    /// @param sellToken The sell token
    /// @param sellAmount The quantity of sellToken (in sellToken base units) to send
    /// @param buyToken The buy token
    /// @param target The execution target for the data
    /// @param data The swap or portal data
    /// @return amountBought Quantity of buyToken acquired
    function _execute(
        address sellToken,
        uint256 sellAmount,
        address buyToken,
        address target,
        bytes memory data
    ) internal virtual returns (uint256 amountBought) {
        if (sellToken == buyToken) {
            return sellAmount;
        }

        if (sellToken == address(0) && buyToken == wrappedNetworkToken) {
            IWETH(wrappedNetworkToken).deposit{ value: sellAmount }();
            return sellAmount;
        }

        if (sellToken == wrappedNetworkToken && buyToken == address(0)) {
            IWETH(wrappedNetworkToken).withdraw(sellAmount);
            return sellAmount;
        }

        uint256 valueToSend;
        if (sellToken == address(0)) {
            valueToSend = sellAmount;
        } else {
            _approve(sellToken, target, sellAmount);
        }

        uint256 initialBalance = _getBalance(address(this), buyToken);

        require(
            target == exchange || registry.isPortal(target),
            "Unauthorized target"
        );
        (bool success, bytes memory returnData) = target.call{
            value: valueToSend
        }(data);
        require(success, string(returnData));

        amountBought = _getBalance(address(this), buyToken) - initialBalance;

        require(amountBought > 0, "Invalid execution");
    }

    /// @notice Get the token or network token balance of an account
    /// @param account The owner of the tokens or network tokens whose balance is being queried
    /// @param token The address of the token (address(0) if network token)
    /// @return The owner's token or network token balance
    function _getBalance(address account, address token)
        internal
        view
        returns (uint256)
    {
        if (token == address(0)) {
            return account.balance;
        } else {
            return ERC20(token).balanceOf(account);
        }
    }

    /// @notice Approve a token for spending with finite allowance
    /// @param token The ERC20 token to approve
    /// @param spender The spender of the token
    /// @param amount The allowance to grant to the spender
    function _approve(
        address token,
        address spender,
        uint256 amount
    ) internal {
        ERC20 _token = ERC20(token);
        _token.safeApprove(spender, 0);
        _token.safeApprove(spender, amount);
    }

    /// @notice Collects tokens or network tokens from this contract
    /// @param tokens An array of the tokens to withdraw (address(0) if network token)
    function collect(address[] calldata tokens) external {
        address collector = registry.collector();

        for (uint256 i = 0; i < tokens.length; i++) {
            uint256 qty;

            if (tokens[i] == address(0)) {
                qty = address(this).balance;
                collector.safeTransferETH(qty);
            } else {
                qty = ERC20(tokens[i]).balanceOf(address(this));
                ERC20(tokens[i]).safeTransfer(collector, qty);
            }
        }
    }

    /// @dev Pause or unpause the contract
    function pause() external onlyOwner {
        paused = !paused;
    }

    /// @notice Sets the fee
    /// @param _fee The new fee amount between 0.06-1%
    function setFee(uint256 _fee) public onlyOwner {
        require(_fee >= 6 && _fee <= 100, "Invalid Fee");
        fee = _fee;
    }

    /// @notice Updates the registry
    /// @param _registry The address of the new registry
    function updateRegistry(IPortalRegistry _registry) external onlyOwner {
        registry = _registry;
    }

    /// @notice Reverts if networks tokens are sent directly to this contract
    receive() external payable {
        require(msg.sender != tx.origin);
    }
}

File 5 of 10 : IPortalFactory.sol
/// SPDX-License-Identifier: GPL-3.0

pragma solidity 0.8.11;

import "./IPortalRegistry.sol";

interface IPortalFactory {
    function fee() external view returns (uint256 fee);

    function registry() external view returns (IPortalRegistry registry);
}

File 6 of 10 : IPortalRegistry.sol
/// SPDX-License-Identifier: GPL-3.0

pragma solidity 0.8.11;

enum PortalType {
    IN,
    OUT
}

interface IPortalRegistry {
    function addPortal(
        address portal,
        PortalType portalType,
        bytes32 protocolId
    ) external;

    function addPortalFactory(
        address portalFactory,
        PortalType portalType,
        bytes32 protocolId
    ) external;

    function removePortal(bytes32 protocolId, PortalType portalType) external;

    function owner() external view returns (address owner);

    function registrars(address origin) external view returns (bool isDeployer);

    function collector() external view returns (address collector);

    function isPortal(address portal) external view returns (bool isPortal);
}

File 7 of 10 : IWETH.sol
/// SPDX-License-Identifier: GPL-3.0

pragma solidity 0.8.11;

interface IWETH {
    function deposit() external payable;

    function withdraw(uint256 wad) external;
}

File 8 of 10 : ERC20.sol
// SPDX-License-Identifier: AGPL-3.0-only
pragma solidity >=0.8.0;

/// @notice Modern and gas efficient ERC20 + EIP-2612 implementation.
/// @author Solmate (https://github.com/transmissions11/solmate/blob/main/src/tokens/ERC20.sol)
/// @author Modified from Uniswap (https://github.com/Uniswap/uniswap-v2-core/blob/master/contracts/UniswapV2ERC20.sol)
/// @dev Do not manually set balances without updating totalSupply, as the sum of all user balances must not exceed it.
abstract contract ERC20 {
    /*//////////////////////////////////////////////////////////////
                                 EVENTS
    //////////////////////////////////////////////////////////////*/

    event Transfer(address indexed from, address indexed to, uint256 amount);

    event Approval(
        address indexed owner,
        address indexed spender,
        uint256 amount
    );

    /*//////////////////////////////////////////////////////////////
                            METADATA STORAGE
    //////////////////////////////////////////////////////////////*/

    string public name;

    string public symbol;

    uint8 public immutable decimals;

    /*//////////////////////////////////////////////////////////////
                              ERC20 STORAGE
    //////////////////////////////////////////////////////////////*/

    uint256 public totalSupply;

    mapping(address => uint256) public balanceOf;

    mapping(address => mapping(address => uint256)) public allowance;

    /*//////////////////////////////////////////////////////////////
                            EIP-2612 STORAGE
    //////////////////////////////////////////////////////////////*/

    uint256 internal immutable INITIAL_CHAIN_ID;

    bytes32 internal immutable INITIAL_DOMAIN_SEPARATOR;

    mapping(address => uint256) public nonces;

    /*//////////////////////////////////////////////////////////////
                               CONSTRUCTOR
    //////////////////////////////////////////////////////////////*/

    constructor(
        string memory _name,
        string memory _symbol,
        uint8 _decimals
    ) {
        name = _name;
        symbol = _symbol;
        decimals = _decimals;

        INITIAL_CHAIN_ID = block.chainid;
        INITIAL_DOMAIN_SEPARATOR = computeDomainSeparator();
    }

    /*//////////////////////////////////////////////////////////////
                               ERC20 LOGIC
    //////////////////////////////////////////////////////////////*/

    function approve(address spender, uint256 amount)
        public
        virtual
        returns (bool)
    {
        allowance[msg.sender][spender] = amount;

        emit Approval(msg.sender, spender, amount);

        return true;
    }

    function transfer(address to, uint256 amount)
        public
        virtual
        returns (bool)
    {
        balanceOf[msg.sender] -= amount;

        // Cannot overflow because the sum of all user
        // balances can't exceed the max uint256 value.
        unchecked {
            balanceOf[to] += amount;
        }

        emit Transfer(msg.sender, to, amount);

        return true;
    }

    function transferFrom(
        address from,
        address to,
        uint256 amount
    ) public virtual returns (bool) {
        uint256 allowed = allowance[from][msg.sender]; // Saves gas for limited approvals.

        if (allowed != type(uint256).max)
            allowance[from][msg.sender] = allowed - amount;

        balanceOf[from] -= amount;

        // Cannot overflow because the sum of all user
        // balances can't exceed the max uint256 value.
        unchecked {
            balanceOf[to] += amount;
        }

        emit Transfer(from, to, amount);

        return true;
    }

    /*//////////////////////////////////////////////////////////////
                             EIP-2612 LOGIC
    //////////////////////////////////////////////////////////////*/

    function permit(
        address owner,
        address spender,
        uint256 value,
        uint256 deadline,
        uint8 v,
        bytes32 r,
        bytes32 s
    ) public virtual {
        require(deadline >= block.timestamp, "PERMIT_DEADLINE_EXPIRED");

        // Unchecked because the only math done is incrementing
        // the owner's nonce which cannot realistically overflow.
        unchecked {
            address recoveredAddress = ecrecover(
                keccak256(
                    abi.encodePacked(
                        "\x19\x01",
                        DOMAIN_SEPARATOR(),
                        keccak256(
                            abi.encode(
                                keccak256(
                                    "Permit(address owner,address spender,uint256 value,uint256 nonce,uint256 deadline)"
                                ),
                                owner,
                                spender,
                                value,
                                nonces[owner]++,
                                deadline
                            )
                        )
                    )
                ),
                v,
                r,
                s
            );

            require(
                recoveredAddress != address(0) && recoveredAddress == owner,
                "INVALID_SIGNER"
            );

            allowance[recoveredAddress][spender] = value;
        }

        emit Approval(owner, spender, value);
    }

    function DOMAIN_SEPARATOR() public view virtual returns (bytes32) {
        return
            block.chainid == INITIAL_CHAIN_ID
                ? INITIAL_DOMAIN_SEPARATOR
                : computeDomainSeparator();
    }

    function computeDomainSeparator() internal view virtual returns (bytes32) {
        return
            keccak256(
                abi.encode(
                    keccak256(
                        "EIP712Domain(string name,string version,uint256 chainId,address verifyingContract)"
                    ),
                    keccak256(bytes(name)),
                    keccak256("1"),
                    block.chainid,
                    address(this)
                )
            );
    }

    /*//////////////////////////////////////////////////////////////
                        INTERNAL MINT/BURN LOGIC
    //////////////////////////////////////////////////////////////*/

    function _mint(address to, uint256 amount) internal virtual {
        totalSupply += amount;

        // Cannot overflow because the sum of all user
        // balances can't exceed the max uint256 value.
        unchecked {
            balanceOf[to] += amount;
        }

        emit Transfer(address(0), to, amount);
    }

    function _burn(address from, uint256 amount) internal virtual {
        balanceOf[from] -= amount;

        // Cannot underflow because a user's balance
        // will never be larger than the total supply.
        unchecked {
            totalSupply -= amount;
        }

        emit Transfer(from, address(0), amount);
    }
}

File 9 of 10 : SafeTransferLib.sol
// SPDX-License-Identifier: AGPL-3.0-only
pragma solidity >=0.8.0;

import { ERC20 } from "../tokens/ERC20.sol";

/// @notice Safe ETH and ERC20 transfer library that gracefully handles missing return values.
/// @author Solmate (https://github.com/transmissions11/solmate/blob/main/src/utils/SafeTransferLib.sol)
/// @dev Use with caution! Some functions in this library knowingly create dirty bits at the destination of the free memory pointer.
/// @dev Note that none of the functions in this library check that a token has code at all! That responsibility is delegated to the caller.
library SafeTransferLib {
    /*//////////////////////////////////////////////////////////////
                             ETH OPERATIONS
    //////////////////////////////////////////////////////////////*/

    function safeTransferETH(address to, uint256 amount) internal {
        bool success;

        assembly {
            // Transfer the ETH and store if it succeeded or not.
            success := call(gas(), to, amount, 0, 0, 0, 0)
        }

        require(success, "ETH_TRANSFER_FAILED");
    }

    /*//////////////////////////////////////////////////////////////
                            ERC20 OPERATIONS
    //////////////////////////////////////////////////////////////*/

    function safeTransferFrom(
        ERC20 token,
        address from,
        address to,
        uint256 amount
    ) internal {
        bool success;

        assembly {
            // Get a pointer to some free memory.
            let freeMemoryPointer := mload(0x40)

            // Write the abi-encoded calldata into memory, beginning with the function selector.
            mstore(
                freeMemoryPointer,
                0x23b872dd00000000000000000000000000000000000000000000000000000000
            )
            mstore(add(freeMemoryPointer, 4), from) // Append the "from" argument.
            mstore(add(freeMemoryPointer, 36), to) // Append the "to" argument.
            mstore(add(freeMemoryPointer, 68), amount) // Append the "amount" argument.

            success := and(
                // Set success to whether the call reverted, if not we check it either
                // returned exactly 1 (can't just be non-zero data), or had no return data.
                or(
                    and(eq(mload(0), 1), gt(returndatasize(), 31)),
                    iszero(returndatasize())
                ),
                // We use 100 because the length of our calldata totals up like so: 4 + 32 * 3.
                // We use 0 and 32 to copy up to 32 bytes of return data into the scratch space.
                // Counterintuitively, this call must be positioned second to the or() call in the
                // surrounding and() call or else returndatasize() will be zero during the computation.
                call(gas(), token, 0, freeMemoryPointer, 100, 0, 32)
            )
        }

        require(success, "TRANSFER_FROM_FAILED");
    }

    function safeTransfer(
        ERC20 token,
        address to,
        uint256 amount
    ) internal {
        bool success;

        assembly {
            // Get a pointer to some free memory.
            let freeMemoryPointer := mload(0x40)

            // Write the abi-encoded calldata into memory, beginning with the function selector.
            mstore(
                freeMemoryPointer,
                0xa9059cbb00000000000000000000000000000000000000000000000000000000
            )
            mstore(add(freeMemoryPointer, 4), to) // Append the "to" argument.
            mstore(add(freeMemoryPointer, 36), amount) // Append the "amount" argument.

            success := and(
                // Set success to whether the call reverted, if not we check it either
                // returned exactly 1 (can't just be non-zero data), or had no return data.
                or(
                    and(eq(mload(0), 1), gt(returndatasize(), 31)),
                    iszero(returndatasize())
                ),
                // We use 68 because the length of our calldata totals up like so: 4 + 32 * 2.
                // We use 0 and 32 to copy up to 32 bytes of return data into the scratch space.
                // Counterintuitively, this call must be positioned second to the or() call in the
                // surrounding and() call or else returndatasize() will be zero during the computation.
                call(gas(), token, 0, freeMemoryPointer, 68, 0, 32)
            )
        }

        require(success, "TRANSFER_FAILED");
    }

    function safeApprove(
        ERC20 token,
        address to,
        uint256 amount
    ) internal {
        bool success;

        assembly {
            // Get a pointer to some free memory.
            let freeMemoryPointer := mload(0x40)

            // Write the abi-encoded calldata into memory, beginning with the function selector.
            mstore(
                freeMemoryPointer,
                0x095ea7b300000000000000000000000000000000000000000000000000000000
            )
            mstore(add(freeMemoryPointer, 4), to) // Append the "to" argument.
            mstore(add(freeMemoryPointer, 36), amount) // Append the "amount" argument.

            success := and(
                // Set success to whether the call reverted, if not we check it either
                // returned exactly 1 (can't just be non-zero data), or had no return data.
                or(
                    and(eq(mload(0), 1), gt(returndatasize(), 31)),
                    iszero(returndatasize())
                ),
                // We use 68 because the length of our calldata totals up like so: 4 + 32 * 2.
                // We use 0 and 32 to copy up to 32 bytes of return data into the scratch space.
                // Counterintuitively, this call must be positioned second to the or() call in the
                // surrounding and() call or else returndatasize() will be zero during the computation.
                call(gas(), token, 0, freeMemoryPointer, 68, 0, 32)
            )
        }

        require(success, "APPROVE_FAILED");
    }
}

File 10 of 10 : IYearnPartnerTracker.sol
/// SPDX-License-Identifier: GPL-3.0

pragma solidity 0.8.11;

interface IYearnPartnerTracker {
    /**
     * @notice Deposit into a vault the specified amount from depositer
     * @param vault The address of the vault
     * @param partnerId The address of the partner who has referred this deposit
     * @param amount The amount to deposit
     * @return The number of yVault tokens received
     */
    function deposit(
        address vault,
        address partnerId,
        uint256 amount
    ) external returns (uint256);
}

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

Contract Security Audit

Contract ABI

[{"inputs":[{"internalType":"bytes32","name":"protocolId","type":"bytes32"},{"internalType":"enum PortalType","name":"portalType","type":"uint8"},{"internalType":"contract IPortalRegistry","name":"registry","type":"address"},{"internalType":"address","name":"exchange","type":"address"},{"internalType":"address","name":"wrappedNetworkToken","type":"address"},{"internalType":"uint256","name":"fee","type":"uint256"},{"internalType":"contract IYearnPartnerTracker","name":"yearnPartnerTracker","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"inputs":[{"internalType":"uint256","name":"buyAmount","type":"uint256"},{"internalType":"uint256","name":"minBuyAmount","type":"uint256"}],"name":"InsufficientBuy","type":"error"},{"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":"sellToken","type":"address"},{"indexed":false,"internalType":"uint256","name":"sellAmount","type":"uint256"},{"indexed":false,"internalType":"address","name":"buyToken","type":"address"},{"indexed":false,"internalType":"uint256","name":"buyAmount","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"fee","type":"uint256"},{"indexed":true,"internalType":"address","name":"sender","type":"address"},{"indexed":true,"internalType":"address","name":"partner","type":"address"}],"name":"PortalIn","type":"event"},{"inputs":[{"internalType":"address[]","name":"tokens","type":"address[]"}],"name":"collect","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"exchange","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"fee","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":"pause","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"paused","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"sellToken","type":"address"},{"internalType":"uint256","name":"sellAmount","type":"uint256"},{"internalType":"address","name":"intermediateToken","type":"address"},{"internalType":"address","name":"buyToken","type":"address"},{"internalType":"uint256","name":"minBuyAmount","type":"uint256"},{"internalType":"address","name":"target","type":"address"},{"internalType":"bytes","name":"data","type":"bytes"},{"internalType":"address","name":"partner","type":"address"},{"internalType":"address","name":"yearnAffiliate","type":"address"}],"name":"portalIn","outputs":[{"internalType":"uint256","name":"buyAmount","type":"uint256"}],"stateMutability":"payable","type":"function"},{"inputs":[],"name":"registry","outputs":[{"internalType":"contract IPortalRegistry","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_fee","type":"uint256"}],"name":"setFee","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"contract IPortalRegistry","name":"_registry","type":"address"}],"name":"updateRegistry","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"wrappedNetworkToken","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"stateMutability":"payable","type":"receive"}]

60e06040523480156200001157600080fd5b5060405162001b7438038062001b7483398101604081905262000034916200034a565b868686868686620000453362000181565b6001600160a01b03821660a0526200005d81620001d1565b6001600160a01b03838116608052600280546001600160a01b031916918616918217905560405163dc54e91360e01b815263dc54e91390620000a890309089908b90600401620003e0565b600060405180830381600087803b158015620000c357600080fd5b505af1158015620000d8573d6000803e3d6000fd5b5050505062000160600260009054906101000a90046001600160a01b03166001600160a01b0316638da5cb5b6040518163ffffffff1660e01b8152600401602060405180830381865afa15801562000134573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906200015a919062000420565b62000274565b5050506001600160a01b0390931660c0525062000447975050505050505050565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b6000546001600160a01b03163314620002205760405162461bcd60e51b8152602060048201819052602482015260008051602062001b5483398151915260448201526064015b60405180910390fd5b6006811015801562000233575060648111155b6200026f5760405162461bcd60e51b815260206004820152600b60248201526a496e76616c69642046656560a81b604482015260640162000217565b600155565b6000546001600160a01b03163314620002bf5760405162461bcd60e51b8152602060048201819052602482015260008051602062001b54833981519152604482015260640162000217565b6001600160a01b038116620003265760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b606482015260840162000217565b620003318162000181565b50565b6001600160a01b03811681146200033157600080fd5b600080600080600080600060e0888a0312156200036657600080fd5b875196506020880151600281106200037d57600080fd5b6040890151909650620003908162000334565b6060890151909550620003a38162000334565b6080890151909450620003b68162000334565b60a089015160c08a01519194509250620003d08162000334565b8091505092959891949750929550565b6001600160a01b038416815260608101600284106200040f57634e487b7160e01b600052602160045260246000fd5b602082019390935260400152919050565b6000602082840312156200043357600080fd5b8151620004408162000334565b9392505050565b60805160a05160c0516116b3620004a1600039600081816107aa015261081601526000818161010101528181610d8601528181610dc101528181610e3d0152610eb701526000818161026c0152610f5501526116b36000f3fe6080604052600436106100d65760003560e01c80638456cb591161007f578063b6c2c6e911610059578063b6c2c6e914610239578063d2f7265a1461025a578063ddca3f431461028e578063f2fde38b146102a457600080fd5b80638456cb59146101e65780638da5cb5b146101fb578063a4520aee1461021957600080fd5b806369fe0e2d116100b057806369fe0e2d14610191578063715018a6146101b15780637b103999146101c657600080fd5b8063041bf7bc146100ef5780631a5da6c8146101405780635c975abb1461016057600080fd5b366100ea57333214156100e857600080fd5b005b600080fd5b3480156100fb57600080fd5b506101237f000000000000000000000000000000000000000000000000000000000000000081565b6040516001600160a01b0390911681526020015b60405180910390f35b34801561014c57600080fd5b506100e861015b36600461135d565b6102c4565b34801561016c57600080fd5b5060005461018190600160a01b900460ff1681565b6040519015158152602001610137565b34801561019d57600080fd5b506100e86101ac36600461137a565b610352565b3480156101bd57600080fd5b506100e861040f565b3480156101d257600080fd5b50600254610123906001600160a01b031681565b3480156101f257600080fd5b506100e8610475565b34801561020757600080fd5b506000546001600160a01b0316610123565b34801561022557600080fd5b506100e8610234366004611393565b61050b565b61024c610247366004611418565b6106da565b604051908152602001610137565b34801561026657600080fd5b506101237f000000000000000000000000000000000000000000000000000000000000000081565b34801561029a57600080fd5b5061024c60015481565b3480156102b057600080fd5b506100e86102bf36600461135d565b610987565b6000546001600160a01b031633146103235760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657260448201526064015b60405180910390fd5b6002805473ffffffffffffffffffffffffffffffffffffffff19166001600160a01b0392909216919091179055565b6000546001600160a01b031633146103ac5760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015260640161031a565b600681101580156103be575060648111155b61040a5760405162461bcd60e51b815260206004820152600b60248201527f496e76616c696420466565000000000000000000000000000000000000000000604482015260640161031a565b600155565b6000546001600160a01b031633146104695760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015260640161031a565b6104736000610a69565b565b6000546001600160a01b031633146104cf5760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015260640161031a565b600080547fffffffffffffffffffffff00ffffffffffffffffffffffffffffffffffffffff8116600160a01b9182900460ff1615909102179055565b600254604080517f913e77ad00000000000000000000000000000000000000000000000000000000815290516000926001600160a01b03169163913e77ad9160048083019260209291908290030181865afa15801561056e573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610592919061150b565b905060005b828110156106d4576000808585848181106105b4576105b4611528565b90506020020160208101906105c9919061135d565b6001600160a01b031614156105f25750476105ed6001600160a01b03841682610ac6565b6106c1565b84848381811061060457610604611528565b9050602002016020810190610619919061135d565b6040516370a0823160e01b81523060048201526001600160a01b0391909116906370a0823190602401602060405180830381865afa15801561065f573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610683919061153e565b90506106c1838287878681811061069c5761069c611528565b90506020020160208101906106b1919061135d565b6001600160a01b03169190610b26565b50806106cc8161156d565b915050610597565b50505050565b60008054600160a01b900460ff16156107355760405162461bcd60e51b815260206004820152600660248201527f5061757365640000000000000000000000000000000000000000000000000000604482015260640161031a565b60006107418c8c610bc5565b905061074f81600154610caf565b90506107948c828c8a8a8a8080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250610d4f92505050565b905060006107a2308b611141565b90506107cf8b7f0000000000000000000000000000000000000000000000000000000000000000846111d3565b6040517f8340f5490000000000000000000000000000000000000000000000000000000081526001600160a01b038b811660048301528581166024830152604482018490527f00000000000000000000000000000000000000000000000000000000000000001690638340f549906064016020604051808303816000875af115801561085f573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610883919061153e565b508061088f308c611141565b6108999190611588565b9250888310156108df576040517fc634b00600000000000000000000000000000000000000000000000000000000815260048101849052602481018a905260440161031a565b6108f36001600160a01b038b163385610b26565b846001600160a01b0316336001600160a01b03167fc4d7bc58a132fd4a1b9d658b0a30809bcfb6b4959c1d3d4eb2e300d3a15099be8f8f8e8860015460405161096f9594939291906001600160a01b03958616815260208101949094529190931660408301526060820192909252608081019190915260a00190565b60405180910390a350509a9950505050505050505050565b6000546001600160a01b031633146109e15760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015260640161031a565b6001600160a01b038116610a5d5760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201527f6464726573730000000000000000000000000000000000000000000000000000606482015260840161031a565b610a6681610a69565b50565b600080546001600160a01b0383811673ffffffffffffffffffffffffffffffffffffffff19831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b600080600080600085875af1905080610b215760405162461bcd60e51b815260206004820152601360248201527f4554485f5452414e534645525f4641494c454400000000000000000000000000604482015260640161031a565b505050565b60006040517fa9059cbb000000000000000000000000000000000000000000000000000000008152836004820152826024820152602060006044836000895af13d15601f3d11600160005114161716915050806106d45760405162461bcd60e51b815260206004820152600f60248201527f5452414e534645525f4641494c45440000000000000000000000000000000000604482015260640161031a565b60006001600160a01b038316610c3757600034118015610be457508134145b610c305760405162461bcd60e51b815260206004820152601d60248201527f496e76616c6964207175616e74697479206f72206d73672e76616c7565000000604482015260640161031a565b5034610ca9565b600082118015610c45575034155b610c915760405162461bcd60e51b815260206004820152601d60248201527f496e76616c6964207175616e74697479206f72206d73672e76616c7565000000604482015260640161031a565b610ca66001600160a01b0384163330856111fd565b50805b92915050565b6002546040516313eb467160e01b81523360048201526000916001600160a01b0316906313eb467190602401602060405180830381865afa158015610cf8573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d1c919061159f565b610d4657612710610d2d83856115c1565b610d3791906115e0565b610d419084611588565b610d48565b825b9392505050565b6000836001600160a01b0316866001600160a01b03161415610d72575083611138565b6001600160a01b038616158015610dba57507f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316846001600160a01b0316145b15610e3b577f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031663d0e30db0866040518263ffffffff1660e01b81526004016000604051808303818588803b158015610e1a57600080fd5b505af1158015610e2e573d6000803e3d6000fd5b5050505050849050611138565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316866001600160a01b0316148015610e8357506001600160a01b038416155b15610f23576040517f2e1a7d4d000000000000000000000000000000000000000000000000000000008152600481018690527f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031690632e1a7d4d90602401600060405180830381600087803b158015610f0357600080fd5b505af1158015610f17573d6000803e3d6000fd5b50505050849050611138565b60006001600160a01b038716610f3a575084610f45565b610f458785886111d3565b6000610f513087611141565b90507f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316856001600160a01b03161480610ffc57506002546040516313eb467160e01b81526001600160a01b038781166004830152909116906313eb467190602401602060405180830381865afa158015610fd8573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610ffc919061159f565b6110485760405162461bcd60e51b815260206004820152601360248201527f556e617574686f72697a65642074617267657400000000000000000000000000604482015260640161031a565b600080866001600160a01b03168487604051611064919061162e565b60006040518083038185875af1925050503d80600081146110a1576040519150601f19603f3d011682016040523d82523d6000602084013e6110a6565b606091505b50915091508181906110cb5760405162461bcd60e51b815260040161031a919061164a565b50826110d7308a611141565b6110e19190611588565b9450600085116111335760405162461bcd60e51b815260206004820152601160248201527f496e76616c696420657865637574696f6e000000000000000000000000000000604482015260640161031a565b505050505b95945050505050565b60006001600160a01b03821661116257506001600160a01b03821631610ca9565b6040516370a0823160e01b81526001600160a01b0384811660048301528316906370a0823190602401602060405180830381865afa1580156111a8573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906111cc919061153e565b9050610ca9565b826111e96001600160a01b0382168460006112a9565b6106d46001600160a01b03821684846112a9565b60006040517f23b872dd0000000000000000000000000000000000000000000000000000000081528460048201528360248201528260448201526020600060648360008a5af13d15601f3d11600160005114161716915050806112a25760405162461bcd60e51b815260206004820152601460248201527f5452414e534645525f46524f4d5f4641494c4544000000000000000000000000604482015260640161031a565b5050505050565b60006040517f095ea7b3000000000000000000000000000000000000000000000000000000008152836004820152826024820152602060006044836000895af13d15601f3d11600160005114161716915050806106d45760405162461bcd60e51b815260206004820152600e60248201527f415050524f56455f4641494c4544000000000000000000000000000000000000604482015260640161031a565b6001600160a01b0381168114610a6657600080fd5b60006020828403121561136f57600080fd5b8135610d4881611348565b60006020828403121561138c57600080fd5b5035919050565b600080602083850312156113a657600080fd5b823567ffffffffffffffff808211156113be57600080fd5b818501915085601f8301126113d257600080fd5b8135818111156113e157600080fd5b8660208260051b85010111156113f657600080fd5b60209290920196919550909350505050565b803561141381611348565b919050565b6000806000806000806000806000806101208b8d03121561143857600080fd5b8a3561144381611348565b995060208b0135985060408b013561145a81611348565b975060608b013561146a81611348565b965060808b0135955060a08b013561148181611348565b945060c08b013567ffffffffffffffff8082111561149e57600080fd5b818d0191508d601f8301126114b257600080fd5b8135818111156114c157600080fd5b8e60208285010111156114d357600080fd5b6020830196508095505050506114eb60e08c01611408565b91506114fa6101008c01611408565b90509295989b9194979a5092959850565b60006020828403121561151d57600080fd5b8151610d4881611348565b634e487b7160e01b600052603260045260246000fd5b60006020828403121561155057600080fd5b5051919050565b634e487b7160e01b600052601160045260246000fd5b600060001982141561158157611581611557565b5060010190565b60008282101561159a5761159a611557565b500390565b6000602082840312156115b157600080fd5b81518015158114610d4857600080fd5b60008160001904831182151516156115db576115db611557565b500290565b6000826115fd57634e487b7160e01b600052601260045260246000fd5b500490565b60005b8381101561161d578181015183820152602001611605565b838111156106d45750506000910152565b60008251611640818460208701611602565b9190910192915050565b6020815260008251806020840152611669816040850160208701611602565b601f01601f1916919091016040019291505056fea2646970667358221220283644bbb458cf5a52e4a6bfad42ba681cb7901f7570c893ddd346e327a9960e64736f6c634300080b00334f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572796561726e506172746e657200000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000ea49d02c248b357b99670d9e9741f54f72df9cb3000000000000000000000000def1c0ded9bec7f1a1670819833240f027b25eff000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc2000000000000000000000000000000000000000000000000000000000000001e0000000000000000000000008ee392a4787397126c163cb9844d7c447da419d8

Deployed Bytecode

0x6080604052600436106100d65760003560e01c80638456cb591161007f578063b6c2c6e911610059578063b6c2c6e914610239578063d2f7265a1461025a578063ddca3f431461028e578063f2fde38b146102a457600080fd5b80638456cb59146101e65780638da5cb5b146101fb578063a4520aee1461021957600080fd5b806369fe0e2d116100b057806369fe0e2d14610191578063715018a6146101b15780637b103999146101c657600080fd5b8063041bf7bc146100ef5780631a5da6c8146101405780635c975abb1461016057600080fd5b366100ea57333214156100e857600080fd5b005b600080fd5b3480156100fb57600080fd5b506101237f000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc281565b6040516001600160a01b0390911681526020015b60405180910390f35b34801561014c57600080fd5b506100e861015b36600461135d565b6102c4565b34801561016c57600080fd5b5060005461018190600160a01b900460ff1681565b6040519015158152602001610137565b34801561019d57600080fd5b506100e86101ac36600461137a565b610352565b3480156101bd57600080fd5b506100e861040f565b3480156101d257600080fd5b50600254610123906001600160a01b031681565b3480156101f257600080fd5b506100e8610475565b34801561020757600080fd5b506000546001600160a01b0316610123565b34801561022557600080fd5b506100e8610234366004611393565b61050b565b61024c610247366004611418565b6106da565b604051908152602001610137565b34801561026657600080fd5b506101237f000000000000000000000000def1c0ded9bec7f1a1670819833240f027b25eff81565b34801561029a57600080fd5b5061024c60015481565b3480156102b057600080fd5b506100e86102bf36600461135d565b610987565b6000546001600160a01b031633146103235760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657260448201526064015b60405180910390fd5b6002805473ffffffffffffffffffffffffffffffffffffffff19166001600160a01b0392909216919091179055565b6000546001600160a01b031633146103ac5760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015260640161031a565b600681101580156103be575060648111155b61040a5760405162461bcd60e51b815260206004820152600b60248201527f496e76616c696420466565000000000000000000000000000000000000000000604482015260640161031a565b600155565b6000546001600160a01b031633146104695760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015260640161031a565b6104736000610a69565b565b6000546001600160a01b031633146104cf5760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015260640161031a565b600080547fffffffffffffffffffffff00ffffffffffffffffffffffffffffffffffffffff8116600160a01b9182900460ff1615909102179055565b600254604080517f913e77ad00000000000000000000000000000000000000000000000000000000815290516000926001600160a01b03169163913e77ad9160048083019260209291908290030181865afa15801561056e573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610592919061150b565b905060005b828110156106d4576000808585848181106105b4576105b4611528565b90506020020160208101906105c9919061135d565b6001600160a01b031614156105f25750476105ed6001600160a01b03841682610ac6565b6106c1565b84848381811061060457610604611528565b9050602002016020810190610619919061135d565b6040516370a0823160e01b81523060048201526001600160a01b0391909116906370a0823190602401602060405180830381865afa15801561065f573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610683919061153e565b90506106c1838287878681811061069c5761069c611528565b90506020020160208101906106b1919061135d565b6001600160a01b03169190610b26565b50806106cc8161156d565b915050610597565b50505050565b60008054600160a01b900460ff16156107355760405162461bcd60e51b815260206004820152600660248201527f5061757365640000000000000000000000000000000000000000000000000000604482015260640161031a565b60006107418c8c610bc5565b905061074f81600154610caf565b90506107948c828c8a8a8a8080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250610d4f92505050565b905060006107a2308b611141565b90506107cf8b7f0000000000000000000000008ee392a4787397126c163cb9844d7c447da419d8846111d3565b6040517f8340f5490000000000000000000000000000000000000000000000000000000081526001600160a01b038b811660048301528581166024830152604482018490527f0000000000000000000000008ee392a4787397126c163cb9844d7c447da419d81690638340f549906064016020604051808303816000875af115801561085f573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610883919061153e565b508061088f308c611141565b6108999190611588565b9250888310156108df576040517fc634b00600000000000000000000000000000000000000000000000000000000815260048101849052602481018a905260440161031a565b6108f36001600160a01b038b163385610b26565b846001600160a01b0316336001600160a01b03167fc4d7bc58a132fd4a1b9d658b0a30809bcfb6b4959c1d3d4eb2e300d3a15099be8f8f8e8860015460405161096f9594939291906001600160a01b03958616815260208101949094529190931660408301526060820192909252608081019190915260a00190565b60405180910390a350509a9950505050505050505050565b6000546001600160a01b031633146109e15760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015260640161031a565b6001600160a01b038116610a5d5760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201527f6464726573730000000000000000000000000000000000000000000000000000606482015260840161031a565b610a6681610a69565b50565b600080546001600160a01b0383811673ffffffffffffffffffffffffffffffffffffffff19831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b600080600080600085875af1905080610b215760405162461bcd60e51b815260206004820152601360248201527f4554485f5452414e534645525f4641494c454400000000000000000000000000604482015260640161031a565b505050565b60006040517fa9059cbb000000000000000000000000000000000000000000000000000000008152836004820152826024820152602060006044836000895af13d15601f3d11600160005114161716915050806106d45760405162461bcd60e51b815260206004820152600f60248201527f5452414e534645525f4641494c45440000000000000000000000000000000000604482015260640161031a565b60006001600160a01b038316610c3757600034118015610be457508134145b610c305760405162461bcd60e51b815260206004820152601d60248201527f496e76616c6964207175616e74697479206f72206d73672e76616c7565000000604482015260640161031a565b5034610ca9565b600082118015610c45575034155b610c915760405162461bcd60e51b815260206004820152601d60248201527f496e76616c6964207175616e74697479206f72206d73672e76616c7565000000604482015260640161031a565b610ca66001600160a01b0384163330856111fd565b50805b92915050565b6002546040516313eb467160e01b81523360048201526000916001600160a01b0316906313eb467190602401602060405180830381865afa158015610cf8573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d1c919061159f565b610d4657612710610d2d83856115c1565b610d3791906115e0565b610d419084611588565b610d48565b825b9392505050565b6000836001600160a01b0316866001600160a01b03161415610d72575083611138565b6001600160a01b038616158015610dba57507f000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc26001600160a01b0316846001600160a01b0316145b15610e3b577f000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc26001600160a01b031663d0e30db0866040518263ffffffff1660e01b81526004016000604051808303818588803b158015610e1a57600080fd5b505af1158015610e2e573d6000803e3d6000fd5b5050505050849050611138565b7f000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc26001600160a01b0316866001600160a01b0316148015610e8357506001600160a01b038416155b15610f23576040517f2e1a7d4d000000000000000000000000000000000000000000000000000000008152600481018690527f000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc26001600160a01b031690632e1a7d4d90602401600060405180830381600087803b158015610f0357600080fd5b505af1158015610f17573d6000803e3d6000fd5b50505050849050611138565b60006001600160a01b038716610f3a575084610f45565b610f458785886111d3565b6000610f513087611141565b90507f000000000000000000000000def1c0ded9bec7f1a1670819833240f027b25eff6001600160a01b0316856001600160a01b03161480610ffc57506002546040516313eb467160e01b81526001600160a01b038781166004830152909116906313eb467190602401602060405180830381865afa158015610fd8573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610ffc919061159f565b6110485760405162461bcd60e51b815260206004820152601360248201527f556e617574686f72697a65642074617267657400000000000000000000000000604482015260640161031a565b600080866001600160a01b03168487604051611064919061162e565b60006040518083038185875af1925050503d80600081146110a1576040519150601f19603f3d011682016040523d82523d6000602084013e6110a6565b606091505b50915091508181906110cb5760405162461bcd60e51b815260040161031a919061164a565b50826110d7308a611141565b6110e19190611588565b9450600085116111335760405162461bcd60e51b815260206004820152601160248201527f496e76616c696420657865637574696f6e000000000000000000000000000000604482015260640161031a565b505050505b95945050505050565b60006001600160a01b03821661116257506001600160a01b03821631610ca9565b6040516370a0823160e01b81526001600160a01b0384811660048301528316906370a0823190602401602060405180830381865afa1580156111a8573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906111cc919061153e565b9050610ca9565b826111e96001600160a01b0382168460006112a9565b6106d46001600160a01b03821684846112a9565b60006040517f23b872dd0000000000000000000000000000000000000000000000000000000081528460048201528360248201528260448201526020600060648360008a5af13d15601f3d11600160005114161716915050806112a25760405162461bcd60e51b815260206004820152601460248201527f5452414e534645525f46524f4d5f4641494c4544000000000000000000000000604482015260640161031a565b5050505050565b60006040517f095ea7b3000000000000000000000000000000000000000000000000000000008152836004820152826024820152602060006044836000895af13d15601f3d11600160005114161716915050806106d45760405162461bcd60e51b815260206004820152600e60248201527f415050524f56455f4641494c4544000000000000000000000000000000000000604482015260640161031a565b6001600160a01b0381168114610a6657600080fd5b60006020828403121561136f57600080fd5b8135610d4881611348565b60006020828403121561138c57600080fd5b5035919050565b600080602083850312156113a657600080fd5b823567ffffffffffffffff808211156113be57600080fd5b818501915085601f8301126113d257600080fd5b8135818111156113e157600080fd5b8660208260051b85010111156113f657600080fd5b60209290920196919550909350505050565b803561141381611348565b919050565b6000806000806000806000806000806101208b8d03121561143857600080fd5b8a3561144381611348565b995060208b0135985060408b013561145a81611348565b975060608b013561146a81611348565b965060808b0135955060a08b013561148181611348565b945060c08b013567ffffffffffffffff8082111561149e57600080fd5b818d0191508d601f8301126114b257600080fd5b8135818111156114c157600080fd5b8e60208285010111156114d357600080fd5b6020830196508095505050506114eb60e08c01611408565b91506114fa6101008c01611408565b90509295989b9194979a5092959850565b60006020828403121561151d57600080fd5b8151610d4881611348565b634e487b7160e01b600052603260045260246000fd5b60006020828403121561155057600080fd5b5051919050565b634e487b7160e01b600052601160045260246000fd5b600060001982141561158157611581611557565b5060010190565b60008282101561159a5761159a611557565b500390565b6000602082840312156115b157600080fd5b81518015158114610d4857600080fd5b60008160001904831182151516156115db576115db611557565b500290565b6000826115fd57634e487b7160e01b600052601260045260246000fd5b500490565b60005b8381101561161d578181015183820152602001611605565b838111156106d45750506000910152565b60008251611640818460208701611602565b9190910192915050565b6020815260008251806020840152611669816040850160208701611602565b601f01601f1916919091016040019291505056fea2646970667358221220283644bbb458cf5a52e4a6bfad42ba681cb7901f7570c893ddd346e327a9960e64736f6c634300080b0033

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

796561726e506172746e657200000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000ea49d02c248b357b99670d9e9741f54f72df9cb3000000000000000000000000def1c0ded9bec7f1a1670819833240f027b25eff000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc2000000000000000000000000000000000000000000000000000000000000001e0000000000000000000000008ee392a4787397126c163cb9844d7c447da419d8

-----Decoded View---------------
Arg [0] : protocolId (bytes32): 0x796561726e506172746e65720000000000000000000000000000000000000000
Arg [1] : portalType (uint8): 0
Arg [2] : registry (address): 0xEa49D02c248b357B99670d9E9741F54f72dF9Cb3
Arg [3] : exchange (address): 0xDef1C0ded9bec7F1a1670819833240f027b25EfF
Arg [4] : wrappedNetworkToken (address): 0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2
Arg [5] : fee (uint256): 30
Arg [6] : yearnPartnerTracker (address): 0x8ee392a4787397126C163Cb9844d7c447da419D8

-----Encoded View---------------
7 Constructor Arguments found :
Arg [0] : 796561726e506172746e65720000000000000000000000000000000000000000
Arg [1] : 0000000000000000000000000000000000000000000000000000000000000000
Arg [2] : 000000000000000000000000ea49d02c248b357b99670d9e9741f54f72df9cb3
Arg [3] : 000000000000000000000000def1c0ded9bec7f1a1670819833240f027b25eff
Arg [4] : 000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc2
Arg [5] : 000000000000000000000000000000000000000000000000000000000000001e
Arg [6] : 0000000000000000000000008ee392a4787397126c163cb9844d7c447da419d8


Block Transaction Difficulty Gas Used Reward
View All Blocks Produced

Block Uncle Number Difficulty Gas Used Reward
View All Uncles
Loading...
Loading
Loading...
Loading

Validator Index Block Amount
View All Withdrawals

Transaction Hash Block Value Eth2 PubKey Valid
View All Deposits
Chain Token Portfolio % Price Amount Value
ETH14.87%$2.212.5642$5.67
ETH7.25%$322.370.00857449$2.76
ETH6.47%$279.310.00882751$2.47
ETH5.07%$0.03495455.3133$1.93
ETH4.65%$0.2146968.2503$1.77
ETH4.48%$107.360.0159$1.71
ETH4.31%$5,553.960.00029551$1.64
ETH3.35%$0.9995171.2758$1.28
ETH3.15%$1.041.1611$1.2
ETH3.09%$0.05019423.4929$1.18
ETH2.98%$0.4788022.3747$1.14
ETH2.67%$0.3768942.7$1.02
ETH2.65%$33.70.03$1.01
ETH2.37%$0.8331971.085$0.904
ETH1.84%$2.550.2745$0.70
ETH1.67%$0.2585352.4597$0.6359
ETH1.58%$2.840.212$0.602
ETH1.47%$0.2625242.128$0.5586
ETH1.44%$20.470.0268$0.548
ETH1.37%$0.2006392.5998$0.5216
ETH1.28%$0.5398370.906$0.489
ETH1.15%$66.750.00654476$0.4368
ETH1.12%$55.280.00775358$0.4286
ETH1.12%$1.490.2861$0.4262
ETH1.08%$0.1390692.9611$0.4117
ETH0.96%$54.310.00671377$0.3646
ETH0.93%$0.6008050.592$0.3556
ETH0.93%$0.00517968.6322$0.3554
ETH0.89%$0.3897390.8662$0.3375
ETH0.63%$0.01958712.3285$0.2414
ETH0.49%$1.30.1446$0.188
ETH0.49%$0.2318680.7994$0.1853
ETH0.47%$10.1798$0.1799
ETH0.45%$0.4969020.347$0.1724
ETH0.40%$0.9989850.1529$0.1527
ETH0.38%$0.541810.2678$0.1451
ETH0.36%$0.0329654.2187$0.139
ETH0.34%$0.00431930.002$0.1295
ETH0.32%$0.057922.1038$0.1218
ETH0.31%$0.9750230.1213$0.1182
ETH0.31%$0.0327213.591$0.1175
ETH0.30%$10.1126$0.1127
OP8.45%$13.2112$3.22
BSC0.11%$672.940.00006$0.040376
POL<0.01%$0.5917170.00606984$0.003592
Loading...
Loading
[ Download: CSV Export  ]
[ Download: CSV Export  ]

A contract address hosts a smart contract, which is a set of code stored on the blockchain that runs when predetermined conditions are met. Learn more about addresses in our Knowledge Base.