ETH Price: $2,811.39 (+4.43%)

Contract

0xF9C00fE7dC7308D45E7BE9835b4d786e0871E08E
 

Overview

ETH Balance

0 ETH

Eth Value

$0.00

Token Holdings

Multichain Info

No addresses found
Transaction Hash
Method
Block
From
To
Transfer From205727022024-08-20 22:05:47180 days ago1724191547IN
0xF9C00fE7...e0871E08E
0 ETH0.00005011.31893637
Transfer From205726862024-08-20 22:02:35180 days ago1724191355IN
0xF9C00fE7...e0871E08E
0 ETH0.000087181.45584207
Transfer From205726842024-08-20 22:02:11180 days ago1724191331IN
0xF9C00fE7...e0871E08E
0 ETH0.00008821.47288847
Transfer From205726822024-08-20 22:01:47180 days ago1724191307IN
0xF9C00fE7...e0871E08E
0 ETH0.000093181.55607457
Transfer From205724912024-08-20 21:23:23180 days ago1724189003IN
0xF9C00fE7...e0871E08E
0 ETH0.000085611.42966819
Set Approval For...205367212024-08-15 21:30:35185 days ago1723757435IN
0xF9C00fE7...e0871E08E
0 ETH0.000204854.42762831
Approve205367182024-08-15 21:29:59185 days ago1723757399IN
0xF9C00fE7...e0871E08E
0 ETH0.000130944.55049543
Approve205367082024-08-15 21:27:59185 days ago1723757279IN
0xF9C00fE7...e0871E08E
0 ETH0.000198274.07337829
Activate Brain205366962024-08-15 21:25:35185 days ago1723757135IN
0xF9C00fE7...e0871E08E
0 ETH0.00072625.53673925
Transfer From200854862024-06-13 21:09:35248 days ago1718312975IN
0xF9C00fE7...e0871E08E
0 ETH0.0006335410.57894921
Redeem Brain199930722024-05-31 23:24:23261 days ago1717197863IN
0xF9C00fE7...e0871E08E
0 ETH0.000629896.36106084
Stake Pepecoin199930412024-05-31 23:18:11261 days ago1717197491IN
0xF9C00fE7...e0871E08E
0 ETH0.000953285.84979638
Set Pepecoin199930342024-05-31 23:16:47261 days ago1717197407IN
0xF9C00fE7...e0871E08E
0 ETH0.000275475.96586293
Mint Labs Brain199930232024-05-31 23:14:35261 days ago1717197275IN
0xF9C00fE7...e0871E08E
0 ETH0.000453346.32199934
Mint Labs Brain199930212024-05-31 23:14:11261 days ago1717197251IN
0xF9C00fE7...e0871E08E
0 ETH0.000490716.39013179
Mint Labs Brain199930202024-05-31 23:13:59261 days ago1717197239IN
0xF9C00fE7...e0871E08E
0 ETH0.000501336.52844756
Mint Labs Brain199930192024-05-31 23:13:47261 days ago1717197227IN
0xF9C00fE7...e0871E08E
0 ETH0.000492446.41264957
Mint Labs Brain199930182024-05-31 23:13:35261 days ago1717197215IN
0xF9C00fE7...e0871E08E
0 ETH0.000431115.61407851
Mint Labs Brain199930142024-05-31 23:12:47261 days ago1717197167IN
0xF9C00fE7...e0871E08E
0 ETH0.000500276.51462341
Mint Labs Brain199930132024-05-31 23:12:35261 days ago1717197155IN
0xF9C00fE7...e0871E08E
0 ETH0.000492816.41757755
Mint Labs Brain199930102024-05-31 23:11:59261 days ago1717197119IN
0xF9C00fE7...e0871E08E
0 ETH0.000694726.25987681
Set Brain Credit...199930062024-05-31 23:11:11261 days ago1717197071IN
0xF9C00fE7...e0871E08E
0 ETH0.000310446.72623452

Latest 1 internal transaction

Advanced mode:
Parent Transaction Hash Block
From
To
205366962024-08-15 21:25:35185 days ago1723757135
0xF9C00fE7...e0871E08E
 Contract Creation0 ETH
Loading...
Loading

Contract Source Code Verified (Exact Match)

Contract Name:
Brains

Compiler Version
v0.8.25+commit.b61c2a91

Optimization Enabled:
Yes with 800 runs

Other Settings:
default evmVersion
File 1 of 19 : ERC721.sol
// SPDX-License-Identifier: MIT
/**
   ____    _    ____  _____ ____       _    ___ 
  | __ )  / \  / ___|| ____|  _ \     / \  |_ _|
  |  _ \ / _ \ \___ \|  _| | | | |   / _ \  | | 
  | |_) / ___ \ ___) | |___| |_| |  / ___ \ | | 
  |____/_/___\_\____/|_____|____/ _/_/   \_\___|
  | __ )|  _ \    / \  |_ _| \ | / ___|         
  |  _ \| |_) |  / _ \  | ||  \| \___ \         
  | |_) |  _ <  / ___ \ | || |\  |___) |        
  |____/|_| \_\/_/   \_\___|_| \_|____/         
*/
pragma solidity ^0.8.0;

import "@openzeppelin/contracts/token/ERC721/ERC721.sol";
import "@openzeppelin/contracts/utils/Strings.sol";
import "@openzeppelin/contracts/token/ERC20/IERC20.sol";
import "@openzeppelin/contracts/security/ReentrancyGuard.sol";
import "@openzeppelin/contracts/token/ERC721/IERC721Receiver.sol";
import "@openzeppelin/contracts/access/Ownable.sol";
import "@openzeppelin/contracts/utils/math/SafeMath.sol";
import "./BrainERC20.sol"; 

interface IBrainCredits {
    function decreaseTotalSupply() external;
    function increaseTotalSupply() external;
}

contract Brains is ERC721, ReentrancyGuard, Ownable, IERC721Receiver {
    using SafeMath for uint256;
    
    address public brainCreditAddress;
    address public pepecoinAddress;
    address[] public contributors;

    mapping(address => uint256) public contributions;
    mapping(uint256 => address) public brainToERC20; 
    mapping(address => uint256) public stakes;
    mapping(uint256 => uint256) public tokenStakeTime;
    mapping(uint256 => string) private _tokenURIs;
    mapping(uint256 => bool) private _blockedTokenIds;

    uint256 public tokenCounter;
    uint256 private constant TOKENS_PER_NFT = 1000 * 10**18; 
    uint256 private constant STAKE_AMOUNT = 100000 * 10**18;
    uint256 private constant STAKE_DURATION = 90 days;
    uint256[] private availableTokenIds;
    uint256 public constant MAX_SUPPLY = 1024;
    
    event BrainMinted(uint256 nftId, address brainFather);
    event ContributionReceived(address contributor, uint256 amount);
    event BrainURIUpdated(uint256 tokenId, string newURI);

    constructor() ERC721("BasedAI Brains", "BRAIN") Ownable(msg.sender) {
        tokenCounter = 0;
    }

    function setBrainCredits(address _brainCreditAddress) public onlyOwner {
        brainCreditAddress = _brainCreditAddress;
    }

    function setPepecoin(address _pepecoinAddress) public onlyOwner {
        pepecoinAddress = _pepecoinAddress;
    }

    function redeemBrain(uint256 amount) public nonReentrant {
        require(brainCreditAddress != address(0), "Specific Brain Credit address not set");
        require(amount >= TOKENS_PER_NFT, "Minimum amount not met");
        require(amount % TOKENS_PER_NFT == 0, "Amount must be in increments of 1000 credits");
        uint256 numNFTs = amount / TOKENS_PER_NFT;
        require(tokenCounter + numNFTs - 1 <= MAX_SUPPLY, "Exceeds maximum supply of Brains");

        IERC20(brainCreditAddress).transferFrom(msg.sender, address(this), amount);

        for (uint256 i = 0; i < numNFTs; i++) {
            uint256 tokenId;
            if (availableTokenIds.length > 0) {
                tokenId = availableTokenIds[availableTokenIds.length - 1];
                availableTokenIds.pop();
            } else {
                unchecked {
                    tokenId = tokenCounter;
                    tokenCounter++;
                }
                
            }
            emit BrainMinted(tokenId, msg.sender);
            _safeMint(msg.sender, tokenId);
        }
    }
    
    function stakePepecoin(uint256 amount) public nonReentrant {
        require(pepecoinAddress != address(0), "Specific Pepecoin address not set");
        require(amount % STAKE_AMOUNT == 0, "Stake amount must be in increments of 100,000 tokens");
        uint256 numNFTs = amount.div(STAKE_AMOUNT);
        require(tokenCounter + numNFTs - 1 <= MAX_SUPPLY, "Exceeds maximum supply of Brains");

        IERC20(pepecoinAddress).transferFrom(msg.sender, address(this), amount);
        stakes[msg.sender] = stakes[msg.sender].add(amount);

        IBrainCredits(brainCreditAddress).decreaseTotalSupply();

        for (uint256 i = 0; i < numNFTs; i++) {
            uint256 tokenId;
            if (availableTokenIds.length > 0) {
                tokenId = availableTokenIds[availableTokenIds.length - 1];
                availableTokenIds.pop();
            } else {
                unchecked {
                    tokenId = tokenCounter;
                    tokenCounter++;
                    if (tokenCounter == 47) tokenCounter++; // reserved for Based Labs
                }
                
            }
            emit BrainMinted(tokenId, msg.sender);
            _safeMint(msg.sender, tokenId);
            tokenStakeTime[tokenId] = block.timestamp;
        }
    }

    function unstakePepecoin(uint256 tokenId) public nonReentrant {
        require(ownerOf(tokenId) == msg.sender, "Only Brain owner can unstake");
        require(block.timestamp >= tokenStakeTime[tokenId] + STAKE_DURATION, "Stake period not yet completed");
        require(stakes[msg.sender] >= STAKE_AMOUNT, "Not enough tokens staked");

        stakes[msg.sender] = stakes[msg.sender].sub(STAKE_AMOUNT);
        IERC20(pepecoinAddress).transfer(msg.sender, STAKE_AMOUNT);
        _burn(tokenId);
        availableTokenIds.push(tokenId);

        IBrainCredits(brainCreditAddress).increaseTotalSupply();
    }

    function activateBrain(uint256 tokenId) public {
        require(ownerOf(tokenId) == msg.sender, "Only Brain owner can link a ERC20");
        require(brainToERC20[tokenId] == address(0), "Brain token has been activated.");
        address erc20Contract = _deployERC20(msg.sender, tokenId); 
        brainToERC20[tokenId] = erc20Contract;
    }

    function _deployERC20(address tokenOwner, uint256 tokenId) internal returns (address) {
        string memory name = string(abi.encodePacked("BRAIN TOKEN #", Strings.toString(tokenId)));
        string memory symbol = string(abi.encodePacked("B#", Strings.toString(tokenId)));
        uint256 initialSupply = 1000000 * 10**18; 
        BrainERC20 newERC20 = new BrainERC20(name, symbol, initialSupply, tokenOwner);
        return address(newERC20);
    }

    function contributeBrainCredits(uint256 amount) public {
        require(brainCreditAddress != address(0), "Brain Credit address not set");
        IERC20(brainCreditAddress).transferFrom(msg.sender, address(this), amount);
        if (contributions[msg.sender] == 0) {
            contributors.push(msg.sender);
        }
        contributions[msg.sender] = contributions[msg.sender].add(amount);
        emit ContributionReceived(msg.sender, amount);
    }

    function collectiveMint() public nonReentrant {
        uint256 totalContributions = 0;
        uint256 totalUsedContributions = 0;
    
        // Calculate total contributions
        for (uint256 i = 0; i < contributors.length; i++) {
            totalContributions += contributions[contributors[i]];
        }
    
        require(totalContributions >= TOKENS_PER_NFT, "Not enough BrainCredits contributed collectively");
        require(tokenCounter < MAX_SUPPLY, "Exceeds maximum supply of Brains");
    
        // Mint the NFT
        uint256 tokenId;
        if (availableTokenIds.length > 0) {
            tokenId = availableTokenIds[availableTokenIds.length - 1];
            availableTokenIds.pop();
        } else {
            unchecked {
                tokenId = tokenCounter;
                tokenCounter++;
                if (tokenCounter == 47) tokenCounter++; // reserved for Based Labs
            }
        }
        emit BrainMinted(tokenId, address(this));
        _safeMint(address(this), tokenId);
        address erc20Contract = _deployERC20(address(this), tokenId);
    
        // Distribute ERC20 tokens based on contributions up to the TOKENS_PER_NFT limit
        for (uint256 i = 0; i < contributors.length && totalUsedContributions < TOKENS_PER_NFT; i++) {
            address contributor = contributors[i];
            uint256 contribution = contributions[contributor];
            if (totalUsedContributions + contribution > TOKENS_PER_NFT) {
                contribution = TOKENS_PER_NFT - totalUsedContributions;
            }
            contributions[contributor] -= contribution;
            totalUsedContributions += contribution;
    
            uint256 share = contribution.mul(1000000 * 10**18).div(TOKENS_PER_NFT);
            BrainERC20(erc20Contract).transfer(contributor, share);
    
            if (totalUsedContributions == TOKENS_PER_NFT) {
                break;
            }
        }
    }
    
    function distributeERC20BasedOnContributions(address erc20Contract, uint256 usedContributions, uint256 totalContributions) internal {
        require(usedContributions > 0, "Used contributions must be greater than zero for distribution");
        require(totalContributions > 0, "Total contributions must be greater than zero for distribution");
    
        for (uint256 i = 0; i < contributors.length; i++) {
            address contributor = contributors[i];
            uint256 contribution = contributions[contributor];
            uint256 share = contribution.mul(1000000 * 10**18).mul(usedContributions).div(totalContributions);
            BrainERC20(erc20Contract).transfer(contributor, share);
        }
    }
    
    function adjustContributionsAfterMint(uint256 usedContributions) internal {
        uint256 totalContributions = 0;
        for (uint256 i = 0; i < contributors.length; i++) {
            totalContributions = totalContributions.add(contributions[contributors[i]]);
        }
    
        uint256 remainingContributions = totalContributions.sub(usedContributions);
        for (uint256 i = 0; i < contributors.length; i++) {
            address contributor = contributors[i];
            uint256 contribution = contributions[contributor];
            uint256 newContribution = contribution.mul(remainingContributions).div(totalContributions);
            contributions[contributor] = newContribution;
        }
    }

    function getTimeUntilWithdrawal(uint256 tokenId) public view returns (uint256) {
        require(ownerOf(tokenId) == msg.sender, "Only the owner can check the time");
        if (block.timestamp >= tokenStakeTime[tokenId] + STAKE_DURATION) {
            return 0;
        } else {
            return (tokenStakeTime[tokenId] + STAKE_DURATION) - block.timestamp;
        }
    }

    function getStakedAmount(address staker) public view returns (uint256) {
        return stakes[staker];
    }

    function mintLabsBrain(uint256 tokenId) public onlyOwner {
        require(tokenId < MAX_SUPPLY, "Token ID exceeds maximum supply");
        require(pepecoinAddress == address(0), "Cannot run after mint start");
        emit BrainMinted(tokenId, msg.sender);
        IBrainCredits(brainCreditAddress).decreaseTotalSupply();
        _safeMint(msg.sender, tokenId);
        if (tokenId != 47) tokenCounter++;
    }
    // Override tokenURI to return the fixed URI for all tokens
    function tokenURI(uint256 tokenId) public view virtual override returns (string memory) {
        if (bytes(_tokenURIs[tokenId]).length > 0) {
            return _tokenURIs[tokenId];
        }
        return "https://ordinals.com/content/f4be79518ebb0283ed37012b42152dedc2bdfe2e7a89267c7448ab36e02bf99ci0";
    }

    // Function to update the URI of a specific token
    function updateBrainURI(uint256 tokenId, string memory newURI) public {
        require(ownerOf(tokenId) == msg.sender || owner() == msg.sender, "Not authorized to update URI");
        require(!_blockedTokenIds[tokenId], "Brain ID is blocked from updating URI");
        _tokenURIs[tokenId] = newURI;
        emit BrainURIUpdated(tokenId, newURI);
    }

    // Function for the contract owner to toggle blocking of specific token IDs from updating their URI
    function toggleBlockBrainUri(uint256 tokenId) public onlyOwner {
        _blockedTokenIds[tokenId] = !_blockedTokenIds[tokenId];
    }

    function totalSupply() public pure returns (uint256) {
        return MAX_SUPPLY;
    }

    // Stub functionality for self-storage of ERC721s 
    function onERC721Received(
        address operator,
        address from,
        uint256 tokenId,
        bytes calldata data
    ) external override returns (bytes4) {
        // Handle the receipt of an ERC721 token
        return this.onERC721Received.selector;
    }

}

