Overview
ETH Balance
0 ETH
Eth Value
$0.00More Info
Private Name Tags
ContractCreator
View more zero value Internal Transactions in Advanced View mode
Advanced mode:
Loading...
Loading
Similar Match Source Code This contract matches the deployed Bytecode of the Source Code for Contract 0x20CBAb2a...bb9c0da49 The constructor portion of the code might be different and could alter the actual behaviour of the contract
Contract Name:
PoolTogetherPortalIn
Compiler Version
v0.8.11+commit.d7f03943
Contract Source Code (Solidity Standard Json-Input format)
/// Copyright (C) 2022 Portals.fi /// @author Portals.fi /// @notice This contract acquires Pool Together Tickets using any ERC20 token or the network token. /// SPDX-License-Identifier: GPL-3.0 pragma solidity 0.8.11; import "../base/PortalBaseV2.sol"; import "../interface/IPortalRegistry.sol"; import "./interface/IPrizePool.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 PoolTogetherPortalIn is PortalBaseV2 { using SafeTransferLib for address; using SafeTransferLib for ERC20; IPrizePool public immutable PRIZE_POOL; /// @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, IPrizePool _prizePool ) PortalBaseV2( protocolId, portalType, registry, exchange, wrappedNetworkToken, fee ) { PRIZE_POOL = _prizePool; } /// @notice Acquires Pool Together Tickets 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 one of the pool tokens) /// @param buyToken The Pool Together ticket address /// @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 portalIn( address sellToken, uint256 sellAmount, address intermediateToken, address buyToken, uint256 minBuyAmount, address target, bytes calldata data, address partner ) external payable pausable returns (uint256 buyAmount) { uint256 amount = _transferFromCaller(sellToken, sellAmount); amount = _getFeeAmount(amount); amount = _execute(sellToken, amount, intermediateToken, target, data); uint256 balance = _getBalance(msg.sender, buyToken); _approve(intermediateToken, address(PRIZE_POOL), amount); PRIZE_POOL.depositToAndDelegate(msg.sender, amount, msg.sender); buyAmount = _getBalance(msg.sender, buyToken) - balance; if (buyAmount < minBuyAmount) revert InsufficientBuy(buyAmount, minBuyAmount); emit PortalIn( sellToken, sellAmount, buyToken, buyAmount, fee, msg.sender, partner ); } }
// 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); } }
// 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; } }
/// 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 "./interface/IPortalBase.sol"; import "../libraries/solmate/utils/SafeTransferLib.sol"; import "../interface/IWETH.sol"; import "../interface/IPortalRegistry.sol"; abstract contract PortalBaseV2 is IPortalBase, 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; // The Portal Registry IPortalRegistry public registry; // The address of the exchange used for swaps address public immutable exchange; // The 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 /// @return The quantity of tokens or network tokens to transact with less the fee function _getFeeAmount(uint256 quantity) internal view returns (uint256) { return registry.isPortal(msg.sender) ? quantity : quantity - (quantity * fee) / 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(); uint256 qty; for (uint256 i = 0; i < tokens.length; i++) { 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); } emit Collect(tokens[i], qty); } } /// @dev Pause or unpause the contract function pause() external onlyOwner { paused = !paused; emit Pause(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"); emit Fee(fee, _fee); fee = _fee; } /// @notice Updates the registry /// @param _registry The address of the new registry function updateRegistry(IPortalRegistry _registry) external onlyOwner { registry = _registry; emit UpdateRegistry(address(registry)); } /// @notice Reverts if networks tokens are sent directly to this contract receive() external payable { require(msg.sender != tx.origin); } }
/// Copyright (C) 2022 Portals.fi /// @author Portals.fi /// @notice Interface for the Base contract inherited by Portals /// SPDX-License-Identifier: GPL-3.0 pragma solidity 0.8.11; interface IPortalBase { /// @notice Emitted when a portal is collected /// @param token The ERC20 token address to collect (address(0) if network token) /// @param amount The quantity of th token to collect event Collect(address token, uint256 amount); /// @notice Emitted when the fee is changed /// @param oldFee The ERC20 token address to collect (address(0) if network token) /// @param newFee The quantity of th token to collect event Fee(uint256 oldFee, uint256 newFee); /// @notice Emitted when a portal is paused /// @param paused The active status of this contract. If false, contract is active (i.e un-paused) event Pause(bool paused); /// @notice Emitted when the registry is upated /// @param registry The address of the new registry event UpdateRegistry(address registry); }
/// 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); }
/// SPDX-License-Identifier: GPL-3.0 pragma solidity 0.8.11; interface IWETH { function deposit() external payable; function withdraw(uint256 wad) external; }
// 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); } }
// 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"); } }
/// SPDX-License-Identifier: GPL-3.0 pragma solidity 0.8.11; interface IPrizePool { /// @notice Deposit assets into the Prize Pool in exchange for tokens /// @param to The address receiving the newly minted tokens /// @param amount The amount of assets to deposit function depositTo(address to, uint256 amount) external; /// @notice Deposit assets into the Prize Pool in exchange for tokens /// @param to The address receiving the newly minted tokens /// @param amount The amount of assets to deposit /// @param delegate the address to delegate to for the caller function depositToAndDelegate( address to, uint256 amount, address delegate ) external; /// @notice Withdraw assets from the Prize Pool instantly. A fairness fee may be charged for an early exit. /// @param from The address to redeem tokens from. /// @param amount The amount of tokens to redeem for assets. /// @return The actual amount withdrawn function withdrawFrom(address from, uint256 amount) external returns (uint256); /** * @notice Read ticket variable */ function getTicket() external view returns (address); }
{ "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
- No Contract Security Audit Submitted- Submit Audit Here
[{"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 IPrizePool","name":"_prizePool","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":false,"internalType":"address","name":"token","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"Collect","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"oldFee","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"newFee","type":"uint256"}],"name":"Fee","type":"event"},{"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":"bool","name":"paused","type":"bool"}],"name":"Pause","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"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"registry","type":"address"}],"name":"UpdateRegistry","type":"event"},{"inputs":[],"name":"PRIZE_POOL","outputs":[{"internalType":"contract IPrizePool","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"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":"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"}]
Deployed Bytecode
0x6080604052600436106100e15760003560e01c80637b1039991161007f578063a4520aee11610059578063a4520aee14610279578063d2f7265a14610299578063ddca3f43146102cd578063f2fde38b146102e357600080fd5b80637b103999146102265780638456cb59146102465780638da5cb5b1461025b57600080fd5b80635c975abb116100bb5780635c975abb1461018c57806369fe0e2d146101bd578063715018a6146101dd578063764a7163146101f257600080fd5b8063041bf7bc146100fa5780631a5da6c81461014b57806331468f781461016b57600080fd5b366100f557333214156100f357600080fd5b005b600080fd5b34801561010657600080fd5b5061012e7f000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc281565b6040516001600160a01b0390911681526020015b60405180910390f35b34801561015757600080fd5b506100f361016636600461146a565b610303565b61017e61017936600461149e565b6103c3565b604051908152602001610142565b34801561019857600080fd5b506000546101ad90600160a01b900460ff1681565b6040519015158152602001610142565b3480156101c957600080fd5b506100f36101d836600461157f565b610623565b3480156101e957600080fd5b506100f361071c565b3480156101fe57600080fd5b5061012e7f000000000000000000000000d89a09084555a7d0abe7b111b1f78dfeddd638be81565b34801561023257600080fd5b5060025461012e906001600160a01b031681565b34801561025257600080fd5b506100f3610782565b34801561026757600080fd5b506000546001600160a01b031661012e565b34801561028557600080fd5b506100f3610294366004611598565b61085d565b3480156102a557600080fd5b5061012e7f000000000000000000000000def1c0ded9bec7f1a1670819833240f027b25eff81565b3480156102d957600080fd5b5061017e60015481565b3480156102ef57600080fd5b506100f36102fe36600461146a565b610a96565b6000546001600160a01b031633146103625760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657260448201526064015b60405180910390fd5b6002805473ffffffffffffffffffffffffffffffffffffffff19166001600160a01b0383169081179091556040519081527fe882cd4ecccebb4897bd9859948ab1e5a95e1ff3a4769e6c2893f05230e912639060200160405180910390a150565b60008054600160a01b900460ff161561041e5760405162461bcd60e51b815260206004820152600660248201527f50617573656400000000000000000000000000000000000000000000000000006044820152606401610359565b600061042a8b8b610b78565b905061043581610c62565b905061047a8b828b8989898080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250610d0192505050565b90506000610488338a6110f3565b90506104b58a7f000000000000000000000000d89a09084555a7d0abe7b111b1f78dfeddd638be84611185565b6040517fd7a169eb00000000000000000000000000000000000000000000000000000000815233600482018190526024820184905260448201527f000000000000000000000000d89a09084555a7d0abe7b111b1f78dfeddd638be6001600160a01b03169063d7a169eb90606401600060405180830381600087803b15801561053d57600080fd5b505af1158015610551573d6000803e3d6000fd5b5050505080610560338b6110f3565b61056a9190611623565b9250878310156105b0576040517fc634b0060000000000000000000000000000000000000000000000000000000081526004810184905260248101899052604401610359565b600154604080516001600160a01b038f81168252602082018f90528c81168284015260608201879052608082019390935290519186169133917fc4d7bc58a132fd4a1b9d658b0a30809bcfb6b4959c1d3d4eb2e300d3a15099be919081900360a00190a350509998505050505050505050565b6000546001600160a01b0316331461067d5760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610359565b6006811015801561068f575060648111155b6106db5760405162461bcd60e51b815260206004820152600b60248201527f496e76616c6964204665650000000000000000000000000000000000000000006044820152606401610359565b60015460408051918252602082018390527fa6205f24a082c01e6c705e20c1a026c246eedf9800b87b84440f05e8271aaf27910160405180910390a1600155565b6000546001600160a01b031633146107765760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610359565b61078060006111b5565b565b6000546001600160a01b031633146107dc5760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610359565b6000805460ff600160a01b80830482161581027fffffffffffffffffffffff00ffffffffffffffffffffffffffffffffffffffff90931692909217928390556040517f9422424b175dda897495a07b091ef74a3ef715cf6d866fc972954c1c7f459304936108539390049091161515815260200190565b60405180910390a1565b600254604080517f913e77ad00000000000000000000000000000000000000000000000000000000815290516000926001600160a01b03169163913e77ad9160048083019260209291908290030181865afa1580156108c0573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906108e4919061163a565b90506000805b83811015610a8f57600085858381811061090657610906611657565b905060200201602081019061091b919061146a565b6001600160a01b03161415610945574791506109406001600160a01b03841683611212565b610a14565b84848281811061095757610957611657565b905060200201602081019061096c919061146a565b6040516370a0823160e01b81523060048201526001600160a01b0391909116906370a0823190602401602060405180830381865afa1580156109b2573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109d6919061166d565b9150610a1483838787858181106109ef576109ef611657565b9050602002016020810190610a04919061146a565b6001600160a01b03169190611272565b7f4256a058fa2b123d727576d3d31e3a272db98ee5fe264e229610ce43dc849999858583818110610a4757610a47611657565b9050602002016020810190610a5c919061146a565b604080516001600160a01b039092168252602082018590520160405180910390a180610a8781611686565b9150506108ea565b5050505050565b6000546001600160a01b03163314610af05760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610359565b6001600160a01b038116610b6c5760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201527f64647265737300000000000000000000000000000000000000000000000000006064820152608401610359565b610b75816111b5565b50565b60006001600160a01b038316610bea57600034118015610b9757508134145b610be35760405162461bcd60e51b815260206004820152601d60248201527f496e76616c6964207175616e74697479206f72206d73672e76616c75650000006044820152606401610359565b5034610c5c565b600082118015610bf8575034155b610c445760405162461bcd60e51b815260206004820152601d60248201527f496e76616c6964207175616e74697479206f72206d73672e76616c75650000006044820152606401610359565b610c596001600160a01b038416333085611311565b50805b92915050565b6002546040516313eb467160e01b81523360048201526000916001600160a01b0316906313eb467190602401602060405180830381865afa158015610cab573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610ccf91906116a1565b610cfd5761271060015483610ce491906116c3565b610cee91906116e2565b610cf89083611623565b610c5c565b5090565b6000836001600160a01b0316866001600160a01b03161415610d245750836110ea565b6001600160a01b038616158015610d6c57507f000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc26001600160a01b0316846001600160a01b0316145b15610ded577f000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc26001600160a01b031663d0e30db0866040518263ffffffff1660e01b81526004016000604051808303818588803b158015610dcc57600080fd5b505af1158015610de0573d6000803e3d6000fd5b50505050508490506110ea565b7f000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc26001600160a01b0316866001600160a01b0316148015610e3557506001600160a01b038416155b15610ed5576040517f2e1a7d4d000000000000000000000000000000000000000000000000000000008152600481018690527f000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc26001600160a01b031690632e1a7d4d90602401600060405180830381600087803b158015610eb557600080fd5b505af1158015610ec9573d6000803e3d6000fd5b505050508490506110ea565b60006001600160a01b038716610eec575084610ef7565b610ef7878588611185565b6000610f0330876110f3565b90507f000000000000000000000000def1c0ded9bec7f1a1670819833240f027b25eff6001600160a01b0316856001600160a01b03161480610fae57506002546040516313eb467160e01b81526001600160a01b038781166004830152909116906313eb467190602401602060405180830381865afa158015610f8a573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610fae91906116a1565b610ffa5760405162461bcd60e51b815260206004820152601360248201527f556e617574686f72697a656420746172676574000000000000000000000000006044820152606401610359565b600080866001600160a01b031684876040516110169190611730565b60006040518083038185875af1925050503d8060008114611053576040519150601f19603f3d011682016040523d82523d6000602084013e611058565b606091505b509150915081819061107d5760405162461bcd60e51b8152600401610359919061174c565b5082611089308a6110f3565b6110939190611623565b9450600085116110e55760405162461bcd60e51b815260206004820152601160248201527f496e76616c696420657865637574696f6e0000000000000000000000000000006044820152606401610359565b505050505b95945050505050565b60006001600160a01b03821661111457506001600160a01b03821631610c5c565b6040516370a0823160e01b81526001600160a01b0384811660048301528316906370a0823190602401602060405180830381865afa15801561115a573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061117e919061166d565b9050610c5c565b8261119b6001600160a01b0382168460006113b6565b6111af6001600160a01b03821684846113b6565b50505050565b600080546001600160a01b0383811673ffffffffffffffffffffffffffffffffffffffff19831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b600080600080600085875af190508061126d5760405162461bcd60e51b815260206004820152601360248201527f4554485f5452414e534645525f4641494c4544000000000000000000000000006044820152606401610359565b505050565b60006040517fa9059cbb000000000000000000000000000000000000000000000000000000008152836004820152826024820152602060006044836000895af13d15601f3d11600160005114161716915050806111af5760405162461bcd60e51b815260206004820152600f60248201527f5452414e534645525f4641494c454400000000000000000000000000000000006044820152606401610359565b60006040517f23b872dd0000000000000000000000000000000000000000000000000000000081528460048201528360248201528260448201526020600060648360008a5af13d15601f3d1160016000511416171691505080610a8f5760405162461bcd60e51b815260206004820152601460248201527f5452414e534645525f46524f4d5f4641494c45440000000000000000000000006044820152606401610359565b60006040517f095ea7b3000000000000000000000000000000000000000000000000000000008152836004820152826024820152602060006044836000895af13d15601f3d11600160005114161716915050806111af5760405162461bcd60e51b815260206004820152600e60248201527f415050524f56455f4641494c45440000000000000000000000000000000000006044820152606401610359565b6001600160a01b0381168114610b7557600080fd5b60006020828403121561147c57600080fd5b813561148781611455565b9392505050565b803561149981611455565b919050565b60008060008060008060008060006101008a8c0312156114bd57600080fd5b89356114c881611455565b985060208a0135975060408a01356114df81611455565b965060608a01356114ef81611455565b955060808a0135945060a08a013561150681611455565b935060c08a013567ffffffffffffffff8082111561152357600080fd5b818c0191508c601f83011261153757600080fd5b81358181111561154657600080fd5b8d602082850101111561155857600080fd5b60208301955080945050505061157060e08b0161148e565b90509295985092959850929598565b60006020828403121561159157600080fd5b5035919050565b600080602083850312156115ab57600080fd5b823567ffffffffffffffff808211156115c357600080fd5b818501915085601f8301126115d757600080fd5b8135818111156115e657600080fd5b8660208260051b85010111156115fb57600080fd5b60209290920196919550909350505050565b634e487b7160e01b600052601160045260246000fd5b6000828210156116355761163561160d565b500390565b60006020828403121561164c57600080fd5b815161148781611455565b634e487b7160e01b600052603260045260246000fd5b60006020828403121561167f57600080fd5b5051919050565b600060001982141561169a5761169a61160d565b5060010190565b6000602082840312156116b357600080fd5b8151801515811461148757600080fd5b60008160001904831182151516156116dd576116dd61160d565b500290565b6000826116ff57634e487b7160e01b600052601260045260246000fd5b500490565b60005b8381101561171f578181015183820152602001611707565b838111156111af5750506000910152565b60008251611742818460208701611704565b9190910192915050565b602081526000825180602084015261176b816040850160208701611704565b601f01601f1916919091016040019291505056fea2646970667358221220f313791b9396b06adea67037043f37f0ac29c8e6fe94c6fc7d861fa5eb7265eb64736f6c634300080b0033
Loading...
Loading
Loading...
Loading
Multichain Portfolio | 31 Chains
Chain | Token | Portfolio % | Price | Amount | Value |
---|
Loading...
Loading
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.