ETH Price: $3,202.50 (+1.49%)
 

Multichain Info

1 address found via
Transaction Hash
Method
Block
From
To
Portal Out185680952023-11-14 5:37:11440 days ago1699940231IN
0x70ed999E...cA7b807F4
0 ETH0.008355624.82146752
Portal Out185675462023-11-14 3:46:35441 days ago1699933595IN
0x70ed999E...cA7b807F4
0 ETH0.0196965228.29521495
Portal Out183364242023-10-12 19:29:11473 days ago1697138951IN
0x70ed999E...cA7b807F4
0 ETH0.003052938.70260299
Portal Out183003462023-10-07 18:17:35478 days ago1696702655IN
0x70ed999E...cA7b807F4
0 ETH0.002542598.61431483
Portal Out182564652023-10-01 15:05:47484 days ago1696172747IN
0x70ed999E...cA7b807F4
0 ETH0.0035120610.3096201
Portal Out182485962023-09-30 12:43:23485 days ago1696077803IN
0x70ed999E...cA7b807F4
0 ETH0.004402237.637931
Portal Out182278652023-09-27 15:03:59488 days ago1695827039IN
0x70ed999E...cA7b807F4
0 ETH0.0207950425.42669597
Portal Out181680912023-09-19 6:11:35496 days ago1695103895IN
0x70ed999E...cA7b807F4
0 ETH0.002670797.77
Portal Out180938562023-09-08 19:43:35507 days ago1694202215IN
0x70ed999E...cA7b807F4
0 ETH0.0080892215.50526424
Portal Out180466362023-09-02 5:04:47513 days ago1693631087IN
0x70ed999E...cA7b807F4
0 ETH0.0078646510.23835131
Portal Out180466312023-09-02 5:03:47513 days ago1693631027IN
0x70ed999E...cA7b807F4
0 ETH0.009919410.94116941
Portal Out180266932023-08-30 10:01:47516 days ago1693389707IN
0x70ed999E...cA7b807F4
0 ETH0.0114254316.21209035
Portal Out178191992023-08-01 9:16:59545 days ago1690881419IN
0x70ed999E...cA7b807F4
0 ETH0.0271630919.78487786
Portal Out178169002023-08-01 1:33:35546 days ago1690853615IN
0x70ed999E...cA7b807F4
0 ETH0.0080964215.51464325
Portal Out177599722023-07-24 2:25:35554 days ago1690165535IN
0x70ed999E...cA7b807F4
0 ETH0.01058617.45808048
Portal Out177074842023-07-16 17:58:59561 days ago1689530339IN
0x70ed999E...cA7b807F4
0 ETH0.0124142812.37272838
Portal Out176459462023-07-08 2:00:59570 days ago1688781659IN
0x70ed999E...cA7b807F4
0 ETH0.0083030718.92668155
Portal Out176049392023-07-02 7:47:35575 days ago1688284055IN
0x70ed999E...cA7b807F4
0 ETH0.0167777313.8
Portal Out176031672023-07-02 1:49:59576 days ago1688262599IN
0x70ed999E...cA7b807F4
0 ETH0.0157100713.34275235
Portal Out175806652023-06-28 22:02:11579 days ago1687989731IN
0x70ed999E...cA7b807F4
0 ETH0.0229763420.29187277
Portal Out175801022023-06-28 20:08:47579 days ago1687982927IN
0x70ed999E...cA7b807F4
0 ETH0.0276583325.52071913
Portal Out175358652023-06-22 14:51:59585 days ago1687445519IN
0x70ed999E...cA7b807F4
0 ETH0.0167407419.82173376
Portal Out173841452023-06-01 6:20:11606 days ago1685600411IN
0x70ed999E...cA7b807F4
0 ETH0.0223060243.93959894
Portal Out173841382023-06-01 6:18:47606 days ago1685600327IN
0x70ed999E...cA7b807F4
0 ETH0.0291707540.77886701
Portal Out170978712023-04-21 22:59:23647 days ago1682117963IN
0x70ed999E...cA7b807F4
0 ETH0.0040837631.51542952
View all transactions

Latest 25 internal transactions (View All)

