MNT Price: $0.86 (+1.25%)

Contract

0x209c0a0485839e17566fAf2b19B203647Fad3DCc
 

Overview

MNT Balance

Mantle Mainnet Network LogoMantle Mainnet Network LogoMantle Mainnet Network Logo600 MNT

MNT Value

$515.04 (@ $0.86/MNT)

More Info

Private Name Tags

Multichain Info

No addresses found
Transaction Hash
Block
From
To
Unstake721383692024-11-24 0:10:50428 days ago1732407050IN
0x209c0a04...47Fad3DCc
0 MNT0.00631880.03
Unstake721383612024-11-24 0:10:34428 days ago1732407034IN
0x209c0a04...47Fad3DCc
0 MNT0.00619360.03
Unstake721381502024-11-24 0:03:32428 days ago1732406612IN
0x209c0a04...47Fad3DCc
0 MNT0.006200170.03
Unstake721381402024-11-24 0:03:12428 days ago1732406592IN
0x209c0a04...47Fad3DCc
0 MNT0.006296180.03
Unstake721381252024-11-24 0:02:42428 days ago1732406562IN
0x209c0a04...47Fad3DCc
0 MNT0.006299540.03
Unstake721381182024-11-24 0:02:28428 days ago1732406548IN
0x209c0a04...47Fad3DCc
0 MNT0.00636450.03
Unstake721381092024-11-24 0:02:10428 days ago1732406530IN
0x209c0a04...47Fad3DCc
0 MNT0.006394980.03
Unstake721380932024-11-24 0:01:38428 days ago1732406498IN
0x209c0a04...47Fad3DCc
0 MNT0.006358180.03
Unstake721380822024-11-24 0:01:16428 days ago1732406476IN
0x209c0a04...47Fad3DCc
0 MNT0.006373860.03
Unstake721380722024-11-24 0:00:56428 days ago1732406456IN
0x209c0a04...47Fad3DCc
0 MNT0.006332220.03
Unstake721380572024-11-24 0:00:26428 days ago1732406426IN
0x209c0a04...47Fad3DCc
0 MNT0.006501340.03
Unstake721380432024-11-23 23:59:58428 days ago1732406398IN
0x209c0a04...47Fad3DCc
0 MNT0.006381530.03
Unstake721380322024-11-23 23:59:36428 days ago1732406376IN
0x209c0a04...47Fad3DCc
0 MNT0.006464860.03
Unstake721380202024-11-23 23:59:12428 days ago1732406352IN
0x209c0a04...47Fad3DCc
0 MNT0.006397680.03
Unstake721380042024-11-23 23:58:40428 days ago1732406320IN
0x209c0a04...47Fad3DCc
0 MNT0.006246270.03
Unstake721378642024-11-23 23:54:00428 days ago1732406040IN
0x209c0a04...47Fad3DCc
0 MNT0.005989670.03
Unstake721374892024-11-23 23:41:30428 days ago1732405290IN
0x209c0a04...47Fad3DCc
0 MNT0.004187410.03
Unstake721373552024-11-23 23:37:02428 days ago1732405022IN
0x209c0a04...47Fad3DCc
0 MNT0.004177950.03
Unstake699468482024-10-04 6:40:08479 days ago1728024008IN
0x209c0a04...47Fad3DCc
0 MNT0.004054040.02
Unstake699467102024-10-04 6:35:32479 days ago1728023732IN
0x209c0a04...47Fad3DCc
0 MNT0.004053430.02
Unstake699466942024-10-04 6:35:00479 days ago1728023700IN
0x209c0a04...47Fad3DCc
0 MNT0.004049020.02
Unstake699203262024-10-03 15:56:04479 days ago1727970964IN
0x209c0a04...47Fad3DCc
0 MNT0.004655770.02
Unstake697867062024-09-30 13:42:04482 days ago1727703724IN
0x209c0a04...47Fad3DCc
0 MNT0.006662280.03
Unstake697087852024-09-28 18:24:42484 days ago1727547882IN
0x209c0a04...47Fad3DCc
0 MNT0.004244370.02
Unstake697026242024-09-28 14:59:20484 days ago1727535560IN
0x209c0a04...47Fad3DCc
0 MNT0.004308920.02
View all transactions

Latest 25 internal transactions (View All)

Advanced mode:
Parent Transaction Hash Block From To
721383692024-11-24 0:10:50428 days ago1732407050
0x209c0a04...47Fad3DCc
100 MNT
721383612024-11-24 0:10:34428 days ago1732407034
0x209c0a04...47Fad3DCc
100 MNT
721381502024-11-24 0:03:32428 days ago1732406612
0x209c0a04...47Fad3DCc
100 MNT
721381402024-11-24 0:03:12428 days ago1732406592
0x209c0a04...47Fad3DCc
100 MNT
721381252024-11-24 0:02:42428 days ago1732406562
0x209c0a04...47Fad3DCc
100 MNT
721381182024-11-24 0:02:28428 days ago1732406548
0x209c0a04...47Fad3DCc
100 MNT
721381092024-11-24 0:02:10428 days ago1732406530
0x209c0a04...47Fad3DCc
100 MNT
721380932024-11-24 0:01:38428 days ago1732406498
0x209c0a04...47Fad3DCc
100 MNT
721380822024-11-24 0:01:16428 days ago1732406476
0x209c0a04...47Fad3DCc
100 MNT
721380722024-11-24 0:00:56428 days ago1732406456
0x209c0a04...47Fad3DCc
100 MNT
721380572024-11-24 0:00:26428 days ago1732406426
0x209c0a04...47Fad3DCc
100 MNT
721380432024-11-23 23:59:58428 days ago1732406398
0x209c0a04...47Fad3DCc
100 MNT
721380322024-11-23 23:59:36428 days ago1732406376
0x209c0a04...47Fad3DCc
100 MNT
721380202024-11-23 23:59:12428 days ago1732406352
0x209c0a04...47Fad3DCc
100 MNT
721380042024-11-23 23:58:40428 days ago1732406320
0x209c0a04...47Fad3DCc
100 MNT
721378642024-11-23 23:54:00428 days ago1732406040
0x209c0a04...47Fad3DCc
100 MNT
699468482024-10-04 6:40:08479 days ago1728024008
0x209c0a04...47Fad3DCc
100 MNT
699467102024-10-04 6:35:32479 days ago1728023732
0x209c0a04...47Fad3DCc
100 MNT
699466942024-10-04 6:35:00479 days ago1728023700
0x209c0a04...47Fad3DCc
100 MNT
699203262024-10-03 15:56:04479 days ago1727970964
0x209c0a04...47Fad3DCc
100 MNT
697867062024-09-30 13:42:04482 days ago1727703724
0x209c0a04...47Fad3DCc
100 MNT
697087852024-09-28 18:24:42484 days ago1727547882
0x209c0a04...47Fad3DCc
100 MNT
697026242024-09-28 14:59:20484 days ago1727535560
0x209c0a04...47Fad3DCc
100 MNT
696812632024-09-28 3:07:18485 days ago1727492838
0x209c0a04...47Fad3DCc
100 MNT
696812522024-09-28 3:06:56485 days ago1727492816
0x209c0a04...47Fad3DCc
100 MNT
View All Internal Transactions

Cross-Chain Transactions
Loading...
Loading

Contract Source Code Verified (Exact Match)

Contract Name:
LightCycleStake

Compiler Version
v0.8.26+commit.8a97fa7a

Optimization Enabled:
Yes with 200 runs

Other Settings:
paris EvmVersion
//SPDX-License-Identifier: MIT

pragma solidity ^0.8.26;

import "@openzeppelin/contracts/token/ERC721/IERC721.sol";
import "@openzeppelin/contracts/token/ERC721/IERC721Receiver.sol";
import "@openzeppelin/contracts/token/ERC20/IERC20.sol";
import "@openzeppelin/contracts/token/ERC1155/IERC1155.sol";
import {Strings} from "@openzeppelin/contracts/utils/Strings.sol";
import "@openzeppelin/contracts/access/Ownable.sol";
import "@openzeppelin/contracts/token/ERC20/ERC20.sol";
import "@openzeppelin/contracts/utils/ReentrancyGuard.sol";

interface ILightCycleStake {
    /**
     * @dev stakes coin to `contract`.
     *
     * WARNING: 
     *
     * Requirements:
     *
     * - `msg.value` must be equal to the staking amount.
     *
     * Emits a {Stake} event.
     */
    function stake() external payable;
    
    /**
     * @dev stakes token to `contract`.
     *
     * WARNING: 
     *
     * Requirements:
     *
     * - `token` is a ERC20 or ERC721 token contract address.
     * - `value` is the staking amount for a ERC20 token or the staking tokenId for a ERC721.
     *
     * Emits a {Stake} event.
     */
    function stake(address token, uint256 value) external returns(uint256);
    
    /**
     * @dev stakes a NFT to `contract`.
     *
     * WARNING: 
     *
     * Requirements:
     *
     * - `idx` is a staking order index staring from 0 which was generated by a stake event.
     *
     * Emits a {Stake} event.
     */
    function unstake(uint256 idx) external;

    /**
     * @dev Emitted when a coin or ERC20 token or ERC721 token (`pool`) is staked 
     * with an amount (`value`) and an unique id (`tokenId`) if the token is a NFT
     * in a order index (`idx`) by a account (`user`).
     */
    event Stake(address indexed pool, address indexed user, uint256 idx, uint256 value, uint256 tokenId);
    
    /**
     * @dev Emitted when a coin or ERC20 token or ERC721 token (`pool`) is unstaked 
     * with an amount (`value`) and an unique id (`tokenId`) if the token is a ERC721 token
     * in a order index (`idx`) by a account (`user`).
     */
    event Unstake(address indexed pool, address indexed user, uint256 idx, uint256 value, uint256 tokenId);
}

