Source Code
Overview
ETH Balance
0 ETH
More Info
ContractCreator
Multichain Info
N/A
Loading...
Loading
Contract Name:
OracleAggregator
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 "@openzeppelin/contracts/access/AccessControl.sol";
import "./interface/IOracleWrapper.sol";
/**
* @title OracleAggregator
* @notice Aggregates price data from multiple oracles
* @dev Implements IPriceOracleGetter for compatibility with Aave
*/
contract OracleAggregator is AccessControl, IOracleWrapper {
/* Core state */
/// @notice Mapping from asset address to oracle address
mapping(address => address) public assetOracles;
/// @notice 1 Unit of base currency (10^priceDecimals)
uint256 public immutable baseCurrencyUnit;
/// @notice Address representing the base currency
address public immutable baseCurrency;
/* Events */
event OracleUpdated(address indexed asset, address indexed oracle);
/* Roles */
/// @notice Role for managing oracles
bytes32 public constant ORACLE_MANAGER_ROLE = keccak256("ORACLE_MANAGER_ROLE");
/* Errors */
error UnexpectedBaseUnit(address asset, address oracle, uint256 expectedBaseUnit, uint256 oracleBaseUnit);
error OracleNotSet(address asset);
error PriceNotAlive(address asset);
/**
* @notice Constructor to initialize the OracleAggregator
* @param _baseCurrency Address of the base currency
* @param _baseCurrencyUnit Number of decimal places for price values
*/
constructor(address _baseCurrency, uint256 _baseCurrencyUnit) {
baseCurrency = _baseCurrency;
baseCurrencyUnit = _baseCurrencyUnit;
_grantRole(DEFAULT_ADMIN_ROLE, msg.sender);
_grantRole(ORACLE_MANAGER_ROLE, msg.sender);
}
/**
* @notice Sets the oracle for a specific asset
* @param asset Address of the asset
* @param oracle Address of the oracle for the asset
*/
function setOracle(address asset, address oracle) external onlyRole(ORACLE_MANAGER_ROLE) {
uint256 oracleBaseUnit = IOracleWrapper(oracle).BASE_CURRENCY_UNIT();
if (oracleBaseUnit != baseCurrencyUnit) {
revert UnexpectedBaseUnit(asset, oracle, baseCurrencyUnit, oracleBaseUnit);
}
assetOracles[asset] = oracle;
emit OracleUpdated(asset, oracle);
}
/**
* @notice Removes the oracle for a specific asset
* @param asset Address of the asset
*/
function removeOracle(address asset) external onlyRole(ORACLE_MANAGER_ROLE) {
assetOracles[asset] = address(0);
emit OracleUpdated(asset, address(0));
}
/**
* @notice Returns the base currency
* @return Address representing the base currency
*/
function BASE_CURRENCY() external view returns (address) {
return baseCurrency;
}
/**
* @notice Returns the base currency unit
* @return Base currency unit (10^priceDecimals)
*/
function BASE_CURRENCY_UNIT() external view returns (uint256) {
return baseCurrencyUnit;
}
/**
* @notice Gets the price of an asset
* @param asset Address of the asset
* @return Price of the asset
*/
function getAssetPrice(address asset) external view returns (uint256) {
(uint256 price, bool isAlive) = getPriceInfo(asset);
if (!isAlive) {
revert PriceNotAlive(asset);
}
return price;
}
/**
* @notice Gets the price info of an asset
* @param asset Address of the asset
* @return price Price of the asset
* @return isAlive Whether the price is considered valid
*/
function getPriceInfo(address asset) public view returns (uint256 price, bool isAlive) {
address oracle = assetOracles[asset];
if (oracle == address(0)) {
revert OracleNotSet(asset);
}
return IOracleWrapper(oracle).getPriceInfo(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.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);
}{
"evmVersion": "paris",
"metadata": {
"bytecodeHash": "ipfs",
"useLiteralContent": true
},
"optimizer": {
"enabled": true,
"runs": 200
},
"remappings": [],
"outputSelection": {
"*": {
"*": [
"evm.bytecode",
"evm.deployedBytecode",
"devdoc",
"userdoc",
"metadata",
"abi"
]
}
}
}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":[{"internalType":"address","name":"asset","type":"address"}],"name":"OracleNotSet","type":"error"},{"inputs":[{"internalType":"address","name":"asset","type":"address"}],"name":"PriceNotAlive","type":"error"},{"inputs":[{"internalType":"address","name":"asset","type":"address"},{"internalType":"address","name":"oracle","type":"address"},{"internalType":"uint256","name":"expectedBaseUnit","type":"uint256"},{"internalType":"uint256","name":"oracleBaseUnit","type":"uint256"}],"name":"UnexpectedBaseUnit","type":"error"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"asset","type":"address"},{"indexed":true,"internalType":"address","name":"oracle","type":"address"}],"name":"OracleUpdated","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":"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":"assetOracles","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"baseCurrency","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"baseCurrencyUnit","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"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":[{"internalType":"address","name":"asset","type":"address"}],"name":"removeOracle","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":"address","name":"asset","type":"address"},{"internalType":"address","name":"oracle","type":"address"}],"name":"setOracle","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
60c060405234801561001057600080fd5b50604051610b3b380380610b3b83398101604081905261002f9161012b565b6001600160a01b03821660a052608081905261004c60003361007f565b506100777fced6982f480260bdd8ad5cb18ff2854f0306d78d904ad6cc107e8f3a0f526c183361007f565b505050610165565b6000828152602081815260408083206001600160a01b038516845290915281205460ff16610121576000838152602081815260408083206001600160a01b03861684529091529020805460ff191660011790556100d93390565b6001600160a01b0316826001600160a01b0316847f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a4506001610125565b5060005b92915050565b6000806040838503121561013e57600080fd5b82516001600160a01b038116811461015557600080fd5b6020939093015192949293505050565b60805160a0516109956101a66000396000818161024b01526102c40152600081816101e7015281816102ed0152818161044e015261049901526109956000f3fe608060405234801561001057600080fd5b506004361061010b5760003560e01c806391d14854116100a2578063bfc69e1c11610071578063bfc69e1c14610288578063d547741f146102af578063e19f4700146102c2578063f3bddde1146102e8578063fdc85fc41461030f57600080fd5b806391d148541461023357806392a85fde14610246578063a217fddf1461026d578063b3596f071461027557600080fd5b806336568abe116100de57806336568abe146101bf5780635c38eb3a146101d25780638c89b64f146101e55780638edbf4361461020b57600080fd5b806301ffc9a714610110578063248a9ca3146101385780632b663986146101695780632f2ff15d146101aa575b600080fd5b61012361011e36600461083a565b610322565b60405190151581526020015b60405180910390f35b61015b61014636600461086b565b60009081526020819052604090206001015490565b60405190815260200161012f565b6101926101773660046108a0565b6001602052600090815260409020546001600160a01b031681565b6040516001600160a01b03909116815260200161012f565b6101bd6101b83660046108bb565b610359565b005b6101bd6101cd3660046108bb565b610384565b6101bd6101e03660046108e7565b6103bc565b7f000000000000000000000000000000000000000000000000000000000000000061015b565b61021e6102193660046108a0565b61052a565b6040805192835290151560208301520161012f565b6101236102413660046108bb565b6105e5565b6101927f000000000000000000000000000000000000000000000000000000000000000081565b61015b600081565b61015b6102833660046108a0565b61060e565b61015b7fced6982f480260bdd8ad5cb18ff2854f0306d78d904ad6cc107e8f3a0f526c1881565b6101bd6102bd3660046108bb565b610650565b7f0000000000000000000000000000000000000000000000000000000000000000610192565b61015b7f000000000000000000000000000000000000000000000000000000000000000081565b6101bd61031d3660046108a0565b610675565b60006001600160e01b03198216637965db0b60e01b148061035357506301ffc9a760e01b6001600160e01b03198316145b92915050565b600082815260208190526040902060010154610374816106f3565b61037e8383610700565b50505050565b6001600160a01b03811633146103ad5760405163334bd91960e11b815260040160405180910390fd5b6103b78282610792565b505050565b7fced6982f480260bdd8ad5cb18ff2854f0306d78d904ad6cc107e8f3a0f526c186103e6816106f3565b6000826001600160a01b0316638c89b64f6040518163ffffffff1660e01b8152600401602060405180830381865afa158015610426573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061044a9190610911565b90507f000000000000000000000000000000000000000000000000000000000000000081146104d15760405163ef09a31360e01b81526001600160a01b038086166004830152841660248201527f00000000000000000000000000000000000000000000000000000000000000006044820152606481018290526084015b60405180910390fd5b6001600160a01b0384811660008181526001602052604080822080546001600160a01b0319169488169485179055517f078c3b417dadf69374a59793b829c52001247130433427049317bde56607b1b79190a350505050565b6001600160a01b0380821660009081526001602052604081205490918291168061057257604051634bf9754b60e11b81526001600160a01b03851660048201526024016104c8565b60405163476dfa1b60e11b81526001600160a01b038581166004830152821690638edbf436906024016040805180830381865afa1580156105b7573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906105db919061092a565b9250925050915091565b6000918252602082815260408084206001600160a01b0393909316845291905290205460ff1690565b600080600061061c8461052a565b91509150806106495760405163118297e560e01b81526001600160a01b03851660048201526024016104c8565b5092915050565b60008281526020819052604090206001015461066b816106f3565b61037e8383610792565b7fced6982f480260bdd8ad5cb18ff2854f0306d78d904ad6cc107e8f3a0f526c1861069f816106f3565b6001600160a01b03821660008181526001602052604080822080546001600160a01b0319169055519091907f078c3b417dadf69374a59793b829c52001247130433427049317bde56607b1b7908390a35050565b6106fd81336107fd565b50565b600061070c83836105e5565b61078a576000838152602081815260408083206001600160a01b03861684529091529020805460ff191660011790556107423390565b6001600160a01b0316826001600160a01b0316847f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a4506001610353565b506000610353565b600061079e83836105e5565b1561078a576000838152602081815260408083206001600160a01b0386168085529252808320805460ff1916905551339286917ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b9190a4506001610353565b61080782826105e5565b6108365760405163e2517d3f60e01b81526001600160a01b0382166004820152602481018390526044016104c8565b5050565b60006020828403121561084c57600080fd5b81356001600160e01b03198116811461086457600080fd5b9392505050565b60006020828403121561087d57600080fd5b5035919050565b80356001600160a01b038116811461089b57600080fd5b919050565b6000602082840312156108b257600080fd5b61086482610884565b600080604083850312156108ce57600080fd5b823591506108de60208401610884565b90509250929050565b600080604083850312156108fa57600080fd5b61090383610884565b91506108de60208401610884565b60006020828403121561092357600080fd5b5051919050565b6000806040838503121561093d57600080fd5b825191506020830151801515811461095457600080fd5b80915050925092905056fea264697066735822122081a9015768ca4d648ce99675bdbce8e2b4a1dd29eb1c001ef8edb1c88c52864564736f6c6343000816003300000000000000000000000055f937def274c6cbd9444f0857639757c5a2a3e90000000000000000000000000000000000000000000000000de0b6b3a7640000
Deployed Bytecode
0x608060405234801561001057600080fd5b506004361061010b5760003560e01c806391d14854116100a2578063bfc69e1c11610071578063bfc69e1c14610288578063d547741f146102af578063e19f4700146102c2578063f3bddde1146102e8578063fdc85fc41461030f57600080fd5b806391d148541461023357806392a85fde14610246578063a217fddf1461026d578063b3596f071461027557600080fd5b806336568abe116100de57806336568abe146101bf5780635c38eb3a146101d25780638c89b64f146101e55780638edbf4361461020b57600080fd5b806301ffc9a714610110578063248a9ca3146101385780632b663986146101695780632f2ff15d146101aa575b600080fd5b61012361011e36600461083a565b610322565b60405190151581526020015b60405180910390f35b61015b61014636600461086b565b60009081526020819052604090206001015490565b60405190815260200161012f565b6101926101773660046108a0565b6001602052600090815260409020546001600160a01b031681565b6040516001600160a01b03909116815260200161012f565b6101bd6101b83660046108bb565b610359565b005b6101bd6101cd3660046108bb565b610384565b6101bd6101e03660046108e7565b6103bc565b7f0000000000000000000000000000000000000000000000000de0b6b3a764000061015b565b61021e6102193660046108a0565b61052a565b6040805192835290151560208301520161012f565b6101236102413660046108bb565b6105e5565b6101927f00000000000000000000000055f937def274c6cbd9444f0857639757c5a2a3e981565b61015b600081565b61015b6102833660046108a0565b61060e565b61015b7fced6982f480260bdd8ad5cb18ff2854f0306d78d904ad6cc107e8f3a0f526c1881565b6101bd6102bd3660046108bb565b610650565b7f00000000000000000000000055f937def274c6cbd9444f0857639757c5a2a3e9610192565b61015b7f0000000000000000000000000000000000000000000000000de0b6b3a764000081565b6101bd61031d3660046108a0565b610675565b60006001600160e01b03198216637965db0b60e01b148061035357506301ffc9a760e01b6001600160e01b03198316145b92915050565b600082815260208190526040902060010154610374816106f3565b61037e8383610700565b50505050565b6001600160a01b03811633146103ad5760405163334bd91960e11b815260040160405180910390fd5b6103b78282610792565b505050565b7fced6982f480260bdd8ad5cb18ff2854f0306d78d904ad6cc107e8f3a0f526c186103e6816106f3565b6000826001600160a01b0316638c89b64f6040518163ffffffff1660e01b8152600401602060405180830381865afa158015610426573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061044a9190610911565b90507f0000000000000000000000000000000000000000000000000de0b6b3a764000081146104d15760405163ef09a31360e01b81526001600160a01b038086166004830152841660248201527f0000000000000000000000000000000000000000000000000de0b6b3a76400006044820152606481018290526084015b60405180910390fd5b6001600160a01b0384811660008181526001602052604080822080546001600160a01b0319169488169485179055517f078c3b417dadf69374a59793b829c52001247130433427049317bde56607b1b79190a350505050565b6001600160a01b0380821660009081526001602052604081205490918291168061057257604051634bf9754b60e11b81526001600160a01b03851660048201526024016104c8565b60405163476dfa1b60e11b81526001600160a01b038581166004830152821690638edbf436906024016040805180830381865afa1580156105b7573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906105db919061092a565b9250925050915091565b6000918252602082815260408084206001600160a01b0393909316845291905290205460ff1690565b600080600061061c8461052a565b91509150806106495760405163118297e560e01b81526001600160a01b03851660048201526024016104c8565b5092915050565b60008281526020819052604090206001015461066b816106f3565b61037e8383610792565b7fced6982f480260bdd8ad5cb18ff2854f0306d78d904ad6cc107e8f3a0f526c1861069f816106f3565b6001600160a01b03821660008181526001602052604080822080546001600160a01b0319169055519091907f078c3b417dadf69374a59793b829c52001247130433427049317bde56607b1b7908390a35050565b6106fd81336107fd565b50565b600061070c83836105e5565b61078a576000838152602081815260408083206001600160a01b03861684529091529020805460ff191660011790556107423390565b6001600160a01b0316826001600160a01b0316847f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a4506001610353565b506000610353565b600061079e83836105e5565b1561078a576000838152602081815260408083206001600160a01b0386168085529252808320805460ff1916905551339286917ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b9190a4506001610353565b61080782826105e5565b6108365760405163e2517d3f60e01b81526001600160a01b0382166004820152602481018390526044016104c8565b5050565b60006020828403121561084c57600080fd5b81356001600160e01b03198116811461086457600080fd5b9392505050565b60006020828403121561087d57600080fd5b5035919050565b80356001600160a01b038116811461089b57600080fd5b919050565b6000602082840312156108b257600080fd5b61086482610884565b600080604083850312156108ce57600080fd5b823591506108de60208401610884565b90509250929050565b600080604083850312156108fa57600080fd5b61090383610884565b91506108de60208401610884565b60006020828403121561092357600080fd5b5051919050565b6000806040838503121561093d57600080fd5b825191506020830151801515811461095457600080fd5b80915050925092905056fea264697066735822122081a9015768ca4d648ce99675bdbce8e2b4a1dd29eb1c001ef8edb1c88c52864564736f6c63430008160033
Constructor Arguments (ABI-Encoded and is the last bytes of the Contract Creation Code above)
00000000000000000000000055f937def274c6cbd9444f0857639757c5a2a3e90000000000000000000000000000000000000000000000000de0b6b3a7640000
-----Decoded View---------------
Arg [0] : _baseCurrency (address): 0x55F937DEF274C6CBd9444f0857639757C5A2a3E9
Arg [1] : _baseCurrencyUnit (uint256): 1000000000000000000
-----Encoded View---------------
2 Constructor Arguments found :
Arg [0] : 00000000000000000000000055f937def274c6cbd9444f0857639757c5a2a3e9
Arg [1] : 0000000000000000000000000000000000000000000000000de0b6b3a7640000
Loading...
Loading
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.