Advanced mode:
Parent Transaction Hash Block
From
To
196083012024-04-08 3:33:35295 days ago1712547215
0x70ed999E...cA7b807F4
0.56345772 ETH
183351152023-10-12 15:04:47473 days ago1697123087
0x70ed999E...cA7b807F4
2.09154599 ETH
183351152023-10-12 15:04:47473 days ago1697123087
0x70ed999E...cA7b807F4
2.09154599 ETH
181456412023-09-16 2:05:59500 days ago1694829959
0x70ed999E...cA7b807F4
6.25477481 ETH
181456412023-09-16 2:05:59500 days ago1694829959
0x70ed999E...cA7b807F4
6.25477481 ETH
180051022023-08-27 9:26:59519 days ago1693128419
0x70ed999E...cA7b807F4
0.49774697 ETH
180051022023-08-27 9:26:59519 days ago1693128419
0x70ed999E...cA7b807F4
0.49774697 ETH
176459462023-07-08 2:00:59570 days ago1688781659
0x70ed999E...cA7b807F4
0.1695841 ETH
176459462023-07-08 2:00:59570 days ago1688781659
0x70ed999E...cA7b807F4
0.17009438 ETH
173841452023-06-01 6:20:11606 days ago1685600411
0x70ed999E...cA7b807F4
0.03316729 ETH
173841452023-06-01 6:20:11606 days ago1685600411
0x70ed999E...cA7b807F4
0.03326709 ETH
173841382023-06-01 6:18:47606 days ago1685600327
0x70ed999E...cA7b807F4
0.03471977 ETH
173841382023-06-01 6:18:47606 days ago1685600327
0x70ed999E...cA7b807F4
0.03482424 ETH
170978712023-04-21 22:59:23647 days ago1682117963
0x70ed999E...cA7b807F4
0.99700012 ETH
170978712023-04-21 22:59:23647 days ago1682117963
0x70ed999E...cA7b807F4
1.00000012 ETH
167024252023-02-25 2:45:59703 days ago1677293159
0x70ed999E...cA7b807F4
0.92344155 ETH
167024252023-02-25 2:45:59703 days ago1677293159
0x70ed999E...cA7b807F4
0.92622021 ETH
162223542022-12-20 0:34:47770 days ago1671496487
0x70ed999E...cA7b807F4
22.06094052 ETH
162223542022-12-20 0:34:47770 days ago1671496487
0x70ed999E...cA7b807F4
22.12732248 ETH
162004362022-12-16 23:08:11773 days ago1671232091
0x70ed999E...cA7b807F4
10.50081663 ETH
162004362022-12-16 23:08:11773 days ago1671232091
0x70ed999E...cA7b807F4
10.53241387 ETH
161945882022-12-16 3:31:35774 days ago1671161495
0x70ed999E...cA7b807F4
2.52251142 ETH
161945882022-12-16 3:31:35774 days ago1671161495
0x70ed999E...cA7b807F4
2.53010172 ETH
161907932022-12-15 14:48:47774 days ago1671115727
0x70ed999E...cA7b807F4
2.76808179 ETH
161907932022-12-15 14:48:47774 days ago1671115727
0x70ed999E...cA7b807F4
2.77641103 ETH
View All Internal Transactions
Loading...
Loading

Contract Source Code Verified (Exact Match)

Contract Name:
YearnPortalOut

Compiler Version
v0.8.11+commit.d7f03943

Optimization Enabled:
Yes with 1000 runs

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

/// @author Portals.fi
/// @notice This contract removes liquidity from Yearn Vaults into 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/IVault.sol";

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

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

    /// @notice Emitted when a portal is exited
    /// @param sellToken The ERC20 token address to spend (address(0) if network token)
    /// @param sellAmount The quantity of sellToken to Portal out
    /// @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 PortalOut(
        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
    )
        PortalBaseV1_1(
            protocolId,
            portalType,
            registry,
            exchange,
            wrappedNetworkToken,
            fee
        )
    {}

    /// @notice Remove liquidity from Yearn like vaults into network tokens/ERC20 tokens
    /// @param sellToken The vault token address
    /// @param sellAmount The quantity of sellToken to Portal out
    /// @param intermediateToken The intermediate token to swap from (must be the vault underlying token)
    /// @param buyToken The ERC20 token address to buy (address(0) if network 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
    /// @return buyAmount The quantity of buyToken acquired
    function portalOut(
        address sellToken,
        uint256 sellAmount,
        address intermediateToken,
        address buyToken,
        uint256 minBuyAmount,
        address target,
        bytes calldata data,
        address partner
    ) public payable pausable returns (uint256 buyAmount) {
        uint256 amount = _transferFromCaller(sellToken, sellAmount);

        uint256 balance = _getBalance(address(this), intermediateToken);
        IVault(sellToken).withdraw(amount);
        amount = _getBalance(address(this), intermediateToken) - balance;

        buyAmount = _execute(intermediateToken, amount, buyToken, target, data);

        buyAmount = _getFeeAmount(buyAmount, fee);

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

        buyToken == address(0)
            ? msg.sender.safeTransferETH(buyAmount)
            : ERC20(buyToken).safeTransfer(msg.sender, buyAmount);

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

    /// @notice Remove liquidity from Yearn like vaults into network tokens/ERC20 tokens with permit
    /// @param sellToken The vault token address
    /// @param sellAmount The quantity of sellToken to Portal out
    /// @param intermediateToken The intermediate token to swap from (must be the vault underlying token)
    /// @param buyToken The ERC20 token address to buy (address(0) if network 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 signature A valid secp256k1 signature of Permit by owner encoded as r, s, v
    /// @return buyAmount The quantity of buyToken acquired
    function portalOutWithPermit(
        address sellToken,
        uint256 sellAmount,
        address intermediateToken,
        address buyToken,
        uint256 minBuyAmount,
        address target,
        bytes calldata data,
        address partner,
        bytes calldata signature
    ) external payable pausable returns (uint256 buyAmount) {
        _permit(sellToken, sellAmount, signature);

        return
            portalOut(
                sellToken,
                sellAmount,
                intermediateToken,
                buyToken,
                minBuyAmount,
                target,
                data,
                partner
            );
    }

    function _permit(
        address sellToken,
        uint256 sellAmount,
        bytes calldata signature
    ) internal {
        bool success = IVault(sellToken).permit(
            msg.sender,
            address(this),
            sellAmount,
            0,
            signature
        );
        require(success, "Could Not Permit");
    }
}

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 : IVault.sol
/// SPDX-License-Identifier: GPL-3.0