contract LightCycleStake is Ownable, ILightCycleStake, IERC721Receiver, ReentrancyGuard {
    mapping(address => uint256) public poolType;
    mapping(address => uint256) public poolStakePerAmount;
    
    mapping(uint256 => address) public ownerOfStakeRecord;
    mapping(uint256 => uint256) public amountOfStakeRecord;
    mapping(uint256 => address) public poolOfStakeRecord;
    mapping(uint256 => uint256) public typeOfStakeRecord;
    mapping(uint256 => uint256) public tokeIdOfStakeRecord;
    mapping(uint256 => bool) public statusOfStakeRecord;
    
    uint256 public totalStake;
    
    constructor() Ownable(msg.sender) {
    }

    function onERC721Received(
        address,
        address,
        uint256,
        bytes calldata
    ) public pure returns (bytes4) {
        return IERC721Receiver.onERC721Received.selector;
    }

    function set(address[] memory _pools, 
        uint256[] memory _poolType, 
        uint256[] memory _poolStakePerAmount, 
        uint8 decimal) public onlyOwner {
        require(decimal <= 18, "The decimal value is wrong.");
        
        uint256 scaler = 10 ** (18 - decimal);
        for (uint256 i = 0; i < _pools.length; i++) {
            address pool = _pools[i];
            uint256 _newType = _poolType[i];
            uint256 _oldType = poolType[pool];
            require(0 == _oldType || _newType == _oldType, "You can't change the pool type.");

            poolType[pool] = _newType;
            poolStakePerAmount[pool] = _poolStakePerAmount[i] * scaler;
        }
    }

    function stake() public payable nonReentrant {
        uint256 amount = poolStakePerAmount[address(0x0)];
        
        require(amount > 0, "The stake pool isn't exist.");
        require(msg.value == amount, "The stake value must be equal.");
        _recordStake(1, address(0x0), msg.sender, amount, 0);
    }

    function stake(address token, uint256 tokenId) public virtual nonReentrant returns(uint256) { 
        uint256 _type = poolType[token];
        require(2 == _type || 3 == _type, "The stake pool isn't exist.");
        
        uint256 amount = poolStakePerAmount[token];

        if (2 == _type) {
            uint256 balanceBefore = IERC20(token).balanceOf(address(this));
            IERC20(token).transferFrom(msg.sender, address(this), amount);
            uint256 balanceAfter = IERC20(token).balanceOf(address(this));
            require(balanceAfter > balanceBefore, "The real stake amount is zero.");

            uint256 amountX = balanceAfter - balanceBefore;
            return _recordStake(_type, token, msg.sender, 
                amountX < amount ? amountX : amount, 0);
        } else if (3 == _type) {
            IERC721(token).transferFrom(msg.sender, address(this), tokenId);
            return _recordStake(_type, token, msg.sender, 1, tokenId);
        }
        return 0;
    }

    function unstake(uint256 idx) public virtual nonReentrant {
        require(msg.sender == ownerOfStakeRecord[idx], "You have no right to unstake.");
        require(statusOfStakeRecord[idx], "You have unstaked.");

        uint256 amount = amountOfStakeRecord[idx];
        uint256 tokenId = tokeIdOfStakeRecord[idx];
        address pool = poolOfStakeRecord[idx];
        address user = ownerOfStakeRecord[idx];
        uint256 _type = typeOfStakeRecord[idx];
        
        statusOfStakeRecord[idx] = false;
        if (1 == _type) {
            payable(msg.sender).transfer(amount);
        } else if (2 == _type) {
            IERC20(pool).transfer(msg.sender, amount);
        } else if (3 == _type)  {
            IERC721(pool).transferFrom(address(this), msg.sender, tokenId);
        }

        emit Unstake(pool, user, idx, amount, tokenId);
    }

    function _recordStake(uint256 _type, address pool, address user, uint256 value, uint256 tokenId) internal returns(uint256) {
        totalStake++;
        ownerOfStakeRecord[totalStake] = user;
        amountOfStakeRecord[totalStake] = value;
        poolOfStakeRecord[totalStake] = pool;
        tokeIdOfStakeRecord[totalStake] = tokenId;
        typeOfStakeRecord[totalStake] = _type;
        statusOfStakeRecord[totalStake] = true;
        
        emit Stake(pool, user, totalStake, value, tokenId);
        return totalStake;
    }
}

// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (access/Ownable.sol)

pragma solidity ^0.8.20;

import {Context} from "../utils/Context.sol";

/**
 * @dev Contract module which provides a basic access control mechanism, where
 * there is an account (an owner) that can be granted exclusive access to
 * specific functions.
 *
 * The initial owner is set to the address provided by the deployer. This can
 * later be changed with {transferOwnership}.
 *
 * This module is used through inheritance. It will make available the modifier
 * `onlyOwner`, which can be applied to your functions to restrict their use to
 * the owner.
 */
abstract contract Ownable is Context {
    address private _owner;

    /**
     * @dev The caller account is not authorized to perform an operation.
     */
    error OwnableUnauthorizedAccount(address account);

    /**
     * @dev The owner is not a valid owner account. (eg. `address(0)`)
     */
    error OwnableInvalidOwner(address owner);

    event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);

    /**
     * @dev Initializes the contract setting the address provided by the deployer as the initial owner.
     */
    constructor(address initialOwner) {
        if (initialOwner == address(0)) {
            revert OwnableInvalidOwner(address(0));
        }
        _transferOwnership(initialOwner);
    }

    /**
     * @dev Throws if called by any account other than the owner.
     */
    modifier onlyOwner() {
        _checkOwner();
        _;
    }

    /**
     * @dev Returns the address of the current owner.
     */
    function owner() public view virtual returns (address) {
        return _owner;
    }

    /**
     * @dev Throws if the sender is not the owner.
     */
    function _checkOwner() internal view virtual {
        if (owner() != _msgSender()) {
            revert OwnableUnauthorizedAccount(_msgSender());
        }
    }

    /**
     * @dev Leaves the contract without owner. It will not be possible to call
     * `onlyOwner` functions. Can only be called by the current owner.
     *
     * NOTE: Renouncing ownership will leave the contract without an owner,
     * thereby disabling any functionality that is only available to the owner.
     */
    function renounceOwnership() public virtual onlyOwner {
        _transferOwnership(address(0));
    }

    /**
     * @dev Transfers ownership of the contract to a new account (`newOwner`).
     * Can only be called by the current owner.
     */
    function transferOwnership(address newOwner) public virtual onlyOwner {
        if (newOwner == address(0)) {
            revert OwnableInvalidOwner(address(0));
        }
        _transferOwnership(newOwner);
    }

    /**
     * @dev Transfers ownership of the contract to a new account (`newOwner`).
     * Internal function without access restriction.
     */
    function _transferOwnership(address newOwner) internal virtual {
        address oldOwner = _owner;
        _owner = newOwner;
        emit OwnershipTransferred(oldOwner, newOwner);
    }
}

// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (interfaces/draft-IERC6093.sol)
pragma solidity ^0.8.20;

/**
 * @dev Standard ERC20 Errors
 * Interface of the https://eips.ethereum.org/EIPS/eip-6093[ERC-6093] custom errors for ERC20 tokens.
 */
interface IERC20Errors {
    /**
     * @dev Indicates an error related to the current `balance` of a `sender`. Used in transfers.
     * @param sender Address whose tokens are being transferred.
     * @param balance Current balance for the interacting account.
     * @param needed Minimum amount required to perform a transfer.
     */
    error ERC20InsufficientBalance(address sender, uint256 balance, uint256 needed);

    /**
     * @dev Indicates a failure with the token `sender`. Used in transfers.
     * @param sender Address whose tokens are being transferred.
     */
    error ERC20InvalidSender(address sender);

    /**
     * @dev Indicates a failure with the token `receiver`. Used in transfers.
     * @param receiver Address to which tokens are being transferred.
     */
    error ERC20InvalidReceiver(address receiver);

    /**
     * @dev Indicates a failure with the `spender`’s `allowance`. Used in transfers.
     * @param spender Address that may be allowed to operate on tokens without being their owner.
     * @param allowance Amount of tokens a `spender` is allowed to operate with.
     * @param needed Minimum amount required to perform a transfer.
     */
    error ERC20InsufficientAllowance(address spender, uint256 allowance, uint256 needed);

    /**
     * @dev Indicates a failure with the `approver` of a token to be approved. Used in approvals.
     * @param approver Address initiating an approval operation.
     */
    error ERC20InvalidApprover(address approver);

    /**
     * @dev Indicates a failure with the `spender` to be approved. Used in approvals.
     * @param spender Address that may be allowed to operate on tokens without being their owner.
     */
    error ERC20InvalidSpender(address spender);
}

/**
 * @dev Standard ERC721 Errors
 * Interface of the https://eips.ethereum.org/EIPS/eip-6093[ERC-6093] custom errors for ERC721 tokens.
 */
interface IERC721Errors {
    /**
     * @dev Indicates that an address can't be an owner. For example, `address(0)` is a forbidden owner in EIP-20.
     * Used in balance queries.
     * @param owner Address of the current owner of a token.
     */
    error ERC721InvalidOwner(address owner);

    /**
     * @dev Indicates a `tokenId` whose `owner` is the zero address.
     * @param tokenId Identifier number of a token.
     */
    error ERC721NonexistentToken(uint256 tokenId);

    /**
     * @dev Indicates an error related to the ownership over a particular token. Used in transfers.
     * @param sender Address whose tokens are being transferred.
     * @param tokenId Identifier number of a token.
     * @param owner Address of the current owner of a token.
     */
    error ERC721IncorrectOwner(address sender, uint256 tokenId, address owner);

    /**
     * @dev Indicates a failure with the token `sender`. Used in transfers.
     * @param sender Address whose tokens are being transferred.
     */
    error ERC721InvalidSender(address sender);