File 2 of 19 : BrainERC20.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;

import "@openzeppelin/contracts/token/ERC20/ERC20.sol";
import "@openzeppelin/contracts/access/Ownable.sol";
import "@openzeppelin/contracts/utils/Strings.sol";

contract BrainERC20 is ERC20, Ownable {
    uint256 private constant MAX_SUPPLY = 1000000 * 10 ** 18;

    constructor(string memory name, string memory symbol, uint256 initialSupply, address owner) ERC20(name, symbol) Ownable(owner) {
        transferOwnership(owner);
        require(initialSupply <= MAX_SUPPLY, "Initial supply exceeds maximum supply");
        _mint(owner, initialSupply);
    }

    function mint(address account, uint256 amount) public onlyOwner {
        require(totalSupply() + amount <= MAX_SUPPLY, "Minting would exceed max supply");
        _mint(account, amount);
    }

    function burn(uint256 amount) public onlyOwner {
        _burn(_msgSender(), amount);
    }
}

File 3 of 19 : SafeMath.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.0) (utils/math/SafeMath.sol)

pragma solidity ^0.8.0;

// CAUTION
// This version of SafeMath should only be used with Solidity 0.8 or later,
// because it relies on the compiler's built in overflow checks.

/**
 * @dev Wrappers over Solidity's arithmetic operations.
 *
 * NOTE: `SafeMath` is generally not needed starting with Solidity 0.8, since the compiler
 * now has built in overflow checking.
 */
library SafeMath {
    /**
     * @dev Returns the addition of two unsigned integers, with an overflow flag.
     *
     * _Available since v3.4._
     */
    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.
     *
     * _Available since v3.4._
     */
    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.
     *
     * _Available since v3.4._
     */
    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.
     *
     * _Available since v3.4._
     */
    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.
     *
     * _Available since v3.4._
     */
    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 addition of two unsigned integers, reverting on
     * overflow.
     *
     * Counterpart to Solidity's `+` operator.
     *
     * Requirements:
     *
     * - Addition cannot overflow.
     */
    function add(uint256 a, uint256 b) internal pure returns (uint256) {
        return a + b;
    }

    /**
     * @dev Returns the subtraction of two unsigned integers, reverting on
     * overflow (when the result is negative).
     *
     * Counterpart to Solidity's `-` operator.
     *
     * Requirements:
     *
     * - Subtraction cannot overflow.
     */
    function sub(uint256 a, uint256 b) internal pure returns (uint256) {
        return a - b;
    }

    /**
     * @dev Returns the multiplication of two unsigned integers, reverting on
     * overflow.
     *
     * Counterpart to Solidity's `*` operator.
     *
     * Requirements:
     *
     * - Multiplication cannot overflow.
     */
    function mul(uint256 a, uint256 b) internal pure returns (uint256) {
        return a * b;
    }

    /**
     * @dev Returns the integer division of two unsigned integers, reverting on
     * division by zero. The result is rounded towards zero.
     *
     * Counterpart to Solidity's `/` operator.
     *
     * Requirements:
     *
     * - The divisor cannot be zero.
     */
    function div(uint256 a, uint256 b) internal pure returns (uint256) {
        return a / b;
    }

    /**
     * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo),
     * reverting when dividing by zero.
     *
     * Counterpart to Solidity's `%` operator. This function uses a `revert`
     * opcode (which leaves remaining gas untouched) while Solidity uses an
     * invalid opcode to revert (consuming all remaining gas).
     *
     * Requirements:
     *
     * - The divisor cannot be zero.
     */
    function mod(uint256 a, uint256 b) internal pure returns (uint256) {
        return a % b;
    }

    /**
     * @dev Returns the subtraction of two unsigned integers, reverting with custom message on
     * overflow (when the result is negative).
     *
     * CAUTION: This function is deprecated because it requires allocating memory for the error
     * message unnecessarily. For custom revert reasons use {trySub}.
     *
     * Counterpart to Solidity's `-` operator.
     *
     * Requirements:
     *
     * - Subtraction cannot overflow.
     */
    function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
        unchecked {
            require(b <= a, errorMessage);
            return a - b;
        }
    }

    /**
     * @dev Returns the integer division of two unsigned integers, reverting with custom message on
     * division by zero. The result is rounded towards zero.
     *
     * Counterpart to Solidity's `/` operator. Note: this function uses a
     * `revert` opcode (which leaves remaining gas untouched) while Solidity
     * uses an invalid opcode to revert (consuming all remaining gas).
     *
     * Requirements:
     *
     * - The divisor cannot be zero.
     */
    function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
        unchecked {
            require(b > 0, errorMessage);
            return a / b;
        }
    }

    /**
     * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo),
     * reverting with custom message when dividing by zero.
     *
     * CAUTION: This function is deprecated because it requires allocating memory for the error
     * message unnecessarily. For custom revert reasons use {tryMod}.
     *
     * Counterpart to Solidity's `%` operator. This function uses a `revert`
     * opcode (which leaves remaining gas untouched) while Solidity uses an
     * invalid opcode to revert (consuming all remaining gas).
     *
     * Requirements:
     *
     * - The divisor cannot be zero.
     */
    function mod(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
        unchecked {
            require(b > 0, errorMessage);
            return a % b;
        }
    }
}

File 4 of 19 : Ownable.sol
// 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);
    }
}

File 5 of 19 : 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);
}

File 6 of 19 : ReentrancyGuard.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.0) (security/ReentrancyGuard.sol)

pragma solidity ^0.8.0;

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

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

    uint256 private _status;

    constructor() {
        _status = _NOT_ENTERED;
    }

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

    function _nonReentrantBefore() private {
        // On the first call to nonReentrant, _status will be _NOT_ENTERED
        require(_status != _ENTERED, "ReentrancyGuard: reentrant call");

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

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

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

File 7 of 19 : IERC20.sol
// 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);
}

File 8 of 19 : Strings.sol
// 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));
    }
}

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

pragma solidity ^0.8.20;

import {IERC721} from "./IERC721.sol";
import {IERC721Receiver} from "./IERC721Receiver.sol";
import {IERC721Metadata} from "./extensions/IERC721Metadata.sol";
import {Context} from "../../utils/Context.sol";
import {Strings} from "../../utils/Strings.sol";
import {IERC165, ERC165} from "../../utils/introspection/ERC165.sol";
import {IERC721Errors} from "../../interfaces/draft-IERC6093.sol";

/**
 * @dev Implementation of https://eips.ethereum.org/EIPS/eip-721[ERC721] Non-Fungible Token Standard, including
 * the Metadata extension, but not including the Enumerable extension, which is available separately as
 * {ERC721Enumerable}.
 */
