Warning! Contract bytecode has been changed and doesn't match the verified one. Therefore, interaction with this smart contract may be risky.
- Contract name:
- PCO
- Optimization enabled
- true
- Compiler version
- v0.8.20+commit.a1b79de6
- Optimization runs
- 200
- EVM Version
- default
- Verified at
- 2024-05-03T21:41:22.299890Z
Contract source code
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (interfaces/draft-IERC6093.sol)
pragma solidity 0.8.20;
/**
* @dev Standard ERC20 Errors
* Interface of the https://eips.ethereum.org/EIPS/eip-6093[ERC-6093] custom errors for ERC20 tokens.
*/
interface IERC20Errors {
/**
* @dev Indicates an error related to the current `balance` of a `sender`. Used in transfers.
* @param sender Address whose tokens are being transferred.
* @param balance Current balance for the interacting account.
* @param needed Minimum amount required to perform a transfer.
*/
error ERC20InsufficientBalance(address sender, uint256 balance, uint256 needed);
/**
* @dev Indicates a failure with the token `sender`. Used in transfers.
* @param sender Address whose tokens are being transferred.
*/
error ERC20InvalidSender(address sender);
/**
* @dev Indicates a failure with the token `receiver`. Used in transfers.
* @param receiver Address to which tokens are being transferred.
*/
error ERC20InvalidReceiver(address receiver);
/**
* @dev Indicates a failure with the `spender`’s `allowance`. Used in transfers.
* @param spender Address that may be allowed to operate on tokens without being their owner.
* @param allowance Amount of tokens a `spender` is allowed to operate with.
* @param needed Minimum amount required to perform a transfer.
*/
error ERC20InsufficientAllowance(address spender, uint256 allowance, uint256 needed);
/**
* @dev Indicates a failure with the `approver` of a token to be approved. Used in approvals.
* @param approver Address initiating an approval operation.
*/
error ERC20InvalidApprover(address approver);
/**
* @dev Indicates a failure with the `spender` to be approved. Used in approvals.
* @param spender Address that may be allowed to operate on tokens without being their owner.
*/
error ERC20InvalidSpender(address spender);
}
/**
* @dev Standard ERC721 Errors
* Interface of the https://eips.ethereum.org/EIPS/eip-6093[ERC-6093] custom errors for ERC721 tokens.
*/
interface IERC721Errors {
/**
* @dev Indicates that an address can't be an owner. For example, `address(0)` is a forbidden owner in EIP-20.
* Used in balance queries.
* @param owner Address of the current owner of a token.
*/
error ERC721InvalidOwner(address owner);
/**
* @dev Indicates a `tokenId` whose `owner` is the zero address.
* @param tokenId Identifier number of a token.
*/
error ERC721NonexistentToken(uint256 tokenId);
/**
* @dev Indicates an error related to the ownership over a particular token. Used in transfers.
* @param sender Address whose tokens are being transferred.
* @param tokenId Identifier number of a token.
* @param owner Address of the current owner of a token.
*/
error ERC721IncorrectOwner(address sender, uint256 tokenId, address owner);
/**
* @dev Indicates a failure with the token `sender`. Used in transfers.
* @param sender Address whose tokens are being transferred.
*/
error ERC721InvalidSender(address sender);
/**
* @dev Indicates a failure with the token `receiver`. Used in transfers.
* @param receiver Address to which tokens are being transferred.
*/
error ERC721InvalidReceiver(address receiver);
/**
* @dev Indicates a failure with the `operator`’s approval. Used in transfers.
* @param operator Address that may be allowed to operate on tokens without being their owner.
* @param tokenId Identifier number of a token.
*/
error ERC721InsufficientApproval(address operator, uint256 tokenId);
/**
* @dev Indicates a failure with the `approver` of a token to be approved. Used in approvals.
* @param approver Address initiating an approval operation.
*/
error ERC721InvalidApprover(address approver);
/**
* @dev Indicates a failure with the `operator` to be approved. Used in approvals.
* @param operator Address that may be allowed to operate on tokens without being their owner.
*/
error ERC721InvalidOperator(address operator);
}
/**
* @dev Standard ERC1155 Errors
* Interface of the https://eips.ethereum.org/EIPS/eip-6093[ERC-6093] custom errors for ERC1155 tokens.
*/
interface IERC1155Errors {
/**
* @dev Indicates an error related to the current `balance` of a `sender`. Used in transfers.
* @param sender Address whose tokens are being transferred.
* @param balance Current balance for the interacting account.
* @param needed Minimum amount required to perform a transfer.
* @param tokenId Identifier number of a token.
*/
error ERC1155InsufficientBalance(address sender, uint256 balance, uint256 needed, uint256 tokenId);
/**
* @dev Indicates a failure with the token `sender`. Used in transfers.
* @param sender Address whose tokens are being transferred.
*/
error ERC1155InvalidSender(address sender);
/**
* @dev Indicates a failure with the token `receiver`. Used in transfers.
* @param receiver Address to which tokens are being transferred.
*/
error ERC1155InvalidReceiver(address receiver);
/**
* @dev Indicates a failure with the `operator`’s approval. Used in transfers.
* @param operator Address that may be allowed to operate on tokens without being their owner.
* @param owner Address of the current owner of a token.
*/
error ERC1155MissingApprovalForAll(address operator, address owner);
/**
* @dev Indicates a failure with the `approver` of a token to be approved. Used in approvals.
* @param approver Address initiating an approval operation.
*/
error ERC1155InvalidApprover(address approver);
/**
* @dev Indicates a failure with the `operator` to be approved. Used in approvals.
* @param operator Address that may be allowed to operate on tokens without being their owner.
*/
error ERC1155InvalidOperator(address operator);
/**
* @dev Indicates an array length mismatch between ids and values in a safeBatchTransferFrom operation.
* Used in batch transfers.
* @param idsLength Length of the array of token identifiers
* @param valuesLength Length of the array of token amounts
*/
error ERC1155InvalidArrayLength(uint256 idsLength, uint256 valuesLength);
}
// File: @openzeppelin/contracts/utils/Context.sol
// OpenZeppelin Contracts (last updated v5.0.1) (utils/Context.sol)
pragma solidity ^0.8.20;
/**
* @dev Provides information about the current execution context, including the
* sender of the transaction and its data. While these are generally available
* via msg.sender and msg.data, they should not be accessed in such a direct
* manner, since when dealing with meta-transactions the account sending and
* paying for execution may not be the actual sender (as far as an application
* is concerned).
*
* This contract is only required for intermediate, library-like contracts.
*/
abstract contract Context {
function _msgSender() internal view virtual returns (address) {
return msg.sender;
}
function _msgData() internal view virtual returns (bytes calldata) {
return msg.data;
}
function _contextSuffixLength() internal view virtual returns (uint256) {
return 0;
}
}
// File: @openzeppelin/contracts/access/Ownable.sol
// OpenZeppelin Contracts (last updated v5.0.0) (access/Ownable.sol)
pragma solidity ^0.8.20;
/**
* @dev Contract module which provides a basic access control mechanism, where
* there is an account (an owner) that can be granted exclusive access to
* specific functions.
*
* The initial owner is set to the address provided by the deployer. This can
* later be changed with {transferOwnership}.
*
* This module is used through inheritance. It will make available the modifier
* `onlyOwner`, which can be applied to your functions to restrict their use to
* the owner.
*/
abstract contract Ownable is Context {
address private _owner;
/**
* @dev The caller account is not authorized to perform an operation.
*/
error OwnableUnauthorizedAccount(address account);
/**
* @dev The owner is not a valid owner account. (eg. `address(0)`)
*/
error OwnableInvalidOwner(address owner);
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
/**
* @dev Initializes the contract setting the address provided by the deployer as the initial owner.
*/
constructor(address initialOwner) {
if (initialOwner == address(0)) {
revert OwnableInvalidOwner(address(0));
}
_transferOwnership(initialOwner);
}
/**
* @dev Throws if called by any account other than the owner.
*/
modifier onlyOwner() {
_checkOwner();
_;
}
/**
* @dev Returns the address of the current owner.
*/
function owner() public view virtual returns (address) {
return _owner;
}
/**
* @dev Throws if the sender is not the owner.
*/
function _checkOwner() internal view virtual {
if (owner() != _msgSender()) {
revert OwnableUnauthorizedAccount(_msgSender());
}
}
/**
* @dev Leaves the contract without owner. It will not be possible to call
* `onlyOwner` functions. Can only be called by the current owner.
*
* NOTE: Renouncing ownership will leave the contract without an owner,
* thereby disabling any functionality that is only available to the owner.
*/
function renounceOwnership() public virtual onlyOwner {
_transferOwnership(address(0));
}
/**
* @dev Transfers ownership of the contract to a new account (`newOwner`).
* Can only be called by the current owner.
*/
function transferOwnership(address newOwner) public virtual onlyOwner {
if (newOwner == address(0)) {
revert OwnableInvalidOwner(address(0));
}
_transferOwnership(newOwner);
}
/**
* @dev Transfers ownership of the contract to a new account (`newOwner`).
* Internal function without access restriction.
*/
function _transferOwnership(address newOwner) internal virtual {
address oldOwner = _owner;
_owner = newOwner;
emit OwnershipTransferred(oldOwner, newOwner);
}
}
// File: @openzeppelin/contracts/token/ERC20/IERC20.sol
// OpenZeppelin Contracts (last updated v5.0.0) (token/ERC20/IERC20.sol)
pragma solidity ^0.8.20;
/**
* @dev Interface of the ERC20 standard as defined in the EIP.
*/
interface IERC20 {
/**
* @dev Emitted when `value` tokens are moved from one account (`from`) to
* another (`to`).
*
* Note that `value` may be zero.
*/
event Transfer(address indexed from, address indexed to, uint256 value);
/**
* @dev Emitted when the allowance of a `spender` for an `owner` is set by
* a call to {approve}. `value` is the new allowance.
*/
event Approval(address indexed owner, address indexed spender, uint256 value);
/**
* @dev Returns the value of tokens in existence.
*/
function totalSupply() external view returns (uint256);
/**
* @dev Returns the value of tokens owned by `account`.
*/
function balanceOf(address account) external view returns (uint256);
/**
* @dev Moves a `value` amount of tokens from the caller's account to `to`.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* Emits a {Transfer} event.
*/
function transfer(address to, uint256 value) external returns (bool);
/**
* @dev Returns the remaining number of tokens that `spender` will be
* allowed to spend on behalf of `owner` through {transferFrom}. This is
* zero by default.
*
* This value changes when {approve} or {transferFrom} are called.
*/
function allowance(address owner, address spender) external view returns (uint256);
/**
* @dev Sets a `value` amount of tokens as the allowance of `spender` over the
* caller's tokens.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* IMPORTANT: Beware that changing an allowance with this method brings the risk
* that someone may use both the old and the new allowance by unfortunate
* transaction ordering. One possible solution to mitigate this race
* condition is to first reduce the spender's allowance to 0 and set the
* desired value afterwards:
* https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729
*
* Emits an {Approval} event.
*/
function approve(address spender, uint256 value) external returns (bool);
/**
* @dev Moves a `value` amount of tokens from `from` to `to` using the
* allowance mechanism. `value` is then deducted from the caller's
* allowance.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* Emits a {Transfer} event.
*/
function transferFrom(address from, address to, uint256 value) external returns (bool);
}
// File: @openzeppelin/contracts/token/ERC20/extensions/IERC20Metadata.sol
// OpenZeppelin Contracts (last updated v5.0.0) (token/ERC20/extensions/IERC20Metadata.sol)
pragma solidity ^0.8.20;
/**
* @dev Interface for the optional metadata functions from the ERC20 standard.
*/
interface IERC20Metadata is IERC20 {
/**
* @dev Returns the name of the token.
*/
function name() external view returns (string memory);
/**
* @dev Returns the symbol of the token.
*/
function symbol() external view returns (string memory);
/**
* @dev Returns the decimals places of the token.
*/
function decimals() external view returns (uint8);
}
// File: @openzeppelin/contracts/token/ERC20/ERC20.sol
// OpenZeppelin Contracts (last updated v5.0.0) (token/ERC20/ERC20.sol)
pragma solidity ^0.8.20;
/**
* @dev Implementation of the {IERC20} interface.
*
* This implementation is agnostic to the way tokens are created. This means
* that a supply mechanism has to be added in a derived contract using {_mint}.
*
* TIP: For a detailed writeup see our guide
* https://forum.openzeppelin.com/t/how-to-implement-erc20-supply-mechanisms/226[How
* to implement supply mechanisms].
*
* The default value of {decimals} is 18. To change this, you should override
* this function so it returns a different value.
*
* We have followed general OpenZeppelin Contracts guidelines: functions revert
* instead returning `false` on failure. This behavior is nonetheless
* conventional and does not conflict with the expectations of ERC20
* applications.
*
* Additionally, an {Approval} event is emitted on calls to {transferFrom}.
* This allows applications to reconstruct the allowance for all accounts just
* by listening to said events. Other implementations of the EIP may not emit
* these events, as it isn't required by the specification.
*/
abstract contract ERC20 is Context, IERC20, IERC20Metadata, IERC20Errors {
mapping(address account => uint256) private _balances;
mapping(address account => mapping(address spender => uint256)) private _allowances;
uint256 private _totalSupply;
string private _name;
string private _symbol;
/**
* @dev Sets the values for {name} and {symbol}.
*
* All two of these values are immutable: they can only be set once during
* construction.
*/
constructor(string memory name_, string memory symbol_) {
_name = name_;
_symbol = symbol_;
}
/**
* @dev Returns the name of the token.
*/
function name() public view virtual returns (string memory) {
return _name;
}
/**
* @dev Returns the symbol of the token, usually a shorter version of the
* name.
*/
function symbol() public view virtual returns (string memory) {
return _symbol;
}
/**
* @dev Returns the number of decimals used to get its user representation.
* For example, if `decimals` equals `2`, a balance of `505` tokens should
* be displayed to a user as `5.05` (`505 / 10 ** 2`).
*
* Tokens usually opt for a value of 18, imitating the relationship between
* Ether and Wei. This is the default value returned by this function, unless
* it's overridden.
*
* NOTE: This information is only used for _display_ purposes: it in
* no way affects any of the arithmetic of the contract, including
* {IERC20-balanceOf} and {IERC20-transfer}.
*/
function decimals() public view virtual returns (uint8) {
return 18;
}
/**
* @dev See {IERC20-totalSupply}.
*/
function totalSupply() public view virtual returns (uint256) {
return _totalSupply;
}
/**
* @dev See {IERC20-balanceOf}.
*/
function balanceOf(address account) public view virtual returns (uint256) {
return _balances[account];
}
/**
* @dev See {IERC20-transfer}.
*
* Requirements:
*
* - `to` cannot be the zero address.
* - the caller must have a balance of at least `value`.
*/
function transfer(address to, uint256 value) public virtual returns (bool) {
address owner = _msgSender();
_transfer(owner, to, value);
return true;
}
/**
* @dev See {IERC20-allowance}.
*/
function allowance(address owner, address spender) public view virtual returns (uint256) {
return _allowances[owner][spender];
}
/**
* @dev See {IERC20-approve}.
*
* NOTE: If `value` is the maximum `uint256`, the allowance is not updated on
* `transferFrom`. This is semantically equivalent to an infinite approval.
*
* Requirements:
*
* - `spender` cannot be the zero address.
*/
function approve(address spender, uint256 value) public virtual returns (bool) {
address owner = _msgSender();
_approve(owner, spender, value);
return true;
}
/**
* @dev See {IERC20-transferFrom}.
*
* Emits an {Approval} event indicating the updated allowance. This is not
* required by the EIP. See the note at the beginning of {ERC20}.
*
* NOTE: Does not update the allowance if the current allowance
* is the maximum `uint256`.
*
* Requirements:
*
* - `from` and `to` cannot be the zero address.
* - `from` must have a balance of at least `value`.
* - the caller must have allowance for ``from``'s tokens of at least
* `value`.
*/
function transferFrom(address from, address to, uint256 value) public virtual returns (bool) {
address spender = _msgSender();
_spendAllowance(from, spender, value);
_transfer(from, to, value);
return true;
}
/**
* @dev Moves a `value` amount of tokens from `from` to `to`.
*
* This internal function is equivalent to {transfer}, and can be used to
* e.g. implement automatic token fees, slashing mechanisms, etc.
*
* Emits a {Transfer} event.
*
* NOTE: This function is not virtual, {_update} should be overridden instead.
*/
function _transfer(address from, address to, uint256 value) internal {
if (from == address(0)) {
revert ERC20InvalidSender(address(0));
}
if (to == address(0)) {
revert ERC20InvalidReceiver(address(0));
}
_update(from, to, value);
}
/**
* @dev Transfers a `value` amount of tokens from `from` to `to`, or alternatively mints (or burns) if `from`
* (or `to`) is the zero address. All customizations to transfers, mints, and burns should be done by overriding
* this function.
*
* Emits a {Transfer} event.
*/
function _update(address from, address to, uint256 value) internal virtual {
if (from == address(0)) {
// Overflow check required: The rest of the code assumes that totalSupply never overflows
_totalSupply += value;
} else {
uint256 fromBalance = _balances[from];
if (fromBalance < value) {
revert ERC20InsufficientBalance(from, fromBalance, value);
}
unchecked {
// Overflow not possible: value <= fromBalance <= totalSupply.
_balances[from] = fromBalance - value;
}
}
if (to == address(0)) {
unchecked {
// Overflow not possible: value <= totalSupply or value <= fromBalance <= totalSupply.
_totalSupply -= value;
}
} else {
unchecked {
// Overflow not possible: balance + value is at most totalSupply, which we know fits into a uint256.
_balances[to] += value;
}
}
emit Transfer(from, to, value);
}
/**
* @dev Creates a `value` amount of tokens and assigns them to `account`, by transferring it from address(0).
* Relies on the `_update` mechanism
*
* Emits a {Transfer} event with `from` set to the zero address.
*
* NOTE: This function is not virtual, {_update} should be overridden instead.
*/
function _mint(address account, uint256 value) internal {
if (account == address(0)) {
revert ERC20InvalidReceiver(address(0));
}
_update(address(0), account, value);
}
/**
* @dev Destroys a `value` amount of tokens from `account`, lowering the total supply.
* Relies on the `_update` mechanism.
*
* Emits a {Transfer} event with `to` set to the zero address.
*
* NOTE: This function is not virtual, {_update} should be overridden instead
*/
function _burn(address account, uint256 value) internal {
if (account == address(0)) {
revert ERC20InvalidSender(address(0));
}
_update(account, address(0), value);
}
/**
* @dev Sets `value` as the allowance of `spender` over the `owner` s tokens.
*
* This internal function is equivalent to `approve`, and can be used to
* e.g. set automatic allowances for certain subsystems, etc.
*
* Emits an {Approval} event.
*
* Requirements:
*
* - `owner` cannot be the zero address.
* - `spender` cannot be the zero address.
*
* Overrides to this logic should be done to the variant with an additional `bool emitEvent` argument.
*/
function _approve(address owner, address spender, uint256 value) internal {
_approve(owner, spender, value, true);
}
/**
* @dev Variant of {_approve} with an optional flag to enable or disable the {Approval} event.
*
* By default (when calling {_approve}) the flag is set to true. On the other hand, approval changes made by
* `_spendAllowance` during the `transferFrom` operation set the flag to false. This saves gas by not emitting any
* `Approval` event during `transferFrom` operations.
*
* Anyone who wishes to continue emitting `Approval` events on the`transferFrom` operation can force the flag to
* true using the following override:
* ```
* function _approve(address owner, address spender, uint256 value, bool) internal virtual override {
* super._approve(owner, spender, value, true);
* }
* ```
*
* Requirements are the same as {_approve}.
*/
function _approve(address owner, address spender, uint256 value, bool emitEvent) internal virtual {
if (owner == address(0)) {
revert ERC20InvalidApprover(address(0));
}
if (spender == address(0)) {
revert ERC20InvalidSpender(address(0));
}
_allowances[owner][spender] = value;
if (emitEvent) {
emit Approval(owner, spender, value);
}
}
/**
* @dev Updates `owner` s allowance for `spender` based on spent `value`.
*
* Does not update the allowance value in case of infinite allowance.
* Revert if not enough allowance is available.
*
* Does not emit an {Approval} event.
*/
function _spendAllowance(address owner, address spender, uint256 value) internal virtual {
uint256 currentAllowance = allowance(owner, spender);
if (currentAllowance != type(uint256).max) {
if (currentAllowance < value) {
revert ERC20InsufficientAllowance(spender, currentAllowance, value);
}
unchecked {
_approve(owner, spender, currentAllowance - value, false);
}
}
}
}
// File: @openzeppelin/contracts/security/ReentrancyGuard.sol
// OpenZeppelin Contracts (last updated v4.9.0) (security/ReentrancyGuard.sol)
pragma solidity ^0.8.0;
/**
* @dev Contract module that helps prevent reentrant calls to a function.
*
* Inheriting from `ReentrancyGuard` will make the {nonReentrant} modifier
* available, which can be applied to functions to make sure there are no nested
* (reentrant) calls to them.
*
* Note that because there is a single `nonReentrant` guard, functions marked as
* `nonReentrant` may not call one another. This can be worked around by making
* those functions `private`, and then adding `external` `nonReentrant` entry
* points to them.
*
* TIP: If you would like to learn more about reentrancy and alternative ways
* to protect against it, check out our blog post
* https://blog.openzeppelin.com/reentrancy-after-istanbul/[Reentrancy After Istanbul].
*/
abstract contract ReentrancyGuard {
// Booleans are more expensive than uint256 or any type that takes up a full
// word because each write operation emits an extra SLOAD to first read the
// slot's contents, replace the bits taken up by the boolean, and then write
// back. This is the compiler's defense against contract upgrades and
// pointer aliasing, and it cannot be disabled.
// The values being non-zero value makes deployment a bit more expensive,
// but in exchange the refund on every call to nonReentrant will be lower in
// amount. Since refunds are capped to a percentage of the total
// transaction's gas, it is best to keep them low in cases like this one, to
// increase the likelihood of the full refund coming into effect.
uint256 private constant _NOT_ENTERED = 1;
uint256 private constant _ENTERED = 2;
uint256 private _status;
constructor() {
_status = _NOT_ENTERED;
}
/**
* @dev Prevents a contract from calling itself, directly or indirectly.
* Calling a `nonReentrant` function from another `nonReentrant`
* function is not supported. It is possible to prevent this from happening
* by making the `nonReentrant` function external, and making it call a
* `private` function that does the actual work.
*/
modifier nonReentrant() {
_nonReentrantBefore();
_;
_nonReentrantAfter();
}
function _nonReentrantBefore() private {
// On the first call to nonReentrant, _status will be _NOT_ENTERED
require(_status != _ENTERED, "ReentrancyGuard: reentrant call");
// Any calls to nonReentrant after this point will fail
_status = _ENTERED;
}
function _nonReentrantAfter() private {
// By storing the original value once again, a refund is triggered (see
// https://eips.ethereum.org/EIPS/eip-2200)
_status = _NOT_ENTERED;
}
/**
* @dev Returns true if the reentrancy guard is currently set to "entered", which indicates there is a
* `nonReentrant` function in the call stack.
*/
function _reentrancyGuardEntered() internal view returns (bool) {
return _status == _ENTERED;
}
}
/*
//Experimental.
//Tokens can be locked in the RewardSystem Contract for Minted Rewards
//Nodes can potentially be used as a fill-in Oracle Price feed on Networks not supported by Large Oracle Projects
//Use at your own risk
*/
interface IOracleNode {
function updatePrices() external;
}
contract PCO is ERC20, Ownable, ReentrancyGuard {
string public constant NAME = "PulseChain Oracles";
string public constant SYMBOL = "PCO";
mapping(address => bool) public activeNodes; // New mapping to manage node activity
address[] public registeredNodes;
address public oracleController;
mapping(address => bool) public isRewardSysAddress;
uint256 public lastUpdateTimestamp;
uint256 public wait = 3 minutes; // Minimum interval between updates
event NodeRegistered(address node);
event NodeUnregistered(address node);
event RewardSysAddressUpdated(address indexed account, bool isRewardSysAddress);
event MaxMintAmountUpdated(uint256 newMaxMintAmount);
event WaitUpdated(uint256 wait);
uint256 public maxMintAmount = 1 * 10 ** uint256(decimals());
modifier onlyOracleController() {
require(msg.sender == oracleController, "Only Oracle Controller can call this function.");
_;
}
constructor() ERC20(NAME, SYMBOL) Ownable(msg.sender) {
_mint(msg.sender, 10000 * 10**uint256(decimals())); // Mint initial tokens to deployer/owner
lastUpdateTimestamp = block.timestamp;
}
function setWait(uint256 _waitSeconds) external onlyOwner {
require(_waitSeconds <= 30 minutes, "Excessive wait time");
require(_waitSeconds >= 10 seconds, "Wait too short");
wait = _waitSeconds;
emit WaitUpdated(_waitSeconds);
}
function setMaxMintAmount(uint256 _maxMintAmount) external onlyOwner {
maxMintAmount = _maxMintAmount;
emit MaxMintAmountUpdated(_maxMintAmount);
}
function setOracleController(address _oracleController) external onlyOwner {
require(_oracleController != address(0), "OracleToken: Controller cannot be zero address");
oracleController = _oracleController;
}
function setRewardSys(address account, bool status) external onlyOwner {
isRewardSysAddress[account] = status;
emit RewardSysAddressUpdated(account, status);
}
function registerNode(address node) external onlyOwner {
require(node != address(0), "Node cannot be zero address");
require(!activeNodes[node], "Node already registered");
registeredNodes.push(node);
activeNodes[node] = true;
emit NodeRegistered(node);
}
function unregisterNode(address node) external onlyOwner {
require(activeNodes[node], "Node not registered");
// Mark the node as inactive
activeNodes[node] = false;
// Optional: Find and remove the node from the registeredNodes array to prevent it from growing indefinitely
for (uint i = 0; i < registeredNodes.length; i++) {
if (registeredNodes[i] == node) {
registeredNodes[i] = registeredNodes[registeredNodes.length - 1];
registeredNodes.pop();
break;
}
}
emit NodeUnregistered(node);
}
function mint(address to, uint256 amount) external onlyOracleController nonReentrant {
require(amount <= maxMintAmount, "OracleToken: Cannot mint more than the max allowed amount");
require(to != address(0), "OracleToken: Cannot mint to the zero address");
_mint(to, amount);
}
function transfer(address recipient, uint256 amount) public override returns (bool) {
bool success = super.transfer(recipient, amount);
if (success && !isRewardSysAddress[msg.sender]) {
triggerNodeUpdate();
}
return success;
}
function transferFrom(address sender, address recipient, uint256 amount) public override returns (bool) {
bool success = super.transferFrom(sender, recipient, amount);
if (success && !isRewardSysAddress[sender]) {
triggerNodeUpdate();
}
return success;
}
function triggerNodeUpdate() internal nonReentrant {
if (block.timestamp >= lastUpdateTimestamp + wait) {
uint256 successes = 0;
uint256 failures = 0;
for (uint i = 0; i < registeredNodes.length; i++) {
if (activeNodes[registeredNodes[i]]) {
try IOracleNode(registeredNodes[i]).updatePrices() {
successes++;
} catch {
failures++;
}
}
}
if (successes > 0) {
lastUpdateTimestamp = block.timestamp;
}
}
}
function isNodeRegistered(address node) public view returns (bool) {
for (uint i = 0; i < registeredNodes.length; i++) {
if (registeredNodes[i] == node) {
return true;
}
}
return false;
}
}
Contract ABI
[{"type":"constructor","stateMutability":"nonpayable","inputs":[]},{"type":"error","name":"ERC20InsufficientAllowance","inputs":[{"type":"address","name":"spender","internalType":"address"},{"type":"uint256","name":"allowance","internalType":"uint256"},{"type":"uint256","name":"needed","internalType":"uint256"}]},{"type":"error","name":"ERC20InsufficientBalance","inputs":[{"type":"address","name":"sender","internalType":"address"},{"type":"uint256","name":"balance","internalType":"uint256"},{"type":"uint256","name":"needed","internalType":"uint256"}]},{"type":"error","name":"ERC20InvalidApprover","inputs":[{"type":"address","name":"approver","internalType":"address"}]},{"type":"error","name":"ERC20InvalidReceiver","inputs":[{"type":"address","name":"receiver","internalType":"address"}]},{"type":"error","name":"ERC20InvalidSender","inputs":[{"type":"address","name":"sender","internalType":"address"}]},{"type":"error","name":"ERC20InvalidSpender","inputs":[{"type":"address","name":"spender","internalType":"address"}]},{"type":"error","name":"OwnableInvalidOwner","inputs":[{"type":"address","name":"owner","internalType":"address"}]},{"type":"error","name":"OwnableUnauthorizedAccount","inputs":[{"type":"address","name":"account","internalType":"address"}]},{"type":"event","name":"Approval","inputs":[{"type":"address","name":"owner","internalType":"address","indexed":true},{"type":"address","name":"spender","internalType":"address","indexed":true},{"type":"uint256","name":"value","internalType":"uint256","indexed":false}],"anonymous":false},{"type":"event","name":"MaxMintAmountUpdated","inputs":[{"type":"uint256","name":"newMaxMintAmount","internalType":"uint256","indexed":false}],"anonymous":false},{"type":"event","name":"NodeRegistered","inputs":[{"type":"address","name":"node","internalType":"address","indexed":false}],"anonymous":false},{"type":"event","name":"NodeUnregistered","inputs":[{"type":"address","name":"node","internalType":"address","indexed":false}],"anonymous":false},{"type":"event","name":"OwnershipTransferred","inputs":[{"type":"address","name":"previousOwner","internalType":"address","indexed":true},{"type":"address","name":"newOwner","internalType":"address","indexed":true}],"anonymous":false},{"type":"event","name":"RewardSysAddressUpdated","inputs":[{"type":"address","name":"account","internalType":"address","indexed":true},{"type":"bool","name":"isRewardSysAddress","internalType":"bool","indexed":false}],"anonymous":false},{"type":"event","name":"Transfer","inputs":[{"type":"address","name":"from","internalType":"address","indexed":true},{"type":"address","name":"to","internalType":"address","indexed":true},{"type":"uint256","name":"value","internalType":"uint256","indexed":false}],"anonymous":false},{"type":"event","name":"WaitUpdated","inputs":[{"type":"uint256","name":"wait","internalType":"uint256","indexed":false}],"anonymous":false},{"type":"function","stateMutability":"view","outputs":[{"type":"string","name":"","internalType":"string"}],"name":"NAME","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"string","name":"","internalType":"string"}],"name":"SYMBOL","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"bool","name":"","internalType":"bool"}],"name":"activeNodes","inputs":[{"type":"address","name":"","internalType":"address"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"allowance","inputs":[{"type":"address","name":"owner","internalType":"address"},{"type":"address","name":"spender","internalType":"address"}]},{"type":"function","stateMutability":"nonpayable","outputs":[{"type":"bool","name":"","internalType":"bool"}],"name":"approve","inputs":[{"type":"address","name":"spender","internalType":"address"},{"type":"uint256","name":"value","internalType":"uint256"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"balanceOf","inputs":[{"type":"address","name":"account","internalType":"address"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint8","name":"","internalType":"uint8"}],"name":"decimals","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"bool","name":"","internalType":"bool"}],"name":"isNodeRegistered","inputs":[{"type":"address","name":"node","internalType":"address"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"bool","name":"","internalType":"bool"}],"name":"isRewardSysAddress","inputs":[{"type":"address","name":"","internalType":"address"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"lastUpdateTimestamp","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"maxMintAmount","inputs":[]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"mint","inputs":[{"type":"address","name":"to","internalType":"address"},{"type":"uint256","name":"amount","internalType":"uint256"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"string","name":"","internalType":"string"}],"name":"name","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"address","name":"","internalType":"address"}],"name":"oracleController","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"address","name":"","internalType":"address"}],"name":"owner","inputs":[]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"registerNode","inputs":[{"type":"address","name":"node","internalType":"address"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"address","name":"","internalType":"address"}],"name":"registeredNodes","inputs":[{"type":"uint256","name":"","internalType":"uint256"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"renounceOwnership","inputs":[]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"setMaxMintAmount","inputs":[{"type":"uint256","name":"_maxMintAmount","internalType":"uint256"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"setOracleController","inputs":[{"type":"address","name":"_oracleController","internalType":"address"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"setRewardSys","inputs":[{"type":"address","name":"account","internalType":"address"},{"type":"bool","name":"status","internalType":"bool"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"setWait","inputs":[{"type":"uint256","name":"_waitSeconds","internalType":"uint256"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"string","name":"","internalType":"string"}],"name":"symbol","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"totalSupply","inputs":[]},{"type":"function","stateMutability":"nonpayable","outputs":[{"type":"bool","name":"","internalType":"bool"}],"name":"transfer","inputs":[{"type":"address","name":"recipient","internalType":"address"},{"type":"uint256","name":"amount","internalType":"uint256"}]},{"type":"function","stateMutability":"nonpayable","outputs":[{"type":"bool","name":"","internalType":"bool"}],"name":"transferFrom","inputs":[{"type":"address","name":"sender","internalType":"address"},{"type":"address","name":"recipient","internalType":"address"},{"type":"uint256","name":"amount","internalType":"uint256"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"transferOwnership","inputs":[{"type":"address","name":"newOwner","internalType":"address"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"unregisterNode","inputs":[{"type":"address","name":"node","internalType":"address"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"wait","inputs":[]}]
Contract Creation Code
0x608060405260b4600c55620000176012600a620003db565b62000024906001620003ef565b600d5534801562000033575f80fd5b50336040518060400160405280601281526020017150756c7365436861696e204f7261636c657360701b8152506040518060400160405280600381526020016250434f60e81b81525081600390816200008d9190620004a9565b5060046200009c8282620004a9565b5050506001600160a01b038116620000ce57604051631e4fbdf760e01b81525f60048201526024015b60405180910390fd5b620000d98162000110565b5060016006556200010633620000f26012600a620003db565b6200010090612710620003ef565b62000161565b42600b5562000587565b600580546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0905f90a35050565b6001600160a01b0382166200018c5760405163ec442f0560e01b81525f6004820152602401620000c5565b620001995f83836200019d565b5050565b6001600160a01b038316620001cb578060025f828254620001bf919062000571565b909155506200023d9050565b6001600160a01b0383165f90815260208190526040902054818110156200021f5760405163391434e360e21b81526001600160a01b03851660048201526024810182905260448101839052606401620000c5565b6001600160a01b0384165f9081526020819052604090209082900390555b6001600160a01b0382166200025b5760028054829003905562000279565b6001600160a01b0382165f9081526020819052604090208054820190555b816001600160a01b0316836001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef83604051620002bf91815260200190565b60405180910390a3505050565b634e487b7160e01b5f52601160045260245ffd5b600181815b808511156200032057815f1904821115620003045762000304620002cc565b808516156200031257918102915b93841c9390800290620002e5565b509250929050565b5f826200033857506001620003d5565b816200034657505f620003d5565b81600181146200035f57600281146200036a576200038a565b6001915050620003d5565b60ff8411156200037e576200037e620002cc565b50506001821b620003d5565b5060208310610133831016604e8410600b8410161715620003af575081810a620003d5565b620003bb8383620002e0565b805f1904821115620003d157620003d1620002cc565b0290505b92915050565b5f620003e8838362000328565b9392505050565b8082028115828204841417620003d557620003d5620002cc565b634e487b7160e01b5f52604160045260245ffd5b600181811c908216806200043257607f821691505b6020821081036200045157634e487b7160e01b5f52602260045260245ffd5b50919050565b601f821115620004a4575f81815260208120601f850160051c810160208610156200047f5750805b601f850160051c820191505b81811015620004a0578281556001016200048b565b5050505b505050565b81516001600160401b03811115620004c557620004c562000409565b620004dd81620004d684546200041d565b8462000457565b602080601f83116001811462000513575f8415620004fb5750858301515b5f19600386901b1c1916600185901b178555620004a0565b5f85815260208120601f198616915b82811015620005435788860151825594840194600190910190840162000522565b50858210156200056157878501515f19600388901b60f8161c191681555b5050505050600190811b01905550565b80820180821115620003d557620003d5620002cc565b6114ac80620005955f395ff3fe608060405234801561000f575f80fd5b50600436106101c6575f3560e01c806370a08231116100fe578063a9059cbb1161009e578063df6dd6701161006e578063df6dd6701461040a578063f2fde38b1461042c578063f76f8d781461043f578063f9a726ad14610461575f80fd5b8063a9059cbb14610399578063c5e41cf6146103ac578063c703a615146103bf578063dd62ed3e146103d2575f80fd5b80638cc0ebb5116100d95780638cc0ebb51461033c5780638da5cb5b1461034f57806395d89b4114610360578063a3f4df7e14610368575f80fd5b806370a08231146102f9578063715018a6146103215780637dbc3c1914610329575f80fd5b806326a7512d11610169578063524e6b1311610144578063524e6b13146102a857806361ca89fa146102ca57806364bd7013146102dd578063672d7a0d146102e6575f80fd5b806326a7512d1461025b578063313ce5671461028657806340c10f1914610295575f80fd5b806314bcec9f116101a457806314bcec9f1461022057806318160ddd14610237578063239c70ae1461023f57806323b872dd14610248575f80fd5b806306fdde03146101ca578063088a4ed0146101e8578063095ea7b3146101fd575b5f80fd5b6101d2610474565b6040516101df9190611263565b60405180910390f35b6101fb6101f63660046112ae565b610504565b005b61021061020b3660046112e0565b610548565b60405190151581526020016101df565b610229600b5481565b6040519081526020016101df565b600254610229565b610229600d5481565b610210610256366004611308565b610561565b60095461026e906001600160a01b031681565b6040516001600160a01b0390911681526020016101df565b604051601281526020016101df565b6101fb6102a33660046112e0565b6105aa565b6102106102b6366004611341565b600a6020525f908152604090205460ff1681565b61026e6102d83660046112ae565b610723565b610229600c5481565b6101fb6102f4366004611341565b61074b565b610229610307366004611341565b6001600160a01b03165f9081526020819052604090205490565b6101fb6108a4565b6101fb61033736600461135a565b6108b7565b61021061034a366004611341565b61091d565b6005546001600160a01b031661026e565b6101d2610983565b6101d26040518060400160405280601281526020017150756c7365436861696e204f7261636c657360701b81525081565b6102106103a73660046112e0565b610992565b6101fb6103ba366004611341565b6109d0565b6101fb6103cd366004611341565b610b8d565b6102296103e0366004611393565b6001600160a01b039182165f90815260016020908152604080832093909416825291909152205490565b610210610418366004611341565b60076020525f908152604090205460ff1681565b6101fb61043a366004611341565b610c24565b6101d26040518060400160405280600381526020016250434f60e81b81525081565b6101fb61046f3660046112ae565b610c61565b606060038054610483906113c4565b80601f01602080910402602001604051908101604052809291908181526020018280546104af906113c4565b80156104fa5780601f106104d1576101008083540402835291602001916104fa565b820191905f5260205f20905b8154815290600101906020018083116104dd57829003601f168201915b5050505050905090565b61050c610d28565b600d8190556040518181527f0c33cdd1eb55835683ae5c126064487d648f6befc66602caa78f53dd7c499671906020015b60405180910390a150565b5f33610555818585610d55565b60019150505b92915050565b5f8061056e858585610d67565b905080801561059557506001600160a01b0385165f908152600a602052604090205460ff16155b156105a2576105a2610d8a565b949350505050565b6009546001600160a01b031633146106205760405162461bcd60e51b815260206004820152602e60248201527f4f6e6c79204f7261636c6520436f6e74726f6c6c65722063616e2063616c6c2060448201526d3a3434b990333ab731ba34b7b71760911b60648201526084015b60405180910390fd5b610628610eb1565b600d548111156106a05760405162461bcd60e51b815260206004820152603960248201527f4f7261636c65546f6b656e3a2043616e6e6f74206d696e74206d6f726520746860448201527f616e20746865206d617820616c6c6f77656420616d6f756e74000000000000006064820152608401610617565b6001600160a01b03821661070b5760405162461bcd60e51b815260206004820152602c60248201527f4f7261636c65546f6b656e3a2043616e6e6f74206d696e7420746f207468652060448201526b7a65726f206164647265737360a01b6064820152608401610617565b6107158282610f0a565b61071f6001600655565b5050565b60088181548110610732575f80fd5b5f918252602090912001546001600160a01b0316905081565b610753610d28565b6001600160a01b0381166107a95760405162461bcd60e51b815260206004820152601b60248201527f4e6f64652063616e6e6f74206265207a65726f206164647265737300000000006044820152606401610617565b6001600160a01b0381165f9081526007602052604090205460ff16156108115760405162461bcd60e51b815260206004820152601760248201527f4e6f646520616c726561647920726567697374657265640000000000000000006044820152606401610617565b6008805460018082019092557ff3f7a9fe364faab93b216da50a3214154f22a0a2b415b23a84c8169e8b636ee30180546001600160a01b0319166001600160a01b0384169081179091555f81815260076020908152604091829020805460ff1916909417909355519081527f564728e6a7c8edd446557d94e0339d5e6ca2e05f42188914efdbdc87bcbbabf6910161053d565b6108ac610d28565b6108b55f610f3e565b565b6108bf610d28565b6001600160a01b0382165f818152600a6020908152604091829020805460ff191685151590811790915591519182527f49bb04c8dc0ee4af5b474122f1889b0fed7b9dfa698c43c0c57c74112e55fcc1910160405180910390a25050565b5f805b60085481101561097b57826001600160a01b031660088281548110610947576109476113fc565b5f918252602090912001546001600160a01b0316036109695750600192915050565b8061097381611424565b915050610920565b505f92915050565b606060048054610483906113c4565b5f8061099e8484610f8f565b90508080156109bc5750335f908152600a602052604090205460ff16155b156109c9576109c9610d8a565b9392505050565b6109d8610d28565b6001600160a01b0381165f9081526007602052604090205460ff16610a355760405162461bcd60e51b8152602060048201526013602482015272139bd919481b9bdd081c9959da5cdd195c9959606a1b6044820152606401610617565b6001600160a01b0381165f908152600760205260408120805460ff191690555b600854811015610b5357816001600160a01b031660088281548110610a7c57610a7c6113fc565b5f918252602090912001546001600160a01b031603610b415760088054610aa59060019061143c565b81548110610ab557610ab56113fc565b5f91825260209091200154600880546001600160a01b039092169183908110610ae057610ae06113fc565b905f5260205f20015f6101000a8154816001600160a01b0302191690836001600160a01b031602179055506008805480610b1c57610b1c61144f565b5f8281526020902081015f1990810180546001600160a01b0319169055019055610b53565b80610b4b81611424565b915050610a55565b506040516001600160a01b03821681527fb1864577e4f285436a80ebc833984755393e2450d58622a65fb4fce87ea3573a9060200161053d565b610b95610d28565b6001600160a01b038116610c025760405162461bcd60e51b815260206004820152602e60248201527f4f7261636c65546f6b656e3a20436f6e74726f6c6c65722063616e6e6f74206260448201526d65207a65726f206164647265737360901b6064820152608401610617565b600980546001600160a01b0319166001600160a01b0392909216919091179055565b610c2c610d28565b6001600160a01b038116610c5557604051631e4fbdf760e01b81525f6004820152602401610617565b610c5e81610f3e565b50565b610c69610d28565b610708811115610cb15760405162461bcd60e51b815260206004820152601360248201527245786365737369766520776169742074696d6560681b6044820152606401610617565b600a811015610cf35760405162461bcd60e51b815260206004820152600e60248201526d15d85a5d081d1bdbc81cda1bdc9d60921b6044820152606401610617565b600c8190556040518181527f19edefce302a2a5a5c73bae9a1c3faa6861e94c0289f28997fdf7c765fb05f7a9060200161053d565b6005546001600160a01b031633146108b55760405163118cdaa760e01b8152336004820152602401610617565b610d628383836001610f9c565b505050565b5f33610d7485828561106f565b610d7f8585856110e4565b506001949350505050565b610d92610eb1565b600c54600b54610da29190611463565b4210610ea7575f805f5b600854811015610e985760075f60088381548110610dcc57610dcc6113fc565b5f9182526020808320909101546001600160a01b0316835282019290925260400190205460ff1615610e865760088181548110610e0b57610e0b6113fc565b5f918252602082200154604080516324ee893160e11b815290516001600160a01b03909216926349dd12629260048084019382900301818387803b158015610e51575f80fd5b505af1925050508015610e62575060015b610e785781610e7081611424565b925050610e86565b82610e8281611424565b9350505b80610e9081611424565b915050610dac565b508115610ea45742600b555b50505b6108b56001600655565b600260065403610f035760405162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c006044820152606401610617565b6002600655565b6001600160a01b038216610f335760405163ec442f0560e01b81525f6004820152602401610617565b61071f5f838361113d565b600580546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0905f90a35050565b5f336105558185856110e4565b6001600160a01b038416610fc55760405163e602df0560e01b81525f6004820152602401610617565b6001600160a01b038316610fee57604051634a1406b160e11b81525f6004820152602401610617565b6001600160a01b038085165f908152600160209081526040808320938716835292905220829055801561106957826001600160a01b0316846001600160a01b03167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9258460405161106091815260200190565b60405180910390a35b50505050565b6001600160a01b038381165f908152600160209081526040808320938616835292905220545f19811461106957818110156110d657604051637dc7a0d960e11b81526001600160a01b03841660048201526024810182905260448101839052606401610617565b61106984848484035f610f9c565b6001600160a01b03831661110d57604051634b637e8f60e11b81525f6004820152602401610617565b6001600160a01b0382166111365760405163ec442f0560e01b81525f6004820152602401610617565b610d628383835b6001600160a01b038316611167578060025f82825461115c9190611463565b909155506111d79050565b6001600160a01b0383165f90815260208190526040902054818110156111b95760405163391434e360e21b81526001600160a01b03851660048201526024810182905260448101839052606401610617565b6001600160a01b0384165f9081526020819052604090209082900390555b6001600160a01b0382166111f357600280548290039055611211565b6001600160a01b0382165f9081526020819052604090208054820190555b816001600160a01b0316836001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8360405161125691815260200190565b60405180910390a3505050565b5f6020808352835180828501525f5b8181101561128e57858101830151858201604001528201611272565b505f604082860101526040601f19601f8301168501019250505092915050565b5f602082840312156112be575f80fd5b5035919050565b80356001600160a01b03811681146112db575f80fd5b919050565b5f80604083850312156112f1575f80fd5b6112fa836112c5565b946020939093013593505050565b5f805f6060848603121561131a575f80fd5b611323846112c5565b9250611331602085016112c5565b9150604084013590509250925092565b5f60208284031215611351575f80fd5b6109c9826112c5565b5f806040838503121561136b575f80fd5b611374836112c5565b915060208301358015158114611388575f80fd5b809150509250929050565b5f80604083850312156113a4575f80fd5b6113ad836112c5565b91506113bb602084016112c5565b90509250929050565b600181811c908216806113d857607f821691505b6020821081036113f657634e487b7160e01b5f52602260045260245ffd5b50919050565b634e487b7160e01b5f52603260045260245ffd5b634e487b7160e01b5f52601160045260245ffd5b5f6001820161143557611435611410565b5060010190565b8181038181111561055b5761055b611410565b634e487b7160e01b5f52603160045260245ffd5b8082018082111561055b5761055b61141056fea2646970667358221220daf004417eea93ec4279e4904b83f4631512530462b969e804249b623be36c1d64736f6c63430008140033
Deployed ByteCode
0x608060405234801561000f575f80fd5b50600436106101c6575f3560e01c806370a08231116100fe578063a9059cbb1161009e578063df6dd6701161006e578063df6dd6701461040a578063f2fde38b1461042c578063f76f8d781461043f578063f9a726ad14610461575f80fd5b8063a9059cbb14610399578063c5e41cf6146103ac578063c703a615146103bf578063dd62ed3e146103d2575f80fd5b80638cc0ebb5116100d95780638cc0ebb51461033c5780638da5cb5b1461034f57806395d89b4114610360578063a3f4df7e14610368575f80fd5b806370a08231146102f9578063715018a6146103215780637dbc3c1914610329575f80fd5b806326a7512d11610169578063524e6b1311610144578063524e6b13146102a857806361ca89fa146102ca57806364bd7013146102dd578063672d7a0d146102e6575f80fd5b806326a7512d1461025b578063313ce5671461028657806340c10f1914610295575f80fd5b806314bcec9f116101a457806314bcec9f1461022057806318160ddd14610237578063239c70ae1461023f57806323b872dd14610248575f80fd5b806306fdde03146101ca578063088a4ed0146101e8578063095ea7b3146101fd575b5f80fd5b6101d2610474565b6040516101df9190611263565b60405180910390f35b6101fb6101f63660046112ae565b610504565b005b61021061020b3660046112e0565b610548565b60405190151581526020016101df565b610229600b5481565b6040519081526020016101df565b600254610229565b610229600d5481565b610210610256366004611308565b610561565b60095461026e906001600160a01b031681565b6040516001600160a01b0390911681526020016101df565b604051601281526020016101df565b6101fb6102a33660046112e0565b6105aa565b6102106102b6366004611341565b600a6020525f908152604090205460ff1681565b61026e6102d83660046112ae565b610723565b610229600c5481565b6101fb6102f4366004611341565b61074b565b610229610307366004611341565b6001600160a01b03165f9081526020819052604090205490565b6101fb6108a4565b6101fb61033736600461135a565b6108b7565b61021061034a366004611341565b61091d565b6005546001600160a01b031661026e565b6101d2610983565b6101d26040518060400160405280601281526020017150756c7365436861696e204f7261636c657360701b81525081565b6102106103a73660046112e0565b610992565b6101fb6103ba366004611341565b6109d0565b6101fb6103cd366004611341565b610b8d565b6102296103e0366004611393565b6001600160a01b039182165f90815260016020908152604080832093909416825291909152205490565b610210610418366004611341565b60076020525f908152604090205460ff1681565b6101fb61043a366004611341565b610c24565b6101d26040518060400160405280600381526020016250434f60e81b81525081565b6101fb61046f3660046112ae565b610c61565b606060038054610483906113c4565b80601f01602080910402602001604051908101604052809291908181526020018280546104af906113c4565b80156104fa5780601f106104d1576101008083540402835291602001916104fa565b820191905f5260205f20905b8154815290600101906020018083116104dd57829003601f168201915b5050505050905090565b61050c610d28565b600d8190556040518181527f0c33cdd1eb55835683ae5c126064487d648f6befc66602caa78f53dd7c499671906020015b60405180910390a150565b5f33610555818585610d55565b60019150505b92915050565b5f8061056e858585610d67565b905080801561059557506001600160a01b0385165f908152600a602052604090205460ff16155b156105a2576105a2610d8a565b949350505050565b6009546001600160a01b031633146106205760405162461bcd60e51b815260206004820152602e60248201527f4f6e6c79204f7261636c6520436f6e74726f6c6c65722063616e2063616c6c2060448201526d3a3434b990333ab731ba34b7b71760911b60648201526084015b60405180910390fd5b610628610eb1565b600d548111156106a05760405162461bcd60e51b815260206004820152603960248201527f4f7261636c65546f6b656e3a2043616e6e6f74206d696e74206d6f726520746860448201527f616e20746865206d617820616c6c6f77656420616d6f756e74000000000000006064820152608401610617565b6001600160a01b03821661070b5760405162461bcd60e51b815260206004820152602c60248201527f4f7261636c65546f6b656e3a2043616e6e6f74206d696e7420746f207468652060448201526b7a65726f206164647265737360a01b6064820152608401610617565b6107158282610f0a565b61071f6001600655565b5050565b60088181548110610732575f80fd5b5f918252602090912001546001600160a01b0316905081565b610753610d28565b6001600160a01b0381166107a95760405162461bcd60e51b815260206004820152601b60248201527f4e6f64652063616e6e6f74206265207a65726f206164647265737300000000006044820152606401610617565b6001600160a01b0381165f9081526007602052604090205460ff16156108115760405162461bcd60e51b815260206004820152601760248201527f4e6f646520616c726561647920726567697374657265640000000000000000006044820152606401610617565b6008805460018082019092557ff3f7a9fe364faab93b216da50a3214154f22a0a2b415b23a84c8169e8b636ee30180546001600160a01b0319166001600160a01b0384169081179091555f81815260076020908152604091829020805460ff1916909417909355519081527f564728e6a7c8edd446557d94e0339d5e6ca2e05f42188914efdbdc87bcbbabf6910161053d565b6108ac610d28565b6108b55f610f3e565b565b6108bf610d28565b6001600160a01b0382165f818152600a6020908152604091829020805460ff191685151590811790915591519182527f49bb04c8dc0ee4af5b474122f1889b0fed7b9dfa698c43c0c57c74112e55fcc1910160405180910390a25050565b5f805b60085481101561097b57826001600160a01b031660088281548110610947576109476113fc565b5f918252602090912001546001600160a01b0316036109695750600192915050565b8061097381611424565b915050610920565b505f92915050565b606060048054610483906113c4565b5f8061099e8484610f8f565b90508080156109bc5750335f908152600a602052604090205460ff16155b156109c9576109c9610d8a565b9392505050565b6109d8610d28565b6001600160a01b0381165f9081526007602052604090205460ff16610a355760405162461bcd60e51b8152602060048201526013602482015272139bd919481b9bdd081c9959da5cdd195c9959606a1b6044820152606401610617565b6001600160a01b0381165f908152600760205260408120805460ff191690555b600854811015610b5357816001600160a01b031660088281548110610a7c57610a7c6113fc565b5f918252602090912001546001600160a01b031603610b415760088054610aa59060019061143c565b81548110610ab557610ab56113fc565b5f91825260209091200154600880546001600160a01b039092169183908110610ae057610ae06113fc565b905f5260205f20015f6101000a8154816001600160a01b0302191690836001600160a01b031602179055506008805480610b1c57610b1c61144f565b5f8281526020902081015f1990810180546001600160a01b0319169055019055610b53565b80610b4b81611424565b915050610a55565b506040516001600160a01b03821681527fb1864577e4f285436a80ebc833984755393e2450d58622a65fb4fce87ea3573a9060200161053d565b610b95610d28565b6001600160a01b038116610c025760405162461bcd60e51b815260206004820152602e60248201527f4f7261636c65546f6b656e3a20436f6e74726f6c6c65722063616e6e6f74206260448201526d65207a65726f206164647265737360901b6064820152608401610617565b600980546001600160a01b0319166001600160a01b0392909216919091179055565b610c2c610d28565b6001600160a01b038116610c5557604051631e4fbdf760e01b81525f6004820152602401610617565b610c5e81610f3e565b50565b610c69610d28565b610708811115610cb15760405162461bcd60e51b815260206004820152601360248201527245786365737369766520776169742074696d6560681b6044820152606401610617565b600a811015610cf35760405162461bcd60e51b815260206004820152600e60248201526d15d85a5d081d1bdbc81cda1bdc9d60921b6044820152606401610617565b600c8190556040518181527f19edefce302a2a5a5c73bae9a1c3faa6861e94c0289f28997fdf7c765fb05f7a9060200161053d565b6005546001600160a01b031633146108b55760405163118cdaa760e01b8152336004820152602401610617565b610d628383836001610f9c565b505050565b5f33610d7485828561106f565b610d7f8585856110e4565b506001949350505050565b610d92610eb1565b600c54600b54610da29190611463565b4210610ea7575f805f5b600854811015610e985760075f60088381548110610dcc57610dcc6113fc565b5f9182526020808320909101546001600160a01b0316835282019290925260400190205460ff1615610e865760088181548110610e0b57610e0b6113fc565b5f918252602082200154604080516324ee893160e11b815290516001600160a01b03909216926349dd12629260048084019382900301818387803b158015610e51575f80fd5b505af1925050508015610e62575060015b610e785781610e7081611424565b925050610e86565b82610e8281611424565b9350505b80610e9081611424565b915050610dac565b508115610ea45742600b555b50505b6108b56001600655565b600260065403610f035760405162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c006044820152606401610617565b6002600655565b6001600160a01b038216610f335760405163ec442f0560e01b81525f6004820152602401610617565b61071f5f838361113d565b600580546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0905f90a35050565b5f336105558185856110e4565b6001600160a01b038416610fc55760405163e602df0560e01b81525f6004820152602401610617565b6001600160a01b038316610fee57604051634a1406b160e11b81525f6004820152602401610617565b6001600160a01b038085165f908152600160209081526040808320938716835292905220829055801561106957826001600160a01b0316846001600160a01b03167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9258460405161106091815260200190565b60405180910390a35b50505050565b6001600160a01b038381165f908152600160209081526040808320938616835292905220545f19811461106957818110156110d657604051637dc7a0d960e11b81526001600160a01b03841660048201526024810182905260448101839052606401610617565b61106984848484035f610f9c565b6001600160a01b03831661110d57604051634b637e8f60e11b81525f6004820152602401610617565b6001600160a01b0382166111365760405163ec442f0560e01b81525f6004820152602401610617565b610d628383835b6001600160a01b038316611167578060025f82825461115c9190611463565b909155506111d79050565b6001600160a01b0383165f90815260208190526040902054818110156111b95760405163391434e360e21b81526001600160a01b03851660048201526024810182905260448101839052606401610617565b6001600160a01b0384165f9081526020819052604090209082900390555b6001600160a01b0382166111f357600280548290039055611211565b6001600160a01b0382165f9081526020819052604090208054820190555b816001600160a01b0316836001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8360405161125691815260200190565b60405180910390a3505050565b5f6020808352835180828501525f5b8181101561128e57858101830151858201604001528201611272565b505f604082860101526040601f19601f8301168501019250505092915050565b5f602082840312156112be575f80fd5b5035919050565b80356001600160a01b03811681146112db575f80fd5b919050565b5f80604083850312156112f1575f80fd5b6112fa836112c5565b946020939093013593505050565b5f805f6060848603121561131a575f80fd5b611323846112c5565b9250611331602085016112c5565b9150604084013590509250925092565b5f60208284031215611351575f80fd5b6109c9826112c5565b5f806040838503121561136b575f80fd5b611374836112c5565b915060208301358015158114611388575f80fd5b809150509250929050565b5f80604083850312156113a4575f80fd5b6113ad836112c5565b91506113bb602084016112c5565b90509250929050565b600181811c908216806113d857607f821691505b6020821081036113f657634e487b7160e01b5f52602260045260245ffd5b50919050565b634e487b7160e01b5f52603260045260245ffd5b634e487b7160e01b5f52601160045260245ffd5b5f6001820161143557611435611410565b5060010190565b8181038181111561055b5761055b611410565b634e487b7160e01b5f52603160045260245ffd5b8082018082111561055b5761055b61141056fea2646970667358221220daf004417eea93ec4279e4904b83f4631512530462b969e804249b623be36c1d64736f6c63430008140033