    /**
     * @dev Indicates a failure with the token `receiver`. Used in transfers.
     * @param receiver Address to which tokens are being transferred.
     */
    error ERC721InvalidReceiver(address receiver);

    /**
     * @dev Indicates a failure with the `operator`’s approval. Used in transfers.
     * @param operator Address that may be allowed to operate on tokens without being their owner.
     * @param tokenId Identifier number of a token.
     */
    error ERC721InsufficientApproval(address operator, uint256 tokenId);

    /**
     * @dev Indicates a failure with the `approver` of a token to be approved. Used in approvals.
     * @param approver Address initiating an approval operation.
     */
    error ERC721InvalidApprover(address approver);

    /**
     * @dev Indicates a failure with the `operator` to be approved. Used in approvals.
     * @param operator Address that may be allowed to operate on tokens without being their owner.
     */
    error ERC721InvalidOperator(address operator);
}

/**
 * @dev Standard ERC1155 Errors
 * Interface of the https://eips.ethereum.org/EIPS/eip-6093[ERC-6093] custom errors for ERC1155 tokens.
 */
interface IERC1155Errors {
    /**
     * @dev Indicates an error related to the current `balance` of a `sender`. Used in transfers.
     * @param sender Address whose tokens are being transferred.
     * @param balance Current balance for the interacting account.
     * @param needed Minimum amount required to perform a transfer.
     * @param tokenId Identifier number of a token.
     */
    error ERC1155InsufficientBalance(address sender, uint256 balance, uint256 needed, uint256 tokenId);

    /**
     * @dev Indicates a failure with the token `sender`. Used in transfers.
     * @param sender Address whose tokens are being transferred.
     */
    error ERC1155InvalidSender(address sender);

    /**
     * @dev Indicates a failure with the token `receiver`. Used in transfers.
     * @param receiver Address to which tokens are being transferred.
     */
    error ERC1155InvalidReceiver(address receiver);

    /**
     * @dev Indicates a failure with the `operator`’s approval. Used in transfers.
     * @param operator Address that may be allowed to operate on tokens without being their owner.
     * @param owner Address of the current owner of a token.
     */
    error ERC1155MissingApprovalForAll(address operator, address owner);

    /**
     * @dev Indicates a failure with the `approver` of a token to be approved. Used in approvals.
     * @param approver Address initiating an approval operation.
     */
    error ERC1155InvalidApprover(address approver);

    /**
     * @dev Indicates a failure with the `operator` to be approved. Used in approvals.
     * @param operator Address that may be allowed to operate on tokens without being their owner.
     */
    error ERC1155InvalidOperator(address operator);

    /**
     * @dev Indicates an array length mismatch between ids and values in a safeBatchTransferFrom operation.
     * Used in batch transfers.
     * @param idsLength Length of the array of token identifiers
     * @param valuesLength Length of the array of token amounts
     */
    error ERC1155InvalidArrayLength(uint256 idsLength, uint256 valuesLength);
}

// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.1) (token/ERC1155/IERC1155.sol)

pragma solidity ^0.8.20;

import {IERC165} from "../../utils/introspection/IERC165.sol";

/**
 * @dev Required interface of an ERC1155 compliant contract, as defined in the
 * https://eips.ethereum.org/EIPS/eip-1155[EIP].
 */
interface IERC1155 is IERC165 {
    /**
     * @dev Emitted when `value` amount of tokens of type `id` are transferred from `from` to `to` by `operator`.
     */
    event TransferSingle(address indexed operator, address indexed from, address indexed to, uint256 id, uint256 value);

    /**
     * @dev Equivalent to multiple {TransferSingle} events, where `operator`, `from` and `to` are the same for all
     * transfers.
     */
    event TransferBatch(
        address indexed operator,
        address indexed from,
        address indexed to,
        uint256[] ids,
        uint256[] values
    );

    /**
     * @dev Emitted when `account` grants or revokes permission to `operator` to transfer their tokens, according to
     * `approved`.
     */
    event ApprovalForAll(address indexed account, address indexed operator, bool approved);

    /**
     * @dev Emitted when the URI for token type `id` changes to `value`, if it is a non-programmatic URI.
     *
     * If an {URI} event was emitted for `id`, the standard
     * https://eips.ethereum.org/EIPS/eip-1155#metadata-extensions[guarantees] that `value` will equal the value
     * returned by {IERC1155MetadataURI-uri}.
     */
    event URI(string value, uint256 indexed id);

    /**
     * @dev Returns the value of tokens of token type `id` owned by `account`.
     *
     * Requirements:
     *
     * - `account` cannot be the zero address.
     */
    function balanceOf(address account, uint256 id) external view returns (uint256);

    /**
     * @dev xref:ROOT:erc1155.adoc#batch-operations[Batched] version of {balanceOf}.
     *
     * Requirements:
     *
     * - `accounts` and `ids` must have the same length.
     */
    function balanceOfBatch(
        address[] calldata accounts,
        uint256[] calldata ids
    ) external view returns (uint256[] memory);

    /**
     * @dev Grants or revokes permission to `operator` to transfer the caller's tokens, according to `approved`,
     *
     * Emits an {ApprovalForAll} event.
     *
     * Requirements:
     *
     * - `operator` cannot be the caller.
     */
    function setApprovalForAll(address operator, bool approved) external;

    /**
     * @dev Returns true if `operator` is approved to transfer ``account``'s tokens.
     *
     * See {setApprovalForAll}.
     */
    function isApprovedForAll(address account, address operator) external view returns (bool);

    /**
     * @dev Transfers a `value` amount of tokens of type `id` from `from` to `to`.
     *
     * WARNING: This function can potentially allow a reentrancy attack when transferring tokens
     * to an untrusted contract, when invoking {onERC1155Received} on the receiver.
     * Ensure to follow the checks-effects-interactions pattern and consider employing
     * reentrancy guards when interacting with untrusted contracts.
     *
     * Emits a {TransferSingle} event.
     *
     * Requirements:
     *
     * - `to` cannot be the zero address.
     * - If the caller is not `from`, it must have been approved to spend ``from``'s tokens via {setApprovalForAll}.
     * - `from` must have a balance of tokens of type `id` of at least `value` amount.
     * - If `to` refers to a smart contract, it must implement {IERC1155Receiver-onERC1155Received} and return the
     * acceptance magic value.
     */
    function safeTransferFrom(address from, address to, uint256 id, uint256 value, bytes calldata data) external;

    /**
     * @dev xref:ROOT:erc1155.adoc#batch-operations[Batched] version of {safeTransferFrom}.
     *
     * WARNING: This function can potentially allow a reentrancy attack when transferring tokens
     * to an untrusted contract, when invoking {onERC1155BatchReceived} on the receiver.
     * Ensure to follow the checks-effects-interactions pattern and consider employing
     * reentrancy guards when interacting with untrusted contracts.
     *
     * Emits either a {TransferSingle} or a {TransferBatch} event, depending on the length of the array arguments.
     *
     * Requirements:
     *
     * - `ids` and `values` must have the same length.
     * - If `to` refers to a smart contract, it must implement {IERC1155Receiver-onERC1155BatchReceived} and return the
     * acceptance magic value.
     */
    function safeBatchTransferFrom(
        address from,
        address to,
        uint256[] calldata ids,
        uint256[] calldata values,
        bytes calldata data
    ) external;
}

// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.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 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);
            }
        }
    }
}

// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.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 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);
}

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

pragma solidity ^0.8.20;

/**
 * @dev Interface of the ERC20 standard as defined in the EIP.
 */
interface IERC20 {
    /**
     * @dev Emitted when `value` tokens are moved from one account (`from`) to
     * another (`to`).
     *
     * Note that `value` may be zero.
     */
    event Transfer(address indexed from, address indexed to, uint256 value);

    /**
     * @dev Emitted when the allowance of a `spender` for an `owner` is set by
     * a call to {approve}. `value` is the new allowance.
     */
    event Approval(address indexed owner, address indexed spender, uint256 value);

    /**
     * @dev Returns the value of tokens in existence.
     */
    function totalSupply() external view returns (uint256);

    /**
     * @dev Returns the value of tokens owned by `account`.
     */
    function balanceOf(address account) external view returns (uint256);

    /**
     * @dev Moves a `value` amount of tokens from the caller's account to `to`.
     *
     * Returns a boolean value indicating whether the operation succeeded.
     *
     * Emits a {Transfer} event.
     */
    function transfer(address to, uint256 value) external returns (bool);

    /**
     * @dev Returns the remaining number of tokens that `spender` will be
     * allowed to spend on behalf of `owner` through {transferFrom}. This is
     * zero by default.
     *
     * This value changes when {approve} or {transferFrom} are called.
     */
    function allowance(address owner, address spender) external view returns (uint256);

    /**
     * @dev Sets a `value` amount of tokens as the allowance of `spender` over the
     * caller's tokens.
     *
     * Returns a boolean value indicating whether the operation succeeded.
     *
     * IMPORTANT: Beware that changing an allowance with this method brings the risk
     * that someone may use both the old and the new allowance by unfortunate
     * transaction ordering. One possible solution to mitigate this race
     * condition is to first reduce the spender's allowance to 0 and set the
     * desired value afterwards:
     * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729
     *
     * Emits an {Approval} event.
     */
    function approve(address spender, uint256 value) external returns (bool);

    /**
     * @dev Moves a `value` amount of tokens from `from` to `to` using the
     * allowance mechanism. `value` is then deducted from the caller's
     * allowance.
     *
     * Returns a boolean value indicating whether the operation succeeded.
     *
     * Emits a {Transfer} event.
     */
    function transferFrom(address from, address to, uint256 value) external returns (bool);
}

// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (token/ERC721/IERC721.sol)

pragma solidity ^0.8.20;

import {IERC165} from "../../utils/introspection/IERC165.sol";

