Overview
POL Balance
0 POL
POL Value
$0.00More Info
Private Name Tags
ContractCreator
Latest 1 from a total of 1 transactions
Transaction Hash |
Method
|
Block
|
From
|
To
|
|||||
---|---|---|---|---|---|---|---|---|---|
Transfer Ownersh... | 43642512 | 590 days ago | IN | 0 POL | 0.00455661 |
Loading...
Loading
Contract Name:
ChainlinkOracle
Compiler Version
v0.8.15+commit.e14f2714
Optimization Enabled:
Yes with 200 runs
Other Settings:
default evmVersion
Contract Source Code (Solidity Standard Json-Input format)
// SPDX-License-Identifier: CC0-1.0 pragma solidity 0.8.15; import "@openzeppelin/contracts/token/ERC20/extensions/IERC20Metadata.sol"; import "@openzeppelin/contracts/access/Ownable.sol"; import "../interfaces/external/chainlink/IAggregatorV3.sol"; import "../interfaces/oracles/IOracle.sol"; /// @notice Contract for getting chainlink data contract ChainlinkOracle is IOracle, Ownable { /// @notice Thrown when tokens.length != oracles.length error InvalidLength(); /// @notice Thrown when price feed doesn't work by some reason error InvalidOracle(); /// @notice Thrown when sum of token.decimals and oracle.decimals is too high error InvalidOverallDecimals(); /// @notice Price update error error PriceUpdateFailed(); uint256 public constant DECIMALS = 18; uint256 public constant Q96 = 2**96; struct PriceData { IAggregatorV3 feed; uint48 heartbeat; uint48 fallbackUpdatedAt; uint256 fallbackPriceX96; uint256 priceMultiplier; } /// @notice Mapping, returning underlying prices for each token mapping(address => PriceData) public pricesInfo; /// @notice Valid period of underlying prices (in seconds) uint256 public validPeriod; /// @notice Creates a new contract /// @param tokens Initial supported tokens /// @param oracles Initial approved Chainlink oracles /// @param heartbeats Initial heartbeats for chainlink oracles /// @param validPeriod_ Initial valid period of underlying prices (in seconds) constructor( address[] memory tokens, address[] memory oracles, uint48[] memory heartbeats, uint256 validPeriod_ ) { validPeriod = validPeriod_; _addChainlinkOracles(tokens, oracles, heartbeats); } // ------------------------- EXTERNAL, VIEW ------------------------------ /// @inheritdoc IOracle function hasOracle(address token) external view returns (bool) { return address(pricesInfo[token].feed) != address(0); } /// @inheritdoc IOracle function price(address token) external view returns (bool success, uint256 priceX96) { PriceData storage priceData = pricesInfo[token]; (IAggregatorV3 feed, uint48 heartbeat, uint48 fallbackUpdatedAt) = ( priceData.feed, priceData.heartbeat, priceData.fallbackUpdatedAt ); uint256 oraclePrice; uint256 updatedAt; if (address(priceData.feed) == address(0)) { return (false, 0); } (success, oraclePrice, updatedAt) = _queryChainlinkOracle(feed); if (!success || updatedAt + heartbeat < block.timestamp) { if (block.timestamp <= fallbackUpdatedAt + validPeriod) { return (true, priceData.fallbackPriceX96); } else { return (false, 0); } } success = true; priceX96 = oraclePrice * priceData.priceMultiplier; } // ------------------------- EXTERNAL, MUTATING ------------------------------ /// @notice Add more chainlink oracles and tokens /// @param tokens Array of new tokens /// @param oracles Array of new oracles /// @param heartbeats Array of heartbeats for oracles function addChainlinkOracles( address[] memory tokens, address[] memory oracles, uint48[] memory heartbeats ) external onlyOwner { _addChainlinkOracles(tokens, oracles, heartbeats); } /// @notice Set new valid period /// @param validPeriod_ New valid period function setValidPeriod(uint256 validPeriod_) external onlyOwner { validPeriod = validPeriod_; emit ValidPeriodUpdated(tx.origin, msg.sender, validPeriod_); } /// @notice Set new underlying fallbackPriceX96 for specific token /// @param token Address of the token /// @param fallbackPriceX96 Value of price multiplied by 2**96 /// @param fallbackUpdatedAt Timestamp of the price function setUnderlyingPriceX96( address token, uint256 fallbackPriceX96, uint48 fallbackUpdatedAt ) external onlyOwner { if (fallbackUpdatedAt >= block.timestamp) { fallbackUpdatedAt = uint48(block.timestamp); } else if (fallbackUpdatedAt + validPeriod < block.timestamp) { revert PriceUpdateFailed(); } PriceData storage priceData = pricesInfo[token]; priceData.fallbackUpdatedAt = fallbackUpdatedAt; priceData.fallbackPriceX96 = fallbackPriceX96; emit PricePosted(tx.origin, msg.sender, token, fallbackPriceX96, fallbackUpdatedAt); } // ------------------------- INTERNAL, VIEW ------------------------------ /// @notice Attempt to send a price query to chainlink oracle /// @param oracle Chainlink oracle /// @return success Query to chainlink oracle (if oracle.latestRoundData call works correctly => the answer can be received), answer Result of the query function _queryChainlinkOracle(IAggregatorV3 oracle) internal view returns ( bool success, uint256 answer, uint256 fallbackUpdatedAt ) { try oracle.latestRoundData() returns (uint80, int256 ans, uint256, uint256 fallbackUpdatedAt_, uint80) { if (ans <= 0) { return (false, 0, 0); } return (true, uint256(ans), fallbackUpdatedAt_); } catch (bytes memory) { return (false, 0, 0); } } // ------------------------- INTERNAL, MUTATING ------------------------------ /// @notice Add more chainlink oracles and tokens (internal) /// @param tokens Array of new tokens /// @param oracles Array of new oracles /// @param heartbeats Array of heartbeats for oracles function _addChainlinkOracles( address[] memory tokens, address[] memory oracles, uint48[] memory heartbeats ) internal { if (tokens.length != oracles.length || oracles.length != heartbeats.length) { revert InvalidLength(); } for (uint256 i = 0; i < tokens.length; ++i) { address token = tokens[i]; address oracle = oracles[i]; uint48 heartbeat = heartbeats[i]; IAggregatorV3 chainlinkOracle = IAggregatorV3(oracle); (bool flag, , ) = _queryChainlinkOracle(chainlinkOracle); if (!flag) { revert InvalidOracle(); // hence a token for this 'oracle' can not be added } uint256 decimals = uint256(IERC20Metadata(token).decimals() + IAggregatorV3(oracle).decimals()); // when decimals is more than 18 + 26 priceDeviation becomes too high if (decimals > 44) { revert InvalidOverallDecimals(); } uint256 priceMultiplier; if (DECIMALS > decimals) { priceMultiplier = (10**(DECIMALS - decimals)) * Q96; } else { priceMultiplier = Q96 / 10**(decimals - DECIMALS); } pricesInfo[token] = PriceData({ feed: chainlinkOracle, heartbeat: heartbeat, fallbackUpdatedAt: 0, fallbackPriceX96: 0, priceMultiplier: priceMultiplier }); } emit OraclesAdded(tx.origin, msg.sender, tokens, oracles, heartbeats); } // -------------------------- EVENTS -------------------------- /// @notice Emitted when new Chainlink oracles are added /// @param origin Origin of the transaction (tx.origin) /// @param sender Sender of the call (msg.sender) /// @param tokens Tokens added /// @param oracles Oracles added for the tokens /// @param heartbeats Array of heartbeats for oracles event OraclesAdded( address indexed origin, address indexed sender, address[] tokens, address[] oracles, uint48[] heartbeats ); /// @notice Emitted when underlying price of the token updates /// @param origin Origin of the transaction (tx.origin) /// @param sender Sender of the call (msg.sender) /// @param token Address of the token /// @param newPriceX96 New underlying price multiplied by 2**96 /// @param fallbackUpdatedAt Timestamp of underlying price updating event PricePosted( address indexed origin, address indexed sender, address token, uint256 newPriceX96, uint48 fallbackUpdatedAt ); /// @notice Emitted when validPeriod updates /// @param origin Origin of the transaction (tx.origin) /// @param sender Sender of the call (msg.sender) /// @param validPeriod Current valid period event ValidPeriodUpdated(address indexed origin, address indexed sender, uint256 validPeriod); }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (token/ERC20/extensions/IERC20Metadata.sol) pragma solidity ^0.8.0; import "../IERC20.sol"; /** * @dev Interface for the optional metadata functions from the ERC20 standard. * * _Available since v4.1._ */ interface IERC20Metadata is IERC20 { /** * @dev Returns the name of the token. */ function name() external view returns (string memory); /** * @dev Returns the symbol of the token. */ function symbol() external view returns (string memory); /** * @dev Returns the decimals places of the token. */ function decimals() external view returns (uint8); }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.7.0) (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 Throws if called by any account other than the owner. */ modifier onlyOwner() { _checkOwner(); _; } /** * @dev Returns the address of the current owner. */ function owner() public view virtual returns (address) { return _owner; } /** * @dev Throws if the sender is not the owner. */ function _checkOwner() internal view virtual { require(owner() == _msgSender(), "Ownable: caller is not the owner"); } /** * @dev Leaves the contract without owner. It will not be possible to call * `onlyOwner` functions. Can only be called by the current owner. * * NOTE: Renouncing ownership will leave the contract without an owner, * thereby disabling 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: CC0-1.0 pragma solidity ^0.8.0; interface IAggregatorV3 { function decimals() external view returns (uint8); function description() external view returns (string memory); function version() external view returns (uint256); // getRoundData and latestRoundData should both raise "No data present" // if they do not have data to report, instead of returning unset values // which could be misinterpreted as actual reported values. function getRoundData(uint80 _roundId) external view returns ( uint80 roundId, int256 answer, uint256 startedAt, uint256 updatedAt, uint80 answeredInRound ); function latestRoundData() external view returns ( uint80 roundId, int256 answer, uint256 startedAt, uint256 updatedAt, uint80 answeredInRound ); }
// SPDX-License-Identifier: CC0-1.0 pragma solidity ^0.8.0; interface IOracle { /// @notice Oracle price for token. /// @param token Reference to token /// @return success True if call to an external oracle was successful, false otherwise /// @return priceX96 Price that satisfy token function price(address token) external view returns (bool success, uint256 priceX96); /// @notice Returns if an oracle was approved for a token /// @param token A given token address /// @return bool True if an oracle was approved for a token, else - false function hasOracle(address token) external view returns (bool); }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.6.0) (token/ERC20/IERC20.sol) pragma solidity ^0.8.0; /** * @dev Interface of the ERC20 standard as defined in the EIP. */ interface IERC20 { /** * @dev Emitted when `value` tokens are moved from one account (`from`) to * another (`to`). * * Note that `value` may be zero. */ event Transfer(address indexed from, address indexed to, uint256 value); /** * @dev Emitted when the allowance of a `spender` for an `owner` is set by * a call to {approve}. `value` is the new allowance. */ event Approval(address indexed owner, address indexed spender, uint256 value); /** * @dev Returns the amount of tokens in existence. */ function totalSupply() external view returns (uint256); /** * @dev Returns the amount of tokens owned by `account`. */ function balanceOf(address account) external view returns (uint256); /** * @dev Moves `amount` tokens from the caller's account to `to`. * * Returns a boolean value indicating whether the operation succeeded. * * Emits a {Transfer} event. */ function transfer(address to, uint256 amount) external returns (bool); /** * @dev Returns the remaining number of tokens that `spender` will be * allowed to spend on behalf of `owner` through {transferFrom}. This is * zero by default. * * This value changes when {approve} or {transferFrom} are called. */ function allowance(address owner, address spender) external view returns (uint256); /** * @dev Sets `amount` as the allowance of `spender` over the caller's tokens. * * Returns a boolean value indicating whether the operation succeeded. * * IMPORTANT: Beware that changing an allowance with this method brings the risk * that someone may use both the old and the new allowance by unfortunate * transaction ordering. One possible solution to mitigate this race * condition is to first reduce the spender's allowance to 0 and set the * desired value afterwards: * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729 * * Emits an {Approval} event. */ function approve(address spender, uint256 amount) external returns (bool); /** * @dev Moves `amount` tokens from `from` to `to` using the * allowance mechanism. `amount` is then deducted from the caller's * allowance. * * Returns a boolean value indicating whether the operation succeeded. * * Emits a {Transfer} event. */ function transferFrom(address from, address to, uint256 amount) external returns (bool); }
// 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; } }
{ "remappings": [ "@openzeppelin/=lib/openzeppelin-contracts/", "@quickswap/=lib/@quickswap/contracts/", "@uniswap/=lib/@uniswap/", "@zkbob/=lib/zkbob-contracts/src/", "ds-test/=lib/forge-std/lib/ds-test/src/", "forge-std/=lib/forge-std/src/" ], "optimizer": { "enabled": true, "runs": 200, "details": { "yul": true, "yulDetails": { "stackAllocation": true } } }, "metadata": { "bytecodeHash": "ipfs" }, "outputSelection": { "*": { "*": [ "evm.bytecode", "evm.deployedBytecode", "devdoc", "userdoc", "metadata", "abi" ] } }, "evmVersion": "london", "libraries": {} }
Contract Security Audit
- No Contract Security Audit Submitted- Submit Audit Here
[{"inputs":[{"internalType":"address[]","name":"tokens","type":"address[]"},{"internalType":"address[]","name":"oracles","type":"address[]"},{"internalType":"uint48[]","name":"heartbeats","type":"uint48[]"},{"internalType":"uint256","name":"validPeriod_","type":"uint256"}],"stateMutability":"nonpayable","type":"constructor"},{"inputs":[],"name":"InvalidLength","type":"error"},{"inputs":[],"name":"InvalidOracle","type":"error"},{"inputs":[],"name":"InvalidOverallDecimals","type":"error"},{"inputs":[],"name":"PriceUpdateFailed","type":"error"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"origin","type":"address"},{"indexed":true,"internalType":"address","name":"sender","type":"address"},{"indexed":false,"internalType":"address[]","name":"tokens","type":"address[]"},{"indexed":false,"internalType":"address[]","name":"oracles","type":"address[]"},{"indexed":false,"internalType":"uint48[]","name":"heartbeats","type":"uint48[]"}],"name":"OraclesAdded","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":true,"internalType":"address","name":"origin","type":"address"},{"indexed":true,"internalType":"address","name":"sender","type":"address"},{"indexed":false,"internalType":"address","name":"token","type":"address"},{"indexed":false,"internalType":"uint256","name":"newPriceX96","type":"uint256"},{"indexed":false,"internalType":"uint48","name":"fallbackUpdatedAt","type":"uint48"}],"name":"PricePosted","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"origin","type":"address"},{"indexed":true,"internalType":"address","name":"sender","type":"address"},{"indexed":false,"internalType":"uint256","name":"validPeriod","type":"uint256"}],"name":"ValidPeriodUpdated","type":"event"},{"inputs":[],"name":"DECIMALS","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"Q96","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address[]","name":"tokens","type":"address[]"},{"internalType":"address[]","name":"oracles","type":"address[]"},{"internalType":"uint48[]","name":"heartbeats","type":"uint48[]"}],"name":"addChainlinkOracles","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"token","type":"address"}],"name":"hasOracle","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"token","type":"address"}],"name":"price","outputs":[{"internalType":"bool","name":"success","type":"bool"},{"internalType":"uint256","name":"priceX96","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"pricesInfo","outputs":[{"internalType":"contract IAggregatorV3","name":"feed","type":"address"},{"internalType":"uint48","name":"heartbeat","type":"uint48"},{"internalType":"uint48","name":"fallbackUpdatedAt","type":"uint48"},{"internalType":"uint256","name":"fallbackPriceX96","type":"uint256"},{"internalType":"uint256","name":"priceMultiplier","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"token","type":"address"},{"internalType":"uint256","name":"fallbackPriceX96","type":"uint256"},{"internalType":"uint48","name":"fallbackUpdatedAt","type":"uint48"}],"name":"setUnderlyingPriceX96","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"validPeriod_","type":"uint256"}],"name":"setValidPeriod","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"validPeriod","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"}]
Contract Creation Code
60806040523480156200001157600080fd5b5060405162001981380380620019818339810160408190526200003491620005dc565b6200003f336200005b565b600281905562000051848484620000ab565b5050505062000a1b565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b81518351141580620000bf57508051825114155b15620000de5760405163251f56a160e21b815260040160405180910390fd5b60005b8351811015620003b6576000848281518110620001025762000102620006e4565b602002602001015190506000848381518110620001235762000123620006e4565b602002602001015190506000848481518110620001445762000144620006e4565b602090810291909101015190508160006200015f82620003fe565b50509050806200018257604051639589a27d60e01b815260040160405180910390fd5b6000846001600160a01b031663313ce5676040518163ffffffff1660e01b8152600401602060405180830381865afa158015620001c3573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190620001e99190620006fa565b866001600160a01b031663313ce5676040518163ffffffff1660e01b8152600401602060405180830381865afa15801562000228573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906200024e9190620006fa565b6200025a91906200073c565b60ff169050602c8111156200028257604051631eead3f560e31b815260040160405180910390fd5b60008160121115620002ca576c01000000000000000000000000620002a983601262000764565b620002b690600a6200087d565b620002c291906200088b565b905062000300565b620002d760128362000764565b620002e490600a6200087d565b620002fd906c01000000000000000000000000620008ad565b90505b6040805160a0810182526001600160a01b03958616815265ffffffffffff9687166020808301918252600083850181815260608501828152608086019788529c8a16825260019283905294902092518354925194518a16600160d01b026001600160d01b0395909a16600160a01b026001600160d01b031990931698169790971717919091169590951785559551928401929092555050915160029092019190915550620003ae81620008d0565b9050620000e1565b50604051339032907f426dbe4a04e4106ef2c804dc24a80ee19f1f411909e7edf6c2a05c86951a98d190620003f19087908790879062000932565b60405180910390a3505050565b6000806000836001600160a01b031663feaf968c6040518163ffffffff1660e01b815260040160a060405180830381865afa92505050801562000460575060408051601f3d908101601f191682019092526200045d91810190620009c6565b60015b620004a9573d80801562000491576040519150601f19603f3d011682016040523d82523d6000602084013e62000496565b606091505b50600080600093509350935050620004dc565b60008413620004c85760008060009750975097505050505050620004dc565b5060019650919450909250620004dc915050565b9193909250565b634e487b7160e01b600052604160045260246000fd5b604051601f8201601f191681016001600160401b0381118282101715620005245762000524620004e3565b604052919050565b60006001600160401b03821115620005485762000548620004e3565b5060051b60200190565b600082601f8301126200056457600080fd5b815160206200057d62000577836200052c565b620004f9565b82815260059290921b840181019181810190868411156200059d57600080fd5b8286015b84811015620005d15780516001600160a01b0381168114620005c35760008081fd5b8352918301918301620005a1565b509695505050505050565b60008060008060808587031215620005f357600080fd5b84516001600160401b03808211156200060b57600080fd5b620006198883890162000552565b95506020915081870151818111156200063157600080fd5b6200063f89828a0162000552565b9550506040870151818111156200065557600080fd5b87019050601f810188136200066957600080fd5b80516200067a62000577826200052c565b81815260059190911b8201830190838101908a8311156200069a57600080fd5b928401925b82841015620006d057835165ffffffffffff81168114620006c05760008081fd5b825292840192908401906200069f565b60609990990151979a969950505050505050565b634e487b7160e01b600052603260045260246000fd5b6000602082840312156200070d57600080fd5b815160ff811681146200071f57600080fd5b9392505050565b634e487b7160e01b600052601160045260246000fd5b600060ff821660ff84168060ff038211156200075c576200075c62000726565b019392505050565b60008282101562000779576200077962000726565b500390565b600181815b80851115620007bf578160001904821115620007a357620007a362000726565b80851615620007b157918102915b93841c939080029062000783565b509250929050565b600082620007d85750600162000877565b81620007e75750600062000877565b81600181146200080057600281146200080b576200082b565b600191505062000877565b60ff8411156200081f576200081f62000726565b50506001821b62000877565b5060208310610133831016604e8410600b841016171562000850575081810a62000877565b6200085c83836200077e565b806000190482111562000873576200087362000726565b0290505b92915050565b60006200071f8383620007c7565b6000816000190483118215151615620008a857620008a862000726565b500290565b600082620008cb57634e487b7160e01b600052601260045260246000fd5b500490565b600060018201620008e557620008e562000726565b5060010190565b600081518084526020808501945080840160005b83811015620009275781516001600160a01b03168752958201959082019060010162000900565b509495945050505050565b606081526000620009476060830186620008ec565b6020838203818501526200095c8287620008ec565b8481036040860152855180825282870193509082019060005b818110156200099b57845165ffffffffffff168352938301939183019160010162000975565b509098975050505050505050565b80516001600160501b0381168114620009c157600080fd5b919050565b600080600080600060a08688031215620009df57600080fd5b620009ea86620009a9565b945060208601519350604086015192506060860151915062000a0f60808701620009a9565b90509295509295909350565b610f568062000a2b6000396000f3fe608060405234801561001057600080fd5b50600436106100b45760003560e01c80638da5cb5b116100715780638da5cb5b14610143578063a35f8f971461015e578063aea9107814610171578063c257cbd41461019b578063f2fde38b146101ae578063f3417e33146101c157600080fd5b8063180c9309146100b95780632e0f2625146100fc5780634079246514610112578063715018a61461011d5780637efcc3a21461012757806389200da114610130575b600080fd5b6100e76100c73660046109c3565b6001600160a01b0390811660009081526001602052604090205416151590565b60405190151581526020015b60405180910390f35b610104601281565b6040519081526020016100f3565b610104600160601b81565b610125610253565b005b61010460025481565b61012561013e366004610ad8565b610267565b6000546040516001600160a01b0390911681526020016100f3565b61012561016c366004610bbd565b61027f565b61018461017f3660046109c3565b6102c6565b6040805192151583526020830191909152016100f3565b6101256101a9366004610bd6565b6103ae565b6101256101bc3660046109c3565b61048d565b6102156101cf3660046109c3565b60016020819052600091825260409091208054918101546002909101546001600160a01b0383169265ffffffffffff600160a01b8204811693600160d01b909204169185565b604080516001600160a01b0396909616865265ffffffffffff948516602087015292909316918401919091526060830152608082015260a0016100f3565b61025b61050b565b6102656000610565565b565b61026f61050b565b61027a8383836105b5565b505050565b61028761050b565b6002819055604051818152339032907f3f288679c843d6cb6dcb4832b2eb4a01129596cb122587a096eee986684f875f9060200160405180910390a350565b6001600160a01b0380821660009081526001602052604081208054919283929081169065ffffffffffff600160a01b8204811691600160d01b90041684808461031a57506000988998509650505050505050565b610323856108cc565b9199509250905087158061034757504261034565ffffffffffff861683610c28565b105b1561038e576002546103619065ffffffffffff8516610c28565b421161037d576001866001015497509750505050505050915091565b506000988998509650505050505050565b6002860154600198506103a19083610c40565b9650505050505050915091565b6103b661050b565b428165ffffffffffff16106103cc575042610402565b426002548265ffffffffffff166103e39190610c28565b101561040257604051630ad461a960e21b815260040160405180910390fd5b6001600160a01b03831660008181526001602081815260409283902080546001600160d01b0316600160d01b65ffffffffffff881690810291909117825592810187905583519485529084018690529183015290339032907f0923c6decc7b82e47992aaaad6e4d444fbc38ef9eba8b7c83e3efe9e1806fde79060600160405180910390a350505050565b61049561050b565b6001600160a01b0381166104ff5760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b60648201526084015b60405180910390fd5b61050881610565565b50565b6000546001600160a01b031633146102655760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657260448201526064016104f6565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b815183511415806105c857508051825114155b156105e65760405163251f56a160e21b815260040160405180910390fd5b60005b835181101561088657600084828151811061060657610606610c5f565b60200260200101519050600084838151811061062457610624610c5f565b60200260200101519050600084848151811061064257610642610c5f565b602002602001015190506000829050600061065c826108cc565b505090508061067e57604051639589a27d60e01b815260040160405180910390fd5b6000846001600160a01b031663313ce5676040518163ffffffff1660e01b8152600401602060405180830381865afa1580156106be573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906106e29190610c75565b866001600160a01b031663313ce5676040518163ffffffff1660e01b8152600401602060405180830381865afa158015610720573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906107449190610c75565b61074e9190610c98565b60ff169050602c81111561077557604051631eead3f560e31b815260040160405180910390fd5b600081601211156107ac57600160601b610790836012610cbd565b61079b90600a610dba565b6107a59190610c40565b90506107d3565b6107b7601283610cbd565b6107c290600a610dba565b6107d090600160601b610dc6565b90505b6040805160a0810182526001600160a01b03958616815265ffffffffffff9687166020808301918252600083850181815260608501828152608086019788529c8a16825260019283905294902092518354925194518a16600160d01b026001600160d01b0395909a16600160a01b026001600160d01b03199093169816979097171791909116959095178555955192840192909255505091516002909201919091555061087f81610de8565b90506105e9565b50604051339032907f426dbe4a04e4106ef2c804dc24a80ee19f1f411909e7edf6c2a05c86951a98d1906108bf90879087908790610e45565b60405180910390a3505050565b6000806000836001600160a01b031663feaf968c6040518163ffffffff1660e01b815260040160a060405180830381865afa92505050801561092b575060408051601f3d908101601f1916820190925261092891810190610ed0565b60015b610970573d808015610959576040519150601f19603f3d011682016040523d82523d6000602084013e61095e565b606091505b506000806000935093509350506109a0565b6000841361098d57600080600097509750975050505050506109a0565b50600196509194509092506109a0915050565b9193909250565b80356001600160a01b03811681146109be57600080fd5b919050565b6000602082840312156109d557600080fd5b6109de826109a7565b9392505050565b634e487b7160e01b600052604160045260246000fd5b604051601f8201601f1916810167ffffffffffffffff81118282101715610a2457610a246109e5565b604052919050565b600067ffffffffffffffff821115610a4657610a466109e5565b5060051b60200190565b600082601f830112610a6157600080fd5b81356020610a76610a7183610a2c565b6109fb565b82815260059290921b84018101918181019086841115610a9557600080fd5b8286015b84811015610ab757610aaa816109a7565b8352918301918301610a99565b509695505050505050565b803565ffffffffffff811681146109be57600080fd5b600080600060608486031215610aed57600080fd5b833567ffffffffffffffff80821115610b0557600080fd5b610b1187838801610a50565b9450602091508186013581811115610b2857600080fd5b610b3488828901610a50565b945050604086013581811115610b4957600080fd5b86019050601f81018713610b5c57600080fd5b8035610b6a610a7182610a2c565b81815260059190911b82018301908381019089831115610b8957600080fd5b928401925b82841015610bae57610b9f84610ac2565b82529284019290840190610b8e565b80955050505050509250925092565b600060208284031215610bcf57600080fd5b5035919050565b600080600060608486031215610beb57600080fd5b610bf4846109a7565b925060208401359150610c0960408501610ac2565b90509250925092565b634e487b7160e01b600052601160045260246000fd5b60008219821115610c3b57610c3b610c12565b500190565b6000816000190483118215151615610c5a57610c5a610c12565b500290565b634e487b7160e01b600052603260045260246000fd5b600060208284031215610c8757600080fd5b815160ff811681146109de57600080fd5b600060ff821660ff84168060ff03821115610cb557610cb5610c12565b019392505050565b600082821015610ccf57610ccf610c12565b500390565b600181815b80851115610d0f578160001904821115610cf557610cf5610c12565b80851615610d0257918102915b93841c9390800290610cd9565b509250929050565b600082610d2657506001610db4565b81610d3357506000610db4565b8160018114610d495760028114610d5357610d6f565b6001915050610db4565b60ff841115610d6457610d64610c12565b50506001821b610db4565b5060208310610133831016604e8410600b8410161715610d92575081810a610db4565b610d9c8383610cd4565b8060001904821115610db057610db0610c12565b0290505b92915050565b60006109de8383610d17565b600082610de357634e487b7160e01b600052601260045260246000fd5b500490565b600060018201610dfa57610dfa610c12565b5060010190565b600081518084526020808501945080840160005b83811015610e3a5781516001600160a01b031687529582019590820190600101610e15565b509495945050505050565b606081526000610e586060830186610e01565b602083820381850152610e6b8287610e01565b8481036040860152855180825282870193509082019060005b81811015610ea857845165ffffffffffff1683529383019391830191600101610e84565b509098975050505050505050565b805169ffffffffffffffffffff811681146109be57600080fd5b600080600080600060a08688031215610ee857600080fd5b610ef186610eb6565b9450602086015193506040860151925060608601519150610f1460808701610eb6565b9050929550929590935056fea2646970667358221220403a74eacf8d32a292bf06f7f0234ef3e81609bbeeaeed77655cdc31f31f076264736f6c634300080f00330000000000000000000000000000000000000000000000000000000000000080000000000000000000000000000000000000000000000000000000000000014000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000000e100000000000000000000000000000000000000000000000000000000000000005000000000000000000000000b0b195aefa3650a6908f15cdac7d92f8a5791b0b0000000000000000000000002791bca1f2de4661ed88a30c99a7a9449aa84174000000000000000000000000c2132d05d31c914a87c6611c10748aeb04b58e8f0000000000000000000000000d500b1d8e8ef31e21c99d1db9a6444d3adf12700000000000000000000000007ceb23fd6bc0add59e62ac25578270cff1b9f61900000000000000000000000000000000000000000000000000000000000000050000000000000000000000006f557f27da56a579218322478587c9aedb0bf9d4000000000000000000000000fe4a8cc5b5b2366c1b58bea3858e81843581b2f70000000000000000000000000a6513e40db6eb1b165753ad52e80663aea50545000000000000000000000000ab594600376ec9fd91f8e885dadf0ce036862de0000000000000000000000000f9680d99d6c9589e2a93a78a04a279e50920594500000000000000000000000000000000000000000000000000000000000000050000000000000000000000000000000000000000000000000000000000000e100000000000000000000000000000000000000000000000000000000000000e100000000000000000000000000000000000000000000000000000000000000e100000000000000000000000000000000000000000000000000000000000000e100000000000000000000000000000000000000000000000000000000000000e10
Deployed Bytecode
0x608060405234801561001057600080fd5b50600436106100b45760003560e01c80638da5cb5b116100715780638da5cb5b14610143578063a35f8f971461015e578063aea9107814610171578063c257cbd41461019b578063f2fde38b146101ae578063f3417e33146101c157600080fd5b8063180c9309146100b95780632e0f2625146100fc5780634079246514610112578063715018a61461011d5780637efcc3a21461012757806389200da114610130575b600080fd5b6100e76100c73660046109c3565b6001600160a01b0390811660009081526001602052604090205416151590565b60405190151581526020015b60405180910390f35b610104601281565b6040519081526020016100f3565b610104600160601b81565b610125610253565b005b61010460025481565b61012561013e366004610ad8565b610267565b6000546040516001600160a01b0390911681526020016100f3565b61012561016c366004610bbd565b61027f565b61018461017f3660046109c3565b6102c6565b6040805192151583526020830191909152016100f3565b6101256101a9366004610bd6565b6103ae565b6101256101bc3660046109c3565b61048d565b6102156101cf3660046109c3565b60016020819052600091825260409091208054918101546002909101546001600160a01b0383169265ffffffffffff600160a01b8204811693600160d01b909204169185565b604080516001600160a01b0396909616865265ffffffffffff948516602087015292909316918401919091526060830152608082015260a0016100f3565b61025b61050b565b6102656000610565565b565b61026f61050b565b61027a8383836105b5565b505050565b61028761050b565b6002819055604051818152339032907f3f288679c843d6cb6dcb4832b2eb4a01129596cb122587a096eee986684f875f9060200160405180910390a350565b6001600160a01b0380821660009081526001602052604081208054919283929081169065ffffffffffff600160a01b8204811691600160d01b90041684808461031a57506000988998509650505050505050565b610323856108cc565b9199509250905087158061034757504261034565ffffffffffff861683610c28565b105b1561038e576002546103619065ffffffffffff8516610c28565b421161037d576001866001015497509750505050505050915091565b506000988998509650505050505050565b6002860154600198506103a19083610c40565b9650505050505050915091565b6103b661050b565b428165ffffffffffff16106103cc575042610402565b426002548265ffffffffffff166103e39190610c28565b101561040257604051630ad461a960e21b815260040160405180910390fd5b6001600160a01b03831660008181526001602081815260409283902080546001600160d01b0316600160d01b65ffffffffffff881690810291909117825592810187905583519485529084018690529183015290339032907f0923c6decc7b82e47992aaaad6e4d444fbc38ef9eba8b7c83e3efe9e1806fde79060600160405180910390a350505050565b61049561050b565b6001600160a01b0381166104ff5760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b60648201526084015b60405180910390fd5b61050881610565565b50565b6000546001600160a01b031633146102655760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657260448201526064016104f6565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b815183511415806105c857508051825114155b156105e65760405163251f56a160e21b815260040160405180910390fd5b60005b835181101561088657600084828151811061060657610606610c5f565b60200260200101519050600084838151811061062457610624610c5f565b60200260200101519050600084848151811061064257610642610c5f565b602002602001015190506000829050600061065c826108cc565b505090508061067e57604051639589a27d60e01b815260040160405180910390fd5b6000846001600160a01b031663313ce5676040518163ffffffff1660e01b8152600401602060405180830381865afa1580156106be573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906106e29190610c75565b866001600160a01b031663313ce5676040518163ffffffff1660e01b8152600401602060405180830381865afa158015610720573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906107449190610c75565b61074e9190610c98565b60ff169050602c81111561077557604051631eead3f560e31b815260040160405180910390fd5b600081601211156107ac57600160601b610790836012610cbd565b61079b90600a610dba565b6107a59190610c40565b90506107d3565b6107b7601283610cbd565b6107c290600a610dba565b6107d090600160601b610dc6565b90505b6040805160a0810182526001600160a01b03958616815265ffffffffffff9687166020808301918252600083850181815260608501828152608086019788529c8a16825260019283905294902092518354925194518a16600160d01b026001600160d01b0395909a16600160a01b026001600160d01b03199093169816979097171791909116959095178555955192840192909255505091516002909201919091555061087f81610de8565b90506105e9565b50604051339032907f426dbe4a04e4106ef2c804dc24a80ee19f1f411909e7edf6c2a05c86951a98d1906108bf90879087908790610e45565b60405180910390a3505050565b6000806000836001600160a01b031663feaf968c6040518163ffffffff1660e01b815260040160a060405180830381865afa92505050801561092b575060408051601f3d908101601f1916820190925261092891810190610ed0565b60015b610970573d808015610959576040519150601f19603f3d011682016040523d82523d6000602084013e61095e565b606091505b506000806000935093509350506109a0565b6000841361098d57600080600097509750975050505050506109a0565b50600196509194509092506109a0915050565b9193909250565b80356001600160a01b03811681146109be57600080fd5b919050565b6000602082840312156109d557600080fd5b6109de826109a7565b9392505050565b634e487b7160e01b600052604160045260246000fd5b604051601f8201601f1916810167ffffffffffffffff81118282101715610a2457610a246109e5565b604052919050565b600067ffffffffffffffff821115610a4657610a466109e5565b5060051b60200190565b600082601f830112610a6157600080fd5b81356020610a76610a7183610a2c565b6109fb565b82815260059290921b84018101918181019086841115610a9557600080fd5b8286015b84811015610ab757610aaa816109a7565b8352918301918301610a99565b509695505050505050565b803565ffffffffffff811681146109be57600080fd5b600080600060608486031215610aed57600080fd5b833567ffffffffffffffff80821115610b0557600080fd5b610b1187838801610a50565b9450602091508186013581811115610b2857600080fd5b610b3488828901610a50565b945050604086013581811115610b4957600080fd5b86019050601f81018713610b5c57600080fd5b8035610b6a610a7182610a2c565b81815260059190911b82018301908381019089831115610b8957600080fd5b928401925b82841015610bae57610b9f84610ac2565b82529284019290840190610b8e565b80955050505050509250925092565b600060208284031215610bcf57600080fd5b5035919050565b600080600060608486031215610beb57600080fd5b610bf4846109a7565b925060208401359150610c0960408501610ac2565b90509250925092565b634e487b7160e01b600052601160045260246000fd5b60008219821115610c3b57610c3b610c12565b500190565b6000816000190483118215151615610c5a57610c5a610c12565b500290565b634e487b7160e01b600052603260045260246000fd5b600060208284031215610c8757600080fd5b815160ff811681146109de57600080fd5b600060ff821660ff84168060ff03821115610cb557610cb5610c12565b019392505050565b600082821015610ccf57610ccf610c12565b500390565b600181815b80851115610d0f578160001904821115610cf557610cf5610c12565b80851615610d0257918102915b93841c9390800290610cd9565b509250929050565b600082610d2657506001610db4565b81610d3357506000610db4565b8160018114610d495760028114610d5357610d6f565b6001915050610db4565b60ff841115610d6457610d64610c12565b50506001821b610db4565b5060208310610133831016604e8410600b8410161715610d92575081810a610db4565b610d9c8383610cd4565b8060001904821115610db057610db0610c12565b0290505b92915050565b60006109de8383610d17565b600082610de357634e487b7160e01b600052601260045260246000fd5b500490565b600060018201610dfa57610dfa610c12565b5060010190565b600081518084526020808501945080840160005b83811015610e3a5781516001600160a01b031687529582019590820190600101610e15565b509495945050505050565b606081526000610e586060830186610e01565b602083820381850152610e6b8287610e01565b8481036040860152855180825282870193509082019060005b81811015610ea857845165ffffffffffff1683529383019391830191600101610e84565b509098975050505050505050565b805169ffffffffffffffffffff811681146109be57600080fd5b600080600080600060a08688031215610ee857600080fd5b610ef186610eb6565b9450602086015193506040860151925060608601519150610f1460808701610eb6565b9050929550929590935056fea2646970667358221220403a74eacf8d32a292bf06f7f0234ef3e81609bbeeaeed77655cdc31f31f076264736f6c634300080f0033
Constructor Arguments (ABI-Encoded and is the last bytes of the Contract Creation Code above)
0000000000000000000000000000000000000000000000000000000000000080000000000000000000000000000000000000000000000000000000000000014000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000000e100000000000000000000000000000000000000000000000000000000000000005000000000000000000000000b0b195aefa3650a6908f15cdac7d92f8a5791b0b0000000000000000000000002791bca1f2de4661ed88a30c99a7a9449aa84174000000000000000000000000c2132d05d31c914a87c6611c10748aeb04b58e8f0000000000000000000000000d500b1d8e8ef31e21c99d1db9a6444d3adf12700000000000000000000000007ceb23fd6bc0add59e62ac25578270cff1b9f61900000000000000000000000000000000000000000000000000000000000000050000000000000000000000006f557f27da56a579218322478587c9aedb0bf9d4000000000000000000000000fe4a8cc5b5b2366c1b58bea3858e81843581b2f70000000000000000000000000a6513e40db6eb1b165753ad52e80663aea50545000000000000000000000000ab594600376ec9fd91f8e885dadf0ce036862de0000000000000000000000000f9680d99d6c9589e2a93a78a04a279e50920594500000000000000000000000000000000000000000000000000000000000000050000000000000000000000000000000000000000000000000000000000000e100000000000000000000000000000000000000000000000000000000000000e100000000000000000000000000000000000000000000000000000000000000e100000000000000000000000000000000000000000000000000000000000000e100000000000000000000000000000000000000000000000000000000000000e10
-----Decoded View---------------
Arg [0] : tokens (address[]): 0xB0B195aEFA3650A6908f15CdaC7D92F8a5791B0B,0x2791Bca1f2de4661ED88A30C99A7a9449Aa84174,0xc2132D05D31c914a87C6611C10748AEb04B58e8F,0x0d500B1d8E8eF31E21C99d1Db9A6444d3ADf1270,0x7ceB23fD6bC0adD59E62ac25578270cFf1b9f619
Arg [1] : oracles (address[]): 0x6F557f27Da56a579218322478587C9AEDB0bf9d4,0xfE4A8cc5b5B2366C1B58Bea3858e81843581b2F7,0x0A6513e40db6EB1b165753AD52E80663aeA50545,0xAB594600376Ec9fD91F8e885dADF0CE036862dE0,0xF9680D99D6C9589e2a93a78A04A279e509205945
Arg [2] : heartbeats (uint48[]): 3600,3600,3600,3600,3600
Arg [3] : validPeriod_ (uint256): 3600
-----Encoded View---------------
22 Constructor Arguments found :
Arg [0] : 0000000000000000000000000000000000000000000000000000000000000080
Arg [1] : 0000000000000000000000000000000000000000000000000000000000000140
Arg [2] : 0000000000000000000000000000000000000000000000000000000000000200
Arg [3] : 0000000000000000000000000000000000000000000000000000000000000e10
Arg [4] : 0000000000000000000000000000000000000000000000000000000000000005
Arg [5] : 000000000000000000000000b0b195aefa3650a6908f15cdac7d92f8a5791b0b
Arg [6] : 0000000000000000000000002791bca1f2de4661ed88a30c99a7a9449aa84174
Arg [7] : 000000000000000000000000c2132d05d31c914a87c6611c10748aeb04b58e8f
Arg [8] : 0000000000000000000000000d500b1d8e8ef31e21c99d1db9a6444d3adf1270
Arg [9] : 0000000000000000000000007ceb23fd6bc0add59e62ac25578270cff1b9f619
Arg [10] : 0000000000000000000000000000000000000000000000000000000000000005
Arg [11] : 0000000000000000000000006f557f27da56a579218322478587c9aedb0bf9d4
Arg [12] : 000000000000000000000000fe4a8cc5b5b2366c1b58bea3858e81843581b2f7
Arg [13] : 0000000000000000000000000a6513e40db6eb1b165753ad52e80663aea50545
Arg [14] : 000000000000000000000000ab594600376ec9fd91f8e885dadf0ce036862de0
Arg [15] : 000000000000000000000000f9680d99d6c9589e2a93a78a04a279e509205945
Arg [16] : 0000000000000000000000000000000000000000000000000000000000000005
Arg [17] : 0000000000000000000000000000000000000000000000000000000000000e10
Arg [18] : 0000000000000000000000000000000000000000000000000000000000000e10
Arg [19] : 0000000000000000000000000000000000000000000000000000000000000e10
Arg [20] : 0000000000000000000000000000000000000000000000000000000000000e10
Arg [21] : 0000000000000000000000000000000000000000000000000000000000000e10
Loading...
Loading
Loading...
Loading
Multichain Portfolio | 30 Chains
Chain | Token | Portfolio % | Price | Amount | Value |
---|
[ 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.