abstract contract ERC721 is Context, ERC165, IERC721, IERC721Metadata, IERC721Errors {
    using Strings for uint256;

    // Token name
    string private _name;

    // Token symbol
    string private _symbol;

    mapping(uint256 tokenId => address) private _owners;

    mapping(address owner => uint256) private _balances;

    mapping(uint256 tokenId => address) private _tokenApprovals;

    mapping(address owner => mapping(address operator => bool)) private _operatorApprovals;

    /**
     * @dev Initializes the contract by setting a `name` and a `symbol` to the token collection.
     */
    constructor(string memory name_, string memory symbol_) {
        _name = name_;
        _symbol = symbol_;
    }

    /**
     * @dev See {IERC165-supportsInterface}.
     */
    function supportsInterface(bytes4 interfaceId) public view virtual override(ERC165, IERC165) returns (bool) {
        return
            interfaceId == type(IERC721).interfaceId ||
            interfaceId == type(IERC721Metadata).interfaceId ||
            super.supportsInterface(interfaceId);
    }

    /**
     * @dev See {IERC721-balanceOf}.
     */
    function balanceOf(address owner) public view virtual returns (uint256) {
        if (owner == address(0)) {
            revert ERC721InvalidOwner(address(0));
        }
        return _balances[owner];
    }

    /**
     * @dev See {IERC721-ownerOf}.
     */
    function ownerOf(uint256 tokenId) public view virtual returns (address) {
        return _requireOwned(tokenId);
    }

    /**
     * @dev See {IERC721Metadata-name}.
     */
    function name() public view virtual returns (string memory) {
        return _name;
    }

    /**
     * @dev See {IERC721Metadata-symbol}.
     */
    function symbol() public view virtual returns (string memory) {
        return _symbol;
    }

    /**
     * @dev See {IERC721Metadata-tokenURI}.
     */
    function tokenURI(uint256 tokenId) public view virtual returns (string memory) {
        _requireOwned(tokenId);

        string memory baseURI = _baseURI();
        return bytes(baseURI).length > 0 ? string.concat(baseURI, tokenId.toString()) : "";
    }

    /**
     * @dev Base URI for computing {tokenURI}. If set, the resulting URI for each
     * token will be the concatenation of the `baseURI` and the `tokenId`. Empty
     * by default, can be overridden in child contracts.
     */
    function _baseURI() internal view virtual returns (string memory) {
        return "";
    }

    /**
     * @dev See {IERC721-approve}.
     */
    function approve(address to, uint256 tokenId) public virtual {
        _approve(to, tokenId, _msgSender());
    }

    /**
     * @dev See {IERC721-getApproved}.
     */
    function getApproved(uint256 tokenId) public view virtual returns (address) {
        _requireOwned(tokenId);

        return _getApproved(tokenId);
    }

    /**
     * @dev See {IERC721-setApprovalForAll}.
     */
    function setApprovalForAll(address operator, bool approved) public virtual {
        _setApprovalForAll(_msgSender(), operator, approved);
    }

    /**
     * @dev See {IERC721-isApprovedForAll}.
     */
    function isApprovedForAll(address owner, address operator) public view virtual returns (bool) {
        return _operatorApprovals[owner][operator];
    }

    /**
     * @dev See {IERC721-transferFrom}.
     */
    function transferFrom(address from, address to, uint256 tokenId) public virtual {
        if (to == address(0)) {
            revert ERC721InvalidReceiver(address(0));
        }
        // Setting an "auth" arguments enables the `_isAuthorized` check which verifies that the token exists
        // (from != 0). Therefore, it is not needed to verify that the return value is not 0 here.
        address previousOwner = _update(to, tokenId, _msgSender());
        if (previousOwner != from) {
            revert ERC721IncorrectOwner(from, tokenId, previousOwner);
        }
    }

    /**
     * @dev See {IERC721-safeTransferFrom}.
     */
    function safeTransferFrom(address from, address to, uint256 tokenId) public {
        safeTransferFrom(from, to, tokenId, "");
    }

    /**
     * @dev See {IERC721-safeTransferFrom}.
     */
    function safeTransferFrom(address from, address to, uint256 tokenId, bytes memory data) public virtual {
        transferFrom(from, to, tokenId);
        _checkOnERC721Received(from, to, tokenId, data);
    }

    /**
     * @dev Returns the owner of the `tokenId`. Does NOT revert if token doesn't exist
     *
     * IMPORTANT: Any overrides to this function that add ownership of tokens not tracked by the
     * core ERC721 logic MUST be matched with the use of {_increaseBalance} to keep balances
     * consistent with ownership. The invariant to preserve is that for any address `a` the value returned by
     * `balanceOf(a)` must be equal to the number of tokens such that `_ownerOf(tokenId)` is `a`.
     */
    function _ownerOf(uint256 tokenId) internal view virtual returns (address) {
        return _owners[tokenId];
    }

    /**
     * @dev Returns the approved address for `tokenId`. Returns 0 if `tokenId` is not minted.
     */
    function _getApproved(uint256 tokenId) internal view virtual returns (address) {
        return _tokenApprovals[tokenId];
    }

    /**
     * @dev Returns whether `spender` is allowed to manage `owner`'s tokens, or `tokenId` in
     * particular (ignoring whether it is owned by `owner`).
     *
     * WARNING: This function assumes that `owner` is the actual owner of `tokenId` and does not verify this
     * assumption.
     */
    function _isAuthorized(address owner, address spender, uint256 tokenId) internal view virtual returns (bool) {
        return
            spender != address(0) &&
            (owner == spender || isApprovedForAll(owner, spender) || _getApproved(tokenId) == spender);
    }

    /**
     * @dev Checks if `spender` can operate on `tokenId`, assuming the provided `owner` is the actual owner.
     * Reverts if `spender` does not have approval from the provided `owner` for the given token or for all its assets
     * the `spender` for the specific `tokenId`.
     *
     * WARNING: This function assumes that `owner` is the actual owner of `tokenId` and does not verify this
     * assumption.
     */
    function _checkAuthorized(address owner, address spender, uint256 tokenId) internal view virtual {
        if (!_isAuthorized(owner, spender, tokenId)) {
            if (owner == address(0)) {
                revert ERC721NonexistentToken(tokenId);
            } else {
                revert ERC721InsufficientApproval(spender, tokenId);
            }
        }
    }

    /**
     * @dev Unsafe write access to the balances, used by extensions that "mint" tokens using an {ownerOf} override.
     *
     * NOTE: the value is limited to type(uint128).max. This protect against _balance overflow. It is unrealistic that
     * a uint256 would ever overflow from increments when these increments are bounded to uint128 values.
     *
     * WARNING: Increasing an account's balance using this function tends to be paired with an override of the
     * {_ownerOf} function to resolve the ownership of the corresponding tokens so that balances and ownership
     * remain consistent with one another.
     */
    function _increaseBalance(address account, uint128 value) internal virtual {
        unchecked {
            _balances[account] += value;
        }
    }

    /**
     * @dev Transfers `tokenId` from its current owner to `to`, or alternatively mints (or burns) if the current owner
     * (or `to`) is the zero address. Returns the owner of the `tokenId` before the update.
     *
     * The `auth` argument is optional. If the value passed is non 0, then this function will check that
     * `auth` is either the owner of the token, or approved to operate on the token (by the owner).
     *
     * Emits a {Transfer} event.
     *
     * NOTE: If overriding this function in a way that tracks balances, see also {_increaseBalance}.
     */
    function _update(address to, uint256 tokenId, address auth) internal virtual returns (address) {
        address from = _ownerOf(tokenId);

        // Perform (optional) operator check
        if (auth != address(0)) {
            _checkAuthorized(from, auth, tokenId);
        }

        // Execute the update
        if (from != address(0)) {
            // Clear approval. No need to re-authorize or emit the Approval event
            _approve(address(0), tokenId, address(0), false);

            unchecked {
                _balances[from] -= 1;
            }
        }

        if (to != address(0)) {
            unchecked {
                _balances[to] += 1;
            }
        }

        _owners[tokenId] = to;

        emit Transfer(from, to, tokenId);

        return from;
    }

    /**
     * @dev Mints `tokenId` and transfers it to `to`.
     *
     * WARNING: Usage of this method is discouraged, use {_safeMint} whenever possible
     *
     * Requirements:
     *
     * - `tokenId` must not exist.
     * - `to` cannot be the zero address.
     *
     * Emits a {Transfer} event.
     */
    function _mint(address to, uint256 tokenId) internal {
        if (to == address(0)) {
            revert ERC721InvalidReceiver(address(0));
        }
        address previousOwner = _update(to, tokenId, address(0));
        if (previousOwner != address(0)) {
            revert ERC721InvalidSender(address(0));
        }
    }

    /**
     * @dev Mints `tokenId`, transfers it to `to` and checks for `to` acceptance.
     *
     * Requirements:
     *
     * - `tokenId` must not exist.
     * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer.
     *
     * Emits a {Transfer} event.
     */
    function _safeMint(address to, uint256 tokenId) internal {
        _safeMint(to, tokenId, "");
    }

    /**
     * @dev Same as {xref-ERC721-_safeMint-address-uint256-}[`_safeMint`], with an additional `data` parameter which is
     * forwarded in {IERC721Receiver-onERC721Received} to contract recipients.
     */
    function _safeMint(address to, uint256 tokenId, bytes memory data) internal virtual {
        _mint(to, tokenId);
        _checkOnERC721Received(address(0), to, tokenId, data);
    }

    /**
     * @dev Destroys `tokenId`.
     * The approval is cleared when the token is burned.
     * This is an internal function that does not check if the sender is authorized to operate on the token.
     *
     * Requirements:
     *
     * - `tokenId` must exist.
     *
     * Emits a {Transfer} event.
     */
    function _burn(uint256 tokenId) internal {
        address previousOwner = _update(address(0), tokenId, address(0));
        if (previousOwner == address(0)) {
            revert ERC721NonexistentToken(tokenId);
        }
    }

    /**
     * @dev Transfers `tokenId` from `from` to `to`.
     *  As opposed to {transferFrom}, this imposes no restrictions on msg.sender.
     *
     * Requirements:
     *
     * - `to` cannot be the zero address.
     * - `tokenId` token must be owned by `from`.
     *
     * Emits a {Transfer} event.
     */
    function _transfer(address from, address to, uint256 tokenId) internal {
        if (to == address(0)) {
            revert ERC721InvalidReceiver(address(0));
        }
        address previousOwner = _update(to, tokenId, address(0));
        if (previousOwner == address(0)) {
            revert ERC721NonexistentToken(tokenId);
        } else if (previousOwner != from) {
            revert ERC721IncorrectOwner(from, tokenId, previousOwner);
        }
    }

    /**
     * @dev Safely transfers `tokenId` token from `from` to `to`, checking that contract recipients
     * are aware of the ERC721 standard to prevent tokens from being forever locked.
     *
     * `data` is additional data, it has no specified format and it is sent in call to `to`.
     *
     * This internal function is like {safeTransferFrom} in the sense that it invokes
     * {IERC721Receiver-onERC721Received} on the receiver, and can be used to e.g.
     * implement alternative mechanisms to perform token transfer, such as signature-based.
     *
     * Requirements:
     *
     * - `tokenId` token must exist and be owned by `from`.
     * - `to` cannot be the zero address.
     * - `from` cannot be the zero address.
     * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer.
     *
     * Emits a {Transfer} event.
     */
    function _safeTransfer(address from, address to, uint256 tokenId) internal {
        _safeTransfer(from, to, tokenId, "");
    }

    /**
     * @dev Same as {xref-ERC721-_safeTransfer-address-address-uint256-}[`_safeTransfer`], with an additional `data` parameter which is
     * forwarded in {IERC721Receiver-onERC721Received} to contract recipients.
     */
    function _safeTransfer(address from, address to, uint256 tokenId, bytes memory data) internal virtual {
        _transfer(from, to, tokenId);
        _checkOnERC721Received(from, to, tokenId, data);
    }

    /**
     * @dev Approve `to` to operate on `tokenId`
     *
     * The `auth` argument is optional. If the value passed is non 0, then this function will check that `auth` is
     * either the owner of the token, or approved to operate on all tokens held by this owner.
     *
     * Emits an {Approval} event.
     *
     * Overrides to this logic should be done to the variant with an additional `bool emitEvent` argument.
     */
    function _approve(address to, uint256 tokenId, address auth) internal {
        _approve(to, tokenId, auth, true);
    }

    /**
     * @dev Variant of `_approve` with an optional flag to enable or disable the {Approval} event. The event is not
     * emitted in the context of transfers.
     */
    function _approve(address to, uint256 tokenId, address auth, bool emitEvent) internal virtual {
        // Avoid reading the owner unless necessary
        if (emitEvent || auth != address(0)) {
            address owner = _requireOwned(tokenId);

            // We do not use _isAuthorized because single-token approvals should not be able to call approve
            if (auth != address(0) && owner != auth && !isApprovedForAll(owner, auth)) {
                revert ERC721InvalidApprover(auth);
            }

            if (emitEvent) {
                emit Approval(owner, to, tokenId);
            }
        }

        _tokenApprovals[tokenId] = to;
    }

    /**
     * @dev Approve `operator` to operate on all of `owner` tokens
     *
     * Requirements:
     * - operator can't be the address zero.
     *
     * Emits an {ApprovalForAll} event.
     */
    function _setApprovalForAll(address owner, address operator, bool approved) internal virtual {
        if (operator == address(0)) {
            revert ERC721InvalidOperator(operator);
        }
        _operatorApprovals[owner][operator] = approved;
        emit ApprovalForAll(owner, operator, approved);
    }

    /**
     * @dev Reverts if the `tokenId` doesn't have a current owner (it hasn't been minted, or it has been burned).
     * Returns the owner.
     *
     * Overrides to ownership logic should be done to {_ownerOf}.
     */
    function _requireOwned(uint256 tokenId) internal view returns (address) {
        address owner = _ownerOf(tokenId);
        if (owner == address(0)) {
            revert ERC721NonexistentToken(tokenId);
        }
        return owner;
    }

    /**
     * @dev Private function to invoke {IERC721Receiver-onERC721Received} on a target address. This will revert if the
     * recipient doesn't accept the token transfer. The call is not executed if the target address is not a contract.
     *
     * @param from address representing the previous owner of the given token ID
     * @param to target address that will receive the tokens
     * @param tokenId uint256 ID of the token to be transferred
     * @param data bytes optional data to send along with the call
     */
    function _checkOnERC721Received(address from, address to, uint256 tokenId, bytes memory data) private {
        if (to.code.length > 0) {
            try IERC721Receiver(to).onERC721Received(_msgSender(), from, tokenId, data) returns (bytes4 retval) {
                if (retval != IERC721Receiver.onERC721Received.selector) {
                    revert ERC721InvalidReceiver(to);
                }
            } catch (bytes memory reason) {
                if (reason.length == 0) {
                    revert ERC721InvalidReceiver(to);
                } else {
                    /// @solidity memory-safe-assembly
                    assembly {
                        revert(add(32, reason), mload(reason))
                    }
                }
            }
        }
    }
}

File 10 of 19 : ERC20.sol
// 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);
            }
        }
    }
}

File 11 of 19 : SignedMath.sol
// 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);
        }
    }
}

File 12 of 19 : Math.sol
// 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;
    }
}

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

File 14 of 19 : ERC165.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (utils/introspection/ERC165.sol)

pragma solidity ^0.8.20;

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

/**
 * @dev Implementation of the {IERC165} interface.
 *
 * Contracts that want to implement ERC165 should inherit from this contract and override {supportsInterface} to check
 * for the additional interface id that will be supported. For example:
 *
 * ```solidity
 * function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {
 *     return interfaceId == type(MyInterface).interfaceId || super.supportsInterface(interfaceId);
 * }
 * ```
 */
abstract contract ERC165 is IERC165 {
    /**
     * @dev See {IERC165-supportsInterface}.
     */
    function supportsInterface(bytes4 interfaceId) public view virtual returns (bool) {
        return interfaceId == type(IERC165).interfaceId;
    }
}

File 15 of 19 : Context.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (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;
    }
}

File 16 of 19 : IERC721Metadata.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (token/ERC721/extensions/IERC721Metadata.sol)

pragma solidity ^0.8.20;

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

/**
 * @title ERC-721 Non-Fungible Token Standard, optional metadata extension
 * @dev See https://eips.ethereum.org/EIPS/eip-721
 */
interface IERC721Metadata is IERC721 {
    /**
     * @dev Returns the token collection name.
     */
    function name() external view returns (string memory);

    /**
     * @dev Returns the token collection symbol.
     */
    function symbol() external view returns (string memory);

    /**
     * @dev Returns the Uniform Resource Identifier (URI) for `tokenId` token.
     */
    function tokenURI(uint256 tokenId) external view returns (string memory);
}

File 17 of 19 : IERC721.sol
// 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 18 of 19 : IERC165.sol
// 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);
}

File 19 of 19 : IERC20Metadata.sol
// 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);
}

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

Contract Security Audit

Contract ABI