/**
 * @dev Required interface of an ERC721 compliant contract.
 */
interface IERC721 is IERC165 {
    /**
     * @dev Emitted when `tokenId` token is transferred from `from` to `to`.
     */
    event Transfer(address indexed from, address indexed to, uint256 indexed tokenId);

    /**
     * @dev Emitted when `owner` enables `approved` to manage the `tokenId` token.
     */
    event Approval(address indexed owner, address indexed approved, uint256 indexed tokenId);

    /**
     * @dev Emitted when `owner` enables or disables (`approved`) `operator` to manage all of its assets.
     */
    event ApprovalForAll(address indexed owner, address indexed operator, bool approved);

    /**
     * @dev Returns the number of tokens in ``owner``'s account.
     */
    function balanceOf(address owner) external view returns (uint256 balance);

    /**
     * @dev Returns the owner of the `tokenId` token.
     *
     * Requirements:
     *
     * - `tokenId` must exist.
     */
    function ownerOf(uint256 tokenId) external view returns (address owner);

    /**
     * @dev Safely transfers `tokenId` token from `from` to `to`.
     *
     * Requirements:
     *
     * - `from` cannot be the zero address.
     * - `to` cannot be the zero address.
     * - `tokenId` token must exist and be owned by `from`.
     * - If the caller is not `from`, it must be approved to move this token by either {approve} or {setApprovalForAll}.
     * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon
     *   a safe transfer.
     *
     * Emits a {Transfer} event.
     */
    function safeTransferFrom(address from, address to, uint256 tokenId, bytes calldata data) external;

    /**
     * @dev Safely transfers `tokenId` token from `from` to `to`, checking first that contract recipients
     * are aware of the ERC721 protocol to prevent tokens from being forever locked.
     *
     * Requirements:
     *
     * - `from` cannot be the zero address.
     * - `to` cannot be the zero address.
     * - `tokenId` token must exist and be owned by `from`.
     * - If the caller is not `from`, it must have been allowed to move this token by either {approve} or
     *   {setApprovalForAll}.
     * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon
     *   a safe transfer.
     *
     * Emits a {Transfer} event.
     */
    function safeTransferFrom(address from, address to, uint256 tokenId) external;

    /**
     * @dev Transfers `tokenId` token from `from` to `to`.
     *
     * WARNING: Note that the caller is responsible to confirm that the recipient is capable of receiving ERC721
     * or else they may be permanently lost. Usage of {safeTransferFrom} prevents loss, though the caller must
     * understand this adds an external call which potentially creates a reentrancy vulnerability.
     *
     * Requirements:
     *
     * - `from` cannot be the zero address.
     * - `to` cannot be the zero address.
     * - `tokenId` token must be owned by `from`.
     * - If the caller is not `from`, it must be approved to move this token by either {approve} or {setApprovalForAll}.
     *
     * Emits a {Transfer} event.
     */
    function transferFrom(address from, address to, uint256 tokenId) external;

    /**
     * @dev Gives permission to `to` to transfer `tokenId` token to another account.
     * The approval is cleared when the token is transferred.
     *
     * Only a single account can be approved at a time, so approving the zero address clears previous approvals.
     *
     * Requirements:
     *
     * - The caller must own the token or be an approved operator.
     * - `tokenId` must exist.
     *
     * Emits an {Approval} event.
     */
    function approve(address to, uint256 tokenId) external;

    /**
     * @dev Approve or remove `operator` as an operator for the caller.
     * Operators can call {transferFrom} or {safeTransferFrom} for any token owned by the caller.
     *
     * Requirements:
     *
     * - The `operator` cannot be the address zero.
     *
     * Emits an {ApprovalForAll} event.
     */
    function setApprovalForAll(address operator, bool approved) external;

    /**
     * @dev Returns the account approved for `tokenId` token.
     *
     * Requirements:
     *
     * - `tokenId` must exist.
     */
    function getApproved(uint256 tokenId) external view returns (address operator);

    /**
     * @dev Returns if the `operator` is allowed to manage all of the assets of `owner`.
     *
     * See {setApprovalForAll}
     */
    function isApprovedForAll(address owner, address operator) external view returns (bool);
}

File 9 of 15 : IERC721Receiver.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (token/ERC721/IERC721Receiver.sol)

pragma solidity ^0.8.20;

/**
 * @title ERC721 token receiver interface
 * @dev Interface for any contract that wants to support safeTransfers
 * from ERC721 asset contracts.
 */
interface IERC721Receiver {
    /**
     * @dev Whenever an {IERC721} `tokenId` token is transferred to this contract via {IERC721-safeTransferFrom}
     * by `operator` from `from`, this function is called.
     *
     * It must return its Solidity selector to confirm the token transfer.
     * If any other value is returned or the interface is not implemented by the recipient, the transfer will be
     * reverted.
     *
     * The selector can be obtained in Solidity with `IERC721Receiver.onERC721Received.selector`.
     */
    function onERC721Received(
        address operator,
        address from,
        uint256 tokenId,
        bytes calldata data
    ) external returns (bytes4);
}

// 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.0.0) (utils/introspection/IERC165.sol)

pragma solidity ^0.8.20;

/**
 * @dev Interface of the ERC165 standard, as defined in the
 * https://eips.ethereum.org/EIPS/eip-165[EIP].
 *
 * Implementers can declare support of contract interfaces, which can then be
 * queried by others ({ERC165Checker}).
 *
 * For an implementation, see {ERC165}.
 */
interface IERC165 {
    /**
     * @dev Returns true if this contract implements the interface defined by
     * `interfaceId`. See the corresponding
     * https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified[EIP section]
     * to learn more about how these ids are created.
     *
     * This function call must use less than 30 000 gas.
     */
    function supportsInterface(bytes4 interfaceId) external view returns (bool);
}

// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (utils/math/Math.sol)

pragma solidity ^0.8.20;

/**
 * @dev Standard math utilities missing in the Solidity language.
 */