pragma solidity 0.8.11;

interface IVault {
    function deposit(uint256 _amount) external payable;

    function withdraw(uint256 _amount) external;

    function permit(
        address owner,
        address spender,
        uint256 amount,
        uint256 expiry,
        bytes calldata signature
    ) external returns (bool);
}

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"}],"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":"PortalOut","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"}],"name":"portalOut","outputs":[{"internalType":"uint256","name":"buyAmount","type":"uint256"}],"stateMutability":"payable","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":"bytes","name":"signature","type":"bytes"}],"name":"portalOutWithPermit","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"}]

60c06040523480156200001157600080fd5b5060405162001d4138038062001d4183398101604081905262000034916200033b565b858585858585620000453362000172565b6001600160a01b03821660a0526200005d81620001c2565b6001600160a01b03838116608052600280546001600160a01b031916918616918217905560405163dc54e91360e01b815263dc54e91390620000a890309089908b90600401620003ba565b600060405180830381600087803b158015620000c357600080fd5b505af1158015620000d8573d6000803e3d6000fd5b5050505062000160600260009054906101000a90046001600160a01b03166001600160a01b0316638da5cb5b6040518163ffffffff1660e01b8152600401602060405180830381865afa15801562000134573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906200015a9190620003fa565b62000265565b50505050505050505050505062000421565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b6000546001600160a01b03163314620002115760405162461bcd60e51b8152602060048201819052602482015260008051602062001d2183398151915260448201526064015b60405180910390fd5b6006811015801562000224575060648111155b620002605760405162461bcd60e51b815260206004820152600b60248201526a496e76616c69642046656560a81b604482015260640162000208565b600155565b6000546001600160a01b03163314620002b05760405162461bcd60e51b8152602060048201819052602482015260008051602062001d21833981519152604482015260640162000208565b6001600160a01b038116620003175760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b606482015260840162000208565b620003228162000172565b50565b6001600160a01b03811681146200032257600080fd5b60008060008060008060c087890312156200035557600080fd5b865195506020870151600281106200036c57600080fd5b60408801519095506200037f8162000325565b6060880151909450620003928162000325565b6080880151909350620003a58162000325565b8092505060a087015190509295509295509295565b6001600160a01b03841681526060810160028410620003e957634e487b7160e01b600052602160045260246000fd5b602082019390935260400152919050565b6000602082840312156200040d57600080fd5b81516200041a8162000325565b9392505050565b60805160a0516118b76200046a6000396000818161010c01528181610c6901528181610ca401528181610d200152610d8101526000818161028a0152610e1f01526118b76000f3fe6080604052600436106100e15760003560e01c80638da5cb5b1161007f578063ae0e9d5c11610059578063ae0e9d5c14610265578063d2f7265a14610278578063ddca3f43146102ac578063f2fde38b146102c257600080fd5b80638da5cb5b146102065780638ea7ab5314610224578063a4520aee1461024557600080fd5b806369fe0e2d116100bb57806369fe0e2d1461019c578063715018a6146101bc5780637b103999146101d15780638456cb59146101f157600080fd5b8063041bf7bc146100fa5780631a5da6c81461014b5780635c975abb1461016b57600080fd5b366100f557333214156100f357600080fd5b005b600080fd5b34801561010657600080fd5b5061012e7f000000000000000000000000000000000000000000000000000000000000000081565b6040516001600160a01b0390911681526020015b60405180910390f35b34801561015757600080fd5b506100f3610166366004611414565b6102e2565b34801561017757600080fd5b5060005461018c90600160a01b900460ff1681565b6040519015158152602001610142565b3480156101a857600080fd5b506100f36101b7366004611431565b610370565b3480156101c857600080fd5b506100f361042d565b3480156101dd57600080fd5b5060025461012e906001600160a01b031681565b3480156101fd57600080fd5b506100f3610493565b34801561021257600080fd5b506000546001600160a01b031661012e565b6102376102323660046114a3565b610529565b604051908152602001610142565b34801561025157600080fd5b506100f3610260366004611558565b610737565b6102376102733660046115cd565b610906565b34801561028457600080fd5b5061012e7f000000000000000000000000000000000000000000000000000000000000000081565b3480156102b857600080fd5b5061023760015481565b3480156102ce57600080fd5b506100f36102dd366004611414565b610977565b6000546001600160a01b031633146103415760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657260448201526064015b60405180910390fd5b6002805473ffffffffffffffffffffffffffffffffffffffff19166001600160a01b0392909216919091179055565b6000546001600160a01b031633146103ca5760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610338565b600681101580156103dc575060648111155b6104285760405162461bcd60e51b815260206004820152600b60248201527f496e76616c6964204665650000000000000000000000000000000000000000006044820152606401610338565b600155565b6000546001600160a01b031633146104875760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610338565b6104916000610a59565b565b6000546001600160a01b031633146104ed5760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610338565b600080547fffffffffffffffffffffff00ffffffffffffffffffffffffffffffffffffffff8116600160a01b9182900460ff1615909102179055565b60008054600160a01b900460ff161561056d5760405162461bcd60e51b815260206004820152600660248201526514185d5cd95960d21b6044820152606401610338565b60006105798b8b610ab6565b90506000610587308b610ba0565b604051632e1a7d4d60e01b8152600481018490529091506001600160a01b038d1690632e1a7d4d90602401600060405180830381600087803b1580156105cc57600080fd5b505af11580156105e0573d6000803e3d6000fd5b50505050806105ef308c610ba0565b6105f991906116ca565b915061063e8a838b8a8a8a8080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250610c3292505050565b925061064c8360015461100b565b925087831015610692576040517fc634b0060000000000000000000000000000000000000000000000000000000081526004810184905260248101899052604401610338565b6001600160a01b038916156106ba576106b56001600160a01b038a1633856110ab565b6106c4565b6106c4338461114a565b600154604080516001600160a01b038f81168252602082018f90528c81168284015260608201879052608082019390935290519186169133917fc47af4cbc46aeb20a42e91e06b2a5d5e5a07d8e7ccf66f6abb0faf468ee59c7b919081900360a00190a350509998505050505050505050565b600254604080517f913e77ad00000000000000000000000000000000000000000000000000000000815290516000926001600160a01b03169163913e77ad9160048083019260209291908290030181865afa15801561079a573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906107be91906116e1565b905060005b82811015610900576000808585848181106107e0576107e06116fe565b90506020020160208101906107f59190611414565b6001600160a01b0316141561081e5750476108196001600160a01b0384168261114a565b6108ed565b848483818110610830576108306116fe565b90506020020160208101906108459190611414565b6040516370a0823160e01b81523060048201526001600160a01b0391909116906370a0823190602401602060405180830381865afa15801561088b573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906108af9190611714565b90506108ed83828787868181106108c8576108c86116fe565b90506020020160208101906108dd9190611414565b6001600160a01b031691906110ab565b50806108f88161172d565b9150506107c3565b50505050565b60008054600160a01b900460ff161561094a5760405162461bcd60e51b815260206004820152600660248201526514185d5cd95960d21b6044820152606401610338565b6109568c8c85856111aa565b6109678c8c8c8c8c8c8c8c8c610529565b9c9b505050505050505050505050565b6000546001600160a01b031633146109d15760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610338565b6001600160a01b038116610a4d5760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201527f64647265737300000000000000000000000000000000000000000000000000006064820152608401610338565b610a5681610a59565b50565b600080546001600160a01b0383811673ffffffffffffffffffffffffffffffffffffffff19831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b60006001600160a01b038316610b2857600034118015610ad557508134145b610b215760405162461bcd60e51b815260206004820152601d60248201527f496e76616c6964207175616e74697479206f72206d73672e76616c75650000006044820152606401610338565b5034610b9a565b600082118015610b36575034155b610b825760405162461bcd60e51b815260206004820152601d60248201527f496e76616c6964207175616e74697479206f72206d73672e76616c75650000006044820152606401610338565b610b976001600160a01b038416333085611295565b50805b92915050565b60006001600160a01b038216610bc157506001600160a01b03821631610b9a565b6040516370a0823160e01b81526001600160a01b0384811660048301528316906370a0823190602401602060405180830381865afa158015610c07573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610c2b9190611714565b9050610b9a565b6000836001600160a01b0316866001600160a01b03161415610c55575083611002565b6001600160a01b038616158015610c9d57507f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316846001600160a01b0316145b15610d1e577f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031663d0e30db0866040518263ffffffff1660e01b81526004016000604051808303818588803b158015610cfd57600080fd5b505af1158015610d11573d6000803e3d6000fd5b5050505050849050611002565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316866001600160a01b0316148015610d6657506001600160a01b038416155b15610ded57604051632e1a7d4d60e01b8152600481018690527f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031690632e1a7d4d90602401600060405180830381600087803b158015610dcd57600080fd5b505af1158015610de1573d6000803e3d6000fd5b50505050849050611002565b60006001600160a01b038716610e04575084610e0f565b610e0f87858861133a565b6000610e1b3087610ba0565b90507f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316856001600160a01b03161480610ec657506002546040516313eb467160e01b81526001600160a01b038781166004830152909116906313eb467190602401602060405180830381865afa158015610ea2573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610ec69190611748565b610f125760405162461bcd60e51b815260206004820152601360248201527f556e617574686f72697a656420746172676574000000000000000000000000006044820152606401610338565b600080866001600160a01b03168487604051610f2e9190611796565b60006040518083038185875af1925050503d8060008114610f6b576040519150601f19603f3d011682016040523d82523d6000602084013e610f70565b606091505b5091509150818190610f955760405162461bcd60e51b815260040161033891906117b2565b5082610fa1308a610ba0565b610fab91906116ca565b945060008511610ffd5760405162461bcd60e51b815260206004820152601160248201527f496e76616c696420657865637574696f6e0000000000000000000000000000006044820152606401610338565b505050505b95945050505050565b6002546040516313eb467160e01b81523360048201526000916001600160a01b0316906313eb467190602401602060405180830381865afa158015611054573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906110789190611748565b6110a25761271061108983856117e5565b6110939190611804565b61109d90846116ca565b6110a4565b825b9392505050565b60006040517fa9059cbb000000000000000000000000000000000000000000000000000000008152836004820152826024820152602060006044836000895af13d15601f3d11600160005114161716915050806109005760405162461bcd60e51b815260206004820152600f60248201527f5452414e534645525f4641494c454400000000000000000000000000000000006044820152606401610338565b600080600080600085875af19050806111a55760405162461bcd60e51b815260206004820152601360248201527f4554485f5452414e534645525f4641494c4544000000000000000000000000006044820152606401610338565b505050565b6040517f9fd5a6cf0000000000000000000000000000000000000000000000000000000081526000906001600160a01b03861690639fd5a6cf906111fc9033903090899087908a908a90600401611826565b6020604051808303816000875af115801561121b573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061123f9190611748565b90508061128e5760405162461bcd60e51b815260206004820152601060248201527f436f756c64204e6f74205065726d6974000000000000000000000000000000006044820152606401610338565b5050505050565b60006040517f23b872dd0000000000000000000000000000000000000000000000000000000081528460048201528360248201528260448201526020600060648360008a5af13d15601f3d116001600051141617169150508061128e5760405162461bcd60e51b815260206004820152601460248201527f5452414e534645525f46524f4d5f4641494c45440000000000000000000000006044820152606401610338565b826113506001600160a01b038216846000611360565b6109006001600160a01b03821684845b60006040517f095ea7b3000000000000000000000000000000000000000000000000000000008152836004820152826024820152602060006044836000895af13d15601f3d11600160005114161716915050806109005760405162461bcd60e51b815260206004820152600e60248201527f415050524f56455f4641494c45440000000000000000000000000000000000006044820152606401610338565b6001600160a01b0381168114610a5657600080fd5b60006020828403121561142657600080fd5b81356110a4816113ff565b60006020828403121561144357600080fd5b5035919050565b8035611455816113ff565b919050565b60008083601f84011261146c57600080fd5b50813567ffffffffffffffff81111561148457600080fd5b60208301915083602082850101111561149c57600080fd5b9250929050565b60008060008060008060008060006101008a8c0312156114c257600080fd5b89356114cd816113ff565b985060208a0135975060408a01356114e4816113ff565b965060608a01356114f4816113ff565b955060808a0135945060a08a013561150b816113ff565b935060c08a013567ffffffffffffffff81111561152757600080fd5b6115338c828d0161145a565b90945092505060e08a0135611547816113ff565b809150509295985092959850929598565b6000806020838503121561156b57600080fd5b823567ffffffffffffffff8082111561158357600080fd5b818501915085601f83011261159757600080fd5b8135818111156115a657600080fd5b8660208260051b85010111156115bb57600080fd5b60209290920196919550909350505050565b60008060008060008060008060008060006101208c8e0312156115ef57600080fd5b6115f98c356113ff565b8b359a5060208c0135995061161160408d01356113ff565b60408c0135985061162460608d0161144a565b975060808c0135965061163960a08d0161144a565b955067ffffffffffffffff8060c08e0135111561165557600080fd5b6116658e60c08f01358f0161145a565b909650945061167660e08e0161144a565b9350806101008e0135111561168a57600080fd5b5061169c8d6101008e01358e0161145a565b81935080925050509295989b509295989b9093969950565b634e487b7160e01b600052601160045260246000fd5b6000828210156116dc576116dc6116b4565b500390565b6000602082840312156116f357600080fd5b81516110a4816113ff565b634e487b7160e01b600052603260045260246000fd5b60006020828403121561172657600080fd5b5051919050565b6000600019821415611741576117416116b4565b5060010190565b60006020828403121561175a57600080fd5b815180151581146110a457600080fd5b60005b8381101561178557818101518382015260200161176d565b838111156109005750506000910152565b600082516117a881846020870161176a565b9190910192915050565b60208152600082518060208401526117d181604085016020870161176a565b601f01601f19169190910160400192915050565b60008160001904831182151516156117ff576117ff6116b4565b500290565b60008261182157634e487b7160e01b600052601260045260246000fd5b500490565b60006001600160a01b03808916835280881660208401525085604083015284606083015260a060808301528260a0830152828460c0840137600060c0848401015260c0601f19601f850116830101905097965050505050505056fea264697066735822122022a4d3a1af60dcc4dc814c3d89bb0569f9de628f717ac0d8796421ef51f6cb0264736f6c634300080b00334f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572796561726e0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001000000000000000000000000ea49d02c248b357b99670d9e9741f54f72df9cb3000000000000000000000000def1c0ded9bec7f1a1670819833240f027b25eff000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc2000000000000000000000000000000000000000000000000000000000000001e

