Overview
ETH Balance
0 ETH
ETH Value
$0.00More Info
Private Name Tags
ContractCreator
Transaction Hash |
Method
|
Block
|
From
|
To
|
|||||
---|---|---|---|---|---|---|---|---|---|
Latest 1 internal transaction
Advanced mode:
Parent Transaction Hash | Block | From | To | |||
---|---|---|---|---|---|---|
107520665 | 608 days ago | 0 ETH |
Loading...
Loading
Contract Name:
InternetBondRatioFeed_R3
Compiler Version
v0.8.6+commit.11564f7e
Optimization Enabled:
Yes with 200 runs
Other Settings:
berlin EvmVersion
Contract Source Code (Solidity Standard Json-Input format)
// SPDX-License-Identifier: GPL-3.0-only pragma solidity ^0.8.6; import "@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol"; import "../interfaces/IInternetBondRatioFeed.sol"; contract InternetBondRatioFeed_R3 is OwnableUpgradeable, IInternetBondRatioFeed { event OperatorAdded(address operator); event OperatorRemoved(address operator); event RatioUpdated(address indexed tokenAddress, uint256 oldRatio, uint256 newRatio); event RatioNotUpdated(address indexed tokenAddress, uint256 failedRatio, string reason); struct HistoricalRatios { uint64[9] historicalRatios; uint40 lastUpdate; } mapping(address => bool) _isOperator; mapping(address => uint256) private _ratios; mapping(address => HistoricalRatios) public historicalRatios; uint32 public constant MAX_THRESHOLD = uint32(1e8); // 100000000 /// @dev diff between the current ratio and a new one in %(0.000001 ... 100%) uint256 private _ratioThreshold; /// @dev use this instead of HistoricalRatios.lastUpdate to check for 12hr ratio update timeout mapping(address => uint256) private _ratioUpdates; function initialize(address operator) public initializer { __Ownable_init(); _isOperator[operator] = true; } function updateRatioBatch( address[] calldata addresses, uint256[] calldata ratios ) public override onlyOperator { require(addresses.length == ratios.length, "corrupted ratio data"); require(_ratioThreshold > 0, "ratio threshold is not set"); for (uint256 i = 0; i < addresses.length; i++) { address tokenAddr = addresses[i]; uint256 lastUpdate = _ratioUpdates[tokenAddr]; uint256 oldRatio = _ratios[tokenAddr]; uint256 newRatio = ratios[i]; (bool valid, string memory reason) = _checkRatioRules( lastUpdate, newRatio, oldRatio ); if(!valid) { emit RatioNotUpdated(tokenAddr, newRatio, reason); // continue to other ratios continue; } _ratios[tokenAddr] = newRatio; emit RatioUpdated(tokenAddr, oldRatio, newRatio); _ratioUpdates[tokenAddr] = uint40(block.timestamp); // let's compare with a new ratio HistoricalRatios storage hisRatio = historicalRatios[tokenAddr]; if (block.timestamp - hisRatio.lastUpdate > 1 days - 1 minutes) { uint64 latestOffset = hisRatio.historicalRatios[0]; hisRatio.historicalRatios[ ((latestOffset + 1) % 8) + 1 ] = uint64(newRatio); hisRatio.historicalRatios[0] = latestOffset + 1; hisRatio.lastUpdate = uint40(block.timestamp); } } } function getRatioThreshold() public view returns (uint256) { return _ratioThreshold; } function _checkRatioRules( uint256 lastUpdated, uint256 newRatio, uint256 oldRatio ) internal view returns (bool valid, string memory reason) { // initialization of the first ratio -> skip checks if (oldRatio == 0) { return (valid = true, reason); } if (block.timestamp - lastUpdated < 12 hours) { // valid == false return (valid, reason = "ratio was updated less than 12 hours ago"); } // new ratio should be not greater than a previous one if (newRatio > oldRatio) { // valid == false return (valid, reason = "new ratio cannot be greater than old"); } // new ratio should be in the range (oldRatio - threshold , oldRatio] uint256 threshold = (oldRatio * _ratioThreshold) / MAX_THRESHOLD; if (newRatio < oldRatio - threshold) { // valid == false return (valid, reason = "new ratio too low, not in threshold range"); } return (valid = true, reason); } function averagePercentageRate( address addr, uint256 day ) external view returns (uint256) { require(day > 0 && day < 8, "day should be from 1 to 7"); HistoricalRatios storage hisRatio = historicalRatios[addr]; uint64 latestOffset = hisRatio.historicalRatios[0]; uint256 oldestRatio = hisRatio.historicalRatios[ ((latestOffset - day) % 8) + 1 ]; uint256 newestRatio = hisRatio.historicalRatios[ ((latestOffset) % 8) + 1 ]; if (oldestRatio < newestRatio) { return 0; } return ((oldestRatio - newestRatio) * 10 ** 20 * 365) / (oldestRatio * (day)); } function repairRatioFor(address token, uint256 ratio) public onlyOwner { require(ratio != 0, "ratio is zero"); uint256 oldRatio = _ratios[token]; _ratios[token] = ratio; emit RatioUpdated(token, oldRatio, ratio); } function getRatioFor(address token) public view override returns (uint256) { return _ratios[token]; } function addOperator(address operator) public onlyOwner { require(operator != address(0x0), "operator must be non-zero"); require(!_isOperator[operator], "already operator"); _isOperator[operator] = true; emit OperatorAdded(operator); } function removeOperator(address operator) public onlyOwner { require(_isOperator[operator], "not an operator"); delete _isOperator[operator]; emit OperatorRemoved(operator); } function setRatioThreshold(uint256 newValue) public onlyOwner { require( newValue < MAX_THRESHOLD && newValue > 0, "wrong value for ratio threshold" ); uint256 oldValue = _ratioThreshold; _ratioThreshold = newValue; emit RatioThresholdChanged(oldValue, newValue); } modifier onlyOperator() { require( msg.sender == owner() || _isOperator[msg.sender], "Operator: not allowed" ); _; } }
// SPDX-License-Identifier: GPL-3.0-only pragma solidity ^0.8.6; interface IInternetBondRatioFeed { event RatioThresholdChanged(uint256 oldValue, uint256 newValue); function updateRatioBatch( address[] calldata addresses, uint256[] calldata ratios ) external; function getRatioFor(address) external view returns (uint256); }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (utils/Context.sol) pragma solidity ^0.8.0; import "../proxy/utils/Initializable.sol"; /** * @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 ContextUpgradeable is Initializable { function __Context_init() internal onlyInitializing { } function __Context_init_unchained() internal onlyInitializing { } function _msgSender() internal view virtual returns (address) { return msg.sender; } function _msgData() internal view virtual returns (bytes calldata) { return msg.data; } /** * @dev This empty reserved space is put in place to allow future versions to add new * variables without shifting down storage in the inheritance chain. * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps */ uint256[50] private __gap; }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.8.0) (utils/Address.sol) pragma solidity ^0.8.1; /** * @dev Collection of functions related to the address type */ library AddressUpgradeable { /** * @dev Returns true if `account` is a contract. * * [IMPORTANT] * ==== * It is unsafe to assume that an address for which this function returns * false is an externally-owned account (EOA) and not a contract. * * Among others, `isContract` will return false for the following * types of addresses: * * - an externally-owned account * - a contract in construction * - an address where a contract will be created * - an address where a contract lived, but was destroyed * ==== * * [IMPORTANT] * ==== * You shouldn't rely on `isContract` to protect against flash loan attacks! * * Preventing calls from contracts is highly discouraged. It breaks composability, breaks support for smart wallets * like Gnosis Safe, and does not provide security since it can be circumvented by calling from a contract * constructor. * ==== */ function isContract(address account) internal view returns (bool) { // This method relies on extcodesize/address.code.length, which returns 0 // for contracts in construction, since the code is only stored at the end // of the constructor execution. return account.code.length > 0; } /** * @dev Replacement for Solidity's `transfer`: sends `amount` wei to * `recipient`, forwarding all available gas and reverting on errors. * * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost * of certain opcodes, possibly making contracts go over the 2300 gas limit * imposed by `transfer`, making them unable to receive funds via * `transfer`. {sendValue} removes this limitation. * * https://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more]. * * IMPORTANT: because control is transferred to `recipient`, care must be * taken to not create reentrancy vulnerabilities. Consider using * {ReentrancyGuard} or the * https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern]. */ function sendValue(address payable recipient, uint256 amount) internal { require(address(this).balance >= amount, "Address: insufficient balance"); (bool success, ) = recipient.call{value: amount}(""); require(success, "Address: unable to send value, recipient may have reverted"); } /** * @dev Performs a Solidity function call using a low level `call`. A * plain `call` is an unsafe replacement for a function call: use this * function instead. * * If `target` reverts with a revert reason, it is bubbled up by this * function (like regular Solidity function calls). * * Returns the raw returned data. To convert to the expected return value, * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`]. * * Requirements: * * - `target` must be a contract. * - calling `target` with `data` must not revert. * * _Available since v3.1._ */ function functionCall(address target, bytes memory data) internal returns (bytes memory) { return functionCallWithValue(target, data, 0, "Address: low-level call failed"); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with * `errorMessage` as a fallback revert reason when `target` reverts. * * _Available since v3.1._ */ function functionCall( address target, bytes memory data, string memory errorMessage ) internal returns (bytes memory) { return functionCallWithValue(target, data, 0, errorMessage); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], * but also transferring `value` wei to `target`. * * Requirements: * * - the calling contract must have an ETH balance of at least `value`. * - the called Solidity function must be `payable`. * * _Available since v3.1._ */ function functionCallWithValue( address target, bytes memory data, uint256 value ) internal returns (bytes memory) { return functionCallWithValue(target, data, value, "Address: low-level call with value failed"); } /** * @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but * with `errorMessage` as a fallback revert reason when `target` reverts. * * _Available since v3.1._ */ function functionCallWithValue( address target, bytes memory data, uint256 value, string memory errorMessage ) internal returns (bytes memory) { require(address(this).balance >= value, "Address: insufficient balance for call"); (bool success, bytes memory returndata) = target.call{value: value}(data); return verifyCallResultFromTarget(target, success, returndata, errorMessage); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], * but performing a static call. * * _Available since v3.3._ */ function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) { return functionStaticCall(target, data, "Address: low-level static call failed"); } /** * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`], * but performing a static call. * * _Available since v3.3._ */ function functionStaticCall( address target, bytes memory data, string memory errorMessage ) internal view returns (bytes memory) { (bool success, bytes memory returndata) = target.staticcall(data); return verifyCallResultFromTarget(target, success, returndata, errorMessage); } /** * @dev Tool to verify that a low level call to smart-contract was successful, and revert (either by bubbling * the revert reason or using the provided one) in case of unsuccessful call or if target was not a contract. * * _Available since v4.8._ */ function verifyCallResultFromTarget( address target, bool success, bytes memory returndata, string memory errorMessage ) internal view returns (bytes memory) { if (success) { if (returndata.length == 0) { // only check isContract if the call was successful and the return data is empty // otherwise we already know that it was a contract require(isContract(target), "Address: call to non-contract"); } return returndata; } else { _revert(returndata, errorMessage); } } /** * @dev Tool to verify that a low level call was successful, and revert if it wasn't, either by bubbling the * revert reason or using the provided one. * * _Available since v4.3._ */ function verifyCallResult( bool success, bytes memory returndata, string memory errorMessage ) internal pure returns (bytes memory) { if (success) { return returndata; } else { _revert(returndata, errorMessage); } } function _revert(bytes memory returndata, string memory errorMessage) private pure { // Look for revert reason and bubble it up if present if (returndata.length > 0) { // The easiest way to bubble the revert reason is using memory via assembly /// @solidity memory-safe-assembly assembly { let returndata_size := mload(returndata) revert(add(32, returndata), returndata_size) } } else { revert(errorMessage); } } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.8.1) (proxy/utils/Initializable.sol) pragma solidity ^0.8.2; import "../../utils/AddressUpgradeable.sol"; /** * @dev This is a base contract to aid in writing upgradeable contracts, or any kind of contract that will be deployed * behind a proxy. Since proxied contracts do not make use of a constructor, it's common to move constructor logic to an * external initializer function, usually called `initialize`. It then becomes necessary to protect this initializer * function so it can only be called once. The {initializer} modifier provided by this contract will have this effect. * * The initialization functions use a version number. Once a version number is used, it is consumed and cannot be * reused. This mechanism prevents re-execution of each "step" but allows the creation of new initialization steps in * case an upgrade adds a module that needs to be initialized. * * For example: * * [.hljs-theme-light.nopadding] * ``` * contract MyToken is ERC20Upgradeable { * function initialize() initializer public { * __ERC20_init("MyToken", "MTK"); * } * } * contract MyTokenV2 is MyToken, ERC20PermitUpgradeable { * function initializeV2() reinitializer(2) public { * __ERC20Permit_init("MyToken"); * } * } * ``` * * TIP: To avoid leaving the proxy in an uninitialized state, the initializer function should be called as early as * possible by providing the encoded function call as the `_data` argument to {ERC1967Proxy-constructor}. * * CAUTION: When used with inheritance, manual care must be taken to not invoke a parent initializer twice, or to ensure * that all initializers are idempotent. This is not verified automatically as constructors are by Solidity. * * [CAUTION] * ==== * Avoid leaving a contract uninitialized. * * An uninitialized contract can be taken over by an attacker. This applies to both a proxy and its implementation * contract, which may impact the proxy. To prevent the implementation contract from being used, you should invoke * the {_disableInitializers} function in the constructor to automatically lock it when it is deployed: * * [.hljs-theme-light.nopadding] * ``` * /// @custom:oz-upgrades-unsafe-allow constructor * constructor() { * _disableInitializers(); * } * ``` * ==== */ abstract contract Initializable { /** * @dev Indicates that the contract has been initialized. * @custom:oz-retyped-from bool */ uint8 private _initialized; /** * @dev Indicates that the contract is in the process of being initialized. */ bool private _initializing; /** * @dev Triggered when the contract has been initialized or reinitialized. */ event Initialized(uint8 version); /** * @dev A modifier that defines a protected initializer function that can be invoked at most once. In its scope, * `onlyInitializing` functions can be used to initialize parent contracts. * * Similar to `reinitializer(1)`, except that functions marked with `initializer` can be nested in the context of a * constructor. * * Emits an {Initialized} event. */ modifier initializer() { bool isTopLevelCall = !_initializing; require( (isTopLevelCall && _initialized < 1) || (!AddressUpgradeable.isContract(address(this)) && _initialized == 1), "Initializable: contract is already initialized" ); _initialized = 1; if (isTopLevelCall) { _initializing = true; } _; if (isTopLevelCall) { _initializing = false; emit Initialized(1); } } /** * @dev A modifier that defines a protected reinitializer function that can be invoked at most once, and only if the * contract hasn't been initialized to a greater version before. In its scope, `onlyInitializing` functions can be * used to initialize parent contracts. * * A reinitializer may be used after the original initialization step. This is essential to configure modules that * are added through upgrades and that require initialization. * * When `version` is 1, this modifier is similar to `initializer`, except that functions marked with `reinitializer` * cannot be nested. If one is invoked in the context of another, execution will revert. * * Note that versions can jump in increments greater than 1; this implies that if multiple reinitializers coexist in * a contract, executing them in the right order is up to the developer or operator. * * WARNING: setting the version to 255 will prevent any future reinitialization. * * Emits an {Initialized} event. */ modifier reinitializer(uint8 version) { require(!_initializing && _initialized < version, "Initializable: contract is already initialized"); _initialized = version; _initializing = true; _; _initializing = false; emit Initialized(version); } /** * @dev Modifier to protect an initialization function so that it can only be invoked by functions with the * {initializer} and {reinitializer} modifiers, directly or indirectly. */ modifier onlyInitializing() { require(_initializing, "Initializable: contract is not initializing"); _; } /** * @dev Locks the contract, preventing any future reinitialization. This cannot be part of an initializer call. * Calling this in the constructor of a contract will prevent that contract from being initialized or reinitialized * to any version. It is recommended to use this to lock implementation contracts that are designed to be called * through proxies. * * Emits an {Initialized} event the first time it is successfully executed. */ function _disableInitializers() internal virtual { require(!_initializing, "Initializable: contract is initializing"); if (_initialized < type(uint8).max) { _initialized = type(uint8).max; emit Initialized(type(uint8).max); } } /** * @dev Returns the highest version that has been initialized. See {reinitializer}. */ function _getInitializedVersion() internal view returns (uint8) { return _initialized; } /** * @dev Returns `true` if the contract is currently initializing. See {onlyInitializing}. */ function _isInitializing() internal view returns (bool) { return _initializing; } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.7.0) (access/Ownable.sol) pragma solidity ^0.8.0; import "../utils/ContextUpgradeable.sol"; import "../proxy/utils/Initializable.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 OwnableUpgradeable is Initializable, ContextUpgradeable { address private _owner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); /** * @dev Initializes the contract setting the deployer as the initial owner. */ function __Ownable_init() internal onlyInitializing { __Ownable_init_unchained(); } function __Ownable_init_unchained() internal onlyInitializing { _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 anymore. Can only be called by the current owner. * * NOTE: Renouncing ownership will leave the contract without an owner, * thereby removing any functionality that is only available to the owner. */ function renounceOwnership() public virtual onlyOwner { _transferOwnership(address(0)); } /** * @dev Transfers ownership of the contract to a new account (`newOwner`). * Can only be called by the current owner. */ function transferOwnership(address newOwner) public virtual onlyOwner { require(newOwner != address(0), "Ownable: new owner is the zero address"); _transferOwnership(newOwner); } /** * @dev Transfers ownership of the contract to a new account (`newOwner`). * Internal function without access restriction. */ function _transferOwnership(address newOwner) internal virtual { address oldOwner = _owner; _owner = newOwner; emit OwnershipTransferred(oldOwner, newOwner); } /** * @dev This empty reserved space is put in place to allow future versions to add new * variables without shifting down storage in the inheritance chain. * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps */ uint256[49] private __gap; }
{ "remappings": [], "optimizer": { "enabled": true, "runs": 200 }, "evmVersion": "berlin", "libraries": {}, "outputSelection": { "*": { "*": [ "evm.bytecode", "evm.deployedBytecode", "devdoc", "userdoc", "metadata", "abi" ] } } }
Contract Security Audit
- No Contract Security Audit Submitted- Submit Audit Here
Contract ABI
API[{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint8","name":"version","type":"uint8"}],"name":"Initialized","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"operator","type":"address"}],"name":"OperatorAdded","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"operator","type":"address"}],"name":"OperatorRemoved","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":"tokenAddress","type":"address"},{"indexed":false,"internalType":"uint256","name":"failedRatio","type":"uint256"},{"indexed":false,"internalType":"string","name":"reason","type":"string"}],"name":"RatioNotUpdated","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"oldValue","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"newValue","type":"uint256"}],"name":"RatioThresholdChanged","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"tokenAddress","type":"address"},{"indexed":false,"internalType":"uint256","name":"oldRatio","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"newRatio","type":"uint256"}],"name":"RatioUpdated","type":"event"},{"inputs":[],"name":"MAX_THRESHOLD","outputs":[{"internalType":"uint32","name":"","type":"uint32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"operator","type":"address"}],"name":"addOperator","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"addr","type":"address"},{"internalType":"uint256","name":"day","type":"uint256"}],"name":"averagePercentageRate","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"token","type":"address"}],"name":"getRatioFor","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getRatioThreshold","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"historicalRatios","outputs":[{"internalType":"uint40","name":"lastUpdate","type":"uint40"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"operator","type":"address"}],"name":"initialize","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"operator","type":"address"}],"name":"removeOperator","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"token","type":"address"},{"internalType":"uint256","name":"ratio","type":"uint256"}],"name":"repairRatioFor","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"newValue","type":"uint256"}],"name":"setRatioThreshold","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address[]","name":"addresses","type":"address[]"},{"internalType":"uint256[]","name":"ratios","type":"uint256[]"}],"name":"updateRatioBatch","outputs":[],"stateMutability":"nonpayable","type":"function"}]
Contract Creation Code
608060405234801561001057600080fd5b506111ac806100206000396000f3fe608060405234801561001057600080fd5b50600436106100ea5760003560e01c8063a1f1d48d1161008c578063ba34fa0511610066578063ba34fa05146101e2578063c4d66de8146101ea578063ec653c4b146101fd578063f2fde38b1461023d57600080fd5b8063a1f1d48d14610193578063ac8a584a146101bc578063b037d56a146101cf57600080fd5b80632ef86a1f116100c85780632ef86a1f1461014a578063715018a61461015d5780638da5cb5b146101655780639870d7fe1461018057600080fd5b806308af5431146100ef5780632364753a146101145780632acaaff414610129575b600080fd5b6100fa6305f5e10081565b60405163ffffffff90911681526020015b60405180910390f35b610127610122366004610f1c565b610250565b005b61013c610137366004610e87565b610302565b60405190815260200161010b565b610127610158366004610e87565b610498565b61012761053c565b6033546040516001600160a01b03909116815260200161010b565b61012761018e366004610e65565b610550565b61013c6101a1366004610e65565b6001600160a01b031660009081526066602052604090205490565b6101276101ca366004610e65565b610665565b6101276101dd366004610eb1565b610718565b60685461013c565b6101276101f8366004610e65565b610a76565b61022761020b366004610e65565b60676020526000908152604090206003015464ffffffffff1681565b60405164ffffffffff909116815260200161010b565b61012761024b366004610e65565b610ba7565b610258610c20565b6305f5e1008110801561026b5750600081115b6102bc5760405162461bcd60e51b815260206004820152601f60248201527f77726f6e672076616c756520666f7220726174696f207468726573686f6c640060448201526064015b60405180910390fd5b606880549082905560408051828152602081018490527f661e4cadf2d36ec16a59d60dcfeebe23f9be2aec99852725798a4be99790840e91015b60405180910390a15050565b600080821180156103135750600882105b61035f5760405162461bcd60e51b815260206004820152601960248201527f6461792073686f756c642062652066726f6d203120746f20370000000000000060448201526064016102b3565b6001600160a01b0383166000908152606760205260408120805490916001600160401b03909116908260086103948785611053565b61039e9190611085565b6103a9906001610fdd565b600981106103b9576103b96110eb565b60048104909101546001600160401b036008600390931683026101000a90910416915060009084906103eb9085611099565b6103f6906001610ff5565b6001600160401b03166009811061040f5761040f6110eb565b600491828204019190066008029054906101000a90046001600160401b03166001600160401b031690508082101561044e576000945050505050610492565b6104588683611034565b6104628284611053565b6104759068056bc75e2d63100000611034565b6104819061016d611034565b61048b9190611020565b9450505050505b92915050565b6104a0610c20565b806104dd5760405162461bcd60e51b815260206004820152600d60248201526c726174696f206973207a65726f60981b60448201526064016102b3565b6001600160a01b038216600081815260666020908152604091829020805490859055825181815291820185905292917f4c5c23b4efbfea6d16c8453f565e165a02a22cda9a8dc7aac0a66f91d2304da6910160405180910390a2505050565b610544610c20565b61054e6000610c7a565b565b610558610c20565b6001600160a01b0381166105ae5760405162461bcd60e51b815260206004820152601960248201527f6f70657261746f72206d757374206265206e6f6e2d7a65726f0000000000000060448201526064016102b3565b6001600160a01b03811660009081526065602052604090205460ff161561060a5760405162461bcd60e51b815260206004820152601060248201526f30b63932b0b23c9037b832b930ba37b960811b60448201526064016102b3565b6001600160a01b038116600081815260656020908152604091829020805460ff1916600117905590519182527fac6fa858e9350a46cec16539926e0fde25b7629f84b5a72bffaae4df888ae86d91015b60405180910390a150565b61066d610c20565b6001600160a01b03811660009081526065602052604090205460ff166106c75760405162461bcd60e51b815260206004820152600f60248201526e3737ba1030b71037b832b930ba37b960891b60448201526064016102b3565b6001600160a01b038116600081815260656020908152604091829020805460ff1916905590519182527f80c0b871b97b595b16a7741c1b06fed0c6f6f558639f18ccbce50724325dc40d910161065a565b6033546001600160a01b031633148061074057503360009081526065602052604090205460ff165b6107845760405162461bcd60e51b815260206004820152601560248201527413dc195c985d1bdc8e881b9bdd08185b1b1bddd959605a1b60448201526064016102b3565b8281146107ca5760405162461bcd60e51b8152602060048201526014602482015273636f7272757074656420726174696f206461746160601b60448201526064016102b3565b60006068541161081c5760405162461bcd60e51b815260206004820152601a60248201527f726174696f207468726573686f6c64206973206e6f742073657400000000000060448201526064016102b3565b60005b83811015610a6f57600085858381811061083b5761083b6110eb565b90506020020160208101906108509190610e65565b6001600160a01b0381166000908152606960209081526040808320546066909252822054929350919086868681811061088b5761088b6110eb565b9050602002013590506000806108a2858486610ccc565b91509150816108f957856001600160a01b03167f2471a7627ad27128888e46dfc72f5d674c7156d6e99c969a675492a558a0b0e084836040516108e6929190610f80565b60405180910390a2505050505050610a5d565b6001600160a01b03861660008181526066602090815260409182902086905581518781529081018690527f4c5c23b4efbfea6d16c8453f565e165a02a22cda9a8dc7aac0a66f91d2304da6910160405180910390a26001600160a01b038616600090815260696020908152604080832064ffffffffff4281811690925560679093529220600381015490926201514492610994921690611053565b1115610a555780546001600160401b0316848260086109b4846001610ff5565b6109be9190611099565b6109c9906001610ff5565b6001600160401b0316600981106109e2576109e26110eb565b600491828204019190066008026101000a8154816001600160401b0302191690836001600160401b03160217905550806001610a1e9190610ff5565b825467ffffffffffffffff19166001600160401b03919091161782555060038101805464ffffffffff19164264ffffffffff161790555b505050505050505b80610a678161106a565b91505061081f565b5050505050565b600054610100900460ff1615808015610a965750600054600160ff909116105b80610ab05750303b158015610ab0575060005460ff166001145b610b135760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201526d191e481a5b9a5d1a585b1a5e995960921b60648201526084016102b3565b6000805460ff191660011790558015610b36576000805461ff0019166101001790555b610b3e610da4565b6001600160a01b0382166000908152606560205260409020805460ff191660011790558015610ba3576000805461ff0019169055604051600181527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb3847402498906020016102f6565b5050565b610baf610c20565b6001600160a01b038116610c145760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b60648201526084016102b3565b610c1d81610c7a565b50565b6033546001600160a01b0316331461054e5760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657260448201526064016102b3565b603380546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b6000606082610cde5760019150610d9c565b61a8c0610ceb8642611053565b1015610d1457816040518060600160405280602881526020016111026028913991509150610d9c565b82841115610d3f578160405180606001604052806024815260200161112a6024913991509150610d9c565b6068546000906305f5e10090610d559086611034565b610d5f9190611020565b9050610d6b8185611053565b851015610d96578260405180606001604052806029815260200161114e602991399250925050610d9c565b60019250505b935093915050565b600054610100900460ff16610dcb5760405162461bcd60e51b81526004016102b390610f35565b61054e600054610100900460ff16610df55760405162461bcd60e51b81526004016102b390610f35565b61054e33610c7a565b80356001600160a01b0381168114610e1557600080fd5b919050565b60008083601f840112610e2c57600080fd5b5081356001600160401b03811115610e4357600080fd5b6020830191508360208260051b8501011115610e5e57600080fd5b9250929050565b600060208284031215610e7757600080fd5b610e8082610dfe565b9392505050565b60008060408385031215610e9a57600080fd5b610ea383610dfe565b946020939093013593505050565b60008060008060408587031215610ec757600080fd5b84356001600160401b0380821115610ede57600080fd5b610eea88838901610e1a565b90965094506020870135915080821115610f0357600080fd5b50610f1087828801610e1a565b95989497509550505050565b600060208284031215610f2e57600080fd5b5035919050565b6020808252602b908201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960408201526a6e697469616c697a696e6760a81b606082015260800190565b82815260006020604081840152835180604085015260005b81811015610fb457858101830151858201606001528201610f98565b81811115610fc6576000606083870101525b50601f01601f191692909201606001949350505050565b60008219821115610ff057610ff06110bf565b500190565b60006001600160401b03808316818516808303821115611017576110176110bf565b01949350505050565b60008261102f5761102f6110d5565b500490565b600081600019048311821515161561104e5761104e6110bf565b500290565b600082821015611065576110656110bf565b500390565b600060001982141561107e5761107e6110bf565b5060010190565b600082611094576110946110d5565b500690565b60006001600160401b03808416806110b3576110b36110d5565b92169190910692915050565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052601260045260246000fd5b634e487b7160e01b600052603260045260246000fdfe726174696f207761732075706461746564206c657373207468616e20313220686f7572732061676f6e657720726174696f2063616e6e6f742062652067726561746572207468616e206f6c646e657720726174696f20746f6f206c6f772c206e6f7420696e207468726573686f6c642072616e6765a2646970667358221220c093267ab1730284165a08fbb90d76588354bc3febd59bd475b8fe02059a14a464736f6c63430008060033
Deployed Bytecode
0x608060405234801561001057600080fd5b50600436106100ea5760003560e01c8063a1f1d48d1161008c578063ba34fa0511610066578063ba34fa05146101e2578063c4d66de8146101ea578063ec653c4b146101fd578063f2fde38b1461023d57600080fd5b8063a1f1d48d14610193578063ac8a584a146101bc578063b037d56a146101cf57600080fd5b80632ef86a1f116100c85780632ef86a1f1461014a578063715018a61461015d5780638da5cb5b146101655780639870d7fe1461018057600080fd5b806308af5431146100ef5780632364753a146101145780632acaaff414610129575b600080fd5b6100fa6305f5e10081565b60405163ffffffff90911681526020015b60405180910390f35b610127610122366004610f1c565b610250565b005b61013c610137366004610e87565b610302565b60405190815260200161010b565b610127610158366004610e87565b610498565b61012761053c565b6033546040516001600160a01b03909116815260200161010b565b61012761018e366004610e65565b610550565b61013c6101a1366004610e65565b6001600160a01b031660009081526066602052604090205490565b6101276101ca366004610e65565b610665565b6101276101dd366004610eb1565b610718565b60685461013c565b6101276101f8366004610e65565b610a76565b61022761020b366004610e65565b60676020526000908152604090206003015464ffffffffff1681565b60405164ffffffffff909116815260200161010b565b61012761024b366004610e65565b610ba7565b610258610c20565b6305f5e1008110801561026b5750600081115b6102bc5760405162461bcd60e51b815260206004820152601f60248201527f77726f6e672076616c756520666f7220726174696f207468726573686f6c640060448201526064015b60405180910390fd5b606880549082905560408051828152602081018490527f661e4cadf2d36ec16a59d60dcfeebe23f9be2aec99852725798a4be99790840e91015b60405180910390a15050565b600080821180156103135750600882105b61035f5760405162461bcd60e51b815260206004820152601960248201527f6461792073686f756c642062652066726f6d203120746f20370000000000000060448201526064016102b3565b6001600160a01b0383166000908152606760205260408120805490916001600160401b03909116908260086103948785611053565b61039e9190611085565b6103a9906001610fdd565b600981106103b9576103b96110eb565b60048104909101546001600160401b036008600390931683026101000a90910416915060009084906103eb9085611099565b6103f6906001610ff5565b6001600160401b03166009811061040f5761040f6110eb565b600491828204019190066008029054906101000a90046001600160401b03166001600160401b031690508082101561044e576000945050505050610492565b6104588683611034565b6104628284611053565b6104759068056bc75e2d63100000611034565b6104819061016d611034565b61048b9190611020565b9450505050505b92915050565b6104a0610c20565b806104dd5760405162461bcd60e51b815260206004820152600d60248201526c726174696f206973207a65726f60981b60448201526064016102b3565b6001600160a01b038216600081815260666020908152604091829020805490859055825181815291820185905292917f4c5c23b4efbfea6d16c8453f565e165a02a22cda9a8dc7aac0a66f91d2304da6910160405180910390a2505050565b610544610c20565b61054e6000610c7a565b565b610558610c20565b6001600160a01b0381166105ae5760405162461bcd60e51b815260206004820152601960248201527f6f70657261746f72206d757374206265206e6f6e2d7a65726f0000000000000060448201526064016102b3565b6001600160a01b03811660009081526065602052604090205460ff161561060a5760405162461bcd60e51b815260206004820152601060248201526f30b63932b0b23c9037b832b930ba37b960811b60448201526064016102b3565b6001600160a01b038116600081815260656020908152604091829020805460ff1916600117905590519182527fac6fa858e9350a46cec16539926e0fde25b7629f84b5a72bffaae4df888ae86d91015b60405180910390a150565b61066d610c20565b6001600160a01b03811660009081526065602052604090205460ff166106c75760405162461bcd60e51b815260206004820152600f60248201526e3737ba1030b71037b832b930ba37b960891b60448201526064016102b3565b6001600160a01b038116600081815260656020908152604091829020805460ff1916905590519182527f80c0b871b97b595b16a7741c1b06fed0c6f6f558639f18ccbce50724325dc40d910161065a565b6033546001600160a01b031633148061074057503360009081526065602052604090205460ff165b6107845760405162461bcd60e51b815260206004820152601560248201527413dc195c985d1bdc8e881b9bdd08185b1b1bddd959605a1b60448201526064016102b3565b8281146107ca5760405162461bcd60e51b8152602060048201526014602482015273636f7272757074656420726174696f206461746160601b60448201526064016102b3565b60006068541161081c5760405162461bcd60e51b815260206004820152601a60248201527f726174696f207468726573686f6c64206973206e6f742073657400000000000060448201526064016102b3565b60005b83811015610a6f57600085858381811061083b5761083b6110eb565b90506020020160208101906108509190610e65565b6001600160a01b0381166000908152606960209081526040808320546066909252822054929350919086868681811061088b5761088b6110eb565b9050602002013590506000806108a2858486610ccc565b91509150816108f957856001600160a01b03167f2471a7627ad27128888e46dfc72f5d674c7156d6e99c969a675492a558a0b0e084836040516108e6929190610f80565b60405180910390a2505050505050610a5d565b6001600160a01b03861660008181526066602090815260409182902086905581518781529081018690527f4c5c23b4efbfea6d16c8453f565e165a02a22cda9a8dc7aac0a66f91d2304da6910160405180910390a26001600160a01b038616600090815260696020908152604080832064ffffffffff4281811690925560679093529220600381015490926201514492610994921690611053565b1115610a555780546001600160401b0316848260086109b4846001610ff5565b6109be9190611099565b6109c9906001610ff5565b6001600160401b0316600981106109e2576109e26110eb565b600491828204019190066008026101000a8154816001600160401b0302191690836001600160401b03160217905550806001610a1e9190610ff5565b825467ffffffffffffffff19166001600160401b03919091161782555060038101805464ffffffffff19164264ffffffffff161790555b505050505050505b80610a678161106a565b91505061081f565b5050505050565b600054610100900460ff1615808015610a965750600054600160ff909116105b80610ab05750303b158015610ab0575060005460ff166001145b610b135760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201526d191e481a5b9a5d1a585b1a5e995960921b60648201526084016102b3565b6000805460ff191660011790558015610b36576000805461ff0019166101001790555b610b3e610da4565b6001600160a01b0382166000908152606560205260409020805460ff191660011790558015610ba3576000805461ff0019169055604051600181527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb3847402498906020016102f6565b5050565b610baf610c20565b6001600160a01b038116610c145760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b60648201526084016102b3565b610c1d81610c7a565b50565b6033546001600160a01b0316331461054e5760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657260448201526064016102b3565b603380546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b6000606082610cde5760019150610d9c565b61a8c0610ceb8642611053565b1015610d1457816040518060600160405280602881526020016111026028913991509150610d9c565b82841115610d3f578160405180606001604052806024815260200161112a6024913991509150610d9c565b6068546000906305f5e10090610d559086611034565b610d5f9190611020565b9050610d6b8185611053565b851015610d96578260405180606001604052806029815260200161114e602991399250925050610d9c565b60019250505b935093915050565b600054610100900460ff16610dcb5760405162461bcd60e51b81526004016102b390610f35565b61054e600054610100900460ff16610df55760405162461bcd60e51b81526004016102b390610f35565b61054e33610c7a565b80356001600160a01b0381168114610e1557600080fd5b919050565b60008083601f840112610e2c57600080fd5b5081356001600160401b03811115610e4357600080fd5b6020830191508360208260051b8501011115610e5e57600080fd5b9250929050565b600060208284031215610e7757600080fd5b610e8082610dfe565b9392505050565b60008060408385031215610e9a57600080fd5b610ea383610dfe565b946020939093013593505050565b60008060008060408587031215610ec757600080fd5b84356001600160401b0380821115610ede57600080fd5b610eea88838901610e1a565b90965094506020870135915080821115610f0357600080fd5b50610f1087828801610e1a565b95989497509550505050565b600060208284031215610f2e57600080fd5b5035919050565b6020808252602b908201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960408201526a6e697469616c697a696e6760a81b606082015260800190565b82815260006020604081840152835180604085015260005b81811015610fb457858101830151858201606001528201610f98565b81811115610fc6576000606083870101525b50601f01601f191692909201606001949350505050565b60008219821115610ff057610ff06110bf565b500190565b60006001600160401b03808316818516808303821115611017576110176110bf565b01949350505050565b60008261102f5761102f6110d5565b500490565b600081600019048311821515161561104e5761104e6110bf565b500290565b600082821015611065576110656110bf565b500390565b600060001982141561107e5761107e6110bf565b5060010190565b600082611094576110946110d5565b500690565b60006001600160401b03808416806110b3576110b36110d5565b92169190910692915050565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052601260045260246000fd5b634e487b7160e01b600052603260045260246000fdfe726174696f207761732075706461746564206c657373207468616e20313220686f7572732061676f6e657720726174696f2063616e6e6f742062652067726561746572207468616e206f6c646e657720726174696f20746f6f206c6f772c206e6f7420696e207468726573686f6c642072616e6765a2646970667358221220c093267ab1730284165a08fbb90d76588354bc3febd59bd475b8fe02059a14a464736f6c63430008060033
Loading...
Loading
Loading...
Loading
Multichain Portfolio | 35 Chains
Chain | Token | Portfolio % | Price | Amount | Value |
---|
Loading...
Loading
Loading...
Loading
[ 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.