Source Code
Overview
ETH Balance
0 ETH
ETH Value
$0.00Latest 1 from a total of 1 transactions
| Transaction Hash |
Method
|
Block
|
From
|
To
|
|||||
|---|---|---|---|---|---|---|---|---|---|
| Grant Role | 13864515 | 53 days ago | IN | 0 ETH | 0.00000148 |
Cross-Chain Transactions
Loading...
Loading
Contract Name:
API3WrapperWithThresholding
Compiler Version
v0.8.22+commit.4fc1097e
Contract Source Code (Solidity Standard Json-Input format)
// SPDX-License-Identifier: MIT
/* ———————————————————————————————————————————————————————————————————————————————— *
* _____ ______ ______ __ __ __ __ ______ __ __ *
* /\ __-. /\__ _\ /\ == \ /\ \ /\ "-.\ \ /\ \ /\__ _\ /\ \_\ \ *
* \ \ \/\ \ \/_/\ \/ \ \ __< \ \ \ \ \ \-. \ \ \ \ \/_/\ \/ \ \____ \ *
* \ \____- \ \_\ \ \_\ \_\ \ \_\ \ \_\\"\_\ \ \_\ \ \_\ \/\_____\ *
* \/____/ \/_/ \/_/ /_/ \/_/ \/_/ \/_/ \/_/ \/_/ \/_____/ *
* *
* ————————————————————————————————— dtrinity.org ————————————————————————————————— *
* *
* ▲ *
* ▲ ▲ *
* *
* ———————————————————————————————————————————————————————————————————————————————— *
* dTRINITY Protocol: https://github.com/dtrinity *
* ———————————————————————————————————————————————————————————————————————————————— */
pragma solidity ^0.8.20;
import "./API3Wrapper.sol";
import "./ThresholdingUtils.sol";
import "@openzeppelin/contracts/access/Ownable.sol";
contract API3WrapperWithThresholding is API3Wrapper, ThresholdingUtils {
/* State */
mapping(address => ThresholdConfig) public assetThresholds;
/* Events */
event ThresholdConfigSet(address indexed asset, uint256 lowerThresholdInBase, uint256 fixedPriceInBase);
event ThresholdConfigRemoved(address indexed asset);
constructor(address baseCurrency, uint256 _baseCurrencyUnit) API3Wrapper(baseCurrency, _baseCurrencyUnit) {}
function getPriceInfo(address asset) public view override returns (uint256 price, bool isAlive) {
(price, isAlive) = super.getPriceInfo(asset);
if (isAlive) {
ThresholdConfig memory config = assetThresholds[asset];
if (config.lowerThresholdInBase > 0) {
price = _applyThreshold(price, config);
}
}
}
function setThresholdConfig(
address asset,
uint256 lowerThresholdInBase,
uint256 fixedPriceInBase
) external onlyRole(ORACLE_MANAGER_ROLE) {
assetThresholds[asset] = ThresholdConfig({ lowerThresholdInBase: lowerThresholdInBase, fixedPriceInBase: fixedPriceInBase });
emit ThresholdConfigSet(asset, lowerThresholdInBase, fixedPriceInBase);
}
function removeThresholdConfig(address asset) external onlyRole(ORACLE_MANAGER_ROLE) {
delete assetThresholds[asset];
emit ThresholdConfigRemoved(asset);
}
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.4.0) (access/AccessControl.sol)
pragma solidity ^0.8.20;
import {IAccessControl} from "./IAccessControl.sol";
import {Context} from "../utils/Context.sol";
import {IERC165, 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);
_;
}
/// @inheritdoc IERC165
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` from `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.4.0) (access/IAccessControl.sol)
pragma solidity >=0.8.4;
/**
* @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 to signal 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.0) (access/Ownable.sol)
pragma solidity ^0.8.20;
import {Context} from "../utils/Context.sol";
/**
* @dev Contract module which provides a basic access control mechanism, where
* there is an account (an owner) that can be granted exclusive access to
* specific functions.
*
* The initial owner is set to the address provided by the deployer. This can
* later be changed with {transferOwnership}.
*
* This module is used through inheritance. It will make available the modifier
* `onlyOwner`, which can be applied to your functions to restrict their use to
* the owner.
*/
abstract contract Ownable is Context {
address private _owner;
/**
* @dev The caller account is not authorized to perform an operation.
*/
error OwnableUnauthorizedAccount(address account);
/**
* @dev The owner is not a valid owner account. (eg. `address(0)`)
*/
error OwnableInvalidOwner(address owner);
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
/**
* @dev Initializes the contract setting the address provided by the deployer as the initial owner.
*/
constructor(address initialOwner) {
if (initialOwner == address(0)) {
revert OwnableInvalidOwner(address(0));
}
_transferOwnership(initialOwner);
}
/**
* @dev Throws if called by any account other than the owner.
*/
modifier onlyOwner() {
_checkOwner();
_;
}
/**
* @dev Returns the address of the current owner.
*/
function owner() public view virtual returns (address) {
return _owner;
}
/**
* @dev Throws if the sender is not the owner.
*/
function _checkOwner() internal view virtual {
if (owner() != _msgSender()) {
revert OwnableUnauthorizedAccount(_msgSender());
}
}
/**
* @dev Leaves the contract without owner. It will not be possible to call
* `onlyOwner` functions. Can only be called by the current owner.
*
* NOTE: Renouncing ownership will leave the contract without an owner,
* thereby disabling any functionality that is only available to the owner.
*/
function renounceOwnership() public virtual onlyOwner {
_transferOwnership(address(0));
}
/**
* @dev Transfers ownership of the contract to a new account (`newOwner`).
* Can only be called by the current owner.
*/
function transferOwnership(address newOwner) public virtual onlyOwner {
if (newOwner == address(0)) {
revert OwnableInvalidOwner(address(0));
}
_transferOwnership(newOwner);
}
/**
* @dev Transfers ownership of the contract to a new account (`newOwner`).
* Internal function without access restriction.
*/
function _transferOwnership(address newOwner) internal virtual {
address oldOwner = _owner;
_owner = newOwner;
emit OwnershipTransferred(oldOwner, newOwner);
}
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (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.4.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 {
/// @inheritdoc IERC165
function supportsInterface(bytes4 interfaceId) public view virtual returns (bool) {
return interfaceId == type(IERC165).interfaceId;
}
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.4.0) (utils/introspection/IERC165.sol)
pragma solidity >=0.4.16;
/**
* @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
/* ———————————————————————————————————————————————————————————————————————————————— *
* _____ ______ ______ __ __ __ __ ______ __ __ *
* /\ __-. /\__ _\ /\ == \ /\ \ /\ "-.\ \ /\ \ /\__ _\ /\ \_\ \ *
* \ \ \/\ \ \/_/\ \/ \ \ __< \ \ \ \ \ \-. \ \ \ \ \/_/\ \/ \ \____ \ *
* \ \____- \ \_\ \ \_\ \_\ \ \_\ \ \_\\"\_\ \ \_\ \ \_\ \/\_____\ *
* \/____/ \/_/ \/_/ /_/ \/_/ \/_/ \/_/ \/_/ \/_/ \/_____/ *
* *
* ————————————————————————————————— dtrinity.org ————————————————————————————————— *
* *
* ▲ *
* ▲ ▲ *
* *
* ———————————————————————————————————————————————————————————————————————————————— *
* dTRINITY Protocol: https://github.com/dtrinity *
* ———————————————————————————————————————————————————————————————————————————————— */
pragma solidity ^0.8.20;
/**
* @dev Interface for the individual oracle wrappers, to unify interface between different oracle providers
*/
interface IOracleWrapper {
/**
* @notice Returns the base currency address
* @dev Address 0x0 is commonly used for USD, but can be any token address based on the implementation.
* @return Returns the base currency address.
*/
function BASE_CURRENCY() external view returns (address);
/**
* @notice Returns the base currency unit
* @dev Represents the decimal precision of the base currency (e.g., 1e8 for USD, 1e18 for ETH).
* @return Returns the base currency unit.
*/
function BASE_CURRENCY_UNIT() external view returns (uint256);
/**
* @notice Returns the asset price in the base currency
* @param asset The address of the asset
* @return The price of the asset
*/
function getAssetPrice(address asset) external view returns (uint256);
/**
* @notice Returns the price and alive status of an asset
* @param asset The address of the asset
* @return price The price of the asset
* @return isAlive The alive status of the asset
*/
function getPriceInfo(address asset) external view returns (uint256 price, bool isAlive);
}// SPDX-License-Identifier: MIT
/* ———————————————————————————————————————————————————————————————————————————————— *
* _____ ______ ______ __ __ __ __ ______ __ __ *
* /\ __-. /\__ _\ /\ == \ /\ \ /\ "-.\ \ /\ \ /\__ _\ /\ \_\ \ *
* \ \ \/\ \ \/_/\ \/ \ \ __< \ \ \ \ \ \-. \ \ \ \ \/_/\ \/ \ \____ \ *
* \ \____- \ \_\ \ \_\ \_\ \ \_\ \ \_\\"\_\ \ \_\ \ \_\ \/\_____\ *
* \/____/ \/_/ \/_/ /_/ \/_/ \/_/ \/_/ \/_/ \/_/ \/_____/ *
* *
* ————————————————————————————————— dtrinity.org ————————————————————————————————— *
* *
* ▲ *
* ▲ ▲ *
* *
* ———————————————————————————————————————————————————————————————————————————————— *
* dTRINITY Protocol: https://github.com/dtrinity *
* ———————————————————————————————————————————————————————————————————————————————— */
pragma solidity ^0.8.20;
import "../IOracleWrapper.sol";
import "@openzeppelin/contracts/access/AccessControl.sol";
/**
* @title BaseAPI3Wrapper
* @dev Abstract contract that implements the IOracleWrapper interface for API3 oracles
* Provides common functionality for all API3 oracle wrappers
*/
abstract contract BaseAPI3Wrapper is IOracleWrapper, AccessControl {
/* Core state */
uint256 public constant API3_BASE_CURRENCY_UNIT = 10 ** 18;
uint256 public constant API3_HEARTBEAT = 24 hours;
address private immutable _baseCurrency;
uint256 public immutable BASE_CURRENCY_UNIT;
uint256 public heartbeatStaleTimeLimit = 30 minutes;
/* Roles */
bytes32 public constant ORACLE_MANAGER_ROLE = keccak256("ORACLE_MANAGER_ROLE");
/* Errors */
error PriceIsStale();
/**
* @dev Constructor that sets the base currency and base currency unit
* @param baseCurrency The address of the base currency (zero address for USD)
* @param _baseCurrencyUnit The decimal precision of the base currency (e.g., 1e8 for USD)
*/
constructor(address baseCurrency, uint256 _baseCurrencyUnit) {
_baseCurrency = baseCurrency;
BASE_CURRENCY_UNIT = _baseCurrencyUnit;
_grantRole(DEFAULT_ADMIN_ROLE, msg.sender);
_grantRole(ORACLE_MANAGER_ROLE, msg.sender);
}
/**
* @notice Returns the base currency address
* @return Returns the base currency address.
*/
function BASE_CURRENCY() external view override returns (address) {
return _baseCurrency;
}
function getPriceInfo(address asset) public view virtual override returns (uint256 price, bool isAlive);
function getAssetPrice(address asset) external view virtual override returns (uint256) {
(uint256 price, bool isAlive) = getPriceInfo(asset);
if (!isAlive) {
revert PriceIsStale();
}
return price;
}
function _convertToBaseCurrencyUnit(uint256 price) internal view returns (uint256) {
return (price * BASE_CURRENCY_UNIT) / API3_BASE_CURRENCY_UNIT;
}
function setHeartbeatStaleTimeLimit(uint256 _newHeartbeatStaleTimeLimit) external onlyRole(ORACLE_MANAGER_ROLE) {
heartbeatStaleTimeLimit = _newHeartbeatStaleTimeLimit;
}
}// SPDX-License-Identifier: MIT
/* ———————————————————————————————————————————————————————————————————————————————— *
* _____ ______ ______ __ __ __ __ ______ __ __ *
* /\ __-. /\__ _\ /\ == \ /\ \ /\ "-.\ \ /\ \ /\__ _\ /\ \_\ \ *
* \ \ \/\ \ \/_/\ \/ \ \ __< \ \ \ \ \ \-. \ \ \ \ \/_/\ \/ \ \____ \ *
* \ \____- \ \_\ \ \_\ \_\ \ \_\ \ \_\\"\_\ \ \_\ \ \_\ \/\_____\ *
* \/____/ \/_/ \/_/ /_/ \/_/ \/_/ \/_/ \/_/ \/_/ \/_____/ *
* *
* ————————————————————————————————— dtrinity.org ————————————————————————————————— *
* *
* ▲ *
* ▲ ▲ *
* *
* ———————————————————————————————————————————————————————————————————————————————— *
* dTRINITY Protocol: https://github.com/dtrinity *
* ———————————————————————————————————————————————————————————————————————————————— */
pragma solidity ^0.8.20;
/// @dev See DapiProxy.sol for comments about usage
interface IProxy {
function read() external view returns (int224 value, uint32 timestamp);
function api3ServerV1() external view returns (address);
}// SPDX-License-Identifier: MIT
/* ———————————————————————————————————————————————————————————————————————————————— *
* _____ ______ ______ __ __ __ __ ______ __ __ *
* /\ __-. /\__ _\ /\ == \ /\ \ /\ "-.\ \ /\ \ /\__ _\ /\ \_\ \ *
* \ \ \/\ \ \/_/\ \/ \ \ __< \ \ \ \ \ \-. \ \ \ \ \/_/\ \/ \ \____ \ *
* \ \____- \ \_\ \ \_\ \_\ \ \_\ \ \_\\"\_\ \ \_\ \ \_\ \/\_____\ *
* \/____/ \/_/ \/_/ /_/ \/_/ \/_/ \/_/ \/_/ \/_/ \/_____/ *
* *
* ————————————————————————————————— dtrinity.org ————————————————————————————————— *
* *
* ▲ *
* ▲ ▲ *
* *
* ———————————————————————————————————————————————————————————————————————————————— *
* dTRINITY Protocol: https://github.com/dtrinity *
* ———————————————————————————————————————————————————————————————————————————————— */
pragma solidity ^0.8.20;
import { IProxy } from "../interface/api3/IProxy.sol";
import "../interface/api3/BaseAPI3Wrapper.sol";
/**
* @title API3Wrapper
* @dev Implementation of IAPI3Wrapper for standard API3 oracles
*/
contract API3Wrapper is BaseAPI3Wrapper {
mapping(address => IProxy) public assetToProxy;
error ProxyNotSet(address asset);
constructor(address baseCurrency, uint256 _baseCurrencyUnit) BaseAPI3Wrapper(baseCurrency, _baseCurrencyUnit) {}
function getPriceInfo(address asset) public view virtual override returns (uint256 price, bool isAlive) {
IProxy api3Proxy = assetToProxy[asset];
if (address(api3Proxy) == address(0)) {
revert ProxyNotSet(asset);
}
(int224 value, uint32 timestamp) = api3Proxy.read();
price = value > 0 ? uint256(uint224(value)) : 0;
isAlive = price > 0 && timestamp + API3_HEARTBEAT + heartbeatStaleTimeLimit > block.timestamp;
price = _convertToBaseCurrencyUnit(price);
}
function setProxy(address asset, address proxy) external onlyRole(ORACLE_MANAGER_ROLE) {
assetToProxy[asset] = IProxy(proxy);
}
}// SPDX-License-Identifier: MIT
/* ———————————————————————————————————————————————————————————————————————————————— *
* _____ ______ ______ __ __ __ __ ______ __ __ *
* /\ __-. /\__ _\ /\ == \ /\ \ /\ "-.\ \ /\ \ /\__ _\ /\ \_\ \ *
* \ \ \/\ \ \/_/\ \/ \ \ __< \ \ \ \ \ \-. \ \ \ \ \/_/\ \/ \ \____ \ *
* \ \____- \ \_\ \ \_\ \_\ \ \_\ \ \_\\"\_\ \ \_\ \ \_\ \/\_____\ *
* \/____/ \/_/ \/_/ /_/ \/_/ \/_/ \/_/ \/_/ \/_/ \/_____/ *
* *
* ————————————————————————————————— dtrinity.org ————————————————————————————————— *
* *
* ▲ *
* ▲ ▲ *
* *
* ———————————————————————————————————————————————————————————————————————————————— *
* dTRINITY Protocol: https://github.com/dtrinity *
* ———————————————————————————————————————————————————————————————————————————————— */
pragma solidity ^0.8.20;
abstract contract ThresholdingUtils {
/* Types */
struct ThresholdConfig {
/// @notice The minimum price after which thresholding is applied. Not a price cap, but a trigger point.
/// @dev If lowerThresholdInBase == fixedPriceInBase: Acts as an upper threshold
/// @dev If lowerThresholdInBase < fixedPriceInBase: Acts as "price rounding up" (e.g. if USDC > 0.997 then round to 1)
/// @dev If lowerThresholdInBase > fixedPriceInBase: Acts as "price rounding down" (e.g. if USDC > 1.003 then round to 1)
uint256 lowerThresholdInBase;
uint256 fixedPriceInBase;
}
/**
* @notice Apply threshold to a price value
* @param priceInBase The price to check against threshold
* @param thresholdConfig The threshold configuration
* @return The original price or fixed price based on threshold
*/
function _applyThreshold(uint256 priceInBase, ThresholdConfig memory thresholdConfig) internal pure returns (uint256) {
if (priceInBase > thresholdConfig.lowerThresholdInBase) {
return thresholdConfig.fixedPriceInBase;
}
return priceInBase;
}
}{
"evmVersion": "paris",
"metadata": {
"bytecodeHash": "ipfs",
"useLiteralContent": true
},
"optimizer": {
"enabled": true,
"runs": 200
},
"remappings": [],
"outputSelection": {
"*": {
"*": [
"evm.bytecode",
"evm.deployedBytecode",
"devdoc",
"userdoc",
"metadata",
"abi"
]
}
}
}Contract Security Audit
- No Contract Security Audit Submitted- Submit Audit Here
Contract ABI
API[{"inputs":[{"internalType":"address","name":"baseCurrency","type":"address"},{"internalType":"uint256","name":"_baseCurrencyUnit","type":"uint256"}],"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":[],"name":"PriceIsStale","type":"error"},{"inputs":[{"internalType":"address","name":"asset","type":"address"}],"name":"ProxyNotSet","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"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"asset","type":"address"}],"name":"ThresholdConfigRemoved","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"asset","type":"address"},{"indexed":false,"internalType":"uint256","name":"lowerThresholdInBase","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"fixedPriceInBase","type":"uint256"}],"name":"ThresholdConfigSet","type":"event"},{"inputs":[],"name":"API3_BASE_CURRENCY_UNIT","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"API3_HEARTBEAT","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"BASE_CURRENCY","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"BASE_CURRENCY_UNIT","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"DEFAULT_ADMIN_ROLE","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"ORACLE_MANAGER_ROLE","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"assetThresholds","outputs":[{"internalType":"uint256","name":"lowerThresholdInBase","type":"uint256"},{"internalType":"uint256","name":"fixedPriceInBase","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"assetToProxy","outputs":[{"internalType":"contract IProxy","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"asset","type":"address"}],"name":"getAssetPrice","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"asset","type":"address"}],"name":"getPriceInfo","outputs":[{"internalType":"uint256","name":"price","type":"uint256"},{"internalType":"bool","name":"isAlive","type":"bool"}],"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":"heartbeatStaleTimeLimit","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"asset","type":"address"}],"name":"removeThresholdConfig","outputs":[],"stateMutability":"nonpayable","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":[{"internalType":"uint256","name":"_newHeartbeatStaleTimeLimit","type":"uint256"}],"name":"setHeartbeatStaleTimeLimit","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"asset","type":"address"},{"internalType":"address","name":"proxy","type":"address"}],"name":"setProxy","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"asset","type":"address"},{"internalType":"uint256","name":"lowerThresholdInBase","type":"uint256"},{"internalType":"uint256","name":"fixedPriceInBase","type":"uint256"}],"name":"setThresholdConfig","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes4","name":"interfaceId","type":"bytes4"}],"name":"supportsInterface","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"}]Contract Creation Code
60c060405261070860015534801561001657600080fd5b50604051610cb5380380610cb583398101604081905261003591610139565b6001600160a01b03821660805260a08190528181818161005660003361008d565b506100817fced6982f480260bdd8ad5cb18ff2854f0306d78d904ad6cc107e8f3a0f526c183361008d565b50505050505050610173565b6000828152602081815260408083206001600160a01b038516845290915281205460ff1661012f576000838152602081815260408083206001600160a01b03861684529091529020805460ff191660011790556100e73390565b6001600160a01b0316826001600160a01b0316847f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a4506001610133565b5060005b92915050565b6000806040838503121561014c57600080fd5b82516001600160a01b038116811461016357600080fd5b6020939093015192949293505050565b60805160a051610b1661019f6000396000818161021f01526108dc015260006103360152610b166000f3fe608060405234801561001057600080fd5b50600436106101375760003560e01c806391d14854116100b8578063bfc69e1c1161007c578063bfc69e1c146102f9578063c5efe27c1461030e578063d547741f14610321578063e19f470014610334578063fbff771c1461035a578063ffceb4151461036957600080fd5b806391d148541461027c578063a217fddf1461028f578063a794d15214610297578063a9d4630c146102d3578063b3596f07146102e657600080fd5b80632f2ff15d116100ff5780632f2ff15d146101f457806336568abe146102075780638c89b64f1461021a5780638edbf436146102415780638f7af4211461026957600080fd5b806301ffc9a71461013c578063042818f914610164578063248a9ca314610179578063276d9959146101aa5780632ecac6fc146101eb575b600080fd5b61014f61014a36600461090b565b610373565b60405190151581526020015b60405180910390f35b610177610172366004610958565b6103aa565b005b61019c610187366004610973565b60009081526020819052604090206001015490565b60405190815260200161015b565b6101d36101b8366004610958565b6002602052600090815260409020546001600160a01b031681565b6040516001600160a01b03909116815260200161015b565b61019c60015481565b61017761020236600461098c565b61040d565b61017761021536600461098c565b610438565b61019c7f000000000000000000000000000000000000000000000000000000000000000081565b61025461024f366004610958565b610470565b6040805192835290151560208301520161015b565b6101776102773660046109b8565b6104d6565b61014f61028a36600461098c565b610565565b61019c600081565b6102be6102a5366004610958565b6003602052600090815260409020805460019091015482565b6040805192835260208301919091520161015b565b6101776102e13660046109eb565b61058e565b61019c6102f4366004610958565b6105d5565b61019c600080516020610ac183398151915281565b61017761031c366004610973565b61060c565b61017761032f36600461098c565b61062a565b7f00000000000000000000000000000000000000000000000000000000000000006101d3565b61019c670de0b6b3a764000081565b61019c6201518081565b60006001600160e01b03198216637965db0b60e01b14806103a457506301ffc9a760e01b6001600160e01b03198316145b92915050565b600080516020610ac18339815191526103c28161064f565b6001600160a01b038216600081815260036020526040808220828155600101829055517fe33ca422cb32fc509d95272b11d42c89c665a8968c21a483226b773e18c072f19190a25050565b6000828152602081905260409020600101546104288161064f565b610432838361065c565b50505050565b6001600160a01b03811633146104615760405163334bd91960e11b815260040160405180910390fd5b61046b82826106ee565b505050565b60008061047c83610759565b909250905080156104d1576001600160a01b0383166000908152600360209081526040918290208251808401909352805480845260019091015491830191909152156104cf576104cc8382610871565b92505b505b915091565b600080516020610ac18339815191526104ee8161064f565b60408051808201825284815260208082018581526001600160a01b038816600081815260038452859020935184559051600190930192909255825186815290810185905290917fc7f1785f536ea381a57caaf882172a5df51535dc45cf06657813919e3cf535e3910160405180910390a250505050565b6000918252602082815260408084206001600160a01b0393909316845291905290205460ff1690565b600080516020610ac18339815191526105a68161064f565b506001600160a01b03918216600090815260026020526040902080546001600160a01b03191691909216179055565b60008060006105e384610470565b9150915080610605576040516342bc305b60e11b815260040160405180910390fd5b5092915050565b600080516020610ac18339815191526106248161064f565b50600155565b6000828152602081905260409020600101546106458161064f565b61043283836106ee565b610659813361088f565b50565b60006106688383610565565b6106e6576000838152602081815260408083206001600160a01b03861684529091529020805460ff1916600117905561069e3390565b6001600160a01b0316826001600160a01b0316847f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a45060016103a4565b5060006103a4565b60006106fa8383610565565b156106e6576000838152602081815260408083206001600160a01b0386168085529252808320805460ff1916905551339286917ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b9190a45060016103a4565b6001600160a01b038082166000908152600260205260408120549091829116806107a6576040516326a5df8d60e01b81526001600160a01b03851660048201526024015b60405180910390fd5b600080826001600160a01b03166357de26a46040518163ffffffff1660e01b81526004016040805180830381865afa1580156107e6573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061080a9190610a15565b91509150600082601b0b1361082057600061082b565b816001600160e01b03165b945060008511801561085c575060015442906108506201518063ffffffff8516610a74565b61085a9190610a74565b115b9350610867856108cc565b9450505050915091565b8051600090831115610888575060208101516103a4565b5090919050565b6108998282610565565b6108c85760405163e2517d3f60e01b81526001600160a01b03821660048201526024810183905260440161079d565b5050565b6000670de0b6b3a76400006109017f000000000000000000000000000000000000000000000000000000000000000084610a87565b6103a49190610a9e565b60006020828403121561091d57600080fd5b81356001600160e01b03198116811461093557600080fd5b9392505050565b80356001600160a01b038116811461095357600080fd5b919050565b60006020828403121561096a57600080fd5b6109358261093c565b60006020828403121561098557600080fd5b5035919050565b6000806040838503121561099f57600080fd5b823591506109af6020840161093c565b90509250929050565b6000806000606084860312156109cd57600080fd5b6109d68461093c565b95602085013595506040909401359392505050565b600080604083850312156109fe57600080fd5b610a078361093c565b91506109af6020840161093c565b60008060408385031215610a2857600080fd5b825180601b0b8114610a3957600080fd5b602084015190925063ffffffff81168114610a5357600080fd5b809150509250929050565b634e487b7160e01b600052601160045260246000fd5b808201808211156103a4576103a4610a5e565b80820281158282048414176103a4576103a4610a5e565b600082610abb57634e487b7160e01b600052601260045260246000fd5b50049056feced6982f480260bdd8ad5cb18ff2854f0306d78d904ad6cc107e8f3a0f526c18a2646970667358221220f36906e2b2de8b78d6f70f92cdffccd978cea52e83b1e905decdc22ee7d87c1264736f6c63430008160033000000000000000000000000ee7d8bcfb72bc1880d0cf19822eb0a2e6577ab620000000000000000000000000000000000000000000000000de0b6b3a7640000
Deployed Bytecode
0x608060405234801561001057600080fd5b50600436106101375760003560e01c806391d14854116100b8578063bfc69e1c1161007c578063bfc69e1c146102f9578063c5efe27c1461030e578063d547741f14610321578063e19f470014610334578063fbff771c1461035a578063ffceb4151461036957600080fd5b806391d148541461027c578063a217fddf1461028f578063a794d15214610297578063a9d4630c146102d3578063b3596f07146102e657600080fd5b80632f2ff15d116100ff5780632f2ff15d146101f457806336568abe146102075780638c89b64f1461021a5780638edbf436146102415780638f7af4211461026957600080fd5b806301ffc9a71461013c578063042818f914610164578063248a9ca314610179578063276d9959146101aa5780632ecac6fc146101eb575b600080fd5b61014f61014a36600461090b565b610373565b60405190151581526020015b60405180910390f35b610177610172366004610958565b6103aa565b005b61019c610187366004610973565b60009081526020819052604090206001015490565b60405190815260200161015b565b6101d36101b8366004610958565b6002602052600090815260409020546001600160a01b031681565b6040516001600160a01b03909116815260200161015b565b61019c60015481565b61017761020236600461098c565b61040d565b61017761021536600461098c565b610438565b61019c7f0000000000000000000000000000000000000000000000000de0b6b3a764000081565b61025461024f366004610958565b610470565b6040805192835290151560208301520161015b565b6101776102773660046109b8565b6104d6565b61014f61028a36600461098c565b610565565b61019c600081565b6102be6102a5366004610958565b6003602052600090815260409020805460019091015482565b6040805192835260208301919091520161015b565b6101776102e13660046109eb565b61058e565b61019c6102f4366004610958565b6105d5565b61019c600080516020610ac183398151915281565b61017761031c366004610973565b61060c565b61017761032f36600461098c565b61062a565b7f000000000000000000000000ee7d8bcfb72bc1880d0cf19822eb0a2e6577ab626101d3565b61019c670de0b6b3a764000081565b61019c6201518081565b60006001600160e01b03198216637965db0b60e01b14806103a457506301ffc9a760e01b6001600160e01b03198316145b92915050565b600080516020610ac18339815191526103c28161064f565b6001600160a01b038216600081815260036020526040808220828155600101829055517fe33ca422cb32fc509d95272b11d42c89c665a8968c21a483226b773e18c072f19190a25050565b6000828152602081905260409020600101546104288161064f565b610432838361065c565b50505050565b6001600160a01b03811633146104615760405163334bd91960e11b815260040160405180910390fd5b61046b82826106ee565b505050565b60008061047c83610759565b909250905080156104d1576001600160a01b0383166000908152600360209081526040918290208251808401909352805480845260019091015491830191909152156104cf576104cc8382610871565b92505b505b915091565b600080516020610ac18339815191526104ee8161064f565b60408051808201825284815260208082018581526001600160a01b038816600081815260038452859020935184559051600190930192909255825186815290810185905290917fc7f1785f536ea381a57caaf882172a5df51535dc45cf06657813919e3cf535e3910160405180910390a250505050565b6000918252602082815260408084206001600160a01b0393909316845291905290205460ff1690565b600080516020610ac18339815191526105a68161064f565b506001600160a01b03918216600090815260026020526040902080546001600160a01b03191691909216179055565b60008060006105e384610470565b9150915080610605576040516342bc305b60e11b815260040160405180910390fd5b5092915050565b600080516020610ac18339815191526106248161064f565b50600155565b6000828152602081905260409020600101546106458161064f565b61043283836106ee565b610659813361088f565b50565b60006106688383610565565b6106e6576000838152602081815260408083206001600160a01b03861684529091529020805460ff1916600117905561069e3390565b6001600160a01b0316826001600160a01b0316847f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a45060016103a4565b5060006103a4565b60006106fa8383610565565b156106e6576000838152602081815260408083206001600160a01b0386168085529252808320805460ff1916905551339286917ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b9190a45060016103a4565b6001600160a01b038082166000908152600260205260408120549091829116806107a6576040516326a5df8d60e01b81526001600160a01b03851660048201526024015b60405180910390fd5b600080826001600160a01b03166357de26a46040518163ffffffff1660e01b81526004016040805180830381865afa1580156107e6573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061080a9190610a15565b91509150600082601b0b1361082057600061082b565b816001600160e01b03165b945060008511801561085c575060015442906108506201518063ffffffff8516610a74565b61085a9190610a74565b115b9350610867856108cc565b9450505050915091565b8051600090831115610888575060208101516103a4565b5090919050565b6108998282610565565b6108c85760405163e2517d3f60e01b81526001600160a01b03821660048201526024810183905260440161079d565b5050565b6000670de0b6b3a76400006109017f0000000000000000000000000000000000000000000000000de0b6b3a764000084610a87565b6103a49190610a9e565b60006020828403121561091d57600080fd5b81356001600160e01b03198116811461093557600080fd5b9392505050565b80356001600160a01b038116811461095357600080fd5b919050565b60006020828403121561096a57600080fd5b6109358261093c565b60006020828403121561098557600080fd5b5035919050565b6000806040838503121561099f57600080fd5b823591506109af6020840161093c565b90509250929050565b6000806000606084860312156109cd57600080fd5b6109d68461093c565b95602085013595506040909401359392505050565b600080604083850312156109fe57600080fd5b610a078361093c565b91506109af6020840161093c565b60008060408385031215610a2857600080fd5b825180601b0b8114610a3957600080fd5b602084015190925063ffffffff81168114610a5357600080fd5b809150509250929050565b634e487b7160e01b600052601160045260246000fd5b808201808211156103a4576103a4610a5e565b80820281158282048414176103a4576103a4610a5e565b600082610abb57634e487b7160e01b600052601260045260246000fd5b50049056feced6982f480260bdd8ad5cb18ff2854f0306d78d904ad6cc107e8f3a0f526c18a2646970667358221220f36906e2b2de8b78d6f70f92cdffccd978cea52e83b1e905decdc22ee7d87c1264736f6c63430008160033
Constructor Arguments (ABI-Encoded and is the last bytes of the Contract Creation Code above)
000000000000000000000000ee7d8bcfb72bc1880d0cf19822eb0a2e6577ab620000000000000000000000000000000000000000000000000de0b6b3a7640000
-----Decoded View---------------
Arg [0] : baseCurrency (address): 0xEE7D8BCFb72bC1880D0Cf19822eB0A2e6577aB62
Arg [1] : _baseCurrencyUnit (uint256): 1000000000000000000
-----Encoded View---------------
2 Constructor Arguments found :
Arg [0] : 000000000000000000000000ee7d8bcfb72bc1880d0cf19822eb0a2e6577ab62
Arg [1] : 0000000000000000000000000000000000000000000000000de0b6b3a7640000
Loading...
Loading
Loading...
Loading
Multichain Portfolio | 34 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.