library Math {
    /**
     * @dev Muldiv operation overflow.
     */
    error MathOverflowedMulDiv();

    enum Rounding {
        Floor, // Toward negative infinity
        Ceil, // Toward positive infinity
        Trunc, // Toward zero
        Expand // Away from zero
    }

    /**
     * @dev Returns the addition of two unsigned integers, with an overflow flag.
     */
    function tryAdd(uint256 a, uint256 b) internal pure returns (bool, uint256) {
        unchecked {
            uint256 c = a + b;
            if (c < a) return (false, 0);
            return (true, c);
        }
    }

    /**
     * @dev Returns the subtraction of two unsigned integers, with an overflow flag.
     */
    function trySub(uint256 a, uint256 b) internal pure returns (bool, uint256) {
        unchecked {
            if (b > a) return (false, 0);
            return (true, a - b);
        }
    }

    /**
     * @dev Returns the multiplication of two unsigned integers, with an overflow flag.
     */
    function tryMul(uint256 a, uint256 b) internal pure returns (bool, uint256) {
        unchecked {
            // Gas optimization: this is cheaper than requiring 'a' not being zero, but the
            // benefit is lost if 'b' is also tested.
            // See: https://github.com/OpenZeppelin/openzeppelin-contracts/pull/522
            if (a == 0) return (true, 0);
            uint256 c = a * b;
            if (c / a != b) return (false, 0);
            return (true, c);
        }
    }

    /**
     * @dev Returns the division of two unsigned integers, with a division by zero flag.
     */
    function tryDiv(uint256 a, uint256 b) internal pure returns (bool, uint256) {
        unchecked {
            if (b == 0) return (false, 0);
            return (true, a / b);
        }
    }

    /**
     * @dev Returns the remainder of dividing two unsigned integers, with a division by zero flag.
     */
    function tryMod(uint256 a, uint256 b) internal pure returns (bool, uint256) {
        unchecked {
            if (b == 0) return (false, 0);
            return (true, a % b);
        }
    }

    /**
     * @dev Returns the largest of two numbers.
     */
    function max(uint256 a, uint256 b) internal pure returns (uint256) {
        return a > b ? a : b;
    }

    /**
     * @dev Returns the smallest of two numbers.
     */
    function min(uint256 a, uint256 b) internal pure returns (uint256) {
        return a < b ? a : b;
    }

    /**
     * @dev Returns the average of two numbers. The result is rounded towards
     * zero.
     */
    function average(uint256 a, uint256 b) internal pure returns (uint256) {
        // (a + b) / 2 can overflow.
        return (a & b) + (a ^ b) / 2;
    }

    /**
     * @dev Returns the ceiling of the division of two numbers.
     *
     * This differs from standard division with `/` in that it rounds towards infinity instead
     * of rounding towards zero.
     */
    function ceilDiv(uint256 a, uint256 b) internal pure returns (uint256) {
        if (b == 0) {
            // Guarantee the same behavior as in a regular Solidity division.
            return a / b;
        }

        // (a + b - 1) / b can overflow on addition, so we distribute.
        return a == 0 ? 0 : (a - 1) / b + 1;
    }

    /**
     * @notice Calculates floor(x * y / denominator) with full precision. Throws if result overflows a uint256 or
     * denominator == 0.
     * @dev Original credit to Remco Bloemen under MIT license (https://xn--2-umb.com/21/muldiv) with further edits by
     * Uniswap Labs also under MIT license.
     */
    function mulDiv(uint256 x, uint256 y, uint256 denominator) internal pure returns (uint256 result) {
        unchecked {
            // 512-bit multiply [prod1 prod0] = x * y. Compute the product mod 2^256 and mod 2^256 - 1, then use
            // use the Chinese Remainder Theorem to reconstruct the 512 bit result. The result is stored in two 256
            // variables such that product = prod1 * 2^256 + prod0.
            uint256 prod0 = x * y; // Least significant 256 bits of the product
            uint256 prod1; // Most significant 256 bits of the product
            assembly {
                let mm := mulmod(x, y, not(0))
                prod1 := sub(sub(mm, prod0), lt(mm, prod0))
            }

            // Handle non-overflow cases, 256 by 256 division.
            if (prod1 == 0) {
                // Solidity will revert if denominator == 0, unlike the div opcode on its own.
                // The surrounding unchecked block does not change this fact.
                // See https://docs.soliditylang.org/en/latest/control-structures.html#checked-or-unchecked-arithmetic.
                return prod0 / denominator;
            }

            // Make sure the result is less than 2^256. Also prevents denominator == 0.
            if (denominator <= prod1) {
                revert MathOverflowedMulDiv();
            }

            ///////////////////////////////////////////////
            // 512 by 256 division.
            ///////////////////////////////////////////////

            // Make division exact by subtracting the remainder from [prod1 prod0].
            uint256 remainder;
            assembly {
                // Compute remainder using mulmod.
                remainder := mulmod(x, y, denominator)

                // Subtract 256 bit number from 512 bit number.
                prod1 := sub(prod1, gt(remainder, prod0))
                prod0 := sub(prod0, remainder)
            }

            // Factor powers of two out of denominator and compute largest power of two divisor of denominator.
            // Always >= 1. See https://cs.stackexchange.com/q/138556/92363.

            uint256 twos = denominator & (0 - denominator);
            assembly {
                // Divide denominator by twos.
                denominator := div(denominator, twos)

                // Divide [prod1 prod0] by twos.
                prod0 := div(prod0, twos)

                // Flip twos such that it is 2^256 / twos. If twos is zero, then it becomes one.
                twos := add(div(sub(0, twos), twos), 1)
            }

            // Shift in bits from prod1 into prod0.
            prod0 |= prod1 * twos;

            // Invert denominator mod 2^256. Now that denominator is an odd number, it has an inverse modulo 2^256 such
            // that denominator * inv = 1 mod 2^256. Compute the inverse by starting with a seed that is correct for
            // four bits. That is, denominator * inv = 1 mod 2^4.
            uint256 inverse = (3 * denominator) ^ 2;

            // Use the Newton-Raphson iteration to improve the precision. Thanks to Hensel's lifting lemma, this also
            // works in modular arithmetic, doubling the correct bits in each step.
            inverse *= 2 - denominator * inverse; // inverse mod 2^8
            inverse *= 2 - denominator * inverse; // inverse mod 2^16
            inverse *= 2 - denominator * inverse; // inverse mod 2^32
            inverse *= 2 - denominator * inverse; // inverse mod 2^64
            inverse *= 2 - denominator * inverse; // inverse mod 2^128
            inverse *= 2 - denominator * inverse; // inverse mod 2^256

            // Because the division is now exact we can divide by multiplying with the modular inverse of denominator.
            // This will give us the correct result modulo 2^256. Since the preconditions guarantee that the outcome is
            // less than 2^256, this is the final result. We don't need to compute the high bits of the result and prod1
            // is no longer required.
            result = prod0 * inverse;
            return result;
        }
    }

    /**
     * @notice Calculates x * y / denominator with full precision, following the selected rounding direction.
     */
    function mulDiv(uint256 x, uint256 y, uint256 denominator, Rounding rounding) internal pure returns (uint256) {
        uint256 result = mulDiv(x, y, denominator);
        if (unsignedRoundsUp(rounding) && mulmod(x, y, denominator) > 0) {
            result += 1;
        }
        return result;
    }

    /**
     * @dev Returns the square root of a number. If the number is not a perfect square, the value is rounded
     * towards zero.
     *
     * Inspired by Henry S. Warren, Jr.'s "Hacker's Delight" (Chapter 11).
     */
    function sqrt(uint256 a) internal pure returns (uint256) {
        if (a == 0) {
            return 0;
        }

        // For our first guess, we get the biggest power of 2 which is smaller than the square root of the target.
        //
        // We know that the "msb" (most significant bit) of our target number `a` is a power of 2 such that we have
        // `msb(a) <= a < 2*msb(a)`. This value can be written `msb(a)=2**k` with `k=log2(a)`.
        //
        // This can be rewritten `2**log2(a) <= a < 2**(log2(a) + 1)`
        // → `sqrt(2**k) <= sqrt(a) < sqrt(2**(k+1))`
        // → `2**(k/2) <= sqrt(a) < 2**((k+1)/2) <= 2**(k/2 + 1)`
        //
        // Consequently, `2**(log2(a) / 2)` is a good first approximation of `sqrt(a)` with at least 1 correct bit.
        uint256 result = 1 << (log2(a) >> 1);

        // At this point `result` is an estimation with one bit of precision. We know the true value is a uint128,
        // since it is the square root of a uint256. Newton's method converges quadratically (precision doubles at
        // every iteration). We thus need at most 7 iteration to turn our partial result with one bit of precision
        // into the expected uint128 result.
        unchecked {
            result = (result + a / result) >> 1;
            result = (result + a / result) >> 1;
            result = (result + a / result) >> 1;
            result = (result + a / result) >> 1;
            result = (result + a / result) >> 1;
            result = (result + a / result) >> 1;
            result = (result + a / result) >> 1;
            return min(result, a / result);
        }
    }

    /**
     * @notice Calculates sqrt(a), following the selected rounding direction.
     */
    function sqrt(uint256 a, Rounding rounding) internal pure returns (uint256) {
        unchecked {
            uint256 result = sqrt(a);
            return result + (unsignedRoundsUp(rounding) && result * result < a ? 1 : 0);
        }
    }

    /**
     * @dev Return the log in base 2 of a positive value rounded towards zero.
     * Returns 0 if given 0.
     */
    function log2(uint256 value) internal pure returns (uint256) {
        uint256 result = 0;
        unchecked {
            if (value >> 128 > 0) {
                value >>= 128;
                result += 128;
            }
            if (value >> 64 > 0) {
                value >>= 64;
                result += 64;
            }
            if (value >> 32 > 0) {
                value >>= 32;
                result += 32;
            }
            if (value >> 16 > 0) {
                value >>= 16;
                result += 16;
            }
            if (value >> 8 > 0) {
                value >>= 8;
                result += 8;
            }
            if (value >> 4 > 0) {
                value >>= 4;
                result += 4;
            }
            if (value >> 2 > 0) {
                value >>= 2;
                result += 2;
            }
            if (value >> 1 > 0) {
                result += 1;
            }
        }
        return result;
    }

    /**
     * @dev Return the log in base 2, following the selected rounding direction, of a positive value.
     * Returns 0 if given 0.
     */
    function log2(uint256 value, Rounding rounding) internal pure returns (uint256) {
        unchecked {
            uint256 result = log2(value);
            return result + (unsignedRoundsUp(rounding) && 1 << result < value ? 1 : 0);
        }
    }

    /**
     * @dev Return the log in base 10 of a positive value rounded towards zero.
     * Returns 0 if given 0.
     */
    function log10(uint256 value) internal pure returns (uint256) {
        uint256 result = 0;
        unchecked {
            if (value >= 10 ** 64) {
                value /= 10 ** 64;
                result += 64;
            }
            if (value >= 10 ** 32) {
                value /= 10 ** 32;
                result += 32;
            }
            if (value >= 10 ** 16) {
                value /= 10 ** 16;
                result += 16;
            }
            if (value >= 10 ** 8) {
                value /= 10 ** 8;
                result += 8;
            }
            if (value >= 10 ** 4) {
                value /= 10 ** 4;
                result += 4;
            }
            if (value >= 10 ** 2) {
                value /= 10 ** 2;
                result += 2;
            }
            if (value >= 10 ** 1) {
                result += 1;
            }
        }
        return result;
    }

    /**
     * @dev Return the log in base 10, following the selected rounding direction, of a positive value.
     * Returns 0 if given 0.
     */
    function log10(uint256 value, Rounding rounding) internal pure returns (uint256) {
        unchecked {
            uint256 result = log10(value);
            return result + (unsignedRoundsUp(rounding) && 10 ** result < value ? 1 : 0);
        }
    }

    /**
     * @dev Return the log in base 256 of a positive value rounded towards zero.
     * Returns 0 if given 0.
     *
     * Adding one to the result gives the number of pairs of hex symbols needed to represent `value` as a hex string.
     */
    function log256(uint256 value) internal pure returns (uint256) {
        uint256 result = 0;
        unchecked {
            if (value >> 128 > 0) {
                value >>= 128;
                result += 16;
            }
            if (value >> 64 > 0) {
                value >>= 64;
                result += 8;
            }
            if (value >> 32 > 0) {
                value >>= 32;
                result += 4;
            }
            if (value >> 16 > 0) {
                value >>= 16;
                result += 2;
            }
            if (value >> 8 > 0) {
                result += 1;
            }
        }
        return result;
    }

    /**
     * @dev Return the log in base 256, following the selected rounding direction, of a positive value.
     * Returns 0 if given 0.
     */
    function log256(uint256 value, Rounding rounding) internal pure returns (uint256) {
        unchecked {
            uint256 result = log256(value);
            return result + (unsignedRoundsUp(rounding) && 1 << (result << 3) < value ? 1 : 0);
        }
    }

    /**
     * @dev Returns whether a provided rounding mode is considered rounding up for unsigned integers.
     */
    function unsignedRoundsUp(Rounding rounding) internal pure returns (bool) {
        return uint8(rounding) % 2 == 1;
    }
}

// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (utils/math/SignedMath.sol)

pragma solidity ^0.8.20;

/**
 * @dev Standard signed math utilities missing in the Solidity language.
 */
