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
Contract Name:
CompoundAssetInteractiveAdapter
Compiler Version
v0.7.3+commit.9bfce1f6
Optimization Enabled:
Yes with 1000000 runs
Other Settings:
default evmVersion
Contract Source Code (Solidity Standard Json-Input format)
// Copyright (C) 2020 Zerion Inc. <https://zerion.io> // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation, either version 3 of the License, or // (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program. If not, see <https://www.gnu.org/licenses/>. // // SPDX-License-Identifier: LGPL-3.0-only pragma solidity 0.7.3; pragma experimental ABIEncoderV2; import { ERC20 } from "../../shared/ERC20.sol"; import { SafeERC20 } from "../../shared/SafeERC20.sol"; import { TokenAmount } from "../../shared/Structs.sol"; import { ERC20ProtocolAdapter } from "../../adapters/ERC20ProtocolAdapter.sol"; import { CompoundRegistry } from "../../adapters/compound/CompoundRegistry.sol"; import { InteractiveAdapter } from "../InteractiveAdapter.sol"; import { CToken } from "../../interfaces/CToken.sol"; import { CEther } from "../../interfaces/CEther.sol"; /** * @title Interactive adapter for Compound protocol. * @dev Implementation of InteractiveAdapter abstract contract. */ contract CompoundAssetInteractiveAdapter is InteractiveAdapter, ERC20ProtocolAdapter { using SafeERC20 for ERC20; address internal constant CETH = 0x4Ddc2D193948926D02f9B1fE9e1daa0718270ED5; address internal constant COMP = 0xc00e94Cb662C3520282E6f5717214004A7f26888; address internal constant REGISTRY = 0xAc41dB9741F869E432575952748e7064d299614D; /** * @notice Deposits tokens to the Compound protocol. * @param tokenAmounts Array with one element - TokenAmount struct with * underlying token address, underlying token amount to be deposited, and amount type. * @return tokensToBeWithdrawn Array with two elements - cToken and COMP addresses. * @dev Implementation of InteractiveAdapter function. */ function deposit(TokenAmount[] calldata tokenAmounts, bytes calldata) external payable override returns (address[] memory tokensToBeWithdrawn) { require(tokenAmounts.length == 1, "CAIA: should be 1 tokenAmount[1]"); address token = tokenAmounts[0].token; uint256 amount = getAbsoluteAmountDeposit(tokenAmounts[0]); tokensToBeWithdrawn = new address[](2); tokensToBeWithdrawn[0] = COMP; if (token == ETH) { tokensToBeWithdrawn[1] = CETH; CEther(CETH).mint{ value: amount }(); } else { address cToken = CompoundRegistry(REGISTRY).getCToken(token); tokensToBeWithdrawn[1] = cToken; ERC20(token).safeApprove(cToken, amount, "CAIA"); require(CToken(cToken).mint(amount) == 0, "CAIA: deposit failed"); } } /** * @notice Withdraws tokens from the Compound protocol. * @param tokenAmounts Array with one element - TokenAmount struct with * cToken address, cToken amount to be redeemed, and amount type. * @return tokensToBeWithdrawn Array with two elements - underlying token and COMP addresses. * @dev Implementation of InteractiveAdapter function. */ function withdraw(TokenAmount[] calldata tokenAmounts, bytes calldata) external payable override returns (address[] memory tokensToBeWithdrawn) { require(tokenAmounts.length == 1, "CAIA: should be 1 tokenAmount[2]"); address token = tokenAmounts[0].token; uint256 amount = getAbsoluteAmountWithdraw(tokenAmounts[0]); tokensToBeWithdrawn = new address[](2); tokensToBeWithdrawn[0] = COMP; if (token == CETH) { tokensToBeWithdrawn[1] = ETH; } else { tokensToBeWithdrawn[1] = CToken(token).underlying(); } require(CToken(token).redeem(amount) == 0, "CAIA: withdraw failed"); } }
// Copyright (C) 2020 Zerion Inc. <https://zerion.io> // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation, either version 3 of the License, or // (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program. If not, see <https://www.gnu.org/licenses/>. // // SPDX-License-Identifier: LGPL-3.0-only pragma solidity 0.7.3; pragma experimental ABIEncoderV2; import { ERC20 } from "../shared/ERC20.sol"; import { ProtocolAdapter } from "./ProtocolAdapter.sol"; /** * @title Adapter for any protocol with ERC20 interface. * @dev Implementation of ProtocolAdapter abstract contract. * @author Igor Sobolev <[email protected]> */ contract ERC20ProtocolAdapter is ProtocolAdapter { /** * @return Amount of tokens held by the given account. * @dev Implementation of ProtocolAdapter abstract contract function. */ function getBalance(address token, address account) public view override returns (int256) { return int256(ERC20(token).balanceOf(account)); } }
// Copyright (C) 2020 Zerion Inc. <https://zerion.io> // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation, either version 3 of the License, or // (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program. If not, see <https://www.gnu.org/licenses/>. // // SPDX-License-Identifier: LGPL-3.0-only pragma solidity 0.7.3; pragma experimental ABIEncoderV2; /** * @title Protocol adapter abstract contract. * @dev adapterType(), tokenType(), and getBalance() functions MUST be implemented. * @author Igor Sobolev <[email protected]> */ abstract contract ProtocolAdapter { /** * @dev MUST return amount and type of the given token * locked on the protocol by the given account. */ function getBalance(address token, address account) public virtual returns (int256); }
// Copyright (C) 2020 Zerion Inc. <https://zerion.io> // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation, either version 3 of the License, or // (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program. If not, see <https://www.gnu.org/licenses/>. // // SPDX-License-Identifier: LGPL-3.0-only pragma solidity 0.7.3; import { Ownable } from "../../core/Ownable.sol"; /** * @title Registry for Compound contracts. * @dev Implements the only function - getCToken(address). * @notice Call getCToken(token) function and get address * of CToken contract for the given token address. * @author Igor Sobolev <[email protected]> */ contract CompoundRegistry is Ownable { mapping(address => address) internal cToken_; function setCTokens(address[] calldata tokens, address[] calldata cTokens) external { uint256 length = tokens.length; require(cTokens.length == length, "CR: inconsistent arrays"); for (uint256 i = 0; i < length; i++) { setCToken(tokens[i], cTokens[i]); } } function setCToken(address token, address cToken) internal { cToken_[token] = cToken; } function getCToken(address token) external view returns (address) { return cToken_[token]; } }
// Copyright (C) 2020 Zerion Inc. <https://zerion.io> // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation, either version 3 of the License, or // (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program. If not, see <https://www.gnu.org/licenses/>. // // SPDX-License-Identifier: LGPL-3.0-only pragma solidity 0.7.3; pragma experimental ABIEncoderV2; abstract contract Ownable { modifier onlyOwner { require(msg.sender == owner_, "O: only owner"); _; } modifier onlyPendingOwner { require(msg.sender == pendingOwner_, "O: only pending owner"); _; } address private owner_; address private pendingOwner_; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); /** * @notice Initializes owner variable with msg.sender address. */ constructor() { owner_ = msg.sender; emit OwnershipTransferred(address(0), msg.sender); } /** * @notice Sets pending owner to the desired address. * The function is callable only by the owner. */ function proposeOwnership(address newOwner) external onlyOwner { require(newOwner != address(0), "O: empty newOwner"); require(newOwner != owner_, "O: equal to owner_"); require(newOwner != pendingOwner_, "O: equal to pendingOwner_"); pendingOwner_ = newOwner; } /** * @notice Transfers ownership to the pending owner. * The function is callable only by the pending owner. */ function acceptOwnership() external onlyPendingOwner { emit OwnershipTransferred(owner_, msg.sender); owner_ = msg.sender; delete pendingOwner_; } /** * @return Owner of the contract. */ function owner() external view returns (address) { return owner_; } /** * @return Pending owner of the contract. */ function pendingOwner() external view returns (address) { return pendingOwner_; } }
// Copyright (C) 2020 Zerion Inc. <https://zerion.io> // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation, either version 3 of the License, or // (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program. If not, see <https://www.gnu.org/licenses/>. // // SPDX-License-Identifier: LGPL-3.0-only pragma solidity 0.7.3; pragma experimental ABIEncoderV2; import { ProtocolAdapter } from "../adapters/ProtocolAdapter.sol"; import { TokenAmount, AmountType } from "../shared/Structs.sol"; import { ERC20 } from "../shared/ERC20.sol"; /** * @title Base contract for interactive protocol adapters. * @dev deposit() and withdraw() functions MUST be implemented * as well as all the functions from ProtocolAdapter abstract contract. * @author Igor Sobolev <[email protected]> */ abstract contract InteractiveAdapter is ProtocolAdapter { uint256 internal constant DELIMITER = 1e18; address internal constant ETH = 0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE; /** * @dev The function must deposit assets to the protocol. * @return MUST return assets to be sent back to the `msg.sender`. */ function deposit(TokenAmount[] calldata tokenAmounts, bytes calldata data) external payable virtual returns (address[] memory); /** * @dev The function must withdraw assets from the protocol. * @return MUST return assets to be sent back to the `msg.sender`. */ function withdraw(TokenAmount[] calldata tokenAmounts, bytes calldata data) external payable virtual returns (address[] memory); function getAbsoluteAmountDeposit(TokenAmount calldata tokenAmount) internal view virtual returns (uint256) { address token = tokenAmount.token; uint256 amount = tokenAmount.amount; AmountType amountType = tokenAmount.amountType; require( amountType == AmountType.Relative || amountType == AmountType.Absolute, "IA: bad amount type" ); if (amountType == AmountType.Relative) { require(amount <= DELIMITER, "IA: bad amount"); uint256 balance; if (token == ETH) { balance = address(this).balance; } else { balance = ERC20(token).balanceOf(address(this)); } if (amount == DELIMITER) { return balance; } else { return mul(balance, amount) / DELIMITER; } } else { return amount; } } function getAbsoluteAmountWithdraw(TokenAmount calldata tokenAmount) internal virtual returns (uint256) { address token = tokenAmount.token; uint256 amount = tokenAmount.amount; AmountType amountType = tokenAmount.amountType; require( amountType == AmountType.Relative || amountType == AmountType.Absolute, "IA: bad amount type" ); if (amountType == AmountType.Relative) { require(amount <= DELIMITER, "IA: bad amount"); int256 balanceSigned = getBalance(token, address(this)); uint256 balance = balanceSigned > 0 ? uint256(balanceSigned) : uint256(-balanceSigned); if (amount == DELIMITER) { return balance; } else { return mul(balance, amount) / DELIMITER; } } else { return amount; } } function mul(uint256 a, uint256 b) internal pure returns (uint256) { if (a == 0) { return 0; } uint256 c = a * b; require(c / a == b, "IA: mul overflow"); return c; } }
// Copyright (C) 2020 Zerion Inc. <https://zerion.io> // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation, either version 3 of the License, or // (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program. If not, see <https://www.gnu.org/licenses/>. // // SPDX-License-Identifier: LGPL-3.0-only pragma solidity 0.7.3; /** * @dev CEther contract interface. * The CEther contract is available here * github.com/compound-finance/compound-protocol/blob/master/contracts/CEther.sol. */ interface CEther { function mint() external payable; }
// Copyright (C) 2020 Zerion Inc. <https://zerion.io> // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation, either version 3 of the License, or // (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program. If not, see <https://www.gnu.org/licenses/>. // // SPDX-License-Identifier: LGPL-3.0-only pragma solidity 0.7.3; /** * @dev CToken contract interface. * The CToken contract is available here * github.com/compound-finance/compound-protocol/blob/master/contracts/CToken.sol. */ interface CToken { function borrowBalanceCurrent(address) external returns (uint256); function exchangeRateCurrent() external returns (uint256); function mint(uint256) external returns (uint256); function redeem(uint256) external returns (uint256); function borrowBalanceStored(address) external view returns (uint256); function underlying() external view returns (address); function borrowIndex() external view returns (uint256); function balanceOf(address) external view returns (uint256); }
// Copyright (C) 2020 Zerion Inc. <https://zerion.io> // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation, either version 3 of the License, or // (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program. If not, see <https://www.gnu.org/licenses/>. // // SPDX-License-Identifier: LGPL-3.0-only pragma solidity 0.7.3; pragma experimental ABIEncoderV2; interface ERC20 { function approve(address, uint256) external returns (bool); function transfer(address, uint256) external returns (bool); function transferFrom( address, address, uint256 ) external returns (bool); function name() external view returns (string memory); function symbol() external view returns (string memory); function decimals() external view returns (uint8); function totalSupply() external view returns (uint256); function balanceOf(address) external view returns (uint256); function allowance(address, address) external view returns (uint256); }
// Copyright (C) 2020 Zerion Inc. <https://zerion.io> // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation, either version 3 of the License, or // (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program. If not, see <https://www.gnu.org/licenses/>. // // SPDX-License-Identifier: LGPL-3.0-only pragma solidity 0.7.3; import "./ERC20.sol"; /** * @title SafeERC20 * @dev Wrappers around ERC20 operations that throw on failure (when the token contract * returns false). Tokens that return no value (and instead revert or throw on failure) * are also supported, non-reverting calls are assumed to be successful. * To use this library you can add a `using SafeERC20 for ERC20;` statement to your contract, * which allows you to call the safe operations as `token.safeTransfer(...)`, etc. */ library SafeERC20 { function safeTransfer( ERC20 token, address to, uint256 value, string memory location ) internal { callOptionalReturn( token, abi.encodeWithSelector(token.transfer.selector, to, value), "transfer", location ); } function safeTransferFrom( ERC20 token, address from, address to, uint256 value, string memory location ) internal { callOptionalReturn( token, abi.encodeWithSelector(token.transferFrom.selector, from, to, value), "transferFrom", location ); } function safeApprove( ERC20 token, address spender, uint256 value, string memory location ) internal { require( (value == 0) || (token.allowance(address(this), spender) == 0), string(abi.encodePacked("SafeERC20: bad approve call from ", location)) ); callOptionalReturn( token, abi.encodeWithSelector(token.approve.selector, spender, value), "approve", location ); } function safeApproveMax( ERC20 token, address spender, uint256 amount, string memory location ) internal { uint256 allowance = ERC20(token).allowance(address(this), spender); if (allowance < amount) { if (allowance > 0) { safeApprove(token, spender, 0, location); } safeApprove(token, spender, type(uint256).max, location); } } /** * @dev Imitates a Solidity high-level call (i.e. a regular function call to a contract), * relaxing the requirement on the return value: the return value is optional * (but if data is returned, it must not be false). * @param token The token targeted by the call. * @param data The call data (encoded using abi.encode or one of its variants). * @param location Location of the call (for debug). */ function callOptionalReturn( ERC20 token, bytes memory data, string memory functionName, string memory location ) private { // We need to perform a low level call here, to bypass Solidity's return data size checking // mechanism, since we're implementing it ourselves. // We implement two-steps call as callee is a contract is a responsibility of a caller. // 1. The call itself is made, and success asserted // 2. The return value is decoded, which in turn checks the size of the returned data. // solhint-disable-next-line avoid-low-level-calls (bool success, bytes memory returndata) = address(token).call(data); require( success, string(abi.encodePacked("SafeERC20: ", functionName, " failed in ", location)) ); if (returndata.length > 0) { // Return data is optional require( abi.decode(returndata, (bool)), string( abi.encodePacked("SafeERC20: ", functionName, " returned false in ", location) ) ); } } }
// Copyright (C) 2020 Zerion Inc. <https://zerion.io> // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation, either version 3 of the License, or // (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program. If not, see <https://www.gnu.org/licenses/>. // // SPDX-License-Identifier: LGPL-3.0-only pragma solidity 0.7.3; pragma experimental ABIEncoderV2; // The struct consists of TokenBalanceMeta structs for // (base) token and its underlying tokens (if any). struct FullTokenBalance { TokenBalanceMeta base; TokenBalanceMeta[] underlying; } // The struct consists of TokenBalance struct // with token address and absolute amount // and ERC20Metadata struct with ERC20-style metadata. // NOTE: 0xEeee...EEeE address is used for ETH. struct TokenBalanceMeta { TokenBalance tokenBalance; ERC20Metadata erc20metadata; } // The struct consists of ERC20-style token metadata. struct ERC20Metadata { string name; string symbol; uint8 decimals; } // The struct consists of protocol adapter's name // and array of TokenBalance structs // with token addresses and absolute amounts. struct AdapterBalance { bytes32 protocolAdapterName; TokenBalance[] tokenBalances; } // The struct consists of token address // and its absolute amount (may be negative). struct TokenBalance { address token; int256 amount; } // The struct consists of token address, // and price per full share (1e18). struct Component { address token; int256 rate; } //=============================== Interactive Adapters Structs ==================================== // The struct consists of array of actions, // array of inputs, fee, required outputs, // and salt parameter used to protect users from double spends. struct TransactionData { Action[] actions; TokenAmount[] inputs; Fee fee; AbsoluteTokenAmount[] requiredOutputs; uint256 salt; } // The struct consists of name of the protocol adapter, // action type, array of token amounts, // and some additional data (depends on the protocol). struct Action { bytes32 protocolAdapterName; ActionType actionType; TokenAmount[] tokenAmounts; bytes data; } // The struct consists of token address // its amount and amount type. struct TokenAmount { address token; uint256 amount; AmountType amountType; } // The struct consists of fee share // and beneficiary address. struct Fee { uint256 share; address beneficiary; } // The struct consists of token address // and its absolute amount. struct AbsoluteTokenAmount { address token; uint256 amount; } enum ActionType { None, Deposit, Withdraw } enum AmountType { None, Relative, Absolute }
{ "remappings": [], "optimizer": { "enabled": true, "runs": 1000000 }, "evmVersion": "istanbul", "libraries": { "": {} }, "outputSelection": { "*": { "*": [ "evm.bytecode", "evm.deployedBytecode", "abi" ] } } }
Contract Security Audit
- No Contract Security Audit Submitted- Submit Audit Here
[{"inputs":[{"components":[{"internalType":"address","name":"token","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"enum AmountType","name":"amountType","type":"uint8"}],"internalType":"struct TokenAmount[]","name":"tokenAmounts","type":"tuple[]"},{"internalType":"bytes","name":"","type":"bytes"}],"name":"deposit","outputs":[{"internalType":"address[]","name":"tokensToBeWithdrawn","type":"address[]"}],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"address","name":"token","type":"address"},{"internalType":"address","name":"account","type":"address"}],"name":"getBalance","outputs":[{"internalType":"int256","name":"","type":"int256"}],"stateMutability":"view","type":"function"},{"inputs":[{"components":[{"internalType":"address","name":"token","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"enum AmountType","name":"amountType","type":"uint8"}],"internalType":"struct TokenAmount[]","name":"tokenAmounts","type":"tuple[]"},{"internalType":"bytes","name":"","type":"bytes"}],"name":"withdraw","outputs":[{"internalType":"address[]","name":"tokensToBeWithdrawn","type":"address[]"}],"stateMutability":"payable","type":"function"}]
Contract Creation Code
608060405234801561001057600080fd5b50611556806100206000396000f3fe6080604052600436106100345760003560e01c806328ffb83d14610039578063387b817414610062578063d4fac45d14610075575b600080fd5b61004c610047366004610f94565b6100a2565b604051610059919061129e565b60405180910390f35b61004c610070366004610f94565b6104bc565b34801561008157600080fd5b50610095610090366004610f5c565b6107c3565b60405161005991906112f8565b6060600184146100e7576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016100de90611463565b60405180910390fd5b6000858560008181106100f657fe5b61010c9260206060909202019081019150610f24565b9050600061012b8787600081811061012057fe5b905060600201610871565b604080516002808252606082018352929350919060208301908036833701905050925073c00e94cb662c3520282e6f5717214004a7f268888360008151811061017057fe5b73ffffffffffffffffffffffffffffffffffffffff9283166020918202929092010152821673eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee141561028657734ddc2d193948926d02f9b1fe9e1daa0718270ed5836001815181106101d257fe5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050734ddc2d193948926d02f9b1fe9e1daa0718270ed573ffffffffffffffffffffffffffffffffffffffff16631249c58b826040518263ffffffff1660e01b81526004016000604051808303818588803b15801561026857600080fd5b505af115801561027c573d6000803e3d6000fd5b50505050506104b2565b6040517f7e5a4eb900000000000000000000000000000000000000000000000000000000815260009073ac41db9741f869e432575952748e7064d299614d90637e5a4eb9906102d9908690600401611230565b60206040518083038186803b1580156102f157600080fd5b505afa158015610305573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906103299190610f40565b9050808460018151811061033957fe5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff16815250506103d581836040518060400160405280600481526020017f43414941000000000000000000000000000000000000000000000000000000008152508673ffffffffffffffffffffffffffffffffffffffff16610a7d909392919063ffffffff16565b6040517fa0712d6800000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff82169063a0712d68906104279085906004016112f8565b602060405180830381600087803b15801561044157600080fd5b505af1158015610455573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610479919061108f565b156104b0576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016100de90611498565b505b5050949350505050565b6060600184146104f8576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016100de906113f7565b60008585600081811061050757fe5b61051d9260206060909202019081019150610f24565b9050600061053c8787600081811061053157fe5b905060600201610c42565b604080516002808252606082018352929350919060208301908036833701905050925073c00e94cb662c3520282e6f5717214004a7f268888360008151811061058157fe5b73ffffffffffffffffffffffffffffffffffffffff92831660209182029290920101528216734ddc2d193948926d02f9b1fe9e1daa0718270ed514156106225773eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee836001815181106105e357fe5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff16815250506106e8565b8173ffffffffffffffffffffffffffffffffffffffff16636f307dc36040518163ffffffff1660e01b815260040160206040518083038186803b15801561066857600080fd5b505afa15801561067c573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906106a09190610f40565b836001815181106106ad57fe5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff16815250505b6040517fdb006a7500000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff83169063db006a759061073a9084906004016112f8565b602060405180830381600087803b15801561075457600080fd5b505af1158015610768573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061078c919061108f565b156104b2576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016100de906113c0565b6040517f70a0823100000000000000000000000000000000000000000000000000000000815260009073ffffffffffffffffffffffffffffffffffffffff8416906370a0823190610818908590600401611230565b60206040518083038186803b15801561083057600080fd5b505afa158015610844573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610868919061108f565b90505b92915050565b6000806108816020840184610f24565b90506020830135600061089a6060860160408701611070565b905060018160028111156108aa57fe5b14806108c1575060028160028111156108bf57fe5b145b6108f7576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016100de90611352565b600181600281111561090557fe5b1415610a6e57670de0b6b3a764000082111561094d576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016100de90611389565b600073ffffffffffffffffffffffffffffffffffffffff841673eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee1415610988575047610a2d565b6040517f70a0823100000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff8516906370a08231906109da903090600401611230565b60206040518083038186803b1580156109f257600080fd5b505afa158015610a06573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610a2a919061108f565b90505b670de0b6b3a7640000831415610a48579350610a7892505050565b670de0b6b3a7640000610a5b8285610d85565b81610a6257fe5b04945050505050610a78565b509150610a789050565b919050565b811580610b2b57506040517fdd62ed3e00000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff85169063dd62ed3e90610ad99030908790600401611251565b60206040518083038186803b158015610af157600080fd5b505afa158015610b05573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610b29919061108f565b155b81604051602001610b3c91906110c3565b60405160208183030381529060405290610b83576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016100de9190611301565b50610c3c8463095ea7b360e01b8585604051602401610ba3929190611278565b604051602081830303815290604052907bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19166020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff83818316178352505050506040518060400160405280600781526020017f617070726f76650000000000000000000000000000000000000000000000000081525084610dd9565b50505050565b600080610c526020840184610f24565b905060208301356000610c6b6060860160408701611070565b90506001816002811115610c7b57fe5b1480610c9257506002816002811115610c9057fe5b145b610cc8576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016100de90611352565b6001816002811115610cd657fe5b1415610a6e57670de0b6b3a7640000821115610d1e576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016100de90611389565b6000610d2a84306107c3565b90506000808213610d3e5781600003610d40565b815b9050670de0b6b3a7640000841415610d5e579450610a789350505050565b670de0b6b3a7640000610d718286610d85565b81610d7857fe5b0495505050505050610a78565b600082610d945750600061086b565b82820282848281610da157fe5b0414610868576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016100de9061142c565b600060608573ffffffffffffffffffffffffffffffffffffffff1685604051610e0291906110a7565b6000604051808303816000865af19150503d8060008114610e3f576040519150601f19603f3d011682016040523d82523d6000602084013e610e44565b606091505b5091509150818484604051602001610e5d9291906111af565b60405160208183030381529060405290610ea4576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016100de9190611301565b50805115610f1c5780806020019051810190610ec09190611050565b8484604051602001610ed392919061112e565b60405160208183030381529060405290610f1a576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016100de9190611301565b505b505050505050565b600060208284031215610f35578081fd5b8135610868816114fb565b600060208284031215610f51578081fd5b8151610868816114fb565b60008060408385031215610f6e578081fd5b8235610f79816114fb565b91506020830135610f89816114fb565b809150509250929050565b60008060008060408587031215610fa9578182fd5b843567ffffffffffffffff80821115610fc0578384fd5b818701915087601f830112610fd3578384fd5b813581811115610fe1578485fd5b886020606083028501011115610ff5578485fd5b60209283019650945090860135908082111561100f578384fd5b818701915087601f830112611022578384fd5b813581811115611030578485fd5b886020828501011115611041578485fd5b95989497505060200194505050565b600060208284031215611061578081fd5b81518015158114610868578182fd5b600060208284031215611081578081fd5b813560038110610868578182fd5b6000602082840312156110a0578081fd5b5051919050565b600082516110b98184602087016114cf565b9190910192915050565b60007f5361666545524332303a2062616420617070726f76652063616c6c2066726f6d82527f2000000000000000000000000000000000000000000000000000000000000000602083015282516111218160218501602087016114cf565b9190910160210192915050565b60007f5361666545524332303a200000000000000000000000000000000000000000008252835161116681600b8501602088016114cf565b7f2072657475726e65642066616c736520696e2000000000000000000000000000600b9184019182015283516111a381601e8401602088016114cf565b01601e01949350505050565b60007f5361666545524332303a20000000000000000000000000000000000000000000825283516111e781600b8501602088016114cf565b7f206661696c656420696e20000000000000000000000000000000000000000000600b9184019182015283516112248160168401602088016114cf565b01601601949350505050565b73ffffffffffffffffffffffffffffffffffffffff91909116815260200190565b73ffffffffffffffffffffffffffffffffffffffff92831681529116602082015260400190565b73ffffffffffffffffffffffffffffffffffffffff929092168252602082015260400190565b6020808252825182820181905260009190848201906040850190845b818110156112ec57835173ffffffffffffffffffffffffffffffffffffffff16835292840192918401916001016112ba565b50909695505050505050565b90815260200190565b60006020825282518060208401526113208160408501602087016114cf565b601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0169190910160400192915050565b60208082526013908201527f49413a2062616420616d6f756e74207479706500000000000000000000000000604082015260600190565b6020808252600e908201527f49413a2062616420616d6f756e74000000000000000000000000000000000000604082015260600190565b60208082526015908201527f434149413a207769746864726177206661696c65640000000000000000000000604082015260600190565b6020808252818101527f434149413a2073686f756c64206265203120746f6b656e416d6f756e745b325d604082015260600190565b60208082526010908201527f49413a206d756c206f766572666c6f7700000000000000000000000000000000604082015260600190565b6020808252818101527f434149413a2073686f756c64206265203120746f6b656e416d6f756e745b315d604082015260600190565b60208082526014908201527f434149413a206465706f736974206661696c6564000000000000000000000000604082015260600190565b60005b838110156114ea5781810151838201526020016114d2565b83811115610c3c5750506000910152565b73ffffffffffffffffffffffffffffffffffffffff8116811461151d57600080fd5b5056fea2646970667358221220b286da123f985659e490ab86b22ac6d0843a6bb9cf65d047786058f831fd392964736f6c63430007030033
Deployed Bytecode
0x6080604052600436106100345760003560e01c806328ffb83d14610039578063387b817414610062578063d4fac45d14610075575b600080fd5b61004c610047366004610f94565b6100a2565b604051610059919061129e565b60405180910390f35b61004c610070366004610f94565b6104bc565b34801561008157600080fd5b50610095610090366004610f5c565b6107c3565b60405161005991906112f8565b6060600184146100e7576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016100de90611463565b60405180910390fd5b6000858560008181106100f657fe5b61010c9260206060909202019081019150610f24565b9050600061012b8787600081811061012057fe5b905060600201610871565b604080516002808252606082018352929350919060208301908036833701905050925073c00e94cb662c3520282e6f5717214004a7f268888360008151811061017057fe5b73ffffffffffffffffffffffffffffffffffffffff9283166020918202929092010152821673eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee141561028657734ddc2d193948926d02f9b1fe9e1daa0718270ed5836001815181106101d257fe5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050734ddc2d193948926d02f9b1fe9e1daa0718270ed573ffffffffffffffffffffffffffffffffffffffff16631249c58b826040518263ffffffff1660e01b81526004016000604051808303818588803b15801561026857600080fd5b505af115801561027c573d6000803e3d6000fd5b50505050506104b2565b6040517f7e5a4eb900000000000000000000000000000000000000000000000000000000815260009073ac41db9741f869e432575952748e7064d299614d90637e5a4eb9906102d9908690600401611230565b60206040518083038186803b1580156102f157600080fd5b505afa158015610305573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906103299190610f40565b9050808460018151811061033957fe5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff16815250506103d581836040518060400160405280600481526020017f43414941000000000000000000000000000000000000000000000000000000008152508673ffffffffffffffffffffffffffffffffffffffff16610a7d909392919063ffffffff16565b6040517fa0712d6800000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff82169063a0712d68906104279085906004016112f8565b602060405180830381600087803b15801561044157600080fd5b505af1158015610455573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610479919061108f565b156104b0576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016100de90611498565b505b5050949350505050565b6060600184146104f8576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016100de906113f7565b60008585600081811061050757fe5b61051d9260206060909202019081019150610f24565b9050600061053c8787600081811061053157fe5b905060600201610c42565b604080516002808252606082018352929350919060208301908036833701905050925073c00e94cb662c3520282e6f5717214004a7f268888360008151811061058157fe5b73ffffffffffffffffffffffffffffffffffffffff92831660209182029290920101528216734ddc2d193948926d02f9b1fe9e1daa0718270ed514156106225773eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee836001815181106105e357fe5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff16815250506106e8565b8173ffffffffffffffffffffffffffffffffffffffff16636f307dc36040518163ffffffff1660e01b815260040160206040518083038186803b15801561066857600080fd5b505afa15801561067c573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906106a09190610f40565b836001815181106106ad57fe5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff16815250505b6040517fdb006a7500000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff83169063db006a759061073a9084906004016112f8565b602060405180830381600087803b15801561075457600080fd5b505af1158015610768573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061078c919061108f565b156104b2576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016100de906113c0565b6040517f70a0823100000000000000000000000000000000000000000000000000000000815260009073ffffffffffffffffffffffffffffffffffffffff8416906370a0823190610818908590600401611230565b60206040518083038186803b15801561083057600080fd5b505afa158015610844573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610868919061108f565b90505b92915050565b6000806108816020840184610f24565b90506020830135600061089a6060860160408701611070565b905060018160028111156108aa57fe5b14806108c1575060028160028111156108bf57fe5b145b6108f7576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016100de90611352565b600181600281111561090557fe5b1415610a6e57670de0b6b3a764000082111561094d576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016100de90611389565b600073ffffffffffffffffffffffffffffffffffffffff841673eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee1415610988575047610a2d565b6040517f70a0823100000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff8516906370a08231906109da903090600401611230565b60206040518083038186803b1580156109f257600080fd5b505afa158015610a06573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610a2a919061108f565b90505b670de0b6b3a7640000831415610a48579350610a7892505050565b670de0b6b3a7640000610a5b8285610d85565b81610a6257fe5b04945050505050610a78565b509150610a789050565b919050565b811580610b2b57506040517fdd62ed3e00000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff85169063dd62ed3e90610ad99030908790600401611251565b60206040518083038186803b158015610af157600080fd5b505afa158015610b05573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610b29919061108f565b155b81604051602001610b3c91906110c3565b60405160208183030381529060405290610b83576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016100de9190611301565b50610c3c8463095ea7b360e01b8585604051602401610ba3929190611278565b604051602081830303815290604052907bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19166020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff83818316178352505050506040518060400160405280600781526020017f617070726f76650000000000000000000000000000000000000000000000000081525084610dd9565b50505050565b600080610c526020840184610f24565b905060208301356000610c6b6060860160408701611070565b90506001816002811115610c7b57fe5b1480610c9257506002816002811115610c9057fe5b145b610cc8576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016100de90611352565b6001816002811115610cd657fe5b1415610a6e57670de0b6b3a7640000821115610d1e576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016100de90611389565b6000610d2a84306107c3565b90506000808213610d3e5781600003610d40565b815b9050670de0b6b3a7640000841415610d5e579450610a789350505050565b670de0b6b3a7640000610d718286610d85565b81610d7857fe5b0495505050505050610a78565b600082610d945750600061086b565b82820282848281610da157fe5b0414610868576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016100de9061142c565b600060608573ffffffffffffffffffffffffffffffffffffffff1685604051610e0291906110a7565b6000604051808303816000865af19150503d8060008114610e3f576040519150601f19603f3d011682016040523d82523d6000602084013e610e44565b606091505b5091509150818484604051602001610e5d9291906111af565b60405160208183030381529060405290610ea4576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016100de9190611301565b50805115610f1c5780806020019051810190610ec09190611050565b8484604051602001610ed392919061112e565b60405160208183030381529060405290610f1a576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016100de9190611301565b505b505050505050565b600060208284031215610f35578081fd5b8135610868816114fb565b600060208284031215610f51578081fd5b8151610868816114fb565b60008060408385031215610f6e578081fd5b8235610f79816114fb565b91506020830135610f89816114fb565b809150509250929050565b60008060008060408587031215610fa9578182fd5b843567ffffffffffffffff80821115610fc0578384fd5b818701915087601f830112610fd3578384fd5b813581811115610fe1578485fd5b886020606083028501011115610ff5578485fd5b60209283019650945090860135908082111561100f578384fd5b818701915087601f830112611022578384fd5b813581811115611030578485fd5b886020828501011115611041578485fd5b95989497505060200194505050565b600060208284031215611061578081fd5b81518015158114610868578182fd5b600060208284031215611081578081fd5b813560038110610868578182fd5b6000602082840312156110a0578081fd5b5051919050565b600082516110b98184602087016114cf565b9190910192915050565b60007f5361666545524332303a2062616420617070726f76652063616c6c2066726f6d82527f2000000000000000000000000000000000000000000000000000000000000000602083015282516111218160218501602087016114cf565b9190910160210192915050565b60007f5361666545524332303a200000000000000000000000000000000000000000008252835161116681600b8501602088016114cf565b7f2072657475726e65642066616c736520696e2000000000000000000000000000600b9184019182015283516111a381601e8401602088016114cf565b01601e01949350505050565b60007f5361666545524332303a20000000000000000000000000000000000000000000825283516111e781600b8501602088016114cf565b7f206661696c656420696e20000000000000000000000000000000000000000000600b9184019182015283516112248160168401602088016114cf565b01601601949350505050565b73ffffffffffffffffffffffffffffffffffffffff91909116815260200190565b73ffffffffffffffffffffffffffffffffffffffff92831681529116602082015260400190565b73ffffffffffffffffffffffffffffffffffffffff929092168252602082015260400190565b6020808252825182820181905260009190848201906040850190845b818110156112ec57835173ffffffffffffffffffffffffffffffffffffffff16835292840192918401916001016112ba565b50909695505050505050565b90815260200190565b60006020825282518060208401526113208160408501602087016114cf565b601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0169190910160400192915050565b60208082526013908201527f49413a2062616420616d6f756e74207479706500000000000000000000000000604082015260600190565b6020808252600e908201527f49413a2062616420616d6f756e74000000000000000000000000000000000000604082015260600190565b60208082526015908201527f434149413a207769746864726177206661696c65640000000000000000000000604082015260600190565b6020808252818101527f434149413a2073686f756c64206265203120746f6b656e416d6f756e745b325d604082015260600190565b60208082526010908201527f49413a206d756c206f766572666c6f7700000000000000000000000000000000604082015260600190565b6020808252818101527f434149413a2073686f756c64206265203120746f6b656e416d6f756e745b315d604082015260600190565b60208082526014908201527f434149413a206465706f736974206661696c6564000000000000000000000000604082015260600190565b60005b838110156114ea5781810151838201526020016114d2565b83811115610c3c5750506000910152565b73ffffffffffffffffffffffffffffffffffffffff8116811461151d57600080fd5b5056fea2646970667358221220b286da123f985659e490ab86b22ac6d0843a6bb9cf65d047786058f831fd392964736f6c63430007030033
Loading...
Loading
Loading...
Loading
Multichain Portfolio | 30 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.