ERC-20
Overview
Max Total Supply
420,500 WORK
Holders
52
Market
Price
$0.00 @ 0.000000 APE
Onchain Market Cap
$0.00
Circulating Supply Market Cap
-
Other Info
Token Contract (WITH 18 Decimals)
Loading...
Loading
Loading...
Loading
Loading...
Loading
Contract Source Code Verified (Exact Match)
Contract Name:
ProofOfApe
Compiler Version
v0.8.28+commit.7893614a
Optimization Enabled:
Yes with 200 runs
Other Settings:
cancun EvmVersion
Contract Source Code (Solidity Standard Json-Input format)
// SPDX-License-Identifier: MIT pragma solidity ^0.8.28; import "@openzeppelin/contracts/token/ERC20/ERC20.sol"; import "./Tag.sol"; /// @notice A struct to store block data including the miner's address and a message. struct BlockData { address miner; string data; } /// @title ProofOfWorkCoin /// @dev An ERC20 token that can be minted by providing proof-of-work. contract ProofOfApe is ERC20 { /// @notice The initial difficulty target for minting. uint256 public constant START_DIFFICULTY = 1; /// @notice The maximum possible value for the difficulty target. uint256 public constant MAXIMUM_TARGET = type(uint256).max; /// @notice The target time period between difficulty adjustments uint256 public constant TARGET_TIME = 2 weeks; /// @notice The initial reward for minting a block. uint256 public constant REWARD_START = 50 ether; /// @notice The number of blocks after which the minting reward is halved. uint256 public constant HALVING_INTERVAL = 210_000; /// @notice The current difficulty target for minting. uint256 public difficulty; /// @notice The current block height. uint256 public blockHeight = 0; /// @notice The timestamp at the start of the current difficulty period. uint256 public difficultyStartTime; /// @notice The hash of the last block that was minted. bytes32 public lastBlockHash; /// @notice The current reward for minting a block. uint256 public reward; /// @notice The current target for difficulty validation. uint256 public target; /// @notice A mapping from block height to the block data. mapping(uint256 => BlockData) public blockData; /// @notice Emitted when a new block is minted. /// @param miner The address of the miner who minted the new block. /// @param difficulty The difficulty target for the new block. /// @param blockHeight The height of the new block. /// @param hash The hash of the new block. event Mined( address indexed miner, uint256 difficulty, uint256 blockHeight, uint256 hash ); /// @dev Sets the initial difficulty and start timestamp for the current difficulty period when the contract is deployed. constructor() ERC20("Proof of Ape", "WORK") { difficulty = START_DIFFICULTY; difficultyStartTime = block.timestamp; reward = REWARD_START; target = MAXIMUM_TARGET; } /// @notice Mint new tokens by providing a nonce that satisfies the current difficulty target. /// @dev This function requires that the hash of the sender's address, the provided nonce, and the hash of the last block is less than the maximum possible value divided by the current difficulty. /// @param _nonce The nonce to be used for minting. /// @param _miner The miner's address. function _mine(uint256 _nonce, address _miner) private { bytes32 hash = keccak256( abi.encodePacked(_miner, _nonce, lastBlockHash) ); require( uint256(hash) < target, "mine: hash does not meet difficulty requirement" ); _mint(_miner, reward); emit Mined(_miner, difficulty, blockHeight, uint256(hash)); blockHeight++; lastBlockHash = hash; if (blockHeight % 2016 == 0) { _adjustDifficulty(); difficultyStartTime = block.timestamp; target = MAXIMUM_TARGET / difficulty; } if (blockHeight % HALVING_INTERVAL == 0) { reward >>= 1; } } /// @dev Allows any user to mine new tokens and adds a message to the block data. /// @param _nonce The nonce to be used for minting. /// @param _data The message to be added to the block data. function mine(uint256 _nonce, string calldata _data) public { require(bytes(_data).length <= 256, "mine: data exceeds maximum length of 256 characters"); _mine(_nonce, msg.sender); blockData[blockHeight] = BlockData({miner: msg.sender, data: _data}); } /// @notice Adjusts the mining difficulty based on the elapsed time. /// @dev This function calculates the new difficulty based on the target time period and the actual elapsed time since the start of the current difficulty period. If blocks were minted too quickly, the difficulty increases. If they were minted too slowly, the difficulty decreases. function _adjustDifficulty() private { uint256 elapsed = block.timestamp - difficultyStartTime; uint256 newDifficulty = (difficulty * TARGET_TIME) / elapsed; if (newDifficulty == 0){ newDifficulty = 1; } difficulty = newDifficulty; } function returnHash( address _address, uint256 _nonce, uint256 _hash ) external pure returns (bytes32) { return keccak256(abi.encodePacked(_address, _nonce, _hash)); } }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.28; // ---------------[ ]--------------- // -------[ ]-------------[ ]------- // --------------------------------- // ----[ ]--------[ ]--------[ ]---- // --------------------------------- // -------[ ]-------------[ ]------- //
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v5.0.1) (utils/Context.sol) pragma solidity ^0.8.20; /** * @dev Provides information about the current execution context, including the * sender of the transaction and its data. While these are generally available * via msg.sender and msg.data, they should not be accessed in such a direct * manner, since when dealing with meta-transactions the account sending and * paying for execution may not be the actual sender (as far as an application * is concerned). * * This contract is only required for intermediate, library-like contracts. */ abstract contract Context { function _msgSender() internal view virtual returns (address) { return msg.sender; } function _msgData() internal view virtual returns (bytes calldata) { return msg.data; } function _contextSuffixLength() internal view virtual returns (uint256) { return 0; } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v5.1.0) (token/ERC20/extensions/IERC20Metadata.sol) pragma solidity ^0.8.20; import {IERC20} from "../IERC20.sol"; /** * @dev Interface for the optional metadata functions from the ERC-20 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); }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v5.1.0) (token/ERC20/IERC20.sol) pragma solidity ^0.8.20; /** * @dev Interface of the ERC-20 standard as defined in the ERC. */ 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); }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v5.1.0) (token/ERC20/ERC20.sol) pragma solidity ^0.8.20; import {IERC20} from "./IERC20.sol"; import {IERC20Metadata} from "./extensions/IERC20Metadata.sol"; import {Context} from "../../utils/Context.sol"; import {IERC20Errors} from "../../interfaces/draft-IERC6093.sol"; /** * @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 ERC-20 * applications. */ 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}. * * Skips emitting an {Approval} event indicating an allowance update. This is not * required by the ERC. See {xref-ERC20-_approve-address-address-uint256-bool-}[_approve]. * * 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: * * ```solidity * 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); } } } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v5.1.0) (interfaces/draft-IERC6093.sol) pragma solidity ^0.8.20; /** * @dev Standard ERC-20 Errors * Interface of the https://eips.ethereum.org/EIPS/eip-6093[ERC-6093] custom errors for ERC-20 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 ERC-721 Errors * Interface of the https://eips.ethereum.org/EIPS/eip-6093[ERC-6093] custom errors for ERC-721 tokens. */ interface IERC721Errors { /** * @dev Indicates that an address can't be an owner. For example, `address(0)` is a forbidden owner in ERC-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 ERC-1155 Errors * Interface of the https://eips.ethereum.org/EIPS/eip-6093[ERC-6093] custom errors for ERC-1155 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); }
{ "remappings": [], "optimizer": { "enabled": true, "runs": 200 }, "evmVersion": "cancun", "libraries": {}, "outputSelection": { "*": { "*": [ "evm.bytecode", "evm.deployedBytecode", "devdoc", "userdoc", "metadata", "abi" ] } } }
Contract Security Audit
- No Contract Security Audit Submitted- Submit Audit Here
[{"inputs":[],"stateMutability":"nonpayable","type":"constructor"},{"inputs":[{"internalType":"address","name":"spender","type":"address"},{"internalType":"uint256","name":"allowance","type":"uint256"},{"internalType":"uint256","name":"needed","type":"uint256"}],"name":"ERC20InsufficientAllowance","type":"error"},{"inputs":[{"internalType":"address","name":"sender","type":"address"},{"internalType":"uint256","name":"balance","type":"uint256"},{"internalType":"uint256","name":"needed","type":"uint256"}],"name":"ERC20InsufficientBalance","type":"error"},{"inputs":[{"internalType":"address","name":"approver","type":"address"}],"name":"ERC20InvalidApprover","type":"error"},{"inputs":[{"internalType":"address","name":"receiver","type":"address"}],"name":"ERC20InvalidReceiver","type":"error"},{"inputs":[{"internalType":"address","name":"sender","type":"address"}],"name":"ERC20InvalidSender","type":"error"},{"inputs":[{"internalType":"address","name":"spender","type":"address"}],"name":"ERC20InvalidSpender","type":"error"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"owner","type":"address"},{"indexed":true,"internalType":"address","name":"spender","type":"address"},{"indexed":false,"internalType":"uint256","name":"value","type":"uint256"}],"name":"Approval","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"miner","type":"address"},{"indexed":false,"internalType":"uint256","name":"difficulty","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"blockHeight","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"hash","type":"uint256"}],"name":"Mined","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"from","type":"address"},{"indexed":true,"internalType":"address","name":"to","type":"address"},{"indexed":false,"internalType":"uint256","name":"value","type":"uint256"}],"name":"Transfer","type":"event"},{"inputs":[],"name":"HALVING_INTERVAL","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"MAXIMUM_TARGET","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"REWARD_START","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"START_DIFFICULTY","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"TARGET_TIME","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"},{"internalType":"address","name":"spender","type":"address"}],"name":"allowance","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"spender","type":"address"},{"internalType":"uint256","name":"value","type":"uint256"}],"name":"approve","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"account","type":"address"}],"name":"balanceOf","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"blockData","outputs":[{"internalType":"address","name":"miner","type":"address"},{"internalType":"string","name":"data","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"blockHeight","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"decimals","outputs":[{"internalType":"uint8","name":"","type":"uint8"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"difficulty","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"difficultyStartTime","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"lastBlockHash","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_nonce","type":"uint256"},{"internalType":"string","name":"_data","type":"string"}],"name":"mine","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"name","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_address","type":"address"},{"internalType":"uint256","name":"_nonce","type":"uint256"},{"internalType":"uint256","name":"_hash","type":"uint256"}],"name":"returnHash","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"pure","type":"function"},{"inputs":[],"name":"reward","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"symbol","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"target","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"totalSupply","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"value","type":"uint256"}],"name":"transfer","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"value","type":"uint256"}],"name":"transferFrom","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"}]
Contract Creation Code
60806040525f600655348015610013575f5ffd5b506040518060400160405280600c81526020016b50726f6f66206f662041706560a01b81525060405180604001604052806004815260200163574f524b60e01b8152508160039081610065919061012d565b506004610072828261012d565b5050600160055550426007556802b5e3af16b18800006009555f19600a556101e7565b634e487b7160e01b5f52604160045260245ffd5b600181811c908216806100bd57607f821691505b6020821081036100db57634e487b7160e01b5f52602260045260245ffd5b50919050565b601f82111561012857805f5260205f20601f840160051c810160208510156101065750805b601f840160051c820191505b81811015610125575f8155600101610112565b50505b505050565b81516001600160401b0381111561014657610146610095565b61015a8161015484546100a9565b846100e1565b6020601f82116001811461018c575f83156101755750848201515b5f19600385901b1c1916600184901b178455610125565b5f84815260208120601f198516915b828110156101bb578785015182556020948501946001909201910161019b565b50848210156101d857868401515f19600387901b60f8161c191681555b50505050600190811b01905550565b610ee8806101f45f395ff3fe608060405234801561000f575f5ffd5b5060043610610148575f3560e01c806370a08231116100bf578063aa54869711610079578063aa54869714610278578063be31832b14610288578063d4b8399214610292578063dd62ed3e1461029b578063e2f5816e146102d3578063f44ff7121461032f575f5ffd5b806370a08231146101f75780637e21c28b1461021f578063880b51631461024057806395d89b4114610255578063a636fe7f1461025d578063a9059cbb14610265575f5ffd5b806319cae4621161011057806319cae462146101b0578063228cb733146101b957806323b872dd146101c2578063313ce567146101d55780635c0ecfad146101e45780635fd9491d146101ed575f5ffd5b8063031052f31461014c57806304420cef1461016757806306fdde0314610170578063095ea7b31461018557806318160ddd146101a8575b5f5ffd5b6101545f1981565b6040519081526020015b60405180910390f35b61015460075481565b610178610338565b60405161015e9190610af4565b610198610193366004610b28565b6103c8565b604051901515815260200161015e565b600254610154565b61015460055481565b61015460095481565b6101986101d0366004610b50565b6103e1565b6040516012815260200161015e565b61015460085481565b6101546203345081565b610154610205366004610b8a565b6001600160a01b03165f9081526020819052604090205490565b61023261022d366004610ba3565b610404565b60405161015e929190610bba565b61025361024e366004610be5565b6104b0565b005b6101786105c9565b610154600181565b610198610273366004610b28565b6105d8565b6101546802b5e3af16b188000081565b6101546212750081565b610154600a5481565b6101546102a9366004610c5c565b6001600160a01b039182165f90815260016020908152604080832093909416825291909152205490565b6101546102e1366004610c8d565b6040516bffffffffffffffffffffffff19606085901b16602082015260348101839052605481018290525f906074016040516020818303038152906040528051906020012090509392505050565b61015460065481565b60606003805461034790610cbd565b80601f016020809104026020016040519081016040528092919081815260200182805461037390610cbd565b80156103be5780601f10610395576101008083540402835291602001916103be565b820191905f5260205f20905b8154815290600101906020018083116103a157829003601f168201915b5050505050905090565b5f336103d58185856105e5565b60019150505b92915050565b5f336103ee8582856105f7565b6103f9858585610672565b506001949350505050565b600b6020525f9081526040902080546001820180546001600160a01b03909216929161042f90610cbd565b80601f016020809104026020016040519081016040528092919081815260200182805461045b90610cbd565b80156104a65780601f1061047d576101008083540402835291602001916104a6565b820191905f5260205f20905b81548152906001019060200180831161048957829003601f168201915b5050505050905082565b6101008111156105235760405162461bcd60e51b815260206004820152603360248201527f6d696e653a20646174612065786365656473206d6178696d756d206c656e677460448201527268206f6620323536206368617261637465727360681b60648201526084015b60405180910390fd5b61052d83336106cf565b6040518060400160405280336001600160a01b0316815260200183838080601f0160208091040260200160405190810160405280939291908181526020018383808284375f9201829052509390945250506006548152600b60209081526040909120835181546001600160a01b0319166001600160a01b039091161781559083015190915060018201906105c19082610d54565b505050505050565b60606004805461034790610cbd565b5f336103d5818585610672565b6105f28383836001610855565b505050565b6001600160a01b038381165f908152600160209081526040808320938616835292905220545f19811461066c578181101561065e57604051637dc7a0d960e11b81526001600160a01b0384166004820152602481018290526044810183905260640161051a565b61066c84848484035f610855565b50505050565b6001600160a01b03831661069b57604051634b637e8f60e11b81525f600482015260240161051a565b6001600160a01b0382166106c45760405163ec442f0560e01b81525f600482015260240161051a565b6105f2838383610927565b6008546040516bffffffffffffffffffffffff19606084901b1660208201526034810184905260548101919091525f90607401604051602081830303815290604052805190602001209050600a54815f1c106107855760405162461bcd60e51b815260206004820152602f60248201527f6d696e653a206861736820646f6573206e6f74206d656574206469666669637560448201526e1b1d1e481c995c5d5a5c995b595b9d608a1b606482015260840161051a565b61079182600954610a4d565b60055460065460408051928352602083019190915281018290526001600160a01b038316907f94b5f8ac81f2e6e11c2d087499a0122e51fdfb3a8e07760065141257418cbe269060600160405180910390a260068054905f6107f283610e23565b9091555050600881905560065461080c906107e090610e4f565b5f036108305761081a610a85565b4260075560055461082c905f19610e62565b600a555b620334506006546108419190610e4f565b5f036105f2576009805460011c9055505050565b6001600160a01b03841661087e5760405163e602df0560e01b81525f600482015260240161051a565b6001600160a01b0383166108a757604051634a1406b160e11b81525f600482015260240161051a565b6001600160a01b038085165f908152600160209081526040808320938716835292905220829055801561066c57826001600160a01b0316846001600160a01b03167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9258460405161091991815260200190565b60405180910390a350505050565b6001600160a01b038316610951578060025f8282546109469190610e75565b909155506109c19050565b6001600160a01b0383165f90815260208190526040902054818110156109a35760405163391434e360e21b81526001600160a01b0385166004820152602481018290526044810183905260640161051a565b6001600160a01b0384165f9081526020819052604090209082900390555b6001600160a01b0382166109dd576002805482900390556109fb565b6001600160a01b0382165f9081526020819052604090208054820190555b816001600160a01b0316836001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef83604051610a4091815260200190565b60405180910390a3505050565b6001600160a01b038216610a765760405163ec442f0560e01b81525f600482015260240161051a565b610a815f8383610927565b5050565b5f60075442610a949190610e88565b90505f8162127500600554610aa99190610e9b565b610ab39190610e62565b9050805f03610ac0575060015b60055550565b5f81518084528060208401602086015e5f602082860101526020601f19601f83011685010191505092915050565b602081525f610b066020830184610ac6565b9392505050565b80356001600160a01b0381168114610b23575f5ffd5b919050565b5f5f60408385031215610b39575f5ffd5b610b4283610b0d565b946020939093013593505050565b5f5f5f60608486031215610b62575f5ffd5b610b6b84610b0d565b9250610b7960208501610b0d565b929592945050506040919091013590565b5f60208284031215610b9a575f5ffd5b610b0682610b0d565b5f60208284031215610bb3575f5ffd5b5035919050565b6001600160a01b03831681526040602082018190525f90610bdd90830184610ac6565b949350505050565b5f5f5f60408486031215610bf7575f5ffd5b83359250602084013567ffffffffffffffff811115610c14575f5ffd5b8401601f81018613610c24575f5ffd5b803567ffffffffffffffff811115610c3a575f5ffd5b866020828401011115610c4b575f5ffd5b939660209190910195509293505050565b5f5f60408385031215610c6d575f5ffd5b610c7683610b0d565b9150610c8460208401610b0d565b90509250929050565b5f5f5f60608486031215610c9f575f5ffd5b610ca884610b0d565b95602085013595506040909401359392505050565b600181811c90821680610cd157607f821691505b602082108103610cef57634e487b7160e01b5f52602260045260245ffd5b50919050565b634e487b7160e01b5f52604160045260245ffd5b601f8211156105f257805f5260205f20601f840160051c81016020851015610d2e5750805b601f840160051c820191505b81811015610d4d575f8155600101610d3a565b5050505050565b815167ffffffffffffffff811115610d6e57610d6e610cf5565b610d8281610d7c8454610cbd565b84610d09565b6020601f821160018114610db4575f8315610d9d5750848201515b5f19600385901b1c1916600184901b178455610d4d565b5f84815260208120601f198516915b82811015610de35787850151825560209485019460019092019101610dc3565b5084821015610e0057868401515f19600387901b60f8161c191681555b50505050600190811b01905550565b634e487b7160e01b5f52601160045260245ffd5b5f60018201610e3457610e34610e0f565b5060010190565b634e487b7160e01b5f52601260045260245ffd5b5f82610e5d57610e5d610e3b565b500690565b5f82610e7057610e70610e3b565b500490565b808201808211156103db576103db610e0f565b818103818111156103db576103db610e0f565b80820281158282048414176103db576103db610e0f56fea2646970667358221220967c2a769ac9573568260b1fc2084a630edabf78d337762a401f0dfd88e22dc964736f6c634300081c0033
Deployed Bytecode
0x608060405234801561000f575f5ffd5b5060043610610148575f3560e01c806370a08231116100bf578063aa54869711610079578063aa54869714610278578063be31832b14610288578063d4b8399214610292578063dd62ed3e1461029b578063e2f5816e146102d3578063f44ff7121461032f575f5ffd5b806370a08231146101f75780637e21c28b1461021f578063880b51631461024057806395d89b4114610255578063a636fe7f1461025d578063a9059cbb14610265575f5ffd5b806319cae4621161011057806319cae462146101b0578063228cb733146101b957806323b872dd146101c2578063313ce567146101d55780635c0ecfad146101e45780635fd9491d146101ed575f5ffd5b8063031052f31461014c57806304420cef1461016757806306fdde0314610170578063095ea7b31461018557806318160ddd146101a8575b5f5ffd5b6101545f1981565b6040519081526020015b60405180910390f35b61015460075481565b610178610338565b60405161015e9190610af4565b610198610193366004610b28565b6103c8565b604051901515815260200161015e565b600254610154565b61015460055481565b61015460095481565b6101986101d0366004610b50565b6103e1565b6040516012815260200161015e565b61015460085481565b6101546203345081565b610154610205366004610b8a565b6001600160a01b03165f9081526020819052604090205490565b61023261022d366004610ba3565b610404565b60405161015e929190610bba565b61025361024e366004610be5565b6104b0565b005b6101786105c9565b610154600181565b610198610273366004610b28565b6105d8565b6101546802b5e3af16b188000081565b6101546212750081565b610154600a5481565b6101546102a9366004610c5c565b6001600160a01b039182165f90815260016020908152604080832093909416825291909152205490565b6101546102e1366004610c8d565b6040516bffffffffffffffffffffffff19606085901b16602082015260348101839052605481018290525f906074016040516020818303038152906040528051906020012090509392505050565b61015460065481565b60606003805461034790610cbd565b80601f016020809104026020016040519081016040528092919081815260200182805461037390610cbd565b80156103be5780601f10610395576101008083540402835291602001916103be565b820191905f5260205f20905b8154815290600101906020018083116103a157829003601f168201915b5050505050905090565b5f336103d58185856105e5565b60019150505b92915050565b5f336103ee8582856105f7565b6103f9858585610672565b506001949350505050565b600b6020525f9081526040902080546001820180546001600160a01b03909216929161042f90610cbd565b80601f016020809104026020016040519081016040528092919081815260200182805461045b90610cbd565b80156104a65780601f1061047d576101008083540402835291602001916104a6565b820191905f5260205f20905b81548152906001019060200180831161048957829003601f168201915b5050505050905082565b6101008111156105235760405162461bcd60e51b815260206004820152603360248201527f6d696e653a20646174612065786365656473206d6178696d756d206c656e677460448201527268206f6620323536206368617261637465727360681b60648201526084015b60405180910390fd5b61052d83336106cf565b6040518060400160405280336001600160a01b0316815260200183838080601f0160208091040260200160405190810160405280939291908181526020018383808284375f9201829052509390945250506006548152600b60209081526040909120835181546001600160a01b0319166001600160a01b039091161781559083015190915060018201906105c19082610d54565b505050505050565b60606004805461034790610cbd565b5f336103d5818585610672565b6105f28383836001610855565b505050565b6001600160a01b038381165f908152600160209081526040808320938616835292905220545f19811461066c578181101561065e57604051637dc7a0d960e11b81526001600160a01b0384166004820152602481018290526044810183905260640161051a565b61066c84848484035f610855565b50505050565b6001600160a01b03831661069b57604051634b637e8f60e11b81525f600482015260240161051a565b6001600160a01b0382166106c45760405163ec442f0560e01b81525f600482015260240161051a565b6105f2838383610927565b6008546040516bffffffffffffffffffffffff19606084901b1660208201526034810184905260548101919091525f90607401604051602081830303815290604052805190602001209050600a54815f1c106107855760405162461bcd60e51b815260206004820152602f60248201527f6d696e653a206861736820646f6573206e6f74206d656574206469666669637560448201526e1b1d1e481c995c5d5a5c995b595b9d608a1b606482015260840161051a565b61079182600954610a4d565b60055460065460408051928352602083019190915281018290526001600160a01b038316907f94b5f8ac81f2e6e11c2d087499a0122e51fdfb3a8e07760065141257418cbe269060600160405180910390a260068054905f6107f283610e23565b9091555050600881905560065461080c906107e090610e4f565b5f036108305761081a610a85565b4260075560055461082c905f19610e62565b600a555b620334506006546108419190610e4f565b5f036105f2576009805460011c9055505050565b6001600160a01b03841661087e5760405163e602df0560e01b81525f600482015260240161051a565b6001600160a01b0383166108a757604051634a1406b160e11b81525f600482015260240161051a565b6001600160a01b038085165f908152600160209081526040808320938716835292905220829055801561066c57826001600160a01b0316846001600160a01b03167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9258460405161091991815260200190565b60405180910390a350505050565b6001600160a01b038316610951578060025f8282546109469190610e75565b909155506109c19050565b6001600160a01b0383165f90815260208190526040902054818110156109a35760405163391434e360e21b81526001600160a01b0385166004820152602481018290526044810183905260640161051a565b6001600160a01b0384165f9081526020819052604090209082900390555b6001600160a01b0382166109dd576002805482900390556109fb565b6001600160a01b0382165f9081526020819052604090208054820190555b816001600160a01b0316836001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef83604051610a4091815260200190565b60405180910390a3505050565b6001600160a01b038216610a765760405163ec442f0560e01b81525f600482015260240161051a565b610a815f8383610927565b5050565b5f60075442610a949190610e88565b90505f8162127500600554610aa99190610e9b565b610ab39190610e62565b9050805f03610ac0575060015b60055550565b5f81518084528060208401602086015e5f602082860101526020601f19601f83011685010191505092915050565b602081525f610b066020830184610ac6565b9392505050565b80356001600160a01b0381168114610b23575f5ffd5b919050565b5f5f60408385031215610b39575f5ffd5b610b4283610b0d565b946020939093013593505050565b5f5f5f60608486031215610b62575f5ffd5b610b6b84610b0d565b9250610b7960208501610b0d565b929592945050506040919091013590565b5f60208284031215610b9a575f5ffd5b610b0682610b0d565b5f60208284031215610bb3575f5ffd5b5035919050565b6001600160a01b03831681526040602082018190525f90610bdd90830184610ac6565b949350505050565b5f5f5f60408486031215610bf7575f5ffd5b83359250602084013567ffffffffffffffff811115610c14575f5ffd5b8401601f81018613610c24575f5ffd5b803567ffffffffffffffff811115610c3a575f5ffd5b866020828401011115610c4b575f5ffd5b939660209190910195509293505050565b5f5f60408385031215610c6d575f5ffd5b610c7683610b0d565b9150610c8460208401610b0d565b90509250929050565b5f5f5f60608486031215610c9f575f5ffd5b610ca884610b0d565b95602085013595506040909401359392505050565b600181811c90821680610cd157607f821691505b602082108103610cef57634e487b7160e01b5f52602260045260245ffd5b50919050565b634e487b7160e01b5f52604160045260245ffd5b601f8211156105f257805f5260205f20601f840160051c81016020851015610d2e5750805b601f840160051c820191505b81811015610d4d575f8155600101610d3a565b5050505050565b815167ffffffffffffffff811115610d6e57610d6e610cf5565b610d8281610d7c8454610cbd565b84610d09565b6020601f821160018114610db4575f8315610d9d5750848201515b5f19600385901b1c1916600184901b178455610d4d565b5f84815260208120601f198516915b82811015610de35787850151825560209485019460019092019101610dc3565b5084821015610e0057868401515f19600387901b60f8161c191681555b50505050600190811b01905550565b634e487b7160e01b5f52601160045260245ffd5b5f60018201610e3457610e34610e0f565b5060010190565b634e487b7160e01b5f52601260045260245ffd5b5f82610e5d57610e5d610e3b565b500690565b5f82610e7057610e70610e3b565b500490565b808201808211156103db576103db610e0f565b818103818111156103db576103db610e0f565b80820281158282048414176103db576103db610e0f56fea2646970667358221220967c2a769ac9573568260b1fc2084a630edabf78d337762a401f0dfd88e22dc964736f6c634300081c0033
[ Download: CSV Export ]
[ Download: CSV Export ]
A token is a representation of an on-chain or off-chain asset. The token page shows information such as price, total supply, holders, transfers and social links. Learn more about this page in our Knowledge Base.