library SignedMath {
    /**
     * @dev Returns the largest of two signed numbers.
     */
    function max(int256 a, int256 b) internal pure returns (int256) {
        return a > b ? a : b;
    }

    /**
     * @dev Returns the smallest of two signed numbers.
     */
    function min(int256 a, int256 b) internal pure returns (int256) {
        return a < b ? a : b;
    }

    /**
     * @dev Returns the average of two signed numbers without overflow.
     * The result is rounded towards zero.
     */
    function average(int256 a, int256 b) internal pure returns (int256) {
        // Formula from the book "Hacker's Delight"
        int256 x = (a & b) + ((a ^ b) >> 1);
        return x + (int256(uint256(x) >> 255) & (a ^ b));
    }

    /**
     * @dev Returns the absolute unsigned value of a signed value.
     */
    function abs(int256 n) internal pure returns (uint256) {
        unchecked {
            // must be unchecked in order to support `n = type(int256).min`
            return uint256(n >= 0 ? n : -n);
        }
    }
}

// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (utils/ReentrancyGuard.sol)

pragma solidity ^0.8.20;

/**
 * @dev Contract module that helps prevent reentrant calls to a function.
 *
 * Inheriting from `ReentrancyGuard` will make the {nonReentrant} modifier
 * available, which can be applied to functions to make sure there are no nested
 * (reentrant) calls to them.
 *
 * Note that because there is a single `nonReentrant` guard, functions marked as
 * `nonReentrant` may not call one another. This can be worked around by making
 * those functions `private`, and then adding `external` `nonReentrant` entry
 * points to them.
 *
 * TIP: If you would like to learn more about reentrancy and alternative ways
 * to protect against it, check out our blog post
 * https://blog.openzeppelin.com/reentrancy-after-istanbul/[Reentrancy After Istanbul].
 */
abstract contract ReentrancyGuard {
    // Booleans are more expensive than uint256 or any type that takes up a full
    // word because each write operation emits an extra SLOAD to first read the
    // slot's contents, replace the bits taken up by the boolean, and then write
    // back. This is the compiler's defense against contract upgrades and
    // pointer aliasing, and it cannot be disabled.

    // The values being non-zero value makes deployment a bit more expensive,
    // but in exchange the refund on every call to nonReentrant will be lower in
    // amount. Since refunds are capped to a percentage of the total
    // transaction's gas, it is best to keep them low in cases like this one, to
    // increase the likelihood of the full refund coming into effect.
    uint256 private constant NOT_ENTERED = 1;
    uint256 private constant ENTERED = 2;

    uint256 private _status;

    /**
     * @dev Unauthorized reentrant call.
     */
    error ReentrancyGuardReentrantCall();

    constructor() {
        _status = NOT_ENTERED;
    }

    /**
     * @dev Prevents a contract from calling itself, directly or indirectly.
     * Calling a `nonReentrant` function from another `nonReentrant`
     * function is not supported. It is possible to prevent this from happening
     * by making the `nonReentrant` function external, and making it call a
     * `private` function that does the actual work.
     */
    modifier nonReentrant() {
        _nonReentrantBefore();
        _;
        _nonReentrantAfter();
    }

    function _nonReentrantBefore() private {
        // On the first call to nonReentrant, _status will be NOT_ENTERED
        if (_status == ENTERED) {
            revert ReentrancyGuardReentrantCall();
        }

        // Any calls to nonReentrant after this point will fail
        _status = ENTERED;
    }

    function _nonReentrantAfter() private {
        // By storing the original value once again, a refund is triggered (see
        // https://eips.ethereum.org/EIPS/eip-2200)
        _status = NOT_ENTERED;
    }

    /**
     * @dev Returns true if the reentrancy guard is currently set to "entered", which indicates there is a
     * `nonReentrant` function in the call stack.
     */
    function _reentrancyGuardEntered() internal view returns (bool) {
        return _status == ENTERED;
    }
}

// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (utils/Strings.sol)

pragma solidity ^0.8.20;

import {Math} from "./math/Math.sol";
import {SignedMath} from "./math/SignedMath.sol";

/**
 * @dev String operations.
 */
library Strings {
    bytes16 private constant HEX_DIGITS = "0123456789abcdef";
    uint8 private constant ADDRESS_LENGTH = 20;

    /**
     * @dev The `value` string doesn't fit in the specified `length`.
     */
    error StringsInsufficientHexLength(uint256 value, uint256 length);

    /**
     * @dev Converts a `uint256` to its ASCII `string` decimal representation.
     */
    function toString(uint256 value) internal pure returns (string memory) {
        unchecked {
            uint256 length = Math.log10(value) + 1;
            string memory buffer = new string(length);
            uint256 ptr;
            /// @solidity memory-safe-assembly
            assembly {
                ptr := add(buffer, add(32, length))
            }
            while (true) {
                ptr--;
                /// @solidity memory-safe-assembly
                assembly {
                    mstore8(ptr, byte(mod(value, 10), HEX_DIGITS))
                }
                value /= 10;
                if (value == 0) break;
            }
            return buffer;
        }
    }

    /**
     * @dev Converts a `int256` to its ASCII `string` decimal representation.
     */
    function toStringSigned(int256 value) internal pure returns (string memory) {
        return string.concat(value < 0 ? "-" : "", toString(SignedMath.abs(value)));
    }

    /**
     * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation.
     */
    function toHexString(uint256 value) internal pure returns (string memory) {
        unchecked {
            return toHexString(value, Math.log256(value) + 1);
        }
    }

    /**
     * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation with fixed length.
     */
    function toHexString(uint256 value, uint256 length) internal pure returns (string memory) {
        uint256 localValue = value;
        bytes memory buffer = new bytes(2 * length + 2);
        buffer[0] = "0";
        buffer[1] = "x";
        for (uint256 i = 2 * length + 1; i > 1; --i) {
            buffer[i] = HEX_DIGITS[localValue & 0xf];
            localValue >>= 4;
        }
        if (localValue != 0) {
            revert StringsInsufficientHexLength(value, length);
        }
        return string(buffer);
    }

    /**
     * @dev Converts an `address` with fixed length of 20 bytes to its not checksummed ASCII `string` hexadecimal
     * representation.
     */
    function toHexString(address addr) internal pure returns (string memory) {
        return toHexString(uint256(uint160(addr)), ADDRESS_LENGTH);
    }

    /**
     * @dev Returns true if the two strings are equal.
     */
    function equal(string memory a, string memory b) internal pure returns (bool) {
        return bytes(a).length == bytes(b).length && keccak256(bytes(a)) == keccak256(bytes(b));
    }
}

Settings
{
  "optimizer": {
    "enabled": true,
    "runs": 200
  },
  "evmVersion": "paris",
  "outputSelection": {
    "*": {
      "*": [
        "evm.bytecode",
        "evm.deployedBytecode",
        "devdoc",
        "userdoc",
        "metadata",
        "abi"
      ]
    }
  },
  "libraries": {}
}

Contract Security Audit

Contract ABI

