Overview
MNT Balance
MNT Value
$0.00View more zero value Internal Transactions in Advanced View mode
Advanced mode:
Cross-Chain Transactions
Loading...
Loading
Contract Name:
RWADynamicOracle
Compiler Version
v0.8.16+commit.07a7930e
Optimization Enabled:
Yes with 100 runs
Other Settings:
default evmVersion
Contract Source Code (Solidity Standard Json-Input format)
/**SPDX-License-Identifier: BUSL-1.1
▄▄█████████▄
╓██▀└ ,╓▄▄▄, '▀██▄
██▀ ▄██▀▀╙╙▀▀██▄ └██µ ,, ,, , ,,, ,,,
██ ,██¬ ▄████▄ ▀█▄ ╙█▄ ▄███▀▀███▄ ███▄ ██ ███▀▀▀███▄ ▄███▀▀███,
██ ██ ╒█▀' ╙█▌ ╙█▌ ██ ▐██ ███ █████, ██ ██▌ └██▌ ██▌ └██▌
██ ▐█▌ ██ ╟█ █▌ ╟█ ██▌ ▐██ ██ └███ ██ ██▌ ╟██ j██ ╟██
╟█ ██ ╙██ ▄█▀ ▐█▌ ██ ╙██ ██▌ ██ ╙████ ██▌ ▄██▀ ██▌ ,██▀
██ "██, ╙▀▀███████████⌐ ╙████████▀ ██ ╙██ ███████▀▀ ╙███████▀`
██▄ ╙▀██▄▄▄▄▄,,, ¬─ '─¬
╙▀██▄ '╙╙╙▀▀▀▀▀▀▀▀
╙▀▀██████R⌐
*/
pragma solidity 0.8.16;
import "contracts/rwaOracles/IRWAOracle.sol";
import "contracts/external/openzeppelin/contracts/access/AccessControlEnumerable.sol";
import "contracts/external/openzeppelin/contracts/security/Pausable.sol";
contract RWADynamicOracle is IRWAOracle, AccessControlEnumerable, Pausable {
uint256 public constant DAY = 1 days;
Range[] public ranges;
bytes32 public constant SETTER_ROLE = keccak256("SETTER_ROLE");
bytes32 public constant PAUSER_ROLE = keccak256("PAUSER_ROLE");
constructor(
address admin,
address setter,
address pauser,
uint256 firstRangeStart,
uint256 firstRangeEnd,
uint256 dailyIR,
uint256 startPrice
) {
_grantRole(DEFAULT_ADMIN_ROLE, admin);
_grantRole(PAUSER_ROLE, pauser);
_grantRole(SETTER_ROLE, setter);
if (firstRangeStart >= firstRangeEnd) revert InvalidRange();
if (firstRangeStart > block.timestamp) revert InvalidRangeStart();
uint256 trueStart = (startPrice * ONE) / dailyIR;
ranges.push(Range(firstRangeStart, firstRangeEnd, dailyIR, trueStart));
}
/*//////////////////////////////////////////////////////////////
Public Functions
//////////////////////////////////////////////////////////////*/
/**
* @notice Function which returns the daily price of USDY given the range previously set
*
* @return price The current price of USDY, in 18 decimals
* @return timestamp The current timestamp of the call
*/
function getPriceData()
external
view
returns (uint256 price, uint256 timestamp)
{
price = getPrice();
timestamp = block.timestamp;
}
/**
* @notice Function which returns the daily price of USDY given the range previously set
*
* @return price The current price of USDY, in 18 decimals
*
* @dev The Ranges are not intended to be set more than 2 ranges in advance
* from the current range
*/
function getPrice() public view whenNotPaused returns (uint256 price) {
uint256 length = ranges.length;
for (uint256 i = length; i > 0; --i) {
Range storage range = ranges[i - 1];
if (range.start <= block.timestamp) {
if (range.end <= block.timestamp) {
return derivePrice(range, range.end - 1);
} else {
return derivePrice(range, block.timestamp);
}
}
}
}
/**
* @notice External view function which will return the price of
* USDY at a given point in time.
*
* @param timestamp The unix timestamp at which you would like
* the price for
* @dev Notice that when no historical price exists this function
* will return `0`
*/
function getPriceHistorical(
uint256 timestamp
) external view returns (uint256 price) {
uint256 length = ranges.length;
for (uint256 i = length; i > 0; --i) {
Range storage range = ranges[i - 1];
if (range.start <= timestamp) {
if (range.end <= timestamp) {
return derivePrice(range, range.end - 1);
} else {
return derivePrice(range, timestamp);
}
}
}
}
/**
* @notice External helper function used to simulate the derivation of the prices returned
* from the oracle, given a range and a timestamp
*
* @dev If you are simulating the first range, you MUST set `startTime` and `rangeStartPrice`
* @dev If you are simulating a range > 1st then `startTime` and `rangeStartPrice` values
* remain unused.
*
* @param blockTimeStamp The unixTimestamp of the point in time you wish to simulate
* @param dailyIR The daily Interest Rate for the range to simulate
* @param endTime The end time for the range to simulate
* @param startTime The start time for the range to simulate
* @param rangeStartPrice The start price for the range to simulate
*
*/
function simulateRange(
uint256 blockTimeStamp,
uint256 dailyIR,
uint256 endTime,
uint256 startTime,
uint256 rangeStartPrice
) external view returns (uint256 price) {
uint256 length = ranges.length;
Range[] memory rangeList = new Range[](length + 1);
for (uint256 i = 0; i < length; ++i) {
rangeList[i] = ranges[i];
}
if (startTime == ranges[0].start) {
uint256 trueStart = (rangeStartPrice * ONE) / dailyIR;
rangeList[length] = Range(startTime, endTime, dailyIR, trueStart);
} else {
Range memory lastRange = ranges[ranges.length - 1];
uint256 prevClosePrice = derivePrice(lastRange, lastRange.end - 1);
rangeList[length] = Range(
lastRange.end,
endTime,
dailyIR,
prevClosePrice
);
}
for (uint256 i = 0; i < length + 1; ++i) {
Range memory range = rangeList[(length) - i];
if (range.start <= blockTimeStamp) {
if (range.end <= blockTimeStamp) {
return derivePrice(range, range.end - 1);
} else {
return derivePrice(range, blockTimeStamp);
}
}
}
}
/*//////////////////////////////////////////////////////////////
Admin Functions
//////////////////////////////////////////////////////////////*/
/**
* @notice Function that allows for an admin to set a given price range for USDY
*
* @param endTimestamp The timestamp for the range to end
* @param dailyInterestRate The daily interest rate during said range
*/
function setRange(
uint256 endTimestamp,
uint256 dailyInterestRate
) external onlyRole(SETTER_ROLE) {
// Assert that dailyInterestRate is >= 1
if (dailyInterestRate < ONE) revert InvalidInterestRate();
Range memory lastRange = ranges[ranges.length - 1];
// Check that the endTimestamp is greater than the last range's end time
if (lastRange.end >= endTimestamp) revert InvalidRange();
// Assert that the range is in whole units of days
if ((endTimestamp - lastRange.end) % 1 days != 0) revert InvalidRange();
uint256 prevClosePrice = derivePrice(lastRange, lastRange.end - 1);
ranges.push(
Range(lastRange.end, endTimestamp, dailyInterestRate, prevClosePrice)
);
emit RangeSet(
ranges.length - 1,
lastRange.end,
endTimestamp,
dailyInterestRate,
prevClosePrice
);
}
/**
* @notice Function that allows for an admin to override a previously set range
*
* @param indexToModify The index of the range that we want to change
* @param newStart The new start time for the updated range
* @param newEnd The new end time for the updated range
* @param newDailyIR The new daily interest rate for the range to update
* @param newPrevRangeClosePrice The previous ranges close price
*
* @dev This function enforces that the range being overriden does not
* overlap with any other set ranges
* @dev If closed ranges are updated, the result is a stale value for `prevRangeClosePrice`
*/
function overrideRange(
uint256 indexToModify,
uint256 newStart,
uint256 newEnd,
uint256 newDailyIR,
uint256 newPrevRangeClosePrice
) external onlyRole(DEFAULT_ADMIN_ROLE) {
// Check that the ranges start and end time are less than each other
if (newStart >= newEnd) revert InvalidRange();
uint256 rangeLength = ranges.length;
// Case 1: The range being modified is the first range
if (indexToModify == 0) {
// If the length of ranges is greater than 1,
// Ensure that the newEnd time is not greater than the start time of the next range
if (rangeLength > 1 && newEnd > ranges[indexToModify + 1].start)
revert InvalidRange();
}
// Case 2: The range being modified is the last range
else if (indexToModify == rangeLength - 1) {
// Ensure that the newStart time is not less than the end time of the previous range
if (newStart < ranges[indexToModify - 1].end) revert InvalidRange();
}
// Case 3: The range being modified is between first and last range
else {
// Ensure that the newStart time is not less than the end time of the previous range
if (newStart < ranges[indexToModify - 1].end) revert InvalidRange();
// Ensure that the newEnd time is not greater than the start time of the next range
if (newEnd > ranges[indexToModify + 1].start) revert InvalidRange();
}
// Update range
if (indexToModify == 0) {
uint256 trueStart = (newPrevRangeClosePrice * ONE) / newDailyIR;
ranges[indexToModify] = Range(newStart, newEnd, newDailyIR, trueStart);
} else {
ranges[indexToModify] = Range(
newStart,
newEnd,
newDailyIR,
newPrevRangeClosePrice
);
}
emit RangeOverriden(
indexToModify,
newStart,
newEnd,
newDailyIR,
newPrevRangeClosePrice
);
}
/**
* @notice Function to pause the oracle
*/
function pauseOracle() external onlyRole(PAUSER_ROLE) {
_pause();
}
/**
* @notice Function to unpause the oracle
*/
function unpauseOracle() external onlyRole(DEFAULT_ADMIN_ROLE) {
_unpause();
}
/*//////////////////////////////////////////////////////////////
Internal Functions
//////////////////////////////////////////////////////////////*/
/**
* @notice Internal helper function used to derive the price of USDY
*
* @param currentRange The current range to derive the price of USDY from
* @param currentTime The current unixTimestamp of the blockchain
*/
function derivePrice(
Range memory currentRange,
uint256 currentTime
) internal pure returns (uint256 price) {
uint256 elapsedDays = (currentTime - currentRange.start) / DAY;
return
roundUpTo8(
_rmul(
_rpow(currentRange.dailyInterestRate, elapsedDays + 1, ONE),
currentRange.prevRangeClosePrice
)
);
}
/**
* @notice internal function that will round derived price to the 8th decimal
* and will round 5 up
*
* @param value The value to round
*/
function roundUpTo8(uint256 value) internal pure returns (uint256) {
uint256 remainder = value % 1e10;
if (remainder >= 0.5e10) {
value += 1e10;
}
value -= remainder;
return value;
}
/*//////////////////////////////////////////////////////////////
Structs, Events and Errors
//////////////////////////////////////////////////////////////*/
struct Range {
uint256 start;
uint256 end;
uint256 dailyInterestRate;
uint256 prevRangeClosePrice;
}
/**
* @notice Event emitted when a range has been set
*
* @param start The start time for the range
* @param end The end time for the range
* @param dailyInterestRate The daily interest rate for the range
*/
event RangeSet(
uint256 indexed index,
uint256 start,
uint256 end,
uint256 dailyInterestRate,
uint256 prevRangeClosePrice
);
/**
* @notice Event emitted when a previously set range is overriden
*
* @param index The index of the range being modified
* @param newStart The new start time for the modified range
* @param newEnd The new end time for the modified range
* @param newDailyInterestRate The new dailyInterestRate for the modified range
* @param newPrevRangeClosePrice The new prevRangeClosePrice for the modified range
*/
event RangeOverriden(
uint256 indexed index,
uint256 newStart,
uint256 newEnd,
uint256 newDailyInterestRate,
uint256 newPrevRangeClosePrice
);
error InvalidRangeStart();
error InvalidRange();
error InvalidInterestRate();
/*//////////////////////////////////////////////////////////////
Interest calculation helper functions
//////////////////////////////////////////////////////////////*/
// Copied from https://github.com/makerdao/dss/blob/master/src/jug.sol
uint256 private constant ONE = 10 ** 27;
function _rpow(
uint256 x,
uint256 n,
uint256 base
) internal pure returns (uint256 z) {
assembly {
switch x
case 0 {
switch n
case 0 {
z := base
}
default {
z := 0
}
}
default {
switch mod(n, 2)
case 0 {
z := base
}
default {
z := x
}
let half := div(base, 2) // for rounding.
for {
n := div(n, 2)
} n {
n := div(n, 2)
} {
let xx := mul(x, x)
if iszero(eq(div(xx, x), x)) {
revert(0, 0)
}
let xxRound := add(xx, half)
if lt(xxRound, xx) {
revert(0, 0)
}
x := div(xxRound, base)
if mod(n, 2) {
let zx := mul(z, x)
if and(iszero(iszero(x)), iszero(eq(div(zx, x), z))) {
revert(0, 0)
}
let zxRound := add(zx, half)
if lt(zxRound, zx) {
revert(0, 0)
}
z := div(zxRound, base)
}
}
}
}
}
function _rmul(uint256 x, uint256 y) internal pure returns (uint256 z) {
z = _mul(x, y) / ONE;
}
function _mul(uint256 x, uint256 y) internal pure returns (uint256 z) {
require(y == 0 || (z = x * y) / y == x);
}
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.5.0) (access/AccessControl.sol)
pragma solidity ^0.8.0;
import "contracts/external/openzeppelin/contracts/access/IAccessControl.sol";
import "contracts/external/openzeppelin/contracts/utils/Context.sol";
import "contracts/external/openzeppelin/contracts/utils/Strings.sol";
import "contracts/external/openzeppelin/contracts/utils/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:
*
* ```
* 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}:
*
* ```
* 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.
*/
abstract contract AccessControl is Context, IAccessControl, ERC165 {
struct RoleData {
mapping(address => bool) members;
bytes32 adminRole;
}
mapping(bytes32 => RoleData) private _roles;
bytes32 public constant DEFAULT_ADMIN_ROLE = 0x00;
/**
* @dev Modifier that checks that an account has a specific role. Reverts
* with a standardized message including the required role.
*
* The format of the revert reason is given by the following regular expression:
*
* /^AccessControl: account (0x[0-9a-f]{40}) is missing role (0x[0-9a-f]{64})$/
*
* _Available since v4.1._
*/
modifier onlyRole(bytes32 role) {
_checkRole(role, _msgSender());
_;
}
/**
* @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
override
returns (bool)
{
return _roles[role].members[account];
}
/**
* @dev Revert with a standard message if `account` is missing `role`.
*
* The format of the revert reason is given by the following regular expression:
*
* /^AccessControl: account (0x[0-9a-f]{40}) is missing role (0x[0-9a-f]{64})$/
*/
function _checkRole(bytes32 role, address account) internal view virtual {
if (!hasRole(role, account)) {
revert(
string(
abi.encodePacked(
"AccessControl: account ",
Strings.toHexString(uint160(account), 20),
" is missing role ",
Strings.toHexString(uint256(role), 32)
)
)
);
}
}
/**
* @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
override
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.
*/
function grantRole(bytes32 role, address account)
public
virtual
override
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.
*/
function revokeRole(bytes32 role, address account)
public
virtual
override
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 `account`.
*/
function renounceRole(bytes32 role, address account) public virtual override {
require(
account == _msgSender(),
"AccessControl: can only renounce roles for self"
);
_revokeRole(role, account);
}
/**
* @dev Grants `role` to `account`.
*
* If `account` had not been already granted `role`, emits a {RoleGranted}
* event. Note that unlike {grantRole}, this function doesn't perform any
* checks on the calling account.
*
* [WARNING]
* ====
* This function should only be called from the constructor when setting
* up the initial roles for the system.
*
* Using this function in any other way is effectively circumventing the admin
* system imposed by {AccessControl}.
* ====
*
* NOTE: This function is deprecated in favor of {_grantRole}.
*/
function _setupRole(bytes32 role, address account) internal virtual {
_grantRole(role, account);
}
/**
* @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 Grants `role` to `account`.
*
* Internal function without access restriction.
*/
function _grantRole(bytes32 role, address account) internal virtual {
if (!hasRole(role, account)) {
_roles[role].members[account] = true;
emit RoleGranted(role, account, _msgSender());
}
}
/**
* @dev Revokes `role` from `account`.
*
* Internal function without access restriction.
*/
function _revokeRole(bytes32 role, address account) internal virtual {
if (hasRole(role, account)) {
_roles[role].members[account] = false;
emit RoleRevoked(role, account, _msgSender());
}
}
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (utils/introspection/IERC165.sol)
pragma solidity ^0.8.0;
/**
* @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: MIT
// OpenZeppelin Contracts (last updated v4.5.0) (access/AccessControlEnumerable.sol)
pragma solidity ^0.8.0;
import "contracts/external/openzeppelin/contracts/access/IAccessControlEnumerable.sol";
import "contracts/external/openzeppelin/contracts/access/AccessControl.sol";
import "contracts/external/openzeppelin/contracts/utils/EnumerableSet.sol";
/**
* @dev Extension of {AccessControl} that allows enumerating the members of each role.
*/
abstract contract AccessControlEnumerable is
IAccessControlEnumerable,
AccessControl
{
using EnumerableSet for EnumerableSet.AddressSet;
mapping(bytes32 => EnumerableSet.AddressSet) private _roleMembers;
/**
* @dev See {IERC165-supportsInterface}.
*/
function supportsInterface(bytes4 interfaceId)
public
view
virtual
override
returns (bool)
{
return
interfaceId == type(IAccessControlEnumerable).interfaceId ||
super.supportsInterface(interfaceId);
}
/**
* @dev Returns one of the accounts that have `role`. `index` must be a
* value between 0 and {getRoleMemberCount}, non-inclusive.
*
* Role bearers are not sorted in any particular way, and their ordering may
* change at any point.
*
* WARNING: When using {getRoleMember} and {getRoleMemberCount}, make sure
* you perform all queries on the same block. See the following
* https://forum.openzeppelin.com/t/iterating-over-elements-on-enumerableset-in-openzeppelin-contracts/2296[forum post]
* for more information.
*/
function getRoleMember(bytes32 role, uint256 index)
public
view
virtual
override
returns (address)
{
return _roleMembers[role].at(index);
}
/**
* @dev Returns the number of accounts that have `role`. Can be used
* together with {getRoleMember} to enumerate all bearers of a role.
*/
function getRoleMemberCount(bytes32 role)
public
view
virtual
override
returns (uint256)
{
return _roleMembers[role].length();
}
/**
* @dev Overload {_grantRole} to track enumerable memberships
*/
function _grantRole(bytes32 role, address account) internal virtual override {
super._grantRole(role, account);
_roleMembers[role].add(account);
}
/**
* @dev Overload {_revokeRole} to track enumerable memberships
*/
function _revokeRole(bytes32 role, address account)
internal
virtual
override
{
super._revokeRole(role, account);
_roleMembers[role].remove(account);
}
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (access/IAccessControl.sol)
pragma solidity ^0.8.0;
/**
* @dev External interface of AccessControl declared to support ERC165 detection.
*/
interface IAccessControl {
/**
* @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.
*
* _Available since v3.1._
*/
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 `account`.
*/
function renounceRole(bytes32 role, address account) external;
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (access/IAccessControlEnumerable.sol)
pragma solidity ^0.8.0;
import "contracts/external/openzeppelin/contracts/access/IAccessControl.sol";
/**
* @dev External interface of AccessControlEnumerable declared to support ERC165 detection.
*/
interface IAccessControlEnumerable is IAccessControl {
/**
* @dev Returns one of the accounts that have `role`. `index` must be a
* value between 0 and {getRoleMemberCount}, non-inclusive.
*
* Role bearers are not sorted in any particular way, and their ordering may
* change at any point.
*
* WARNING: When using {getRoleMember} and {getRoleMemberCount}, make sure
* you perform all queries on the same block. See the following
* https://forum.openzeppelin.com/t/iterating-over-elements-on-enumerableset-in-openzeppelin-contracts/2296[forum post]
* for more information.
*/
function getRoleMember(bytes32 role, uint256 index)
external
view
returns (address);
/**
* @dev Returns the number of accounts that have `role`. Can be used
* together with {getRoleMember} to enumerate all bearers of a role.
*/
function getRoleMemberCount(bytes32 role) external view returns (uint256);
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (security/Pausable.sol)
pragma solidity ^0.8.0;
import "contracts/external/openzeppelin/contracts/utils/Context.sol";
/**
* @dev Contract module which allows children to implement an emergency stop
* mechanism that can be triggered by an authorized account.
*
* This module is used through inheritance. It will make available the
* modifiers `whenNotPaused` and `whenPaused`, which can be applied to
* the functions of your contract. Note that they will not be pausable by
* simply including this module, only once the modifiers are put in place.
*/
abstract contract Pausable is Context {
/**
* @dev Emitted when the pause is triggered by `account`.
*/
event Paused(address account);
/**
* @dev Emitted when the pause is lifted by `account`.
*/
event Unpaused(address account);
bool private _paused;
/**
* @dev Initializes the contract in unpaused state.
*/
constructor() {
_paused = false;
}
/**
* @dev Returns true if the contract is paused, and false otherwise.
*/
function paused() public view virtual returns (bool) {
return _paused;
}
/**
* @dev Modifier to make a function callable only when the contract is not paused.
*
* Requirements:
*
* - The contract must not be paused.
*/
modifier whenNotPaused() {
require(!paused(), "Pausable: paused");
_;
}
/**
* @dev Modifier to make a function callable only when the contract is paused.
*
* Requirements:
*
* - The contract must be paused.
*/
modifier whenPaused() {
require(paused(), "Pausable: not paused");
_;
}
/**
* @dev Triggers stopped state.
*
* Requirements:
*
* - The contract must not be paused.
*/
function _pause() internal virtual whenNotPaused {
_paused = true;
emit Paused(_msgSender());
}
/**
* @dev Returns to normal state.
*
* Requirements:
*
* - The contract must be paused.
*/
function _unpause() internal virtual whenPaused {
_paused = false;
emit Unpaused(_msgSender());
}
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (utils/Context.sol)
pragma solidity ^0.8.0;
/**
* @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;
}
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (utils/introspection/ERC165.sol)
pragma solidity ^0.8.0;
import "contracts/external/openzeppelin/contracts/utils/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);
* }
* ```
*
* Alternatively, {ERC165Storage} provides an easier to use but more expensive implementation.
*/
abstract contract ERC165 is IERC165 {
/**
* @dev See {IERC165-supportsInterface}.
*/
function supportsInterface(bytes4 interfaceId)
public
view
virtual
override
returns (bool)
{
return interfaceId == type(IERC165).interfaceId;
}
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (utils/structs/EnumerableSet.sol)
pragma solidity ^0.8.0;
/**
* @dev Library for managing
* https://en.wikipedia.org/wiki/Set_(abstract_data_type)[sets] of primitive
* types.
*
* Sets have the following properties:
*
* - Elements are added, removed, and checked for existence in constant time
* (O(1)).
* - Elements are enumerated in O(n). No guarantees are made on the ordering.
*
* ```
* contract Example {
* // Add the library methods
* using EnumerableSet for EnumerableSet.AddressSet;
*
* // Declare a set state variable
* EnumerableSet.AddressSet private mySet;
* }
* ```
*
* As of v3.3.0, sets of type `bytes32` (`Bytes32Set`), `address` (`AddressSet`)
* and `uint256` (`UintSet`) are supported.
*/
library EnumerableSet {
// To implement this library for multiple types with as little code
// repetition as possible, we write it in terms of a generic Set type with
// bytes32 values.
// The Set implementation uses private functions, and user-facing
// implementations (such as AddressSet) are just wrappers around the
// underlying Set.
// This means that we can only create new EnumerableSets for types that fit
// in bytes32.
struct Set {
// Storage of set values
bytes32[] _values;
// Position of the value in the `values` array, plus 1 because index 0
// means a value is not in the set.
mapping(bytes32 => uint256) _indexes;
}
/**
* @dev Add a value to a set. O(1).
*
* Returns true if the value was added to the set, that is if it was not
* already present.
*/
function _add(Set storage set, bytes32 value) private returns (bool) {
if (!_contains(set, value)) {
set._values.push(value);
// The value is stored at length-1, but we add 1 to all indexes
// and use 0 as a sentinel value
set._indexes[value] = set._values.length;
return true;
} else {
return false;
}
}
/**
* @dev Removes a value from a set. O(1).
*
* Returns true if the value was removed from the set, that is if it was
* present.
*/
function _remove(Set storage set, bytes32 value) private returns (bool) {
// We read and store the value's index to prevent multiple reads from the same storage slot
uint256 valueIndex = set._indexes[value];
if (valueIndex != 0) {
// Equivalent to contains(set, value)
// To delete an element from the _values array in O(1), we swap the element to delete with the last one in
// the array, and then remove the last element (sometimes called as 'swap and pop').
// This modifies the order of the array, as noted in {at}.
uint256 toDeleteIndex = valueIndex - 1;
uint256 lastIndex = set._values.length - 1;
if (lastIndex != toDeleteIndex) {
bytes32 lastvalue = set._values[lastIndex];
// Move the last value to the index where the value to delete is
set._values[toDeleteIndex] = lastvalue;
// Update the index for the moved value
set._indexes[lastvalue] = valueIndex; // Replace lastvalue's index to valueIndex
}
// Delete the slot where the moved value was stored
set._values.pop();
// Delete the index for the deleted slot
delete set._indexes[value];
return true;
} else {
return false;
}
}
/**
* @dev Returns true if the value is in the set. O(1).
*/
function _contains(Set storage set, bytes32 value)
private
view
returns (bool)
{
return set._indexes[value] != 0;
}
/**
* @dev Returns the number of values on the set. O(1).
*/
function _length(Set storage set) private view returns (uint256) {
return set._values.length;
}
/**
* @dev Returns the value stored at position `index` in the set. O(1).
*
* Note that there are no guarantees on the ordering of values inside the
* array, and it may change when more values are added or removed.
*
* Requirements:
*
* - `index` must be strictly less than {length}.
*/
function _at(Set storage set, uint256 index) private view returns (bytes32) {
return set._values[index];
}
/**
* @dev Return the entire set in an array
*
* WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed
* to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that
* this function has an unbounded cost, and using it as part of a state-changing function may render the function
* uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block.
*/
function _values(Set storage set) private view returns (bytes32[] memory) {
return set._values;
}
// Bytes32Set
struct Bytes32Set {
Set _inner;
}
/**
* @dev Add a value to a set. O(1).
*
* Returns true if the value was added to the set, that is if it was not
* already present.
*/
function add(Bytes32Set storage set, bytes32 value) internal returns (bool) {
return _add(set._inner, value);
}
/**
* @dev Removes a value from a set. O(1).
*
* Returns true if the value was removed from the set, that is if it was
* present.
*/
function remove(Bytes32Set storage set, bytes32 value)
internal
returns (bool)
{
return _remove(set._inner, value);
}
/**
* @dev Returns true if the value is in the set. O(1).
*/
function contains(Bytes32Set storage set, bytes32 value)
internal
view
returns (bool)
{
return _contains(set._inner, value);
}
/**
* @dev Returns the number of values in the set. O(1).
*/
function length(Bytes32Set storage set) internal view returns (uint256) {
return _length(set._inner);
}
/**
* @dev Returns the value stored at position `index` in the set. O(1).
*
* Note that there are no guarantees on the ordering of values inside the
* array, and it may change when more values are added or removed.
*
* Requirements:
*
* - `index` must be strictly less than {length}.
*/
function at(Bytes32Set storage set, uint256 index)
internal
view
returns (bytes32)
{
return _at(set._inner, index);
}
/**
* @dev Return the entire set in an array
*
* WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed
* to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that
* this function has an unbounded cost, and using it as part of a state-changing function may render the function
* uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block.
*/
function values(Bytes32Set storage set)
internal
view
returns (bytes32[] memory)
{
return _values(set._inner);
}
// AddressSet
struct AddressSet {
Set _inner;
}
/**
* @dev Add a value to a set. O(1).
*
* Returns true if the value was added to the set, that is if it was not
* already present.
*/
function add(AddressSet storage set, address value) internal returns (bool) {
return _add(set._inner, bytes32(uint256(uint160(value))));
}
/**
* @dev Removes a value from a set. O(1).
*
* Returns true if the value was removed from the set, that is if it was
* present.
*/
function remove(AddressSet storage set, address value)
internal
returns (bool)
{
return _remove(set._inner, bytes32(uint256(uint160(value))));
}
/**
* @dev Returns true if the value is in the set. O(1).
*/
function contains(AddressSet storage set, address value)
internal
view
returns (bool)
{
return _contains(set._inner, bytes32(uint256(uint160(value))));
}
/**
* @dev Returns the number of values in the set. O(1).
*/
function length(AddressSet storage set) internal view returns (uint256) {
return _length(set._inner);
}
/**
* @dev Returns the value stored at position `index` in the set. O(1).
*
* Note that there are no guarantees on the ordering of values inside the
* array, and it may change when more values are added or removed.
*
* Requirements:
*
* - `index` must be strictly less than {length}.
*/
function at(AddressSet storage set, uint256 index)
internal
view
returns (address)
{
return address(uint160(uint256(_at(set._inner, index))));
}
/**
* @dev Return the entire set in an array
*
* WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed
* to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that
* this function has an unbounded cost, and using it as part of a state-changing function may render the function
* uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block.
*/
function values(AddressSet storage set)
internal
view
returns (address[] memory)
{
bytes32[] memory store = _values(set._inner);
address[] memory result;
assembly {
result := store
}
return result;
}
// UintSet
struct UintSet {
Set _inner;
}
/**
* @dev Add a value to a set. O(1).
*
* Returns true if the value was added to the set, that is if it was not
* already present.
*/
function add(UintSet storage set, uint256 value) internal returns (bool) {
return _add(set._inner, bytes32(value));
}
/**
* @dev Removes a value from a set. O(1).
*
* Returns true if the value was removed from the set, that is if it was
* present.
*/
function remove(UintSet storage set, uint256 value) internal returns (bool) {
return _remove(set._inner, bytes32(value));
}
/**
* @dev Returns true if the value is in the set. O(1).
*/
function contains(UintSet storage set, uint256 value)
internal
view
returns (bool)
{
return _contains(set._inner, bytes32(value));
}
/**
* @dev Returns the number of values on the set. O(1).
*/
function length(UintSet storage set) internal view returns (uint256) {
return _length(set._inner);
}
/**
* @dev Returns the value stored at position `index` in the set. O(1).
*
* Note that there are no guarantees on the ordering of values inside the
* array, and it may change when more values are added or removed.
*
* Requirements:
*
* - `index` must be strictly less than {length}.
*/
function at(UintSet storage set, uint256 index)
internal
view
returns (uint256)
{
return uint256(_at(set._inner, index));
}
/**
* @dev Return the entire set in an array
*
* WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed
* to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that
* this function has an unbounded cost, and using it as part of a state-changing function may render the function
* uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block.
*/
function values(UintSet storage set)
internal
view
returns (uint256[] memory)
{
bytes32[] memory store = _values(set._inner);
uint256[] memory result;
assembly {
result := store
}
return result;
}
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (utils/Strings.sol)
pragma solidity ^0.8.0;
/**
* @dev String operations.
*/
library Strings {
bytes16 private constant _HEX_SYMBOLS = "0123456789abcdef";
/**
* @dev Converts a `uint256` to its ASCII `string` decimal representation.
*/
function toString(uint256 value) internal pure returns (string memory) {
// Inspired by OraclizeAPI's implementation - MIT licence
// https://github.com/oraclize/ethereum-api/blob/b42146b063c7d6ee1358846c198246239e9360e8/oraclizeAPI_0.4.25.sol
if (value == 0) {
return "0";
}
uint256 temp = value;
uint256 digits;
while (temp != 0) {
digits++;
temp /= 10;
}
bytes memory buffer = new bytes(digits);
while (value != 0) {
digits -= 1;
buffer[digits] = bytes1(uint8(48 + uint256(value % 10)));
value /= 10;
}
return string(buffer);
}
/**
* @dev Converts a `uint256` to its ASCII `string` hexadecimal representation.
*/
function toHexString(uint256 value) internal pure returns (string memory) {
if (value == 0) {
return "0x00";
}
uint256 temp = value;
uint256 length = 0;
while (temp != 0) {
length++;
temp >>= 8;
}
return toHexString(value, length);
}
/**
* @dev Converts a `uint256` to its ASCII `string` hexadecimal representation with fixed length.
*/
function toHexString(uint256 value, uint256 length)
internal
pure
returns (string memory)
{
bytes memory buffer = new bytes(2 * length + 2);
buffer[0] = "0";
buffer[1] = "x";
for (uint256 i = 2 * length + 1; i > 1; --i) {
buffer[i] = _HEX_SYMBOLS[value & 0xf];
value >>= 4;
}
require(value == 0, "Strings: hex length insufficient");
return string(buffer);
}
}/**SPDX-License-Identifier: BUSL-1.1
▄▄█████████▄
╓██▀└ ,╓▄▄▄, '▀██▄
██▀ ▄██▀▀╙╙▀▀██▄ └██µ ,, ,, , ,,, ,,,
██ ,██¬ ▄████▄ ▀█▄ ╙█▄ ▄███▀▀███▄ ███▄ ██ ███▀▀▀███▄ ▄███▀▀███,
██ ██ ╒█▀' ╙█▌ ╙█▌ ██ ▐██ ███ █████, ██ ██▌ └██▌ ██▌ └██▌
██ ▐█▌ ██ ╟█ █▌ ╟█ ██▌ ▐██ ██ └███ ██ ██▌ ╟██ j██ ╟██
╟█ ██ ╙██ ▄█▀ ▐█▌ ██ ╙██ ██▌ ██ ╙████ ██▌ ▄██▀ ██▌ ,██▀
██ "██, ╙▀▀███████████⌐ ╙████████▀ ██ ╙██ ███████▀▀ ╙███████▀`
██▄ ╙▀██▄▄▄▄▄,,, ¬─ '─¬
╙▀██▄ '╙╙╙▀▀▀▀▀▀▀▀
╙▀▀██████R⌐
*/
pragma solidity 0.8.16;
interface IRWAOracle {
/// @notice Retrieve RWA price data
function getPriceData()
external
view
returns (uint256 price, uint256 timestamp);
}{
"libraries": {},
"metadata": {
"useLiteralContent": true
},
"optimizer": {
"enabled": true,
"runs": 100
},
"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":"admin","type":"address"},{"internalType":"address","name":"setter","type":"address"},{"internalType":"address","name":"pauser","type":"address"},{"internalType":"uint256","name":"firstRangeStart","type":"uint256"},{"internalType":"uint256","name":"firstRangeEnd","type":"uint256"},{"internalType":"uint256","name":"dailyIR","type":"uint256"},{"internalType":"uint256","name":"startPrice","type":"uint256"}],"stateMutability":"nonpayable","type":"constructor"},{"inputs":[],"name":"InvalidInterestRate","type":"error"},{"inputs":[],"name":"InvalidRange","type":"error"},{"inputs":[],"name":"InvalidRangeStart","type":"error"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"account","type":"address"}],"name":"Paused","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"index","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"newStart","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"newEnd","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"newDailyInterestRate","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"newPrevRangeClosePrice","type":"uint256"}],"name":"RangeOverriden","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"index","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"start","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"end","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"dailyInterestRate","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"prevRangeClosePrice","type":"uint256"}],"name":"RangeSet","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"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"account","type":"address"}],"name":"Unpaused","type":"event"},{"inputs":[],"name":"DAY","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":"PAUSER_ROLE","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"SETTER_ROLE","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getPrice","outputs":[{"internalType":"uint256","name":"price","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getPriceData","outputs":[{"internalType":"uint256","name":"price","type":"uint256"},{"internalType":"uint256","name":"timestamp","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"timestamp","type":"uint256"}],"name":"getPriceHistorical","outputs":[{"internalType":"uint256","name":"price","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"}],"name":"getRoleAdmin","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"uint256","name":"index","type":"uint256"}],"name":"getRoleMember","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"}],"name":"getRoleMemberCount","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"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":"uint256","name":"indexToModify","type":"uint256"},{"internalType":"uint256","name":"newStart","type":"uint256"},{"internalType":"uint256","name":"newEnd","type":"uint256"},{"internalType":"uint256","name":"newDailyIR","type":"uint256"},{"internalType":"uint256","name":"newPrevRangeClosePrice","type":"uint256"}],"name":"overrideRange","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"pauseOracle","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"paused","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"ranges","outputs":[{"internalType":"uint256","name":"start","type":"uint256"},{"internalType":"uint256","name":"end","type":"uint256"},{"internalType":"uint256","name":"dailyInterestRate","type":"uint256"},{"internalType":"uint256","name":"prevRangeClosePrice","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","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":"endTimestamp","type":"uint256"},{"internalType":"uint256","name":"dailyInterestRate","type":"uint256"}],"name":"setRange","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"blockTimeStamp","type":"uint256"},{"internalType":"uint256","name":"dailyIR","type":"uint256"},{"internalType":"uint256","name":"endTime","type":"uint256"},{"internalType":"uint256","name":"startTime","type":"uint256"},{"internalType":"uint256","name":"rangeStartPrice","type":"uint256"}],"name":"simulateRange","outputs":[{"internalType":"uint256","name":"price","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes4","name":"interfaceId","type":"bytes4"}],"name":"supportsInterface","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"unpauseOracle","outputs":[],"stateMutability":"nonpayable","type":"function"}]Contract Creation Code
60806040523480156200001157600080fd5b5060405162001e8338038062001e83833981016040819052620000349162000359565b6002805460ff191690556200004b600088620001e6565b620000777f65d7a28e3265b37a6474929f336521b332c1681b933f6cb9f3376673440d862a86620001e6565b620000a37f61c92169ef077349011ff0b1383c894d86c5f0b41d986366b58a6cf31e93beda87620001e6565b828410620000c45760405163561ce9bb60e01b815260040160405180910390fd5b42841115620000e657604051633b06765360e21b815260040160405180910390fd5b600082620001016b033b2e3c9fd0803ce800000084620003ca565b6200010d9190620003f8565b60408051608081018252968752602087019586528601938452606086019081526003805460018101825560009190915295517fc2575a0e9e593c00f959f8c92f12db2869c3395a3b0502d05e2516446f71f85b60049097029687015593517fc2575a0e9e593c00f959f8c92f12db2869c3395a3b0502d05e2516446f71f85c8601555050517fc2575a0e9e593c00f959f8c92f12db2869c3395a3b0502d05e2516446f71f85d830155517fc2575a0e9e593c00f959f8c92f12db2869c3395a3b0502d05e2516446f71f85e90910155506200041b915050565b620001fd82826200022960201b62000fa31760201c565b60008281526001602090815260409091206200022491839062001027620002ca821b17901c565b505050565b6000828152602081815260408083206001600160a01b038516845290915290205460ff16620002c6576000828152602081815260408083206001600160a01b03851684529091529020805460ff19166001179055620002853390565b6001600160a01b0316816001600160a01b0316837f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a45b5050565b6000620002e1836001600160a01b038416620002ea565b90505b92915050565b60008181526001830160205260408120546200033357508154600181810184556000848152602080822090930184905584548482528286019093526040902091909155620002e4565b506000620002e4565b80516001600160a01b03811681146200035457600080fd5b919050565b600080600080600080600060e0888a0312156200037557600080fd5b62000380886200033c565b965062000390602089016200033c565b9550620003a0604089016200033c565b9450606088015193506080880151925060a0880151915060c0880151905092959891949750929550565b6000816000190483118215151615620003f357634e487b7160e01b600052601160045260246000fd5b500290565b6000826200041657634e487b7160e01b600052601260045260246000fd5b500490565b611a58806200042b6000396000f3fe608060405234801561001057600080fd5b50600436106101425760003560e01c806383ad4542116100b8578063a217fddf1161007c578063a217fddf146102c6578063a4a28168146102ce578063a712c9c7146102eb578063ca15c873146102fe578063d547741f14610311578063e63ab1e91461032457600080fd5b806383ad4542146102465780639010d07c1461025957806391d148541461028457806398d5fdca14610297578063a2011b3f1461029f57600080fd5b80632f2ff15d1161010a5780632f2ff15d146101bc57806336568abe146101cf5780634c983986146101e25780635c975abb146101f55780635fdecdfa1461020057806366b1d6c31461023357600080fd5b806301ffc9a7146101475780630fab68651461016f578063248a9ca314610179578063253ea980146101aa57806327cfe856146101b2575b600080fd5b61015a61015536600461174b565b61034b565b60405190151581526020015b60405180910390f35b610177610376565b005b61019c610187366004611775565b60009081526020819052604090206001015490565b604051908152602001610166565b61017761038d565b61019c6201518081565b6101776101ca36600461178e565b6103c0565b6101776101dd36600461178e565b6103eb565b6101776101f03660046117ca565b61046e565b60025460ff1661015a565b61021361020e366004611775565b610764565b604080519485526020850193909352918301526060820152608001610166565b61019c6102413660046117ca565b61079e565b610177610254366004611805565b610aad565b61026c610267366004611805565b610d19565b6040516001600160a01b039091168152602001610166565b61015a61029236600461178e565b610d38565b61019c610d61565b61019c7f61c92169ef077349011ff0b1383c894d86c5f0b41d986366b58a6cf31e93beda81565b61019c600081565b6102d6610e71565b60408051928352602083019190915201610166565b61019c6102f9366004611775565b610e84565b61019c61030c366004611775565b610f66565b61017761031f36600461178e565b610f7d565b61019c7f65d7a28e3265b37a6474929f336521b332c1681b933f6cb9f3376673440d862a81565b60006001600160e01b03198216635a05180f60e01b148061037057506103708261103c565b92915050565b60006103828133611071565b61038a6110d5565b50565b7f65d7a28e3265b37a6474929f336521b332c1681b933f6cb9f3376673440d862a6103b88133611071565b61038a611168565b6000828152602081905260409020600101546103dc8133611071565b6103e683836111c0565b505050565b6001600160a01b03811633146104605760405162461bcd60e51b815260206004820152602f60248201527f416363657373436f6e74726f6c3a2063616e206f6e6c792072656e6f756e636560448201526e103937b632b9903337b91039b2b63360891b60648201526084015b60405180910390fd5b61046a82826111e2565b5050565b600061047a8133611071565b83851061049a5760405163561ce9bb60e01b815260040160405180910390fd5b6003546000879003610506576001811180156104e3575060036104be88600161183d565b815481106104ce576104ce611850565b90600052602060002090600402016000015485115b156105015760405163561ce9bb60e01b815260040160405180910390fd5b610604565b610511600182611866565b8703610566576003610524600189611866565b8154811061053457610534611850565b9060005260206000209060040201600101548610156105015760405163561ce9bb60e01b815260040160405180910390fd5b6003610573600189611866565b8154811061058357610583611850565b9060005260206000209060040201600101548610156105b55760405163561ce9bb60e01b815260040160405180910390fd5b60036105c288600161183d565b815481106105d2576105d2611850565b9060005260206000209060040201600001548511156106045760405163561ce9bb60e01b815260040160405180910390fd5b866000036106a357600084610624676765c793fa10079d601b1b86611879565b61062e91906118ae565b90506040518060800160405280888152602001878152602001868152602001828152506003898154811061066457610664611850565b90600052602060002090600402016000820151816000015560208201518160010155604082015181600201556060820151816003015590505050610711565b604051806080016040528087815260200186815260200185815260200184815250600388815481106106d7576106d7611850565b9060005260206000209060040201600082015181600001556020820151816001015560408201518160020155606082015181600301559050505b60408051878152602081018790529081018590526060810184905287907f1d4ab332f121243dc2230aa9d0a537bde65d8f9f7fd7516fe17b9a8b7ca738d19060800160405180910390a250505050505050565b6003818154811061077457600080fd5b60009182526020909120600490910201805460018201546002830154600390930154919350919084565b600354600090816107b082600161183d565b67ffffffffffffffff8111156107c8576107c86118c2565b60405190808252806020026020018201604052801561082457816020015b6108116040518060800160405280600081526020016000815260200160008152602001600081525090565b8152602001906001900390816107e65790505b50905060005b828110156108b4576003818154811061084557610845611850565b906000526020600020906004020160405180608001604052908160008201548152602001600182015481526020016002820154815260200160038201548152505082828151811061089857610898611850565b6020026020010181905250806108ad906118d8565b905061082a565b5060036000815481106108c9576108c9611850565b9060005260206000209060040201600001548503610949576000876108f9676765c793fa10079d601b1b87611879565b61090391906118ae565b905060405180608001604052808781526020018881526020018981526020018281525082848151811061093857610938611850565b602002602001018190525050610a13565b600380546000919061095d90600190611866565b8154811061096d5761096d611850565b9060005260206000209060040201604051806080016040529081600082015481526020016001820154815260200160028201548152602001600382015481525050905060006109cc82600184602001516109c79190611866565b611204565b90506040518060800160405280836020015181526020018981526020018a815260200182815250838581518110610a0557610a05611850565b602002602001018190525050505b60005b610a2183600161183d565b811015610aa057600082610a358386611866565b81518110610a4557610a45611850565b6020026020010151905089816000015111610a8f5789816020015111610a8557610a7a81600183602001516109c79190611866565b945050505050610aa4565b610a7a818b611204565b50610a99816118d8565b9050610a16565b5050505b95945050505050565b7f61c92169ef077349011ff0b1383c894d86c5f0b41d986366b58a6cf31e93beda610ad88133611071565b676765c793fa10079d601b1b821015610b045760405163b770249b60e01b815260040160405180910390fd5b6003805460009190610b1890600190611866565b81548110610b2857610b28611850565b9060005260206000209060040201604051806080016040529081600082015481526020016001820154815260200160028201548152602001600382015481525050905083816020015110610b8f5760405163561ce9bb60e01b815260040160405180910390fd5b62015180816020015185610ba39190611866565b610bad91906118f1565b15610bcb5760405163561ce9bb60e01b815260040160405180910390fd5b6000610be282600184602001516109c79190611866565b6040805160808101825260208581015182528101888152918101878152606082018481526003805460018082018355600083905294517fc2575a0e9e593c00f959f8c92f12db2869c3395a3b0502d05e2516446f71f85b60049092029182015594517fc2575a0e9e593c00f959f8c92f12db2869c3395a3b0502d05e2516446f71f85c86015591517fc2575a0e9e593c00f959f8c92f12db2869c3395a3b0502d05e2516446f71f85d850155517fc2575a0e9e593c00f959f8c92f12db2869c3395a3b0502d05e2516446f71f85e909301929092559054919250610cc591611866565b60208084015160408051918252918101889052908101869052606081018390527fa1a823e20687dfa63aaad1f0b3054ae6c4ee99ce18c3295bf3a96decd1ef682d9060800160405180910390a25050505050565b6000828152600160205260408120610d31908361126a565b9392505050565b6000918252602082815260408084206001600160a01b0393909316845291905290205460ff1690565b6000610d6f60025460ff1690565b15610d8c5760405162461bcd60e51b815260040161045790611905565b600354805b8015610e6c5760006003610da6600184611866565b81548110610db657610db6611850565b9060005260206000209060040201905042816000015411610e5b5742816001015411610e235760408051608081018252825481526001808401546020830181905260028501549383019390935260038401546060830152610e1b926109c79190611866565b935050505090565b60408051608081018252825481526001830154602082015260028301549181019190915260038201546060820152610e1b9042611204565b50610e658161192f565b9050610d91565b505090565b600080610e7c610d61565b924292509050565b600354600090805b8015610f5f5760006003610ea1600184611866565b81548110610eb157610eb1611850565b9060005260206000209060040201905084816000015411610f4e5784816001015411610f165760408051608081018252825481526001808401546020830181905260028501549383019390935260038401546060830152610aa4926109c79190611866565b60408051608081018252825481526001830154602082015260028301549181019190915260038201546060820152610aa49086611204565b50610f588161192f565b9050610e8c565b5050919050565b600081815260016020526040812061037090611276565b600082815260208190526040902060010154610f998133611071565b6103e683836111e2565b610fad8282610d38565b61046a576000828152602081815260408083206001600160a01b03851684529091529020805460ff19166001179055610fe33390565b6001600160a01b0316816001600160a01b0316837f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a45050565b6000610d31836001600160a01b038416611280565b60006001600160e01b03198216637965db0b60e01b148061037057506301ffc9a760e01b6001600160e01b0319831614610370565b61107b8282610d38565b61046a57611093816001600160a01b031660146112cf565b61109e8360206112cf565b6040516020016110af92919061196a565b60408051601f198184030181529082905262461bcd60e51b8252610457916004016119d9565b60025460ff1661111e5760405162461bcd60e51b815260206004820152601460248201527314185d5cd8589b194e881b9bdd081c185d5cd95960621b6044820152606401610457565b6002805460ff191690557f5db9ee0a495bf2e6ff9c91a7834c1ba4fdd244a5e8aa4e537bd38aeae4b073aa335b6040516001600160a01b03909116815260200160405180910390a1565b60025460ff161561118b5760405162461bcd60e51b815260040161045790611905565b6002805460ff191660011790557f62e78cea01bee320cd4e420270b5ea74000d11b0c9f74754ebdbfc544b05a25861114b3390565b6111ca8282610fa3565b60008281526001602052604090206103e69082611027565b6111ec828261146b565b60008281526001602052604090206103e690826114d0565b6000806201518084600001518461121b9190611866565b61122591906118ae565b905061126261125d6112538660400151846001611242919061183d565b676765c793fa10079d601b1b6114e5565b86606001516115a3565b6115c5565b949350505050565b6000610d318383611601565b6000610370825490565b60008181526001830160205260408120546112c757508154600181810184556000848152602080822090930184905584548482528286019093526040902091909155610370565b506000610370565b606060006112de836002611879565b6112e990600261183d565b67ffffffffffffffff811115611301576113016118c2565b6040519080825280601f01601f19166020018201604052801561132b576020820181803683370190505b509050600360fc1b8160008151811061134657611346611850565b60200101906001600160f81b031916908160001a905350600f60fb1b8160018151811061137557611375611850565b60200101906001600160f81b031916908160001a9053506000611399846002611879565b6113a490600161183d565b90505b600181111561141c576f181899199a1a9b1b9c1cb0b131b232b360811b85600f16601081106113d8576113d8611850565b1a60f81b8282815181106113ee576113ee611850565b60200101906001600160f81b031916908160001a90535060049490941c936114158161192f565b90506113a7565b508315610d315760405162461bcd60e51b815260206004820181905260248201527f537472696e67733a20686578206c656e67746820696e73756666696369656e746044820152606401610457565b6114758282610d38565b1561046a576000828152602081815260408083206001600160a01b0385168085529252808320805460ff1916905551339285917ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b9190a45050565b6000610d31836001600160a01b03841661162b565b60008380156115855760018416801561150057859250611504565b8392505b50600283046002850494505b841561157f57858602868782041461152757600080fd5b8181018181101561153757600080fd5b859004965050600185161561157457858302838782041415871515161561155d57600080fd5b8181018181101561156d57600080fd5b8590049350505b600285049450611510565b5061159b565b8380156115955760009250611599565b8392505b505b509392505050565b6000676765c793fa10079d601b1b6115bb848461171e565b610d3191906118ae565b6000806115d76402540be400846118f1565b905064012a05f20081106115f7576115f46402540be4008461183d565b92505b610d318184611866565b600082600001828154811061161857611618611850565b9060005260206000200154905092915050565b6000818152600183016020526040812054801561171457600061164f600183611866565b855490915060009061166390600190611866565b90508181146116c857600086600001828154811061168357611683611850565b90600052602060002001549050808760000184815481106116a6576116a6611850565b6000918252602080832090910192909255918252600188019052604090208390555b85548690806116d9576116d9611a0c565b600190038181906000526020600020016000905590558560010160008681526020019081526020016000206000905560019350505050610370565b6000915050610370565b6000811580611742575082826117348183611879565b925061174090836118ae565b145b61037057600080fd5b60006020828403121561175d57600080fd5b81356001600160e01b031981168114610d3157600080fd5b60006020828403121561178757600080fd5b5035919050565b600080604083850312156117a157600080fd5b8235915060208301356001600160a01b03811681146117bf57600080fd5b809150509250929050565b600080600080600060a086880312156117e257600080fd5b505083359560208501359550604085013594606081013594506080013592509050565b6000806040838503121561181857600080fd5b50508035926020909101359150565b634e487b7160e01b600052601160045260246000fd5b8082018082111561037057610370611827565b634e487b7160e01b600052603260045260246000fd5b8181038181111561037057610370611827565b600081600019048311821515161561189357611893611827565b500290565b634e487b7160e01b600052601260045260246000fd5b6000826118bd576118bd611898565b500490565b634e487b7160e01b600052604160045260246000fd5b6000600182016118ea576118ea611827565b5060010190565b60008261190057611900611898565b500690565b60208082526010908201526f14185d5cd8589b194e881c185d5cd95960821b604082015260600190565b60008161193e5761193e611827565b506000190190565b60005b83811015611961578181015183820152602001611949565b50506000910152565b76020b1b1b2b9b9a1b7b73a3937b61d1030b1b1b7bab73a1604d1b81526000835161199c816017850160208801611946565b7001034b99036b4b9b9b4b733903937b6329607d1b60179184019182015283516119cd816028840160208801611946565b01602801949350505050565b60208152600082518060208401526119f8816040850160208701611946565b601f01601f19169190910160400192915050565b634e487b7160e01b600052603160045260246000fdfea26469706673582212205b449d0d31a22daf453b25e19fa4b56a3412613be270cc47e7e07d2ee38cb1b664736f6c63430008100033000000000000000000000000c8a7870ffe41054612f7f3433e173d8b5bfca8e3000000000000000000000000c8a7870ffe41054612f7f3433e173d8b5bfca8e3000000000000000000000000c04e1818932f24ec03457763def23475d575a44c0000000000000000000000000000000000000000000000000000000064c84b000000000000000000000000000000000000000000000000000000000064f129800000000000000000000000000000000000000000033b4a8b6e7d153e32c000000000000000000000000000000000000000000000000000000de0b6b3a7640000
Deployed Bytecode
0x608060405234801561001057600080fd5b50600436106101425760003560e01c806383ad4542116100b8578063a217fddf1161007c578063a217fddf146102c6578063a4a28168146102ce578063a712c9c7146102eb578063ca15c873146102fe578063d547741f14610311578063e63ab1e91461032457600080fd5b806383ad4542146102465780639010d07c1461025957806391d148541461028457806398d5fdca14610297578063a2011b3f1461029f57600080fd5b80632f2ff15d1161010a5780632f2ff15d146101bc57806336568abe146101cf5780634c983986146101e25780635c975abb146101f55780635fdecdfa1461020057806366b1d6c31461023357600080fd5b806301ffc9a7146101475780630fab68651461016f578063248a9ca314610179578063253ea980146101aa57806327cfe856146101b2575b600080fd5b61015a61015536600461174b565b61034b565b60405190151581526020015b60405180910390f35b610177610376565b005b61019c610187366004611775565b60009081526020819052604090206001015490565b604051908152602001610166565b61017761038d565b61019c6201518081565b6101776101ca36600461178e565b6103c0565b6101776101dd36600461178e565b6103eb565b6101776101f03660046117ca565b61046e565b60025460ff1661015a565b61021361020e366004611775565b610764565b604080519485526020850193909352918301526060820152608001610166565b61019c6102413660046117ca565b61079e565b610177610254366004611805565b610aad565b61026c610267366004611805565b610d19565b6040516001600160a01b039091168152602001610166565b61015a61029236600461178e565b610d38565b61019c610d61565b61019c7f61c92169ef077349011ff0b1383c894d86c5f0b41d986366b58a6cf31e93beda81565b61019c600081565b6102d6610e71565b60408051928352602083019190915201610166565b61019c6102f9366004611775565b610e84565b61019c61030c366004611775565b610f66565b61017761031f36600461178e565b610f7d565b61019c7f65d7a28e3265b37a6474929f336521b332c1681b933f6cb9f3376673440d862a81565b60006001600160e01b03198216635a05180f60e01b148061037057506103708261103c565b92915050565b60006103828133611071565b61038a6110d5565b50565b7f65d7a28e3265b37a6474929f336521b332c1681b933f6cb9f3376673440d862a6103b88133611071565b61038a611168565b6000828152602081905260409020600101546103dc8133611071565b6103e683836111c0565b505050565b6001600160a01b03811633146104605760405162461bcd60e51b815260206004820152602f60248201527f416363657373436f6e74726f6c3a2063616e206f6e6c792072656e6f756e636560448201526e103937b632b9903337b91039b2b63360891b60648201526084015b60405180910390fd5b61046a82826111e2565b5050565b600061047a8133611071565b83851061049a5760405163561ce9bb60e01b815260040160405180910390fd5b6003546000879003610506576001811180156104e3575060036104be88600161183d565b815481106104ce576104ce611850565b90600052602060002090600402016000015485115b156105015760405163561ce9bb60e01b815260040160405180910390fd5b610604565b610511600182611866565b8703610566576003610524600189611866565b8154811061053457610534611850565b9060005260206000209060040201600101548610156105015760405163561ce9bb60e01b815260040160405180910390fd5b6003610573600189611866565b8154811061058357610583611850565b9060005260206000209060040201600101548610156105b55760405163561ce9bb60e01b815260040160405180910390fd5b60036105c288600161183d565b815481106105d2576105d2611850565b9060005260206000209060040201600001548511156106045760405163561ce9bb60e01b815260040160405180910390fd5b866000036106a357600084610624676765c793fa10079d601b1b86611879565b61062e91906118ae565b90506040518060800160405280888152602001878152602001868152602001828152506003898154811061066457610664611850565b90600052602060002090600402016000820151816000015560208201518160010155604082015181600201556060820151816003015590505050610711565b604051806080016040528087815260200186815260200185815260200184815250600388815481106106d7576106d7611850565b9060005260206000209060040201600082015181600001556020820151816001015560408201518160020155606082015181600301559050505b60408051878152602081018790529081018590526060810184905287907f1d4ab332f121243dc2230aa9d0a537bde65d8f9f7fd7516fe17b9a8b7ca738d19060800160405180910390a250505050505050565b6003818154811061077457600080fd5b60009182526020909120600490910201805460018201546002830154600390930154919350919084565b600354600090816107b082600161183d565b67ffffffffffffffff8111156107c8576107c86118c2565b60405190808252806020026020018201604052801561082457816020015b6108116040518060800160405280600081526020016000815260200160008152602001600081525090565b8152602001906001900390816107e65790505b50905060005b828110156108b4576003818154811061084557610845611850565b906000526020600020906004020160405180608001604052908160008201548152602001600182015481526020016002820154815260200160038201548152505082828151811061089857610898611850565b6020026020010181905250806108ad906118d8565b905061082a565b5060036000815481106108c9576108c9611850565b9060005260206000209060040201600001548503610949576000876108f9676765c793fa10079d601b1b87611879565b61090391906118ae565b905060405180608001604052808781526020018881526020018981526020018281525082848151811061093857610938611850565b602002602001018190525050610a13565b600380546000919061095d90600190611866565b8154811061096d5761096d611850565b9060005260206000209060040201604051806080016040529081600082015481526020016001820154815260200160028201548152602001600382015481525050905060006109cc82600184602001516109c79190611866565b611204565b90506040518060800160405280836020015181526020018981526020018a815260200182815250838581518110610a0557610a05611850565b602002602001018190525050505b60005b610a2183600161183d565b811015610aa057600082610a358386611866565b81518110610a4557610a45611850565b6020026020010151905089816000015111610a8f5789816020015111610a8557610a7a81600183602001516109c79190611866565b945050505050610aa4565b610a7a818b611204565b50610a99816118d8565b9050610a16565b5050505b95945050505050565b7f61c92169ef077349011ff0b1383c894d86c5f0b41d986366b58a6cf31e93beda610ad88133611071565b676765c793fa10079d601b1b821015610b045760405163b770249b60e01b815260040160405180910390fd5b6003805460009190610b1890600190611866565b81548110610b2857610b28611850565b9060005260206000209060040201604051806080016040529081600082015481526020016001820154815260200160028201548152602001600382015481525050905083816020015110610b8f5760405163561ce9bb60e01b815260040160405180910390fd5b62015180816020015185610ba39190611866565b610bad91906118f1565b15610bcb5760405163561ce9bb60e01b815260040160405180910390fd5b6000610be282600184602001516109c79190611866565b6040805160808101825260208581015182528101888152918101878152606082018481526003805460018082018355600083905294517fc2575a0e9e593c00f959f8c92f12db2869c3395a3b0502d05e2516446f71f85b60049092029182015594517fc2575a0e9e593c00f959f8c92f12db2869c3395a3b0502d05e2516446f71f85c86015591517fc2575a0e9e593c00f959f8c92f12db2869c3395a3b0502d05e2516446f71f85d850155517fc2575a0e9e593c00f959f8c92f12db2869c3395a3b0502d05e2516446f71f85e909301929092559054919250610cc591611866565b60208084015160408051918252918101889052908101869052606081018390527fa1a823e20687dfa63aaad1f0b3054ae6c4ee99ce18c3295bf3a96decd1ef682d9060800160405180910390a25050505050565b6000828152600160205260408120610d31908361126a565b9392505050565b6000918252602082815260408084206001600160a01b0393909316845291905290205460ff1690565b6000610d6f60025460ff1690565b15610d8c5760405162461bcd60e51b815260040161045790611905565b600354805b8015610e6c5760006003610da6600184611866565b81548110610db657610db6611850565b9060005260206000209060040201905042816000015411610e5b5742816001015411610e235760408051608081018252825481526001808401546020830181905260028501549383019390935260038401546060830152610e1b926109c79190611866565b935050505090565b60408051608081018252825481526001830154602082015260028301549181019190915260038201546060820152610e1b9042611204565b50610e658161192f565b9050610d91565b505090565b600080610e7c610d61565b924292509050565b600354600090805b8015610f5f5760006003610ea1600184611866565b81548110610eb157610eb1611850565b9060005260206000209060040201905084816000015411610f4e5784816001015411610f165760408051608081018252825481526001808401546020830181905260028501549383019390935260038401546060830152610aa4926109c79190611866565b60408051608081018252825481526001830154602082015260028301549181019190915260038201546060820152610aa49086611204565b50610f588161192f565b9050610e8c565b5050919050565b600081815260016020526040812061037090611276565b600082815260208190526040902060010154610f998133611071565b6103e683836111e2565b610fad8282610d38565b61046a576000828152602081815260408083206001600160a01b03851684529091529020805460ff19166001179055610fe33390565b6001600160a01b0316816001600160a01b0316837f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a45050565b6000610d31836001600160a01b038416611280565b60006001600160e01b03198216637965db0b60e01b148061037057506301ffc9a760e01b6001600160e01b0319831614610370565b61107b8282610d38565b61046a57611093816001600160a01b031660146112cf565b61109e8360206112cf565b6040516020016110af92919061196a565b60408051601f198184030181529082905262461bcd60e51b8252610457916004016119d9565b60025460ff1661111e5760405162461bcd60e51b815260206004820152601460248201527314185d5cd8589b194e881b9bdd081c185d5cd95960621b6044820152606401610457565b6002805460ff191690557f5db9ee0a495bf2e6ff9c91a7834c1ba4fdd244a5e8aa4e537bd38aeae4b073aa335b6040516001600160a01b03909116815260200160405180910390a1565b60025460ff161561118b5760405162461bcd60e51b815260040161045790611905565b6002805460ff191660011790557f62e78cea01bee320cd4e420270b5ea74000d11b0c9f74754ebdbfc544b05a25861114b3390565b6111ca8282610fa3565b60008281526001602052604090206103e69082611027565b6111ec828261146b565b60008281526001602052604090206103e690826114d0565b6000806201518084600001518461121b9190611866565b61122591906118ae565b905061126261125d6112538660400151846001611242919061183d565b676765c793fa10079d601b1b6114e5565b86606001516115a3565b6115c5565b949350505050565b6000610d318383611601565b6000610370825490565b60008181526001830160205260408120546112c757508154600181810184556000848152602080822090930184905584548482528286019093526040902091909155610370565b506000610370565b606060006112de836002611879565b6112e990600261183d565b67ffffffffffffffff811115611301576113016118c2565b6040519080825280601f01601f19166020018201604052801561132b576020820181803683370190505b509050600360fc1b8160008151811061134657611346611850565b60200101906001600160f81b031916908160001a905350600f60fb1b8160018151811061137557611375611850565b60200101906001600160f81b031916908160001a9053506000611399846002611879565b6113a490600161183d565b90505b600181111561141c576f181899199a1a9b1b9c1cb0b131b232b360811b85600f16601081106113d8576113d8611850565b1a60f81b8282815181106113ee576113ee611850565b60200101906001600160f81b031916908160001a90535060049490941c936114158161192f565b90506113a7565b508315610d315760405162461bcd60e51b815260206004820181905260248201527f537472696e67733a20686578206c656e67746820696e73756666696369656e746044820152606401610457565b6114758282610d38565b1561046a576000828152602081815260408083206001600160a01b0385168085529252808320805460ff1916905551339285917ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b9190a45050565b6000610d31836001600160a01b03841661162b565b60008380156115855760018416801561150057859250611504565b8392505b50600283046002850494505b841561157f57858602868782041461152757600080fd5b8181018181101561153757600080fd5b859004965050600185161561157457858302838782041415871515161561155d57600080fd5b8181018181101561156d57600080fd5b8590049350505b600285049450611510565b5061159b565b8380156115955760009250611599565b8392505b505b509392505050565b6000676765c793fa10079d601b1b6115bb848461171e565b610d3191906118ae565b6000806115d76402540be400846118f1565b905064012a05f20081106115f7576115f46402540be4008461183d565b92505b610d318184611866565b600082600001828154811061161857611618611850565b9060005260206000200154905092915050565b6000818152600183016020526040812054801561171457600061164f600183611866565b855490915060009061166390600190611866565b90508181146116c857600086600001828154811061168357611683611850565b90600052602060002001549050808760000184815481106116a6576116a6611850565b6000918252602080832090910192909255918252600188019052604090208390555b85548690806116d9576116d9611a0c565b600190038181906000526020600020016000905590558560010160008681526020019081526020016000206000905560019350505050610370565b6000915050610370565b6000811580611742575082826117348183611879565b925061174090836118ae565b145b61037057600080fd5b60006020828403121561175d57600080fd5b81356001600160e01b031981168114610d3157600080fd5b60006020828403121561178757600080fd5b5035919050565b600080604083850312156117a157600080fd5b8235915060208301356001600160a01b03811681146117bf57600080fd5b809150509250929050565b600080600080600060a086880312156117e257600080fd5b505083359560208501359550604085013594606081013594506080013592509050565b6000806040838503121561181857600080fd5b50508035926020909101359150565b634e487b7160e01b600052601160045260246000fd5b8082018082111561037057610370611827565b634e487b7160e01b600052603260045260246000fd5b8181038181111561037057610370611827565b600081600019048311821515161561189357611893611827565b500290565b634e487b7160e01b600052601260045260246000fd5b6000826118bd576118bd611898565b500490565b634e487b7160e01b600052604160045260246000fd5b6000600182016118ea576118ea611827565b5060010190565b60008261190057611900611898565b500690565b60208082526010908201526f14185d5cd8589b194e881c185d5cd95960821b604082015260600190565b60008161193e5761193e611827565b506000190190565b60005b83811015611961578181015183820152602001611949565b50506000910152565b76020b1b1b2b9b9a1b7b73a3937b61d1030b1b1b7bab73a1604d1b81526000835161199c816017850160208801611946565b7001034b99036b4b9b9b4b733903937b6329607d1b60179184019182015283516119cd816028840160208801611946565b01602801949350505050565b60208152600082518060208401526119f8816040850160208701611946565b601f01601f19169190910160400192915050565b634e487b7160e01b600052603160045260246000fdfea26469706673582212205b449d0d31a22daf453b25e19fa4b56a3412613be270cc47e7e07d2ee38cb1b664736f6c63430008100033
Constructor Arguments (ABI-Encoded and is the last bytes of the Contract Creation Code above)
000000000000000000000000c8a7870ffe41054612f7f3433e173d8b5bfca8e3000000000000000000000000c8a7870ffe41054612f7f3433e173d8b5bfca8e3000000000000000000000000c04e1818932f24ec03457763def23475d575a44c0000000000000000000000000000000000000000000000000000000064c84b000000000000000000000000000000000000000000000000000000000064f129800000000000000000000000000000000000000000033b4a8b6e7d153e32c000000000000000000000000000000000000000000000000000000de0b6b3a7640000
-----Decoded View---------------
Arg [0] : admin (address): 0xC8A7870fFe41054612F7f3433E173D8b5bFcA8E3
Arg [1] : setter (address): 0xC8A7870fFe41054612F7f3433E173D8b5bFcA8E3
Arg [2] : pauser (address): 0xC04E1818932f24Ec03457763deF23475D575A44C
Arg [3] : firstRangeStart (uint256): 1690848000
Arg [4] : firstRangeEnd (uint256): 1693526400
Arg [5] : dailyIR (uint256): 1000133680000000000000000000
Arg [6] : startPrice (uint256): 1000000000000000000
-----Encoded View---------------
7 Constructor Arguments found :
Arg [0] : 000000000000000000000000c8a7870ffe41054612f7f3433e173d8b5bfca8e3
Arg [1] : 000000000000000000000000c8a7870ffe41054612f7f3433e173d8b5bfca8e3
Arg [2] : 000000000000000000000000c04e1818932f24ec03457763def23475d575a44c
Arg [3] : 0000000000000000000000000000000000000000000000000000000064c84b00
Arg [4] : 0000000000000000000000000000000000000000000000000000000064f12980
Arg [5] : 0000000000000000000000000000000000000000033b4a8b6e7d153e32c00000
Arg [6] : 0000000000000000000000000000000000000000000000000de0b6b3a7640000
Loading...
Loading
Loading...
Loading
Loading...
Loading
Net Worth in USD
$0.00
Net Worth in MNT
Multichain Portfolio | 34 Chains
| Chain | Token | Portfolio % | Price | Amount | Value |
|---|
Loading...
Loading
Loading...
Loading
Loading...
Loading
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.