[{"inputs":[],"stateMutability":"nonpayable","type":"constructor"},{"inputs":[{"internalType":"address","name":"sender","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"address","name":"owner","type":"address"}],"name":"ERC721IncorrectOwner","type":"error"},{"inputs":[{"internalType":"address","name":"operator","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"ERC721InsufficientApproval","type":"error"},{"inputs":[{"internalType":"address","name":"approver","type":"address"}],"name":"ERC721InvalidApprover","type":"error"},{"inputs":[{"internalType":"address","name":"operator","type":"address"}],"name":"ERC721InvalidOperator","type":"error"},{"inputs":[{"internalType":"address","name":"owner","type":"address"}],"name":"ERC721InvalidOwner","type":"error"},{"inputs":[{"internalType":"address","name":"receiver","type":"address"}],"name":"ERC721InvalidReceiver","type":"error"},{"inputs":[{"internalType":"address","name":"sender","type":"address"}],"name":"ERC721InvalidSender","type":"error"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"ERC721NonexistentToken","type":"error"},{"inputs":[{"internalType":"address","name":"owner","type":"address"}],"name":"OwnableInvalidOwner","type":"error"},{"inputs":[{"internalType":"address","name":"account","type":"address"}],"name":"OwnableUnauthorizedAccount","type":"error"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"owner","type":"address"},{"indexed":true,"internalType":"address","name":"approved","type":"address"},{"indexed":true,"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"Approval","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"owner","type":"address"},{"indexed":true,"internalType":"address","name":"operator","type":"address"},{"indexed":false,"internalType":"bool","name":"approved","type":"bool"}],"name":"ApprovalForAll","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"nftId","type":"uint256"},{"indexed":false,"internalType":"address","name":"brainFather","type":"address"}],"name":"BrainMinted","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"tokenId","type":"uint256"},{"indexed":false,"internalType":"string","name":"newURI","type":"string"}],"name":"BrainURIUpdated","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"contributor","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"ContributionReceived","type":"event"},{"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":"from","type":"address"},{"indexed":true,"internalType":"address","name":"to","type":"address"},{"indexed":true,"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"Transfer","type":"event"},{"inputs":[],"name":"MAX_SUPPLY","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"activateBrain","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"approve","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"}],"name":"balanceOf","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"brainCreditAddress","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"brainToERC20","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"collectiveMint","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"contributeBrainCredits","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"contributions","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"contributors","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"getApproved","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"staker","type":"address"}],"name":"getStakedAmount","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"getTimeUntilWithdrawal","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"},{"internalType":"address","name":"operator","type":"address"}],"name":"isApprovedForAll","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"mintLabsBrain","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"name","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"operator","type":"address"},{"internalType":"address","name":"from","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"bytes","name":"data","type":"bytes"}],"name":"onERC721Received","outputs":[{"internalType":"bytes4","name":"","type":"bytes4"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"ownerOf","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"pepecoinAddress","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"redeemBrain","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"safeTransferFrom","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"bytes","name":"data","type":"bytes"}],"name":"safeTransferFrom","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"operator","type":"address"},{"internalType":"bool","name":"approved","type":"bool"}],"name":"setApprovalForAll","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_brainCreditAddress","type":"address"}],"name":"setBrainCredits","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_pepecoinAddress","type":"address"}],"name":"setPepecoin","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"stakePepecoin","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"stakes","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes4","name":"interfaceId","type":"bytes4"}],"name":"supportsInterface","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"symbol","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"toggleBlockBrainUri","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"tokenCounter","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"tokenStakeTime","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"tokenURI","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"totalSupply","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"pure","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"transferFrom","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"unstakePepecoin","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"string","name":"newURI","type":"string"}],"name":"updateBrainURI","outputs":[],"stateMutability":"nonpayable","type":"function"}]

