Source Code
Overview
HYPE Balance
HYPE Value
$0.00View more zero value Internal Transactions in Advanced View mode
Advanced mode:
Cross-Chain Transactions
Loading...
Loading
Contract Name:
RedstoneStablecoinRateProvider
Compiler Version
v0.8.21+commit.d9974bed
Optimization Enabled:
Yes with 200 runs
Other Settings:
shanghai EvmVersion
Contract Source Code (Solidity Standard Json-Input format)
// SPDX-License-Identifier: MIT
pragma solidity 0.8.21;
import { IRateProvider } from "./../interfaces/IRateProvider.sol";
import { IPriceFeed } from "./../interfaces/IPriceFeed.sol";
import { AccessControl } from "@openzeppelin/contracts/access/AccessControl.sol";
import { ERC20 } from "@solmate/tokens/ERC20.sol";
import { SafeCast } from "@openzeppelin/contracts/utils/math/SafeCast.sol";
/**
* @notice Reports the price of a token in terms of an underlying stablecoin. The underlying price
* feed must be compatible with the Redstone interface.
*
* @notice TERMINOLOGY
* Base Asset: The asset being priced or valued. The underlying base asset of the vault and what positions are
* denominated in.
* Quote Asset: The asset used to price the base asset. It represents the deposit/withdraw asset of a user.
* USD: An intermediary base asset used to derive the price in terms of Base/Quote via redstone oracles.
* EXAMPLE:
* - Base: USDC, a user wants to deposit into a USDC denominated vault
* - Quote: USDT, the vault needs to value their USDT deposit in terms of USDC
* - This rate provider will determine the rate of the USDT as QUOTE/USD / BASE/USD = QUOTE/BASE
* - Redstone will return the QUOTE/USD and BASE/USD. This contract
* will determine the BASE/QUOTE rate with appropriate decimal precision.
* @custom:security-contact [email protected]
*/
contract RedstoneStablecoinRateProvider is AccessControl, IRateProvider {
using SafeCast for int256;
error MaxTimeFromLastUpdatePassed(uint256 blockTimestamp, uint256 lastUpdated);
error InvalidPriceFeedDecimals(uint8 priceFeedDecimals);
error InvalidDescription();
error BoundsViolated(uint256 rate, uint256 violatedBound);
error SequencerIsDown();
bytes32 constant GOVERNANCE_ROLE = keccak256("GOVERNANCE");
bytes32 constant GUARDIAN_ROLE = keccak256("GUARDIAN");
uint8 private constant MAX_DECIMALS = 18;
/**
* @notice The description of the Base asset price feed
*/
string public DESCRIPTION_BaseFeed;
/**
* @notice The description of the Quote asset price feed
*/
string public DESCRIPTION_QuoteFeed;
/**
* @notice bounds on rate to keep it at a reasonable level
*/
uint256 public lowerBound;
/**
* @notice The maximum rate allowed for the quote asset in terms of the base feed stablecoin.
*/
uint256 public MAX_RATE;
/**
* @notice The redstone price feed that returns the value of the Base asset in USD denomination
*/
IPriceFeed public immutable PRICE_FEED_BaseFeed;
/**
* @notice The redstone price feed that returns the value of the quote asset in USD denomination
*/
IPriceFeed public immutable PRICE_FEED_QuoteFeed;
/**
* @notice Number of seconds since last update to determine whether the
* price base feeds is stale.
*/
uint256 public immutable MAX_TIME_FROM_LAST_UPDATE_BASE_FEED;
/**
* @notice Number of seconds since last update to determine whether the
* price quote feed is stale.
*/
uint256 public immutable MAX_TIME_FROM_LAST_UPDATE_QUOTE_FEED;
/**
* @notice The precision of the rate returned by this contract. This must be equal to the decimals of the quote
* asset
*/
uint8 public immutable RATE_DECIMALS;
uint256 public immutable SCALE;
uint256 public immutable ONE;
/// ref https://docs.chain.link/data-feeds/l2-sequencer-feeds
/// Grace period to prevent mass liquidations or unexpected disruptions
uint64 public sequencerDowntimeLimit;
/// Some chains have not had sequencer uptime feed contract yet
/// So that there will be an off-chain keeper to check sequencer status and set that status to this variable
bool public isSequencerDown;
/// Some chains have not had sequencer uptime feed contract yet
/// So that there will be an off-chain keeper to check sequencer status and set startedAt to this variable
uint256 public sequencerStartedAt;
/**
* @param _descriptionBaseFeed The baseFeed asset pair. ex USDC/USD
* @param _descriptionQuoteFeed The quoteFeed asset pair. ex USDT/USD
*/
constructor(
string memory _descriptionBaseFeed,
string memory _descriptionQuoteFeed,
ERC20 _quoteAsset,
IPriceFeed _baseFeed,
IPriceFeed _quoteFeed,
uint256 _maxTimeFromLastUpdateBaseFeed,
uint256 _maxTimeFromLastUpdateQuoteFeed,
uint64 _sequencerDowntimeLimit,
address governor
) {
if (!_isEqual(_descriptionBaseFeed, _baseFeed.description())) revert InvalidDescription();
if (!_isEqual(_descriptionQuoteFeed, _quoteFeed.description())) revert InvalidDescription();
RATE_DECIMALS = _quoteAsset.decimals();
uint8 baseDecimals = _baseFeed.decimals();
uint8 quoteDecimals = _quoteFeed.decimals();
SCALE = _calculateScale(baseDecimals, quoteDecimals, RATE_DECIMALS);
ONE = 10 ** RATE_DECIMALS;
DESCRIPTION_BaseFeed = _descriptionBaseFeed;
DESCRIPTION_QuoteFeed = _descriptionQuoteFeed;
PRICE_FEED_BaseFeed = _baseFeed;
PRICE_FEED_QuoteFeed = _quoteFeed;
MAX_TIME_FROM_LAST_UPDATE_BASE_FEED = _maxTimeFromLastUpdateBaseFeed;
MAX_TIME_FROM_LAST_UPDATE_QUOTE_FEED = _maxTimeFromLastUpdateQuoteFeed;
// Default Lower Bound is 9995 bps (0.9995)
lowerBound = 10 ** RATE_DECIMALS * 9995 / 10_000;
// Default Max Rate is 10_000 bps
MAX_RATE = 10 ** RATE_DECIMALS;
sequencerDowntimeLimit = _sequencerDowntimeLimit;
isSequencerDown = true;
_setRoleAdmin(GOVERNANCE_ROLE, GOVERNANCE_ROLE);
_setRoleAdmin(GUARDIAN_ROLE, GOVERNANCE_ROLE);
_grantRole(GOVERNANCE_ROLE, governor);
_grantRole(GUARDIAN_ROLE, governor);
}
/**
* @notice change the bounds (defaults are 5 bps based on decimals provided)
* @dev callable by GOVERNANCE_ROLE
*/
function setLowerBound(uint16 _lowerBoundInBps) external onlyRole(GOVERNANCE_ROLE) {
require(_lowerBoundInBps < 10_000, "Lower bound must be less than 100%");
lowerBound = 10 ** RATE_DECIMALS * _lowerBoundInBps / 10_000;
}
/**
* @notice Set the maximum rate allowed for the quote asset in terms of the base feed stablecoin.
* @dev callable by GOVERNANCE_ROLE
*/
function setMaxRate(uint16 _maxRateInBps) external onlyRole(GOVERNANCE_ROLE) {
require(_maxRateInBps < 11_000, "Max rate must be less than 110%");
MAX_RATE = 10 ** RATE_DECIMALS * _maxRateInBps / 10_000;
}
/// @notice Sets the sequencerDowntimeLimit
/// @param _sequencerDowntimeLimit The new value of sequencerDowntimeLimit
/// @dev This function sets the value of sequencerDowntimeLimit
function setSequencerDowntimeLimit(uint64 _sequencerDowntimeLimit) external onlyRole(GOVERNANCE_ROLE) {
sequencerDowntimeLimit = _sequencerDowntimeLimit;
}
/// @notice Some chains have not had sequencer uptime feed contract yet
/// This function will be used by an off-chain keeper for setting isSequencerDown to mark sequencer status
/// as down
/// @param isDown The new value of isSequencerDown
/// @param startedAt The new value of sequencerStartedAt
function updateSequencerStatus(bool isDown, uint256 startedAt) external onlyRole(GUARDIAN_ROLE) {
isSequencerDown = isDown;
sequencerStartedAt = startedAt;
}
/**
* @dev Safely compute scaling factor for decimal conversion
* @param baseDecimals decimals of base oracle feed
* @param quoteDecimals decimals of quote oracle feed
* @param rateDecimals desired output decimals (from quote asset)
* @return scale The scaling factor to convert between decimal precisions
*/
function _calculateScale(
uint8 baseDecimals,
uint8 quoteDecimals,
uint8 rateDecimals
)
internal
pure
returns (uint256)
{
// Check for decimal overflow
if (rateDecimals > MAX_DECIMALS || baseDecimals > MAX_DECIMALS || quoteDecimals > MAX_DECIMALS) {
revert InvalidPriceFeedDecimals(MAX_DECIMALS);
}
// Calculate intermediate values to avoid overflow
uint256 numerator = 10 ** (rateDecimals + baseDecimals);
uint256 denominator = 10 ** quoteDecimals;
return numerator / denominator;
}
/**
* @dev Calculate rate using formula min[(min(P(quote_feed/USD),1)/P(base_feed/USD), 1]. The rate is capped at 1.
* @param baseRate The base rate from price feed
* @param quoteRate The quote rate from price feed
* @return rate The calculated rate
*/
function _calculateRate(uint256 baseRate, uint256 quoteRate) internal view returns (uint256) {
uint256 rate = (quoteRate * SCALE) / baseRate;
return rate > MAX_RATE ? MAX_RATE : rate;
}
/**
* @notice Gets the price of the quote token in terms of the base feed stablecoin.
* @return rate in terms of base feed stablecoin.
*/
function getRate() public view returns (uint256 rate) {
_checkSequencerDowntime();
(, int256 _baseRate,, uint256 lastUpdatedAtUsd,) = PRICE_FEED_BaseFeed.latestRoundData();
if (
lastUpdatedAtUsd > block.timestamp
|| block.timestamp - lastUpdatedAtUsd > MAX_TIME_FROM_LAST_UPDATE_BASE_FEED
) {
revert MaxTimeFromLastUpdatePassed(block.timestamp, lastUpdatedAtUsd);
}
require(_baseRate > 0, "Base rate must be greater than 0");
(, int256 _quoteRate,, uint256 lastUpdatedAtQuote,) = PRICE_FEED_QuoteFeed.latestRoundData();
if (
lastUpdatedAtQuote > block.timestamp
|| block.timestamp - lastUpdatedAtQuote > MAX_TIME_FROM_LAST_UPDATE_QUOTE_FEED
) {
revert MaxTimeFromLastUpdatePassed(block.timestamp, lastUpdatedAtQuote);
}
require(_quoteRate > 0, "Quote rate must be greater than 0");
rate = _calculateRate(_baseRate.toUint256(), _quoteRate.toUint256());
_rateCheck(rate);
}
/**
* @dev To check rate remains in reasonable bounds
*/
function _rateCheck(uint256 rate) internal view {
if (rate < lowerBound) {
revert BoundsViolated(rate, lowerBound);
}
}
function _isEqual(string memory a, string memory b) internal pure returns (bool) {
return keccak256(abi.encodePacked(a)) == keccak256(abi.encodePacked(b));
}
function _isEqual(string memory a, bytes32 b) internal pure returns (bool) {
return bytes32(bytes(a)) == b;
}
function _checkSequencerDowntime() internal view {
if (isSequencerDown) revert SequencerIsDown();
uint256 startedAt = sequencerStartedAt;
// Make sure the grace period has passed after the
// sequencer is back up.
uint256 timeSinceUp = block.timestamp - startedAt;
if (timeSinceUp <= sequencerDowntimeLimit) {
revert SequencerIsDown();
}
}
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (access/AccessControl.sol)
pragma solidity ^0.8.20;
import {IAccessControl} from "./IAccessControl.sol";
import {Context} from "../utils/Context.sol";
import {ERC165} from "../utils/introspection/ERC165.sol";
/**
* @dev Contract module that allows children to implement role-based access
* control mechanisms. This is a lightweight version that doesn't allow enumerating role
* members except through off-chain means by accessing the contract event logs. Some
* applications may benefit from on-chain enumerability, for those cases see
* {AccessControlEnumerable}.
*
* Roles are referred to by their `bytes32` identifier. These should be exposed
* in the external API and be unique. The best way to achieve this is by
* using `public constant` hash digests:
*
* ```solidity
* bytes32 public constant MY_ROLE = keccak256("MY_ROLE");
* ```
*
* Roles can be used to represent a set of permissions. To restrict access to a
* function call, use {hasRole}:
*
* ```solidity
* function foo() public {
* require(hasRole(MY_ROLE, msg.sender));
* ...
* }
* ```
*
* Roles can be granted and revoked dynamically via the {grantRole} and
* {revokeRole} functions. Each role has an associated admin role, and only
* accounts that have a role's admin role can call {grantRole} and {revokeRole}.
*
* By default, the admin role for all roles is `DEFAULT_ADMIN_ROLE`, which means
* that only accounts with this role will be able to grant or revoke other
* roles. More complex role relationships can be created by using
* {_setRoleAdmin}.
*
* WARNING: The `DEFAULT_ADMIN_ROLE` is also its own admin: it has permission to
* grant and revoke this role. Extra precautions should be taken to secure
* accounts that have been granted it. We recommend using {AccessControlDefaultAdminRules}
* to enforce additional security measures for this role.
*/
abstract contract AccessControl is Context, IAccessControl, ERC165 {
struct RoleData {
mapping(address account => bool) hasRole;
bytes32 adminRole;
}
mapping(bytes32 role => RoleData) private _roles;
bytes32 public constant DEFAULT_ADMIN_ROLE = 0x00;
/**
* @dev Modifier that checks that an account has a specific role. Reverts
* with an {AccessControlUnauthorizedAccount} error including the required role.
*/
modifier onlyRole(bytes32 role) {
_checkRole(role);
_;
}
/**
* @dev See {IERC165-supportsInterface}.
*/
function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {
return interfaceId == type(IAccessControl).interfaceId || super.supportsInterface(interfaceId);
}
/**
* @dev Returns `true` if `account` has been granted `role`.
*/
function hasRole(bytes32 role, address account) public view virtual returns (bool) {
return _roles[role].hasRole[account];
}
/**
* @dev Reverts with an {AccessControlUnauthorizedAccount} error if `_msgSender()`
* is missing `role`. Overriding this function changes the behavior of the {onlyRole} modifier.
*/
function _checkRole(bytes32 role) internal view virtual {
_checkRole(role, _msgSender());
}
/**
* @dev Reverts with an {AccessControlUnauthorizedAccount} error if `account`
* is missing `role`.
*/
function _checkRole(bytes32 role, address account) internal view virtual {
if (!hasRole(role, account)) {
revert AccessControlUnauthorizedAccount(account, role);
}
}
/**
* @dev Returns the admin role that controls `role`. See {grantRole} and
* {revokeRole}.
*
* To change a role's admin, use {_setRoleAdmin}.
*/
function getRoleAdmin(bytes32 role) public view virtual returns (bytes32) {
return _roles[role].adminRole;
}
/**
* @dev Grants `role` to `account`.
*
* If `account` had not been already granted `role`, emits a {RoleGranted}
* event.
*
* Requirements:
*
* - the caller must have ``role``'s admin role.
*
* May emit a {RoleGranted} event.
*/
function grantRole(bytes32 role, address account) public virtual onlyRole(getRoleAdmin(role)) {
_grantRole(role, account);
}
/**
* @dev Revokes `role` from `account`.
*
* If `account` had been granted `role`, emits a {RoleRevoked} event.
*
* Requirements:
*
* - the caller must have ``role``'s admin role.
*
* May emit a {RoleRevoked} event.
*/
function revokeRole(bytes32 role, address account) public virtual onlyRole(getRoleAdmin(role)) {
_revokeRole(role, account);
}
/**
* @dev Revokes `role` from the calling account.
*
* Roles are often managed via {grantRole} and {revokeRole}: this function's
* purpose is to provide a mechanism for accounts to lose their privileges
* if they are compromised (such as when a trusted device is misplaced).
*
* If the calling account had been revoked `role`, emits a {RoleRevoked}
* event.
*
* Requirements:
*
* - the caller must be `callerConfirmation`.
*
* May emit a {RoleRevoked} event.
*/
function renounceRole(bytes32 role, address callerConfirmation) public virtual {
if (callerConfirmation != _msgSender()) {
revert AccessControlBadConfirmation();
}
_revokeRole(role, callerConfirmation);
}
/**
* @dev Sets `adminRole` as ``role``'s admin role.
*
* Emits a {RoleAdminChanged} event.
*/
function _setRoleAdmin(bytes32 role, bytes32 adminRole) internal virtual {
bytes32 previousAdminRole = getRoleAdmin(role);
_roles[role].adminRole = adminRole;
emit RoleAdminChanged(role, previousAdminRole, adminRole);
}
/**
* @dev Attempts to grant `role` to `account` and returns a boolean indicating if `role` was granted.
*
* Internal function without access restriction.
*
* May emit a {RoleGranted} event.
*/
function _grantRole(bytes32 role, address account) internal virtual returns (bool) {
if (!hasRole(role, account)) {
_roles[role].hasRole[account] = true;
emit RoleGranted(role, account, _msgSender());
return true;
} else {
return false;
}
}
/**
* @dev Attempts to revoke `role` to `account` and returns a boolean indicating if `role` was revoked.
*
* Internal function without access restriction.
*
* May emit a {RoleRevoked} event.
*/
function _revokeRole(bytes32 role, address account) internal virtual returns (bool) {
if (hasRole(role, account)) {
_roles[role].hasRole[account] = false;
emit RoleRevoked(role, account, _msgSender());
return true;
} else {
return false;
}
}
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (access/IAccessControl.sol)
pragma solidity ^0.8.20;
/**
* @dev External interface of AccessControl declared to support ERC-165 detection.
*/
interface IAccessControl {
/**
* @dev The `account` is missing a role.
*/
error AccessControlUnauthorizedAccount(address account, bytes32 neededRole);
/**
* @dev The caller of a function is not the expected one.
*
* NOTE: Don't confuse with {AccessControlUnauthorizedAccount}.
*/
error AccessControlBadConfirmation();
/**
* @dev Emitted when `newAdminRole` is set as ``role``'s admin role, replacing `previousAdminRole`
*
* `DEFAULT_ADMIN_ROLE` is the starting admin for all roles, despite
* {RoleAdminChanged} not being emitted signaling this.
*/
event RoleAdminChanged(bytes32 indexed role, bytes32 indexed previousAdminRole, bytes32 indexed newAdminRole);
/**
* @dev Emitted when `account` is granted `role`.
*
* `sender` is the account that originated the contract call. This account bears the admin role (for the granted role).
* Expected in cases where the role was granted using the internal {AccessControl-_grantRole}.
*/
event RoleGranted(bytes32 indexed role, address indexed account, address indexed sender);
/**
* @dev Emitted when `account` is revoked `role`.
*
* `sender` is the account that originated the contract call:
* - if using `revokeRole`, it is the admin role bearer
* - if using `renounceRole`, it is the role bearer (i.e. `account`)
*/
event RoleRevoked(bytes32 indexed role, address indexed account, address indexed sender);
/**
* @dev Returns `true` if `account` has been granted `role`.
*/
function hasRole(bytes32 role, address account) external view returns (bool);
/**
* @dev Returns the admin role that controls `role`. See {grantRole} and
* {revokeRole}.
*
* To change a role's admin, use {AccessControl-_setRoleAdmin}.
*/
function getRoleAdmin(bytes32 role) external view returns (bytes32);
/**
* @dev Grants `role` to `account`.
*
* If `account` had not been already granted `role`, emits a {RoleGranted}
* event.
*
* Requirements:
*
* - the caller must have ``role``'s admin role.
*/
function grantRole(bytes32 role, address account) external;
/**
* @dev Revokes `role` from `account`.
*
* If `account` had been granted `role`, emits a {RoleRevoked} event.
*
* Requirements:
*
* - the caller must have ``role``'s admin role.
*/
function revokeRole(bytes32 role, address account) external;
/**
* @dev Revokes `role` from the calling account.
*
* Roles are often managed via {grantRole} and {revokeRole}: this function's
* purpose is to provide a mechanism for accounts to lose their privileges
* if they are compromised (such as when a trusted device is misplaced).
*
* If the calling account had been granted `role`, emits a {RoleRevoked}
* event.
*
* Requirements:
*
* - the caller must be `callerConfirmation`.
*/
function renounceRole(bytes32 role, address callerConfirmation) external;
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.1) (utils/Context.sol)
pragma solidity ^0.8.20;
/**
* @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;
}
function _contextSuffixLength() internal view virtual returns (uint256) {
return 0;
}
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (utils/introspection/ERC165.sol)
pragma solidity ^0.8.20;
import {IERC165} from "./IERC165.sol";
/**
* @dev Implementation of the {IERC165} interface.
*
* Contracts that want to implement ERC-165 should inherit from this contract and override {supportsInterface} to check
* for the additional interface id that will be supported. For example:
*
* ```solidity
* function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {
* return interfaceId == type(MyInterface).interfaceId || super.supportsInterface(interfaceId);
* }
* ```
*/
abstract contract ERC165 is IERC165 {
/**
* @dev See {IERC165-supportsInterface}.
*/
function supportsInterface(bytes4 interfaceId) public view virtual returns (bool) {
return interfaceId == type(IERC165).interfaceId;
}
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (utils/introspection/IERC165.sol)
pragma solidity ^0.8.20;
/**
* @dev Interface of the ERC-165 standard, as defined in the
* https://eips.ethereum.org/EIPS/eip-165[ERC].
*
* Implementers can declare support of contract interfaces, which can then be
* queried by others ({ERC165Checker}).
*
* For an implementation, see {ERC165}.
*/
interface IERC165 {
/**
* @dev Returns true if this contract implements the interface defined by
* `interfaceId`. See the corresponding
* https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified[ERC section]
* to learn more about how these ids are created.
*
* This function call must use less than 30 000 gas.
*/
function supportsInterface(bytes4 interfaceId) external view returns (bool);
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (utils/math/SafeCast.sol)
// This file was procedurally generated from scripts/generate/templates/SafeCast.js.
pragma solidity ^0.8.20;
/**
* @dev Wrappers over Solidity's uintXX/intXX/bool casting operators with added overflow
* checks.
*
* Downcasting from uint256/int256 in Solidity does not revert on overflow. This can
* easily result in undesired exploitation or bugs, since developers usually
* assume that overflows raise errors. `SafeCast` restores this intuition by
* reverting the transaction when such an operation overflows.
*
* Using this library instead of the unchecked operations eliminates an entire
* class of bugs, so it's recommended to use it always.
*/
library SafeCast {
/**
* @dev Value doesn't fit in an uint of `bits` size.
*/
error SafeCastOverflowedUintDowncast(uint8 bits, uint256 value);
/**
* @dev An int value doesn't fit in an uint of `bits` size.
*/
error SafeCastOverflowedIntToUint(int256 value);
/**
* @dev Value doesn't fit in an int of `bits` size.
*/
error SafeCastOverflowedIntDowncast(uint8 bits, int256 value);
/**
* @dev An uint value doesn't fit in an int of `bits` size.
*/
error SafeCastOverflowedUintToInt(uint256 value);
/**
* @dev Returns the downcasted uint248 from uint256, reverting on
* overflow (when the input is greater than largest uint248).
*
* Counterpart to Solidity's `uint248` operator.
*
* Requirements:
*
* - input must fit into 248 bits
*/
function toUint248(uint256 value) internal pure returns (uint248) {
if (value > type(uint248).max) {
revert SafeCastOverflowedUintDowncast(248, value);
}
return uint248(value);
}
/**
* @dev Returns the downcasted uint240 from uint256, reverting on
* overflow (when the input is greater than largest uint240).
*
* Counterpart to Solidity's `uint240` operator.
*
* Requirements:
*
* - input must fit into 240 bits
*/
function toUint240(uint256 value) internal pure returns (uint240) {
if (value > type(uint240).max) {
revert SafeCastOverflowedUintDowncast(240, value);
}
return uint240(value);
}
/**
* @dev Returns the downcasted uint232 from uint256, reverting on
* overflow (when the input is greater than largest uint232).
*
* Counterpart to Solidity's `uint232` operator.
*
* Requirements:
*
* - input must fit into 232 bits
*/
function toUint232(uint256 value) internal pure returns (uint232) {
if (value > type(uint232).max) {
revert SafeCastOverflowedUintDowncast(232, value);
}
return uint232(value);
}
/**
* @dev Returns the downcasted uint224 from uint256, reverting on
* overflow (when the input is greater than largest uint224).
*
* Counterpart to Solidity's `uint224` operator.
*
* Requirements:
*
* - input must fit into 224 bits
*/
function toUint224(uint256 value) internal pure returns (uint224) {
if (value > type(uint224).max) {
revert SafeCastOverflowedUintDowncast(224, value);
}
return uint224(value);
}
/**
* @dev Returns the downcasted uint216 from uint256, reverting on
* overflow (when the input is greater than largest uint216).
*
* Counterpart to Solidity's `uint216` operator.
*
* Requirements:
*
* - input must fit into 216 bits
*/
function toUint216(uint256 value) internal pure returns (uint216) {
if (value > type(uint216).max) {
revert SafeCastOverflowedUintDowncast(216, value);
}
return uint216(value);
}
/**
* @dev Returns the downcasted uint208 from uint256, reverting on
* overflow (when the input is greater than largest uint208).
*
* Counterpart to Solidity's `uint208` operator.
*
* Requirements:
*
* - input must fit into 208 bits
*/
function toUint208(uint256 value) internal pure returns (uint208) {
if (value > type(uint208).max) {
revert SafeCastOverflowedUintDowncast(208, value);
}
return uint208(value);
}
/**
* @dev Returns the downcasted uint200 from uint256, reverting on
* overflow (when the input is greater than largest uint200).
*
* Counterpart to Solidity's `uint200` operator.
*
* Requirements:
*
* - input must fit into 200 bits
*/
function toUint200(uint256 value) internal pure returns (uint200) {
if (value > type(uint200).max) {
revert SafeCastOverflowedUintDowncast(200, value);
}
return uint200(value);
}
/**
* @dev Returns the downcasted uint192 from uint256, reverting on
* overflow (when the input is greater than largest uint192).
*
* Counterpart to Solidity's `uint192` operator.
*
* Requirements:
*
* - input must fit into 192 bits
*/
function toUint192(uint256 value) internal pure returns (uint192) {
if (value > type(uint192).max) {
revert SafeCastOverflowedUintDowncast(192, value);
}
return uint192(value);
}
/**
* @dev Returns the downcasted uint184 from uint256, reverting on
* overflow (when the input is greater than largest uint184).
*
* Counterpart to Solidity's `uint184` operator.
*
* Requirements:
*
* - input must fit into 184 bits
*/
function toUint184(uint256 value) internal pure returns (uint184) {
if (value > type(uint184).max) {
revert SafeCastOverflowedUintDowncast(184, value);
}
return uint184(value);
}
/**
* @dev Returns the downcasted uint176 from uint256, reverting on
* overflow (when the input is greater than largest uint176).
*
* Counterpart to Solidity's `uint176` operator.
*
* Requirements:
*
* - input must fit into 176 bits
*/
function toUint176(uint256 value) internal pure returns (uint176) {
if (value > type(uint176).max) {
revert SafeCastOverflowedUintDowncast(176, value);
}
return uint176(value);
}
/**
* @dev Returns the downcasted uint168 from uint256, reverting on
* overflow (when the input is greater than largest uint168).
*
* Counterpart to Solidity's `uint168` operator.
*
* Requirements:
*
* - input must fit into 168 bits
*/
function toUint168(uint256 value) internal pure returns (uint168) {
if (value > type(uint168).max) {
revert SafeCastOverflowedUintDowncast(168, value);
}
return uint168(value);
}
/**
* @dev Returns the downcasted uint160 from uint256, reverting on
* overflow (when the input is greater than largest uint160).
*
* Counterpart to Solidity's `uint160` operator.
*
* Requirements:
*
* - input must fit into 160 bits
*/
function toUint160(uint256 value) internal pure returns (uint160) {
if (value > type(uint160).max) {
revert SafeCastOverflowedUintDowncast(160, value);
}
return uint160(value);
}
/**
* @dev Returns the downcasted uint152 from uint256, reverting on
* overflow (when the input is greater than largest uint152).
*
* Counterpart to Solidity's `uint152` operator.
*
* Requirements:
*
* - input must fit into 152 bits
*/
function toUint152(uint256 value) internal pure returns (uint152) {
if (value > type(uint152).max) {
revert SafeCastOverflowedUintDowncast(152, value);
}
return uint152(value);
}
/**
* @dev Returns the downcasted uint144 from uint256, reverting on
* overflow (when the input is greater than largest uint144).
*
* Counterpart to Solidity's `uint144` operator.
*
* Requirements:
*
* - input must fit into 144 bits
*/
function toUint144(uint256 value) internal pure returns (uint144) {
if (value > type(uint144).max) {
revert SafeCastOverflowedUintDowncast(144, value);
}
return uint144(value);
}
/**
* @dev Returns the downcasted uint136 from uint256, reverting on
* overflow (when the input is greater than largest uint136).
*
* Counterpart to Solidity's `uint136` operator.
*
* Requirements:
*
* - input must fit into 136 bits
*/
function toUint136(uint256 value) internal pure returns (uint136) {
if (value > type(uint136).max) {
revert SafeCastOverflowedUintDowncast(136, value);
}
return uint136(value);
}
/**
* @dev Returns the downcasted uint128 from uint256, reverting on
* overflow (when the input is greater than largest uint128).
*
* Counterpart to Solidity's `uint128` operator.
*
* Requirements:
*
* - input must fit into 128 bits
*/
function toUint128(uint256 value) internal pure returns (uint128) {
if (value > type(uint128).max) {
revert SafeCastOverflowedUintDowncast(128, value);
}
return uint128(value);
}
/**
* @dev Returns the downcasted uint120 from uint256, reverting on
* overflow (when the input is greater than largest uint120).
*
* Counterpart to Solidity's `uint120` operator.
*
* Requirements:
*
* - input must fit into 120 bits
*/
function toUint120(uint256 value) internal pure returns (uint120) {
if (value > type(uint120).max) {
revert SafeCastOverflowedUintDowncast(120, value);
}
return uint120(value);
}
/**
* @dev Returns the downcasted uint112 from uint256, reverting on
* overflow (when the input is greater than largest uint112).
*
* Counterpart to Solidity's `uint112` operator.
*
* Requirements:
*
* - input must fit into 112 bits
*/
function toUint112(uint256 value) internal pure returns (uint112) {
if (value > type(uint112).max) {
revert SafeCastOverflowedUintDowncast(112, value);
}
return uint112(value);
}
/**
* @dev Returns the downcasted uint104 from uint256, reverting on
* overflow (when the input is greater than largest uint104).
*
* Counterpart to Solidity's `uint104` operator.
*
* Requirements:
*
* - input must fit into 104 bits
*/
function toUint104(uint256 value) internal pure returns (uint104) {
if (value > type(uint104).max) {
revert SafeCastOverflowedUintDowncast(104, value);
}
return uint104(value);
}
/**
* @dev Returns the downcasted uint96 from uint256, reverting on
* overflow (when the input is greater than largest uint96).
*
* Counterpart to Solidity's `uint96` operator.
*
* Requirements:
*
* - input must fit into 96 bits
*/
function toUint96(uint256 value) internal pure returns (uint96) {
if (value > type(uint96).max) {
revert SafeCastOverflowedUintDowncast(96, value);
}
return uint96(value);
}
/**
* @dev Returns the downcasted uint88 from uint256, reverting on
* overflow (when the input is greater than largest uint88).
*
* Counterpart to Solidity's `uint88` operator.
*
* Requirements:
*
* - input must fit into 88 bits
*/
function toUint88(uint256 value) internal pure returns (uint88) {
if (value > type(uint88).max) {
revert SafeCastOverflowedUintDowncast(88, value);
}
return uint88(value);
}
/**
* @dev Returns the downcasted uint80 from uint256, reverting on
* overflow (when the input is greater than largest uint80).
*
* Counterpart to Solidity's `uint80` operator.
*
* Requirements:
*
* - input must fit into 80 bits
*/
function toUint80(uint256 value) internal pure returns (uint80) {
if (value > type(uint80).max) {
revert SafeCastOverflowedUintDowncast(80, value);
}
return uint80(value);
}
/**
* @dev Returns the downcasted uint72 from uint256, reverting on
* overflow (when the input is greater than largest uint72).
*
* Counterpart to Solidity's `uint72` operator.
*
* Requirements:
*
* - input must fit into 72 bits
*/
function toUint72(uint256 value) internal pure returns (uint72) {
if (value > type(uint72).max) {
revert SafeCastOverflowedUintDowncast(72, value);
}
return uint72(value);
}
/**
* @dev Returns the downcasted uint64 from uint256, reverting on
* overflow (when the input is greater than largest uint64).
*
* Counterpart to Solidity's `uint64` operator.
*
* Requirements:
*
* - input must fit into 64 bits
*/
function toUint64(uint256 value) internal pure returns (uint64) {
if (value > type(uint64).max) {
revert SafeCastOverflowedUintDowncast(64, value);
}
return uint64(value);
}
/**
* @dev Returns the downcasted uint56 from uint256, reverting on
* overflow (when the input is greater than largest uint56).
*
* Counterpart to Solidity's `uint56` operator.
*
* Requirements:
*
* - input must fit into 56 bits
*/
function toUint56(uint256 value) internal pure returns (uint56) {
if (value > type(uint56).max) {
revert SafeCastOverflowedUintDowncast(56, value);
}
return uint56(value);
}
/**
* @dev Returns the downcasted uint48 from uint256, reverting on
* overflow (when the input is greater than largest uint48).
*
* Counterpart to Solidity's `uint48` operator.
*
* Requirements:
*
* - input must fit into 48 bits
*/
function toUint48(uint256 value) internal pure returns (uint48) {
if (value > type(uint48).max) {
revert SafeCastOverflowedUintDowncast(48, value);
}
return uint48(value);
}
/**
* @dev Returns the downcasted uint40 from uint256, reverting on
* overflow (when the input is greater than largest uint40).
*
* Counterpart to Solidity's `uint40` operator.
*
* Requirements:
*
* - input must fit into 40 bits
*/
function toUint40(uint256 value) internal pure returns (uint40) {
if (value > type(uint40).max) {
revert SafeCastOverflowedUintDowncast(40, value);
}
return uint40(value);
}
/**
* @dev Returns the downcasted uint32 from uint256, reverting on
* overflow (when the input is greater than largest uint32).
*
* Counterpart to Solidity's `uint32` operator.
*
* Requirements:
*
* - input must fit into 32 bits
*/
function toUint32(uint256 value) internal pure returns (uint32) {
if (value > type(uint32).max) {
revert SafeCastOverflowedUintDowncast(32, value);
}
return uint32(value);
}
/**
* @dev Returns the downcasted uint24 from uint256, reverting on
* overflow (when the input is greater than largest uint24).
*
* Counterpart to Solidity's `uint24` operator.
*
* Requirements:
*
* - input must fit into 24 bits
*/
function toUint24(uint256 value) internal pure returns (uint24) {
if (value > type(uint24).max) {
revert SafeCastOverflowedUintDowncast(24, value);
}
return uint24(value);
}
/**
* @dev Returns the downcasted uint16 from uint256, reverting on
* overflow (when the input is greater than largest uint16).
*
* Counterpart to Solidity's `uint16` operator.
*
* Requirements:
*
* - input must fit into 16 bits
*/
function toUint16(uint256 value) internal pure returns (uint16) {
if (value > type(uint16).max) {
revert SafeCastOverflowedUintDowncast(16, value);
}
return uint16(value);
}
/**
* @dev Returns the downcasted uint8 from uint256, reverting on
* overflow (when the input is greater than largest uint8).
*
* Counterpart to Solidity's `uint8` operator.
*
* Requirements:
*
* - input must fit into 8 bits
*/
function toUint8(uint256 value) internal pure returns (uint8) {
if (value > type(uint8).max) {
revert SafeCastOverflowedUintDowncast(8, value);
}
return uint8(value);
}
/**
* @dev Converts a signed int256 into an unsigned uint256.
*
* Requirements:
*
* - input must be greater than or equal to 0.
*/
function toUint256(int256 value) internal pure returns (uint256) {
if (value < 0) {
revert SafeCastOverflowedIntToUint(value);
}
return uint256(value);
}
/**
* @dev Returns the downcasted int248 from int256, reverting on
* overflow (when the input is less than smallest int248 or
* greater than largest int248).
*
* Counterpart to Solidity's `int248` operator.
*
* Requirements:
*
* - input must fit into 248 bits
*/
function toInt248(int256 value) internal pure returns (int248 downcasted) {
downcasted = int248(value);
if (downcasted != value) {
revert SafeCastOverflowedIntDowncast(248, value);
}
}
/**
* @dev Returns the downcasted int240 from int256, reverting on
* overflow (when the input is less than smallest int240 or
* greater than largest int240).
*
* Counterpart to Solidity's `int240` operator.
*
* Requirements:
*
* - input must fit into 240 bits
*/
function toInt240(int256 value) internal pure returns (int240 downcasted) {
downcasted = int240(value);
if (downcasted != value) {
revert SafeCastOverflowedIntDowncast(240, value);
}
}
/**
* @dev Returns the downcasted int232 from int256, reverting on
* overflow (when the input is less than smallest int232 or
* greater than largest int232).
*
* Counterpart to Solidity's `int232` operator.
*
* Requirements:
*
* - input must fit into 232 bits
*/
function toInt232(int256 value) internal pure returns (int232 downcasted) {
downcasted = int232(value);
if (downcasted != value) {
revert SafeCastOverflowedIntDowncast(232, value);
}
}
/**
* @dev Returns the downcasted int224 from int256, reverting on
* overflow (when the input is less than smallest int224 or
* greater than largest int224).
*
* Counterpart to Solidity's `int224` operator.
*
* Requirements:
*
* - input must fit into 224 bits
*/
function toInt224(int256 value) internal pure returns (int224 downcasted) {
downcasted = int224(value);
if (downcasted != value) {
revert SafeCastOverflowedIntDowncast(224, value);
}
}
/**
* @dev Returns the downcasted int216 from int256, reverting on
* overflow (when the input is less than smallest int216 or
* greater than largest int216).
*
* Counterpart to Solidity's `int216` operator.
*
* Requirements:
*
* - input must fit into 216 bits
*/
function toInt216(int256 value) internal pure returns (int216 downcasted) {
downcasted = int216(value);
if (downcasted != value) {
revert SafeCastOverflowedIntDowncast(216, value);
}
}
/**
* @dev Returns the downcasted int208 from int256, reverting on
* overflow (when the input is less than smallest int208 or
* greater than largest int208).
*
* Counterpart to Solidity's `int208` operator.
*
* Requirements:
*
* - input must fit into 208 bits
*/
function toInt208(int256 value) internal pure returns (int208 downcasted) {
downcasted = int208(value);
if (downcasted != value) {
revert SafeCastOverflowedIntDowncast(208, value);
}
}
/**
* @dev Returns the downcasted int200 from int256, reverting on
* overflow (when the input is less than smallest int200 or
* greater than largest int200).
*
* Counterpart to Solidity's `int200` operator.
*
* Requirements:
*
* - input must fit into 200 bits
*/
function toInt200(int256 value) internal pure returns (int200 downcasted) {
downcasted = int200(value);
if (downcasted != value) {
revert SafeCastOverflowedIntDowncast(200, value);
}
}
/**
* @dev Returns the downcasted int192 from int256, reverting on
* overflow (when the input is less than smallest int192 or
* greater than largest int192).
*
* Counterpart to Solidity's `int192` operator.
*
* Requirements:
*
* - input must fit into 192 bits
*/
function toInt192(int256 value) internal pure returns (int192 downcasted) {
downcasted = int192(value);
if (downcasted != value) {
revert SafeCastOverflowedIntDowncast(192, value);
}
}
/**
* @dev Returns the downcasted int184 from int256, reverting on
* overflow (when the input is less than smallest int184 or
* greater than largest int184).
*
* Counterpart to Solidity's `int184` operator.
*
* Requirements:
*
* - input must fit into 184 bits
*/
function toInt184(int256 value) internal pure returns (int184 downcasted) {
downcasted = int184(value);
if (downcasted != value) {
revert SafeCastOverflowedIntDowncast(184, value);
}
}
/**
* @dev Returns the downcasted int176 from int256, reverting on
* overflow (when the input is less than smallest int176 or
* greater than largest int176).
*
* Counterpart to Solidity's `int176` operator.
*
* Requirements:
*
* - input must fit into 176 bits
*/
function toInt176(int256 value) internal pure returns (int176 downcasted) {
downcasted = int176(value);
if (downcasted != value) {
revert SafeCastOverflowedIntDowncast(176, value);
}
}
/**
* @dev Returns the downcasted int168 from int256, reverting on
* overflow (when the input is less than smallest int168 or
* greater than largest int168).
*
* Counterpart to Solidity's `int168` operator.
*
* Requirements:
*
* - input must fit into 168 bits
*/
function toInt168(int256 value) internal pure returns (int168 downcasted) {
downcasted = int168(value);
if (downcasted != value) {
revert SafeCastOverflowedIntDowncast(168, value);
}
}
/**
* @dev Returns the downcasted int160 from int256, reverting on
* overflow (when the input is less than smallest int160 or
* greater than largest int160).
*
* Counterpart to Solidity's `int160` operator.
*
* Requirements:
*
* - input must fit into 160 bits
*/
function toInt160(int256 value) internal pure returns (int160 downcasted) {
downcasted = int160(value);
if (downcasted != value) {
revert SafeCastOverflowedIntDowncast(160, value);
}
}
/**
* @dev Returns the downcasted int152 from int256, reverting on
* overflow (when the input is less than smallest int152 or
* greater than largest int152).
*
* Counterpart to Solidity's `int152` operator.
*
* Requirements:
*
* - input must fit into 152 bits
*/
function toInt152(int256 value) internal pure returns (int152 downcasted) {
downcasted = int152(value);
if (downcasted != value) {
revert SafeCastOverflowedIntDowncast(152, value);
}
}
/**
* @dev Returns the downcasted int144 from int256, reverting on
* overflow (when the input is less than smallest int144 or
* greater than largest int144).
*
* Counterpart to Solidity's `int144` operator.
*
* Requirements:
*
* - input must fit into 144 bits
*/
function toInt144(int256 value) internal pure returns (int144 downcasted) {
downcasted = int144(value);
if (downcasted != value) {
revert SafeCastOverflowedIntDowncast(144, value);
}
}
/**
* @dev Returns the downcasted int136 from int256, reverting on
* overflow (when the input is less than smallest int136 or
* greater than largest int136).
*
* Counterpart to Solidity's `int136` operator.
*
* Requirements:
*
* - input must fit into 136 bits
*/
function toInt136(int256 value) internal pure returns (int136 downcasted) {
downcasted = int136(value);
if (downcasted != value) {
revert SafeCastOverflowedIntDowncast(136, value);
}
}
/**
* @dev Returns the downcasted int128 from int256, reverting on
* overflow (when the input is less than smallest int128 or
* greater than largest int128).
*
* Counterpart to Solidity's `int128` operator.
*
* Requirements:
*
* - input must fit into 128 bits
*/
function toInt128(int256 value) internal pure returns (int128 downcasted) {
downcasted = int128(value);
if (downcasted != value) {
revert SafeCastOverflowedIntDowncast(128, value);
}
}
/**
* @dev Returns the downcasted int120 from int256, reverting on
* overflow (when the input is less than smallest int120 or
* greater than largest int120).
*
* Counterpart to Solidity's `int120` operator.
*
* Requirements:
*
* - input must fit into 120 bits
*/
function toInt120(int256 value) internal pure returns (int120 downcasted) {
downcasted = int120(value);
if (downcasted != value) {
revert SafeCastOverflowedIntDowncast(120, value);
}
}
/**
* @dev Returns the downcasted int112 from int256, reverting on
* overflow (when the input is less than smallest int112 or
* greater than largest int112).
*
* Counterpart to Solidity's `int112` operator.
*
* Requirements:
*
* - input must fit into 112 bits
*/
function toInt112(int256 value) internal pure returns (int112 downcasted) {
downcasted = int112(value);
if (downcasted != value) {
revert SafeCastOverflowedIntDowncast(112, value);
}
}
/**
* @dev Returns the downcasted int104 from int256, reverting on
* overflow (when the input is less than smallest int104 or
* greater than largest int104).
*
* Counterpart to Solidity's `int104` operator.
*
* Requirements:
*
* - input must fit into 104 bits
*/
function toInt104(int256 value) internal pure returns (int104 downcasted) {
downcasted = int104(value);
if (downcasted != value) {
revert SafeCastOverflowedIntDowncast(104, value);
}
}
/**
* @dev Returns the downcasted int96 from int256, reverting on
* overflow (when the input is less than smallest int96 or
* greater than largest int96).
*
* Counterpart to Solidity's `int96` operator.
*
* Requirements:
*
* - input must fit into 96 bits
*/
function toInt96(int256 value) internal pure returns (int96 downcasted) {
downcasted = int96(value);
if (downcasted != value) {
revert SafeCastOverflowedIntDowncast(96, value);
}
}
/**
* @dev Returns the downcasted int88 from int256, reverting on
* overflow (when the input is less than smallest int88 or
* greater than largest int88).
*
* Counterpart to Solidity's `int88` operator.
*
* Requirements:
*
* - input must fit into 88 bits
*/
function toInt88(int256 value) internal pure returns (int88 downcasted) {
downcasted = int88(value);
if (downcasted != value) {
revert SafeCastOverflowedIntDowncast(88, value);
}
}
/**
* @dev Returns the downcasted int80 from int256, reverting on
* overflow (when the input is less than smallest int80 or
* greater than largest int80).
*
* Counterpart to Solidity's `int80` operator.
*
* Requirements:
*
* - input must fit into 80 bits
*/
function toInt80(int256 value) internal pure returns (int80 downcasted) {
downcasted = int80(value);
if (downcasted != value) {
revert SafeCastOverflowedIntDowncast(80, value);
}
}
/**
* @dev Returns the downcasted int72 from int256, reverting on
* overflow (when the input is less than smallest int72 or
* greater than largest int72).
*
* Counterpart to Solidity's `int72` operator.
*
* Requirements:
*
* - input must fit into 72 bits
*/
function toInt72(int256 value) internal pure returns (int72 downcasted) {
downcasted = int72(value);
if (downcasted != value) {
revert SafeCastOverflowedIntDowncast(72, value);
}
}
/**
* @dev Returns the downcasted int64 from int256, reverting on
* overflow (when the input is less than smallest int64 or
* greater than largest int64).
*
* Counterpart to Solidity's `int64` operator.
*
* Requirements:
*
* - input must fit into 64 bits
*/
function toInt64(int256 value) internal pure returns (int64 downcasted) {
downcasted = int64(value);
if (downcasted != value) {
revert SafeCastOverflowedIntDowncast(64, value);
}
}
/**
* @dev Returns the downcasted int56 from int256, reverting on
* overflow (when the input is less than smallest int56 or
* greater than largest int56).
*
* Counterpart to Solidity's `int56` operator.
*
* Requirements:
*
* - input must fit into 56 bits
*/
function toInt56(int256 value) internal pure returns (int56 downcasted) {
downcasted = int56(value);
if (downcasted != value) {
revert SafeCastOverflowedIntDowncast(56, value);
}
}
/**
* @dev Returns the downcasted int48 from int256, reverting on
* overflow (when the input is less than smallest int48 or
* greater than largest int48).
*
* Counterpart to Solidity's `int48` operator.
*
* Requirements:
*
* - input must fit into 48 bits
*/
function toInt48(int256 value) internal pure returns (int48 downcasted) {
downcasted = int48(value);
if (downcasted != value) {
revert SafeCastOverflowedIntDowncast(48, value);
}
}
/**
* @dev Returns the downcasted int40 from int256, reverting on
* overflow (when the input is less than smallest int40 or
* greater than largest int40).
*
* Counterpart to Solidity's `int40` operator.
*
* Requirements:
*
* - input must fit into 40 bits
*/
function toInt40(int256 value) internal pure returns (int40 downcasted) {
downcasted = int40(value);
if (downcasted != value) {
revert SafeCastOverflowedIntDowncast(40, value);
}
}
/**
* @dev Returns the downcasted int32 from int256, reverting on
* overflow (when the input is less than smallest int32 or
* greater than largest int32).
*
* Counterpart to Solidity's `int32` operator.
*
* Requirements:
*
* - input must fit into 32 bits
*/
function toInt32(int256 value) internal pure returns (int32 downcasted) {
downcasted = int32(value);
if (downcasted != value) {
revert SafeCastOverflowedIntDowncast(32, value);
}
}
/**
* @dev Returns the downcasted int24 from int256, reverting on
* overflow (when the input is less than smallest int24 or
* greater than largest int24).
*
* Counterpart to Solidity's `int24` operator.
*
* Requirements:
*
* - input must fit into 24 bits
*/
function toInt24(int256 value) internal pure returns (int24 downcasted) {
downcasted = int24(value);
if (downcasted != value) {
revert SafeCastOverflowedIntDowncast(24, value);
}
}
/**
* @dev Returns the downcasted int16 from int256, reverting on
* overflow (when the input is less than smallest int16 or
* greater than largest int16).
*
* Counterpart to Solidity's `int16` operator.
*
* Requirements:
*
* - input must fit into 16 bits
*/
function toInt16(int256 value) internal pure returns (int16 downcasted) {
downcasted = int16(value);
if (downcasted != value) {
revert SafeCastOverflowedIntDowncast(16, value);
}
}
/**
* @dev Returns the downcasted int8 from int256, reverting on
* overflow (when the input is less than smallest int8 or
* greater than largest int8).
*
* Counterpart to Solidity's `int8` operator.
*
* Requirements:
*
* - input must fit into 8 bits
*/
function toInt8(int256 value) internal pure returns (int8 downcasted) {
downcasted = int8(value);
if (downcasted != value) {
revert SafeCastOverflowedIntDowncast(8, value);
}
}
/**
* @dev Converts an unsigned uint256 into a signed int256.
*
* Requirements:
*
* - input must be less than or equal to maxInt256.
*/
function toInt256(uint256 value) internal pure returns (int256) {
// Note: Unsafe cast below is okay because `type(int256).max` is guaranteed to be positive
if (value > uint256(type(int256).max)) {
revert SafeCastOverflowedUintToInt(value);
}
return int256(value);
}
/**
* @dev Cast a boolean (false or true) to a uint256 (0 or 1) with no jump.
*/
function toUint(bool b) internal pure returns (uint256 u) {
/// @solidity memory-safe-assembly
assembly {
u := iszero(iszero(b))
}
}
}// SPDX-License-Identifier: AGPL-3.0-only
pragma solidity >=0.8.0;
/// @notice Modern and gas efficient ERC20 + EIP-2612 implementation.
/// @author Solmate (https://github.com/transmissions11/solmate/blob/main/src/tokens/ERC20.sol)
/// @author Modified from Uniswap (https://github.com/Uniswap/uniswap-v2-core/blob/master/contracts/UniswapV2ERC20.sol)
/// @dev Do not manually set balances without updating totalSupply, as the sum of all user balances must not exceed it.
abstract contract ERC20 {
/*//////////////////////////////////////////////////////////////
EVENTS
//////////////////////////////////////////////////////////////*/
event Transfer(address indexed from, address indexed to, uint256 amount);
event Approval(address indexed owner, address indexed spender, uint256 amount);
/*//////////////////////////////////////////////////////////////
METADATA STORAGE
//////////////////////////////////////////////////////////////*/
string public name;
string public symbol;
uint8 public immutable decimals;
/*//////////////////////////////////////////////////////////////
ERC20 STORAGE
//////////////////////////////////////////////////////////////*/
uint256 public totalSupply;
mapping(address => uint256) public balanceOf;
mapping(address => mapping(address => uint256)) public allowance;
/*//////////////////////////////////////////////////////////////
EIP-2612 STORAGE
//////////////////////////////////////////////////////////////*/
uint256 internal immutable INITIAL_CHAIN_ID;
bytes32 internal immutable INITIAL_DOMAIN_SEPARATOR;
mapping(address => uint256) public nonces;
/*//////////////////////////////////////////////////////////////
CONSTRUCTOR
//////////////////////////////////////////////////////////////*/
constructor(
string memory _name,
string memory _symbol,
uint8 _decimals
) {
name = _name;
symbol = _symbol;
decimals = _decimals;
INITIAL_CHAIN_ID = block.chainid;
INITIAL_DOMAIN_SEPARATOR = computeDomainSeparator();
}
/*//////////////////////////////////////////////////////////////
ERC20 LOGIC
//////////////////////////////////////////////////////////////*/
function approve(address spender, uint256 amount) public virtual returns (bool) {
allowance[msg.sender][spender] = amount;
emit Approval(msg.sender, spender, amount);
return true;
}
function transfer(address to, uint256 amount) public virtual returns (bool) {
balanceOf[msg.sender] -= amount;
// Cannot overflow because the sum of all user
// balances can't exceed the max uint256 value.
unchecked {
balanceOf[to] += amount;
}
emit Transfer(msg.sender, to, amount);
return true;
}
function transferFrom(
address from,
address to,
uint256 amount
) public virtual returns (bool) {
uint256 allowed = allowance[from][msg.sender]; // Saves gas for limited approvals.
if (allowed != type(uint256).max) allowance[from][msg.sender] = allowed - amount;
balanceOf[from] -= amount;
// Cannot overflow because the sum of all user
// balances can't exceed the max uint256 value.
unchecked {
balanceOf[to] += amount;
}
emit Transfer(from, to, amount);
return true;
}
/*//////////////////////////////////////////////////////////////
EIP-2612 LOGIC
//////////////////////////////////////////////////////////////*/
function permit(
address owner,
address spender,
uint256 value,
uint256 deadline,
uint8 v,
bytes32 r,
bytes32 s
) public virtual {
require(deadline >= block.timestamp, "PERMIT_DEADLINE_EXPIRED");
// Unchecked because the only math done is incrementing
// the owner's nonce which cannot realistically overflow.
unchecked {
address recoveredAddress = ecrecover(
keccak256(
abi.encodePacked(
"\x19\x01",
DOMAIN_SEPARATOR(),
keccak256(
abi.encode(
keccak256(
"Permit(address owner,address spender,uint256 value,uint256 nonce,uint256 deadline)"
),
owner,
spender,
value,
nonces[owner]++,
deadline
)
)
)
),
v,
r,
s
);
require(recoveredAddress != address(0) && recoveredAddress == owner, "INVALID_SIGNER");
allowance[recoveredAddress][spender] = value;
}
emit Approval(owner, spender, value);
}
function DOMAIN_SEPARATOR() public view virtual returns (bytes32) {
return block.chainid == INITIAL_CHAIN_ID ? INITIAL_DOMAIN_SEPARATOR : computeDomainSeparator();
}
function computeDomainSeparator() internal view virtual returns (bytes32) {
return
keccak256(
abi.encode(
keccak256("EIP712Domain(string name,string version,uint256 chainId,address verifyingContract)"),
keccak256(bytes(name)),
keccak256("1"),
block.chainid,
address(this)
)
);
}
/*//////////////////////////////////////////////////////////////
INTERNAL MINT/BURN LOGIC
//////////////////////////////////////////////////////////////*/
function _mint(address to, uint256 amount) internal virtual {
totalSupply += amount;
// Cannot overflow because the sum of all user
// balances can't exceed the max uint256 value.
unchecked {
balanceOf[to] += amount;
}
emit Transfer(address(0), to, amount);
}
function _burn(address from, uint256 amount) internal virtual {
balanceOf[from] -= amount;
// Cannot underflow because a user's balance
// will never be larger than the total supply.
unchecked {
totalSupply -= amount;
}
emit Transfer(from, address(0), amount);
}
}pragma solidity ^0.8.0;
interface IPriceFeed {
/**
* @notice The precision of the value being returned from the price feed.
*/
function decimals() external view returns (uint8);
/**
* @notice Return oracle data for Chainlink or Redstone price feeds.
*/
function latestRoundData()
external
view
returns (uint80 roundId, int256 answer, uint256 startedAt, uint256 updatedAt, uint80 answeredInRound);
function description() external view returns (string memory);
function getDataFeedId() external view returns (bytes32);
}// SPDX-License-Identifier: GPL-3.0-or-later
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
// You should have received a copy of the GNU General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
pragma solidity ^0.8.0;
interface IRateProvider {
function getRate() external view returns (uint256);
}{
"evmVersion": "shanghai",
"libraries": {},
"metadata": {
"appendCBOR": true,
"bytecodeHash": "ipfs",
"useLiteralContent": false
},
"optimizer": {
"enabled": true,
"runs": 200
},
"outputSelection": {
"*": {
"*": [
"evm.bytecode",
"evm.deployedBytecode",
"devdoc",
"userdoc",
"metadata",
"abi"
]
}
},
"remappings": [
"@solmate/=lib/solmate/src/",
"@forge-std/=lib/forge-std/src/",
"forge-std/=lib/forge-std/src/",
"@ds-test/=lib/forge-std/lib/ds-test/src/",
"ds-test/=lib/forge-std/lib/ds-test/src/",
"@openzeppelin/=lib/openzeppelin-contracts/",
"@ion-protocol/=lib/ion-protocol/src/",
"@layerzerolabs/=node_modules/@layerzerolabs/",
"@axelar-network/=node_modules/@axelar-network/",
"@balancer-labs/v2-interfaces/=lib/ion-protocol/lib/balancer-v2-monorepo/pkg/interfaces/",
"@balancer-labs/v2-pool-stable/=lib/ion-protocol/lib/balancer-v2-monorepo/pkg/pool-stable/",
"@chainlink/=node_modules/@chainlink/",
"@chainlink/contracts/=lib/ion-protocol/lib/chainlink/contracts/",
"@eth-optimism/=node_modules/@eth-optimism/",
"@openzeppelin/contracts-upgradeable/=lib/ion-protocol/lib/openzeppelin-contracts-upgradeable/contracts/",
"@openzeppelin/contracts/=lib/openzeppelin-contracts/contracts/",
"@uniswap/v3-core/=lib/ion-protocol/lib/v3-core/",
"@uniswap/v3-periphery/=lib/ion-protocol/lib/v3-periphery/",
"balancer-v2-monorepo/=lib/ion-protocol/lib/",
"chainlink/=lib/ion-protocol/lib/chainlink/",
"createx/=lib/createx/src/",
"erc4626-tests/=lib/openzeppelin-contracts/lib/erc4626-tests/",
"forge-safe/=lib/ion-protocol/lib/forge-safe/",
"halmos-cheatcodes/=lib/openzeppelin-contracts/lib/halmos-cheatcodes/src/",
"hardhat-deploy/=node_modules/hardhat-deploy/",
"ion-protocol/=lib/ion-protocol/",
"openzeppelin-contracts-upgradeable/=lib/ion-protocol/lib/openzeppelin-contracts-upgradeable/",
"openzeppelin-contracts/=lib/openzeppelin-contracts/",
"openzeppelin/=lib/createx/lib/openzeppelin-contracts/contracts/",
"pendle-core-v2-public/=lib/ion-protocol/lib/pendle-core-v2-public/contracts/",
"solady/=lib/ion-protocol/lib/solady/",
"solarray/=lib/ion-protocol/lib/solarray/src/",
"solidity-bytes-utils/=node_modules/solidity-bytes-utils/",
"solidity-stringutils/=lib/ion-protocol/lib/forge-safe/lib/surl/lib/solidity-stringutils/",
"solmate/=lib/solmate/src/",
"surl/=lib/ion-protocol/lib/forge-safe/lib/surl/",
"v3-core/=lib/ion-protocol/lib/v3-core/",
"v3-periphery/=lib/v3-periphery/contracts/"
],
"viaIR": false
}Contract Security Audit
- No Contract Security Audit Submitted- Submit Audit Here
Contract ABI
API[{"inputs":[{"internalType":"string","name":"_descriptionBaseFeed","type":"string"},{"internalType":"string","name":"_descriptionQuoteFeed","type":"string"},{"internalType":"contract ERC20","name":"_quoteAsset","type":"address"},{"internalType":"contract IPriceFeed","name":"_baseFeed","type":"address"},{"internalType":"contract IPriceFeed","name":"_quoteFeed","type":"address"},{"internalType":"uint256","name":"_maxTimeFromLastUpdateBaseFeed","type":"uint256"},{"internalType":"uint256","name":"_maxTimeFromLastUpdateQuoteFeed","type":"uint256"},{"internalType":"uint64","name":"_sequencerDowntimeLimit","type":"uint64"},{"internalType":"address","name":"governor","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"inputs":[],"name":"AccessControlBadConfirmation","type":"error"},{"inputs":[{"internalType":"address","name":"account","type":"address"},{"internalType":"bytes32","name":"neededRole","type":"bytes32"}],"name":"AccessControlUnauthorizedAccount","type":"error"},{"inputs":[{"internalType":"uint256","name":"rate","type":"uint256"},{"internalType":"uint256","name":"violatedBound","type":"uint256"}],"name":"BoundsViolated","type":"error"},{"inputs":[],"name":"InvalidDescription","type":"error"},{"inputs":[{"internalType":"uint8","name":"priceFeedDecimals","type":"uint8"}],"name":"InvalidPriceFeedDecimals","type":"error"},{"inputs":[{"internalType":"uint256","name":"blockTimestamp","type":"uint256"},{"internalType":"uint256","name":"lastUpdated","type":"uint256"}],"name":"MaxTimeFromLastUpdatePassed","type":"error"},{"inputs":[{"internalType":"int256","name":"value","type":"int256"}],"name":"SafeCastOverflowedIntToUint","type":"error"},{"inputs":[],"name":"SequencerIsDown","type":"error"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"role","type":"bytes32"},{"indexed":true,"internalType":"bytes32","name":"previousAdminRole","type":"bytes32"},{"indexed":true,"internalType":"bytes32","name":"newAdminRole","type":"bytes32"}],"name":"RoleAdminChanged","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"role","type":"bytes32"},{"indexed":true,"internalType":"address","name":"account","type":"address"},{"indexed":true,"internalType":"address","name":"sender","type":"address"}],"name":"RoleGranted","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"role","type":"bytes32"},{"indexed":true,"internalType":"address","name":"account","type":"address"},{"indexed":true,"internalType":"address","name":"sender","type":"address"}],"name":"RoleRevoked","type":"event"},{"inputs":[],"name":"DEFAULT_ADMIN_ROLE","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"DESCRIPTION_BaseFeed","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"DESCRIPTION_QuoteFeed","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"MAX_RATE","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"MAX_TIME_FROM_LAST_UPDATE_BASE_FEED","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"MAX_TIME_FROM_LAST_UPDATE_QUOTE_FEED","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"ONE","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"PRICE_FEED_BaseFeed","outputs":[{"internalType":"contract IPriceFeed","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"PRICE_FEED_QuoteFeed","outputs":[{"internalType":"contract IPriceFeed","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"RATE_DECIMALS","outputs":[{"internalType":"uint8","name":"","type":"uint8"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"SCALE","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getRate","outputs":[{"internalType":"uint256","name":"rate","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"}],"name":"getRoleAdmin","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"grantRole","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"hasRole","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"isSequencerDown","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"lowerBound","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"callerConfirmation","type":"address"}],"name":"renounceRole","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"revokeRole","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"sequencerDowntimeLimit","outputs":[{"internalType":"uint64","name":"","type":"uint64"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"sequencerStartedAt","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint16","name":"_lowerBoundInBps","type":"uint16"}],"name":"setLowerBound","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint16","name":"_maxRateInBps","type":"uint16"}],"name":"setMaxRate","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint64","name":"_sequencerDowntimeLimit","type":"uint64"}],"name":"setSequencerDowntimeLimit","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes4","name":"interfaceId","type":"bytes4"}],"name":"supportsInterface","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bool","name":"isDown","type":"bool"},{"internalType":"uint256","name":"startedAt","type":"uint256"}],"name":"updateSequencerStatus","outputs":[],"stateMutability":"nonpayable","type":"function"}]Contract Creation Code
61016060405234801562000011575f80fd5b5060405162001bed38038062001bed8339810160408190526200003491620006be565b620000a489876001600160a01b0316637284e4166040518163ffffffff1660e01b81526004015f60405180830381865afa15801562000075573d5f803e3d5ffd5b505050506040513d5f823e601f3d908101601f191682016040526200009e919081019062000796565b620003e1565b620000c2576040516340132f1f60e01b815260040160405180910390fd5b6200010388866001600160a01b0316637284e4166040518163ffffffff1660e01b81526004015f60405180830381865afa15801562000075573d5f803e3d5ffd5b62000121576040516340132f1f60e01b815260040160405180910390fd5b866001600160a01b031663313ce5676040518163ffffffff1660e01b8152600401602060405180830381865afa1580156200015e573d5f803e3d5ffd5b505050506040513d601f19601f82011682018060405250810190620001849190620007d3565b60ff166101008160ff16815250505f866001600160a01b031663313ce5676040518163ffffffff1660e01b8152600401602060405180830381865afa158015620001d0573d5f803e3d5ffd5b505050506040513d601f19601f82011682018060405250810190620001f69190620007d3565b90505f866001600160a01b031663313ce5676040518163ffffffff1660e01b8152600401602060405180830381865afa15801562000236573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906200025c9190620007d3565b9050620002748282610100516200043e60201b60201c565b61012052610100516200028990600a62000909565b6101405260016200029b8c82620009a5565b506002620002aa8b82620009a5565b506001600160a01b03808916608052871660a05260c086905260e08590526101005161271090620002dd90600a62000909565b620002eb9061270b62000a6d565b620002f7919062000a87565b600355610100516200030b90600a62000909565b600455600580546001600160481b0319166001600160401b03861617680100000000000000001790556200034e5f8051602062001bcd83398151915280620004cc565b620003887f8b5b16d04624687fcf0d0228f19993c9157c1ed07b41d8d430fd9100eb099fe85f8051602062001bcd833981519152620004cc565b620003a25f8051602062001bcd8339815191528462000516565b50620003cf7f8b5b16d04624687fcf0d0228f19993c9157c1ed07b41d8d430fd9100eb099fe88462000516565b50505050505050505050505062000ae0565b5f81604051602001620003f5919062000aa7565b60405160208183030381529060405280519060200120836040516020016200041e919062000aa7565b604051602081830303815290604052805190602001201490505b92915050565b5f601260ff83161180620004555750601260ff8516115b80620004645750601260ff8416115b156200048a5760405163ec18ce9b60e01b81526012600482015260240160405180910390fd5b5f62000497858462000ac4565b620004a490600a62000909565b90505f620004b485600a62000909565b9050620004c2818362000a87565b9695505050505050565b5f82815260208190526040808220600101805490849055905190918391839186917fbd79b86ffe0ab8e8776151514217cd7cacd52c909f66475c3af44e129f0b00ff9190a4505050565b5f828152602081815260408083206001600160a01b038516845290915281205460ff16620005b9575f838152602081815260408083206001600160a01b03861684529091529020805460ff19166001179055620005703390565b6001600160a01b0316826001600160a01b0316847f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a450600162000438565b505f62000438565b634e487b7160e01b5f52604160045260245ffd5b5f5b83811015620005f1578181015183820152602001620005d7565b50505f910152565b5f82601f83011262000609575f80fd5b81516001600160401b0380821115620006265762000626620005c1565b604051601f8301601f19908116603f01168101908282118183101715620006515762000651620005c1565b816040528381528660208588010111156200066a575f80fd5b620004c2846020830160208901620005d5565b6001600160a01b038116811462000692575f80fd5b50565b8051620006a2816200067d565b919050565b80516001600160401b0381168114620006a2575f80fd5b5f805f805f805f805f6101208a8c031215620006d8575f80fd5b89516001600160401b0380821115620006ef575f80fd5b620006fd8d838e01620005f9565b9a5060208c015191508082111562000713575f80fd5b50620007228c828d01620005f9565b98505060408a015162000735816200067d565b60608b015190975062000748816200067d565b95506200075860808b0162000695565b945060a08a0151935060c08a015192506200077660e08b01620006a7565b9150620007876101008b0162000695565b90509295985092959850929598565b5f60208284031215620007a7575f80fd5b81516001600160401b03811115620007bd575f80fd5b620007cb84828501620005f9565b949350505050565b5f60208284031215620007e4575f80fd5b815160ff81168114620007f5575f80fd5b9392505050565b634e487b7160e01b5f52601160045260245ffd5b600181815b808511156200085057815f1904821115620008345762000834620007fc565b808516156200084257918102915b93841c939080029062000815565b509250929050565b5f82620008685750600162000438565b816200087657505f62000438565b81600181146200088f57600281146200089a57620008ba565b600191505062000438565b60ff841115620008ae57620008ae620007fc565b50506001821b62000438565b5060208310610133831016604e8410600b8410161715620008df575081810a62000438565b620008eb838362000810565b805f1904821115620009015762000901620007fc565b029392505050565b5f620007f560ff84168362000858565b600181811c908216806200092e57607f821691505b6020821081036200094d57634e487b7160e01b5f52602260045260245ffd5b50919050565b601f821115620009a0575f81815260208120601f850160051c810160208610156200097b5750805b601f850160051c820191505b818110156200099c5782815560010162000987565b5050505b505050565b81516001600160401b03811115620009c157620009c1620005c1565b620009d981620009d2845462000919565b8462000953565b602080601f83116001811462000a0f575f8415620009f75750858301515b5f19600386901b1c1916600185901b1785556200099c565b5f85815260208120601f198616915b8281101562000a3f5788860151825594840194600190910190840162000a1e565b508582101562000a5d57878501515f19600388901b60f8161c191681555b5050505050600190811b01905550565b8082028115828204841417620004385762000438620007fc565b5f8262000aa257634e487b7160e01b5f52601260045260245ffd5b500490565b5f825162000aba818460208701620005d5565b9190910192915050565b60ff8181168382160190811115620004385762000438620007fc565b60805160a05160c05160e05161010051610120516101405161106a62000b635f395f61036701525f818161041d0152610c5201525f8181610294015281816109a20152610a6f01525f818161026d015261078c01525f8181610396015261065201525f81816103f601526106fc01525f81816102cd01526105c2015261106a5ff3fe608060405234801561000f575f80fd5b5060043610610186575f3560e01c806387a9cc0e116100d9578063cedec17211610093578063d5a8b5cc1161006e578063d5a8b5cc146103cb578063d63f185f146103de578063e7ddfaeb146103f1578063eced552614610418575f80fd5b8063cedec17214610389578063d3aeabf314610391578063d547741f146103b8575f80fd5b806387a9cc0e1461032357806391d1485414610336578063a217fddf14610349578063a384d6ff14610350578063c24dbebd14610359578063c2ee3a0814610362575f80fd5b806354bdfbd6116101445780635a604c521161011f5780635a604c521461028f5780635eadb213146102c8578063679aefce14610307578063682d347e1461030f575f80fd5b806354bdfbd61461024c5780635728fea11461025f57806357b8ba2614610268575f80fd5b80627314051461018a57806301ffc9a7146101bc578063248a9ca3146101df5780632f2ff15d1461020f57806336568abe146102245780633a6887a514610237575b5f80fd5b60055461019e9067ffffffffffffffff1681565b60405167ffffffffffffffff90911681526020015b60405180910390f35b6101cf6101ca366004610d08565b61043f565b60405190151581526020016101b3565b6102016101ed366004610d36565b5f9081526020819052604090206001015490565b6040519081526020016101b3565b61022261021d366004610d4d565b610475565b005b610222610232366004610d4d565b61049f565b61023f6104d7565b6040516101b39190610d86565b61022261025a366004610dd1565b610563565b61020160065481565b6102017f000000000000000000000000000000000000000000000000000000000000000081565b6102b67f000000000000000000000000000000000000000000000000000000000000000081565b60405160ff90911681526020016101b3565b6102ef7f000000000000000000000000000000000000000000000000000000000000000081565b6040516001600160a01b0390911681526020016101b3565b6102016105b5565b6005546101cf90600160401b900460ff1681565b610222610331366004610dff565b610863565b6101cf610344366004610d4d565b6108b2565b6102015f81565b61020160035481565b61020160045481565b6102017f000000000000000000000000000000000000000000000000000000000000000081565b61023f6108da565b6102017f000000000000000000000000000000000000000000000000000000000000000081565b6102226103c6366004610d4d565b6108e7565b6102226103d9366004610e26565b61090b565b6102226103ec366004610e26565b6109e3565b6102ef7f000000000000000000000000000000000000000000000000000000000000000081565b6102017f000000000000000000000000000000000000000000000000000000000000000081565b5f6001600160e01b03198216637965db0b60e01b148061046f57506301ffc9a760e01b6001600160e01b03198316145b92915050565b5f8281526020819052604090206001015461048f81610ab0565b6104998383610abd565b50505050565b6001600160a01b03811633146104c85760405163334bd91960e11b815260040160405180910390fd5b6104d28282610b4c565b505050565b600280546104e490610e47565b80601f016020809104026020016040519081016040528092919081815260200182805461051090610e47565b801561055b5780601f106105325761010080835404028352916020019161055b565b820191905f5260205f20905b81548152906001019060200180831161053e57829003601f168201915b505050505081565b7f8b5b16d04624687fcf0d0228f19993c9157c1ed07b41d8d430fd9100eb099fe861058d81610ab0565b5060058054921515600160401b0268ff00000000000000001990931692909217909155600655565b5f6105be610bb5565b5f807f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031663feaf968c6040518163ffffffff1660e01b815260040160a060405180830381865afa15801561061c573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906106409190610e9d565b509350509250504281118061067d57507f000000000000000000000000000000000000000000000000000000000000000061067b8242610efd565b115b156106a95760405163060c874960e51b8152426004820152602481018290526044015b60405180910390fd5b5f82136106f85760405162461bcd60e51b815260206004820181905260248201527f426173652072617465206d7573742062652067726561746572207468616e203060448201526064016106a0565b5f807f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031663feaf968c6040518163ffffffff1660e01b815260040160a060405180830381865afa158015610756573d5f803e3d5ffd5b505050506040513d601f19601f8201168201806040525081019061077a9190610e9d565b50935050925050428111806107b757507f00000000000000000000000000000000000000000000000000000000000000006107b58242610efd565b115b156107de5760405163060c874960e51b8152426004820152602481018290526044016106a0565b5f82136108375760405162461bcd60e51b815260206004820152602160248201527f51756f74652072617465206d7573742062652067726561746572207468616e206044820152600360fc1b60648201526084016106a0565b61085161084385610c21565b61084c84610c21565b610c4a565b945061085c85610c9e565b5050505090565b7f35a7846a2a701fff6f9d61a46ebff5da578c5dcee8bdf361c569f9ea4ee6477161088d81610ab0565b506005805467ffffffffffffffff191667ffffffffffffffff92909216919091179055565b5f918252602082815260408084206001600160a01b0393909316845291905290205460ff1690565b600180546104e490610e47565b5f8281526020819052604090206001015461090181610ab0565b6104998383610b4c565b7f35a7846a2a701fff6f9d61a46ebff5da578c5dcee8bdf361c569f9ea4ee6477161093581610ab0565b6127108261ffff16106109955760405162461bcd60e51b815260206004820152602260248201527f4c6f77657220626f756e64206d757374206265206c657373207468616e203130604482015261302560f01b60648201526084016106a0565b61271061ffff83166109c87f0000000000000000000000000000000000000000000000000000000000000000600a610ff0565b6109d29190610ffe565b6109dc9190611015565b6003555050565b7f35a7846a2a701fff6f9d61a46ebff5da578c5dcee8bdf361c569f9ea4ee64771610a0d81610ab0565b612af88261ffff1610610a625760405162461bcd60e51b815260206004820152601f60248201527f4d61782072617465206d757374206265206c657373207468616e20313130250060448201526064016106a0565b61271061ffff8316610a957f0000000000000000000000000000000000000000000000000000000000000000600a610ff0565b610a9f9190610ffe565b610aa99190611015565b6004555050565b610aba8133610ccf565b50565b5f610ac883836108b2565b610b45575f838152602081815260408083206001600160a01b03861684529091529020805460ff19166001179055610afd3390565b6001600160a01b0316826001600160a01b0316847f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a450600161046f565b505f61046f565b5f610b5783836108b2565b15610b45575f838152602081815260408083206001600160a01b0386168085529252808320805460ff1916905551339286917ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b9190a450600161046f565b600554600160401b900460ff1615610be0576040516358693ae360e11b815260040160405180910390fd5b6006545f610bee8242610efd565b60055490915067ffffffffffffffff168111610c1d576040516358693ae360e11b815260040160405180910390fd5b5050565b5f80821215610c4657604051635467221960e11b8152600481018390526024016106a0565b5090565b5f8083610c777f000000000000000000000000000000000000000000000000000000000000000085610ffe565b610c819190611015565b90506004548111610c925780610c96565b6004545b949350505050565b600354811015610aba57600354604051630996fda760e41b81526106a0918391600401918252602082015260400190565b610cd982826108b2565b610c1d5760405163e2517d3f60e01b81526001600160a01b0382166004820152602481018390526044016106a0565b5f60208284031215610d18575f80fd5b81356001600160e01b031981168114610d2f575f80fd5b9392505050565b5f60208284031215610d46575f80fd5b5035919050565b5f8060408385031215610d5e575f80fd5b8235915060208301356001600160a01b0381168114610d7b575f80fd5b809150509250929050565b5f6020808352835180828501525f5b81811015610db157858101830151858201604001528201610d95565b505f604082860101526040601f19601f8301168501019250505092915050565b5f8060408385031215610de2575f80fd5b82358015158114610df1575f80fd5b946020939093013593505050565b5f60208284031215610e0f575f80fd5b813567ffffffffffffffff81168114610d2f575f80fd5b5f60208284031215610e36575f80fd5b813561ffff81168114610d2f575f80fd5b600181811c90821680610e5b57607f821691505b602082108103610e7957634e487b7160e01b5f52602260045260245ffd5b50919050565b805169ffffffffffffffffffff81168114610e98575f80fd5b919050565b5f805f805f60a08688031215610eb1575f80fd5b610eba86610e7f565b9450602086015193506040860151925060608601519150610edd60808701610e7f565b90509295509295909350565b634e487b7160e01b5f52601160045260245ffd5b8181038181111561046f5761046f610ee9565b600181815b80851115610f4a57815f1904821115610f3057610f30610ee9565b80851615610f3d57918102915b93841c9390800290610f15565b509250929050565b5f82610f605750600161046f565b81610f6c57505f61046f565b8160018114610f825760028114610f8c57610fa8565b600191505061046f565b60ff841115610f9d57610f9d610ee9565b50506001821b61046f565b5060208310610133831016604e8410600b8410161715610fcb575081810a61046f565b610fd58383610f10565b805f1904821115610fe857610fe8610ee9565b029392505050565b5f610d2f60ff841683610f52565b808202811582820484141761046f5761046f610ee9565b5f8261102f57634e487b7160e01b5f52601260045260245ffd5b50049056fea264697066735822122043e83d693311c8de8ed37bb0c37029a4e638d6abdcbdd1f41b68a4492704b58364736f6c6343000815003335a7846a2a701fff6f9d61a46ebff5da578c5dcee8bdf361c569f9ea4ee6477100000000000000000000000000000000000000000000000000000000000001200000000000000000000000000000000000000000000000000000000000000160000000000000000000000000b8ce59fc3717ada4c02eadf9682a9e934f625ebb0000000000000000000000004c89968338b75551243c99b452c84a01888282fd0000000000000000000000005e21f6530f656a38cae4f55500944753f662d184000000000000000000000000000000000000000000000000000000000000546000000000000000000000000000000000000000000000000000000000000054600000000000000000000000000000000000000000000000000000000000000e100000000000000000000000003cfb6b7fc75f8a7141a67eaed3ee3cb366cae237000000000000000000000000000000000000000000000000000000000000001c52656453746f6e65205072696365204665656420666f72205553444300000000000000000000000000000000000000000000000000000000000000000000001c52656453746f6e65205072696365204665656420666f72205553445400000000
Deployed Bytecode
0x608060405234801561000f575f80fd5b5060043610610186575f3560e01c806387a9cc0e116100d9578063cedec17211610093578063d5a8b5cc1161006e578063d5a8b5cc146103cb578063d63f185f146103de578063e7ddfaeb146103f1578063eced552614610418575f80fd5b8063cedec17214610389578063d3aeabf314610391578063d547741f146103b8575f80fd5b806387a9cc0e1461032357806391d1485414610336578063a217fddf14610349578063a384d6ff14610350578063c24dbebd14610359578063c2ee3a0814610362575f80fd5b806354bdfbd6116101445780635a604c521161011f5780635a604c521461028f5780635eadb213146102c8578063679aefce14610307578063682d347e1461030f575f80fd5b806354bdfbd61461024c5780635728fea11461025f57806357b8ba2614610268575f80fd5b80627314051461018a57806301ffc9a7146101bc578063248a9ca3146101df5780632f2ff15d1461020f57806336568abe146102245780633a6887a514610237575b5f80fd5b60055461019e9067ffffffffffffffff1681565b60405167ffffffffffffffff90911681526020015b60405180910390f35b6101cf6101ca366004610d08565b61043f565b60405190151581526020016101b3565b6102016101ed366004610d36565b5f9081526020819052604090206001015490565b6040519081526020016101b3565b61022261021d366004610d4d565b610475565b005b610222610232366004610d4d565b61049f565b61023f6104d7565b6040516101b39190610d86565b61022261025a366004610dd1565b610563565b61020160065481565b6102017f000000000000000000000000000000000000000000000000000000000000546081565b6102b67f000000000000000000000000000000000000000000000000000000000000000681565b60405160ff90911681526020016101b3565b6102ef7f0000000000000000000000004c89968338b75551243c99b452c84a01888282fd81565b6040516001600160a01b0390911681526020016101b3565b6102016105b5565b6005546101cf90600160401b900460ff1681565b610222610331366004610dff565b610863565b6101cf610344366004610d4d565b6108b2565b6102015f81565b61020160035481565b61020160045481565b6102017f00000000000000000000000000000000000000000000000000000000000f424081565b61023f6108da565b6102017f000000000000000000000000000000000000000000000000000000000000546081565b6102226103c6366004610d4d565b6108e7565b6102226103d9366004610e26565b61090b565b6102226103ec366004610e26565b6109e3565b6102ef7f0000000000000000000000005e21f6530f656a38cae4f55500944753f662d18481565b6102017f00000000000000000000000000000000000000000000000000000000000f424081565b5f6001600160e01b03198216637965db0b60e01b148061046f57506301ffc9a760e01b6001600160e01b03198316145b92915050565b5f8281526020819052604090206001015461048f81610ab0565b6104998383610abd565b50505050565b6001600160a01b03811633146104c85760405163334bd91960e11b815260040160405180910390fd5b6104d28282610b4c565b505050565b600280546104e490610e47565b80601f016020809104026020016040519081016040528092919081815260200182805461051090610e47565b801561055b5780601f106105325761010080835404028352916020019161055b565b820191905f5260205f20905b81548152906001019060200180831161053e57829003601f168201915b505050505081565b7f8b5b16d04624687fcf0d0228f19993c9157c1ed07b41d8d430fd9100eb099fe861058d81610ab0565b5060058054921515600160401b0268ff00000000000000001990931692909217909155600655565b5f6105be610bb5565b5f807f0000000000000000000000004c89968338b75551243c99b452c84a01888282fd6001600160a01b031663feaf968c6040518163ffffffff1660e01b815260040160a060405180830381865afa15801561061c573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906106409190610e9d565b509350509250504281118061067d57507f000000000000000000000000000000000000000000000000000000000000546061067b8242610efd565b115b156106a95760405163060c874960e51b8152426004820152602481018290526044015b60405180910390fd5b5f82136106f85760405162461bcd60e51b815260206004820181905260248201527f426173652072617465206d7573742062652067726561746572207468616e203060448201526064016106a0565b5f807f0000000000000000000000005e21f6530f656a38cae4f55500944753f662d1846001600160a01b031663feaf968c6040518163ffffffff1660e01b815260040160a060405180830381865afa158015610756573d5f803e3d5ffd5b505050506040513d601f19601f8201168201806040525081019061077a9190610e9d565b50935050925050428111806107b757507f00000000000000000000000000000000000000000000000000000000000054606107b58242610efd565b115b156107de5760405163060c874960e51b8152426004820152602481018290526044016106a0565b5f82136108375760405162461bcd60e51b815260206004820152602160248201527f51756f74652072617465206d7573742062652067726561746572207468616e206044820152600360fc1b60648201526084016106a0565b61085161084385610c21565b61084c84610c21565b610c4a565b945061085c85610c9e565b5050505090565b7f35a7846a2a701fff6f9d61a46ebff5da578c5dcee8bdf361c569f9ea4ee6477161088d81610ab0565b506005805467ffffffffffffffff191667ffffffffffffffff92909216919091179055565b5f918252602082815260408084206001600160a01b0393909316845291905290205460ff1690565b600180546104e490610e47565b5f8281526020819052604090206001015461090181610ab0565b6104998383610b4c565b7f35a7846a2a701fff6f9d61a46ebff5da578c5dcee8bdf361c569f9ea4ee6477161093581610ab0565b6127108261ffff16106109955760405162461bcd60e51b815260206004820152602260248201527f4c6f77657220626f756e64206d757374206265206c657373207468616e203130604482015261302560f01b60648201526084016106a0565b61271061ffff83166109c87f0000000000000000000000000000000000000000000000000000000000000006600a610ff0565b6109d29190610ffe565b6109dc9190611015565b6003555050565b7f35a7846a2a701fff6f9d61a46ebff5da578c5dcee8bdf361c569f9ea4ee64771610a0d81610ab0565b612af88261ffff1610610a625760405162461bcd60e51b815260206004820152601f60248201527f4d61782072617465206d757374206265206c657373207468616e20313130250060448201526064016106a0565b61271061ffff8316610a957f0000000000000000000000000000000000000000000000000000000000000006600a610ff0565b610a9f9190610ffe565b610aa99190611015565b6004555050565b610aba8133610ccf565b50565b5f610ac883836108b2565b610b45575f838152602081815260408083206001600160a01b03861684529091529020805460ff19166001179055610afd3390565b6001600160a01b0316826001600160a01b0316847f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a450600161046f565b505f61046f565b5f610b5783836108b2565b15610b45575f838152602081815260408083206001600160a01b0386168085529252808320805460ff1916905551339286917ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b9190a450600161046f565b600554600160401b900460ff1615610be0576040516358693ae360e11b815260040160405180910390fd5b6006545f610bee8242610efd565b60055490915067ffffffffffffffff168111610c1d576040516358693ae360e11b815260040160405180910390fd5b5050565b5f80821215610c4657604051635467221960e11b8152600481018390526024016106a0565b5090565b5f8083610c777f00000000000000000000000000000000000000000000000000000000000f424085610ffe565b610c819190611015565b90506004548111610c925780610c96565b6004545b949350505050565b600354811015610aba57600354604051630996fda760e41b81526106a0918391600401918252602082015260400190565b610cd982826108b2565b610c1d5760405163e2517d3f60e01b81526001600160a01b0382166004820152602481018390526044016106a0565b5f60208284031215610d18575f80fd5b81356001600160e01b031981168114610d2f575f80fd5b9392505050565b5f60208284031215610d46575f80fd5b5035919050565b5f8060408385031215610d5e575f80fd5b8235915060208301356001600160a01b0381168114610d7b575f80fd5b809150509250929050565b5f6020808352835180828501525f5b81811015610db157858101830151858201604001528201610d95565b505f604082860101526040601f19601f8301168501019250505092915050565b5f8060408385031215610de2575f80fd5b82358015158114610df1575f80fd5b946020939093013593505050565b5f60208284031215610e0f575f80fd5b813567ffffffffffffffff81168114610d2f575f80fd5b5f60208284031215610e36575f80fd5b813561ffff81168114610d2f575f80fd5b600181811c90821680610e5b57607f821691505b602082108103610e7957634e487b7160e01b5f52602260045260245ffd5b50919050565b805169ffffffffffffffffffff81168114610e98575f80fd5b919050565b5f805f805f60a08688031215610eb1575f80fd5b610eba86610e7f565b9450602086015193506040860151925060608601519150610edd60808701610e7f565b90509295509295909350565b634e487b7160e01b5f52601160045260245ffd5b8181038181111561046f5761046f610ee9565b600181815b80851115610f4a57815f1904821115610f3057610f30610ee9565b80851615610f3d57918102915b93841c9390800290610f15565b509250929050565b5f82610f605750600161046f565b81610f6c57505f61046f565b8160018114610f825760028114610f8c57610fa8565b600191505061046f565b60ff841115610f9d57610f9d610ee9565b50506001821b61046f565b5060208310610133831016604e8410600b8410161715610fcb575081810a61046f565b610fd58383610f10565b805f1904821115610fe857610fe8610ee9565b029392505050565b5f610d2f60ff841683610f52565b808202811582820484141761046f5761046f610ee9565b5f8261102f57634e487b7160e01b5f52601260045260245ffd5b50049056fea264697066735822122043e83d693311c8de8ed37bb0c37029a4e638d6abdcbdd1f41b68a4492704b58364736f6c63430008150033
Constructor Arguments (ABI-Encoded and is the last bytes of the Contract Creation Code above)
00000000000000000000000000000000000000000000000000000000000001200000000000000000000000000000000000000000000000000000000000000160000000000000000000000000b8ce59fc3717ada4c02eadf9682a9e934f625ebb0000000000000000000000004c89968338b75551243c99b452c84a01888282fd0000000000000000000000005e21f6530f656a38cae4f55500944753f662d184000000000000000000000000000000000000000000000000000000000000546000000000000000000000000000000000000000000000000000000000000054600000000000000000000000000000000000000000000000000000000000000e100000000000000000000000003cfb6b7fc75f8a7141a67eaed3ee3cb366cae237000000000000000000000000000000000000000000000000000000000000001c52656453746f6e65205072696365204665656420666f72205553444300000000000000000000000000000000000000000000000000000000000000000000001c52656453746f6e65205072696365204665656420666f72205553445400000000
-----Decoded View---------------
Arg [0] : _descriptionBaseFeed (string): RedStone Price Feed for USDC
Arg [1] : _descriptionQuoteFeed (string): RedStone Price Feed for USDT
Arg [2] : _quoteAsset (address): 0xB8CE59FC3717ada4C02eaDF9682A9e934F625ebb
Arg [3] : _baseFeed (address): 0x4C89968338b75551243C99B452c84a01888282fD
Arg [4] : _quoteFeed (address): 0x5e21f6530f656A38caE4F55500944753F662D184
Arg [5] : _maxTimeFromLastUpdateBaseFeed (uint256): 21600
Arg [6] : _maxTimeFromLastUpdateQuoteFeed (uint256): 21600
Arg [7] : _sequencerDowntimeLimit (uint64): 3600
Arg [8] : governor (address): 0x3CFb6B7FC75f8A7141a67eAed3Ee3cB366CAE237
-----Encoded View---------------
13 Constructor Arguments found :
Arg [0] : 0000000000000000000000000000000000000000000000000000000000000120
Arg [1] : 0000000000000000000000000000000000000000000000000000000000000160
Arg [2] : 000000000000000000000000b8ce59fc3717ada4c02eadf9682a9e934f625ebb
Arg [3] : 0000000000000000000000004c89968338b75551243c99b452c84a01888282fd
Arg [4] : 0000000000000000000000005e21f6530f656a38cae4f55500944753f662d184
Arg [5] : 0000000000000000000000000000000000000000000000000000000000005460
Arg [6] : 0000000000000000000000000000000000000000000000000000000000005460
Arg [7] : 0000000000000000000000000000000000000000000000000000000000000e10
Arg [8] : 0000000000000000000000003cfb6b7fc75f8a7141a67eaed3ee3cb366cae237
Arg [9] : 000000000000000000000000000000000000000000000000000000000000001c
Arg [10] : 52656453746f6e65205072696365204665656420666f72205553444300000000
Arg [11] : 000000000000000000000000000000000000000000000000000000000000001c
Arg [12] : 52656453746f6e65205072696365204665656420666f72205553445400000000
Loading...
Loading
Loading...
Loading
Loading...
Loading
Net Worth in USD
$0.00
Net Worth in HYPE
Multichain Portfolio | 35 Chains
| Chain | Token | Portfolio % | Price | Amount | Value |
|---|
Loading...
Loading
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.