Deployed Bytecode

0x6080604052600436106100e15760003560e01c80638da5cb5b1161007f578063ae0e9d5c11610059578063ae0e9d5c14610265578063d2f7265a14610278578063ddca3f43146102ac578063f2fde38b146102c257600080fd5b80638da5cb5b146102065780638ea7ab5314610224578063a4520aee1461024557600080fd5b806369fe0e2d116100bb57806369fe0e2d1461019c578063715018a6146101bc5780637b103999146101d15780638456cb59146101f157600080fd5b8063041bf7bc146100fa5780631a5da6c81461014b5780635c975abb1461016b57600080fd5b366100f557333214156100f357600080fd5b005b600080fd5b34801561010657600080fd5b5061012e7f000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc281565b6040516001600160a01b0390911681526020015b60405180910390f35b34801561015757600080fd5b506100f3610166366004611414565b6102e2565b34801561017757600080fd5b5060005461018c90600160a01b900460ff1681565b6040519015158152602001610142565b3480156101a857600080fd5b506100f36101b7366004611431565b610370565b3480156101c857600080fd5b506100f361042d565b3480156101dd57600080fd5b5060025461012e906001600160a01b031681565b3480156101fd57600080fd5b506100f3610493565b34801561021257600080fd5b506000546001600160a01b031661012e565b6102376102323660046114a3565b610529565b604051908152602001610142565b34801561025157600080fd5b506100f3610260366004611558565b610737565b6102376102733660046115cd565b610906565b34801561028457600080fd5b5061012e7f000000000000000000000000def1c0ded9bec7f1a1670819833240f027b25eff81565b3480156102b857600080fd5b5061023760015481565b3480156102ce57600080fd5b506100f36102dd366004611414565b610977565b6000546001600160a01b031633146103415760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657260448201526064015b60405180910390fd5b6002805473ffffffffffffffffffffffffffffffffffffffff19166001600160a01b0392909216919091179055565b6000546001600160a01b031633146103ca5760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610338565b600681101580156103dc575060648111155b6104285760405162461bcd60e51b815260206004820152600b60248201527f496e76616c6964204665650000000000000000000000000000000000000000006044820152606401610338565b600155565b6000546001600160a01b031633146104875760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610338565b6104916000610a59565b565b6000546001600160a01b031633146104ed5760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610338565b600080547fffffffffffffffffffffff00ffffffffffffffffffffffffffffffffffffffff8116600160a01b9182900460ff1615909102179055565b60008054600160a01b900460ff161561056d5760405162461bcd60e51b815260206004820152600660248201526514185d5cd95960d21b6044820152606401610338565b60006105798b8b610ab6565b90506000610587308b610ba0565b604051632e1a7d4d60e01b8152600481018490529091506001600160a01b038d1690632e1a7d4d90602401600060405180830381600087803b1580156105cc57600080fd5b505af11580156105e0573d6000803e3d6000fd5b50505050806105ef308c610ba0565b6105f991906116ca565b915061063e8a838b8a8a8a8080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250610c3292505050565b925061064c8360015461100b565b925087831015610692576040517fc634b0060000000000000000000000000000000000000000000000000000000081526004810184905260248101899052604401610338565b6001600160a01b038916156106ba576106b56001600160a01b038a1633856110ab565b6106c4565b6106c4338461114a565b600154604080516001600160a01b038f81168252602082018f90528c81168284015260608201879052608082019390935290519186169133917fc47af4cbc46aeb20a42e91e06b2a5d5e5a07d8e7ccf66f6abb0faf468ee59c7b919081900360a00190a350509998505050505050505050565b600254604080517f913e77ad00000000000000000000000000000000000000000000000000000000815290516000926001600160a01b03169163913e77ad9160048083019260209291908290030181865afa15801561079a573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906107be91906116e1565b905060005b82811015610900576000808585848181106107e0576107e06116fe565b90506020020160208101906107f59190611414565b6001600160a01b0316141561081e5750476108196001600160a01b0384168261114a565b6108ed565b848483818110610830576108306116fe565b90506020020160208101906108459190611414565b6040516370a0823160e01b81523060048201526001600160a01b0391909116906370a0823190602401602060405180830381865afa15801561088b573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906108af9190611714565b90506108ed83828787868181106108c8576108c86116fe565b90506020020160208101906108dd9190611414565b6001600160a01b031691906110ab565b50806108f88161172d565b9150506107c3565b50505050565b60008054600160a01b900460ff161561094a5760405162461bcd60e51b815260206004820152600660248201526514185d5cd95960d21b6044820152606401610338565b6109568c8c85856111aa565b6109678c8c8c8c8c8c8c8c8c610529565b9c9b505050505050505050505050565b6000546001600160a01b031633146109d15760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610338565b6001600160a01b038116610a4d5760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201527f64647265737300000000000000000000000000000000000000000000000000006064820152608401610338565b610a5681610a59565b50565b600080546001600160a01b0383811673ffffffffffffffffffffffffffffffffffffffff19831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b60006001600160a01b038316610b2857600034118015610ad557508134145b610b215760405162461bcd60e51b815260206004820152601d60248201527f496e76616c6964207175616e74697479206f72206d73672e76616c75650000006044820152606401610338565b5034610b9a565b600082118015610b36575034155b610b825760405162461bcd60e51b815260206004820152601d60248201527f496e76616c6964207175616e74697479206f72206d73672e76616c75650000006044820152606401610338565b610b976001600160a01b038416333085611295565b50805b92915050565b60006001600160a01b038216610bc157506001600160a01b03821631610b9a565b6040516370a0823160e01b81526001600160a01b0384811660048301528316906370a0823190602401602060405180830381865afa158015610c07573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610c2b9190611714565b9050610b9a565b6000836001600160a01b0316866001600160a01b03161415610c55575083611002565b6001600160a01b038616158015610c9d57507f000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc26001600160a01b0316846001600160a01b0316145b15610d1e577f000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc26001600160a01b031663d0e30db0866040518263ffffffff1660e01b81526004016000604051808303818588803b158015610cfd57600080fd5b505af1158015610d11573d6000803e3d6000fd5b5050505050849050611002565b7f000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc26001600160a01b0316866001600160a01b0316148015610d6657506001600160a01b038416155b15610ded57604051632e1a7d4d60e01b8152600481018690527f000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc26001600160a01b031690632e1a7d4d90602401600060405180830381600087803b158015610dcd57600080fd5b505af1158015610de1573d6000803e3d6000fd5b50505050849050611002565b60006001600160a01b038716610e04575084610e0f565b610e0f87858861133a565b6000610e1b3087610ba0565b90507f000000000000000000000000def1c0ded9bec7f1a1670819833240f027b25eff6001600160a01b0316856001600160a01b03161480610ec657506002546040516313eb467160e01b81526001600160a01b038781166004830152909116906313eb467190602401602060405180830381865afa158015610ea2573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610ec69190611748565b610f125760405162461bcd60e51b815260206004820152601360248201527f556e617574686f72697a656420746172676574000000000000000000000000006044820152606401610338565b600080866001600160a01b03168487604051610f2e9190611796565b60006040518083038185875af1925050503d8060008114610f6b576040519150601f19603f3d011682016040523d82523d6000602084013e610f70565b606091505b5091509150818190610f955760405162461bcd60e51b815260040161033891906117b2565b5082610fa1308a610ba0565b610fab91906116ca565b945060008511610ffd5760405162461bcd60e51b815260206004820152601160248201527f496e76616c696420657865637574696f6e0000000000000000000000000000006044820152606401610338565b505050505b95945050505050565b6002546040516313eb467160e01b81523360048201526000916001600160a01b0316906313eb467190602401602060405180830381865afa158015611054573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906110789190611748565b6110a25761271061108983856117e5565b6110939190611804565b61109d90846116ca565b6110a4565b825b9392505050565b60006040517fa9059cbb000000000000000000000000000000000000000000000000000000008152836004820152826024820152602060006044836000895af13d15601f3d11600160005114161716915050806109005760405162461bcd60e51b815260206004820152600f60248201527f5452414e534645525f4641494c454400000000000000000000000000000000006044820152606401610338565b600080600080600085875af19050806111a55760405162461bcd60e51b815260206004820152601360248201527f4554485f5452414e534645525f4641494c4544000000000000000000000000006044820152606401610338565b505050565b6040517f9fd5a6cf0000000000000000000000000000000000000000000000000000000081526000906001600160a01b03861690639fd5a6cf906111fc9033903090899087908a908a90600401611826565b6020604051808303816000875af115801561121b573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061123f9190611748565b90508061128e5760405162461bcd60e51b815260206004820152601060248201527f436f756c64204e6f74205065726d6974000000000000000000000000000000006044820152606401610338565b5050505050565b60006040517f23b872dd0000000000000000000000000000000000000000000000000000000081528460048201528360248201528260448201526020600060648360008a5af13d15601f3d116001600051141617169150508061128e5760405162461bcd60e51b815260206004820152601460248201527f5452414e534645525f46524f4d5f4641494c45440000000000000000000000006044820152606401610338565b826113506001600160a01b038216846000611360565b6109006001600160a01b03821684845b60006040517f095ea7b3000000000000000000000000000000000000000000000000000000008152836004820152826024820152602060006044836000895af13d15601f3d11600160005114161716915050806109005760405162461bcd60e51b815260206004820152600e60248201527f415050524f56455f4641494c45440000000000000000000000000000000000006044820152606401610338565b6001600160a01b0381168114610a5657600080fd5b60006020828403121561142657600080fd5b81356110a4816113ff565b60006020828403121561144357600080fd5b5035919050565b8035611455816113ff565b919050565b60008083601f84011261146c57600080fd5b50813567ffffffffffffffff81111561148457600080fd5b60208301915083602082850101111561149c57600080fd5b9250929050565b60008060008060008060008060006101008a8c0312156114c257600080fd5b89356114cd816113ff565b985060208a0135975060408a01356114e4816113ff565b965060608a01356114f4816113ff565b955060808a0135945060a08a013561150b816113ff565b935060c08a013567ffffffffffffffff81111561152757600080fd5b6115338c828d0161145a565b90945092505060e08a0135611547816113ff565b809150509295985092959850929598565b6000806020838503121561156b57600080fd5b823567ffffffffffffffff8082111561158357600080fd5b818501915085601f83011261159757600080fd5b8135818111156115a657600080fd5b8660208260051b85010111156115bb57600080fd5b60209290920196919550909350505050565b60008060008060008060008060008060006101208c8e0312156115ef57600080fd5b6115f98c356113ff565b8b359a5060208c0135995061161160408d01356113ff565b60408c0135985061162460608d0161144a565b975060808c0135965061163960a08d0161144a565b955067ffffffffffffffff8060c08e0135111561165557600080fd5b6116658e60c08f01358f0161145a565b909650945061167660e08e0161144a565b9350806101008e0135111561168a57600080fd5b5061169c8d6101008e01358e0161145a565b81935080925050509295989b509295989b9093969950565b634e487b7160e01b600052601160045260246000fd5b6000828210156116dc576116dc6116b4565b500390565b6000602082840312156116f357600080fd5b81516110a4816113ff565b634e487b7160e01b600052603260045260246000fd5b60006020828403121561172657600080fd5b5051919050565b6000600019821415611741576117416116b4565b5060010190565b60006020828403121561175a57600080fd5b815180151581146110a457600080fd5b60005b8381101561178557818101518382015260200161176d565b838111156109005750506000910152565b600082516117a881846020870161176a565b9190910192915050565b60208152600082518060208401526117d181604085016020870161176a565b601f01601f19169190910160400192915050565b60008160001904831182151516156117ff576117ff6116b4565b500290565b60008261182157634e487b7160e01b600052601260045260246000fd5b500490565b60006001600160a01b03808916835280881660208401525085604083015284606083015260a060808301528260a0830152828460c0840137600060c0848401015260c0601f19601f850116830101905097965050505050505056fea264697066735822122022a4d3a1af60dcc4dc814c3d89bb0569f9de628f717ac0d8796421ef51f6cb0264736f6c634300080b0033

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

796561726e0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001000000000000000000000000ea49d02c248b357b99670d9e9741f54f72df9cb3000000000000000000000000def1c0ded9bec7f1a1670819833240f027b25eff000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc2000000000000000000000000000000000000000000000000000000000000001e

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

-----Encoded View---------------
6 Constructor Arguments found :
Arg [0] : 796561726e000000000000000000000000000000000000000000000000000000
Arg [1] : 0000000000000000000000000000000000000000000000000000000000000001
Arg [2] : 000000000000000000000000ea49d02c248b357b99670d9e9741f54f72df9cb3
Arg [3] : 000000000000000000000000def1c0ded9bec7f1a1670819833240f027b25eff
Arg [4] : 000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc2
Arg [5] : 000000000000000000000000000000000000000000000000000000000000001e


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
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.