API
[{"inputs":[],"stateMutability":"nonpayable","type":"constructor"},{"inputs":[{"internalType":"address","name":"owner","type":"address"}],"name":"OwnableInvalidOwner","type":"error"},{"inputs":[{"internalType":"address","name":"account","type":"address"}],"name":"OwnableUnauthorizedAccount","type":"error"},{"inputs":[],"name":"ReentrancyGuardReentrantCall","type":"error"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"pool","type":"address"},{"indexed":true,"internalType":"address","name":"user","type":"address"},{"indexed":false,"internalType":"uint256","name":"idx","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"value","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"Stake","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"pool","type":"address"},{"indexed":true,"internalType":"address","name":"user","type":"address"},{"indexed":false,"internalType":"uint256","name":"idx","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"value","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"Unstake","type":"event"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"amountOfStakeRecord","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"},{"internalType":"address","name":"","type":"address"},{"internalType":"uint256","name":"","type":"uint256"},{"internalType":"bytes","name":"","type":"bytes"}],"name":"onERC721Received","outputs":[{"internalType":"bytes4","name":"","type":"bytes4"}],"stateMutability":"pure","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"ownerOfStakeRecord","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"poolOfStakeRecord","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"poolStakePerAmount","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"poolType","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address[]","name":"_pools","type":"address[]"},{"internalType":"uint256[]","name":"_poolType","type":"uint256[]"},{"internalType":"uint256[]","name":"_poolStakePerAmount","type":"uint256[]"},{"internalType":"uint8","name":"decimal","type":"uint8"}],"name":"set","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"stake","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"address","name":"token","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"stake","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"statusOfStakeRecord","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"tokeIdOfStakeRecord","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"totalStake","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"typeOfStakeRecord","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"idx","type":"uint256"}],"name":"unstake","outputs":[],"stateMutability":"nonpayable","type":"function"}]

6080604052348015600f57600080fd5b503380603557604051631e4fbdf760e01b81526000600482015260240160405180910390fd5b603c816045565b50600180556095565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b6112fc806100a46000396000f3fe6080604052600436106100fe5760003560e01c8063715018a611610095578063bb6f12d811610064578063bb6f12d8146102f6578063bdf1878b14610323578063c0a1483114610359578063e4d867a314610386578063f2fde38b146103b357600080fd5b8063715018a61461028d5780638b0e9f3f146102a25780638da5cb5b146102b8578063adc9772e146102d657600080fd5b80632e17de78116100d15780632e17de78146101fd5780633a4b66f11461021d578063660f23041461022557806370d012361461026057600080fd5b80630bf9521f146101035780630dd6490a14610156578063150b7a0214610178578063289d7b62146101bd575b600080fd5b34801561010f57600080fd5b5061013961011e366004610e01565b6004602052600090815260409020546001600160a01b031681565b6040516001600160a01b0390911681526020015b60405180910390f35b34801561016257600080fd5b50610176610171366004610f1f565b6103d3565b005b34801561018457600080fd5b506101a4610193366004611024565b630a85bd0160e11b95945050505050565b6040516001600160e01b0319909116815260200161014d565b3480156101c957600080fd5b506101ed6101d8366004610e01565b60096020526000908152604090205460ff1681565b604051901515815260200161014d565b34801561020957600080fd5b50610176610218366004610e01565b61057f565b61017661081d565b34801561023157600080fd5b50610252610240366004610e01565b60086020526000908152604090205481565b60405190815260200161014d565b34801561026c57600080fd5b5061025261027b366004610e01565b60076020526000908152604090205481565b34801561029957600080fd5b50610176610909565b3480156102ae57600080fd5b50610252600a5481565b3480156102c457600080fd5b506000546001600160a01b0316610139565b3480156102e257600080fd5b506102526102f13660046110c1565b61091b565b34801561030257600080fd5b50610252610311366004610e01565b60056020526000908152604090205481565b34801561032f57600080fd5b5061013961033e366004610e01565b6006602052600090815260409020546001600160a01b031681565b34801561036557600080fd5b506102526103743660046110eb565b60026020526000908152604090205481565b34801561039257600080fd5b506102526103a13660046110eb565b60036020526000908152604090205481565b3480156103bf57600080fd5b506101766103ce3660046110eb565b610c30565b6103db610c6b565b60128160ff1611156104345760405162461bcd60e51b815260206004820152601b60248201527f54686520646563696d616c2076616c75652069732077726f6e672e000000000060448201526064015b60405180910390fd5b6000610441826012611123565b61044c90600a611223565b905060005b855181101561057757600086828151811061046e5761046e611232565b60200260200101519050600086838151811061048c5761048c611232565b6020908102919091018101516001600160a01b038416600090815260029092526040909120549091508015806104c157508082145b61050d5760405162461bcd60e51b815260206004820152601f60248201527f596f752063616e2774206368616e67652074686520706f6f6c20747970652e00604482015260640161042b565b6001600160a01b03831660009081526002602052604090208290558651859088908690811061053e5761053e611232565b60200260200101516105509190611248565b6001600160a01b039093166000908152600360205260409020929092555050600101610451565b505050505050565b610587610c98565b6000818152600460205260409020546001600160a01b031633146105ed5760405162461bcd60e51b815260206004820152601d60248201527f596f752068617665206e6f20726967687420746f20756e7374616b652e000000604482015260640161042b565b60008181526009602052604090205460ff166106405760405162461bcd60e51b81526020600482015260126024820152712cb7ba903430bb32903ab739ba30b5b2b21760711b604482015260640161042b565b6000818152600560209081526040808320546008835281842054600684528285205460048552838620546007865284872054600990965293909520805460ff19169055909390926001600160a01b03918216929091169060018190036106d357604051339086156108fc029087906000818181858888f193505050501580156106cd573d6000803e3d6000fd5b506107bb565b8060020361074c5760405163a9059cbb60e01b8152336004820152602481018690526001600160a01b0384169063a9059cbb906044016020604051808303816000875af1158015610728573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906106cd919061125f565b806003036107bb576040516323b872dd60e01b8152306004820152336024820152604481018590526001600160a01b038416906323b872dd90606401600060405180830381600087803b1580156107a257600080fd5b505af11580156107b6573d6000803e3d6000fd5b505050505b60408051878152602081018790529081018590526001600160a01b0380841691908516907ffe7007b2e89d80edda76299251df08366480cac22e5e260f5e662e850b1f7a329060600160405180910390a3505050505061081a60018055565b50565b610825610c98565b6000805260036020527f3617319a054d772f909f7c479a2cebe5066e836a939412e32403c99029b92eff548061089d5760405162461bcd60e51b815260206004820152601b60248201527f546865207374616b6520706f6f6c2069736e27742065786973742e0000000000604482015260640161042b565b8034146108ec5760405162461bcd60e51b815260206004820152601e60248201527f546865207374616b652076616c7565206d75737420626520657175616c2e0000604482015260640161042b565b6108fc6001600033846000610cc2565b505061090760018055565b565b610911610c6b565b6109076000610db1565b6000610925610c98565b6001600160a01b0383166000908152600260208190526040909120549081148061094f5750806003145b61099b5760405162461bcd60e51b815260206004820152601b60248201527f546865207374616b6520706f6f6c2069736e27742065786973742e0000000000604482015260640161042b565b6001600160a01b0384166000908152600360205260409020546002829003610b95576040516370a0823160e01b81523060048201526000906001600160a01b038716906370a0823190602401602060405180830381865afa158015610a04573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610a289190611281565b6040516323b872dd60e01b8152336004820152306024820152604481018490529091506001600160a01b038716906323b872dd906064016020604051808303816000875af1158015610a7e573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610aa2919061125f565b506040516370a0823160e01b81523060048201526000906001600160a01b038816906370a0823190602401602060405180830381865afa158015610aea573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610b0e9190611281565b9050818111610b5f5760405162461bcd60e51b815260206004820152601e60248201527f546865207265616c207374616b6520616d6f756e74206973207a65726f2e0000604482015260640161042b565b6000610b6b838361129a565b9050610b89858933878510610b805787610b82565b845b6000610cc2565b95505050505050610c21565b81600303610c1a576040516323b872dd60e01b8152336004820152306024820152604481018590526001600160a01b038616906323b872dd90606401600060405180830381600087803b158015610beb57600080fd5b505af1158015610bff573d6000803e3d6000fd5b50505050610c11828633600188610cc2565b92505050610c21565b6000925050505b610c2a60018055565b92915050565b610c38610c6b565b6001600160a01b038116610c6257604051631e4fbdf760e01b81526000600482015260240161042b565b61081a81610db1565b6000546001600160a01b031633146109075760405163118cdaa760e01b815233600482015260240161042b565b600260015403610cbb57604051633ee5aeb560e01b815260040160405180910390fd5b6002600155565b600a805460009182610cd3836112ad565b9091555050600a8054600090815260046020908152604080832080546001600160a01b038a81166001600160a01b0319928316811790935586548652600585528386208a905586548652600685528386208054918d16919092168117909155855485526008845282852088905585548552600784528285208c9055855485526009845293829020805460ff191660011790559354815190815291820187905281018590527f4b22ccaaeb4846ec98072623a51a9070bf1f01c75ac1f8119035f373df852a0c9060600160405180910390a350600a5495945050505050565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b600060208284031215610e1357600080fd5b5035919050565b634e487b7160e01b600052604160045260246000fd5b604051601f8201601f1916810167ffffffffffffffff81118282101715610e5957610e59610e1a565b604052919050565b600067ffffffffffffffff821115610e7b57610e7b610e1a565b5060051b60200190565b80356001600160a01b0381168114610e9c57600080fd5b919050565b600082601f830112610eb257600080fd5b8135610ec5610ec082610e61565b610e30565b8082825260208201915060208360051b860101925085831115610ee757600080fd5b602085015b83811015610f04578035835260209283019201610eec565b5095945050505050565b803560ff81168114610e9c57600080fd5b60008060008060808587031215610f3557600080fd5b843567ffffffffffffffff811115610f4c57600080fd5b8501601f81018713610f5d57600080fd5b8035610f6b610ec082610e61565b8082825260208201915060208360051b850101925089831115610f8d57600080fd5b6020840193505b82841015610fb657610fa584610e85565b825260209384019390910190610f94565b9650505050602085013567ffffffffffffffff811115610fd557600080fd5b610fe187828801610ea1565b935050604085013567ffffffffffffffff811115610ffe57600080fd5b61100a87828801610ea1565b92505061101960608601610f0e565b905092959194509250565b60008060008060006080868803121561103c57600080fd5b61104586610e85565b945061105360208701610e85565b935060408601359250606086013567ffffffffffffffff81111561107657600080fd5b8601601f8101881361108757600080fd5b803567ffffffffffffffff81111561109e57600080fd5b8860208284010111156110b057600080fd5b959894975092955050506020019190565b600080604083850312156110d457600080fd5b6110dd83610e85565b946020939093013593505050565b6000602082840312156110fd57600080fd5b61110682610e85565b9392505050565b634e487b7160e01b600052601160045260246000fd5b60ff8281168282160390811115610c2a57610c2a61110d565b6001815b60018411156111775780850481111561115b5761115b61110d565b600184161561116957908102905b60019390931c928002611140565b935093915050565b60008261118e57506001610c2a565b8161119b57506000610c2a565b81600181146111b157600281146111bb576111d7565b6001915050610c2a565b60ff8411156111cc576111cc61110d565b50506001821b610c2a565b5060208310610133831016604e8410600b84101617156111fa575081810a610c2a565b611207600019848461113c565b806000190482111561121b5761121b61110d565b029392505050565b600061110660ff84168361117f565b634e487b7160e01b600052603260045260246000fd5b8082028115828204841417610c2a57610c2a61110d565b60006020828403121561127157600080fd5b8151801515811461110657600080fd5b60006020828403121561129357600080fd5b5051919050565b81810381811115610c2a57610c2a61110d565b6000600182016112bf576112bf61110d565b506001019056fea2646970667358221220c988079da94e4245cd4296d386e1588167f47d23acafd0588271f91204564def64736f6c634300081a0033

Deployed Bytecode

0x6080604052600436106100fe5760003560e01c8063715018a611610095578063bb6f12d811610064578063bb6f12d8146102f6578063bdf1878b14610323578063c0a1483114610359578063e4d867a314610386578063f2fde38b146103b357600080fd5b8063715018a61461028d5780638b0e9f3f146102a25780638da5cb5b146102b8578063adc9772e146102d657600080fd5b80632e17de78116100d15780632e17de78146101fd5780633a4b66f11461021d578063660f23041461022557806370d012361461026057600080fd5b80630bf9521f146101035780630dd6490a14610156578063150b7a0214610178578063289d7b62146101bd575b600080fd5b34801561010f57600080fd5b5061013961011e366004610e01565b6004602052600090815260409020546001600160a01b031681565b6040516001600160a01b0390911681526020015b60405180910390f35b34801561016257600080fd5b50610176610171366004610f1f565b6103d3565b005b34801561018457600080fd5b506101a4610193366004611024565b630a85bd0160e11b95945050505050565b6040516001600160e01b0319909116815260200161014d565b3480156101c957600080fd5b506101ed6101d8366004610e01565b60096020526000908152604090205460ff1681565b604051901515815260200161014d565b34801561020957600080fd5b50610176610218366004610e01565b61057f565b61017661081d565b34801561023157600080fd5b50610252610240366004610e01565b60086020526000908152604090205481565b60405190815260200161014d565b34801561026c57600080fd5b5061025261027b366004610e01565b60076020526000908152604090205481565b34801561029957600080fd5b50610176610909565b3480156102ae57600080fd5b50610252600a5481565b3480156102c457600080fd5b506000546001600160a01b0316610139565b3480156102e257600080fd5b506102526102f13660046110c1565b61091b565b34801561030257600080fd5b50610252610311366004610e01565b60056020526000908152604090205481565b34801561032f57600080fd5b5061013961033e366004610e01565b6006602052600090815260409020546001600160a01b031681565b34801561036557600080fd5b506102526103743660046110eb565b60026020526000908152604090205481565b34801561039257600080fd5b506102526103a13660046110eb565b60036020526000908152604090205481565b3480156103bf57600080fd5b506101766103ce3660046110eb565b610c30565b6103db610c6b565b60128160ff1611156104345760405162461bcd60e51b815260206004820152601b60248201527f54686520646563696d616c2076616c75652069732077726f6e672e000000000060448201526064015b60405180910390fd5b6000610441826012611123565b61044c90600a611223565b905060005b855181101561057757600086828151811061046e5761046e611232565b60200260200101519050600086838151811061048c5761048c611232565b6020908102919091018101516001600160a01b038416600090815260029092526040909120549091508015806104c157508082145b61050d5760405162461bcd60e51b815260206004820152601f60248201527f596f752063616e2774206368616e67652074686520706f6f6c20747970652e00604482015260640161042b565b6001600160a01b03831660009081526002602052604090208290558651859088908690811061053e5761053e611232565b60200260200101516105509190611248565b6001600160a01b039093166000908152600360205260409020929092555050600101610451565b505050505050565b610587610c98565b6000818152600460205260409020546001600160a01b031633146105ed5760405162461bcd60e51b815260206004820152601d60248201527f596f752068617665206e6f20726967687420746f20756e7374616b652e000000604482015260640161042b565b60008181526009602052604090205460ff166106405760405162461bcd60e51b81526020600482015260126024820152712cb7ba903430bb32903ab739ba30b5b2b21760711b604482015260640161042b565b6000818152600560209081526040808320546008835281842054600684528285205460048552838620546007865284872054600990965293909520805460ff19169055909390926001600160a01b03918216929091169060018190036106d357604051339086156108fc029087906000818181858888f193505050501580156106cd573d6000803e3d6000fd5b506107bb565b8060020361074c5760405163a9059cbb60e01b8152336004820152602481018690526001600160a01b0384169063a9059cbb906044016020604051808303816000875af1158015610728573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906106cd919061125f565b806003036107bb576040516323b872dd60e01b8152306004820152336024820152604481018590526001600160a01b038416906323b872dd90606401600060405180830381600087803b1580156107a257600080fd5b505af11580156107b6573d6000803e3d6000fd5b505050505b60408051878152602081018790529081018590526001600160a01b0380841691908516907ffe7007b2e89d80edda76299251df08366480cac22e5e260f5e662e850b1f7a329060600160405180910390a3505050505061081a60018055565b50565b610825610c98565b6000805260036020527f3617319a054d772f909f7c479a2cebe5066e836a939412e32403c99029b92eff548061089d5760405162461bcd60e51b815260206004820152601b60248201527f546865207374616b6520706f6f6c2069736e27742065786973742e0000000000604482015260640161042b565b8034146108ec5760405162461bcd60e51b815260206004820152601e60248201527f546865207374616b652076616c7565206d75737420626520657175616c2e0000604482015260640161042b565b6108fc6001600033846000610cc2565b505061090760018055565b565b610911610c6b565b6109076000610db1565b6000610925610c98565b6001600160a01b0383166000908152600260208190526040909120549081148061094f5750806003145b61099b5760405162461bcd60e51b815260206004820152601b60248201527f546865207374616b6520706f6f6c2069736e27742065786973742e0000000000604482015260640161042b565b6001600160a01b0384166000908152600360205260409020546002829003610b95576040516370a0823160e01b81523060048201526000906001600160a01b038716906370a0823190602401602060405180830381865afa158015610a04573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610a289190611281565b6040516323b872dd60e01b8152336004820152306024820152604481018490529091506001600160a01b038716906323b872dd906064016020604051808303816000875af1158015610a7e573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610aa2919061125f565b506040516370a0823160e01b81523060048201526000906001600160a01b038816906370a0823190602401602060405180830381865afa158015610aea573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610b0e9190611281565b9050818111610b5f5760405162461bcd60e51b815260206004820152601e60248201527f546865207265616c207374616b6520616d6f756e74206973207a65726f2e0000604482015260640161042b565b6000610b6b838361129a565b9050610b89858933878510610b805787610b82565b845b6000610cc2565b95505050505050610c21565b81600303610c1a576040516323b872dd60e01b8152336004820152306024820152604481018590526001600160a01b038616906323b872dd90606401600060405180830381600087803b158015610beb57600080fd5b505af1158015610bff573d6000803e3d6000fd5b50505050610c11828633600188610cc2565b92505050610c21565b6000925050505b610c2a60018055565b92915050565b610c38610c6b565b6001600160a01b038116610c6257604051631e4fbdf760e01b81526000600482015260240161042b565b61081a81610db1565b6000546001600160a01b031633146109075760405163118cdaa760e01b815233600482015260240161042b565b600260015403610cbb57604051633ee5aeb560e01b815260040160405180910390fd5b6002600155565b600a805460009182610cd3836112ad565b9091555050600a8054600090815260046020908152604080832080546001600160a01b038a81166001600160a01b0319928316811790935586548652600585528386208a905586548652600685528386208054918d16919092168117909155855485526008845282852088905585548552600784528285208c9055855485526009845293829020805460ff191660011790559354815190815291820187905281018590527f4b22ccaaeb4846ec98072623a51a9070bf1f01c75ac1f8119035f373df852a0c9060600160405180910390a350600a5495945050505050565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b600060208284031215610e1357600080fd5b5035919050565b634e487b7160e01b600052604160045260246000fd5b604051601f8201601f1916810167ffffffffffffffff81118282101715610e5957610e59610e1a565b604052919050565b600067ffffffffffffffff821115610e7b57610e7b610e1a565b5060051b60200190565b80356001600160a01b0381168114610e9c57600080fd5b919050565b600082601f830112610eb257600080fd5b8135610ec5610ec082610e61565b610e30565b8082825260208201915060208360051b860101925085831115610ee757600080fd5b602085015b83811015610f04578035835260209283019201610eec565b5095945050505050565b803560ff81168114610e9c57600080fd5b60008060008060808587031215610f3557600080fd5b843567ffffffffffffffff811115610f4c57600080fd5b8501601f81018713610f5d57600080fd5b8035610f6b610ec082610e61565b8082825260208201915060208360051b850101925089831115610f8d57600080fd5b6020840193505b82841015610fb657610fa584610e85565b825260209384019390910190610f94565b9650505050602085013567ffffffffffffffff811115610fd557600080fd5b610fe187828801610ea1565b935050604085013567ffffffffffffffff811115610ffe57600080fd5b61100a87828801610ea1565b92505061101960608601610f0e565b905092959194509250565b60008060008060006080868803121561103c57600080fd5b61104586610e85565b945061105360208701610e85565b935060408601359250606086013567ffffffffffffffff81111561107657600080fd5b8601601f8101881361108757600080fd5b803567ffffffffffffffff81111561109e57600080fd5b8860208284010111156110b057600080fd5b959894975092955050506020019190565b600080604083850312156110d457600080fd5b6110dd83610e85565b946020939093013593505050565b6000602082840312156110fd57600080fd5b61110682610e85565b9392505050565b634e487b7160e01b600052601160045260246000fd5b60ff8281168282160390811115610c2a57610c2a61110d565b6001815b60018411156111775780850481111561115b5761115b61110d565b600184161561116957908102905b60019390931c928002611140565b935093915050565b60008261118e57506001610c2a565b8161119b57506000610c2a565b81600181146111b157600281146111bb576111d7565b6001915050610c2a565b60ff8411156111cc576111cc61110d565b50506001821b610c2a565b5060208310610133831016604e8410600b84101617156111fa575081810a610c2a565b611207600019848461113c565b806000190482111561121b5761121b61110d565b029392505050565b600061110660ff84168361117f565b634e487b7160e01b600052603260045260246000fd5b8082028115828204841417610c2a57610c2a61110d565b60006020828403121561127157600080fd5b8151801515811461110657600080fd5b60006020828403121561129357600080fd5b5051919050565b81810381811115610c2a57610c2a61110d565b6000600182016112bf576112bf61110d565b506001019056fea2646970667358221220c988079da94e4245cd4296d386e1588167f47d23acafd0588271f91204564def64736f6c634300081a0033

Block Transaction Difficulty Gas Used Reward
View All Blocks Produced

Block Uncle Number Difficulty Gas Used Reward
View All Uncles
Loading...
Loading
Loading...
Loading
Loading...
Loading

Validator Index Block Amount
View All Withdrawals

Transaction Hash Block Value Eth2 PubKey Valid
View All Deposits
Loading...
Loading
[ Download: CSV Export  ]
[ Download: CSV Export  ]

A contract address hosts a smart contract, which is a set of code stored on the blockchain that runs when predetermined conditions are met. Learn more about addresses in our Knowledge Base.