608060405234801561000f575f80fd5b50336040518060400160405280600e81526020016d4261736564414920427261696e7360901b81525060405180604001604052806005815260200164212920a4a760d91b815250815f908161006491906101a2565b50600161007182826101a2565b50506001600655506001600160a01b0381166100a657604051631e4fbdf760e01b81525f600482015260240160405180910390fd5b6100af816100b9565b505f601155610261565b600780546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0905f90a35050565b634e487b7160e01b5f52604160045260245ffd5b600181811c9082168061013257607f821691505b60208210810361015057634e487b7160e01b5f52602260045260245ffd5b50919050565b601f82111561019d57805f5260205f20601f840160051c8101602085101561017b5750805b601f840160051c820191505b8181101561019a575f8155600101610187565b50505b505050565b81516001600160401b038111156101bb576101bb61010a565b6101cf816101c9845461011e565b84610156565b602080601f831160018114610202575f84156101eb5750858301515b5f19600386901b1c1916600185901b178555610259565b5f85815260208120601f198616915b8281101561023057888601518255948401946001909101908401610211565b508582101561024d57878501515f19600388901b60f8161c191681555b505060018460011b0185555b505050505050565b613cc38061026e5f395ff3fe608060405234801561000f575f80fd5b50600436106102b7575f3560e01c806370a0823111610171578063a43275bd116100d2578063d082e38111610088578063ee2231991161006e578063ee22319914610606578063f2fde38b14610625578063fa7f1db814610638575f80fd5b8063d082e381146105c2578063e985e9c5146105cb575f80fd5b8063c3edd884116100b8578063c3edd88414610594578063c87b56dd146105a7578063cd07c6aa146105ba575f80fd5b8063a43275bd1461056e578063b88d4fde14610581575f80fd5b80638da5cb5b1161012757806397d7cef41161010d57806397d7cef41461053557806398462b6814610548578063a22cb4651461055b575f80fd5b80638da5cb5b1461051c57806395d89b411461052d575f80fd5b806379e8a6041161015757806379e8a604146104ce5780637ca77d9f146104f657806387d5ec8e14610509575f80fd5b806370a08231146104b3578063715018a6146104c6575f80fd5b806334ad35011161021b5780634da6a556116101d157806352ed33c3116101b757806352ed33c31461047a57806353917a4d1461048d5780636352211e146104a0575f80fd5b80634da6a5561461043f5780634ddfb0f214610467575f80fd5b80633cb5d100116102015780633cb5d100146103fa57806342842e0e1461040d57806342e94c9014610420575f80fd5b806334ad3501146103d45780633765af0b146103e7575f80fd5b806316934fc41161027057806323b872dd1161025657806323b872dd146103a55780632b3ae25c146103b857806332cb6b0c146103cb575f80fd5b806316934fc41461037057806318160ddd1461039d575f80fd5b8063081812fc116102a0578063081812fc146102f8578063095ea7b314610323578063150b7a0214610338575f80fd5b806301ffc9a7146102bb57806306fdde03146102e3575b5f80fd5b6102ce6102c9366004612653565b61064b565b60405190151581526020015b60405180910390f35b6102eb61069c565b6040516102da919061269c565b61030b6103063660046126ae565b61072b565b6040516001600160a01b0390911681526020016102da565b6103366103313660046126db565b610752565b005b610357610346366004612703565b630a85bd0160e11b95945050505050565b6040516001600160e01b031990911681526020016102da565b61038f61037e366004612796565b600d6020525f908152604090205481565b6040519081526020016102da565b61040061038f565b6103366103b33660046127af565b610761565b61038f6103c63660046126ae565b6107ef565b61038f61040081565b6103366103e23660046126ae565b6108b0565b6103366103f536600461286f565b6108d7565b61030b6104083660046126ae565b610a34565b61033661041b3660046127af565b610a5c565b61038f61042e366004612796565b600b6020525f908152604090205481565b61038f61044d366004612796565b6001600160a01b03165f908152600d602052604090205490565b6103366104753660046126ae565b610a7b565b6103366104883660046126ae565b610d08565b61033661049b366004612796565b610e98565b61030b6104ae3660046126ae565b610ec2565b61038f6104c1366004612796565b610ecc565b610336610f11565b61030b6104dc3660046126ae565b600c6020525f90815260409020546001600160a01b031681565b60095461030b906001600160a01b031681565b6103366105173660046126ae565b610f24565b6007546001600160a01b031661030b565b6102eb611281565b6103366105433660046126ae565b611290565b60085461030b906001600160a01b031681565b6103366105693660046128d3565b611398565b61033661057c3660046126ae565b6113a3565b61033661058f366004612908565b6116c2565b6103366105a23660046126ae565b6116d9565b6102eb6105b53660046126ae565b61184e565b61033661192d565b61038f60115481565b6102ce6105d936600461297f565b6001600160a01b039182165f90815260056020908152604080832093909416825291909152205460ff1690565b61038f6106143660046126ae565b600e6020525f908152604090205481565b610336610633366004612796565b611cd1565b610336610646366004612796565b611d0b565b5f6001600160e01b031982166380ac58cd60e01b148061067b57506001600160e01b03198216635b5e139f60e01b145b8061069657506301ffc9a760e01b6001600160e01b03198316145b92915050565b60605f80546106aa906129b0565b80601f01602080910402602001604051908101604052809291908181526020018280546106d6906129b0565b80156107215780601f106106f857610100808354040283529160200191610721565b820191905f5260205f20905b81548152906001019060200180831161070457829003601f168201915b5050505050905090565b5f61073582611d35565b505f828152600460205260409020546001600160a01b0316610696565b61075d828233611d6d565b5050565b6001600160a01b03821661078f57604051633250574960e11b81525f60048201526024015b60405180910390fd5b5f61079b838333611d7a565b9050836001600160a01b0316816001600160a01b0316146107e9576040516364283d7b60e01b81526001600160a01b0380861660048301526024820184905282166044820152606401610786565b50505050565b5f336107fa83610ec2565b6001600160a01b03161461085a5760405162461bcd60e51b815260206004820152602160248201527f4f6e6c7920746865206f776e65722063616e20636865636b207468652074696d6044820152606560f81b6064820152608401610786565b5f828152600e6020526040902054610876906276a700906129fc565b421061088357505f919050565b5f828152600e602052604090205442906108a1906276a700906129fc565b6106969190612a0f565b919050565b6108b8611e6c565b5f908152601060205260409020805460ff19811660ff90911615179055565b336108e183610ec2565b6001600160a01b0316148061090f5750336109046007546001600160a01b031690565b6001600160a01b0316145b61095b5760405162461bcd60e51b815260206004820152601c60248201527f4e6f7420617574686f72697a656420746f2075706461746520555249000000006044820152606401610786565b5f8281526010602052604090205460ff16156109df5760405162461bcd60e51b815260206004820152602560248201527f427261696e20494420697320626c6f636b65642066726f6d207570646174696e60448201527f67205552490000000000000000000000000000000000000000000000000000006064820152608401610786565b5f828152600f602052604090206109f68282612a66565b507f2711e4c38562f558a1dbf8d9d2d9810789462585e6a5d6ca11d98d3fc5df31e28282604051610a28929190612b26565b60405180910390a15050565b600a8181548110610a43575f80fd5b5f918252602090912001546001600160a01b0316905081565b610a7683838360405180602001604052805f8152506116c2565b505050565b610a83611e99565b33610a8d82610ec2565b6001600160a01b031614610ae35760405162461bcd60e51b815260206004820152601c60248201527f4f6e6c7920427261696e206f776e65722063616e20756e7374616b65000000006044820152606401610786565b5f818152600e6020526040902054610aff906276a700906129fc565b421015610b4e5760405162461bcd60e51b815260206004820152601e60248201527f5374616b6520706572696f64206e6f742079657420636f6d706c6574656400006044820152606401610786565b335f908152600d602052604090205469152d02c7e14af68000001115610bb65760405162461bcd60e51b815260206004820152601860248201527f4e6f7420656e6f75676820746f6b656e73207374616b656400000000000000006044820152606401610786565b335f908152600d6020526040902054610bd99069152d02c7e14af6800000611ef2565b335f818152600d60205260409081902092909255600954915163a9059cbb60e01b8152600481019190915269152d02c7e14af680000060248201526001600160a01b039091169063a9059cbb906044016020604051808303815f875af1158015610c45573d5f803e3d5ffd5b505050506040513d601f19601f82011682018060405250810190610c699190612b3e565b50610c7381611f04565b601280546001810182555f9182527fbb8a6a4669ba250d26cd7a459eca9d215f8307e33aebe50379bc5a3617ec3444018290556008546040805163de0f2be160e01b815290516001600160a01b039092169263de0f2be19260048084019382900301818387803b158015610ce5575f80fd5b505af1158015610cf7573d5f803e3d5ffd5b50505050610d056001600655565b50565b6008546001600160a01b0316610d605760405162461bcd60e51b815260206004820152601c60248201527f427261696e204372656469742061646472657373206e6f7420736574000000006044820152606401610786565b6008546040516323b872dd60e01b8152336004820152306024820152604481018390526001600160a01b03909116906323b872dd906064016020604051808303815f875af1158015610db4573d5f803e3d5ffd5b505050506040513d601f19601f82011682018060405250810190610dd89190612b3e565b50335f908152600b60205260408120549003610e3057600a80546001810182555f919091527fc65a7bb8d6351c1cf70c95a316cc6a92839c986682d98bc35f958f4883f9d2a80180546001600160a01b031916331790555b335f908152600b6020526040902054610e499082611f3c565b335f818152600b60209081526040918290209390935580519182529181018390527f1bb460ccaaf70fbacfec17a376f8acbd278c1405590ffcc8ebe4b88daf4f64ad910160405180910390a150565b610ea0611e6c565b600880546001600160a01b0319166001600160a01b0392909216919091179055565b5f61069682611d35565b5f6001600160a01b038216610ef6576040516322718ad960e21b81525f6004820152602401610786565b506001600160a01b03165f9081526003602052604090205490565b610f19611e6c565b610f225f611f47565b565b610f2c611e99565b6009546001600160a01b0316610f8e5760405162461bcd60e51b815260206004820152602160248201527f53706563696669632050657065636f696e2061646472657373206e6f742073656044820152601d60fa1b6064820152608401610786565b610fa269152d02c7e14af680000082612b6d565b156110155760405162461bcd60e51b815260206004820152603460248201527f5374616b6520616d6f756e74206d75737420626520696e20696e6372656d656e60448201527f7473206f66203130302c30303020746f6b656e730000000000000000000000006064820152608401610786565b5f61102a8269152d02c7e14af6800000611f98565b905061040060018260115461103f91906129fc565b6110499190612a0f565b11156110975760405162461bcd60e51b815260206004820181905260248201527f45786365656473206d6178696d756d20737570706c79206f6620427261696e736044820152606401610786565b6009546040516323b872dd60e01b8152336004820152306024820152604481018490526001600160a01b03909116906323b872dd906064016020604051808303815f875af11580156110eb573d5f803e3d5ffd5b505050506040513d601f19601f8201168201806040525081019061110f9190612b3e565b50335f908152600d60205260409020546111299083611f3c565b335f908152600d60205260408082209290925560085482516390578ae160e01b815292516001600160a01b03909116926390578ae192600480830193919282900301818387803b15801561117b575f80fd5b505af115801561118d573d5f803e3d5ffd5b505050505f5b81811015611275576012545f90156111f957601280546111b590600190612a0f565b815481106111c5576111c5612b80565b905f5260205f200154905060128054806111e1576111e1612b94565b600190038181905f5260205f20015f9055905561121b565b5060118054600181019091555f19602f8290030161121b576011805460010190555b604080518281523360208201527f565d5be3c5d9b8fce8cebcd35e95027d3d05547e683e3d6fdb0f0e49d33db90d910160405180910390a161125d3382611fa3565b5f908152600e60205260409020429055600101611193565b5050610d056001600655565b6060600180546106aa906129b0565b3361129a82610ec2565b6001600160a01b0316146112fa5760405162461bcd60e51b815260206004820152602160248201527f4f6e6c7920427261696e206f776e65722063616e206c696e6b206120455243326044820152600360fc1b6064820152608401610786565b5f818152600c60205260409020546001600160a01b03161561135e5760405162461bcd60e51b815260206004820152601f60248201527f427261696e20746f6b656e20686173206265656e206163746976617465642e006044820152606401610786565b5f6113693383611fbc565b5f928352600c602052604090922080546001600160a01b0319166001600160a01b039093169290921790915550565b61075d338383612064565b6113ab611e99565b6008546001600160a01b03166114295760405162461bcd60e51b815260206004820152602560248201527f537065636966696320427261696e204372656469742061646472657373206e6f60448201527f74207365740000000000000000000000000000000000000000000000000000006064820152608401610786565b683635c9adc5dea000008110156114825760405162461bcd60e51b815260206004820152601660248201527f4d696e696d756d20616d6f756e74206e6f74206d6574000000000000000000006044820152606401610786565b611495683635c9adc5dea0000082612b6d565b156115085760405162461bcd60e51b815260206004820152602c60248201527f416d6f756e74206d75737420626520696e20696e6372656d656e7473206f662060448201527f31303030206372656469747300000000000000000000000000000000000000006064820152608401610786565b5f61151c683635c9adc5dea0000083612ba8565b905061040060018260115461153191906129fc565b61153b9190612a0f565b11156115895760405162461bcd60e51b815260206004820181905260248201527f45786365656473206d6178696d756d20737570706c79206f6620427261696e736044820152606401610786565b6008546040516323b872dd60e01b8152336004820152306024820152604481018490526001600160a01b03909116906323b872dd906064016020604051808303815f875af11580156115dd573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906116019190612b3e565b505f5b81811015611275576012545f901561166a576012805461162690600190612a0f565b8154811061163657611636612b80565b905f5260205f2001549050601280548061165257611652612b94565b600190038181905f5260205f20015f90559055611677565b5060118054600181019091555b604080518281523360208201527f565d5be3c5d9b8fce8cebcd35e95027d3d05547e683e3d6fdb0f0e49d33db90d910160405180910390a16116b93382611fa3565b50600101611604565b6116cd848484610761565b6107e984848484612102565b6116e1611e6c565b61040081106117325760405162461bcd60e51b815260206004820152601f60248201527f546f6b656e2049442065786365656473206d6178696d756d20737570706c79006044820152606401610786565b6009546001600160a01b03161561178b5760405162461bcd60e51b815260206004820152601b60248201527f43616e6e6f742072756e206166746572206d696e7420737461727400000000006044820152606401610786565b604080518281523360208201527f565d5be3c5d9b8fce8cebcd35e95027d3d05547e683e3d6fdb0f0e49d33db90d910160405180910390a160085f9054906101000a90046001600160a01b03166001600160a01b03166390578ae16040518163ffffffff1660e01b81526004015f604051808303815f87803b15801561180f575f80fd5b505af1158015611821573d5f803e3d5ffd5b5050505061182f3382611fa3565b80602f14610d055760118054905f61184683612bbb565b919050555050565b5f818152600f602052604081208054606092919061186b906129b0565b9050111561190e575f828152600f60205260409020805461188b906129b0565b80601f01602080910402602001604051908101604052809291908181526020018280546118b7906129b0565b80156119025780601f106118d957610100808354040283529160200191611902565b820191905f5260205f20905b8154815290600101906020018083116118e557829003601f168201915b50505050509050919050565b6040518060800160405280605f8152602001613c2f605f913992915050565b611935611e99565b5f805f5b600a5481101561199157600b5f600a838154811061195957611959612b80565b5f9182526020808320909101546001600160a01b0316835282019290925260400190205461198790846129fc565b9250600101611939565b50683635c9adc5dea00000821015611a115760405162461bcd60e51b815260206004820152603060248201527f4e6f7420656e6f75676820427261696e4372656469747320636f6e747269627560448201527f74656420636f6c6c6563746976656c79000000000000000000000000000000006064820152608401610786565b61040060115410611a645760405162461bcd60e51b815260206004820181905260248201527f45786365656473206d6178696d756d20737570706c79206f6620427261696e736044820152606401610786565b6012545f9015611ac25760128054611a7e90600190612a0f565b81548110611a8e57611a8e612b80565b905f5260205f20015490506012805480611aaa57611aaa612b94565b600190038181905f5260205f20015f90559055611ae4565b5060118054600181019091555f19602f82900301611ae4576011805460010190555b604080518281523060208201527f565d5be3c5d9b8fce8cebcd35e95027d3d05547e683e3d6fdb0f0e49d33db90d910160405180910390a1611b263082611fa3565b5f611b313083611fbc565b90505f5b600a5481108015611b4e5750683635c9adc5dea0000084105b15611cc2575f600a8281548110611b6757611b67612b80565b5f9182526020808320909101546001600160a01b0316808352600b909152604090912054909150683635c9adc5dea00000611ba282886129fc565b1115611bbe57611bbb86683635c9adc5dea00000612a0f565b90505b6001600160a01b0382165f908152600b602052604081208054839290611be5908490612a0f565b90915550611bf5905081876129fc565b95505f611c1f683635c9adc5dea00000611c198469d3c21bcecceda1000000612228565b90611f98565b60405163a9059cbb60e01b81526001600160a01b038581166004830152602482018390529192509086169063a9059cbb906044016020604051808303815f875af1158015611c6f573d5f803e3d5ffd5b505050506040513d601f19601f82011682018060405250810190611c939190612b3e565b50683635c9adc5dea000008703611cac57505050611cc2565b5050508080611cba90612bbb565b915050611b35565b5050505050610f226001600655565b611cd9611e6c565b6001600160a01b038116611d0257604051631e4fbdf760e01b81525f6004820152602401610786565b610d0581611f47565b611d13611e6c565b600980546001600160a01b0319166001600160a01b0392909216919091179055565b5f818152600260205260408120546001600160a01b03168061069657604051637e27328960e01b815260048101849052602401610786565b610a768383836001612233565b5f828152600260205260408120546001600160a01b0390811690831615611da657611da6818486612355565b6001600160a01b03811615611de057611dc15f855f80612233565b6001600160a01b0381165f90815260036020526040902080545f190190555b6001600160a01b03851615611e0e576001600160a01b0385165f908152600360205260409020805460010190555b5f8481526002602052604080822080546001600160a01b0319166001600160a01b0389811691821790925591518793918516917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef91a4949350505050565b6007546001600160a01b03163314610f225760405163118cdaa760e01b8152336004820152602401610786565b600260065403611eeb5760405162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c006044820152606401610786565b6002600655565b5f611efd8284612a0f565b9392505050565b5f611f105f835f611d7a565b90506001600160a01b03811661075d57604051637e27328960e01b815260048101839052602401610786565b5f611efd82846129fc565b600780546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0905f90a35050565b5f611efd8284612ba8565b61075d828260405180602001604052805f8152506123b9565b5f80611fc7836123cf565b604051602001611fd79190612bea565b60405160208183030381529060405290505f611ff2846123cf565b6040516020016120029190612c1b565b60405160208183030381529060405290505f69d3c21bcecceda100000090505f8383838960405161203290612631565b61203f9493929190612c31565b604051809103905ff080158015612058573d5f803e3d5ffd5b50979650505050505050565b6001600160a01b03821661209657604051630b61174360e31b81526001600160a01b0383166004820152602401610786565b6001600160a01b038381165f81815260056020908152604080832094871680845294825291829020805460ff191686151590811790915591519182527f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31910160405180910390a3505050565b6001600160a01b0383163b156107e957604051630a85bd0160e11b81526001600160a01b0384169063150b7a0290612144903390889087908790600401612c76565b6020604051808303815f875af192505050801561217e575060408051601f3d908101601f1916820190925261217b91810190612cb1565b60015b6121e5573d8080156121ab576040519150601f19603f3d011682016040523d82523d5f602084013e6121b0565b606091505b5080515f036121dd57604051633250574960e11b81526001600160a01b0385166004820152602401610786565b805181602001fd5b6001600160e01b03198116630a85bd0160e11b1461222157604051633250574960e11b81526001600160a01b0385166004820152602401610786565b5050505050565b5f611efd8284612ccc565b808061224757506001600160a01b03821615155b15612326575f61225684611d35565b90506001600160a01b038316158015906122825750826001600160a01b0316816001600160a01b031614155b80156122b357506001600160a01b038082165f9081526005602090815260408083209387168352929052205460ff16155b156122dc5760405163a9fbf51f60e01b81526001600160a01b0384166004820152602401610786565b81156123245783856001600160a01b0316826001600160a01b03167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92560405160405180910390a45b505b50505f90815260046020526040902080546001600160a01b0319166001600160a01b0392909216919091179055565b61236083838361246c565b610a76576001600160a01b03831661238e57604051637e27328960e01b815260048101829052602401610786565b60405163177e802f60e01b81526001600160a01b038316600482015260248101829052604401610786565b6123c383836124ef565b610a765f848484612102565b60605f6123db83612550565b60010190505f8167ffffffffffffffff8111156123fa576123fa6127e8565b6040519080825280601f01601f191660200182016040528015612424576020820181803683370190505b5090508181016020015b5f19017f3031323334353637383961626364656600000000000000000000000000000000600a86061a8153600a850494508461242e57509392505050565b5f6001600160a01b038316158015906124e75750826001600160a01b0316846001600160a01b031614806124c457506001600160a01b038085165f9081526005602090815260408083209387168352929052205460ff165b806124e757505f828152600460205260409020546001600160a01b038481169116145b949350505050565b6001600160a01b03821661251857604051633250574960e11b81525f6004820152602401610786565b5f61252483835f611d7a565b90506001600160a01b03811615610a76576040516339e3563760e11b81525f6004820152602401610786565b5f807a184f03e93ff9f4daa797ed6e38ed64bf6a1f0100000000000000008310612598577a184f03e93ff9f4daa797ed6e38ed64bf6a1f010000000000000000830492506040015b6d04ee2d6d415b85acef810000000083106125c4576d04ee2d6d415b85acef8100000000830492506020015b662386f26fc1000083106125e257662386f26fc10000830492506010015b6305f5e10083106125fa576305f5e100830492506008015b612710831061260e57612710830492506004015b60648310612620576064830492506002015b600a83106106965760010192915050565b610f4b80612ce483390190565b6001600160e01b031981168114610d05575f80fd5b5f60208284031215612663575f80fd5b8135611efd8161263e565b5f81518084528060208401602086015e5f602082860101526020601f19601f83011685010191505092915050565b602081525f611efd602083018461266e565b5f602082840312156126be575f80fd5b5035919050565b80356001600160a01b03811681146108ab575f80fd5b5f80604083850312156126ec575f80fd5b6126f5836126c5565b946020939093013593505050565b5f805f805f60808688031215612717575f80fd5b612720866126c5565b945061272e602087016126c5565b935060408601359250606086013567ffffffffffffffff80821115612751575f80fd5b818801915088601f830112612764575f80fd5b813581811115612772575f80fd5b896020828501011115612783575f80fd5b9699959850939650602001949392505050565b5f602082840312156127a6575f80fd5b611efd826126c5565b5f805f606084860312156127c1575f80fd5b6127ca846126c5565b92506127d8602085016126c5565b9150604084013590509250925092565b634e487b7160e01b5f52604160045260245ffd5b5f67ffffffffffffffff80841115612816576128166127e8565b604051601f8501601f19908116603f0116810190828211818310171561283e5761283e6127e8565b81604052809350858152868686011115612856575f80fd5b858560208301375f602087830101525050509392505050565b5f8060408385031215612880575f80fd5b82359150602083013567ffffffffffffffff81111561289d575f80fd5b8301601f810185136128ad575f80fd5b6128bc858235602084016127fc565b9150509250929050565b8015158114610d05575f80fd5b5f80604083850312156128e4575f80fd5b6128ed836126c5565b915060208301356128fd816128c6565b809150509250929050565b5f805f806080858703121561291b575f80fd5b612924856126c5565b9350612932602086016126c5565b925060408501359150606085013567ffffffffffffffff811115612954575f80fd5b8501601f81018713612964575f80fd5b612973878235602084016127fc565b91505092959194509250565b5f8060408385031215612990575f80fd5b612999836126c5565b91506129a7602084016126c5565b90509250929050565b600181811c908216806129c457607f821691505b6020821081036129e257634e487b7160e01b5f52602260045260245ffd5b50919050565b634e487b7160e01b5f52601160045260245ffd5b80820180821115610696576106966129e8565b81810381811115610696576106966129e8565b601f821115610a7657805f5260205f20601f840160051c81016020851015612a475750805b601f840160051c820191505b81811015612221575f8155600101612a53565b815167ffffffffffffffff811115612a8057612a806127e8565b612a9481612a8e84546129b0565b84612a22565b602080601f831160018114612ac7575f8415612ab05750858301515b5f19600386901b1c1916600185901b178555612b1e565b5f85815260208120601f198616915b82811015612af557888601518255948401946001909101908401612ad6565b5085821015612b1257878501515f19600388901b60f8161c191681555b505060018460011b0185555b505050505050565b828152604060208201525f6124e7604083018461266e565b5f60208284031215612b4e575f80fd5b8151611efd816128c6565b634e487b7160e01b5f52601260045260245ffd5b5f82612b7b57612b7b612b59565b500690565b634e487b7160e01b5f52603260045260245ffd5b634e487b7160e01b5f52603160045260245ffd5b5f82612bb657612bb6612b59565b500490565b5f60018201612bcc57612bcc6129e8565b5060010190565b5f81518060208401855e5f93019283525090919050565b7f425241494e20544f4b454e20230000000000000000000000000000000000000081525f611efd600d830184612bd3565b61422360f01b81525f611efd6002830184612bd3565b608081525f612c43608083018761266e565b8281036020840152612c55818761266e565b9150508360408301526001600160a01b038316606083015295945050505050565b5f6001600160a01b03808716835280861660208401525083604083015260806060830152612ca7608083018461266e565b9695505050505050565b5f60208284031215612cc1575f80fd5b8151611efd8161263e565b8082028115828204841417610696576106966129e856fe608060405234801561000f575f80fd5b50604051610f4b380380610f4b83398101604081905261002e916103c0565b808484600361003d83826104cb565b50600461004a82826104cb565b5050506001600160a01b03811661007b57604051631e4fbdf760e01b81525f60048201526024015b60405180910390fd5b61008481610109565b5061008e8161015a565b69d3c21bcecceda10000008211156100f65760405162461bcd60e51b815260206004820152602560248201527f496e697469616c20737570706c792065786365656473206d6178696d756d20736044820152647570706c7960d81b6064820152608401610072565b6101008183610197565b505050506105af565b600580546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0905f90a35050565b6101626101cf565b6001600160a01b03811661018b57604051631e4fbdf760e01b81525f6004820152602401610072565b61019481610109565b50565b6001600160a01b0382166101c05760405163ec442f0560e01b81525f6004820152602401610072565b6101cb5f83836101fe565b5050565b6005546001600160a01b031633146101fc5760405163118cdaa760e01b8152336004820152602401610072565b565b6001600160a01b038316610228578060025f82825461021d919061058a565b909155506102989050565b6001600160a01b0383165f908152602081905260409020548181101561027a5760405163391434e360e21b81526001600160a01b03851660048201526024810182905260448101839052606401610072565b6001600160a01b0384165f9081526020819052604090209082900390555b6001600160a01b0382166102b4576002805482900390556102d2565b6001600160a01b0382165f9081526020819052604090208054820190555b816001600160a01b0316836001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8360405161031791815260200190565b60405180910390a3505050565b634e487b7160e01b5f52604160045260245ffd5b5f82601f830112610347575f80fd5b81516001600160401b038082111561036157610361610324565b604051601f8301601f19908116603f0116810190828211818310171561038957610389610324565b816040528381528660208588010111156103a1575f80fd5b8360208701602083015e5f602085830101528094505050505092915050565b5f805f80608085870312156103d3575f80fd5b84516001600160401b03808211156103e9575f80fd5b6103f588838901610338565b9550602087015191508082111561040a575f80fd5b5061041787828801610338565b60408701516060880151919550935090506001600160a01b038116811461043c575f80fd5b939692955090935050565b600181811c9082168061045b57607f821691505b60208210810361047957634e487b7160e01b5f52602260045260245ffd5b50919050565b601f8211156104c657805f5260205f20601f840160051c810160208510156104a45750805b601f840160051c820191505b818110156104c3575f81556001016104b0565b50505b505050565b81516001600160401b038111156104e4576104e4610324565b6104f8816104f28454610447565b8461047f565b602080601f83116001811461052b575f84156105145750858301515b5f19600386901b1c1916600185901b178555610582565b5f85815260208120601f198616915b828110156105595788860151825594840194600190910190840161053a565b508582101561057657878501515f19600388901b60f8161c191681555b505060018460011b0185555b505050505050565b808201808211156105a957634e487b7160e01b5f52601160045260245ffd5b92915050565b61098f806105bc5f395ff3fe608060405234801561000f575f80fd5b50600436106100e5575f3560e01c806370a082311161008857806395d89b411161006357806395d89b41146101d1578063a9059cbb146101d9578063dd62ed3e146101ec578063f2fde38b14610224575f80fd5b806370a0823114610186578063715018a6146101ae5780638da5cb5b146101b6575f80fd5b806323b872dd116100c357806323b872dd1461013c578063313ce5671461014f57806340c10f191461015e57806342966c6814610173575f80fd5b806306fdde03146100e9578063095ea7b31461010757806318160ddd1461012a575b5f80fd5b6100f1610237565b6040516100fe91906107e9565b60405180910390f35b61011a610115366004610839565b6102c7565b60405190151581526020016100fe565b6002545b6040519081526020016100fe565b61011a61014a366004610861565b6102e0565b604051601281526020016100fe565b61017161016c366004610839565b610303565b005b61017161018136600461089a565b61038b565b61012e6101943660046108b1565b6001600160a01b03165f9081526020819052604090205490565b6101716103a0565b6005546040516001600160a01b0390911681526020016100fe565b6100f16103b3565b61011a6101e7366004610839565b6103c2565b61012e6101fa3660046108d1565b6001600160a01b039182165f90815260016020908152604080832093909416825291909152205490565b6101716102323660046108b1565b6103cf565b60606003805461024690610902565b80601f016020809104026020016040519081016040528092919081815260200182805461027290610902565b80156102bd5780601f10610294576101008083540402835291602001916102bd565b820191905f5260205f20905b8154815290600101906020018083116102a057829003601f168201915b5050505050905090565b5f336102d4818585610409565b60019150505b92915050565b5f336102ed85828561041b565b6102f8858585610496565b506001949350505050565b61030b6104f3565b69d3c21bcecceda10000008161032060025490565b61032a919061093a565b111561037d5760405162461bcd60e51b815260206004820152601f60248201527f4d696e74696e6720776f756c6420657863656564206d617820737570706c790060448201526064015b60405180910390fd5b6103878282610520565b5050565b6103936104f3565b61039d3382610554565b50565b6103a86104f3565b6103b15f610588565b565b60606004805461024690610902565b5f336102d4818585610496565b6103d76104f3565b6001600160a01b03811661040057604051631e4fbdf760e01b81525f6004820152602401610374565b61039d81610588565b61041683838360016105f1565b505050565b6001600160a01b038381165f908152600160209081526040808320938616835292905220545f198114610490578181101561048257604051637dc7a0d960e11b81526001600160a01b03841660048201526024810182905260448101839052606401610374565b61049084848484035f6105f1565b50505050565b6001600160a01b0383166104bf57604051634b637e8f60e11b81525f6004820152602401610374565b6001600160a01b0382166104e85760405163ec442f0560e01b81525f6004820152602401610374565b6104168383836106c3565b6005546001600160a01b031633146103b15760405163118cdaa760e01b8152336004820152602401610374565b6001600160a01b0382166105495760405163ec442f0560e01b81525f6004820152602401610374565b6103875f83836106c3565b6001600160a01b03821661057d57604051634b637e8f60e11b81525f6004820152602401610374565b610387825f836106c3565b600580546001600160a01b038381167fffffffffffffffffffffffff0000000000000000000000000000000000000000831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0905f90a35050565b6001600160a01b03841661061a5760405163e602df0560e01b81525f6004820152602401610374565b6001600160a01b03831661064357604051634a1406b160e11b81525f6004820152602401610374565b6001600160a01b038085165f908152600160209081526040808320938716835292905220829055801561049057826001600160a01b0316846001600160a01b03167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925846040516106b591815260200190565b60405180910390a350505050565b6001600160a01b0383166106ed578060025f8282546106e2919061093a565b9091555061075d9050565b6001600160a01b0383165f908152602081905260409020548181101561073f5760405163391434e360e21b81526001600160a01b03851660048201526024810182905260448101839052606401610374565b6001600160a01b0384165f9081526020819052604090209082900390555b6001600160a01b03821661077957600280548290039055610797565b6001600160a01b0382165f9081526020819052604090208054820190555b816001600160a01b0316836001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040516107dc91815260200190565b60405180910390a3505050565b602081525f82518060208401528060208501604085015e5f604082850101526040601f19601f83011684010191505092915050565b80356001600160a01b0381168114610834575f80fd5b919050565b5f806040838503121561084a575f80fd5b6108538361081e565b946020939093013593505050565b5f805f60608486031215610873575f80fd5b61087c8461081e565b925061088a6020850161081e565b9150604084013590509250925092565b5f602082840312156108aa575f80fd5b5035919050565b5f602082840312156108c1575f80fd5b6108ca8261081e565b9392505050565b5f80604083850312156108e2575f80fd5b6108eb8361081e565b91506108f96020840161081e565b90509250929050565b600181811c9082168061091657607f821691505b60208210810361093457634e487b7160e01b5f52602260045260245ffd5b50919050565b808201808211156102da57634e487b7160e01b5f52601160045260245ffdfea26469706673582212209970321e84ebe94c164604996acaba3c95d88e7bad652e8db8f4bfbde421134264736f6c6343000819003368747470733a2f2f6f7264696e616c732e636f6d2f636f6e74656e742f663462653739353138656262303238336564333730313262343231353264656463326264666532653761383932363763373434386162333665303262663939636930a2646970667358221220da1c11f7c5238568879605abb93064b3baef1ae625356f708856f3699501ea1d64736f6c63430008190033

