Source Code
Overview
ETH Balance
0 ETH
Eth Value
$0.00More Info
Private Name Tags
ContractCreator
TokenTracker
Latest 25 from a total of 109 transactions
| Transaction Hash |
Method
|
Block
|
From
|
|
To
|
||||
|---|---|---|---|---|---|---|---|---|---|
| Update Index | 16993317 | 1061 days ago | IN | 0 ETH | 0.00289544 | ||||
| Update Index | 16986468 | 1062 days ago | IN | 0 ETH | 0.00399425 | ||||
| Update Index | 16979285 | 1063 days ago | IN | 0 ETH | 0.00484601 | ||||
| Update Index | 16972255 | 1064 days ago | IN | 0 ETH | 0.00231943 | ||||
| Update Index | 16965261 | 1065 days ago | IN | 0 ETH | 0.00219441 | ||||
| Update Index | 16958163 | 1066 days ago | IN | 0 ETH | 0.00201723 | ||||
| Update Index | 16951122 | 1067 days ago | IN | 0 ETH | 0.00249213 | ||||
| Update Index | 16943926 | 1068 days ago | IN | 0 ETH | 0.00275186 | ||||
| Update Index | 16936656 | 1069 days ago | IN | 0 ETH | 0.00355708 | ||||
| Update Index | 16929620 | 1070 days ago | IN | 0 ETH | 0.00247543 | ||||
| Update Index | 16922806 | 1071 days ago | IN | 0 ETH | 0.00244614 | ||||
| Update Index | 16915542 | 1072 days ago | IN | 0 ETH | 0.00175989 | ||||
| Update Index | 16908122 | 1073 days ago | IN | 0 ETH | 0.00204515 | ||||
| Update Index | 16901147 | 1074 days ago | IN | 0 ETH | 0.00189395 | ||||
| Update Index | 16894027 | 1075 days ago | IN | 0 ETH | 0.00174861 | ||||
| Update Index | 16886920 | 1076 days ago | IN | 0 ETH | 0.00189919 | ||||
| Update Index | 16879948 | 1077 days ago | IN | 0 ETH | 0.00156858 | ||||
| Update Index | 16872461 | 1078 days ago | IN | 0 ETH | 0.00272896 | ||||
| Update Index | 16865549 | 1079 days ago | IN | 0 ETH | 0.00227114 | ||||
| Update Index | 16858365 | 1080 days ago | IN | 0 ETH | 0.00171171 | ||||
| Update Index | 16851317 | 1081 days ago | IN | 0 ETH | 0.00564278 | ||||
| Update Index | 16844054 | 1082 days ago | IN | 0 ETH | 0.00250669 | ||||
| Update Index | 16837082 | 1083 days ago | IN | 0 ETH | 0.00228324 | ||||
| Update Index | 16829980 | 1084 days ago | IN | 0 ETH | 0.00239798 | ||||
| Update Index | 16822861 | 1085 days ago | IN | 0 ETH | 0.00200322 |
View more zero value Internal Transactions in Advanced View mode
Advanced mode:
Loading...
Loading
Loading...
Loading
Cross-Chain Transactions
Loading...
Loading
Contract Name:
Oracle
Compiler Version
v0.8.6+commit.11564f7e
Optimization Enabled:
Yes with 200 runs
Other Settings:
default evmVersion
Contract Source Code (Solidity Standard Json-Input format)
// SPDX-License-Identifier: MIT
pragma solidity 0.8.6;
import "@openzeppelin/contracts/access/AccessControl.sol";
import "./interfaces/oracle/IOracle.sol";
import "@openzeppelin/contracts/utils/cryptography/ECDSA.sol";
/**
* @title Alkimiya Oracle
* @author Alkimiya Team
*/
contract Oracle is AccessControl, IOracle {
// Constants
int8 public constant VERSION = 1;
uint32 public lastIndexedDay;
bytes32 public constant PUBLISHER_ROLE = keccak256("PUBLISHER_ROLE");
bytes32 public constant CALCULATOR_ROLE = keccak256("CALCULATOR_ROLE");
mapping(uint256 => AlkimiyaIndex) private index;
string public name;
struct AlkimiyaIndex {
uint32 referenceBlock;
uint32 timestamp;
uint128 hashrate;
uint64 difficulty;
uint256 reward;
uint256 fees;
}
constructor(string memory _name) {
_setupRole(PUBLISHER_ROLE, msg.sender);
_setupRole(DEFAULT_ADMIN_ROLE, msg.sender);
name = _name;
}
/// @notice Function to update Oracle Index
function updateIndex(
uint256 _referenceDay,
uint256 _referenceBlock,
uint256 _hashrate,
uint256 _reward,
uint256 _fees,
uint256 _difficulty,
bytes memory signature
) public override returns (bool) {
require(_hashrate <= type(uint128).max, "Hashrate cannot exceed max val");
require(_difficulty <= type(uint64).max, "Difficulty cannot exceed max val");
require(_referenceBlock <= type(uint32).max, "Reference block cannot exceed max val");
require(hasRole(PUBLISHER_ROLE, msg.sender), "Update not allowed to everyone");
bytes32 messageHash = keccak256(
abi.encodePacked(
"\x19Ethereum Signed Message:\n32",
keccak256(abi.encode(_referenceDay, _referenceBlock, _hashrate, _reward, _fees, _difficulty))
)
);
require(hasRole(CALCULATOR_ROLE, ECDSA.recover(messageHash, signature)), "Invalid signature");
require(index[_referenceDay].timestamp == 0, "Information cannot be updated.");
index[_referenceDay].timestamp = uint32(block.timestamp);
index[_referenceDay].difficulty = uint64(_difficulty);
index[_referenceDay].referenceBlock = uint32(_referenceBlock);
index[_referenceDay].hashrate = uint128(_hashrate);
index[_referenceDay].reward = _reward;
index[_referenceDay].fees = _fees;
if (_referenceDay > lastIndexedDay) {
lastIndexedDay = uint32(_referenceDay);
}
emit OracleUpdate(msg.sender, _referenceDay, _referenceBlock, _hashrate, _reward, _fees, _difficulty, block.timestamp);
return true;
}
/// @notice Function to return Oracle index on given day
function get(uint256 _referenceDay)
external
view
override
returns (
uint256 referenceDay,
uint256 referenceBlock,
uint256 hashrate,
uint256 reward,
uint256 fees,
uint256 difficulty,
uint256 timestamp
)
{
require(index[_referenceDay].timestamp != 0, "Date not yet indexed");
return (
_referenceDay,
index[_referenceDay].referenceBlock,
index[_referenceDay].hashrate,
index[_referenceDay].reward,
index[_referenceDay].fees,
index[_referenceDay].difficulty,
index[_referenceDay].timestamp
);
}
/// @notice Function to return array of oracle data between firstday and lastday (inclusive)
function getInRange(uint256 _firstDay, uint256 _lastDay)
external
view
override
returns (uint256[] memory hashrateArray, uint256[] memory rewardArray)
{
uint256 numElements = _lastDay + 1 - _firstDay;
rewardArray = new uint256[](numElements);
hashrateArray = new uint256[](numElements);
for (uint256 i = 0; i < numElements; i++) {
AlkimiyaIndex memory indexCopy = index[_firstDay + i];
rewardArray[i] = indexCopy.reward;
hashrateArray[i] = indexCopy.hashrate;
}
}
/// @notice Function to check if Oracle is updated on a given day
function isDayIndexed(uint256 _referenceDay) external view override returns (bool) {
return index[_referenceDay].timestamp != 0;
}
/// @notice Functino to return the latest day on which the Oracle is updated
function getLastIndexedDay() external view override returns (uint32) {
return lastIndexedDay;
}
}// SPDX-License-Identifier: MIT
pragma solidity 0.8.6;
/**
* @title Alkimiya Oracle
* @author Alkimiya Team
* @notice Main interface for Oracle contracts
*/
interface IOracle {
event OracleUpdate(
address indexed caller,
uint256 indexed referenceDay,
uint256 indexed referenceBlock,
uint256 hashrate,
uint256 reward,
uint256 fees,
uint256 difficulty,
uint256 timestamp
);
/**
* @notice Return the Network data on a given day
*/
function get(uint256 _day)
external
view
returns (
uint256 date,
uint256 referenceBlock,
uint256 hashrate,
uint256 reward,
uint256 fees,
uint256 difficulty,
uint256 timestamp
);
function getInRange(uint256 _firstDay, uint256 _lastDay)
external
view
returns (uint256[] memory hashrateArray, uint256[] memory rewardArray);
/**
* @notice Return the Network data on a given day is updated to Oracle
*/
function isDayIndexed(uint256 _referenceDay) external view returns (bool);
/**
* @notice Return the last day on which the Oracle is updated
*/
function getLastIndexedDay() external view returns (uint32);
/**
* @notice Update the Alkimiya Index on Oracle for a given day
*/
function updateIndex(
uint256 _referenceDay,
uint256 _referenceBlock,
uint256 _hashrate,
uint256 _reward,
uint256 _fees,
uint256 _difficulty,
bytes memory signature
) external returns (bool success);
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.8.0) (access/AccessControl.sol)
pragma solidity ^0.8.0;
import "./IAccessControl.sol";
import "../utils/Context.sol";
import "../utils/Strings.sol";
import "../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:
*
* ```
* 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);
_;
}
/**
* @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 `_msgSender()` is missing `role`.
* Overriding this function changes the behavior of the {onlyRole} modifier.
*
* Format of the revert message is described in {_checkRole}.
*
* _Available since v4.6._
*/
function _checkRole(bytes32 role) internal view virtual {
_checkRole(role, _msgSender());
}
/**
* @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(account),
" 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.
*
* May emit a {RoleGranted} event.
*/
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.
*
* May emit a {RoleRevoked} event.
*/
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`.
*
* May emit a {RoleRevoked} event.
*/
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.
*
* May emit a {RoleGranted} event.
*
* [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.
*
* May emit a {RoleGranted} event.
*/
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.
*
* May emit a {RoleRevoked} event.
*/
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 (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 (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 (last updated v4.8.0) (utils/Strings.sol)
pragma solidity ^0.8.0;
import "./math/Math.sol";
/**
* @dev String operations.
*/
library Strings {
bytes16 private constant _SYMBOLS = "0123456789abcdef";
uint8 private constant _ADDRESS_LENGTH = 20;
/**
* @dev Converts a `uint256` to its ASCII `string` decimal representation.
*/
function toString(uint256 value) internal pure returns (string memory) {
unchecked {
uint256 length = Math.log10(value) + 1;
string memory buffer = new string(length);
uint256 ptr;
/// @solidity memory-safe-assembly
assembly {
ptr := add(buffer, add(32, length))
}
while (true) {
ptr--;
/// @solidity memory-safe-assembly
assembly {
mstore8(ptr, byte(mod(value, 10), _SYMBOLS))
}
value /= 10;
if (value == 0) break;
}
return buffer;
}
}
/**
* @dev Converts a `uint256` to its ASCII `string` hexadecimal representation.
*/
function toHexString(uint256 value) internal pure returns (string memory) {
unchecked {
return toHexString(value, Math.log256(value) + 1);
}
}
/**
* @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] = _SYMBOLS[value & 0xf];
value >>= 4;
}
require(value == 0, "Strings: hex length insufficient");
return string(buffer);
}
/**
* @dev Converts an `address` with fixed length of 20 bytes to its not checksummed ASCII `string` hexadecimal representation.
*/
function toHexString(address addr) internal pure returns (string memory) {
return toHexString(uint256(uint160(addr)), _ADDRESS_LENGTH);
}
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.8.0) (utils/cryptography/ECDSA.sol)
pragma solidity ^0.8.0;
import "../Strings.sol";
/**
* @dev Elliptic Curve Digital Signature Algorithm (ECDSA) operations.
*
* These functions can be used to verify that a message was signed by the holder
* of the private keys of a given address.
*/
library ECDSA {
enum RecoverError {
NoError,
InvalidSignature,
InvalidSignatureLength,
InvalidSignatureS,
InvalidSignatureV // Deprecated in v4.8
}
function _throwError(RecoverError error) private pure {
if (error == RecoverError.NoError) {
return; // no error: do nothing
} else if (error == RecoverError.InvalidSignature) {
revert("ECDSA: invalid signature");
} else if (error == RecoverError.InvalidSignatureLength) {
revert("ECDSA: invalid signature length");
} else if (error == RecoverError.InvalidSignatureS) {
revert("ECDSA: invalid signature 's' value");
}
}
/**
* @dev Returns the address that signed a hashed message (`hash`) with
* `signature` or error string. This address can then be used for verification purposes.
*
* The `ecrecover` EVM opcode allows for malleable (non-unique) signatures:
* this function rejects them by requiring the `s` value to be in the lower
* half order, and the `v` value to be either 27 or 28.
*
* IMPORTANT: `hash` _must_ be the result of a hash operation for the
* verification to be secure: it is possible to craft signatures that
* recover to arbitrary addresses for non-hashed data. A safe way to ensure
* this is by receiving a hash of the original message (which may otherwise
* be too long), and then calling {toEthSignedMessageHash} on it.
*
* Documentation for signature generation:
* - with https://web3js.readthedocs.io/en/v1.3.4/web3-eth-accounts.html#sign[Web3.js]
* - with https://docs.ethers.io/v5/api/signer/#Signer-signMessage[ethers]
*
* _Available since v4.3._
*/
function tryRecover(bytes32 hash, bytes memory signature) internal pure returns (address, RecoverError) {
if (signature.length == 65) {
bytes32 r;
bytes32 s;
uint8 v;
// ecrecover takes the signature parameters, and the only way to get them
// currently is to use assembly.
/// @solidity memory-safe-assembly
assembly {
r := mload(add(signature, 0x20))
s := mload(add(signature, 0x40))
v := byte(0, mload(add(signature, 0x60)))
}
return tryRecover(hash, v, r, s);
} else {
return (address(0), RecoverError.InvalidSignatureLength);
}
}
/**
* @dev Returns the address that signed a hashed message (`hash`) with
* `signature`. This address can then be used for verification purposes.
*
* The `ecrecover` EVM opcode allows for malleable (non-unique) signatures:
* this function rejects them by requiring the `s` value to be in the lower
* half order, and the `v` value to be either 27 or 28.
*
* IMPORTANT: `hash` _must_ be the result of a hash operation for the
* verification to be secure: it is possible to craft signatures that
* recover to arbitrary addresses for non-hashed data. A safe way to ensure
* this is by receiving a hash of the original message (which may otherwise
* be too long), and then calling {toEthSignedMessageHash} on it.
*/
function recover(bytes32 hash, bytes memory signature) internal pure returns (address) {
(address recovered, RecoverError error) = tryRecover(hash, signature);
_throwError(error);
return recovered;
}
/**
* @dev Overload of {ECDSA-tryRecover} that receives the `r` and `vs` short-signature fields separately.
*
* See https://eips.ethereum.org/EIPS/eip-2098[EIP-2098 short signatures]
*
* _Available since v4.3._
*/
function tryRecover(
bytes32 hash,
bytes32 r,
bytes32 vs
) internal pure returns (address, RecoverError) {
bytes32 s = vs & bytes32(0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff);
uint8 v = uint8((uint256(vs) >> 255) + 27);
return tryRecover(hash, v, r, s);
}
/**
* @dev Overload of {ECDSA-recover} that receives the `r and `vs` short-signature fields separately.
*
* _Available since v4.2._
*/
function recover(
bytes32 hash,
bytes32 r,
bytes32 vs
) internal pure returns (address) {
(address recovered, RecoverError error) = tryRecover(hash, r, vs);
_throwError(error);
return recovered;
}
/**
* @dev Overload of {ECDSA-tryRecover} that receives the `v`,
* `r` and `s` signature fields separately.
*
* _Available since v4.3._
*/
function tryRecover(
bytes32 hash,
uint8 v,
bytes32 r,
bytes32 s
) internal pure returns (address, RecoverError) {
// EIP-2 still allows signature malleability for ecrecover(). Remove this possibility and make the signature
// unique. Appendix F in the Ethereum Yellow paper (https://ethereum.github.io/yellowpaper/paper.pdf), defines
// the valid range for s in (301): 0 < s < secp256k1n ÷ 2 + 1, and for v in (302): v ∈ {27, 28}. Most
// signatures from current libraries generate a unique signature with an s-value in the lower half order.
//
// If your library generates malleable signatures, such as s-values in the upper range, calculate a new s-value
// with 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEBAAEDCE6AF48A03BBFD25E8CD0364141 - s1 and flip v from 27 to 28 or
// vice versa. If your library also generates signatures with 0/1 for v instead 27/28, add 27 to v to accept
// these malleable signatures as well.
if (uint256(s) > 0x7FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF5D576E7357A4501DDFE92F46681B20A0) {
return (address(0), RecoverError.InvalidSignatureS);
}
// If the signature is valid (and not malleable), return the signer address
address signer = ecrecover(hash, v, r, s);
if (signer == address(0)) {
return (address(0), RecoverError.InvalidSignature);
}
return (signer, RecoverError.NoError);
}
/**
* @dev Overload of {ECDSA-recover} that receives the `v`,
* `r` and `s` signature fields separately.
*/
function recover(
bytes32 hash,
uint8 v,
bytes32 r,
bytes32 s
) internal pure returns (address) {
(address recovered, RecoverError error) = tryRecover(hash, v, r, s);
_throwError(error);
return recovered;
}
/**
* @dev Returns an Ethereum Signed Message, created from a `hash`. This
* produces hash corresponding to the one signed with the
* https://eth.wiki/json-rpc/API#eth_sign[`eth_sign`]
* JSON-RPC method as part of EIP-191.
*
* See {recover}.
*/
function toEthSignedMessageHash(bytes32 hash) internal pure returns (bytes32) {
// 32 is the length in bytes of hash,
// enforced by the type signature above
return keccak256(abi.encodePacked("\x19Ethereum Signed Message:\n32", hash));
}
/**
* @dev Returns an Ethereum Signed Message, created from `s`. This
* produces hash corresponding to the one signed with the
* https://eth.wiki/json-rpc/API#eth_sign[`eth_sign`]
* JSON-RPC method as part of EIP-191.
*
* See {recover}.
*/
function toEthSignedMessageHash(bytes memory s) internal pure returns (bytes32) {
return keccak256(abi.encodePacked("\x19Ethereum Signed Message:\n", Strings.toString(s.length), s));
}
/**
* @dev Returns an Ethereum Signed Typed Data, created from a
* `domainSeparator` and a `structHash`. This produces hash corresponding
* to the one signed with the
* https://eips.ethereum.org/EIPS/eip-712[`eth_signTypedData`]
* JSON-RPC method as part of EIP-712.
*
* See {recover}.
*/
function toTypedDataHash(bytes32 domainSeparator, bytes32 structHash) internal pure returns (bytes32) {
return keccak256(abi.encodePacked("\x19\x01", domainSeparator, structHash));
}
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (utils/introspection/ERC165.sol)
pragma solidity ^0.8.0;
import "./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/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.8.0) (utils/math/Math.sol)
pragma solidity ^0.8.0;
/**
* @dev Standard math utilities missing in the Solidity language.
*/
library Math {
enum Rounding {
Down, // Toward negative infinity
Up, // Toward infinity
Zero // Toward zero
}
/**
* @dev Returns the largest of two numbers.
*/
function max(uint256 a, uint256 b) internal pure returns (uint256) {
return a > b ? a : b;
}
/**
* @dev Returns the smallest of two numbers.
*/
function min(uint256 a, uint256 b) internal pure returns (uint256) {
return a < b ? a : b;
}
/**
* @dev Returns the average of two numbers. The result is rounded towards
* zero.
*/
function average(uint256 a, uint256 b) internal pure returns (uint256) {
// (a + b) / 2 can overflow.
return (a & b) + (a ^ b) / 2;
}
/**
* @dev Returns the ceiling of the division of two numbers.
*
* This differs from standard division with `/` in that it rounds up instead
* of rounding down.
*/
function ceilDiv(uint256 a, uint256 b) internal pure returns (uint256) {
// (a + b - 1) / b can overflow on addition, so we distribute.
return a == 0 ? 0 : (a - 1) / b + 1;
}
/**
* @notice Calculates floor(x * y / denominator) with full precision. Throws if result overflows a uint256 or denominator == 0
* @dev Original credit to Remco Bloemen under MIT license (https://xn--2-umb.com/21/muldiv)
* with further edits by Uniswap Labs also under MIT license.
*/
function mulDiv(
uint256 x,
uint256 y,
uint256 denominator
) internal pure returns (uint256 result) {
unchecked {
// 512-bit multiply [prod1 prod0] = x * y. Compute the product mod 2^256 and mod 2^256 - 1, then use
// use the Chinese Remainder Theorem to reconstruct the 512 bit result. The result is stored in two 256
// variables such that product = prod1 * 2^256 + prod0.
uint256 prod0; // Least significant 256 bits of the product
uint256 prod1; // Most significant 256 bits of the product
assembly {
let mm := mulmod(x, y, not(0))
prod0 := mul(x, y)
prod1 := sub(sub(mm, prod0), lt(mm, prod0))
}
// Handle non-overflow cases, 256 by 256 division.
if (prod1 == 0) {
return prod0 / denominator;
}
// Make sure the result is less than 2^256. Also prevents denominator == 0.
require(denominator > prod1);
///////////////////////////////////////////////
// 512 by 256 division.
///////////////////////////////////////////////
// Make division exact by subtracting the remainder from [prod1 prod0].
uint256 remainder;
assembly {
// Compute remainder using mulmod.
remainder := mulmod(x, y, denominator)
// Subtract 256 bit number from 512 bit number.
prod1 := sub(prod1, gt(remainder, prod0))
prod0 := sub(prod0, remainder)
}
// Factor powers of two out of denominator and compute largest power of two divisor of denominator. Always >= 1.
// See https://cs.stackexchange.com/q/138556/92363.
// Does not overflow because the denominator cannot be zero at this stage in the function.
uint256 twos = denominator & (~denominator + 1);
assembly {
// Divide denominator by twos.
denominator := div(denominator, twos)
// Divide [prod1 prod0] by twos.
prod0 := div(prod0, twos)
// Flip twos such that it is 2^256 / twos. If twos is zero, then it becomes one.
twos := add(div(sub(0, twos), twos), 1)
}
// Shift in bits from prod1 into prod0.
prod0 |= prod1 * twos;
// Invert denominator mod 2^256. Now that denominator is an odd number, it has an inverse modulo 2^256 such
// that denominator * inv = 1 mod 2^256. Compute the inverse by starting with a seed that is correct for
// four bits. That is, denominator * inv = 1 mod 2^4.
uint256 inverse = (3 * denominator) ^ 2;
// Use the Newton-Raphson iteration to improve the precision. Thanks to Hensel's lifting lemma, this also works
// in modular arithmetic, doubling the correct bits in each step.
inverse *= 2 - denominator * inverse; // inverse mod 2^8
inverse *= 2 - denominator * inverse; // inverse mod 2^16
inverse *= 2 - denominator * inverse; // inverse mod 2^32
inverse *= 2 - denominator * inverse; // inverse mod 2^64
inverse *= 2 - denominator * inverse; // inverse mod 2^128
inverse *= 2 - denominator * inverse; // inverse mod 2^256
// Because the division is now exact we can divide by multiplying with the modular inverse of denominator.
// This will give us the correct result modulo 2^256. Since the preconditions guarantee that the outcome is
// less than 2^256, this is the final result. We don't need to compute the high bits of the result and prod1
// is no longer required.
result = prod0 * inverse;
return result;
}
}
/**
* @notice Calculates x * y / denominator with full precision, following the selected rounding direction.
*/
function mulDiv(
uint256 x,
uint256 y,
uint256 denominator,
Rounding rounding
) internal pure returns (uint256) {
uint256 result = mulDiv(x, y, denominator);
if (rounding == Rounding.Up && mulmod(x, y, denominator) > 0) {
result += 1;
}
return result;
}
/**
* @dev Returns the square root of a number. If the number is not a perfect square, the value is rounded down.
*
* Inspired by Henry S. Warren, Jr.'s "Hacker's Delight" (Chapter 11).
*/
function sqrt(uint256 a) internal pure returns (uint256) {
if (a == 0) {
return 0;
}
// For our first guess, we get the biggest power of 2 which is smaller than the square root of the target.
//
// We know that the "msb" (most significant bit) of our target number `a` is a power of 2 such that we have
// `msb(a) <= a < 2*msb(a)`. This value can be written `msb(a)=2**k` with `k=log2(a)`.
//
// This can be rewritten `2**log2(a) <= a < 2**(log2(a) + 1)`
// → `sqrt(2**k) <= sqrt(a) < sqrt(2**(k+1))`
// → `2**(k/2) <= sqrt(a) < 2**((k+1)/2) <= 2**(k/2 + 1)`
//
// Consequently, `2**(log2(a) / 2)` is a good first approximation of `sqrt(a)` with at least 1 correct bit.
uint256 result = 1 << (log2(a) >> 1);
// At this point `result` is an estimation with one bit of precision. We know the true value is a uint128,
// since it is the square root of a uint256. Newton's method converges quadratically (precision doubles at
// every iteration). We thus need at most 7 iteration to turn our partial result with one bit of precision
// into the expected uint128 result.
unchecked {
result = (result + a / result) >> 1;
result = (result + a / result) >> 1;
result = (result + a / result) >> 1;
result = (result + a / result) >> 1;
result = (result + a / result) >> 1;
result = (result + a / result) >> 1;
result = (result + a / result) >> 1;
return min(result, a / result);
}
}
/**
* @notice Calculates sqrt(a), following the selected rounding direction.
*/
function sqrt(uint256 a, Rounding rounding) internal pure returns (uint256) {
unchecked {
uint256 result = sqrt(a);
return result + (rounding == Rounding.Up && result * result < a ? 1 : 0);
}
}
/**
* @dev Return the log in base 2, rounded down, of a positive value.
* Returns 0 if given 0.
*/
function log2(uint256 value) internal pure returns (uint256) {
uint256 result = 0;
unchecked {
if (value >> 128 > 0) {
value >>= 128;
result += 128;
}
if (value >> 64 > 0) {
value >>= 64;
result += 64;
}
if (value >> 32 > 0) {
value >>= 32;
result += 32;
}
if (value >> 16 > 0) {
value >>= 16;
result += 16;
}
if (value >> 8 > 0) {
value >>= 8;
result += 8;
}
if (value >> 4 > 0) {
value >>= 4;
result += 4;
}
if (value >> 2 > 0) {
value >>= 2;
result += 2;
}
if (value >> 1 > 0) {
result += 1;
}
}
return result;
}
/**
* @dev Return the log in base 2, following the selected rounding direction, of a positive value.
* Returns 0 if given 0.
*/
function log2(uint256 value, Rounding rounding) internal pure returns (uint256) {
unchecked {
uint256 result = log2(value);
return result + (rounding == Rounding.Up && 1 << result < value ? 1 : 0);
}
}
/**
* @dev Return the log in base 10, rounded down, of a positive value.
* Returns 0 if given 0.
*/
function log10(uint256 value) internal pure returns (uint256) {
uint256 result = 0;
unchecked {
if (value >= 10**64) {
value /= 10**64;
result += 64;
}
if (value >= 10**32) {
value /= 10**32;
result += 32;
}
if (value >= 10**16) {
value /= 10**16;
result += 16;
}
if (value >= 10**8) {
value /= 10**8;
result += 8;
}
if (value >= 10**4) {
value /= 10**4;
result += 4;
}
if (value >= 10**2) {
value /= 10**2;
result += 2;
}
if (value >= 10**1) {
result += 1;
}
}
return result;
}
/**
* @dev Return the log in base 10, following the selected rounding direction, of a positive value.
* Returns 0 if given 0.
*/
function log10(uint256 value, Rounding rounding) internal pure returns (uint256) {
unchecked {
uint256 result = log10(value);
return result + (rounding == Rounding.Up && 10**result < value ? 1 : 0);
}
}
/**
* @dev Return the log in base 256, rounded down, of a positive value.
* Returns 0 if given 0.
*
* Adding one to the result gives the number of pairs of hex symbols needed to represent `value` as a hex string.
*/
function log256(uint256 value) internal pure returns (uint256) {
uint256 result = 0;
unchecked {
if (value >> 128 > 0) {
value >>= 128;
result += 16;
}
if (value >> 64 > 0) {
value >>= 64;
result += 8;
}
if (value >> 32 > 0) {
value >>= 32;
result += 4;
}
if (value >> 16 > 0) {
value >>= 16;
result += 2;
}
if (value >> 8 > 0) {
result += 1;
}
}
return result;
}
/**
* @dev Return the log in base 10, following the selected rounding direction, of a positive value.
* Returns 0 if given 0.
*/
function log256(uint256 value, Rounding rounding) internal pure returns (uint256) {
unchecked {
uint256 result = log256(value);
return result + (rounding == Rounding.Up && 1 << (result * 8) < value ? 1 : 0);
}
}
}{
"remappings": [
"@alkimiya/=node_modules/@alkimiya/",
"@ds/=lib/ds-test/src/",
"@openzeppelin/=node_modules/@openzeppelin/",
"@solmate/=lib/solmate/src/",
"@std/=lib/forge-std/src/",
"@uniswap/=node_modules/@uniswap/",
"ds-test/=lib/forge-std/lib/ds-test/src/",
"forge-std/=lib/forge-std/src/",
"solmate/=lib/solmate/src/"
],
"optimizer": {
"enabled": true,
"runs": 200
},
"metadata": {
"bytecodeHash": "ipfs"
},
"outputSelection": {
"*": {
"*": [
"evm.bytecode",
"evm.deployedBytecode",
"devdoc",
"userdoc",
"metadata",
"abi"
]
}
},
"evmVersion": "berlin",
"libraries": {}
}Contract Security Audit
- No Contract Security Audit Submitted- Submit Audit Here
Contract ABI
API[{"inputs":[{"internalType":"string","name":"_name","type":"string"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"caller","type":"address"},{"indexed":true,"internalType":"uint256","name":"referenceDay","type":"uint256"},{"indexed":true,"internalType":"uint256","name":"referenceBlock","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"hashrate","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"reward","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"fees","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"difficulty","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"timestamp","type":"uint256"}],"name":"OracleUpdate","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":"CALCULATOR_ROLE","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"DEFAULT_ADMIN_ROLE","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"PUBLISHER_ROLE","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"VERSION","outputs":[{"internalType":"int8","name":"","type":"int8"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_referenceDay","type":"uint256"}],"name":"get","outputs":[{"internalType":"uint256","name":"referenceDay","type":"uint256"},{"internalType":"uint256","name":"referenceBlock","type":"uint256"},{"internalType":"uint256","name":"hashrate","type":"uint256"},{"internalType":"uint256","name":"reward","type":"uint256"},{"internalType":"uint256","name":"fees","type":"uint256"},{"internalType":"uint256","name":"difficulty","type":"uint256"},{"internalType":"uint256","name":"timestamp","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_firstDay","type":"uint256"},{"internalType":"uint256","name":"_lastDay","type":"uint256"}],"name":"getInRange","outputs":[{"internalType":"uint256[]","name":"hashrateArray","type":"uint256[]"},{"internalType":"uint256[]","name":"rewardArray","type":"uint256[]"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getLastIndexedDay","outputs":[{"internalType":"uint32","name":"","type":"uint32"}],"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":"uint256","name":"_referenceDay","type":"uint256"}],"name":"isDayIndexed","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"lastIndexedDay","outputs":[{"internalType":"uint32","name":"","type":"uint32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"name","outputs":[{"internalType":"string","name":"","type":"string"}],"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":"bytes4","name":"interfaceId","type":"bytes4"}],"name":"supportsInterface","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_referenceDay","type":"uint256"},{"internalType":"uint256","name":"_referenceBlock","type":"uint256"},{"internalType":"uint256","name":"_hashrate","type":"uint256"},{"internalType":"uint256","name":"_reward","type":"uint256"},{"internalType":"uint256","name":"_fees","type":"uint256"},{"internalType":"uint256","name":"_difficulty","type":"uint256"},{"internalType":"bytes","name":"signature","type":"bytes"}],"name":"updateIndex","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"}]Contract Creation Code
60806040523480156200001157600080fd5b5060405162001812380380620018128339810160408190526200003491620001e0565b620000607f0ac90c257048ef1c3e387c26d4a99bde06894efbcbff862dc1885c3a9319308a336200008a565b6200006d6000336200008a565b8051620000829060039060208401906200013a565b50506200030f565b6200009682826200009a565b5050565b6000828152602081815260408083206001600160a01b038516845290915290205460ff1662000096576000828152602081815260408083206001600160a01b03851684529091529020805460ff19166001179055620000f63390565b6001600160a01b0316816001600160a01b0316837f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a45050565b8280546200014890620002bc565b90600052602060002090601f0160209004810192826200016c5760008555620001b7565b82601f106200018757805160ff1916838001178555620001b7565b82800160010185558215620001b7579182015b82811115620001b75782518255916020019190600101906200019a565b50620001c5929150620001c9565b5090565b5b80821115620001c55760008155600101620001ca565b60006020808385031215620001f457600080fd5b82516001600160401b03808211156200020c57600080fd5b818501915085601f8301126200022157600080fd5b815181811115620002365762000236620002f9565b604051601f8201601f19908116603f01168101908382118183101715620002615762000261620002f9565b8160405282815288868487010111156200027a57600080fd5b600093505b828410156200029e57848401860151818501870152928501926200027f565b82841115620002b05760008684830101525b98975050505050505050565b600181811c90821680620002d157607f821691505b60208210811415620002f357634e487b7160e01b600052602260045260246000fd5b50919050565b634e487b7160e01b600052604160045260246000fd5b6114f3806200031f6000396000f3fe608060405234801561001057600080fd5b506004361061010b5760003560e01c8063832fdca7116100a2578063a217fddf11610071578063a217fddf1461028b578063d547741f14610293578063d8f4b6fd146102a6578063ea7b7b0c146102cd578063ffa1ad74146102fd57600080fd5b8063832fdca7146101f9578063856f939f1461022057806391d14854146102305780639507d39a1461024357600080fd5b80632f2ff15d116100de5780632f2ff15d1461019d57806336568abe146101b2578063466a2631146101c5578063723dc4ea146101d857600080fd5b806301ffc9a71461011057806306fdde03146101385780631eccf3db1461014d578063248a9ca31461016c575b600080fd5b61012361011e366004611132565b610318565b60405190151581526020015b60405180910390f35b61014061034f565b60405161012f9190611347565b60015463ffffffff165b60405163ffffffff909116815260200161012f565b61018f61017a3660046110dd565b60009081526020819052604090206001015490565b60405190815260200161012f565b6101b06101ab3660046110f6565b6103dd565b005b6101b06101c03660046110f6565b610407565b6101236101d336600461117e565b61048a565b6101eb6101e636600461115c565b610899565b60405161012f929190611319565b61018f7f49e5b8548b5bb0055e7e9cb1e982f642296e438bfc6aebfb9f4e4d3dd6bb5d6d81565b6001546101579063ffffffff1681565b61012361023e3660046110f6565b610a40565b6102566102513660046110dd565b610a69565b604080519788526020880196909652948601939093526060850191909152608084015260a083015260c082015260e00161012f565b61018f600081565b6101b06102a13660046110f6565b610b38565b61018f7f0ac90c257048ef1c3e387c26d4a99bde06894efbcbff862dc1885c3a9319308a81565b6101236102db3660046110dd565b600090815260026020526040902054640100000000900463ffffffff16151590565b610305600181565b60405160009190910b815260200161012f565b60006001600160e01b03198216637965db0b60e01b148061034957506301ffc9a760e01b6001600160e01b03198316145b92915050565b6003805461035c9061140f565b80601f01602080910402602001604051908101604052809291908181526020018280546103889061140f565b80156103d55780601f106103aa576101008083540402835291602001916103d5565b820191906000526020600020905b8154815290600101906020018083116103b857829003601f168201915b505050505081565b6000828152602081905260409020600101546103f881610b5d565b6104028383610b6a565b505050565b6001600160a01b038116331461047c5760405162461bcd60e51b815260206004820152602f60248201527f416363657373436f6e74726f6c3a2063616e206f6e6c792072656e6f756e636560448201526e103937b632b9903337b91039b2b63360891b60648201526084015b60405180910390fd5b6104868282610bee565b5050565b60006001600160801b038611156104e35760405162461bcd60e51b815260206004820152601e60248201527f48617368726174652063616e6e6f7420657863656564206d61782076616c00006044820152606401610473565b67ffffffffffffffff83111561053b5760405162461bcd60e51b815260206004820181905260248201527f446966666963756c74792063616e6e6f7420657863656564206d61782076616c6044820152606401610473565b63ffffffff87111561059d5760405162461bcd60e51b815260206004820152602560248201527f5265666572656e636520626c6f636b2063616e6e6f7420657863656564206d616044820152641e081d985b60da1b6064820152608401610473565b6105c77f0ac90c257048ef1c3e387c26d4a99bde06894efbcbff862dc1885c3a9319308a33610a40565b6106135760405162461bcd60e51b815260206004820152601e60248201527f557064617465206e6f7420616c6c6f77656420746f2065766572796f6e6500006044820152606401610473565b6040805160208082018b90528183018a9052606082018990526080820188905260a0820187905260c08083018790528351808403909101815260e0830184528051908201207f19457468657265756d205369676e6564204d6573736167653a0a33320000000061010084015261011c808401919091528351808403909101815261013c90920190925280519101206106cf7f49e5b8548b5bb0055e7e9cb1e982f642296e438bfc6aebfb9f4e4d3dd6bb5d6d61023e8386610c53565b61070f5760405162461bcd60e51b8152602060048201526011602482015270496e76616c6964207369676e617475726560781b6044820152606401610473565b600089815260026020526040902054640100000000900463ffffffff16156107795760405162461bcd60e51b815260206004820152601e60248201527f496e666f726d6174696f6e2063616e6e6f7420626520757064617465642e00006044820152606401610473565b6000898152600260208190526040909120805463ffffffff8b811677ffffffffffffffffffffffffffffffff00000000ffffffff909216640100000000428316026001600160c01b031617600160c01b67ffffffffffffffff8a16021777ffffffffffffffffffffffffffffffff00000000ffffffff191691909117600160401b6001600160801b038c160217825560018083018a9055919092018790555416891115610836576001805463ffffffff191663ffffffff8b161790555b60408051888152602081018890529081018690526060810185905242608082015288908a9033907fa4f339c6fee573da0cfc2b6116a1f4b546d31bab7ebc051c25de7368e0c42d269060a00160405180910390a450600198975050505050505050565b6060806000846108aa85600161137a565b6108b491906113b1565b90508067ffffffffffffffff8111156108cf576108cf6114a7565b6040519080825280602002602001820160405280156108f8578160200160208202803683370190505b5091508067ffffffffffffffff811115610914576109146114a7565b60405190808252806020026020018201604052801561093d578160200160208202803683370190505b50925060005b81811015610a3757600060028161095a848a61137a565b81526020808201929092526040908101600020815160c081018352815463ffffffff808216835264010000000082041694820194909452600160401b84046001600160801b031692810192909252600160c01b90920467ffffffffffffffff16606082015260018201546080820181905260029092015460a082015285519092508590849081106109ed576109ed611491565b60200260200101818152505080604001516001600160801b0316858381518110610a1957610a19611491565b60209081029190910101525080610a2f8161144a565b915050610943565b50509250929050565b6000918252602082815260408084206001600160a01b0393909316845291905290205460ff1690565b600081815260026020526040812054819081908190819081908190640100000000900463ffffffff16610ad55760405162461bcd60e51b815260206004820152601460248201527311185d19481b9bdd081e595d081a5b99195e195960621b6044820152606401610473565b5050506000858152600260208190526040909120805460018201549190920154969763ffffffff80841698600160401b85046001600160801b03169850929650919450600160c01b830467ffffffffffffffff1693506401000000009092041690565b600082815260208190526040902060010154610b5381610b5d565b6104028383610bee565b610b678133610c77565b50565b610b748282610a40565b610486576000828152602081815260408083206001600160a01b03851684529091529020805460ff19166001179055610baa3390565b6001600160a01b0316816001600160a01b0316837f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a45050565b610bf88282610a40565b15610486576000828152602081815260408083206001600160a01b0385168085529252808320805460ff1916905551339285917ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b9190a45050565b6000806000610c628585610cd0565b91509150610c6f81610d16565b509392505050565b610c818282610a40565b61048657610c8e81610e64565b610c99836020610e76565b604051602001610caa9291906112a4565b60408051601f198184030181529082905262461bcd60e51b825261047391600401611347565b600080825160411415610d075760208301516040840151606085015160001a610cfb87828585611019565b94509450505050610d0f565b506000905060025b9250929050565b6000816004811115610d2a57610d2a61147b565b1415610d335750565b6001816004811115610d4757610d4761147b565b1415610d955760405162461bcd60e51b815260206004820152601860248201527f45434453413a20696e76616c6964207369676e617475726500000000000000006044820152606401610473565b6002816004811115610da957610da961147b565b1415610df75760405162461bcd60e51b815260206004820152601f60248201527f45434453413a20696e76616c6964207369676e6174757265206c656e677468006044820152606401610473565b6003816004811115610e0b57610e0b61147b565b1415610b675760405162461bcd60e51b815260206004820152602260248201527f45434453413a20696e76616c6964207369676e6174757265202773272076616c604482015261756560f01b6064820152608401610473565b60606103496001600160a01b03831660145b60606000610e85836002611392565b610e9090600261137a565b67ffffffffffffffff811115610ea857610ea86114a7565b6040519080825280601f01601f191660200182016040528015610ed2576020820181803683370190505b509050600360fc1b81600081518110610eed57610eed611491565b60200101906001600160f81b031916908160001a905350600f60fb1b81600181518110610f1c57610f1c611491565b60200101906001600160f81b031916908160001a9053506000610f40846002611392565b610f4b90600161137a565b90505b6001811115610fc3576f181899199a1a9b1b9c1cb0b131b232b360811b85600f1660108110610f7f57610f7f611491565b1a60f81b828281518110610f9557610f95611491565b60200101906001600160f81b031916908160001a90535060049490941c93610fbc816113f8565b9050610f4e565b5083156110125760405162461bcd60e51b815260206004820181905260248201527f537472696e67733a20686578206c656e67746820696e73756666696369656e746044820152606401610473565b9392505050565b6000807f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a083111561105057506000905060036110d4565b6040805160008082526020820180845289905260ff881692820192909252606081018690526080810185905260019060a0016020604051602081039080840390855afa1580156110a4573d6000803e3d6000fd5b5050604051601f1901519150506001600160a01b0381166110cd576000600192509250506110d4565b9150600090505b94509492505050565b6000602082840312156110ef57600080fd5b5035919050565b6000806040838503121561110957600080fd5b8235915060208301356001600160a01b038116811461112757600080fd5b809150509250929050565b60006020828403121561114457600080fd5b81356001600160e01b03198116811461101257600080fd5b6000806040838503121561116f57600080fd5b50508035926020909101359150565b600080600080600080600060e0888a03121561119957600080fd5b873596506020880135955060408801359450606088013593506080880135925060a0880135915060c088013567ffffffffffffffff808211156111db57600080fd5b818a0191508a601f8301126111ef57600080fd5b813581811115611201576112016114a7565b604051601f8201601f19908116603f01168101908382118183101715611229576112296114a7565b816040528281528d602084870101111561124257600080fd5b82602086016020830137600060208483010152809550505050505092959891949750929550565b600081518084526020808501945080840160005b838110156112995781518752958201959082019060010161127d565b509495945050505050565b7f416363657373436f6e74726f6c3a206163636f756e74200000000000000000008152600083516112dc8160178501602088016113c8565b7001034b99036b4b9b9b4b733903937b6329607d1b601791840191820152835161130d8160288401602088016113c8565b01602801949350505050565b60408152600061132c6040830185611269565b828103602084015261133e8185611269565b95945050505050565b60208152600082518060208401526113668160408501602087016113c8565b601f01601f19169190910160400192915050565b6000821982111561138d5761138d611465565b500190565b60008160001904831182151516156113ac576113ac611465565b500290565b6000828210156113c3576113c3611465565b500390565b60005b838110156113e35781810151838201526020016113cb565b838111156113f2576000848401525b50505050565b60008161140757611407611465565b506000190190565b600181811c9082168061142357607f821691505b6020821081141561144457634e487b7160e01b600052602260045260246000fd5b50919050565b600060001982141561145e5761145e611465565b5060010190565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052602160045260246000fd5b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052604160045260246000fdfea26469706673582212201ee5cdef4bbec4307924965edd9f5ebf6aabb5a14f69cc6ada8d1ed7823c009864736f6c63430008060033000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000000164f5241434c455f4254435f4d494e494e475f5357415000000000000000000000
Deployed Bytecode
0x608060405234801561001057600080fd5b506004361061010b5760003560e01c8063832fdca7116100a2578063a217fddf11610071578063a217fddf1461028b578063d547741f14610293578063d8f4b6fd146102a6578063ea7b7b0c146102cd578063ffa1ad74146102fd57600080fd5b8063832fdca7146101f9578063856f939f1461022057806391d14854146102305780639507d39a1461024357600080fd5b80632f2ff15d116100de5780632f2ff15d1461019d57806336568abe146101b2578063466a2631146101c5578063723dc4ea146101d857600080fd5b806301ffc9a71461011057806306fdde03146101385780631eccf3db1461014d578063248a9ca31461016c575b600080fd5b61012361011e366004611132565b610318565b60405190151581526020015b60405180910390f35b61014061034f565b60405161012f9190611347565b60015463ffffffff165b60405163ffffffff909116815260200161012f565b61018f61017a3660046110dd565b60009081526020819052604090206001015490565b60405190815260200161012f565b6101b06101ab3660046110f6565b6103dd565b005b6101b06101c03660046110f6565b610407565b6101236101d336600461117e565b61048a565b6101eb6101e636600461115c565b610899565b60405161012f929190611319565b61018f7f49e5b8548b5bb0055e7e9cb1e982f642296e438bfc6aebfb9f4e4d3dd6bb5d6d81565b6001546101579063ffffffff1681565b61012361023e3660046110f6565b610a40565b6102566102513660046110dd565b610a69565b604080519788526020880196909652948601939093526060850191909152608084015260a083015260c082015260e00161012f565b61018f600081565b6101b06102a13660046110f6565b610b38565b61018f7f0ac90c257048ef1c3e387c26d4a99bde06894efbcbff862dc1885c3a9319308a81565b6101236102db3660046110dd565b600090815260026020526040902054640100000000900463ffffffff16151590565b610305600181565b60405160009190910b815260200161012f565b60006001600160e01b03198216637965db0b60e01b148061034957506301ffc9a760e01b6001600160e01b03198316145b92915050565b6003805461035c9061140f565b80601f01602080910402602001604051908101604052809291908181526020018280546103889061140f565b80156103d55780601f106103aa576101008083540402835291602001916103d5565b820191906000526020600020905b8154815290600101906020018083116103b857829003601f168201915b505050505081565b6000828152602081905260409020600101546103f881610b5d565b6104028383610b6a565b505050565b6001600160a01b038116331461047c5760405162461bcd60e51b815260206004820152602f60248201527f416363657373436f6e74726f6c3a2063616e206f6e6c792072656e6f756e636560448201526e103937b632b9903337b91039b2b63360891b60648201526084015b60405180910390fd5b6104868282610bee565b5050565b60006001600160801b038611156104e35760405162461bcd60e51b815260206004820152601e60248201527f48617368726174652063616e6e6f7420657863656564206d61782076616c00006044820152606401610473565b67ffffffffffffffff83111561053b5760405162461bcd60e51b815260206004820181905260248201527f446966666963756c74792063616e6e6f7420657863656564206d61782076616c6044820152606401610473565b63ffffffff87111561059d5760405162461bcd60e51b815260206004820152602560248201527f5265666572656e636520626c6f636b2063616e6e6f7420657863656564206d616044820152641e081d985b60da1b6064820152608401610473565b6105c77f0ac90c257048ef1c3e387c26d4a99bde06894efbcbff862dc1885c3a9319308a33610a40565b6106135760405162461bcd60e51b815260206004820152601e60248201527f557064617465206e6f7420616c6c6f77656420746f2065766572796f6e6500006044820152606401610473565b6040805160208082018b90528183018a9052606082018990526080820188905260a0820187905260c08083018790528351808403909101815260e0830184528051908201207f19457468657265756d205369676e6564204d6573736167653a0a33320000000061010084015261011c808401919091528351808403909101815261013c90920190925280519101206106cf7f49e5b8548b5bb0055e7e9cb1e982f642296e438bfc6aebfb9f4e4d3dd6bb5d6d61023e8386610c53565b61070f5760405162461bcd60e51b8152602060048201526011602482015270496e76616c6964207369676e617475726560781b6044820152606401610473565b600089815260026020526040902054640100000000900463ffffffff16156107795760405162461bcd60e51b815260206004820152601e60248201527f496e666f726d6174696f6e2063616e6e6f7420626520757064617465642e00006044820152606401610473565b6000898152600260208190526040909120805463ffffffff8b811677ffffffffffffffffffffffffffffffff00000000ffffffff909216640100000000428316026001600160c01b031617600160c01b67ffffffffffffffff8a16021777ffffffffffffffffffffffffffffffff00000000ffffffff191691909117600160401b6001600160801b038c160217825560018083018a9055919092018790555416891115610836576001805463ffffffff191663ffffffff8b161790555b60408051888152602081018890529081018690526060810185905242608082015288908a9033907fa4f339c6fee573da0cfc2b6116a1f4b546d31bab7ebc051c25de7368e0c42d269060a00160405180910390a450600198975050505050505050565b6060806000846108aa85600161137a565b6108b491906113b1565b90508067ffffffffffffffff8111156108cf576108cf6114a7565b6040519080825280602002602001820160405280156108f8578160200160208202803683370190505b5091508067ffffffffffffffff811115610914576109146114a7565b60405190808252806020026020018201604052801561093d578160200160208202803683370190505b50925060005b81811015610a3757600060028161095a848a61137a565b81526020808201929092526040908101600020815160c081018352815463ffffffff808216835264010000000082041694820194909452600160401b84046001600160801b031692810192909252600160c01b90920467ffffffffffffffff16606082015260018201546080820181905260029092015460a082015285519092508590849081106109ed576109ed611491565b60200260200101818152505080604001516001600160801b0316858381518110610a1957610a19611491565b60209081029190910101525080610a2f8161144a565b915050610943565b50509250929050565b6000918252602082815260408084206001600160a01b0393909316845291905290205460ff1690565b600081815260026020526040812054819081908190819081908190640100000000900463ffffffff16610ad55760405162461bcd60e51b815260206004820152601460248201527311185d19481b9bdd081e595d081a5b99195e195960621b6044820152606401610473565b5050506000858152600260208190526040909120805460018201549190920154969763ffffffff80841698600160401b85046001600160801b03169850929650919450600160c01b830467ffffffffffffffff1693506401000000009092041690565b600082815260208190526040902060010154610b5381610b5d565b6104028383610bee565b610b678133610c77565b50565b610b748282610a40565b610486576000828152602081815260408083206001600160a01b03851684529091529020805460ff19166001179055610baa3390565b6001600160a01b0316816001600160a01b0316837f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a45050565b610bf88282610a40565b15610486576000828152602081815260408083206001600160a01b0385168085529252808320805460ff1916905551339285917ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b9190a45050565b6000806000610c628585610cd0565b91509150610c6f81610d16565b509392505050565b610c818282610a40565b61048657610c8e81610e64565b610c99836020610e76565b604051602001610caa9291906112a4565b60408051601f198184030181529082905262461bcd60e51b825261047391600401611347565b600080825160411415610d075760208301516040840151606085015160001a610cfb87828585611019565b94509450505050610d0f565b506000905060025b9250929050565b6000816004811115610d2a57610d2a61147b565b1415610d335750565b6001816004811115610d4757610d4761147b565b1415610d955760405162461bcd60e51b815260206004820152601860248201527f45434453413a20696e76616c6964207369676e617475726500000000000000006044820152606401610473565b6002816004811115610da957610da961147b565b1415610df75760405162461bcd60e51b815260206004820152601f60248201527f45434453413a20696e76616c6964207369676e6174757265206c656e677468006044820152606401610473565b6003816004811115610e0b57610e0b61147b565b1415610b675760405162461bcd60e51b815260206004820152602260248201527f45434453413a20696e76616c6964207369676e6174757265202773272076616c604482015261756560f01b6064820152608401610473565b60606103496001600160a01b03831660145b60606000610e85836002611392565b610e9090600261137a565b67ffffffffffffffff811115610ea857610ea86114a7565b6040519080825280601f01601f191660200182016040528015610ed2576020820181803683370190505b509050600360fc1b81600081518110610eed57610eed611491565b60200101906001600160f81b031916908160001a905350600f60fb1b81600181518110610f1c57610f1c611491565b60200101906001600160f81b031916908160001a9053506000610f40846002611392565b610f4b90600161137a565b90505b6001811115610fc3576f181899199a1a9b1b9c1cb0b131b232b360811b85600f1660108110610f7f57610f7f611491565b1a60f81b828281518110610f9557610f95611491565b60200101906001600160f81b031916908160001a90535060049490941c93610fbc816113f8565b9050610f4e565b5083156110125760405162461bcd60e51b815260206004820181905260248201527f537472696e67733a20686578206c656e67746820696e73756666696369656e746044820152606401610473565b9392505050565b6000807f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a083111561105057506000905060036110d4565b6040805160008082526020820180845289905260ff881692820192909252606081018690526080810185905260019060a0016020604051602081039080840390855afa1580156110a4573d6000803e3d6000fd5b5050604051601f1901519150506001600160a01b0381166110cd576000600192509250506110d4565b9150600090505b94509492505050565b6000602082840312156110ef57600080fd5b5035919050565b6000806040838503121561110957600080fd5b8235915060208301356001600160a01b038116811461112757600080fd5b809150509250929050565b60006020828403121561114457600080fd5b81356001600160e01b03198116811461101257600080fd5b6000806040838503121561116f57600080fd5b50508035926020909101359150565b600080600080600080600060e0888a03121561119957600080fd5b873596506020880135955060408801359450606088013593506080880135925060a0880135915060c088013567ffffffffffffffff808211156111db57600080fd5b818a0191508a601f8301126111ef57600080fd5b813581811115611201576112016114a7565b604051601f8201601f19908116603f01168101908382118183101715611229576112296114a7565b816040528281528d602084870101111561124257600080fd5b82602086016020830137600060208483010152809550505050505092959891949750929550565b600081518084526020808501945080840160005b838110156112995781518752958201959082019060010161127d565b509495945050505050565b7f416363657373436f6e74726f6c3a206163636f756e74200000000000000000008152600083516112dc8160178501602088016113c8565b7001034b99036b4b9b9b4b733903937b6329607d1b601791840191820152835161130d8160288401602088016113c8565b01602801949350505050565b60408152600061132c6040830185611269565b828103602084015261133e8185611269565b95945050505050565b60208152600082518060208401526113668160408501602087016113c8565b601f01601f19169190910160400192915050565b6000821982111561138d5761138d611465565b500190565b60008160001904831182151516156113ac576113ac611465565b500290565b6000828210156113c3576113c3611465565b500390565b60005b838110156113e35781810151838201526020016113cb565b838111156113f2576000848401525b50505050565b60008161140757611407611465565b506000190190565b600181811c9082168061142357607f821691505b6020821081141561144457634e487b7160e01b600052602260045260246000fd5b50919050565b600060001982141561145e5761145e611465565b5060010190565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052602160045260246000fd5b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052604160045260246000fdfea26469706673582212201ee5cdef4bbec4307924965edd9f5ebf6aabb5a14f69cc6ada8d1ed7823c009864736f6c63430008060033
Constructor Arguments (ABI-Encoded and is the last bytes of the Contract Creation Code above)
000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000000164f5241434c455f4254435f4d494e494e475f5357415000000000000000000000
-----Decoded View---------------
Arg [0] : _name (string): ORACLE_BTC_MINING_SWAP
-----Encoded View---------------
3 Constructor Arguments found :
Arg [0] : 0000000000000000000000000000000000000000000000000000000000000020
Arg [1] : 0000000000000000000000000000000000000000000000000000000000000016
Arg [2] : 4f5241434c455f4254435f4d494e494e475f5357415000000000000000000000
Loading...
Loading
Loading...
Loading
Net Worth in USD
$0.00
Net Worth in ETH
0
Multichain Portfolio | 33 Chains
| Chain | Token | Portfolio % | Price | Amount | Value |
|---|
Loading...
Loading
Loading...
Loading
Loading...
Loading
[ Download: CSV Export ]
A contract address hosts a smart contract, which is a set of code stored on the blockchain that runs when predetermined conditions are met. Learn more about addresses in our Knowledge Base.