Source Code
Latest 13 from a total of 13 transactions
| Transaction Hash |
|
Block
|
From
|
To
|
|||||
|---|---|---|---|---|---|---|---|---|---|
| Revoke Role | 20128163 | 257 days ago | IN | 0 FRAX | 0.00000003 | ||||
| Grant Role | 20128159 | 257 days ago | IN | 0 FRAX | 0.00000005 | ||||
| Revoke Role | 20128156 | 257 days ago | IN | 0 FRAX | 0.00000003 | ||||
| Grant Role | 20128153 | 257 days ago | IN | 0 FRAX | 0.00000005 | ||||
| Add Composite Fe... | 16916156 | 331 days ago | IN | 0 FRAX | 0.00000011 | ||||
| Add Composite Fe... | 16791293 | 334 days ago | IN | 0 FRAX | 0.00000011 | ||||
| Add Composite Fe... | 16791290 | 334 days ago | IN | 0 FRAX | 0.00000011 | ||||
| Add Composite Fe... | 16790746 | 334 days ago | IN | 0 FRAX | 0.00000019 | ||||
| Add Composite Fe... | 16790742 | 334 days ago | IN | 0 FRAX | 0.00000011 | ||||
| Add Composite Fe... | 15928419 | 354 days ago | IN | 0 FRAX | 0.00000037 | ||||
| Add Composite Fe... | 15928416 | 354 days ago | IN | 0 FRAX | 0.00000039 | ||||
| Add Composite Fe... | 15928413 | 354 days ago | IN | 0 FRAX | 0.00000037 | ||||
| Add Composite Fe... | 15928410 | 354 days ago | IN | 0 FRAX | 0.00000032 |
Advanced mode: Intended for advanced users or developers and will display all Internal Transactions including zero value transfers.
Latest 25 internal transactions (View All)
Advanced mode:
| Parent Transaction Hash | Block | From | To | ||||
|---|---|---|---|---|---|---|---|
| 31230123 | 6 hrs ago | 0 FRAX | |||||
| 31230123 | 6 hrs ago | 0 FRAX | |||||
| 31230123 | 6 hrs ago | 0 FRAX | |||||
| 31224031 | 10 hrs ago | 0 FRAX | |||||
| 31224031 | 10 hrs ago | 0 FRAX | |||||
| 31224031 | 10 hrs ago | 0 FRAX | |||||
| 31223992 | 10 hrs ago | 0 FRAX | |||||
| 31223992 | 10 hrs ago | 0 FRAX | |||||
| 31223992 | 10 hrs ago | 0 FRAX | |||||
| 31223717 | 10 hrs ago | 0 FRAX | |||||
| 31223717 | 10 hrs ago | 0 FRAX | |||||
| 31223717 | 10 hrs ago | 0 FRAX | |||||
| 31217402 | 13 hrs ago | 0 FRAX | |||||
| 31217402 | 13 hrs ago | 0 FRAX | |||||
| 31217402 | 13 hrs ago | 0 FRAX | |||||
| 31210641 | 17 hrs ago | 0 FRAX | |||||
| 31210641 | 17 hrs ago | 0 FRAX | |||||
| 31210641 | 17 hrs ago | 0 FRAX | |||||
| 31208739 | 18 hrs ago | 0 FRAX | |||||
| 31208739 | 18 hrs ago | 0 FRAX | |||||
| 31208739 | 18 hrs ago | 0 FRAX | |||||
| 31208739 | 18 hrs ago | 0 FRAX | |||||
| 31208739 | 18 hrs ago | 0 FRAX | |||||
| 31208739 | 18 hrs ago | 0 FRAX | |||||
| 31208429 | 18 hrs ago | 0 FRAX |
Cross-Chain Transactions
Loading...
Loading
Contract Name:
API3CompositeWrapperWithThresholding
Compiler Version
v0.8.20+commit.a1b79de6
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 "../interface/api3/IAPI3Wrapper.sol";
import "@openzeppelin/contracts-5/access/AccessControl.sol";
import {IProxy} from "../interface/api3/IProxy.sol";
import "./ThresholdingUtils.sol";
contract API3CompositeWrapperWithThresholding is
IAPI3Wrapper,
ThresholdingUtils
{
/* Core state */
struct CompositeFeed {
address proxy1;
address proxy2;
ThresholdConfig primaryThreshold; // Primary price source threshold config
ThresholdConfig secondaryThreshold; // Secondary price source threshold config
}
mapping(address => CompositeFeed) public compositeFeeds;
/* Events */
event CompositeFeedAdded(
address indexed asset,
address proxy1,
address proxy2,
uint256 lowerThresholdInBase1,
uint256 fixedPriceInBase1,
uint256 lowerThresholdInBase2,
uint256 fixedPriceInBase2
);
event CompositeFeedRemoved(address indexed asset);
event CompositeFeedUpdated(
address indexed asset,
uint256 lowerThresholdInBase1,
uint256 fixedPriceInBase1,
uint256 lowerThresholdInBase2,
uint256 fixedPriceInBase2
);
/* Errors */
error FeedNotSet(address asset);
constructor(uint256 _baseCurrencyUnit) IAPI3Wrapper(_baseCurrencyUnit) {
_grantRole(DEFAULT_ADMIN_ROLE, msg.sender);
_grantRole(ORACLE_MANAGER_ROLE, msg.sender);
}
function addCompositeFeed(
address asset,
address proxy1,
address proxy2,
uint256 lowerThresholdInBase1,
uint256 fixedPriceInBase1,
uint256 lowerThresholdInBase2,
uint256 fixedPriceInBase2
) external onlyRole(ORACLE_MANAGER_ROLE) {
compositeFeeds[asset] = CompositeFeed({
proxy1: proxy1,
proxy2: proxy2,
primaryThreshold: ThresholdConfig({
lowerThresholdInBase: lowerThresholdInBase1,
fixedPriceInBase: fixedPriceInBase1
}),
secondaryThreshold: ThresholdConfig({
lowerThresholdInBase: lowerThresholdInBase2,
fixedPriceInBase: fixedPriceInBase2
})
});
emit CompositeFeedAdded(
asset,
proxy1,
proxy2,
lowerThresholdInBase1,
fixedPriceInBase1,
lowerThresholdInBase2,
fixedPriceInBase2
);
}
function removeCompositeFeed(
address asset
) external onlyRole(ORACLE_MANAGER_ROLE) {
delete compositeFeeds[asset];
emit CompositeFeedRemoved(asset);
}
function updateCompositeFeed(
address asset,
uint256 lowerThresholdInBase1,
uint256 fixedPriceInBase1,
uint256 lowerThresholdInBase2,
uint256 fixedPriceInBase2
) external onlyRole(ORACLE_MANAGER_ROLE) {
CompositeFeed storage feed = compositeFeeds[asset];
if (feed.proxy1 == address(0) || feed.proxy2 == address(0)) {
revert FeedNotSet(asset);
}
feed.primaryThreshold.lowerThresholdInBase = lowerThresholdInBase1;
feed.primaryThreshold.fixedPriceInBase = fixedPriceInBase1;
feed.secondaryThreshold.lowerThresholdInBase = lowerThresholdInBase2;
feed.secondaryThreshold.fixedPriceInBase = fixedPriceInBase2;
emit CompositeFeedUpdated(
asset,
lowerThresholdInBase1,
fixedPriceInBase1,
lowerThresholdInBase2,
fixedPriceInBase2
);
}
function getPriceInfo(
address asset
) public view override returns (uint256 price, bool isAlive) {
CompositeFeed memory feed = compositeFeeds[asset];
if (feed.proxy1 == address(0) || feed.proxy2 == address(0)) {
revert FeedNotSet(asset);
}
(int224 value1, uint32 timestamp1) = IProxy(feed.proxy1).read();
(int224 value2, uint32 timestamp2) = IProxy(feed.proxy2).read();
uint256 api3Price1 = value1 > 0 ? uint256(uint224(value1)) : 0;
uint256 api3Price2 = value2 > 0 ? uint256(uint224(value2)) : 0;
// Convert both prices to BASE_CURRENCY_UNIT first
uint256 priceInBase1 = _convertToBaseCurrencyUnit(api3Price1);
uint256 priceInBase2 = _convertToBaseCurrencyUnit(api3Price2);
// Apply thresholding to prices in BASE_CURRENCY_UNIT if specified
if (feed.primaryThreshold.lowerThresholdInBase > 0) {
priceInBase1 = _applyThreshold(priceInBase1, feed.primaryThreshold);
}
if (feed.secondaryThreshold.lowerThresholdInBase > 0) {
priceInBase2 = _applyThreshold(
priceInBase2,
feed.secondaryThreshold
);
}
price = (priceInBase1 * priceInBase2) / BASE_CURRENCY_UNIT;
isAlive =
price > 0 &&
timestamp1 + API3_HEARTBEAT + heartbeatStaleTimeLimit >
block.timestamp &&
timestamp2 + API3_HEARTBEAT + heartbeatStaleTimeLimit >
block.timestamp;
}
function getAssetPrice(
address asset
) external view override returns (uint256) {
(uint256 price, bool isAlive) = getPriceInfo(asset);
if (!isAlive) {
revert PriceIsStale();
}
return price;
}
}// 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 ERC165 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, an admin role
* bearer except when using {AccessControl-_setupRole}.
*/
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 ERC165 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 ERC165 standard, as defined in the
* https://eips.ethereum.org/EIPS/eip-165[EIP].
*
* 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[EIP 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: AGPL-3.0
/* ———————————————————————————————————————————————————————————————————————————————— *
* _____ ______ ______ __ __ __ __ ______ __ __ *
* /\ __-. /\__ _\ /\ == \ /\ \ /\ "-.\ \ /\ \ /\__ _\ /\ \_\ \ *
* \ \ \/\ \ \/_/\ \/ \ \ __< \ \ \ \ \ \-. \ \ \ \ \/_/\ \/ \ \____ \ *
* \ \____- \ \_\ \ \_\ \_\ \ \_\ \ \_\\"\_\ \ \_\ \ \_\ \/\_____\ *
* \/____/ \/_/ \/_/ /_/ \/_/ \/_/ \/_/ \/_/ \/_/ \/_____/ *
* *
* ————————————————————————————————— dtrinity.org ————————————————————————————————— *
* *
* ▲ *
* ▲ ▲ *
* *
* ———————————————————————————————————————————————————————————————————————————————— *
* dTRINITY Protocol: https://github.com/dtrinity *
* ———————————————————————————————————————————————————————————————————————————————— */
pragma solidity ^0.8.0;
/**
* @title IPriceOracleGetter
* @author Aave
* @notice Interface for the Aave price oracle.
*/
interface IPriceOracleGetter {
/**
* @notice Returns the base currency address
* @dev Address 0x0 is reserved for USD as base currency.
* @return Returns the base currency address.
*/
function BASE_CURRENCY() external view returns (address);
/**
* @notice Returns the base currency unit
* @dev 1 ether for ETH, 1e8 for USD.
* @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);
}// SPDX-License-Identifier: MIT
/* ———————————————————————————————————————————————————————————————————————————————— *
* _____ ______ ______ __ __ __ __ ______ __ __ *
* /\ __-. /\__ _\ /\ == \ /\ \ /\ "-.\ \ /\ \ /\__ _\ /\ \_\ \ *
* \ \ \/\ \ \/_/\ \/ \ \ __< \ \ \ \ \ \-. \ \ \ \ \/_/\ \/ \ \____ \ *
* \ \____- \ \_\ \ \_\ \_\ \ \_\ \ \_\\"\_\ \ \_\ \ \_\ \/\_____\ *
* \/____/ \/_/ \/_/ /_/ \/_/ \/_/ \/_/ \/_/ \/_/ \/_____/ *
* *
* ————————————————————————————————— dtrinity.org ————————————————————————————————— *
* *
* ▲ *
* ▲ ▲ *
* *
* ———————————————————————————————————————————————————————————————————————————————— *
* dTRINITY Protocol: https://github.com/dtrinity *
* ———————————————————————————————————————————————————————————————————————————————— */
pragma solidity 0.8.20;
import "contracts/lending/core/interfaces/IPriceOracleGetter.sol";
/**
* @dev Interface for the individual oracle wrappers, to unify interface between Redstone and API3 for example
*/
interface IOracleWrapper is IPriceOracleGetter {
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-5/access/AccessControl.sol";
abstract contract IAPI3Wrapper is IOracleWrapper, AccessControl {
/* Core state */
uint256 public constant API3_BASE_CURRENCY_UNIT = 10 ** 18;
uint256 public constant API3_HEARTBEAT = 24 hours;
address public constant BASE_CURRENCY = address(0);
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();
constructor(uint256 _baseCurrencyUnit) {
BASE_CURRENCY_UNIT = _baseCurrencyUnit;
_grantRole(DEFAULT_ADMIN_ROLE, msg.sender);
_grantRole(ORACLE_MANAGER_ROLE, msg.sender);
}
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.0;
/// @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;
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": "london",
"libraries": {},
"metadata": {
"bytecodeHash": "ipfs",
"useLiteralContent": true
},
"optimizer": {
"enabled": true,
"runs": 200
},
"remappings": [],
"viaIR": true,
"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":"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":[{"internalType":"address","name":"asset","type":"address"}],"name":"FeedNotSet","type":"error"},{"inputs":[],"name":"PriceIsStale","type":"error"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"asset","type":"address"},{"indexed":false,"internalType":"address","name":"proxy1","type":"address"},{"indexed":false,"internalType":"address","name":"proxy2","type":"address"},{"indexed":false,"internalType":"uint256","name":"lowerThresholdInBase1","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"fixedPriceInBase1","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"lowerThresholdInBase2","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"fixedPriceInBase2","type":"uint256"}],"name":"CompositeFeedAdded","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"asset","type":"address"}],"name":"CompositeFeedRemoved","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"asset","type":"address"},{"indexed":false,"internalType":"uint256","name":"lowerThresholdInBase1","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"fixedPriceInBase1","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"lowerThresholdInBase2","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"fixedPriceInBase2","type":"uint256"}],"name":"CompositeFeedUpdated","type":"event"},{"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":"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":"asset","type":"address"},{"internalType":"address","name":"proxy1","type":"address"},{"internalType":"address","name":"proxy2","type":"address"},{"internalType":"uint256","name":"lowerThresholdInBase1","type":"uint256"},{"internalType":"uint256","name":"fixedPriceInBase1","type":"uint256"},{"internalType":"uint256","name":"lowerThresholdInBase2","type":"uint256"},{"internalType":"uint256","name":"fixedPriceInBase2","type":"uint256"}],"name":"addCompositeFeed","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"compositeFeeds","outputs":[{"internalType":"address","name":"proxy1","type":"address"},{"internalType":"address","name":"proxy2","type":"address"},{"components":[{"internalType":"uint256","name":"lowerThresholdInBase","type":"uint256"},{"internalType":"uint256","name":"fixedPriceInBase","type":"uint256"}],"internalType":"struct ThresholdingUtils.ThresholdConfig","name":"primaryThreshold","type":"tuple"},{"components":[{"internalType":"uint256","name":"lowerThresholdInBase","type":"uint256"},{"internalType":"uint256","name":"fixedPriceInBase","type":"uint256"}],"internalType":"struct ThresholdingUtils.ThresholdConfig","name":"secondaryThreshold","type":"tuple"}],"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":"removeCompositeFeed","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":"bytes4","name":"interfaceId","type":"bytes4"}],"name":"supportsInterface","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"asset","type":"address"},{"internalType":"uint256","name":"lowerThresholdInBase1","type":"uint256"},{"internalType":"uint256","name":"fixedPriceInBase1","type":"uint256"},{"internalType":"uint256","name":"lowerThresholdInBase2","type":"uint256"},{"internalType":"uint256","name":"fixedPriceInBase2","type":"uint256"}],"name":"updateCompositeFeed","outputs":[],"stateMutability":"nonpayable","type":"function"}]Contract Creation Code
60a03461008f57601f610f3838819003918201601f19168301916001600160401b038311848410176100945780849260209460405283398101031261008f5751610708600155608052610051336100aa565b5061005b33610128565b50610065336100aa565b5061006f33610128565b50604051610d4f90816101c982396080518181816104d40152610b2a0152f35b600080fd5b634e487b7160e01b600052604160045260246000fd5b6001600160a01b031660008181527fad3228b676f7d3cd4284a5443f17f1962b36e491b30a40b2405849e597ba5fb5602052604081205490919060ff1661012457818052816020526040822081835260205260408220600160ff198254161790553391600080516020610f188339815191528180a4600190565b5090565b6001600160a01b031660008181527ffb8036e0bab3828a1a1cce97396031bc7ea8a361699e1bc9c4844f3aeee78d6e60205260408120549091907fced6982f480260bdd8ad5cb18ff2854f0306d78d904ad6cc107e8f3a0f526c189060ff166101c357808352826020526040832082845260205260408320600160ff19825416179055600080516020610f18833981519152339380a4600190565b50509056fe608080604052600436101561001357600080fd5b60003560e01c90816301ffc9a7146107235750806304dea65114610648578063248a9ca3146106195780632ecac6fc146105fb5780632f2ff15d146105bc57806336568abe14610575578063519ffff1146104f75780638c89b64f146104bc5780638edbf436146104905780638f5997151461030c57806391d14854146102bf578063a217fddf146101c3578063b3596f071461027c578063bfc69e1c14610241578063c5efe27c14610220578063d547741f146101df578063e19f4700146101c3578063f99256d514610141578063fbff771c1461011e5763ffceb415146100fb57600080fd5b34610119576000366003190112610119576020604051620151808152f35b600080fd5b34610119576000366003190112610119576020604051670de0b6b3a76400008152f35b346101195760203660031901126101195760c06001600160a01b0380610165610776565b166000526002602052602060406000208183825416936001830154169161019a600461019360028401610812565b9201610812565b9260405195865282860152805160408601520151606084015280516080840152015160a0820152f35b3461011957600036600319011261011957602060405160008152f35b346101195760403660031901126101195761021e6004356101fe61078c565b908060005260006020526102196001604060002001546108aa565b61094e565b005b3461011957602036600319011261011957610239610830565b600435600155005b346101195760003660031901126101195760206040517fced6982f480260bdd8ad5cb18ff2854f0306d78d904ad6cc107e8f3a0f526c188152f35b346101195760203660031901126101195761029d610298610776565b610a27565b156102ad57602090604051908152f35b6040516342bc305b60e11b8152600490fd5b34610119576040366003190112610119576102d861078c565b600435600052600060205260406000209060018060a01b0316600052602052602060ff604060002054166040519015158152f35b346101195760e036600319011261011957610325610776565b61032d61078c565b906044356001600160a01b0381168103610119577f8af3f37e726b4aaf30de76bd00359c9166bf6b9a01e457c3d4557df631227eed9160c09161036e610830565b60405161037a816107a2565b60643581526084356020820152604051610393816107a2565b60a435815260c4356020820152604051916103ad836107d4565b60018060a01b038816835260018060a01b03841660208401526040830152606082015260018060a01b038316600052600260205260056020606060406000209360018060a01b038151166bffffffffffffffffffffffff60a01b9081875416178655600186019060018060a01b03858401511690825416179055826040820151805160028801550151600386015501518051600485015501519101556040519460018060a01b0316855260018060a01b031660208501526064356040850152608435606085015260a435608085015260c43560a085015260018060a01b031692a2005b346101195760203660031901126101195760406104ae610298610776565b825191825215156020820152f35b346101195760003660031901126101195760206040517f00000000000000000000000000000000000000000000000000000000000000008152f35b3461011957602036600319011261011957610510610776565b610518610830565b60018060a01b0316806000526002602052600060056040822082815582600182015582600282015582600382015582600482015501557fdabc58d0456c50872fa82879bc9ce7f6a455b4372db632857a62de4abd099691600080a2005b346101195760403660031901126101195761058e61078c565b336001600160a01b038216036105aa5761021e9060043561094e565b60405163334bd91960e11b8152600490fd5b346101195760403660031901126101195761021e6004356105db61078c565b908060005260006020526105f66001604060002001546108aa565b6108d0565b34610119576000366003190112610119576020600154604051908152f35b346101195760203660031901126101195760043560005260006020526020600160406000200154604051908152f35b346101195760a036600319011261011957610661610776565b602435608435606435604435610675610830565b6001600160a01b039485166000818152600260205260409020805491969091811615908115610714575b506106fb579183916080946005858860027fbdebb389cb3e5b0a7c038b900aeea5b6e265e74efd0de50488c3574a4d7861d59a9801558360038201558460048201550155604051938452602084015260408301526060820152a2005b604051630dcaf86b60e01b815260048101879052602490fd5b9050600182015416158761069f565b34610119576020366003190112610119576004359063ffffffff60e01b821680920361011957602091637965db0b60e01b8114908115610765575b5015158152f35b6301ffc9a760e01b1490508361075e565b600435906001600160a01b038216820361011957565b602435906001600160a01b038216820361011957565b6040810190811067ffffffffffffffff8211176107be57604052565b634e487b7160e01b600052604160045260246000fd5b6080810190811067ffffffffffffffff8211176107be57604052565b90601f8019910116810190811067ffffffffffffffff8211176107be57604052565b9060405161081f816107a2565b602060018294805484520154910152565b3360009081527ffb8036e0bab3828a1a1cce97396031bc7ea8a361699e1bc9c4844f3aeee78d6e60205260409020547fced6982f480260bdd8ad5cb18ff2854f0306d78d904ad6cc107e8f3a0f526c189060ff161561088c5750565b6044906040519063e2517d3f60e01b82523360048301526024820152fd5b80600052600060205260406000203360005260205260ff604060002054161561088c5750565b9060009180835282602052604083209160018060a01b03169182845260205260ff6040842054161560001461094957808352826020526040832082845260205260408320600160ff198254161790557f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d339380a4600190565b505090565b9060009180835282602052604083209160018060a01b03169182845260205260ff6040842054166000146109495780835282602052604083208284526020526040832060ff1981541690557ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b339380a4600190565b919082604091031261011957815180601b0b81036101195760209092015163ffffffff811681036101195790565b81810292918115918404141715610a0457565b634e487b7160e01b600052601160045260246000fd5b91908201809211610a0457565b6001600160a01b039081166000818152600260205260408082208151949594909291610a52826107d4565b868454168252866001850154169460208301958652610a7360028601610812565b92828101938452610a876004809701610812565b916060820192835289825116158015610cf8575b610ce257508890511697825190838288816315f789a960e21b9d8e82525afa978815610cd85786928799610cb3575b50908491511699878251809c819382525afa988915610ca9578593869a610c66575b505091610b689391610b81938681601b0b13600014610c5e576001600160e01b0316915b8681601b0b13600014610c56576001600160e01b0316915b7f000000000000000000000000000000000000000000000000000000000000000095868092610b61670de0b6b3a76400009485926109f1565b04946109f1565b0492518051610c45575b50518051610c34575b506109f1565b8115610c215704948515159384610be3575b5083610ba0575b50505090565b63ffffffff919293501691620151808301809311610bd0575050600154610bc691610a1a565b4210388080610b9a565b634e487b7160e01b825260119052602490fd5b63ffffffff91945016620151808101809111610c0e57600154610c0591610a1a565b42109238610b93565b506011602492634e487b7160e01b835252fd5b634e487b7160e01b835260128452602483fd5b610c3e9192610d03565b9038610b7b565b610c4f9192610d03565b9038610b72565b508591610b28565b508591610b10565b610b689593929a50610b8194509081610c9392903d10610ca2575b610c8b81836107f0565b8101906109c3565b91909199919381939550610aec565b503d610c81565b83513d87823e3d90fd5b610ccf91995085809394503d8411610ca257610c8b81836107f0565b98909291610aca565b84513d88823e3d90fd5b86602491855191630dcaf86b60e01b8352820152fd5b508988511615610a9b565b9080518211610d10575090565b6020915001519056fea264697066735822122097ba07b5b5f7f63edd4410fecb1aa7a15484647c272053c29d0e1bd02d23d36564736f6c634300081400332f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d0000000000000000000000000000000000000000000000000000000005f5e100
Deployed Bytecode
0x608080604052600436101561001357600080fd5b60003560e01c90816301ffc9a7146107235750806304dea65114610648578063248a9ca3146106195780632ecac6fc146105fb5780632f2ff15d146105bc57806336568abe14610575578063519ffff1146104f75780638c89b64f146104bc5780638edbf436146104905780638f5997151461030c57806391d14854146102bf578063a217fddf146101c3578063b3596f071461027c578063bfc69e1c14610241578063c5efe27c14610220578063d547741f146101df578063e19f4700146101c3578063f99256d514610141578063fbff771c1461011e5763ffceb415146100fb57600080fd5b34610119576000366003190112610119576020604051620151808152f35b600080fd5b34610119576000366003190112610119576020604051670de0b6b3a76400008152f35b346101195760203660031901126101195760c06001600160a01b0380610165610776565b166000526002602052602060406000208183825416936001830154169161019a600461019360028401610812565b9201610812565b9260405195865282860152805160408601520151606084015280516080840152015160a0820152f35b3461011957600036600319011261011957602060405160008152f35b346101195760403660031901126101195761021e6004356101fe61078c565b908060005260006020526102196001604060002001546108aa565b61094e565b005b3461011957602036600319011261011957610239610830565b600435600155005b346101195760003660031901126101195760206040517fced6982f480260bdd8ad5cb18ff2854f0306d78d904ad6cc107e8f3a0f526c188152f35b346101195760203660031901126101195761029d610298610776565b610a27565b156102ad57602090604051908152f35b6040516342bc305b60e11b8152600490fd5b34610119576040366003190112610119576102d861078c565b600435600052600060205260406000209060018060a01b0316600052602052602060ff604060002054166040519015158152f35b346101195760e036600319011261011957610325610776565b61032d61078c565b906044356001600160a01b0381168103610119577f8af3f37e726b4aaf30de76bd00359c9166bf6b9a01e457c3d4557df631227eed9160c09161036e610830565b60405161037a816107a2565b60643581526084356020820152604051610393816107a2565b60a435815260c4356020820152604051916103ad836107d4565b60018060a01b038816835260018060a01b03841660208401526040830152606082015260018060a01b038316600052600260205260056020606060406000209360018060a01b038151166bffffffffffffffffffffffff60a01b9081875416178655600186019060018060a01b03858401511690825416179055826040820151805160028801550151600386015501518051600485015501519101556040519460018060a01b0316855260018060a01b031660208501526064356040850152608435606085015260a435608085015260c43560a085015260018060a01b031692a2005b346101195760203660031901126101195760406104ae610298610776565b825191825215156020820152f35b346101195760003660031901126101195760206040517f0000000000000000000000000000000000000000000000000000000005f5e1008152f35b3461011957602036600319011261011957610510610776565b610518610830565b60018060a01b0316806000526002602052600060056040822082815582600182015582600282015582600382015582600482015501557fdabc58d0456c50872fa82879bc9ce7f6a455b4372db632857a62de4abd099691600080a2005b346101195760403660031901126101195761058e61078c565b336001600160a01b038216036105aa5761021e9060043561094e565b60405163334bd91960e11b8152600490fd5b346101195760403660031901126101195761021e6004356105db61078c565b908060005260006020526105f66001604060002001546108aa565b6108d0565b34610119576000366003190112610119576020600154604051908152f35b346101195760203660031901126101195760043560005260006020526020600160406000200154604051908152f35b346101195760a036600319011261011957610661610776565b602435608435606435604435610675610830565b6001600160a01b039485166000818152600260205260409020805491969091811615908115610714575b506106fb579183916080946005858860027fbdebb389cb3e5b0a7c038b900aeea5b6e265e74efd0de50488c3574a4d7861d59a9801558360038201558460048201550155604051938452602084015260408301526060820152a2005b604051630dcaf86b60e01b815260048101879052602490fd5b9050600182015416158761069f565b34610119576020366003190112610119576004359063ffffffff60e01b821680920361011957602091637965db0b60e01b8114908115610765575b5015158152f35b6301ffc9a760e01b1490508361075e565b600435906001600160a01b038216820361011957565b602435906001600160a01b038216820361011957565b6040810190811067ffffffffffffffff8211176107be57604052565b634e487b7160e01b600052604160045260246000fd5b6080810190811067ffffffffffffffff8211176107be57604052565b90601f8019910116810190811067ffffffffffffffff8211176107be57604052565b9060405161081f816107a2565b602060018294805484520154910152565b3360009081527ffb8036e0bab3828a1a1cce97396031bc7ea8a361699e1bc9c4844f3aeee78d6e60205260409020547fced6982f480260bdd8ad5cb18ff2854f0306d78d904ad6cc107e8f3a0f526c189060ff161561088c5750565b6044906040519063e2517d3f60e01b82523360048301526024820152fd5b80600052600060205260406000203360005260205260ff604060002054161561088c5750565b9060009180835282602052604083209160018060a01b03169182845260205260ff6040842054161560001461094957808352826020526040832082845260205260408320600160ff198254161790557f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d339380a4600190565b505090565b9060009180835282602052604083209160018060a01b03169182845260205260ff6040842054166000146109495780835282602052604083208284526020526040832060ff1981541690557ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b339380a4600190565b919082604091031261011957815180601b0b81036101195760209092015163ffffffff811681036101195790565b81810292918115918404141715610a0457565b634e487b7160e01b600052601160045260246000fd5b91908201809211610a0457565b6001600160a01b039081166000818152600260205260408082208151949594909291610a52826107d4565b868454168252866001850154169460208301958652610a7360028601610812565b92828101938452610a876004809701610812565b916060820192835289825116158015610cf8575b610ce257508890511697825190838288816315f789a960e21b9d8e82525afa978815610cd85786928799610cb3575b50908491511699878251809c819382525afa988915610ca9578593869a610c66575b505091610b689391610b81938681601b0b13600014610c5e576001600160e01b0316915b8681601b0b13600014610c56576001600160e01b0316915b7f0000000000000000000000000000000000000000000000000000000005f5e10095868092610b61670de0b6b3a76400009485926109f1565b04946109f1565b0492518051610c45575b50518051610c34575b506109f1565b8115610c215704948515159384610be3575b5083610ba0575b50505090565b63ffffffff919293501691620151808301809311610bd0575050600154610bc691610a1a565b4210388080610b9a565b634e487b7160e01b825260119052602490fd5b63ffffffff91945016620151808101809111610c0e57600154610c0591610a1a565b42109238610b93565b506011602492634e487b7160e01b835252fd5b634e487b7160e01b835260128452602483fd5b610c3e9192610d03565b9038610b7b565b610c4f9192610d03565b9038610b72565b508591610b28565b508591610b10565b610b689593929a50610b8194509081610c9392903d10610ca2575b610c8b81836107f0565b8101906109c3565b91909199919381939550610aec565b503d610c81565b83513d87823e3d90fd5b610ccf91995085809394503d8411610ca257610c8b81836107f0565b98909291610aca565b84513d88823e3d90fd5b86602491855191630dcaf86b60e01b8352820152fd5b508988511615610a9b565b9080518211610d10575090565b6020915001519056fea264697066735822122097ba07b5b5f7f63edd4410fecb1aa7a15484647c272053c29d0e1bd02d23d36564736f6c63430008140033
Constructor Arguments (ABI-Encoded and is the last bytes of the Contract Creation Code above)
0000000000000000000000000000000000000000000000000000000005f5e100
-----Decoded View---------------
Arg [0] : _baseCurrencyUnit (uint256): 100000000
-----Encoded View---------------
1 Constructor Arguments found :
Arg [0] : 0000000000000000000000000000000000000000000000000000000005f5e100
Loading...
Loading
Loading...
Loading
Loading...
Loading
Net Worth in USD
$0.00
Net Worth in FRAX
0
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.