Deployed Bytecode

0x608060405234801561000f575f80fd5b50600436106102b7575f3560e01c806370a0823111610171578063a43275bd116100d2578063d082e38111610088578063ee2231991161006e578063ee22319914610606578063f2fde38b14610625578063fa7f1db814610638575f80fd5b8063d082e381146105c2578063e985e9c5146105cb575f80fd5b8063c3edd884116100b8578063c3edd88414610594578063c87b56dd146105a7578063cd07c6aa146105ba575f80fd5b8063a43275bd1461056e578063b88d4fde14610581575f80fd5b80638da5cb5b1161012757806397d7cef41161010d57806397d7cef41461053557806398462b6814610548578063a22cb4651461055b575f80fd5b80638da5cb5b1461051c57806395d89b411461052d575f80fd5b806379e8a6041161015757806379e8a604146104ce5780637ca77d9f146104f657806387d5ec8e14610509575f80fd5b806370a08231146104b3578063715018a6146104c6575f80fd5b806334ad35011161021b5780634da6a556116101d157806352ed33c3116101b757806352ed33c31461047a57806353917a4d1461048d5780636352211e146104a0575f80fd5b80634da6a5561461043f5780634ddfb0f214610467575f80fd5b80633cb5d100116102015780633cb5d100146103fa57806342842e0e1461040d57806342e94c9014610420575f80fd5b806334ad3501146103d45780633765af0b146103e7575f80fd5b806316934fc41161027057806323b872dd1161025657806323b872dd146103a55780632b3ae25c146103b857806332cb6b0c146103cb575f80fd5b806316934fc41461037057806318160ddd1461039d575f80fd5b8063081812fc116102a0578063081812fc146102f8578063095ea7b314610323578063150b7a0214610338575f80fd5b806301ffc9a7146102bb57806306fdde03146102e3575b5f80fd5b6102ce6102c9366004612653565b61064b565b60405190151581526020015b60405180910390f35b6102eb61069c565b6040516102da919061269c565b61030b6103063660046126ae565b61072b565b6040516001600160a01b0390911681526020016102da565b6103366103313660046126db565b610752565b005b610357610346366004612703565b630a85bd0160e11b95945050505050565b6040516001600160e01b031990911681526020016102da565b61038f61037e366004612796565b600d6020525f908152604090205481565b6040519081526020016102da565b61040061038f565b6103366103b33660046127af565b610761565b61038f6103c63660046126ae565b6107ef565b61038f61040081565b6103366103e23660046126ae565b6108b0565b6103366103f536600461286f565b6108d7565b61030b6104083660046126ae565b610a34565b61033661041b3660046127af565b610a5c565b61038f61042e366004612796565b600b6020525f908152604090205481565b61038f61044d366004612796565b6001600160a01b03165f908152600d602052604090205490565b6103366104753660046126ae565b610a7b565b6103366104883660046126ae565b610d08565b61033661049b366004612796565b610e98565b61030b6104ae3660046126ae565b610ec2565b61038f6104c1366004612796565b610ecc565b610336610f11565b61030b6104dc3660046126ae565b600c6020525f90815260409020546001600160a01b031681565b60095461030b906001600160a01b031681565b6103366105173660046126ae565b610f24565b6007546001600160a01b031661030b565b6102eb611281565b6103366105433660046126ae565b611290565b60085461030b906001600160a01b031681565b6103366105693660046128d3565b611398565b61033661057c3660046126ae565b6113a3565b61033661058f366004612908565b6116c2565b6103366105a23660046126ae565b6116d9565b6102eb6105b53660046126ae565b61184e565b61033661192d565b61038f60115481565b6102ce6105d936600461297f565b6001600160a01b039182165f90815260056020908152604080832093909416825291909152205460ff1690565b61038f6106143660046126ae565b600e6020525f908152604090205481565b610336610633366004612796565b611cd1565b610336610646366004612796565b611d0b565b5f6001600160e01b031982166380ac58cd60e01b148061067b57506001600160e01b03198216635b5e139f60e01b145b8061069657506301ffc9a760e01b6001600160e01b03198316145b92915050565b60605f80546106aa906129b0565b80601f01602080910402602001604051908101604052809291908181526020018280546106d6906129b0565b80156107215780601f106106f857610100808354040283529160200191610721565b820191905f5260205f20905b81548152906001019060200180831161070457829003601f168201915b5050505050905090565b5f61073582611d35565b505f828152600460205260409020546001600160a01b0316610696565b61075d828233611d6d565b5050565b6001600160a01b03821661078f57604051633250574960e11b81525f60048201526024015b60405180910390fd5b5f61079b838333611d7a565b9050836001600160a01b0316816001600160a01b0316146107e9576040516364283d7b60e01b81526001600160a01b0380861660048301526024820184905282166044820152606401610786565b50505050565b5f336107fa83610ec2565b6001600160a01b03161461085a5760405162461bcd60e51b815260206004820152602160248201527f4f6e6c7920746865206f776e65722063616e20636865636b207468652074696d6044820152606560f81b6064820152608401610786565b5f828152600e6020526040902054610876906276a700906129fc565b421061088357505f919050565b5f828152600e602052604090205442906108a1906276a700906129fc565b6106969190612a0f565b919050565b6108b8611e6c565b5f908152601060205260409020805460ff19811660ff90911615179055565b336108e183610ec2565b6001600160a01b0316148061090f5750336109046007546001600160a01b031690565b6001600160a01b0316145b61095b5760405162461bcd60e51b815260206004820152601c60248201527f4e6f7420617574686f72697a656420746f2075706461746520555249000000006044820152606401610786565b5f8281526010602052604090205460ff16156109df5760405162461bcd60e51b815260206004820152602560248201527f427261696e20494420697320626c6f636b65642066726f6d207570646174696e60448201527f67205552490000000000000000000000000000000000000000000000000000006064820152608401610786565b5f828152600f602052604090206109f68282612a66565b507f2711e4c38562f558a1dbf8d9d2d9810789462585e6a5d6ca11d98d3fc5df31e28282604051610a28929190612b26565b60405180910390a15050565b600a8181548110610a43575f80fd5b5f918252602090912001546001600160a01b0316905081565b610a7683838360405180602001604052805f8152506116c2565b505050565b610a83611e99565b33610a8d82610ec2565b6001600160a01b031614610ae35760405162461bcd60e51b815260206004820152601c60248201527f4f6e6c7920427261696e206f776e65722063616e20756e7374616b65000000006044820152606401610786565b5f818152600e6020526040902054610aff906276a700906129fc565b421015610b4e5760405162461bcd60e51b815260206004820152601e60248201527f5374616b6520706572696f64206e6f742079657420636f6d706c6574656400006044820152606401610786565b335f908152600d602052604090205469152d02c7e14af68000001115610bb65760405162461bcd60e51b815260206004820152601860248201527f4e6f7420656e6f75676820746f6b656e73207374616b656400000000000000006044820152606401610786565b335f908152600d6020526040902054610bd99069152d02c7e14af6800000611ef2565b335f818152600d60205260409081902092909255600954915163a9059cbb60e01b8152600481019190915269152d02c7e14af680000060248201526001600160a01b039091169063a9059cbb906044016020604051808303815f875af1158015610c45573d5f803e3d5ffd5b505050506040513d601f19601f82011682018060405250810190610c699190612b3e565b50610c7381611f04565b601280546001810182555f9182527fbb8a6a4669ba250d26cd7a459eca9d215f8307e33aebe50379bc5a3617ec3444018290556008546040805163de0f2be160e01b815290516001600160a01b039092169263de0f2be19260048084019382900301818387803b158015610ce5575f80fd5b505af1158015610cf7573d5f803e3d5ffd5b50505050610d056001600655565b50565b6008546001600160a01b0316610d605760405162461bcd60e51b815260206004820152601c60248201527f427261696e204372656469742061646472657373206e6f7420736574000000006044820152606401610786565b6008546040516323b872dd60e01b8152336004820152306024820152604481018390526001600160a01b03909116906323b872dd906064016020604051808303815f875af1158015610db4573d5f803e3d5ffd5b505050506040513d601f19601f82011682018060405250810190610dd89190612b3e565b50335f908152600b60205260408120549003610e3057600a80546001810182555f919091527fc65a7bb8d6351c1cf70c95a316cc6a92839c986682d98bc35f958f4883f9d2a80180546001600160a01b031916331790555b335f908152600b6020526040902054610e499082611f3c565b335f818152600b60209081526040918290209390935580519182529181018390527f1bb460ccaaf70fbacfec17a376f8acbd278c1405590ffcc8ebe4b88daf4f64ad910160405180910390a150565b610ea0611e6c565b600880546001600160a01b0319166001600160a01b0392909216919091179055565b5f61069682611d35565b5f6001600160a01b038216610ef6576040516322718ad960e21b81525f6004820152602401610786565b506001600160a01b03165f9081526003602052604090205490565b610f19611e6c565b610f225f611f47565b565b610f2c611e99565b6009546001600160a01b0316610f8e5760405162461bcd60e51b815260206004820152602160248201527f53706563696669632050657065636f696e2061646472657373206e6f742073656044820152601d60fa1b6064820152608401610786565b610fa269152d02c7e14af680000082612b6d565b156110155760405162461bcd60e51b815260206004820152603460248201527f5374616b6520616d6f756e74206d75737420626520696e20696e6372656d656e60448201527f7473206f66203130302c30303020746f6b656e730000000000000000000000006064820152608401610786565b5f61102a8269152d02c7e14af6800000611f98565b905061040060018260115461103f91906129fc565b6110499190612a0f565b11156110975760405162461bcd60e51b815260206004820181905260248201527f45786365656473206d6178696d756d20737570706c79206f6620427261696e736044820152606401610786565b6009546040516323b872dd60e01b8152336004820152306024820152604481018490526001600160a01b03909116906323b872dd906064016020604051808303815f875af11580156110eb573d5f803e3d5ffd5b505050506040513d601f19601f8201168201806040525081019061110f9190612b3e565b50335f908152600d60205260409020546111299083611f3c565b335f908152600d60205260408082209290925560085482516390578ae160e01b815292516001600160a01b03909116926390578ae192600480830193919282900301818387803b15801561117b575f80fd5b505af115801561118d573d5f803e3d5ffd5b505050505f5b81811015611275576012545f90156111f957601280546111b590600190612a0f565b815481106111c5576111c5612b80565b905f5260205f200154905060128054806111e1576111e1612b94565b600190038181905f5260205f20015f9055905561121b565b5060118054600181019091555f19602f8290030161121b576011805460010190555b604080518281523360208201527f565d5be3c5d9b8fce8cebcd35e95027d3d05547e683e3d6fdb0f0e49d33db90d910160405180910390a161125d3382611fa3565b5f908152600e60205260409020429055600101611193565b5050610d056001600655565b6060600180546106aa906129b0565b3361129a82610ec2565b6001600160a01b0316146112fa5760405162461bcd60e51b815260206004820152602160248201527f4f6e6c7920427261696e206f776e65722063616e206c696e6b206120455243326044820152600360fc1b6064820152608401610786565b5f818152600c60205260409020546001600160a01b03161561135e5760405162461bcd60e51b815260206004820152601f60248201527f427261696e20746f6b656e20686173206265656e206163746976617465642e006044820152606401610786565b5f6113693383611fbc565b5f928352600c602052604090922080546001600160a01b0319166001600160a01b039093169290921790915550565b61075d338383612064565b6113ab611e99565b6008546001600160a01b03166114295760405162461bcd60e51b815260206004820152602560248201527f537065636966696320427261696e204372656469742061646472657373206e6f60448201527f74207365740000000000000000000000000000000000000000000000000000006064820152608401610786565b683635c9adc5dea000008110156114825760405162461bcd60e51b815260206004820152601660248201527f4d696e696d756d20616d6f756e74206e6f74206d6574000000000000000000006044820152606401610786565b611495683635c9adc5dea0000082612b6d565b156115085760405162461bcd60e51b815260206004820152602c60248201527f416d6f756e74206d75737420626520696e20696e6372656d656e7473206f662060448201527f31303030206372656469747300000000000000000000000000000000000000006064820152608401610786565b5f61151c683635c9adc5dea0000083612ba8565b905061040060018260115461153191906129fc565b61153b9190612a0f565b11156115895760405162461bcd60e51b815260206004820181905260248201527f45786365656473206d6178696d756d20737570706c79206f6620427261696e736044820152606401610786565b6008546040516323b872dd60e01b8152336004820152306024820152604481018490526001600160a01b03909116906323b872dd906064016020604051808303815f875af11580156115dd573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906116019190612b3e565b505f5b81811015611275576012545f901561166a576012805461162690600190612a0f565b8154811061163657611636612b80565b905f5260205f2001549050601280548061165257611652612b94565b600190038181905f5260205f20015f90559055611677565b5060118054600181019091555b604080518281523360208201527f565d5be3c5d9b8fce8cebcd35e95027d3d05547e683e3d6fdb0f0e49d33db90d910160405180910390a16116b93382611fa3565b50600101611604565b6116cd848484610761565b6107e984848484612102565b6116e1611e6c565b61040081106117325760405162461bcd60e51b815260206004820152601f60248201527f546f6b656e2049442065786365656473206d6178696d756d20737570706c79006044820152606401610786565b6009546001600160a01b03161561178b5760405162461bcd60e51b815260206004820152601b60248201527f43616e6e6f742072756e206166746572206d696e7420737461727400000000006044820152606401610786565b604080518281523360208201527f565d5be3c5d9b8fce8cebcd35e95027d3d05547e683e3d6fdb0f0e49d33db90d910160405180910390a160085f9054906101000a90046001600160a01b03166001600160a01b03166390578ae16040518163ffffffff1660e01b81526004015f604051808303815f87803b15801561180f575f80fd5b505af1158015611821573d5f803e3d5ffd5b5050505061182f3382611fa3565b80602f14610d055760118054905f61184683612bbb565b919050555050565b5f818152600f602052604081208054606092919061186b906129b0565b9050111561190e575f828152600f60205260409020805461188b906129b0565b80601f01602080910402602001604051908101604052809291908181526020018280546118b7906129b0565b80156119025780601f106118d957610100808354040283529160200191611902565b820191905f5260205f20905b8154815290600101906020018083116118e557829003601f168201915b50505050509050919050565b6040518060800160405280605f8152602001613c2f605f913992915050565b611935611e99565b5f805f5b600a5481101561199157600b5f600a838154811061195957611959612b80565b5f9182526020808320909101546001600160a01b0316835282019290925260400190205461198790846129fc565b9250600101611939565b50683635c9adc5dea00000821015611a115760405162461bcd60e51b815260206004820152603060248201527f4e6f7420656e6f75676820427261696e4372656469747320636f6e747269627560448201527f74656420636f6c6c6563746976656c79000000000000000000000000000000006064820152608401610786565b61040060115410611a645760405162461bcd60e51b815260206004820181905260248201527f45786365656473206d6178696d756d20737570706c79206f6620427261696e736044820152606401610786565b6012545f9015611ac25760128054611a7e90600190612a0f565b81548110611a8e57611a8e612b80565b905f5260205f20015490506012805480611aaa57611aaa612b94565b600190038181905f5260205f20015f90559055611ae4565b5060118054600181019091555f19602f82900301611ae4576011805460010190555b604080518281523060208201527f565d5be3c5d9b8fce8cebcd35e95027d3d05547e683e3d6fdb0f0e49d33db90d910160405180910390a1611b263082611fa3565b5f611b313083611fbc565b90505f5b600a5481108015611b4e5750683635c9adc5dea0000084105b15611cc2575f600a8281548110611b6757611b67612b80565b5f9182526020808320909101546001600160a01b0316808352600b909152604090912054909150683635c9adc5dea00000611ba282886129fc565b1115611bbe57611bbb86683635c9adc5dea00000612a0f565b90505b6001600160a01b0382165f908152600b602052604081208054839290611be5908490612a0f565b90915550611bf5905081876129fc565b95505f611c1f683635c9adc5dea00000611c198469d3c21bcecceda1000000612228565b90611f98565b60405163a9059cbb60e01b81526001600160a01b038581166004830152602482018390529192509086169063a9059cbb906044016020604051808303815f875af1158015611c6f573d5f803e3d5ffd5b505050506040513d601f19601f82011682018060405250810190611c939190612b3e565b50683635c9adc5dea000008703611cac57505050611cc2565b5050508080611cba90612bbb565b915050611b35565b5050505050610f226001600655565b611cd9611e6c565b6001600160a01b038116611d0257604051631e4fbdf760e01b81525f6004820152602401610786565b610d0581611f47565b611d13611e6c565b600980546001600160a01b0319166001600160a01b0392909216919091179055565b5f818152600260205260408120546001600160a01b03168061069657604051637e27328960e01b815260048101849052602401610786565b610a768383836001612233565b5f828152600260205260408120546001600160a01b0390811690831615611da657611da6818486612355565b6001600160a01b03811615611de057611dc15f855f80612233565b6001600160a01b0381165f90815260036020526040902080545f190190555b6001600160a01b03851615611e0e576001600160a01b0385165f908152600360205260409020805460010190555b5f8481526002602052604080822080546001600160a01b0319166001600160a01b0389811691821790925591518793918516917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef91a4949350505050565b6007546001600160a01b03163314610f225760405163118cdaa760e01b8152336004820152602401610786565b600260065403611eeb5760405162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c006044820152606401610786565b6002600655565b5f611efd8284612a0f565b9392505050565b5f611f105f835f611d7a565b90506001600160a01b03811661075d57604051637e27328960e01b815260048101839052602401610786565b5f611efd82846129fc565b600780546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0905f90a35050565b5f611efd8284612ba8565b61075d828260405180602001604052805f8152506123b9565b5f80611fc7836123cf565b604051602001611fd79190612bea565b60405160208183030381529060405290505f611ff2846123cf565b6040516020016120029190612c1b565b60405160208183030381529060405290505f69d3c21bcecceda100000090505f8383838960405161203290612631565b61203f9493929190612c31565b604051809103905ff080158015612058573d5f803e3d5ffd5b50979650505050505050565b6001600160a01b03821661209657604051630b61174360e31b81526001600160a01b0383166004820152602401610786565b6001600160a01b038381165f81815260056020908152604080832094871680845294825291829020805460ff191686151590811790915591519182527f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31910160405180910390a3505050565b6001600160a01b0383163b156107e957604051630a85bd0160e11b81526001600160a01b0384169063150b7a0290612144903390889087908790600401612c76565b6020604051808303815f875af192505050801561217e575060408051601f3d908101601f1916820190925261217b91810190612cb1565b60015b6121e5573d8080156121ab576040519150601f19603f3d011682016040523d82523d5f602084013e6121b0565b606091505b5080515f036121dd57604051633250574960e11b81526001600160a01b0385166004820152602401610786565b805181602001fd5b6001600160e01b03198116630a85bd0160e11b1461222157604051633250574960e11b81526001600160a01b0385166004820152602401610786565b5050505050565b5f611efd8284612ccc565b808061224757506001600160a01b03821615155b15612326575f61225684611d35565b90506001600160a01b038316158015906122825750826001600160a01b0316816001600160a01b031614155b80156122b357506001600160a01b038082165f9081526005602090815260408083209387168352929052205460ff16155b156122dc5760405163a9fbf51f60e01b81526001600160a01b0384166004820152602401610786565b81156123245783856001600160a01b0316826001600160a01b03167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92560405160405180910390a45b505b50505f90815260046020526040902080546001600160a01b0319166001600160a01b0392909216919091179055565b61236083838361246c565b610a76576001600160a01b03831661238e57604051637e27328960e01b815260048101829052602401610786565b60405163177e802f60e01b81526001600160a01b038316600482015260248101829052604401610786565b6123c383836124ef565b610a765f848484612102565b60605f6123db83612550565b60010190505f8167ffffffffffffffff8111156123fa576123fa6127e8565b6040519080825280601f01601f191660200182016040528015612424576020820181803683370190505b5090508181016020015b5f19017f3031323334353637383961626364656600000000000000000000000000000000600a86061a8153600a850494508461242e57509392505050565b5f6001600160a01b038316158015906124e75750826001600160a01b0316846001600160a01b031614806124c457506001600160a01b038085165f9081526005602090815260408083209387168352929052205460ff165b806124e757505f828152600460205260409020546001600160a01b038481169116145b949350505050565b6001600160a01b03821661251857604051633250574960e11b81525f6004820152602401610786565b5f61252483835f611d7a565b90506001600160a01b03811615610a76576040516339e3563760e11b81525f6004820152602401610786565b5f807a184f03e93ff9f4daa797ed6e38ed64bf6a1f0100000000000000008310612598577a184f03e93ff9f4daa797ed6e38ed64bf6a1f010000000000000000830492506040015b6d04ee2d6d415b85acef810000000083106125c4576d04ee2d6d415b85acef8100000000830492506020015b662386f26fc1000083106125e257662386f26fc10000830492506010015b6305f5e10083106125fa576305f5e100830492506008015b612710831061260e57612710830492506004015b60648310612620576064830492506002015b600a83106106965760010192915050565b610f4b80612ce483390190565b6001600160e01b031981168114610d05575f80fd5b5f60208284031215612663575f80fd5b8135611efd8161263e565b5f81518084528060208401602086015e5f602082860101526020601f19601f83011685010191505092915050565b602081525f611efd602083018461266e565b5f602082840312156126be575f80fd5b5035919050565b80356001600160a01b03811681146108ab575f80fd5b5f80604083850312156126ec575f80fd5b6126f5836126c5565b946020939093013593505050565b5f805f805f60808688031215612717575f80fd5b612720866126c5565b945061272e602087016126c5565b935060408601359250606086013567ffffffffffffffff80821115612751575f80fd5b818801915088601f830112612764575f80fd5b813581811115612772575f80fd5b896020828501011115612783575f80fd5b9699959850939650602001949392505050565b5f602082840312156127a6575f80fd5b611efd826126c5565b5f805f606084860312156127c1575f80fd5b6127ca846126c5565b92506127d8602085016126c5565b9150604084013590509250925092565b634e487b7160e01b5f52604160045260245ffd5b5f67ffffffffffffffff80841115612816576128166127e8565b604051601f8501601f19908116603f0116810190828211818310171561283e5761283e6127e8565b81604052809350858152868686011115612856575f80fd5b858560208301375f602087830101525050509392505050565b5f8060408385031215612880575f80fd5b82359150602083013567ffffffffffffffff81111561289d575f80fd5b8301601f810185136128ad575f80fd5b6128bc858235602084016127fc565b9150509250929050565b8015158114610d05575f80fd5b5f80604083850312156128e4575f80fd5b6128ed836126c5565b915060208301356128fd816128c6565b809150509250929050565b5f805f806080858703121561291b575f80fd5b612924856126c5565b9350612932602086016126c5565b925060408501359150606085013567ffffffffffffffff811115612954575f80fd5b8501601f81018713612964575f80fd5b612973878235602084016127fc565b91505092959194509250565b5f8060408385031215612990575f80fd5b612999836126c5565b91506129a7602084016126c5565b90509250929050565b600181811c908216806129c457607f821691505b6020821081036129e257634e487b7160e01b5f52602260045260245ffd5b50919050565b634e487b7160e01b5f52601160045260245ffd5b80820180821115610696576106966129e8565b81810381811115610696576106966129e8565b601f821115610a7657805f5260205f20601f840160051c81016020851015612a475750805b601f840160051c820191505b81811015612221575f8155600101612a53565b815167ffffffffffffffff811115612a8057612a806127e8565b612a9481612a8e84546129b0565b84612a22565b602080601f831160018114612ac7575f8415612ab05750858301515b5f19600386901b1c1916600185901b178555612b1e565b5f85815260208120601f198616915b82811015612af557888601518255948401946001909101908401612ad6565b5085821015612b1257878501515f19600388901b60f8161c191681555b505060018460011b0185555b505050505050565b828152604060208201525f6124e7604083018461266e565b5f60208284031215612b4e575f80fd5b8151611efd816128c6565b634e487b7160e01b5f52601260045260245ffd5b5f82612b7b57612b7b612b59565b500690565b634e487b7160e01b5f52603260045260245ffd5b634e487b7160e01b5f52603160045260245ffd5b5f82612bb657612bb6612b59565b500490565b5f60018201612bcc57612bcc6129e8565b5060010190565b5f81518060208401855e5f93019283525090919050565b7f425241494e20544f4b454e20230000000000000000000000000000000000000081525f611efd600d830184612bd3565b61422360f01b81525f611efd6002830184612bd3565b608081525f612c43608083018761266e565b8281036020840152612c55818761266e565b9150508360408301526001600160a01b038316606083015295945050505050565b5f6001600160a01b03808716835280861660208401525083604083015260806060830152612ca7608083018461266e565b9695505050505050565b5f60208284031215612cc1575f80fd5b8151611efd8161263e565b8082028115828204841417610696576106966129e856fe608060405234801561000f575f80fd5b50604051610f4b380380610f4b83398101604081905261002e916103c0565b808484600361003d83826104cb565b50600461004a82826104cb565b5050506001600160a01b03811661007b57604051631e4fbdf760e01b81525f60048201526024015b60405180910390fd5b61008481610109565b5061008e8161015a565b69d3c21bcecceda10000008211156100f65760405162461bcd60e51b815260206004820152602560248201527f496e697469616c20737570706c792065786365656473206d6178696d756d20736044820152647570706c7960d81b6064820152608401610072565b6101008183610197565b505050506105af565b600580546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0905f90a35050565b6101626101cf565b6001600160a01b03811661018b57604051631e4fbdf760e01b81525f6004820152602401610072565b61019481610109565b50565b6001600160a01b0382166101c05760405163ec442f0560e01b81525f6004820152602401610072565b6101cb5f83836101fe565b5050565b6005546001600160a01b031633146101fc5760405163118cdaa760e01b8152336004820152602401610072565b565b6001600160a01b038316610228578060025f82825461021d919061058a565b909155506102989050565b6001600160a01b0383165f908152602081905260409020548181101561027a5760405163391434e360e21b81526001600160a01b03851660048201526024810182905260448101839052606401610072565b6001600160a01b0384165f9081526020819052604090209082900390555b6001600160a01b0382166102b4576002805482900390556102d2565b6001600160a01b0382165f9081526020819052604090208054820190555b816001600160a01b0316836001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8360405161031791815260200190565b60405180910390a3505050565b634e487b7160e01b5f52604160045260245ffd5b5f82601f830112610347575f80fd5b81516001600160401b038082111561036157610361610324565b604051601f8301601f19908116603f0116810190828211818310171561038957610389610324565b816040528381528660208588010111156103a1575f80fd5b8360208701602083015e5f602085830101528094505050505092915050565b5f805f80608085870312156103d3575f80fd5b84516001600160401b03808211156103e9575f80fd5b6103f588838901610338565b9550602087015191508082111561040a575f80fd5b5061041787828801610338565b60408701516060880151919550935090506001600160a01b038116811461043c575f80fd5b939692955090935050565b600181811c9082168061045b57607f821691505b60208210810361047957634e487b7160e01b5f52602260045260245ffd5b50919050565b601f8211156104c657805f5260205f20601f840160051c810160208510156104a45750805b601f840160051c820191505b818110156104c3575f81556001016104b0565b50505b505050565b81516001600160401b038111156104e4576104e4610324565b6104f8816104f28454610447565b8461047f565b602080601f83116001811461052b575f84156105145750858301515b5f19600386901b1c1916600185901b178555610582565b5f85815260208120601f198616915b828110156105595788860151825594840194600190910190840161053a565b508582101561057657878501515f19600388901b60f8161c191681555b505060018460011b0185555b505050505050565b808201808211156105a957634e487b7160e01b5f52601160045260245ffd5b92915050565b61098f806105bc5f395ff3fe608060405234801561000f575f80fd5b50600436106100e5575f3560e01c806370a082311161008857806395d89b411161006357806395d89b41146101d1578063a9059cbb146101d9578063dd62ed3e146101ec578063f2fde38b14610224575f80fd5b806370a0823114610186578063715018a6146101ae5780638da5cb5b146101b6575f80fd5b806323b872dd116100c357806323b872dd1461013c578063313ce5671461014f57806340c10f191461015e57806342966c6814610173575f80fd5b806306fdde03146100e9578063095ea7b31461010757806318160ddd1461012a575b5f80fd5b6100f1610237565b6040516100fe91906107e9565b60405180910390f35b61011a610115366004610839565b6102c7565b60405190151581526020016100fe565b6002545b6040519081526020016100fe565b61011a61014a366004610861565b6102e0565b604051601281526020016100fe565b61017161016c366004610839565b610303565b005b61017161018136600461089a565b61038b565b61012e6101943660046108b1565b6001600160a01b03165f9081526020819052604090205490565b6101716103a0565b6005546040516001600160a01b0390911681526020016100fe565b6100f16103b3565b61011a6101e7366004610839565b6103c2565b61012e6101fa3660046108d1565b6001600160a01b039182165f90815260016020908152604080832093909416825291909152205490565b6101716102323660046108b1565b6103cf565b60606003805461024690610902565b80601f016020809104026020016040519081016040528092919081815260200182805461027290610902565b80156102bd5780601f10610294576101008083540402835291602001916102bd565b820191905f5260205f20905b8154815290600101906020018083116102a057829003601f168201915b5050505050905090565b5f336102d4818585610409565b60019150505b92915050565b5f336102ed85828561041b565b6102f8858585610496565b506001949350505050565b61030b6104f3565b69d3c21bcecceda10000008161032060025490565b61032a919061093a565b111561037d5760405162461bcd60e51b815260206004820152601f60248201527f4d696e74696e6720776f756c6420657863656564206d617820737570706c790060448201526064015b60405180910390fd5b6103878282610520565b5050565b6103936104f3565b61039d3382610554565b50565b6103a86104f3565b6103b15f610588565b565b60606004805461024690610902565b5f336102d4818585610496565b6103d76104f3565b6001600160a01b03811661040057604051631e4fbdf760e01b81525f6004820152602401610374565b61039d81610588565b61041683838360016105f1565b505050565b6001600160a01b038381165f908152600160209081526040808320938616835292905220545f198114610490578181101561048257604051637dc7a0d960e11b81526001600160a01b03841660048201526024810182905260448101839052606401610374565b61049084848484035f6105f1565b50505050565b6001600160a01b0383166104bf57604051634b637e8f60e11b81525f6004820152602401610374565b6001600160a01b0382166104e85760405163ec442f0560e01b81525f6004820152602401610374565b6104168383836106c3565b6005546001600160a01b031633146103b15760405163118cdaa760e01b8152336004820152602401610374565b6001600160a01b0382166105495760405163ec442f0560e01b81525f6004820152602401610374565b6103875f83836106c3565b6001600160a01b03821661057d57604051634b637e8f60e11b81525f6004820152602401610374565b610387825f836106c3565b600580546001600160a01b038381167fffffffffffffffffffffffff0000000000000000000000000000000000000000831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0905f90a35050565b6001600160a01b03841661061a5760405163e602df0560e01b81525f6004820152602401610374565b6001600160a01b03831661064357604051634a1406b160e11b81525f6004820152602401610374565b6001600160a01b038085165f908152600160209081526040808320938716835292905220829055801561049057826001600160a01b0316846001600160a01b03167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925846040516106b591815260200190565b60405180910390a350505050565b6001600160a01b0383166106ed578060025f8282546106e2919061093a565b9091555061075d9050565b6001600160a01b0383165f908152602081905260409020548181101561073f5760405163391434e360e21b81526001600160a01b03851660048201526024810182905260448101839052606401610374565b6001600160a01b0384165f9081526020819052604090209082900390555b6001600160a01b03821661077957600280548290039055610797565b6001600160a01b0382165f9081526020819052604090208054820190555b816001600160a01b0316836001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040516107dc91815260200190565b60405180910390a3505050565b602081525f82518060208401528060208501604085015e5f604082850101526040601f19601f83011684010191505092915050565b80356001600160a01b0381168114610834575f80fd5b919050565b5f806040838503121561084a575f80fd5b6108538361081e565b946020939093013593505050565b5f805f60608486031215610873575f80fd5b61087c8461081e565b925061088a6020850161081e565b9150604084013590509250925092565b5f602082840312156108aa575f80fd5b5035919050565b5f602082840312156108c1575f80fd5b6108ca8261081e565b9392505050565b5f80604083850312156108e2575f80fd5b6108eb8361081e565b91506108f96020840161081e565b90509250929050565b600181811c9082168061091657607f821691505b60208210810361093457634e487b7160e01b5f52602260045260245ffd5b50919050565b808201808211156102da57634e487b7160e01b5f52601160045260245ffdfea26469706673582212209970321e84ebe94c164604996acaba3c95d88e7bad652e8db8f4bfbde421134264736f6c6343000819003368747470733a2f2f6f7264696e616c732e636f6d2f636f6e74656e742f663462653739353138656262303238336564333730313262343231353264656463326264666532653761383932363763373434386162333665303262663939636930a2646970667358221220da1c11f7c5238568879605abb93064b3baef1ae625356f708856f3699501ea1d64736f6c63430008190033

Block Transaction Difficulty Gas Used Reward
View All Blocks Produced

Block Uncle Number Difficulty Gas Used Reward
View All Uncles
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.