Address io10hwxttfacrjzawyrdwvdk6648cvym4v08z0yvu

Contract Overview

Balance:
0 IOTX

IOTX Value:
$ 0

Token:
Txn Hash
Block
From
To
Value [Txn Fee]
Parent Txn Hash Block From To Value
Loading

Contract Source Code Verified (Exact Match)

Contract Name:
DepinRC20

Compiler Version
v0.8.19+commit.7dd6d404

Optimization Enabled:
No with 200 runs

Other Settings:
default evmVersion, None license
File 1 of 7: Context.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (token/ERC20/IERC20.sol)

pragma solidity ^0.8.19;

/**
 * @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;
    }
}

File 2 of 7: DepinRC20.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (token/ERC20/IERC20.sol)

pragma solidity ^0.8.19;

import "./ERC20.sol";

contract DepinRC20 is ERC20 {
    uint256 constant bn254Prime = 21888242871839275222246405745257275088548364400416034343698204186575808495617;

    uint256 public difficulty;
    uint256 public limitPerMint;
    uint256 public challenge;
    uint256 public totalSupplyCap;
    uint256 public miningLimit;
    uint8 private _decimals;

    address public verifier;
    bytes32 public difficultyFr;
    bytes32 public depinRCFr;

    mapping(address => uint256) public miningTimes;
    mapping(address => mapping(uint256 => bool)) public minedNonces;

    constructor(
        string memory name,
        string memory symbol,
        uint256 _initialSupply,
        uint8 _decimals_,
        uint256 _difficulty,
        uint256 _miningLimit,
        uint256 _initialLimitPerMint,
        address _verifier
    ) ERC20(name, symbol) {
        _decimals = _decimals_;
        difficulty = _difficulty;
        limitPerMint = _initialLimitPerMint * (10 ** uint256(_decimals));
        challenge = block.timestamp;
        totalSupplyCap = _initialSupply * (10 ** uint256(_decimals));
        miningLimit = _miningLimit;
        verifier = _verifier;

        depinRCFr = uint256ToFr(uint256(uint160(address(this))));
        difficultyFr = uint256ToFr(~uint256(0) >> difficulty);
    }

    function mine(uint256 nonce, address sender, bytes calldata proof) public {
        require(miningTimes[sender] < miningLimit, "Mining limit reached");
        require(
            totalSupply() + limitPerMint <= totalSupplyCap,
            "Total supply cap exceeded"
        );
        require(
            !minedNonces[sender][nonce],
            "Nonce already used for mining"
        );

        bytes32 senderFr = uint256ToFr(uint256(uint160(sender)));
        bytes32 nonceFr = uint256ToFr(nonce);
        bytes memory callData = abi.encodePacked(difficultyFr, depinRCFr, senderFr, nonceFr, proof);

        (bool success,) = verifier.staticcall(callData);
        require(success, "Failed to verify proof");

        _mint(sender, limitPerMint);

        miningTimes[sender]++;
        minedNonces[sender][nonce] = true;
    }

    function uint256ToFr(uint256 _value) public pure returns (bytes32) {
        return bytes32(_value % bn254Prime);
    }

    function transfer(
        address to,
        uint256 amount
    ) public override returns (bool) {
        require(
            totalSupply() >= totalSupplyCap,
            "Transfer not allowed until max supply is reached"
        );
        return super.transfer(to, amount);
    }

    function decimals() public view virtual override returns (uint8) {
        return _decimals;
    }

    function getLimitPerMint() public view returns (uint256) {
        return limitPerMint;
    }

    function getRemainingSupply() public view returns (uint256) {
        return totalSupplyCap - totalSupply();
    }
}

File 3 of 7: DepinRC20Factory.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (token/ERC20/IERC20.sol)

pragma solidity ^0.8.19;

import "./DepinRC20.sol";

contract DepinRC20Factory {
    event DepinRC20Created(address newContractAddress);

    address[] public allContracts;

    function createPoWERC20(
        string memory name,
        string memory symbol,
        uint256 _initialSupply,
        uint8 _decimals,
        uint256 _difficulty,
        uint256 _miningLimit,
        uint256 _initialLimitPerMint,
        address _verifier
    ) public returns (address) {
        DepinRC20 newContract = new DepinRC20(
            name,
            symbol,
            _initialSupply,
            _decimals,
            _difficulty,
            _miningLimit,
            _initialLimitPerMint,
            _verifier
        );
        allContracts.push(address(newContract));
        emit DepinRC20Created(address(newContract));
        return address(newContract);
    }

    function getTotalCreatedContracts() public view returns (uint256) {
        return allContracts.length;
    }

    function getAllContracts() public view returns (address[] memory) {
        return allContracts;
    }
}

File 4 of 7: draft-IERC6093.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (interfaces/draft-IERC6093.sol)

pragma solidity ^0.8.19;

/**
 * @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 5 of 7: ERC20.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (token/ERC20/IERC20.sol)

pragma solidity ^0.8.19;

import {IERC20} from "../IERC20.sol";
import {IERC20Metadata} from "../IERC20Metadata.sol";
import {Context} from "../Context.sol";
import {IERC20Errors} from "../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 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 6 of 7: IERC20.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (token/ERC20/IERC20.sol)

pragma solidity ^0.8.19;

/**
 * @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 7 of 7: IERC20Metadata.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (token/ERC20/IERC20.sol)

pragma solidity ^0.8.19;

import {IERC20} from "../IERC20.sol";

/**
 * @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);
}

Contract ABI

[{"inputs":[{"internalType":"string","name":"name","type":"string"},{"internalType":"string","name":"symbol","type":"string"},{"internalType":"uint256","name":"_initialSupply","type":"uint256"},{"internalType":"uint8","name":"_decimals_","type":"uint8"},{"internalType":"uint256","name":"_difficulty","type":"uint256"},{"internalType":"uint256","name":"_miningLimit","type":"uint256"},{"internalType":"uint256","name":"_initialLimitPerMint","type":"uint256"},{"internalType":"address","name":"_verifier","type":"address"}],"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":"from","type":"address"},{"indexed":true,"internalType":"address","name":"to","type":"address"},{"indexed":false,"internalType":"uint256","name":"value","type":"uint256"}],"name":"Transfer","type":"event"},{"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":[],"name":"challenge","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":"depinRCFr","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"difficulty","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"difficultyFr","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getLimitPerMint","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getRemainingSupply","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"limitPerMint","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"nonce","type":"uint256"},{"internalType":"address","name":"sender","type":"address"},{"internalType":"bytes","name":"proof","type":"bytes"}],"name":"mine","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"},{"internalType":"uint256","name":"","type":"uint256"}],"name":"minedNonces","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"miningLimit","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"miningTimes","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"name","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"symbol","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"totalSupply","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"totalSupplyCap","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"amount","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"},{"inputs":[{"internalType":"uint256","name":"_value","type":"uint256"}],"name":"uint256ToFr","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"pure","type":"function"},{"inputs":[],"name":"verifier","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"}]

Contract Creation Code

608060405234801561001057600080fd5b506004361061014d5760003560e01c806370a08231116100c3578063bd2284861161007c578063bd228486146103ba578063c2651503146103ea578063d2ef739814610408578063dd62ed3e14610426578063e2ce9f5114610456578063e4b7fb73146104745761014d565b806370a08231146102e2578063851f270d1461031257806395d89b4114610330578063a9059cbb1461034e578063b32e82c01461037e578063bb102aea1461039c5761014d565b806323b872dd1161011557806323b872dd146101f85780632719881e146102285780632b7ac3f314610258578063313ce56714610276578063342a252a14610294578063347fd8ea146102c45761014d565b8063050ce37a1461015257806306fdde031461016e578063095ea7b31461018c57806318160ddd146101bc57806319cae462146101da575b600080fd5b61016c60048036038101906101679190611310565b610492565b005b61017661080f565b6040516101839190611414565b60405180910390f35b6101a660048036038101906101a19190611436565b6108a1565b6040516101b39190611491565b60405180910390f35b6101c46108c4565b6040516101d191906114bb565b60405180910390f35b6101e26108ce565b6040516101ef91906114bb565b60405180910390f35b610212600480360381019061020d91906114d6565b6108d4565b60405161021f9190611491565b60405180910390f35b610242600480360381019061023d9190611529565b610903565b60405161024f91906114bb565b60405180910390f35b61026061091b565b60405161026d9190611565565b60405180910390f35b61027e610941565b60405161028b919061159c565b60405180910390f35b6102ae60048036038101906102a99190611436565b610958565b6040516102bb9190611491565b60405180910390f35b6102cc610987565b6040516102d991906115d0565b60405180910390f35b6102fc60048036038101906102f79190611529565b61098d565b60405161030991906114bb565b60405180910390f35b61031a6109d5565b60405161032791906115d0565b60405180910390f35b6103386109db565b6040516103459190611414565b60405180910390f35b61036860048036038101906103639190611436565b610a6d565b6040516103759190611491565b60405180910390f35b610386610acd565b60405161039391906114bb565b60405180910390f35b6103a4610ad7565b6040516103b191906114bb565b60405180910390f35b6103d460048036038101906103cf91906115eb565b610add565b6040516103e191906115d0565b60405180910390f35b6103f2610b15565b6040516103ff91906114bb565b60405180910390f35b610410610b1b565b60405161041d91906114bb565b60405180910390f35b610440600480360381019061043b9190611618565b610b21565b60405161044d91906114bb565b60405180910390f35b61045e610ba8565b60405161046b91906114bb565b60405180910390f35b61047c610bae565b60405161048991906114bb565b60405180910390f35b600954600d60008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205410610515576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161050c906116a4565b60405180910390fd5b6008546006546105236108c4565b61052d91906116f3565b111561056e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161056590611773565b60405180910390fd5b600e60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600085815260200190815260200160002060009054906101000a900460ff161561060c576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610603906117df565b60405180910390fd5b600061062d8473ffffffffffffffffffffffffffffffffffffffff16610add565b9050600061063a86610add565b90506000600b54600c548484888860405160200161065d9695949392919061185f565b60405160208183030381529060405290506000600a60019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16826040516106b791906118f8565b600060405180830381855afa9150503d80600081146106f2576040519150601f19603f3d011682016040523d82523d6000602084013e6106f7565b606091505b505090508061073b576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016107329061195b565b60405180910390fd5b61074787600654610bca565b600d60008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008154809291906107979061197b565b91905055506001600e60008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008a815260200190815260200160002060006101000a81548160ff0219169083151502179055505050505050505050565b60606003805461081e906119f2565b80601f016020809104026020016040519081016040528092919081815260200182805461084a906119f2565b80156108975780601f1061086c57610100808354040283529160200191610897565b820191906000526020600020905b81548152906001019060200180831161087a57829003601f168201915b5050505050905090565b6000806108ac610c4c565b90506108b9818585610c54565b600191505092915050565b6000600254905090565b60055481565b6000806108df610c4c565b90506108ec858285610c66565b6108f7858585610cfa565b60019150509392505050565b600d6020528060005260406000206000915090505481565b600a60019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6000600a60009054906101000a900460ff16905090565b600e6020528160005260406000206020528060005260406000206000915091509054906101000a900460ff1681565b600b5481565b60008060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b600c5481565b6060600480546109ea906119f2565b80601f0160208091040260200160405190810160405280929190818152602001828054610a16906119f2565b8015610a635780601f10610a3857610100808354040283529160200191610a63565b820191906000526020600020905b815481529060010190602001808311610a4657829003601f168201915b5050505050905090565b6000600854610a7a6108c4565b1015610abb576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610ab290611a95565b60405180910390fd5b610ac58383610dee565b905092915050565b6000600654905090565b60085481565b60007f30644e72e131a029b85045b68181585d2833e84879b9709143e1f593f000000182610b0b9190611ae4565b60001b9050919050565b60095481565b60075481565b6000600160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b60065481565b6000610bb86108c4565b600854610bc59190611b15565b905090565b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1603610c3c5760006040517fec442f05000000000000000000000000000000000000000000000000000000008152600401610c339190611565565b60405180910390fd5b610c4860008383610e11565b5050565b600033905090565b610c618383836001611036565b505050565b6000610c728484610b21565b90507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8114610cf45781811015610ce4578281836040517ffb8f41b2000000000000000000000000000000000000000000000000000000008152600401610cdb93929190611b49565b60405180910390fd5b610cf384848484036000611036565b5b50505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1603610d6c5760006040517f96c6fd1e000000000000000000000000000000000000000000000000000000008152600401610d639190611565565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1603610dde5760006040517fec442f05000000000000000000000000000000000000000000000000000000008152600401610dd59190611565565b60405180910390fd5b610de9838383610e11565b505050565b600080610df9610c4c565b9050610e06818585610cfa565b600191505092915050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1603610e63578060026000828254610e5791906116f3565b92505081905550610f36565b60008060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905081811015610eef578381836040517fe450d38c000000000000000000000000000000000000000000000000000000008152600401610ee693929190611b49565b60405180910390fd5b8181036000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1603610f7f5780600260008282540392505081905550610fcc565b806000808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600082825401925050819055505b8173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8360405161102991906114bb565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff16036110a85760006040517fe602df0500000000000000000000000000000000000000000000000000000000815260040161109f9190611565565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff160361111a5760006040517f94280d620000000000000000000000000000000000000000000000000000000081526004016111119190611565565b60405180910390fd5b81600160008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508015611207578273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925846040516111fe91906114bb565b60405180910390a35b50505050565b600080fd5b600080fd5b6000819050919050565b61122a81611217565b811461123557600080fd5b50565b60008135905061124781611221565b92915050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b60006112788261124d565b9050919050565b6112888161126d565b811461129357600080fd5b50565b6000813590506112a58161127f565b92915050565b600080fd5b600080fd5b600080fd5b60008083601f8401126112d0576112cf6112ab565b5b8235905067ffffffffffffffff8111156112ed576112ec6112b0565b5b602083019150836001820283011115611309576113086112b5565b5b9250929050565b6000806000806060858703121561132a5761132961120d565b5b600061133887828801611238565b945050602061134987828801611296565b935050604085013567ffffffffffffffff81111561136a57611369611212565b5b611376878288016112ba565b925092505092959194509250565b600081519050919050565b600082825260208201905092915050565b60005b838110156113be5780820151818401526020810190506113a3565b60008484015250505050565b6000601f19601f8301169050919050565b60006113e682611384565b6113f0818561138f565b93506114008185602086016113a0565b611409816113ca565b840191505092915050565b6000602082019050818103600083015261142e81846113db565b905092915050565b6000806040838503121561144d5761144c61120d565b5b600061145b85828601611296565b925050602061146c85828601611238565b9150509250929050565b60008115159050919050565b61148b81611476565b82525050565b60006020820190506114a66000830184611482565b92915050565b6114b581611217565b82525050565b60006020820190506114d060008301846114ac565b92915050565b6000806000606084860312156114ef576114ee61120d565b5b60006114fd86828701611296565b935050602061150e86828701611296565b925050604061151f86828701611238565b9150509250925092565b60006020828403121561153f5761153e61120d565b5b600061154d84828501611296565b91505092915050565b61155f8161126d565b82525050565b600060208201905061157a6000830184611556565b92915050565b600060ff82169050919050565b61159681611580565b82525050565b60006020820190506115b1600083018461158d565b92915050565b6000819050919050565b6115ca816115b7565b82525050565b60006020820190506115e560008301846115c1565b92915050565b6000602082840312156116015761160061120d565b5b600061160f84828501611238565b91505092915050565b6000806040838503121561162f5761162e61120d565b5b600061163d85828601611296565b925050602061164e85828601611296565b9150509250929050565b7f4d696e696e67206c696d69742072656163686564000000000000000000000000600082015250565b600061168e60148361138f565b915061169982611658565b602082019050919050565b600060208201905081810360008301526116bd81611681565b9050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b60006116fe82611217565b915061170983611217565b9250828201905080821115611721576117206116c4565b5b92915050565b7f546f74616c20737570706c792063617020657863656564656400000000000000600082015250565b600061175d60198361138f565b915061176882611727565b602082019050919050565b6000602082019050818103600083015261178c81611750565b9050919050565b7f4e6f6e636520616c7265616479207573656420666f72206d696e696e67000000600082015250565b60006117c9601d8361138f565b91506117d482611793565b602082019050919050565b600060208201905081810360008301526117f8816117bc565b9050919050565b6000819050919050565b61181a611815826115b7565b6117ff565b82525050565b600081905092915050565b82818337600083830152505050565b60006118468385611820565b935061185383858461182b565b82840190509392505050565b600061186b8289611809565b60208201915061187b8288611809565b60208201915061188b8287611809565b60208201915061189b8286611809565b6020820191506118ac82848661183a565b9150819050979650505050505050565b600081519050919050565b60006118d2826118bc565b6118dc8185611820565b93506118ec8185602086016113a0565b80840191505092915050565b600061190482846118c7565b915081905092915050565b7f4661696c656420746f207665726966792070726f6f6600000000000000000000600082015250565b600061194560168361138f565b91506119508261190f565b602082019050919050565b6000602082019050818103600083015261197481611938565b9050919050565b600061198682611217565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff82036119b8576119b76116c4565b5b600182019050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602260045260246000fd5b60006002820490506001821680611a0a57607f821691505b602082108103611a1d57611a1c6119c3565b5b50919050565b7f5472616e73666572206e6f7420616c6c6f77656420756e74696c206d6178207360008201527f7570706c79206973207265616368656400000000000000000000000000000000602082015250565b6000611a7f60308361138f565b9150611a8a82611a23565b604082019050919050565b60006020820190508181036000830152611aae81611a72565b9050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b6000611aef82611217565b9150611afa83611217565b925082611b0a57611b09611ab5565b5b828206905092915050565b6000611b2082611217565b9150611b2b83611217565b9250828203905081811115611b4357611b426116c4565b5b92915050565b6000606082019050611b5e6000830186611556565b611b6b60208301856114ac565b611b7860408301846114ac565b94935050505056fea26469706673582212207435a1095d9729805dfc875cfb59a3472ad5190851c8ae0417a34884a128f62e64736f6c63430008130033

Block Transaction Gas Used Reward
Age Block Fee Address BC Fee Address Voting Power Jailed Incoming
Block Uncle Number Difficulty Gas Used Reward
Loading
Loading
Make sure to use the "Vote Down" button for any spammy posts, and the "Vote Up" for interesting conversations.