ETH Price: $2,693.53 (-2.29%)

Contract

0xe9eB93716914Da5Cd2559578266AE236c0ccCf32

Overview

ETH Balance

0 ETH

ETH Value

$0.00
Transaction Hash
Method
Block
From
To
Reveal Mint Resu...18617752025-02-15 18:45:266 days ago1739645126IN
0xe9eB9371...6c0ccCf32
0 ETH0.000007980.04525
Commit To Mint18617652025-02-15 18:45:166 days ago1739645116IN
0xe9eB9371...6c0ccCf32
0.021 ETH0.000008940.04525
Reveal Mint Resu...18566772025-02-15 17:14:466 days ago1739639686IN
0xe9eB9371...6c0ccCf32
0 ETH0.000005690.04525
Batch Commit To ...18566652025-02-15 17:14:346 days ago1739639674IN
0xe9eB9371...6c0ccCf32
0 ETH0.000005640.04525
Reveal Mint Resu...18565942025-02-15 17:13:236 days ago1739639603IN
0xe9eB9371...6c0ccCf32
0 ETH0.000008520.04525
Batch Commit To ...18565822025-02-15 17:13:116 days ago1739639591IN
0xe9eB9371...6c0ccCf32
0 ETH0.000007560.04525
Reveal Mint Resu...18564102025-02-15 17:10:046 days ago1739639404IN
0xe9eB9371...6c0ccCf32
0 ETH0.000007590.04525
Batch Commit To ...18564012025-02-15 17:09:556 days ago1739639395IN
0xe9eB9371...6c0ccCf32
0 ETH0.000007550.04525
Reveal Mint Resu...18558822025-02-15 17:00:306 days ago1739638830IN
0xe9eB9371...6c0ccCf32
0 ETH0.000004750.04525
Batch Commit To ...18558732025-02-15 17:00:216 days ago1739638821IN
0xe9eB9371...6c0ccCf32
0 ETH0.000005610.04525
Reveal Mint Resu...18557992025-02-15 16:59:076 days ago1739638747IN
0xe9eB9371...6c0ccCf32
0 ETH0.00000750.04525
Batch Commit To ...18557842025-02-15 16:58:526 days ago1739638732IN
0xe9eB9371...6c0ccCf32
0 ETH0.000007520.04525
Reveal Mint Resu...18511492025-02-15 15:34:596 days ago1739633699IN
0xe9eB9371...6c0ccCf32
0 ETH0.000007590.04525
Batch Commit To ...18511362025-02-15 15:34:466 days ago1739633686IN
0xe9eB9371...6c0ccCf32
0 ETH0.000007520.04525
Reveal Mint Resu...18500882025-02-15 15:16:236 days ago1739632583IN
0xe9eB9371...6c0ccCf32
0 ETH0.00000750.04525
Commit To Mint18500742025-02-15 15:16:096 days ago1739632569IN
0xe9eB9371...6c0ccCf32
0.007 ETH0.000009630.04525
Reveal Mint Resu...18482982025-02-15 14:44:446 days ago1739630684IN
0xe9eB9371...6c0ccCf32
0 ETH0.00000450.04525
Commit To Mint18482892025-02-15 14:44:356 days ago1739630675IN
0xe9eB9371...6c0ccCf32
0.007 ETH0.000006680.04525
Reveal Mint Resu...18482502025-02-15 14:43:566 days ago1739630636IN
0xe9eB9371...6c0ccCf32
0 ETH0.00000750.04525
Commit To Mint18482372025-02-15 14:43:436 days ago1739630623IN
0xe9eB9371...6c0ccCf32
0.007 ETH0.000009480.04525
Reveal Mint Resu...18423802025-02-15 13:00:596 days ago1739624459IN
0xe9eB9371...6c0ccCf32
0 ETH0.00000750.04525
Commit To Mint18423712025-02-15 13:00:506 days ago1739624450IN
0xe9eB9371...6c0ccCf32
0.007 ETH0.000009560.047
Reveal Mint Resu...18306472025-02-15 9:37:276 days ago1739612247IN
0xe9eB9371...6c0ccCf32
0 ETH0.000007490.04525
Commit To Mint18306352025-02-15 9:37:156 days ago1739612235IN
0xe9eB9371...6c0ccCf32
0.007 ETH0.000009440.04525
Reveal Mint Resu...18283852025-02-15 8:57:536 days ago1739609873IN
0xe9eB9371...6c0ccCf32
0 ETH0.000004740.04525
View all transactions

Latest 25 internal transactions (View All)

Parent Transaction Hash Block From To
18617652025-02-15 18:45:166 days ago1739645116
0xe9eB9371...6c0ccCf32
0.021 ETH
18617652025-02-15 18:45:166 days ago1739645116
0xe9eB9371...6c0ccCf32
0.021 ETH
18500742025-02-15 15:16:096 days ago1739632569
0xe9eB9371...6c0ccCf32
0.007 ETH
18500742025-02-15 15:16:096 days ago1739632569
0xe9eB9371...6c0ccCf32
0.007 ETH
18482892025-02-15 14:44:356 days ago1739630675
0xe9eB9371...6c0ccCf32
0.007 ETH
18482892025-02-15 14:44:356 days ago1739630675
0xe9eB9371...6c0ccCf32
0.007 ETH
18482372025-02-15 14:43:436 days ago1739630623
0xe9eB9371...6c0ccCf32
0.007 ETH
18482372025-02-15 14:43:436 days ago1739630623
0xe9eB9371...6c0ccCf32
0.007 ETH
18423712025-02-15 13:00:506 days ago1739624450
0xe9eB9371...6c0ccCf32
0.007 ETH
18423712025-02-15 13:00:506 days ago1739624450
0xe9eB9371...6c0ccCf32
0.007 ETH
18306352025-02-15 9:37:156 days ago1739612235
0xe9eB9371...6c0ccCf32
0.007 ETH
18306352025-02-15 9:37:156 days ago1739612235
0xe9eB9371...6c0ccCf32
0.007 ETH
18283762025-02-15 8:57:446 days ago1739609864
0xe9eB9371...6c0ccCf32
0.007 ETH
18283762025-02-15 8:57:446 days ago1739609864
0xe9eB9371...6c0ccCf32
0.007 ETH
18283372025-02-15 8:57:056 days ago1739609825
0xe9eB9371...6c0ccCf32
0.007 ETH
18283372025-02-15 8:57:056 days ago1739609825
0xe9eB9371...6c0ccCf32
0.007 ETH
18283032025-02-15 8:56:316 days ago1739609791
0xe9eB9371...6c0ccCf32
0.007 ETH
18283032025-02-15 8:56:316 days ago1739609791
0xe9eB9371...6c0ccCf32
0.007 ETH
18231852025-02-15 7:27:416 days ago1739604461
0xe9eB9371...6c0ccCf32
0.007 ETH
18231852025-02-15 7:27:416 days ago1739604461
0xe9eB9371...6c0ccCf32
0.007 ETH
18008252025-02-15 1:07:117 days ago1739581631
0xe9eB9371...6c0ccCf32
0.07 ETH
18008252025-02-15 1:07:117 days ago1739581631
0xe9eB9371...6c0ccCf32
0.07 ETH
17837102025-02-14 20:17:547 days ago1739564274
0xe9eB9371...6c0ccCf32
0.007 ETH
17837102025-02-14 20:17:547 days ago1739564274
0xe9eB9371...6c0ccCf32
0.007 ETH
17837082025-02-14 20:17:527 days ago1739564272
0xe9eB9371...6c0ccCf32
0.014 ETH
View All Internal Transactions
Loading...
Loading

Similar Match Source Code
This contract matches the deployed Bytecode of the Source Code for Contract 0xD4220018...594DAa9ff
The constructor portion of the code might be different and could alter the actual behaviour of the contract

Contract Name:
SofamonGachaMachine

Compiler Version
v0.8.25+commit.b61c2a91

ZkSolc Version
v1.5.11

Optimization Enabled:
Yes with Mode 3

Other Settings:
cancun EvmVersion
File 1 of 10 : SofamonGachaMachine.sol
/// SPDX-License-Identifier: MIT
pragma solidity ^0.8.25;

import { IRNG } from "src/interfaces/IRNG.sol";
import { Owned } from "lib/solmate/src/auth/Owned.sol";
import { ECDSA } from "lib/solady/src/utils/ECDSA.sol";
import { SofamonWearable } from "src/SofamonWearable.sol";
import { SafeTransferLib } from "lib/solmate/src/utils/SafeTransferLib.sol";

/// @author CopyPaste
/// @title Sofamon V2 Gacha Machine
contract SofamonGachaMachine is Owned(msg.sender) {
    using ECDSA for bytes32;
    using SafeTransferLib for address;

    /*//////////////////////////////////////////////////////////////
                            CONSTRUCTOR
    //////////////////////////////////////////////////////////////*/

    /// @param _rng The RNG Source for the Gache Machine
    /// @param _wearableContract The Sofamon Wearables to give as rewards
    constructor(IRNG _rng, SofamonWearable _wearableContract) {
        rng = _rng;

        sofamonWearables = _wearableContract;

        signer = msg.sender;
        protocolFeeTo = msg.sender;
        commitController = msg.sender;
        revealController = msg.sender;
        operator = msg.sender;

        INITIAL_CHAIN_ID = block.chainid;
        INITIAL_DOMAIN_SEPARATOR = computeDomainSeparator();
    }
    /*//////////////////////////////////////////////////////////////
                               INTERFACE
    //////////////////////////////////////////////////////////////*/

    error NotOwner();
    error NotController();
    error NotApproved();
    error NotOperator();
    error InvalidOdds();
    error LengthMismatch();
    error RevealTooEarly();
    error InvalidRarities();

    event CollectionLaunched(uint256[] wearables, uint256[] rarities, uint16 mintOdds, uint16 otherRewardOdds, uint16 noRewardOdds, uint256 collectionId);
    event WearableCreated(address wearable, string _name, string _symbol, string _baseURI);

    event MintCommited(address from, address minter, uint256 spins, uint256 payment, uint256 userNonce, uint256 nonce);

    event NftMinted(uint256 ticketNonce, uint256 wearable, address recipient);
    event NftMintFailed(uint256 ticketNonce, uint256 wearable, address recipient);
    event NoReward(uint256 ticketNonce, address initiator);
    event OtherResult(uint256 indexed ticketNonce, address indexed winner, uint16 indexed anotherResult);

    // Upgrade Events
    event RNGSourceUpdated(IRNG newRng);
    event OperatorUpdated(address newOperator);
    event SignerUpdated(address newSigner);
    event CommitControllerUpdated(address newController);
    event RevealControllerUpdated(address newController);
    event ProtocolFeeToUpdated(address newProtocolFeeTo);

    uint256 internal immutable INITIAL_CHAIN_ID;

    bytes32 internal immutable INITIAL_DOMAIN_SEPARATOR;

    function DOMAIN_SEPARATOR() public view returns (bytes32) {
        return block.chainid == INITIAL_CHAIN_ID ? INITIAL_DOMAIN_SEPARATOR : computeDomainSeparator();
    }

    function computeDomainSeparator() internal view returns (bytes32) {
        return keccak256(
            abi.encode(
                keccak256("EIP712Domain(string name,string version,uint256 chainId,address verifyingContract)"),
                keccak256(bytes("SofamonGachaMachine")),
                keccak256("1"),
                block.chainid,
                address(this)
            )
        );
    }

    /*//////////////////////////////////////////////////////////////
                               STORAGE
    //////////////////////////////////////////////////////////////*/
    /// @dev MakerDAO Constant for 1e18 Scaling
    uint256 internal constant WAD = 1e18;

    /// @dev EIP-712 Typehash
    bytes32 public constant MINT_TYPE_HASH = keccak256("MintParams(uint256 collectionid,uint256 spins,uint256 nonce,uint256 fee,address minter)");

    /// @dev The RNG source for the Gacha Machine
    IRNG public rng;

    /// @dev The ERC1155 Contract containing all Sofamon Wearables
    SofamonWearable public immutable sofamonWearables;

    /// @dev The address to recieve all protocolFees and royalties
    address public protocolFeeTo;

    /// @dev Since we are using a meta-nft accounting system almost, we need to track how many collections
    ///   we've launched, so each one gets a correct id
    uint256 public maxCollectionId;

    /// @dev A commit controller address which we let pay for users
    address public commitController;

    /// @dev A reveal controller address which we reveals for users
    address public revealController;

    /// @custom:field mintOdds         The odds out of 10_000 for an NFT to be minted
    /// @custom:field otherRewardOdds  The odds out of 10_000 for an otherReward to be minted
    /// @custom:field noRewardOdds     The odds for no reward to occur out of 10_000 to occur
    /// @custom:field rarities         The rarities of the NFTs to be minted out of 10_000
    /// @custom:field wearables        The wearableIds for all NFTs
    struct Collection {
        uint16 mintOdds;
        uint16 otherRewardOdds;
        uint16 noRewardOdds;
        uint256[] rarities;
        uint256[] wearables;
    }

    /// @dev Tracks each collectionId to all of its assosiated data
    mapping(uint256 collectionId => Collection collection) public idToCollection;
    /*//////////////////////////////////////////////////////////////
                                UTILS
    //////////////////////////////////////////////////////////////*/

    /// @dev The Signer Address which we trust to allow spins
    address public signer;
    /// @dev The Address which to use for deployments and creations of new collections
    address public operator;

    /// @param newOperator The new address authorized to create collections
    function setOperator(address newOperator) external onlyOwner {
        operator = newOperator;

        emit OperatorUpdated(newOperator);
    }

    modifier onlyOperator() {
        if (msg.sender != operator) {
            revert NotOperator();
        }
        _;
    }

    /// @param newFeeRecipient The new address to recieve all protocol fees
    function setProtocolFeeTo(address newFeeRecipient) external onlyOwner {
        protocolFeeTo = newFeeRecipient;

        emit ProtocolFeeToUpdated(newFeeRecipient);
    }

    /// @param newController Thew new commit controller address
    function setCommitController(address newController) external onlyOwner {
        commitController = newController;

        emit CommitControllerUpdated(newController);
    }

    /// @param newController The new controller address for revealing mints
    function setRevealController(address newController) external onlyOwner {
        revealController = newController;

        emit RevealControllerUpdated(newController);
    }

    /// @param newSigner The new signer to permit spins
    function setSigner(address newSigner) public onlyOwner {
        signer = newSigner;

        emit SignerUpdated(newSigner);
    }

    /// @param newRng The new source of randomness for the Machine
    function setRNG(IRNG newRng) public onlyOwner {
        rng = newRng;

        emit RNGSourceUpdated(newRng);
    }

    /*//////////////////////////////////////////////////////////////
                          NEW COLLECTIONS
    //////////////////////////////////////////////////////////////*/

    /// @param _wearables An array containing all of the Sofamon Wearables to add to the collection
    /// @param _rarities An array containing the rarities for each respective wearable, from 100-1, indicating the chances
    /// @param _mintOdds The odds out of 100, for a random NFT to be minted
    /// @param _otherRewardOdds The odds out of 100, for an event to be emitted for front-end use
    /// @param _noRewardOdds The odds of out of 100, for nothing to happpen
    ///
    /// @param collectionId The Id of the newly created collection
    function launchNewCollection(
        uint256[] calldata _wearables,
        uint256[] calldata _rarities,
        uint16 _mintOdds,
        uint16 _otherRewardOdds,
        uint16 _noRewardOdds
    )
        public
        onlyOperator
        returns (uint256 collectionId)
    {
        if (_mintOdds + _otherRewardOdds + _noRewardOdds != 10_000) {
            revert InvalidOdds();
        }

        if (_rarities[_rarities.length - 1] != 10_000) {
            revert InvalidRarities();
        }

        if (_wearables.length != _rarities.length) {
            revert LengthMismatch();
        }

        for (uint256 i; i < _rarities.length;) {
            if (_rarities[i] > 10_000) {
                revert InvalidRarities();
            } else if (i != 0) {
                if (_rarities[i] < _rarities[i - 1]) {
                    revert InvalidRarities();
                }
            }

            unchecked {
                ++i;
            }
        }

        maxCollectionId++;
        collectionId = maxCollectionId;

        Collection memory newCollection =
            Collection({ mintOdds: _mintOdds, otherRewardOdds: _otherRewardOdds, noRewardOdds: _noRewardOdds, wearables: _wearables, rarities: _rarities });

        idToCollection[collectionId] = newCollection;

        emit CollectionLaunched(_wearables, _rarities, _mintOdds, _otherRewardOdds, _noRewardOdds, collectionId);
    }

    /// @custom:field owner        The Owner of the Mint
    /// @custom:field collectionId The collectionId of NFTs to be eligible for / mint
    /// @custom:field spins        The amount of gacha spins to occur
    struct NonceData {
        address owner;
        uint128 collectionId;
        uint128 spins;
    }

    /// @dev Tracks Mint Data for the eventual reveal
    mapping(uint256 nonce => NonceData data) public dataOf;
    /// @dev Tracks who owns a given mint nonce
    mapping(address user => uint256 usersNonce) public userNonce;
    /*//////////////////////////////////////////////////////////////
                            MINT / REVEAL
    //////////////////////////////////////////////////////////////*/

    /// @custom:field collectionId The NFT collection to mint / spin for
    /// @custom:field spins        The amount of spins to spin for
    /// @custom:field minter       The address to award the rewards to
    struct MintData {
        uint256 collectionId;
        uint256 spins;
        address minter;
        uint256 fee;
    }

    /// @dev Note, this function should only be called by the commitController, otherwise it will fail with no signature
    /// @param mintData An array of all the spins to spin for
    /// @return ticketNonces The nonces for each spin so that the user can claim their rewards
    function batchCommitToMint(MintData[] calldata mintData) public payable returns (uint256[] memory ticketNonces) {
        ticketNonces = new uint256[](mintData.length);

        for (uint256 i; i < mintData.length;) {
            MintData memory data = mintData[i];

            uint256 nonce = commitToMint(data.collectionId, data.spins, data.minter, data.fee, "");
            ticketNonces[i] = nonce;

            unchecked {
                ++i;
            }
        }
    }

    /// @param _collectionId The Id of the collection you wish to roll for
    /// @param spins The amount of spins you wish to roll
    /// @param signature A signature commit to the price, nonce, and minter from the authority address
    ///
    /// @return ticketNonce The nonce to use to claim your mint
    function commitToMint(
        uint256 _collectionId,
        uint256 spins,
        address minter,
        uint256 fee,
        bytes memory signature
    )
        public
        payable
        returns (uint256 ticketNonce)
    {
        if (msg.sender != commitController) {
            uint256 nonce = userNonce[msg.sender];
            bytes32 hash = keccak256(abi.encodePacked("\x19\x01", DOMAIN_SEPARATOR(), abi.encode(MINT_TYPE_HASH, _collectionId, spins, nonce, fee, minter)));
            address approved = ECDSA.recover(hash, signature);

            // Only allow the approv
            if (approved != signer || minter != msg.sender) {
                revert NotApproved();
            }
        }

        if (fee != 0) {
            protocolFeeTo.safeTransferETH(fee);
        }

        ticketNonce = rng.rng();

        NonceData memory data = NonceData({ owner: minter, collectionId: uint128(_collectionId), spins: uint128(spins) });

        uint256 _userNonce = userNonce[msg.sender];
        userNonce[msg.sender] = _userNonce + 1;

        dataOf[ticketNonce] = data;

        emit MintCommited(msg.sender, minter, spins, msg.value, _userNonce + 1, ticketNonce);
    }

    /// @notice Helper function to bulk reveal results
    /// @param nonces The nonces to reveal the results for
    function revealMintResults(uint256[] calldata nonces) external {
        for (uint256 i; i < nonces.length;) {
            revealMintResult(nonces[i]);

            unchecked {
                ++i;
            }
        }
    }

    /// @param ticketNonce The Ticket to reveal
    function revealMintResult(uint256 ticketNonce) public {
        NonceData memory data = dataOf[ticketNonce];

        // Verify
        if (msg.sender != revealController) {
            revert NotController();
        }

        Collection memory collection = idToCollection[data.collectionId];

        bytes32 committedRandomness = rng.viewRngForNonce(ticketNonce);
        if (committedRandomness == bytes32(0)) {
            revert RevealTooEarly();
        }

        // Run each spin
        for (uint256 i; i < data.spins;) {
            uint256 specificRandomness = uint256(keccak256(abi.encodePacked(committedRandomness, i)));

            uint16 _result = uint16(specificRandomness) % 10_000;

            if (_result < collection.mintOdds) {
                mintRandomNFT(collection, data.owner, keccak256(abi.encode(specificRandomness)), ticketNonce);
            } else if (_result < collection.mintOdds + collection.otherRewardOdds) {
                emit OtherResult(ticketNonce, data.owner, _result);
            } else {
                emit NoReward(ticketNonce, data.owner);
            }

            unchecked {
                ++i;
            }
        }

        // Clear out the Nonce now that we've taken care of everything
        delete dataOf[ticketNonce];
    }

    /// @param collection The Collection Which The NFT is being minted from
    /// @param to The address to mint the NFT to
    /// @param entropy The randomness to use when minting
    /// @param ticketNonce The nonce ticket that is being redeemed
    function mintRandomNFT(Collection memory collection, address to, bytes32 entropy, uint256 ticketNonce) internal {
        uint16 random = uint16(uint256(entropy)) % 10_000;

        for (uint256 i; i < collection.rarities.length;) {
            if (random < collection.rarities[i]) {
                uint256 wearableId = collection.wearables[i];
                try sofamonWearables.mint(to, wearableId) {
                    emit NftMinted(ticketNonce, wearableId, to);
                    return;
                } catch {
                    emit NftMintFailed(ticketNonce, wearableId, to);
                    return;
                }
            }

            unchecked {
                ++i;
            }
        }
    }
}

File 2 of 10 : IRNG.sol
/// SPDX-License-Identifier: MIT
pragma solidity ^0.8.25;

interface IRNG {
    function setCaller(address newCaller) external;
    function rng() external returns (uint256 nonce);
    function viewRngForNonce(uint256 nonce) external view returns (bytes32 randomness);
}

File 3 of 10 : Owned.sol
// SPDX-License-Identifier: AGPL-3.0-only
pragma solidity >=0.8.0;

/// @notice Simple single owner authorization mixin.
/// @author Solmate (https://github.com/transmissions11/solmate/blob/main/src/auth/Owned.sol)
abstract contract Owned {
    /*//////////////////////////////////////////////////////////////
                                 EVENTS
    //////////////////////////////////////////////////////////////*/

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

    /*//////////////////////////////////////////////////////////////
                            OWNERSHIP STORAGE
    //////////////////////////////////////////////////////////////*/

    address public owner;

    modifier onlyOwner() virtual {
        require(msg.sender == owner, "UNAUTHORIZED");

        _;
    }

    /*//////////////////////////////////////////////////////////////
                               CONSTRUCTOR
    //////////////////////////////////////////////////////////////*/

    constructor(address _owner) {
        owner = _owner;

        emit OwnershipTransferred(address(0), _owner);
    }

    /*//////////////////////////////////////////////////////////////
                             OWNERSHIP LOGIC
    //////////////////////////////////////////////////////////////*/

    function transferOwnership(address newOwner) public virtual onlyOwner {
        owner = newOwner;

        emit OwnershipTransferred(msg.sender, newOwner);
    }
}

File 4 of 10 : ECDSA.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.4;

/// @notice Gas optimized ECDSA wrapper.
/// @author Solady (https://github.com/vectorized/solady/blob/main/src/utils/ECDSA.sol)
/// @author Modified from Solmate (https://github.com/transmissions11/solmate/blob/main/src/utils/ECDSA.sol)
/// @author Modified from OpenZeppelin (https://github.com/OpenZeppelin/openzeppelin-contracts/blob/master/contracts/utils/cryptography/ECDSA.sol)
///
/// @dev Note:
/// - The recovery functions use the ecrecover precompile (0x1).
/// - As of Solady version 0.0.68, the `recover` variants will revert upon recovery failure.
///   This is for more safety by default.
///   Use the `tryRecover` variants if you need to get the zero address back
///   upon recovery failure instead.
/// - As of Solady version 0.0.134, all `bytes signature` variants accept both
///   regular 65-byte `(r, s, v)` and EIP-2098 `(r, vs)` short form signatures.
///   See: https://eips.ethereum.org/EIPS/eip-2098
///   This is for calldata efficiency on smart accounts prevalent on L2s.
///
/// WARNING! Do NOT use signatures as unique identifiers:
/// - Use a nonce in the digest to prevent replay attacks on the same contract.
/// - Use EIP-712 for the digest to prevent replay attacks across different chains and contracts.
///   EIP-712 also enables readable signing of typed data for better user safety.
/// This implementation does NOT check if a signature is non-malleable.
library ECDSA {
    /*´:°•.°+.*•´.*:˚.°*.˚•´.°:°•.°•.*•´.*:˚.°*.˚•´.°:°•.°+.*•´.*:*/
    /*                        CUSTOM ERRORS                       */
    /*.•°:°.´+˚.*°.˚:*.´•*.+°.•°:´*.´•*.•°.•°:°.´:•˚°.*°.˚:*.´+°.•*/

    /// @dev The signature is invalid.
    error InvalidSignature();

    /*´:°•.°+.*•´.*:˚.°*.˚•´.°:°•.°•.*•´.*:˚.°*.˚•´.°:°•.°+.*•´.*:*/
    /*                    RECOVERY OPERATIONS                     */
    /*.•°:°.´+˚.*°.˚:*.´•*.+°.•°:´*.´•*.•°.•°:°.´:•˚°.*°.˚:*.´+°.•*/

    /// @dev Recovers the signer's address from a message digest `hash`, and the `signature`.
    function recover(bytes32 hash, bytes memory signature) internal view returns (address result) {
        /// @solidity memory-safe-assembly
        assembly {
            result := 1
            let m := mload(0x40) // Cache the free memory pointer.
            for {} 1 {} {
                mstore(0x00, hash)
                mstore(0x40, mload(add(signature, 0x20))) // `r`.
                if eq(mload(signature), 64) {
                    let vs := mload(add(signature, 0x40))
                    mstore(0x20, add(shr(255, vs), 27)) // `v`.
                    mstore(0x60, shr(1, shl(1, vs))) // `s`.
                    break
                }
                if eq(mload(signature), 65) {
                    mstore(0x20, byte(0, mload(add(signature, 0x60)))) // `v`.
                    mstore(0x60, mload(add(signature, 0x40))) // `s`.
                    break
                }
                result := 0
                break
            }
            result :=
                mload(
                    staticcall(
                        gas(), // Amount of gas left for the transaction.
                        result, // Address of `ecrecover`.
                        0x00, // Start of input.
                        0x80, // Size of input.
                        0x01, // Start of output.
                        0x20 // Size of output.
                    )
                )
            // `returndatasize()` will be `0x20` upon success, and `0x00` otherwise.
            if iszero(returndatasize()) {
                mstore(0x00, 0x8baa579f) // `InvalidSignature()`.
                revert(0x1c, 0x04)
            }
            mstore(0x60, 0) // Restore the zero slot.
            mstore(0x40, m) // Restore the free memory pointer.
        }
    }

    /// @dev Recovers the signer's address from a message digest `hash`, and the `signature`.
    function recoverCalldata(bytes32 hash, bytes calldata signature)
        internal
        view
        returns (address result)
    {
        /// @solidity memory-safe-assembly
        assembly {
            result := 1
            let m := mload(0x40) // Cache the free memory pointer.
            mstore(0x00, hash)
            for {} 1 {} {
                if eq(signature.length, 64) {
                    let vs := calldataload(add(signature.offset, 0x20))
                    mstore(0x20, add(shr(255, vs), 27)) // `v`.
                    mstore(0x40, calldataload(signature.offset)) // `r`.
                    mstore(0x60, shr(1, shl(1, vs))) // `s`.
                    break
                }
                if eq(signature.length, 65) {
                    mstore(0x20, byte(0, calldataload(add(signature.offset, 0x40)))) // `v`.
                    calldatacopy(0x40, signature.offset, 0x40) // Copy `r` and `s`.
                    break
                }
                result := 0
                break
            }
            result :=
                mload(
                    staticcall(
                        gas(), // Amount of gas left for the transaction.
                        result, // Address of `ecrecover`.
                        0x00, // Start of input.
                        0x80, // Size of input.
                        0x01, // Start of output.
                        0x20 // Size of output.
                    )
                )
            // `returndatasize()` will be `0x20` upon success, and `0x00` otherwise.
            if iszero(returndatasize()) {
                mstore(0x00, 0x8baa579f) // `InvalidSignature()`.
                revert(0x1c, 0x04)
            }
            mstore(0x60, 0) // Restore the zero slot.
            mstore(0x40, m) // Restore the free memory pointer.
        }
    }

    /// @dev Recovers the signer's address from a message digest `hash`,
    /// and the EIP-2098 short form signature defined by `r` and `vs`.
    function recover(bytes32 hash, bytes32 r, bytes32 vs) internal view returns (address result) {
        /// @solidity memory-safe-assembly
        assembly {
            let m := mload(0x40) // Cache the free memory pointer.
            mstore(0x00, hash)
            mstore(0x20, add(shr(255, vs), 27)) // `v`.
            mstore(0x40, r)
            mstore(0x60, shr(1, shl(1, vs))) // `s`.
            result :=
                mload(
                    staticcall(
                        gas(), // Amount of gas left for the transaction.
                        1, // Address of `ecrecover`.
                        0x00, // Start of input.
                        0x80, // Size of input.
                        0x01, // Start of output.
                        0x20 // Size of output.
                    )
                )
            // `returndatasize()` will be `0x20` upon success, and `0x00` otherwise.
            if iszero(returndatasize()) {
                mstore(0x00, 0x8baa579f) // `InvalidSignature()`.
                revert(0x1c, 0x04)
            }
            mstore(0x60, 0) // Restore the zero slot.
            mstore(0x40, m) // Restore the free memory pointer.
        }
    }

    /// @dev Recovers the signer's address from a message digest `hash`,
    /// and the signature defined by `v`, `r`, `s`.
    function recover(bytes32 hash, uint8 v, bytes32 r, bytes32 s)
        internal
        view
        returns (address result)
    {
        /// @solidity memory-safe-assembly
        assembly {
            let m := mload(0x40) // Cache the free memory pointer.
            mstore(0x00, hash)
            mstore(0x20, and(v, 0xff))
            mstore(0x40, r)
            mstore(0x60, s)
            result :=
                mload(
                    staticcall(
                        gas(), // Amount of gas left for the transaction.
                        1, // Address of `ecrecover`.
                        0x00, // Start of input.
                        0x80, // Size of input.
                        0x01, // Start of output.
                        0x20 // Size of output.
                    )
                )
            // `returndatasize()` will be `0x20` upon success, and `0x00` otherwise.
            if iszero(returndatasize()) {
                mstore(0x00, 0x8baa579f) // `InvalidSignature()`.
                revert(0x1c, 0x04)
            }
            mstore(0x60, 0) // Restore the zero slot.
            mstore(0x40, m) // Restore the free memory pointer.
        }
    }

    /*´:°•.°+.*•´.*:˚.°*.˚•´.°:°•.°•.*•´.*:˚.°*.˚•´.°:°•.°+.*•´.*:*/
    /*                   TRY-RECOVER OPERATIONS                   */
    /*.•°:°.´+˚.*°.˚:*.´•*.+°.•°:´*.´•*.•°.•°:°.´:•˚°.*°.˚:*.´+°.•*/

    // WARNING!
    // These functions will NOT revert upon recovery failure.
    // Instead, they will return the zero address upon recovery failure.
    // It is critical that the returned address is NEVER compared against
    // a zero address (e.g. an uninitialized address variable).

    /// @dev Recovers the signer's address from a message digest `hash`, and the `signature`.
    function tryRecover(bytes32 hash, bytes memory signature)
        internal
        view
        returns (address result)
    {
        /// @solidity memory-safe-assembly
        assembly {
            result := 1
            let m := mload(0x40) // Cache the free memory pointer.
            for {} 1 {} {
                mstore(0x00, hash)
                mstore(0x40, mload(add(signature, 0x20))) // `r`.
                if eq(mload(signature), 64) {
                    let vs := mload(add(signature, 0x40))
                    mstore(0x20, add(shr(255, vs), 27)) // `v`.
                    mstore(0x60, shr(1, shl(1, vs))) // `s`.
                    break
                }
                if eq(mload(signature), 65) {
                    mstore(0x20, byte(0, mload(add(signature, 0x60)))) // `v`.
                    mstore(0x60, mload(add(signature, 0x40))) // `s`.
                    break
                }
                result := 0
                break
            }
            pop(
                staticcall(
                    gas(), // Amount of gas left for the transaction.
                    result, // Address of `ecrecover`.
                    0x00, // Start of input.
                    0x80, // Size of input.
                    0x40, // Start of output.
                    0x20 // Size of output.
                )
            )
            mstore(0x60, 0) // Restore the zero slot.
            // `returndatasize()` will be `0x20` upon success, and `0x00` otherwise.
            result := mload(xor(0x60, returndatasize()))
            mstore(0x40, m) // Restore the free memory pointer.
        }
    }

    /// @dev Recovers the signer's address from a message digest `hash`, and the `signature`.
    function tryRecoverCalldata(bytes32 hash, bytes calldata signature)
        internal
        view
        returns (address result)
    {
        /// @solidity memory-safe-assembly
        assembly {
            result := 1
            let m := mload(0x40) // Cache the free memory pointer.
            mstore(0x00, hash)
            for {} 1 {} {
                if eq(signature.length, 64) {
                    let vs := calldataload(add(signature.offset, 0x20))
                    mstore(0x20, add(shr(255, vs), 27)) // `v`.
                    mstore(0x40, calldataload(signature.offset)) // `r`.
                    mstore(0x60, shr(1, shl(1, vs))) // `s`.
                    break
                }
                if eq(signature.length, 65) {
                    mstore(0x20, byte(0, calldataload(add(signature.offset, 0x40)))) // `v`.
                    calldatacopy(0x40, signature.offset, 0x40) // Copy `r` and `s`.
                    break
                }
                result := 0
                break
            }
            pop(
                staticcall(
                    gas(), // Amount of gas left for the transaction.
                    result, // Address of `ecrecover`.
                    0x00, // Start of input.
                    0x80, // Size of input.
                    0x40, // Start of output.
                    0x20 // Size of output.
                )
            )
            mstore(0x60, 0) // Restore the zero slot.
            // `returndatasize()` will be `0x20` upon success, and `0x00` otherwise.
            result := mload(xor(0x60, returndatasize()))
            mstore(0x40, m) // Restore the free memory pointer.
        }
    }

    /// @dev Recovers the signer's address from a message digest `hash`,
    /// and the EIP-2098 short form signature defined by `r` and `vs`.
    function tryRecover(bytes32 hash, bytes32 r, bytes32 vs)
        internal
        view
        returns (address result)
    {
        /// @solidity memory-safe-assembly
        assembly {
            let m := mload(0x40) // Cache the free memory pointer.
            mstore(0x00, hash)
            mstore(0x20, add(shr(255, vs), 27)) // `v`.
            mstore(0x40, r)
            mstore(0x60, shr(1, shl(1, vs))) // `s`.
            pop(
                staticcall(
                    gas(), // Amount of gas left for the transaction.
                    1, // Address of `ecrecover`.
                    0x00, // Start of input.
                    0x80, // Size of input.
                    0x40, // Start of output.
                    0x20 // Size of output.
                )
            )
            mstore(0x60, 0) // Restore the zero slot.
            // `returndatasize()` will be `0x20` upon success, and `0x00` otherwise.
            result := mload(xor(0x60, returndatasize()))
            mstore(0x40, m) // Restore the free memory pointer.
        }
    }

    /// @dev Recovers the signer's address from a message digest `hash`,
    /// and the signature defined by `v`, `r`, `s`.
    function tryRecover(bytes32 hash, uint8 v, bytes32 r, bytes32 s)
        internal
        view
        returns (address result)
    {
        /// @solidity memory-safe-assembly
        assembly {
            let m := mload(0x40) // Cache the free memory pointer.
            mstore(0x00, hash)
            mstore(0x20, and(v, 0xff))
            mstore(0x40, r)
            mstore(0x60, s)
            pop(
                staticcall(
                    gas(), // Amount of gas left for the transaction.
                    1, // Address of `ecrecover`.
                    0x00, // Start of input.
                    0x80, // Size of input.
                    0x40, // Start of output.
                    0x20 // Size of output.
                )
            )
            mstore(0x60, 0) // Restore the zero slot.
            // `returndatasize()` will be `0x20` upon success, and `0x00` otherwise.
            result := mload(xor(0x60, returndatasize()))
            mstore(0x40, m) // Restore the free memory pointer.
        }
    }

    /*´:°•.°+.*•´.*:˚.°*.˚•´.°:°•.°•.*•´.*:˚.°*.˚•´.°:°•.°+.*•´.*:*/
    /*                     HASHING OPERATIONS                     */
    /*.•°:°.´+˚.*°.˚:*.´•*.+°.•°:´*.´•*.•°.•°:°.´:•˚°.*°.˚:*.´+°.•*/

    /// @dev Returns an Ethereum Signed Message, created from a `hash`.
    /// This produces a hash corresponding to the one signed with the
    /// [`eth_sign`](https://ethereum.org/en/developers/docs/apis/json-rpc/#eth_sign)
    /// JSON-RPC method as part of EIP-191.
    function toEthSignedMessageHash(bytes32 hash) internal pure returns (bytes32 result) {
        /// @solidity memory-safe-assembly
        assembly {
            mstore(0x20, hash) // Store into scratch space for keccak256.
            mstore(0x00, "\x00\x00\x00\x00\x19Ethereum Signed Message:\n32") // 28 bytes.
            result := keccak256(0x04, 0x3c) // `32 * 2 - (32 - 28) = 60 = 0x3c`.
        }
    }

    /// @dev Returns an Ethereum Signed Message, created from `s`.
    /// This produces a hash corresponding to the one signed with the
    /// [`eth_sign`](https://ethereum.org/en/developers/docs/apis/json-rpc/#eth_sign)
    /// JSON-RPC method as part of EIP-191.
    /// Note: Supports lengths of `s` up to 999999 bytes.
    function toEthSignedMessageHash(bytes memory s) internal pure returns (bytes32 result) {
        /// @solidity memory-safe-assembly
        assembly {
            let sLength := mload(s)
            let o := 0x20
            mstore(o, "\x19Ethereum Signed Message:\n") // 26 bytes, zero-right-padded.
            mstore(0x00, 0x00)
            // Convert the `s.length` to ASCII decimal representation: `base10(s.length)`.
            for { let temp := sLength } 1 {} {
                o := sub(o, 1)
                mstore8(o, add(48, mod(temp, 10)))
                temp := div(temp, 10)
                if iszero(temp) { break }
            }
            let n := sub(0x3a, o) // Header length: `26 + 32 - o`.
            // Throw an out-of-offset error (consumes all gas) if the header exceeds 32 bytes.
            returndatacopy(returndatasize(), returndatasize(), gt(n, 0x20))
            mstore(s, or(mload(0x00), mload(n))) // Temporarily store the header.
            result := keccak256(add(s, sub(0x20, n)), add(n, sLength))
            mstore(s, sLength) // Restore the length.
        }
    }

    /*´:°•.°+.*•´.*:˚.°*.˚•´.°:°•.°•.*•´.*:˚.°*.˚•´.°:°•.°+.*•´.*:*/
    /*                   EMPTY CALLDATA HELPERS                   */
    /*.•°:°.´+˚.*°.˚:*.´•*.+°.•°:´*.´•*.•°.•°:°.´:•˚°.*°.˚:*.´+°.•*/

    /// @dev Returns an empty calldata bytes.
    function emptySignature() internal pure returns (bytes calldata signature) {
        /// @solidity memory-safe-assembly
        assembly {
            signature.length := 0
        }
    }
}

File 5 of 10 : SofamonWearable.sol
/// SPDX-License-Identifier: MIT
pragma solidity ^0.8.25;

import { Owned } from "lib/solmate/src/auth/Owned.sol";
import { ERC1155 } from "lib/solmate/src/tokens/ERC1155.sol";
import { LibString } from "lib/solady/src/utils/LibString.sol";
import { ISofamonGachaMachine } from "src/interfaces/ISofamonGachaMachine.sol";

/// @author CopyPaste
/// @title SofamonWearable, A Wearable NFT for your Sofamon!
contract SofamonWearable is ERC1155, Owned(msg.sender) {
    /*//////////////////////////////////////////////////////////////
                             CONSTRUCTOR
    //////////////////////////////////////////////////////////////*/
    error NotMachine();
    error AddressBlacklisted();

    /// @param _baseURI The base URI for all Sofamon Weawrable Metadata
    constructor(string memory _baseURI) ERC1155() {
        baseURI = _baseURI;
    }

    /*//////////////////////////////////////////////////////////////
                              STORAGE
    //////////////////////////////////////////////////////////////*/
    /// @dev MakerDAO Constant for 1e18 Scaling
    uint256 constant WAD = 1e18;
    /// @dev The SofamonGachaMachine address
    address public machine;
    /// @dev Mapping tracks whether or not an address is blacklisted to interact with Sofamon
    mapping(address addr => bool auth) public blacklisted;

    /// @param newMachine The new address of the Sofamon Gacha Machien
    function setGachaMachine(address newMachine) public onlyOwner {
        machine = newMachine;
    }

    /// @param user The user to determine the status of
    /// @param status Whether or not the user is blacklisted
    function setBlacklist(address user, bool status) external onlyOwner {
        blacklisted[user] = status;
    }

    /// @param newURI The new base ERC1155 URI
    function setURI(string memory newURI) external onlyOwner {
        baseURI = newURI;
    }

    /// @param person The address to check is not blacklisted
    modifier NoBlacklist(address person) {
        if (blacklisted[person]) {
            revert AddressBlacklisted();
        }
        _;
    }
    /*//////////////////////////////////////////////////////////////
                      ERC1155 BLACKLIST OVERRIDES
    //////////////////////////////////////////////////////////////*/

    function setApprovalForAll(address operator, bool approved) public override {
        super.setApprovalForAll(operator, approved);
    }

    function safeTransferFrom(
        address from,
        address to,
        uint256 id,
        uint256 amount,
        bytes calldata data
    )
        public
        override
        NoBlacklist(to)
        NoBlacklist(from)
        NoBlacklist(msg.sender)
    {
        super.safeTransferFrom(from, to, id, amount, data);
    }

    function safeBatchTransferFrom(
        address from,
        address to,
        uint256[] calldata ids,
        uint256[] calldata amounts,
        bytes calldata data
    )
        public
        override
        NoBlacklist(to)
        NoBlacklist(from)
        NoBlacklist(msg.sender)
    {
        super.safeBatchTransferFrom(from, to, ids, amounts, data);
    }

    /*//////////////////////////////////////////////////////////////
                          ERC1155 METADATA
    //////////////////////////////////////////////////////////////*/
    /// @dev The baseURI for the Sofamon Wearable Metadata
    string internal baseURI;

    /// @dev Returns the Uniform Resource Identifier (URI) for token `id`.
    function uri(uint256 id) public view override returns (string memory) {
        return string(abi.encodePacked(baseURI, LibString.toString(id)));
    }

    /*//////////////////////////////////////////////////////////////
                          ERC1155 EXTENSION
    n/////////////////////////////////////////////////////////////*/

    /// @param to The address to mint the NFT to
    /// @param wearable The WearableId to mint
    function mint(address to, uint256 wearable) external {
        if (msg.sender != machine) {
            revert NotMachine();
        }

        _mint(to, wearable, 1, "");
    }

    /// @notice Irreversibly Burns a Sofamon Wearable, should only be called
    ///   if you know what you are doing
    /// @param wearable The WearableId to burn
    /// @param amount The amount of wearables to burn
    function burn(uint256 wearable, uint256 amount) external {
        _burn(msg.sender, wearable, amount);
    }

    /*//////////////////////////////////////////////////////////////
                              ERC2981
    //////////////////////////////////////////////////////////////*/
    /// @dev The royalty fee to take from sales out of 1e18
    uint256 public royaltyFee;

    event NewRoyaltyFee(uint256 newFee);

    /// @param newRoyaltyFee The new fee out of 1e18 to set for royalties
    function updateRoyaltyFee(uint256 newRoyaltyFee) public onlyOwner {
        royaltyFee = newRoyaltyFee;

        emit NewRoyaltyFee(newRoyaltyFee);
    }

    /// @param _salePrice The sale price of the NFT
    ///
    /// @return receiver The address to send the royalty fee to
    /// @return royaltyAmount The amount which should be paid as a royalty
    function royaltyInfo(uint256, uint256 _salePrice) external view returns (address receiver, uint256 royaltyAmount) {
        receiver = ISofamonGachaMachine(machine).protocolFeeTo();
        royaltyAmount = _salePrice * royaltyFee / WAD;
    }

    /*//////////////////////////////////////////////////////////////
                              ERC165
    //////////////////////////////////////////////////////////////*/

    /// @param interfaceId The interfaceId, or 4byte signature of the interface
    /// @return supported Whether or not the interface is supported
    function supportsInterface(bytes4 interfaceId) public pure override returns (bool supported) {
        supported = interfaceId == 0x01ffc9a7 // ERC165 Interface ID for ERC165
            || interfaceId == 0xd9b67a26 // ERC165 Interface ID for ERC1155
            || interfaceId == 0x2a55205a; // ERC165 Interface ID for ERC2981
    }
}

File 6 of 10 : SafeTransferLib.sol
// SPDX-License-Identifier: AGPL-3.0-only
pragma solidity >=0.8.0;

import {ERC20} from "../tokens/ERC20.sol";

/// @notice Safe ETH and ERC20 transfer library that gracefully handles missing return values.
/// @author Solmate (https://github.com/transmissions11/solmate/blob/main/src/utils/SafeTransferLib.sol)
/// @dev Use with caution! Some functions in this library knowingly create dirty bits at the destination of the free memory pointer.
/// @dev Note that none of the functions in this library check that a token has code at all! That responsibility is delegated to the caller.
library SafeTransferLib {
    /*//////////////////////////////////////////////////////////////
                             ETH OPERATIONS
    //////////////////////////////////////////////////////////////*/

    function safeTransferETH(address to, uint256 amount) internal {
        bool success;

        /// @solidity memory-safe-assembly
        assembly {
            // Transfer the ETH and store if it succeeded or not.
            success := call(gas(), to, amount, 0, 0, 0, 0)
        }

        require(success, "ETH_TRANSFER_FAILED");
    }

    /*//////////////////////////////////////////////////////////////
                            ERC20 OPERATIONS
    //////////////////////////////////////////////////////////////*/

    function safeTransferFrom(
        ERC20 token,
        address from,
        address to,
        uint256 amount
    ) internal {
        bool success;

        /// @solidity memory-safe-assembly
        assembly {
            // Get a pointer to some free memory.
            let freeMemoryPointer := mload(0x40)

            // Write the abi-encoded calldata into memory, beginning with the function selector.
            mstore(freeMemoryPointer, 0x23b872dd00000000000000000000000000000000000000000000000000000000)
            mstore(add(freeMemoryPointer, 4), and(from, 0xffffffffffffffffffffffffffffffffffffffff)) // Append and mask the "from" argument.
            mstore(add(freeMemoryPointer, 36), and(to, 0xffffffffffffffffffffffffffffffffffffffff)) // Append and mask the "to" argument.
            mstore(add(freeMemoryPointer, 68), amount) // Append the "amount" argument. Masking not required as it's a full 32 byte type.

            success := and(
                // Set success to whether the call reverted, if not we check it either
                // returned exactly 1 (can't just be non-zero data), or had no return data.
                or(and(eq(mload(0), 1), gt(returndatasize(), 31)), iszero(returndatasize())),
                // We use 100 because the length of our calldata totals up like so: 4 + 32 * 3.
                // We use 0 and 32 to copy up to 32 bytes of return data into the scratch space.
                // Counterintuitively, this call must be positioned second to the or() call in the
                // surrounding and() call or else returndatasize() will be zero during the computation.
                call(gas(), token, 0, freeMemoryPointer, 100, 0, 32)
            )
        }

        require(success, "TRANSFER_FROM_FAILED");
    }

    function safeTransfer(
        ERC20 token,
        address to,
        uint256 amount
    ) internal {
        bool success;

        /// @solidity memory-safe-assembly
        assembly {
            // Get a pointer to some free memory.
            let freeMemoryPointer := mload(0x40)

            // Write the abi-encoded calldata into memory, beginning with the function selector.
            mstore(freeMemoryPointer, 0xa9059cbb00000000000000000000000000000000000000000000000000000000)
            mstore(add(freeMemoryPointer, 4), and(to, 0xffffffffffffffffffffffffffffffffffffffff)) // Append and mask the "to" argument.
            mstore(add(freeMemoryPointer, 36), amount) // Append the "amount" argument. Masking not required as it's a full 32 byte type.

            success := and(
                // Set success to whether the call reverted, if not we check it either
                // returned exactly 1 (can't just be non-zero data), or had no return data.
                or(and(eq(mload(0), 1), gt(returndatasize(), 31)), iszero(returndatasize())),
                // We use 68 because the length of our calldata totals up like so: 4 + 32 * 2.
                // We use 0 and 32 to copy up to 32 bytes of return data into the scratch space.
                // Counterintuitively, this call must be positioned second to the or() call in the
                // surrounding and() call or else returndatasize() will be zero during the computation.
                call(gas(), token, 0, freeMemoryPointer, 68, 0, 32)
            )
        }

        require(success, "TRANSFER_FAILED");
    }

    function safeApprove(
        ERC20 token,
        address to,
        uint256 amount
    ) internal {
        bool success;

        /// @solidity memory-safe-assembly
        assembly {
            // Get a pointer to some free memory.
            let freeMemoryPointer := mload(0x40)

            // Write the abi-encoded calldata into memory, beginning with the function selector.
            mstore(freeMemoryPointer, 0x095ea7b300000000000000000000000000000000000000000000000000000000)
            mstore(add(freeMemoryPointer, 4), and(to, 0xffffffffffffffffffffffffffffffffffffffff)) // Append and mask the "to" argument.
            mstore(add(freeMemoryPointer, 36), amount) // Append the "amount" argument. Masking not required as it's a full 32 byte type.

            success := and(
                // Set success to whether the call reverted, if not we check it either
                // returned exactly 1 (can't just be non-zero data), or had no return data.
                or(and(eq(mload(0), 1), gt(returndatasize(), 31)), iszero(returndatasize())),
                // We use 68 because the length of our calldata totals up like so: 4 + 32 * 2.
                // We use 0 and 32 to copy up to 32 bytes of return data into the scratch space.
                // Counterintuitively, this call must be positioned second to the or() call in the
                // surrounding and() call or else returndatasize() will be zero during the computation.
                call(gas(), token, 0, freeMemoryPointer, 68, 0, 32)
            )
        }

        require(success, "APPROVE_FAILED");
    }
}

File 7 of 10 : ERC1155.sol
// SPDX-License-Identifier: AGPL-3.0-only
pragma solidity >=0.8.0;

/// @notice Minimalist and gas efficient standard ERC1155 implementation.
/// @author Solmate (https://github.com/transmissions11/solmate/blob/main/src/tokens/ERC1155.sol)
abstract contract ERC1155 {
    /*//////////////////////////////////////////////////////////////
                                 EVENTS
    //////////////////////////////////////////////////////////////*/

    event TransferSingle(
        address indexed operator,
        address indexed from,
        address indexed to,
        uint256 id,
        uint256 amount
    );

    event TransferBatch(
        address indexed operator,
        address indexed from,
        address indexed to,
        uint256[] ids,
        uint256[] amounts
    );

    event ApprovalForAll(address indexed owner, address indexed operator, bool approved);

    event URI(string value, uint256 indexed id);

    /*//////////////////////////////////////////////////////////////
                             ERC1155 STORAGE
    //////////////////////////////////////////////////////////////*/

    mapping(address => mapping(uint256 => uint256)) public balanceOf;

    mapping(address => mapping(address => bool)) public isApprovedForAll;

    /*//////////////////////////////////////////////////////////////
                             METADATA LOGIC
    //////////////////////////////////////////////////////////////*/

    function uri(uint256 id) public view virtual returns (string memory);

    /*//////////////////////////////////////////////////////////////
                              ERC1155 LOGIC
    //////////////////////////////////////////////////////////////*/

    function setApprovalForAll(address operator, bool approved) public virtual {
        isApprovedForAll[msg.sender][operator] = approved;

        emit ApprovalForAll(msg.sender, operator, approved);
    }

    function safeTransferFrom(
        address from,
        address to,
        uint256 id,
        uint256 amount,
        bytes calldata data
    ) public virtual {
        require(msg.sender == from || isApprovedForAll[from][msg.sender], "NOT_AUTHORIZED");

        balanceOf[from][id] -= amount;
        balanceOf[to][id] += amount;

        emit TransferSingle(msg.sender, from, to, id, amount);

        require(
            to.code.length == 0
                ? to != address(0)
                : ERC1155TokenReceiver(to).onERC1155Received(msg.sender, from, id, amount, data) ==
                    ERC1155TokenReceiver.onERC1155Received.selector,
            "UNSAFE_RECIPIENT"
        );
    }

    function safeBatchTransferFrom(
        address from,
        address to,
        uint256[] calldata ids,
        uint256[] calldata amounts,
        bytes calldata data
    ) public virtual {
        require(ids.length == amounts.length, "LENGTH_MISMATCH");

        require(msg.sender == from || isApprovedForAll[from][msg.sender], "NOT_AUTHORIZED");

        // Storing these outside the loop saves ~15 gas per iteration.
        uint256 id;
        uint256 amount;

        for (uint256 i = 0; i < ids.length; ) {
            id = ids[i];
            amount = amounts[i];

            balanceOf[from][id] -= amount;
            balanceOf[to][id] += amount;

            // An array can't have a total length
            // larger than the max uint256 value.
            unchecked {
                ++i;
            }
        }

        emit TransferBatch(msg.sender, from, to, ids, amounts);

        require(
            to.code.length == 0
                ? to != address(0)
                : ERC1155TokenReceiver(to).onERC1155BatchReceived(msg.sender, from, ids, amounts, data) ==
                    ERC1155TokenReceiver.onERC1155BatchReceived.selector,
            "UNSAFE_RECIPIENT"
        );
    }

    function balanceOfBatch(address[] calldata owners, uint256[] calldata ids)
        public
        view
        virtual
        returns (uint256[] memory balances)
    {
        require(owners.length == ids.length, "LENGTH_MISMATCH");

        balances = new uint256[](owners.length);

        // Unchecked because the only math done is incrementing
        // the array index counter which cannot possibly overflow.
        unchecked {
            for (uint256 i = 0; i < owners.length; ++i) {
                balances[i] = balanceOf[owners[i]][ids[i]];
            }
        }
    }

    /*//////////////////////////////////////////////////////////////
                              ERC165 LOGIC
    //////////////////////////////////////////////////////////////*/

    function supportsInterface(bytes4 interfaceId) public view virtual returns (bool) {
        return
            interfaceId == 0x01ffc9a7 || // ERC165 Interface ID for ERC165
            interfaceId == 0xd9b67a26 || // ERC165 Interface ID for ERC1155
            interfaceId == 0x0e89341c; // ERC165 Interface ID for ERC1155MetadataURI
    }

    /*//////////////////////////////////////////////////////////////
                        INTERNAL MINT/BURN LOGIC
    //////////////////////////////////////////////////////////////*/

    function _mint(
        address to,
        uint256 id,
        uint256 amount,
        bytes memory data
    ) internal virtual {
        balanceOf[to][id] += amount;

        emit TransferSingle(msg.sender, address(0), to, id, amount);

        require(
            to.code.length == 0
                ? to != address(0)
                : ERC1155TokenReceiver(to).onERC1155Received(msg.sender, address(0), id, amount, data) ==
                    ERC1155TokenReceiver.onERC1155Received.selector,
            "UNSAFE_RECIPIENT"
        );
    }

    function _batchMint(
        address to,
        uint256[] memory ids,
        uint256[] memory amounts,
        bytes memory data
    ) internal virtual {
        uint256 idsLength = ids.length; // Saves MLOADs.

        require(idsLength == amounts.length, "LENGTH_MISMATCH");

        for (uint256 i = 0; i < idsLength; ) {
            balanceOf[to][ids[i]] += amounts[i];

            // An array can't have a total length
            // larger than the max uint256 value.
            unchecked {
                ++i;
            }
        }

        emit TransferBatch(msg.sender, address(0), to, ids, amounts);

        require(
            to.code.length == 0
                ? to != address(0)
                : ERC1155TokenReceiver(to).onERC1155BatchReceived(msg.sender, address(0), ids, amounts, data) ==
                    ERC1155TokenReceiver.onERC1155BatchReceived.selector,
            "UNSAFE_RECIPIENT"
        );
    }

    function _batchBurn(
        address from,
        uint256[] memory ids,
        uint256[] memory amounts
    ) internal virtual {
        uint256 idsLength = ids.length; // Saves MLOADs.

        require(idsLength == amounts.length, "LENGTH_MISMATCH");

        for (uint256 i = 0; i < idsLength; ) {
            balanceOf[from][ids[i]] -= amounts[i];

            // An array can't have a total length
            // larger than the max uint256 value.
            unchecked {
                ++i;
            }
        }

        emit TransferBatch(msg.sender, from, address(0), ids, amounts);
    }

    function _burn(
        address from,
        uint256 id,
        uint256 amount
    ) internal virtual {
        balanceOf[from][id] -= amount;

        emit TransferSingle(msg.sender, from, address(0), id, amount);
    }
}

/// @notice A generic interface for a contract which properly accepts ERC1155 tokens.
/// @author Solmate (https://github.com/transmissions11/solmate/blob/main/src/tokens/ERC1155.sol)
abstract contract ERC1155TokenReceiver {
    function onERC1155Received(
        address,
        address,
        uint256,
        uint256,
        bytes calldata
    ) external virtual returns (bytes4) {
        return ERC1155TokenReceiver.onERC1155Received.selector;
    }

    function onERC1155BatchReceived(
        address,
        address,
        uint256[] calldata,
        uint256[] calldata,
        bytes calldata
    ) external virtual returns (bytes4) {
        return ERC1155TokenReceiver.onERC1155BatchReceived.selector;
    }
}

File 8 of 10 : LibString.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.4;

/// @notice Library for converting numbers into strings and other string operations.
/// @author Solady (https://github.com/vectorized/solady/blob/main/src/utils/LibString.sol)
/// @author Modified from Solmate (https://github.com/transmissions11/solmate/blob/main/src/utils/LibString.sol)
///
/// @dev Note:
/// For performance and bytecode compactness, most of the string operations are restricted to
/// byte strings (7-bit ASCII), except where otherwise specified.
/// Usage of byte string operations on charsets with runes spanning two or more bytes
/// can lead to undefined behavior.
library LibString {
    /*´:°•.°+.*•´.*:˚.°*.˚•´.°:°•.°•.*•´.*:˚.°*.˚•´.°:°•.°+.*•´.*:*/
    /*                        CUSTOM ERRORS                       */
    /*.•°:°.´+˚.*°.˚:*.´•*.+°.•°:´*.´•*.•°.•°:°.´:•˚°.*°.˚:*.´+°.•*/

    /// @dev The length of the output is too small to contain all the hex digits.
    error HexLengthInsufficient();

    /// @dev The length of the string is more than 32 bytes.
    error TooBigForSmallString();

    /// @dev The input string must be a 7-bit ASCII.
    error StringNot7BitASCII();

    /*´:°•.°+.*•´.*:˚.°*.˚•´.°:°•.°•.*•´.*:˚.°*.˚•´.°:°•.°+.*•´.*:*/
    /*                         CONSTANTS                          */
    /*.•°:°.´+˚.*°.˚:*.´•*.+°.•°:´*.´•*.•°.•°:°.´:•˚°.*°.˚:*.´+°.•*/

    /// @dev The constant returned when the `search` is not found in the string.
    uint256 internal constant NOT_FOUND = type(uint256).max;

    /// @dev Lookup for '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ'.
    uint128 internal constant ALPHANUMERIC_7_BIT_ASCII = 0x7fffffe07fffffe03ff000000000000;

    /// @dev Lookup for 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ'.
    uint128 internal constant LETTERS_7_BIT_ASCII = 0x7fffffe07fffffe0000000000000000;

    /// @dev Lookup for 'abcdefghijklmnopqrstuvwxyz'.
    uint128 internal constant LOWERCASE_7_BIT_ASCII = 0x7fffffe000000000000000000000000;

    /// @dev Lookup for 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'.
    uint128 internal constant UPPERCASE_7_BIT_ASCII = 0x7fffffe0000000000000000;

    /// @dev Lookup for '0123456789'.
    uint128 internal constant DIGITS_7_BIT_ASCII = 0x3ff000000000000;

    /// @dev Lookup for '0123456789abcdefABCDEF'.
    uint128 internal constant HEXDIGITS_7_BIT_ASCII = 0x7e0000007e03ff000000000000;

    /// @dev Lookup for '01234567'.
    uint128 internal constant OCTDIGITS_7_BIT_ASCII = 0xff000000000000;

    /// @dev Lookup for '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ!"#$%&\'()*+,-./:;<=>?@[\\]^_`{|}~ \t\n\r\x0b\x0c'.
    uint128 internal constant PRINTABLE_7_BIT_ASCII = 0x7fffffffffffffffffffffff00003e00;

    /// @dev Lookup for '!"#$%&\'()*+,-./:;<=>?@[\\]^_`{|}~'.
    uint128 internal constant PUNCTUATION_7_BIT_ASCII = 0x78000001f8000001fc00fffe00000000;

    /// @dev Lookup for ' \t\n\r\x0b\x0c'.
    uint128 internal constant WHITESPACE_7_BIT_ASCII = 0x100003e00;

    /*´:°•.°+.*•´.*:˚.°*.˚•´.°:°•.°•.*•´.*:˚.°*.˚•´.°:°•.°+.*•´.*:*/
    /*                     DECIMAL OPERATIONS                     */
    /*.•°:°.´+˚.*°.˚:*.´•*.+°.•°:´*.´•*.•°.•°:°.´:•˚°.*°.˚:*.´+°.•*/

    /// @dev Returns the base 10 decimal representation of `value`.
    function toString(uint256 value) internal pure returns (string memory str) {
        /// @solidity memory-safe-assembly
        assembly {
            // The maximum value of a uint256 contains 78 digits (1 byte per digit), but
            // we allocate 0xa0 bytes to keep the free memory pointer 32-byte word aligned.
            // We will need 1 word for the trailing zeros padding, 1 word for the length,
            // and 3 words for a maximum of 78 digits.
            str := add(mload(0x40), 0x80)
            mstore(0x40, add(str, 0x20)) // Allocate the memory.
            mstore(str, 0) // Zeroize the slot after the string.

            let end := str // Cache the end of the memory to calculate the length later.
            let w := not(0) // Tsk.
            // We write the string from rightmost digit to leftmost digit.
            // The following is essentially a do-while loop that also handles the zero case.
            for { let temp := value } 1 {} {
                str := add(str, w) // `sub(str, 1)`.
                // Store the character to the pointer.
                // The ASCII index of the '0' character is 48.
                mstore8(str, add(48, mod(temp, 10)))
                temp := div(temp, 10) // Keep dividing `temp` until zero.
                if iszero(temp) { break }
            }
            let length := sub(end, str)
            str := sub(str, 0x20) // Move the pointer 32 bytes back to make room for the length.
            mstore(str, length) // Store the length.
        }
    }

    /// @dev Returns the base 10 decimal representation of `value`.
    function toString(int256 value) internal pure returns (string memory str) {
        if (value >= 0) return toString(uint256(value));
        unchecked {
            str = toString(~uint256(value) + 1);
        }
        /// @solidity memory-safe-assembly
        assembly {
            // We still have some spare memory space on the left,
            // as we have allocated 3 words (96 bytes) for up to 78 digits.
            let length := mload(str) // Load the string length.
            mstore(str, 0x2d) // Store the '-' character.
            str := sub(str, 1) // Move back the string pointer by a byte.
            mstore(str, add(length, 1)) // Update the string length.
        }
    }

    /*´:°•.°+.*•´.*:˚.°*.˚•´.°:°•.°•.*•´.*:˚.°*.˚•´.°:°•.°+.*•´.*:*/
    /*                   HEXADECIMAL OPERATIONS                   */
    /*.•°:°.´+˚.*°.˚:*.´•*.+°.•°:´*.´•*.•°.•°:°.´:•˚°.*°.˚:*.´+°.•*/

    /// @dev Returns the hexadecimal representation of `value`,
    /// left-padded to an input length of `length` bytes.
    /// The output is prefixed with "0x" encoded using 2 hexadecimal digits per byte,
    /// giving a total length of `length * 2 + 2` bytes.
    /// Reverts if `length` is too small for the output to contain all the digits.
    function toHexString(uint256 value, uint256 length) internal pure returns (string memory str) {
        str = toHexStringNoPrefix(value, length);
        /// @solidity memory-safe-assembly
        assembly {
            let strLength := add(mload(str), 2) // Compute the length.
            mstore(str, 0x3078) // Store the "0x" prefix.
            str := sub(str, 2) // Move the pointer.
            mstore(str, strLength) // Store the length.
        }
    }

    /// @dev Returns the hexadecimal representation of `value`,
    /// left-padded to an input length of `length` bytes.
    /// The output is prefixed with "0x" encoded using 2 hexadecimal digits per byte,
    /// giving a total length of `length * 2` bytes.
    /// Reverts if `length` is too small for the output to contain all the digits.
    function toHexStringNoPrefix(uint256 value, uint256 length)
        internal
        pure
        returns (string memory str)
    {
        /// @solidity memory-safe-assembly
        assembly {
            // We need 0x20 bytes for the trailing zeros padding, `length * 2` bytes
            // for the digits, 0x02 bytes for the prefix, and 0x20 bytes for the length.
            // We add 0x20 to the total and round down to a multiple of 0x20.
            // (0x20 + 0x20 + 0x02 + 0x20) = 0x62.
            str := add(mload(0x40), and(add(shl(1, length), 0x42), not(0x1f)))
            mstore(0x40, add(str, 0x20)) // Allocate the memory.
            mstore(str, 0) // Zeroize the slot after the string.

            let end := str // Cache the end to calculate the length later.
            // Store "0123456789abcdef" in scratch space.
            mstore(0x0f, 0x30313233343536373839616263646566)

            let start := sub(str, add(length, length))
            let w := not(1) // Tsk.
            let temp := value
            // We write the string from rightmost digit to leftmost digit.
            // The following is essentially a do-while loop that also handles the zero case.
            for {} 1 {} {
                str := add(str, w) // `sub(str, 2)`.
                mstore8(add(str, 1), mload(and(temp, 15)))
                mstore8(str, mload(and(shr(4, temp), 15)))
                temp := shr(8, temp)
                if iszero(xor(str, start)) { break }
            }
            if temp {
                mstore(0x00, 0x2194895a) // `HexLengthInsufficient()`.
                revert(0x1c, 0x04)
            }
            let strLength := sub(end, str)
            str := sub(str, 0x20)
            mstore(str, strLength) // Store the length.
        }
    }

    /// @dev Returns the hexadecimal representation of `value`.
    /// The output is prefixed with "0x" and encoded using 2 hexadecimal digits per byte.
    /// As address are 20 bytes long, the output will left-padded to have
    /// a length of `20 * 2 + 2` bytes.
    function toHexString(uint256 value) internal pure returns (string memory str) {
        str = toHexStringNoPrefix(value);
        /// @solidity memory-safe-assembly
        assembly {
            let strLength := add(mload(str), 2) // Compute the length.
            mstore(str, 0x3078) // Store the "0x" prefix.
            str := sub(str, 2) // Move the pointer.
            mstore(str, strLength) // Store the length.
        }
    }

    /// @dev Returns the hexadecimal representation of `value`.
    /// The output is prefixed with "0x".
    /// The output excludes leading "0" from the `toHexString` output.
    /// `0x00: "0x0", 0x01: "0x1", 0x12: "0x12", 0x123: "0x123"`.
    function toMinimalHexString(uint256 value) internal pure returns (string memory str) {
        str = toHexStringNoPrefix(value);
        /// @solidity memory-safe-assembly
        assembly {
            let o := eq(byte(0, mload(add(str, 0x20))), 0x30) // Whether leading zero is present.
            let strLength := add(mload(str), 2) // Compute the length.
            mstore(add(str, o), 0x3078) // Store the "0x" prefix, accounting for leading zero.
            str := sub(add(str, o), 2) // Move the pointer, accounting for leading zero.
            mstore(str, sub(strLength, o)) // Store the length, accounting for leading zero.
        }
    }

    /// @dev Returns the hexadecimal representation of `value`.
    /// The output excludes leading "0" from the `toHexStringNoPrefix` output.
    /// `0x00: "0", 0x01: "1", 0x12: "12", 0x123: "123"`.
    function toMinimalHexStringNoPrefix(uint256 value) internal pure returns (string memory str) {
        str = toHexStringNoPrefix(value);
        /// @solidity memory-safe-assembly
        assembly {
            let o := eq(byte(0, mload(add(str, 0x20))), 0x30) // Whether leading zero is present.
            let strLength := mload(str) // Get the length.
            str := add(str, o) // Move the pointer, accounting for leading zero.
            mstore(str, sub(strLength, o)) // Store the length, accounting for leading zero.
        }
    }

    /// @dev Returns the hexadecimal representation of `value`.
    /// The output is encoded using 2 hexadecimal digits per byte.
    /// As address are 20 bytes long, the output will left-padded to have
    /// a length of `20 * 2` bytes.
    function toHexStringNoPrefix(uint256 value) internal pure returns (string memory str) {
        /// @solidity memory-safe-assembly
        assembly {
            // We need 0x20 bytes for the trailing zeros padding, 0x20 bytes for the length,
            // 0x02 bytes for the prefix, and 0x40 bytes for the digits.
            // The next multiple of 0x20 above (0x20 + 0x20 + 0x02 + 0x40) is 0xa0.
            str := add(mload(0x40), 0x80)
            mstore(0x40, add(str, 0x20)) // Allocate the memory.
            mstore(str, 0) // Zeroize the slot after the string.

            let end := str // Cache the end to calculate the length later.
            mstore(0x0f, 0x30313233343536373839616263646566) // Store the "0123456789abcdef" lookup.

            let w := not(1) // Tsk.
            // We write the string from rightmost digit to leftmost digit.
            // The following is essentially a do-while loop that also handles the zero case.
            for { let temp := value } 1 {} {
                str := add(str, w) // `sub(str, 2)`.
                mstore8(add(str, 1), mload(and(temp, 15)))
                mstore8(str, mload(and(shr(4, temp), 15)))
                temp := shr(8, temp)
                if iszero(temp) { break }
            }
            let strLength := sub(end, str)
            str := sub(str, 0x20)
            mstore(str, strLength) // Store the length.
        }
    }

    /// @dev Returns the hexadecimal representation of `value`.
    /// The output is prefixed with "0x", encoded using 2 hexadecimal digits per byte,
    /// and the alphabets are capitalized conditionally according to
    /// https://eips.ethereum.org/EIPS/eip-55
    function toHexStringChecksummed(address value) internal pure returns (string memory str) {
        str = toHexString(value);
        /// @solidity memory-safe-assembly
        assembly {
            let mask := shl(6, div(not(0), 255)) // `0b010000000100000000 ...`
            let o := add(str, 0x22)
            let hashed := and(keccak256(o, 40), mul(34, mask)) // `0b10001000 ... `
            let t := shl(240, 136) // `0b10001000 << 240`
            for { let i := 0 } 1 {} {
                mstore(add(i, i), mul(t, byte(i, hashed)))
                i := add(i, 1)
                if eq(i, 20) { break }
            }
            mstore(o, xor(mload(o), shr(1, and(mload(0x00), and(mload(o), mask)))))
            o := add(o, 0x20)
            mstore(o, xor(mload(o), shr(1, and(mload(0x20), and(mload(o), mask)))))
        }
    }

    /// @dev Returns the hexadecimal representation of `value`.
    /// The output is prefixed with "0x" and encoded using 2 hexadecimal digits per byte.
    function toHexString(address value) internal pure returns (string memory str) {
        str = toHexStringNoPrefix(value);
        /// @solidity memory-safe-assembly
        assembly {
            let strLength := add(mload(str), 2) // Compute the length.
            mstore(str, 0x3078) // Store the "0x" prefix.
            str := sub(str, 2) // Move the pointer.
            mstore(str, strLength) // Store the length.
        }
    }

    /// @dev Returns the hexadecimal representation of `value`.
    /// The output is encoded using 2 hexadecimal digits per byte.
    function toHexStringNoPrefix(address value) internal pure returns (string memory str) {
        /// @solidity memory-safe-assembly
        assembly {
            str := mload(0x40)
            // Allocate the memory.
            // We need 0x20 bytes for the trailing zeros padding, 0x20 bytes for the length,
            // 0x02 bytes for the prefix, and 0x28 bytes for the digits.
            // The next multiple of 0x20 above (0x20 + 0x20 + 0x02 + 0x28) is 0x80.
            mstore(0x40, add(str, 0x80))
            mstore(0x0f, 0x30313233343536373839616263646566) // Store the "0123456789abcdef" lookup.

            str := add(str, 2)
            mstore(str, 40) // Store the length.
            let o := add(str, 0x20)
            mstore(add(o, 40), 0) // Zeroize the slot after the string.
            value := shl(96, value)
            // We write the string from rightmost digit to leftmost digit.
            // The following is essentially a do-while loop that also handles the zero case.
            for { let i := 0 } 1 {} {
                let p := add(o, add(i, i))
                let temp := byte(i, value)
                mstore8(add(p, 1), mload(and(temp, 15)))
                mstore8(p, mload(shr(4, temp)))
                i := add(i, 1)
                if eq(i, 20) { break }
            }
        }
    }

    /// @dev Returns the hex encoded string from the raw bytes.
    /// The output is encoded using 2 hexadecimal digits per byte.
    function toHexString(bytes memory raw) internal pure returns (string memory str) {
        str = toHexStringNoPrefix(raw);
        /// @solidity memory-safe-assembly
        assembly {
            let strLength := add(mload(str), 2) // Compute the length.
            mstore(str, 0x3078) // Store the "0x" prefix.
            str := sub(str, 2) // Move the pointer.
            mstore(str, strLength) // Store the length.
        }
    }

    /// @dev Returns the hex encoded string from the raw bytes.
    /// The output is encoded using 2 hexadecimal digits per byte.
    function toHexStringNoPrefix(bytes memory raw) internal pure returns (string memory str) {
        /// @solidity memory-safe-assembly
        assembly {
            let length := mload(raw)
            str := add(mload(0x40), 2) // Skip 2 bytes for the optional prefix.
            mstore(str, add(length, length)) // Store the length of the output.

            mstore(0x0f, 0x30313233343536373839616263646566) // Store the "0123456789abcdef" lookup.
            let o := add(str, 0x20)
            let end := add(raw, length)
            for {} iszero(eq(raw, end)) {} {
                raw := add(raw, 1)
                mstore8(add(o, 1), mload(and(mload(raw), 15)))
                mstore8(o, mload(and(shr(4, mload(raw)), 15)))
                o := add(o, 2)
            }
            mstore(o, 0) // Zeroize the slot after the string.
            mstore(0x40, add(o, 0x20)) // Allocate the memory.
        }
    }

    /*´:°•.°+.*•´.*:˚.°*.˚•´.°:°•.°•.*•´.*:˚.°*.˚•´.°:°•.°+.*•´.*:*/
    /*                   RUNE STRING OPERATIONS                   */
    /*.•°:°.´+˚.*°.˚:*.´•*.+°.•°:´*.´•*.•°.•°:°.´:•˚°.*°.˚:*.´+°.•*/

    /// @dev Returns the number of UTF characters in the string.
    function runeCount(string memory s) internal pure returns (uint256 result) {
        /// @solidity memory-safe-assembly
        assembly {
            if mload(s) {
                mstore(0x00, div(not(0), 255))
                mstore(0x20, 0x0202020202020202020202020202020202020202020202020303030304040506)
                let o := add(s, 0x20)
                let end := add(o, mload(s))
                for { result := 1 } 1 { result := add(result, 1) } {
                    o := add(o, byte(0, mload(shr(250, mload(o)))))
                    if iszero(lt(o, end)) { break }
                }
            }
        }
    }

    /// @dev Returns if this string is a 7-bit ASCII string.
    /// (i.e. all characters codes are in [0..127])
    function is7BitASCII(string memory s) internal pure returns (bool result) {
        /// @solidity memory-safe-assembly
        assembly {
            let mask := shl(7, div(not(0), 255))
            result := 1
            let n := mload(s)
            if n {
                let o := add(s, 0x20)
                let end := add(o, n)
                let last := mload(end)
                mstore(end, 0)
                for {} 1 {} {
                    if and(mask, mload(o)) {
                        result := 0
                        break
                    }
                    o := add(o, 0x20)
                    if iszero(lt(o, end)) { break }
                }
                mstore(end, last)
            }
        }
    }

    /// @dev Returns if this string is a 7-bit ASCII string,
    /// AND all characters are in the `allowed` lookup.
    /// Note: If `s` is empty, returns true regardless of `allowed`.
    function is7BitASCII(string memory s, uint128 allowed) internal pure returns (bool result) {
        /// @solidity memory-safe-assembly
        assembly {
            result := 1
            if mload(s) {
                let allowed_ := shr(128, shl(128, allowed))
                let o := add(s, 0x20)
                let end := add(o, mload(s))
                for {} 1 {} {
                    result := and(result, shr(byte(0, mload(o)), allowed_))
                    o := add(o, 1)
                    if iszero(and(result, lt(o, end))) { break }
                }
            }
        }
    }

    /// @dev Converts the bytes in the 7-bit ASCII string `s` to
    /// an allowed lookup for use in `is7BitASCII(s, allowed)`.
    /// To save runtime gas, you can cache the result in an immutable variable.
    function to7BitASCIIAllowedLookup(string memory s) internal pure returns (uint128 result) {
        /// @solidity memory-safe-assembly
        assembly {
            if mload(s) {
                let o := add(s, 0x20)
                let end := add(o, mload(s))
                for {} 1 {} {
                    result := or(result, shl(byte(0, mload(o)), 1))
                    o := add(o, 1)
                    if iszero(lt(o, end)) { break }
                }
                if shr(128, result) {
                    mstore(0x00, 0xc9807e0d) // `StringNot7BitASCII()`.
                    revert(0x1c, 0x04)
                }
            }
        }
    }

    /*´:°•.°+.*•´.*:˚.°*.˚•´.°:°•.°•.*•´.*:˚.°*.˚•´.°:°•.°+.*•´.*:*/
    /*                   BYTE STRING OPERATIONS                   */
    /*.•°:°.´+˚.*°.˚:*.´•*.+°.•°:´*.´•*.•°.•°:°.´:•˚°.*°.˚:*.´+°.•*/

    // For performance and bytecode compactness, byte string operations are restricted
    // to 7-bit ASCII strings. All offsets are byte offsets, not UTF character offsets.
    // Usage of byte string operations on charsets with runes spanning two or more bytes
    // can lead to undefined behavior.

    /// @dev Returns `subject` all occurrences of `search` replaced with `replacement`.
    function replace(string memory subject, string memory search, string memory replacement)
        internal
        pure
        returns (string memory result)
    {
        /// @solidity memory-safe-assembly
        assembly {
            let subjectLength := mload(subject)
            let searchLength := mload(search)
            let replacementLength := mload(replacement)

            subject := add(subject, 0x20)
            search := add(search, 0x20)
            replacement := add(replacement, 0x20)
            result := add(mload(0x40), 0x20)

            let subjectEnd := add(subject, subjectLength)
            if iszero(gt(searchLength, subjectLength)) {
                let subjectSearchEnd := add(sub(subjectEnd, searchLength), 1)
                let h := 0
                if iszero(lt(searchLength, 0x20)) { h := keccak256(search, searchLength) }
                let m := shl(3, sub(0x20, and(searchLength, 0x1f)))
                let s := mload(search)
                for {} 1 {} {
                    let t := mload(subject)
                    // Whether the first `searchLength % 32` bytes of
                    // `subject` and `search` matches.
                    if iszero(shr(m, xor(t, s))) {
                        if h {
                            if iszero(eq(keccak256(subject, searchLength), h)) {
                                mstore(result, t)
                                result := add(result, 1)
                                subject := add(subject, 1)
                                if iszero(lt(subject, subjectSearchEnd)) { break }
                                continue
                            }
                        }
                        // Copy the `replacement` one word at a time.
                        for { let o := 0 } 1 {} {
                            mstore(add(result, o), mload(add(replacement, o)))
                            o := add(o, 0x20)
                            if iszero(lt(o, replacementLength)) { break }
                        }
                        result := add(result, replacementLength)
                        subject := add(subject, searchLength)
                        if searchLength {
                            if iszero(lt(subject, subjectSearchEnd)) { break }
                            continue
                        }
                    }
                    mstore(result, t)
                    result := add(result, 1)
                    subject := add(subject, 1)
                    if iszero(lt(subject, subjectSearchEnd)) { break }
                }
            }

            let resultRemainder := result
            result := add(mload(0x40), 0x20)
            let k := add(sub(resultRemainder, result), sub(subjectEnd, subject))
            // Copy the rest of the string one word at a time.
            for {} lt(subject, subjectEnd) {} {
                mstore(resultRemainder, mload(subject))
                resultRemainder := add(resultRemainder, 0x20)
                subject := add(subject, 0x20)
            }
            result := sub(result, 0x20)
            let last := add(add(result, 0x20), k) // Zeroize the slot after the string.
            mstore(last, 0)
            mstore(0x40, add(last, 0x20)) // Allocate the memory.
            mstore(result, k) // Store the length.
        }
    }

    /// @dev Returns the byte index of the first location of `search` in `subject`,
    /// searching from left to right, starting from `from`.
    /// Returns `NOT_FOUND` (i.e. `type(uint256).max`) if the `search` is not found.
    function indexOf(string memory subject, string memory search, uint256 from)
        internal
        pure
        returns (uint256 result)
    {
        /// @solidity memory-safe-assembly
        assembly {
            for { let subjectLength := mload(subject) } 1 {} {
                if iszero(mload(search)) {
                    if iszero(gt(from, subjectLength)) {
                        result := from
                        break
                    }
                    result := subjectLength
                    break
                }
                let searchLength := mload(search)
                let subjectStart := add(subject, 0x20)

                result := not(0) // Initialize to `NOT_FOUND`.
                subject := add(subjectStart, from)
                let end := add(sub(add(subjectStart, subjectLength), searchLength), 1)

                let m := shl(3, sub(0x20, and(searchLength, 0x1f)))
                let s := mload(add(search, 0x20))

                if iszero(and(lt(subject, end), lt(from, subjectLength))) { break }

                if iszero(lt(searchLength, 0x20)) {
                    for { let h := keccak256(add(search, 0x20), searchLength) } 1 {} {
                        if iszero(shr(m, xor(mload(subject), s))) {
                            if eq(keccak256(subject, searchLength), h) {
                                result := sub(subject, subjectStart)
                                break
                            }
                        }
                        subject := add(subject, 1)
                        if iszero(lt(subject, end)) { break }
                    }
                    break
                }
                for {} 1 {} {
                    if iszero(shr(m, xor(mload(subject), s))) {
                        result := sub(subject, subjectStart)
                        break
                    }
                    subject := add(subject, 1)
                    if iszero(lt(subject, end)) { break }
                }
                break
            }
        }
    }

    /// @dev Returns the byte index of the first location of `search` in `subject`,
    /// searching from left to right.
    /// Returns `NOT_FOUND` (i.e. `type(uint256).max`) if the `search` is not found.
    function indexOf(string memory subject, string memory search)
        internal
        pure
        returns (uint256 result)
    {
        result = indexOf(subject, search, 0);
    }

    /// @dev Returns the byte index of the first location of `search` in `subject`,
    /// searching from right to left, starting from `from`.
    /// Returns `NOT_FOUND` (i.e. `type(uint256).max`) if the `search` is not found.
    function lastIndexOf(string memory subject, string memory search, uint256 from)
        internal
        pure
        returns (uint256 result)
    {
        /// @solidity memory-safe-assembly
        assembly {
            for {} 1 {} {
                result := not(0) // Initialize to `NOT_FOUND`.
                let searchLength := mload(search)
                if gt(searchLength, mload(subject)) { break }
                let w := result

                let fromMax := sub(mload(subject), searchLength)
                if iszero(gt(fromMax, from)) { from := fromMax }

                let end := add(add(subject, 0x20), w)
                subject := add(add(subject, 0x20), from)
                if iszero(gt(subject, end)) { break }
                // As this function is not too often used,
                // we shall simply use keccak256 for smaller bytecode size.
                for { let h := keccak256(add(search, 0x20), searchLength) } 1 {} {
                    if eq(keccak256(subject, searchLength), h) {
                        result := sub(subject, add(end, 1))
                        break
                    }
                    subject := add(subject, w) // `sub(subject, 1)`.
                    if iszero(gt(subject, end)) { break }
                }
                break
            }
        }
    }

    /// @dev Returns the byte index of the first location of `search` in `subject`,
    /// searching from right to left.
    /// Returns `NOT_FOUND` (i.e. `type(uint256).max`) if the `search` is not found.
    function lastIndexOf(string memory subject, string memory search)
        internal
        pure
        returns (uint256 result)
    {
        result = lastIndexOf(subject, search, uint256(int256(-1)));
    }

    /// @dev Returns true if `search` is found in `subject`, false otherwise.
    function contains(string memory subject, string memory search) internal pure returns (bool) {
        return indexOf(subject, search) != NOT_FOUND;
    }

    /// @dev Returns whether `subject` starts with `search`.
    function startsWith(string memory subject, string memory search)
        internal
        pure
        returns (bool result)
    {
        /// @solidity memory-safe-assembly
        assembly {
            let searchLength := mload(search)
            // Just using keccak256 directly is actually cheaper.
            // forgefmt: disable-next-item
            result := and(
                iszero(gt(searchLength, mload(subject))),
                eq(
                    keccak256(add(subject, 0x20), searchLength),
                    keccak256(add(search, 0x20), searchLength)
                )
            )
        }
    }

    /// @dev Returns whether `subject` ends with `search`.
    function endsWith(string memory subject, string memory search)
        internal
        pure
        returns (bool result)
    {
        /// @solidity memory-safe-assembly
        assembly {
            let searchLength := mload(search)
            let subjectLength := mload(subject)
            // Whether `search` is not longer than `subject`.
            let withinRange := iszero(gt(searchLength, subjectLength))
            // Just using keccak256 directly is actually cheaper.
            // forgefmt: disable-next-item
            result := and(
                withinRange,
                eq(
                    keccak256(
                        // `subject + 0x20 + max(subjectLength - searchLength, 0)`.
                        add(add(subject, 0x20), mul(withinRange, sub(subjectLength, searchLength))),
                        searchLength
                    ),
                    keccak256(add(search, 0x20), searchLength)
                )
            )
        }
    }

    /// @dev Returns `subject` repeated `times`.
    function repeat(string memory subject, uint256 times)
        internal
        pure
        returns (string memory result)
    {
        /// @solidity memory-safe-assembly
        assembly {
            let subjectLength := mload(subject)
            if iszero(or(iszero(times), iszero(subjectLength))) {
                subject := add(subject, 0x20)
                result := mload(0x40)
                let output := add(result, 0x20)
                for {} 1 {} {
                    // Copy the `subject` one word at a time.
                    for { let o := 0 } 1 {} {
                        mstore(add(output, o), mload(add(subject, o)))
                        o := add(o, 0x20)
                        if iszero(lt(o, subjectLength)) { break }
                    }
                    output := add(output, subjectLength)
                    times := sub(times, 1)
                    if iszero(times) { break }
                }
                mstore(output, 0) // Zeroize the slot after the string.
                let resultLength := sub(output, add(result, 0x20))
                mstore(result, resultLength) // Store the length.
                mstore(0x40, add(result, add(resultLength, 0x40))) // Allocate the memory.
            }
        }
    }

    /// @dev Returns a copy of `subject` sliced from `start` to `end` (exclusive).
    /// `start` and `end` are byte offsets.
    function slice(string memory subject, uint256 start, uint256 end)
        internal
        pure
        returns (string memory result)
    {
        /// @solidity memory-safe-assembly
        assembly {
            let subjectLength := mload(subject)
            if iszero(gt(subjectLength, end)) { end := subjectLength }
            if iszero(gt(subjectLength, start)) { start := subjectLength }
            if lt(start, end) {
                result := mload(0x40)
                let resultLength := sub(end, start)
                mstore(result, resultLength)
                subject := add(subject, start)
                let w := not(0x1f)
                // Copy the `subject` one word at a time, backwards.
                for { let o := and(add(resultLength, 0x1f), w) } 1 {} {
                    mstore(add(result, o), mload(add(subject, o)))
                    o := add(o, w) // `sub(o, 0x20)`.
                    if iszero(o) { break }
                }
                // Zeroize the slot after the string.
                mstore(add(add(result, 0x20), resultLength), 0)
                mstore(0x40, add(result, add(resultLength, 0x40))) // Allocate the memory.
            }
        }
    }

    /// @dev Returns a copy of `subject` sliced from `start` to the end of the string.
    /// `start` is a byte offset.
    function slice(string memory subject, uint256 start)
        internal
        pure
        returns (string memory result)
    {
        result = slice(subject, start, uint256(int256(-1)));
    }

    /// @dev Returns all the indices of `search` in `subject`.
    /// The indices are byte offsets.
    function indicesOf(string memory subject, string memory search)
        internal
        pure
        returns (uint256[] memory result)
    {
        /// @solidity memory-safe-assembly
        assembly {
            let subjectLength := mload(subject)
            let searchLength := mload(search)

            if iszero(gt(searchLength, subjectLength)) {
                subject := add(subject, 0x20)
                search := add(search, 0x20)
                result := add(mload(0x40), 0x20)

                let subjectStart := subject
                let subjectSearchEnd := add(sub(add(subject, subjectLength), searchLength), 1)
                let h := 0
                if iszero(lt(searchLength, 0x20)) { h := keccak256(search, searchLength) }
                let m := shl(3, sub(0x20, and(searchLength, 0x1f)))
                let s := mload(search)
                for {} 1 {} {
                    let t := mload(subject)
                    // Whether the first `searchLength % 32` bytes of
                    // `subject` and `search` matches.
                    if iszero(shr(m, xor(t, s))) {
                        if h {
                            if iszero(eq(keccak256(subject, searchLength), h)) {
                                subject := add(subject, 1)
                                if iszero(lt(subject, subjectSearchEnd)) { break }
                                continue
                            }
                        }
                        // Append to `result`.
                        mstore(result, sub(subject, subjectStart))
                        result := add(result, 0x20)
                        // Advance `subject` by `searchLength`.
                        subject := add(subject, searchLength)
                        if searchLength {
                            if iszero(lt(subject, subjectSearchEnd)) { break }
                            continue
                        }
                    }
                    subject := add(subject, 1)
                    if iszero(lt(subject, subjectSearchEnd)) { break }
                }
                let resultEnd := result
                // Assign `result` to the free memory pointer.
                result := mload(0x40)
                // Store the length of `result`.
                mstore(result, shr(5, sub(resultEnd, add(result, 0x20))))
                // Allocate memory for result.
                // We allocate one more word, so this array can be recycled for {split}.
                mstore(0x40, add(resultEnd, 0x20))
            }
        }
    }

    /// @dev Returns a arrays of strings based on the `delimiter` inside of the `subject` string.
    function split(string memory subject, string memory delimiter)
        internal
        pure
        returns (string[] memory result)
    {
        uint256[] memory indices = indicesOf(subject, delimiter);
        /// @solidity memory-safe-assembly
        assembly {
            let w := not(0x1f)
            let indexPtr := add(indices, 0x20)
            let indicesEnd := add(indexPtr, shl(5, add(mload(indices), 1)))
            mstore(add(indicesEnd, w), mload(subject))
            mstore(indices, add(mload(indices), 1))
            let prevIndex := 0
            for {} 1 {} {
                let index := mload(indexPtr)
                mstore(indexPtr, 0x60)
                if iszero(eq(index, prevIndex)) {
                    let element := mload(0x40)
                    let elementLength := sub(index, prevIndex)
                    mstore(element, elementLength)
                    // Copy the `subject` one word at a time, backwards.
                    for { let o := and(add(elementLength, 0x1f), w) } 1 {} {
                        mstore(add(element, o), mload(add(add(subject, prevIndex), o)))
                        o := add(o, w) // `sub(o, 0x20)`.
                        if iszero(o) { break }
                    }
                    // Zeroize the slot after the string.
                    mstore(add(add(element, 0x20), elementLength), 0)
                    // Allocate memory for the length and the bytes,
                    // rounded up to a multiple of 32.
                    mstore(0x40, add(element, and(add(elementLength, 0x3f), w)))
                    // Store the `element` into the array.
                    mstore(indexPtr, element)
                }
                prevIndex := add(index, mload(delimiter))
                indexPtr := add(indexPtr, 0x20)
                if iszero(lt(indexPtr, indicesEnd)) { break }
            }
            result := indices
            if iszero(mload(delimiter)) {
                result := add(indices, 0x20)
                mstore(result, sub(mload(indices), 2))
            }
        }
    }

    /// @dev Returns a concatenated string of `a` and `b`.
    /// Cheaper than `string.concat()` and does not de-align the free memory pointer.
    function concat(string memory a, string memory b)
        internal
        pure
        returns (string memory result)
    {
        /// @solidity memory-safe-assembly
        assembly {
            let w := not(0x1f)
            result := mload(0x40)
            let aLength := mload(a)
            // Copy `a` one word at a time, backwards.
            for { let o := and(add(aLength, 0x20), w) } 1 {} {
                mstore(add(result, o), mload(add(a, o)))
                o := add(o, w) // `sub(o, 0x20)`.
                if iszero(o) { break }
            }
            let bLength := mload(b)
            let output := add(result, aLength)
            // Copy `b` one word at a time, backwards.
            for { let o := and(add(bLength, 0x20), w) } 1 {} {
                mstore(add(output, o), mload(add(b, o)))
                o := add(o, w) // `sub(o, 0x20)`.
                if iszero(o) { break }
            }
            let totalLength := add(aLength, bLength)
            let last := add(add(result, 0x20), totalLength)
            mstore(last, 0) // Zeroize the slot after the string.
            mstore(result, totalLength) // Store the length.
            mstore(0x40, add(last, 0x20)) // Allocate the memory.
        }
    }

    /// @dev Returns a copy of the string in either lowercase or UPPERCASE.
    /// WARNING! This function is only compatible with 7-bit ASCII strings.
    function toCase(string memory subject, bool toUpper)
        internal
        pure
        returns (string memory result)
    {
        /// @solidity memory-safe-assembly
        assembly {
            let length := mload(subject)
            if length {
                result := add(mload(0x40), 0x20)
                subject := add(subject, 1)
                let flags := shl(add(70, shl(5, toUpper)), 0x3ffffff)
                let w := not(0)
                for { let o := length } 1 {} {
                    o := add(o, w)
                    let b := and(0xff, mload(add(subject, o)))
                    mstore8(add(result, o), xor(b, and(shr(b, flags), 0x20)))
                    if iszero(o) { break }
                }
                result := mload(0x40)
                mstore(result, length) // Store the length.
                let last := add(add(result, 0x20), length)
                mstore(last, 0) // Zeroize the slot after the string.
                mstore(0x40, add(last, 0x20)) // Allocate the memory.
            }
        }
    }

    /// @dev Returns a string from a small bytes32 string.
    /// `s` must be null-terminated, or behavior will be undefined.
    function fromSmallString(bytes32 s) internal pure returns (string memory result) {
        /// @solidity memory-safe-assembly
        assembly {
            result := mload(0x40)
            let n := 0
            for {} byte(n, s) { n := add(n, 1) } {} // Scan for '\0'.
            mstore(result, n) // Store the length.
            let o := add(result, 0x20)
            mstore(o, s) // Store the bytes of the string.
            mstore(add(o, n), 0) // Zeroize the slot after the string.
            mstore(0x40, add(result, 0x40)) // Allocate the memory.
        }
    }

    /// @dev Returns the small string, with all bytes after the first null byte zeroized.
    function normalizeSmallString(bytes32 s) internal pure returns (bytes32 result) {
        /// @solidity memory-safe-assembly
        assembly {
            for {} byte(result, s) { result := add(result, 1) } {} // Scan for '\0'.
            mstore(0x00, s)
            mstore(result, 0x00)
            result := mload(0x00)
        }
    }

    /// @dev Returns the string as a normalized null-terminated small string.
    function toSmallString(string memory s) internal pure returns (bytes32 result) {
        /// @solidity memory-safe-assembly
        assembly {
            result := mload(s)
            if iszero(lt(result, 33)) {
                mstore(0x00, 0xec92f9a3) // `TooBigForSmallString()`.
                revert(0x1c, 0x04)
            }
            result := shl(shl(3, sub(32, result)), mload(add(s, result)))
        }
    }

    /// @dev Returns a lowercased copy of the string.
    /// WARNING! This function is only compatible with 7-bit ASCII strings.
    function lower(string memory subject) internal pure returns (string memory result) {
        result = toCase(subject, false);
    }

    /// @dev Returns an UPPERCASED copy of the string.
    /// WARNING! This function is only compatible with 7-bit ASCII strings.
    function upper(string memory subject) internal pure returns (string memory result) {
        result = toCase(subject, true);
    }

    /// @dev Escapes the string to be used within HTML tags.
    function escapeHTML(string memory s) internal pure returns (string memory result) {
        /// @solidity memory-safe-assembly
        assembly {
            let end := add(s, mload(s))
            result := add(mload(0x40), 0x20)
            // Store the bytes of the packed offsets and strides into the scratch space.
            // `packed = (stride << 5) | offset`. Max offset is 20. Max stride is 6.
            mstore(0x1f, 0x900094)
            mstore(0x08, 0xc0000000a6ab)
            // Store "&quot;&amp;&#39;&lt;&gt;" into the scratch space.
            mstore(0x00, shl(64, 0x2671756f743b26616d703b262333393b266c743b2667743b))
            for {} iszero(eq(s, end)) {} {
                s := add(s, 1)
                let c := and(mload(s), 0xff)
                // Not in `["\"","'","&","<",">"]`.
                if iszero(and(shl(c, 1), 0x500000c400000000)) {
                    mstore8(result, c)
                    result := add(result, 1)
                    continue
                }
                let t := shr(248, mload(c))
                mstore(result, mload(and(t, 0x1f)))
                result := add(result, shr(5, t))
            }
            let last := result
            mstore(last, 0) // Zeroize the slot after the string.
            result := mload(0x40)
            mstore(result, sub(last, add(result, 0x20))) // Store the length.
            mstore(0x40, add(last, 0x20)) // Allocate the memory.
        }
    }

    /// @dev Escapes the string to be used within double-quotes in a JSON.
    /// If `addDoubleQuotes` is true, the result will be enclosed in double-quotes.
    function escapeJSON(string memory s, bool addDoubleQuotes)
        internal
        pure
        returns (string memory result)
    {
        /// @solidity memory-safe-assembly
        assembly {
            let end := add(s, mload(s))
            result := add(mload(0x40), 0x20)
            if addDoubleQuotes {
                mstore8(result, 34)
                result := add(1, result)
            }
            // Store "\\u0000" in scratch space.
            // Store "0123456789abcdef" in scratch space.
            // Also, store `{0x08:"b", 0x09:"t", 0x0a:"n", 0x0c:"f", 0x0d:"r"}`.
            // into the scratch space.
            mstore(0x15, 0x5c75303030303031323334353637383961626364656662746e006672)
            // Bitmask for detecting `["\"","\\"]`.
            let e := or(shl(0x22, 1), shl(0x5c, 1))
            for {} iszero(eq(s, end)) {} {
                s := add(s, 1)
                let c := and(mload(s), 0xff)
                if iszero(lt(c, 0x20)) {
                    if iszero(and(shl(c, 1), e)) {
                        // Not in `["\"","\\"]`.
                        mstore8(result, c)
                        result := add(result, 1)
                        continue
                    }
                    mstore8(result, 0x5c) // "\\".
                    mstore8(add(result, 1), c)
                    result := add(result, 2)
                    continue
                }
                if iszero(and(shl(c, 1), 0x3700)) {
                    // Not in `["\b","\t","\n","\f","\d"]`.
                    mstore8(0x1d, mload(shr(4, c))) // Hex value.
                    mstore8(0x1e, mload(and(c, 15))) // Hex value.
                    mstore(result, mload(0x19)) // "\\u00XX".
                    result := add(result, 6)
                    continue
                }
                mstore8(result, 0x5c) // "\\".
                mstore8(add(result, 1), mload(add(c, 8)))
                result := add(result, 2)
            }
            if addDoubleQuotes {
                mstore8(result, 34)
                result := add(1, result)
            }
            let last := result
            mstore(last, 0) // Zeroize the slot after the string.
            result := mload(0x40)
            mstore(result, sub(last, add(result, 0x20))) // Store the length.
            mstore(0x40, add(last, 0x20)) // Allocate the memory.
        }
    }

    /// @dev Escapes the string to be used within double-quotes in a JSON.
    function escapeJSON(string memory s) internal pure returns (string memory result) {
        result = escapeJSON(s, false);
    }

    /// @dev Returns whether `a` equals `b`.
    function eq(string memory a, string memory b) internal pure returns (bool result) {
        /// @solidity memory-safe-assembly
        assembly {
            result := eq(keccak256(add(a, 0x20), mload(a)), keccak256(add(b, 0x20), mload(b)))
        }
    }

    /// @dev Returns whether `a` equals `b`, where `b` is a null-terminated small string.
    function eqs(string memory a, bytes32 b) internal pure returns (bool result) {
        /// @solidity memory-safe-assembly
        assembly {
            // These should be evaluated on compile time, as far as possible.
            let m := not(shl(7, div(not(iszero(b)), 255))) // `0x7f7f ...`.
            let x := not(or(m, or(b, add(m, and(b, m)))))
            let r := shl(7, iszero(iszero(shr(128, x))))
            r := or(r, shl(6, iszero(iszero(shr(64, shr(r, x))))))
            r := or(r, shl(5, lt(0xffffffff, shr(r, x))))
            r := or(r, shl(4, lt(0xffff, shr(r, x))))
            r := or(r, shl(3, lt(0xff, shr(r, x))))
            // forgefmt: disable-next-item
            result := gt(eq(mload(a), add(iszero(x), xor(31, shr(3, r)))),
                xor(shr(add(8, r), b), shr(add(8, r), mload(add(a, 0x20)))))
        }
    }

    /// @dev Packs a single string with its length into a single word.
    /// Returns `bytes32(0)` if the length is zero or greater than 31.
    function packOne(string memory a) internal pure returns (bytes32 result) {
        /// @solidity memory-safe-assembly
        assembly {
            // We don't need to zero right pad the string,
            // since this is our own custom non-standard packing scheme.
            result :=
                mul(
                    // Load the length and the bytes.
                    mload(add(a, 0x1f)),
                    // `length != 0 && length < 32`. Abuses underflow.
                    // Assumes that the length is valid and within the block gas limit.
                    lt(sub(mload(a), 1), 0x1f)
                )
        }
    }

    /// @dev Unpacks a string packed using {packOne}.
    /// Returns the empty string if `packed` is `bytes32(0)`.
    /// If `packed` is not an output of {packOne}, the output behavior is undefined.
    function unpackOne(bytes32 packed) internal pure returns (string memory result) {
        /// @solidity memory-safe-assembly
        assembly {
            result := mload(0x40) // Grab the free memory pointer.
            mstore(0x40, add(result, 0x40)) // Allocate 2 words (1 for the length, 1 for the bytes).
            mstore(result, 0) // Zeroize the length slot.
            mstore(add(result, 0x1f), packed) // Store the length and bytes.
            mstore(add(add(result, 0x20), mload(result)), 0) // Right pad with zeroes.
        }
    }

    /// @dev Packs two strings with their lengths into a single word.
    /// Returns `bytes32(0)` if combined length is zero or greater than 30.
    function packTwo(string memory a, string memory b) internal pure returns (bytes32 result) {
        /// @solidity memory-safe-assembly
        assembly {
            let aLength := mload(a)
            // We don't need to zero right pad the strings,
            // since this is our own custom non-standard packing scheme.
            result :=
                mul(
                    or( // Load the length and the bytes of `a` and `b`.
                        shl(shl(3, sub(0x1f, aLength)), mload(add(a, aLength))),
                        mload(sub(add(b, 0x1e), aLength))
                    ),
                    // `totalLength != 0 && totalLength < 31`. Abuses underflow.
                    // Assumes that the lengths are valid and within the block gas limit.
                    lt(sub(add(aLength, mload(b)), 1), 0x1e)
                )
        }
    }

    /// @dev Unpacks strings packed using {packTwo}.
    /// Returns the empty strings if `packed` is `bytes32(0)`.
    /// If `packed` is not an output of {packTwo}, the output behavior is undefined.
    function unpackTwo(bytes32 packed)
        internal
        pure
        returns (string memory resultA, string memory resultB)
    {
        /// @solidity memory-safe-assembly
        assembly {
            resultA := mload(0x40) // Grab the free memory pointer.
            resultB := add(resultA, 0x40)
            // Allocate 2 words for each string (1 for the length, 1 for the byte). Total 4 words.
            mstore(0x40, add(resultB, 0x40))
            // Zeroize the length slots.
            mstore(resultA, 0)
            mstore(resultB, 0)
            // Store the lengths and bytes.
            mstore(add(resultA, 0x1f), packed)
            mstore(add(resultB, 0x1f), mload(add(add(resultA, 0x20), mload(resultA))))
            // Right pad with zeroes.
            mstore(add(add(resultA, 0x20), mload(resultA)), 0)
            mstore(add(add(resultB, 0x20), mload(resultB)), 0)
        }
    }

    /// @dev Directly returns `a` without copying.
    function directReturn(string memory a) internal pure {
        assembly {
            // Assumes that the string does not start from the scratch space.
            let retStart := sub(a, 0x20)
            let retUnpaddedSize := add(mload(a), 0x40)
            // Right pad with zeroes. Just in case the string is produced
            // by a method that doesn't zero right pad.
            mstore(add(retStart, retUnpaddedSize), 0)
            mstore(retStart, 0x20) // Store the return offset.
            // End the transaction, returning the string.
            return(retStart, and(not(0x1f), add(0x1f, retUnpaddedSize)))
        }
    }
}

File 9 of 10 : ISofamonGachaMachine.sol
/// SPDX-License-Identifier: MIT
pragma solidity ^0.8.25;

interface ISofamonGachaMachine {
    function protocolFeeTo() external view returns (address);
}

File 10 of 10 : ERC20.sol
// SPDX-License-Identifier: AGPL-3.0-only
pragma solidity >=0.8.0;

/// @notice Modern and gas efficient ERC20 + EIP-2612 implementation.
/// @author Solmate (https://github.com/transmissions11/solmate/blob/main/src/tokens/ERC20.sol)
/// @author Modified from Uniswap (https://github.com/Uniswap/uniswap-v2-core/blob/master/contracts/UniswapV2ERC20.sol)
/// @dev Do not manually set balances without updating totalSupply, as the sum of all user balances must not exceed it.
abstract contract ERC20 {
    /*//////////////////////////////////////////////////////////////
                                 EVENTS
    //////////////////////////////////////////////////////////////*/

    event Transfer(address indexed from, address indexed to, uint256 amount);

    event Approval(address indexed owner, address indexed spender, uint256 amount);

    /*//////////////////////////////////////////////////////////////
                            METADATA STORAGE
    //////////////////////////////////////////////////////////////*/

    string public name;

    string public symbol;

    uint8 public immutable decimals;

    /*//////////////////////////////////////////////////////////////
                              ERC20 STORAGE
    //////////////////////////////////////////////////////////////*/

    uint256 public totalSupply;

    mapping(address => uint256) public balanceOf;

    mapping(address => mapping(address => uint256)) public allowance;

    /*//////////////////////////////////////////////////////////////
                            EIP-2612 STORAGE
    //////////////////////////////////////////////////////////////*/

    uint256 internal immutable INITIAL_CHAIN_ID;

    bytes32 internal immutable INITIAL_DOMAIN_SEPARATOR;

    mapping(address => uint256) public nonces;

    /*//////////////////////////////////////////////////////////////
                               CONSTRUCTOR
    //////////////////////////////////////////////////////////////*/

    constructor(
        string memory _name,
        string memory _symbol,
        uint8 _decimals
    ) {
        name = _name;
        symbol = _symbol;
        decimals = _decimals;

        INITIAL_CHAIN_ID = block.chainid;
        INITIAL_DOMAIN_SEPARATOR = computeDomainSeparator();
    }

    /*//////////////////////////////////////////////////////////////
                               ERC20 LOGIC
    //////////////////////////////////////////////////////////////*/

    function approve(address spender, uint256 amount) public virtual returns (bool) {
        allowance[msg.sender][spender] = amount;

        emit Approval(msg.sender, spender, amount);

        return true;
    }

    function transfer(address to, uint256 amount) public virtual returns (bool) {
        balanceOf[msg.sender] -= amount;

        // Cannot overflow because the sum of all user
        // balances can't exceed the max uint256 value.
        unchecked {
            balanceOf[to] += amount;
        }

        emit Transfer(msg.sender, to, amount);

        return true;
    }

    function transferFrom(
        address from,
        address to,
        uint256 amount
    ) public virtual returns (bool) {
        uint256 allowed = allowance[from][msg.sender]; // Saves gas for limited approvals.

        if (allowed != type(uint256).max) allowance[from][msg.sender] = allowed - amount;

        balanceOf[from] -= amount;

        // Cannot overflow because the sum of all user
        // balances can't exceed the max uint256 value.
        unchecked {
            balanceOf[to] += amount;
        }

        emit Transfer(from, to, amount);

        return true;
    }

    /*//////////////////////////////////////////////////////////////
                             EIP-2612 LOGIC
    //////////////////////////////////////////////////////////////*/

    function permit(
        address owner,
        address spender,
        uint256 value,
        uint256 deadline,
        uint8 v,
        bytes32 r,
        bytes32 s
    ) public virtual {
        require(deadline >= block.timestamp, "PERMIT_DEADLINE_EXPIRED");

        // Unchecked because the only math done is incrementing
        // the owner's nonce which cannot realistically overflow.
        unchecked {
            address recoveredAddress = ecrecover(
                keccak256(
                    abi.encodePacked(
                        "\x19\x01",
                        DOMAIN_SEPARATOR(),
                        keccak256(
                            abi.encode(
                                keccak256(
                                    "Permit(address owner,address spender,uint256 value,uint256 nonce,uint256 deadline)"
                                ),
                                owner,
                                spender,
                                value,
                                nonces[owner]++,
                                deadline
                            )
                        )
                    )
                ),
                v,
                r,
                s
            );

            require(recoveredAddress != address(0) && recoveredAddress == owner, "INVALID_SIGNER");

            allowance[recoveredAddress][spender] = value;
        }

        emit Approval(owner, spender, value);
    }

    function DOMAIN_SEPARATOR() public view virtual returns (bytes32) {
        return block.chainid == INITIAL_CHAIN_ID ? INITIAL_DOMAIN_SEPARATOR : computeDomainSeparator();
    }

    function computeDomainSeparator() internal view virtual returns (bytes32) {
        return
            keccak256(
                abi.encode(
                    keccak256("EIP712Domain(string name,string version,uint256 chainId,address verifyingContract)"),
                    keccak256(bytes(name)),
                    keccak256("1"),
                    block.chainid,
                    address(this)
                )
            );
    }

    /*//////////////////////////////////////////////////////////////
                        INTERNAL MINT/BURN LOGIC
    //////////////////////////////////////////////////////////////*/

    function _mint(address to, uint256 amount) internal virtual {
        totalSupply += amount;

        // Cannot overflow because the sum of all user
        // balances can't exceed the max uint256 value.
        unchecked {
            balanceOf[to] += amount;
        }

        emit Transfer(address(0), to, amount);
    }

    function _burn(address from, uint256 amount) internal virtual {
        balanceOf[from] -= amount;

        // Cannot underflow because a user's balance
        // will never be larger than the total supply.
        unchecked {
            totalSupply -= amount;
        }

        emit Transfer(from, address(0), amount);
    }
}

Settings
{
  "viaIR": true,
  "codegen": "yul",
  "remappings": [
    "@pythnetwork/entropy-sdk-solidity/=node_modules/@pythnetwork/entropy-sdk-solidity/",
    "@manifoldxyz/=lib/lssvm2/lib/",
    "@openzeppelin/contracts-upgradeable/=lib/lssvm2/lib/openzeppelin-contracts-upgradeable/contracts/",
    "@openzeppelin/contracts/=lib/lssvm2/lib/openzeppelin-contracts/contracts/",
    "@prb/math/=lib/lssvm2/lib/prb-math/src/",
    "chainlink/=lib/chainlink/",
    "clones-with-immutable-args/=lib/lssvm2/lib/clones-with-immutable-args/src/",
    "create2-helpers/=lib/lssvm2/lib/royalty-registry-solidity/lib/create2-helpers/",
    "create3-factory/=lib/lssvm2/lib/create3-factory/",
    "ds-test/=lib/solmate/lib/ds-test/src/",
    "erc4626-tests/=lib/lssvm2/lib/openzeppelin-contracts-upgradeable/lib/erc4626-tests/",
    "forge-std/=lib/forge-std/src/",
    "foundry-huff/=lib/lssvm2/lib/foundry-huff/src/",
    "huffmate/=lib/lssvm2/lib/huffmate/src/",
    "libraries-solidity/=lib/lssvm2/lib/libraries-solidity/contracts/",
    "lssvm2/=lib/lssvm2/src/",
    "manifoldxyz/=lib/lssvm2/lib/royalty-registry-solidity/contracts/",
    "openzeppelin-contracts-upgradeable/=lib/lssvm2/lib/openzeppelin-contracts-upgradeable/",
    "openzeppelin-contracts/=lib/lssvm2/lib/openzeppelin-contracts/",
    "prb-math/=lib/lssvm2/lib/prb-math/src/",
    "prb-test/=lib/lssvm2/lib/prb-math/lib/prb-test/src/",
    "royalty-registry-solidity/=lib/lssvm2/lib/royalty-registry-solidity/",
    "solady/=lib/solady/src/",
    "solmate/=lib/solmate/src/",
    "stringutils/=lib/lssvm2/lib/foundry-huff/lib/solidity-stringutils/",
    "vrf-contracts/=lib/vrf-contracts/contracts/"
  ],
  "evmVersion": "cancun",
  "outputSelection": {
    "*": {
      "*": [
        "abi"
      ]
    }
  },
  "optimizer": {
    "enabled": true,
    "mode": "3",
    "fallback_to_optimizing_for_size": false,
    "disable_system_request_memoization": true
  },
  "metadata": {},
  "libraries": {},
  "enableEraVMExtensions": false,
  "forceEVMLA": false
}

Contract Security Audit

Contract ABI

[{"inputs":[{"internalType":"contract IRNG","name":"_rng","type":"address"},{"internalType":"contract SofamonWearable","name":"_wearableContract","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"inputs":[],"name":"InvalidOdds","type":"error"},{"inputs":[],"name":"InvalidRarities","type":"error"},{"inputs":[],"name":"LengthMismatch","type":"error"},{"inputs":[],"name":"NotApproved","type":"error"},{"inputs":[],"name":"NotController","type":"error"},{"inputs":[],"name":"NotOperator","type":"error"},{"inputs":[],"name":"NotOwner","type":"error"},{"inputs":[],"name":"RevealTooEarly","type":"error"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256[]","name":"wearables","type":"uint256[]"},{"indexed":false,"internalType":"uint256[]","name":"rarities","type":"uint256[]"},{"indexed":false,"internalType":"uint16","name":"mintOdds","type":"uint16"},{"indexed":false,"internalType":"uint16","name":"otherRewardOdds","type":"uint16"},{"indexed":false,"internalType":"uint16","name":"noRewardOdds","type":"uint16"},{"indexed":false,"internalType":"uint256","name":"collectionId","type":"uint256"}],"name":"CollectionLaunched","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"newController","type":"address"}],"name":"CommitControllerUpdated","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"from","type":"address"},{"indexed":false,"internalType":"address","name":"minter","type":"address"},{"indexed":false,"internalType":"uint256","name":"spins","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"payment","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"userNonce","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"nonce","type":"uint256"}],"name":"MintCommited","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"ticketNonce","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"wearable","type":"uint256"},{"indexed":false,"internalType":"address","name":"recipient","type":"address"}],"name":"NftMintFailed","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"ticketNonce","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"wearable","type":"uint256"},{"indexed":false,"internalType":"address","name":"recipient","type":"address"}],"name":"NftMinted","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"ticketNonce","type":"uint256"},{"indexed":false,"internalType":"address","name":"initiator","type":"address"}],"name":"NoReward","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"newOperator","type":"address"}],"name":"OperatorUpdated","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"ticketNonce","type":"uint256"},{"indexed":true,"internalType":"address","name":"winner","type":"address"},{"indexed":true,"internalType":"uint16","name":"anotherResult","type":"uint16"}],"name":"OtherResult","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"user","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"newProtocolFeeTo","type":"address"}],"name":"ProtocolFeeToUpdated","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"contract IRNG","name":"newRng","type":"address"}],"name":"RNGSourceUpdated","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"newController","type":"address"}],"name":"RevealControllerUpdated","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"newSigner","type":"address"}],"name":"SignerUpdated","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"wearable","type":"address"},{"indexed":false,"internalType":"string","name":"_name","type":"string"},{"indexed":false,"internalType":"string","name":"_symbol","type":"string"},{"indexed":false,"internalType":"string","name":"_baseURI","type":"string"}],"name":"WearableCreated","type":"event"},{"inputs":[],"name":"DOMAIN_SEPARATOR","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"MINT_TYPE_HASH","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[{"components":[{"internalType":"uint256","name":"collectionId","type":"uint256"},{"internalType":"uint256","name":"spins","type":"uint256"},{"internalType":"address","name":"minter","type":"address"},{"internalType":"uint256","name":"fee","type":"uint256"}],"internalType":"struct SofamonGachaMachine.MintData[]","name":"mintData","type":"tuple[]"}],"name":"batchCommitToMint","outputs":[{"internalType":"uint256[]","name":"ticketNonces","type":"uint256[]"}],"stateMutability":"payable","type":"function"},{"inputs":[],"name":"commitController","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_collectionId","type":"uint256"},{"internalType":"uint256","name":"spins","type":"uint256"},{"internalType":"address","name":"minter","type":"address"},{"internalType":"uint256","name":"fee","type":"uint256"},{"internalType":"bytes","name":"signature","type":"bytes"}],"name":"commitToMint","outputs":[{"internalType":"uint256","name":"ticketNonce","type":"uint256"}],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"uint256","name":"nonce","type":"uint256"}],"name":"dataOf","outputs":[{"internalType":"address","name":"owner","type":"address"},{"internalType":"uint128","name":"collectionId","type":"uint128"},{"internalType":"uint128","name":"spins","type":"uint128"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"collectionId","type":"uint256"}],"name":"idToCollection","outputs":[{"internalType":"uint16","name":"mintOdds","type":"uint16"},{"internalType":"uint16","name":"otherRewardOdds","type":"uint16"},{"internalType":"uint16","name":"noRewardOdds","type":"uint16"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256[]","name":"_wearables","type":"uint256[]"},{"internalType":"uint256[]","name":"_rarities","type":"uint256[]"},{"internalType":"uint16","name":"_mintOdds","type":"uint16"},{"internalType":"uint16","name":"_otherRewardOdds","type":"uint16"},{"internalType":"uint16","name":"_noRewardOdds","type":"uint16"}],"name":"launchNewCollection","outputs":[{"internalType":"uint256","name":"collectionId","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"maxCollectionId","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"operator","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"protocolFeeTo","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"revealController","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"ticketNonce","type":"uint256"}],"name":"revealMintResult","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256[]","name":"nonces","type":"uint256[]"}],"name":"revealMintResults","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"rng","outputs":[{"internalType":"contract IRNG","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"newController","type":"address"}],"name":"setCommitController","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newOperator","type":"address"}],"name":"setOperator","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newFeeRecipient","type":"address"}],"name":"setProtocolFeeTo","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"contract IRNG","name":"newRng","type":"address"}],"name":"setRNG","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newController","type":"address"}],"name":"setRevealController","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newSigner","type":"address"}],"name":"setSigner","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"signer","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"sofamonWearables","outputs":[{"internalType":"contract SofamonWearable","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"user","type":"address"}],"name":"userNonce","outputs":[{"internalType":"uint256","name":"usersNonce","type":"uint256"}],"stateMutability":"view","type":"function"}]

Deployed Bytecode

0x00020000000000020014000000000002000000600310027000010000000103550000039f0030019d0000039f0430019700000001002001900000001f0000c13d0000008002000039000000400020043f000000040040008c000009460000413d000000000201043b000000e002200270000003af0020009c000000930000213d000003c10020009c000000a20000a13d000003c20020009c000000bc0000a13d000003c30020009c0000015a0000213d000003c60020009c000001990000613d000003c70020009c000009460000c13d0000000001000416000000000001004b000009460000c13d0000000301000039000005160000013d0000000002000416000000000002004b000009460000c13d0000001f02400039000003a002200197000000e002200039000000400020043f0000001f0340018f000003a105400198000000e002500039000000300000613d000000e006000039000000000701034f000000007807043c0000000006860436000000000026004b0000002c0000c13d000000000003004b0000003d0000613d000000000151034f0000000303300210000000000502043300000000053501cf000000000535022f000000000101043b0000010003300089000000000131022f00000000013101cf000000000151019f0000000000120435000000400040008c000009460000413d000000e00200043d000003a20020009c000009460000213d000001000100043d001200000001001d000003a20010009c000009460000213d000000000100041a000003a3011001970000000006000411000000000161019f000000000010041b000000400100043d001000000001001d00000000010004140000039f0010009c0000039f01008041000000c001100210000003a4011001c7001100000002001d0000800d020000390000000303000039000003a50400004100000000050000190e760e6c0000040f00000001002001900000001101000029000009460000613d000003a2011001970000000102000039000000000302041a000003a303300197000000000113019f000000000012041b0000001201000029000000c00010043f0000000701000039000000000201041a000003a3022001970000000003000411000000000232019f000000000021041b0000000201000039000000000201041a000003a302200197000000000232019f000000000021041b0000000401000039000000000201041a000003a302200197000000000232019f000000000021041b0000000501000039000000000201041a000003a302200197000000000232019f000000000021041b0000000801000039000000000201041a000003a302200197000000000232019f000000000021041b000003a601000041000000000010044300000000010004140000039f0010009c0000039f01008041000000c001100210000003a7011001c70000800b020000390e760e710000040f00000001002001900000079f0000613d000000000101043b000000800010043f0000001002000029000003a80020009c0000052e0000a13d0000040a01000041000000000010043f0000004101000039000000040010043f000004060100004100000e7800010430000003b00020009c000000af0000a13d000003b10020009c000001030000a13d000003b20020009c0000017b0000213d000003b50020009c0000019e0000613d000003b60020009c000009460000c13d0000000001000416000000000001004b000009460000c13d0000000501000039000004ea0000013d000003cb0020009c000001260000213d000003cf0020009c000001fc0000613d000003d00020009c000004e60000613d000003d10020009c000009460000c13d0000000001000416000000000001004b000009460000c13d0000000701000039000004ea0000013d000003ba0020009c000001370000213d000003be0020009c0000041f0000613d000003bf0020009c000004ef0000613d000003c00020009c000009460000c13d0000000001000416000000000001004b000009460000c13d000000000100041a000004eb0000013d000003c80020009c000001d80000613d000003c90020009c000004d30000613d000003ca0020009c000009460000c13d000000240040008c000009460000413d0000000402100370000000000202043b000003da0020009c000009460000213d0000002303200039000000000043004b000009460000813d0000000403200039000000000331034f000000000303043b000003da0030009c000009460000213d000000070530021000000000055200190000002405500039000000000045004b000009460000213d00000005063002100000003f05600039000003df05500197000003ec0050009c0000008d0000213d0000008005500039000000400050043f000000800030043f0000001f0560018f000000000006004b000000e70000613d000000000441034f000000a006600039000000a007000039000000004804043c0000000007870436000000000067004b000000e30000c13d000000000005004b000000000003004b0000056a0000c13d000000400100043d00000020020000390000000002210436000000800300043d00000000003204350000004002100039000000000003004b000000fa0000613d000000000400001900000080060000390000002006600039000000000506043300000000025204360000000104400039000000000034004b000000f40000413d00000000021200490000039f0020009c0000039f0200804100000060022002100000039f0010009c0000039f010080410000004001100210000000000112019f00000e770001042e000003b70020009c000001f50000613d000003b80020009c000004e10000613d000003b90020009c000009460000c13d000000240040008c000009460000413d0000000002000416000000000002004b000009460000c13d0000000401100370000000000101043b000003a20010009c000009460000213d000000000200041a000003a2022001970000000003000411000000000023004b000005240000c13d0000000202000039000000000302041a000003a303300197000000000313019f000000000032041b000000800010043f00000000010004140000039f0010009c0000039f01008041000000c001100210000003d4011001c70000800d020000390000000103000039000003d504000041000004ce0000013d000003cc0020009c0000046e0000613d000003cd0020009c000005070000613d000003ce0020009c000009460000c13d0000000001000416000000000001004b000009460000c13d0e760b920000040f000000400200043d00000000001204350000039f0020009c0000039f020080410000004001200210000003e8011001c700000e770001042e000003bb0020009c000004b20000613d000003bc0020009c0000051a0000613d000003bd0020009c000009460000c13d000000240040008c000009460000413d0000000002000416000000000002004b000009460000c13d0000000401100370000000000101043b000003a20010009c000009460000213d000000000200041a000003a2022001970000000003000411000000000023004b000005240000c13d0000000802000039000000000302041a000003a303300197000000000313019f000000000032041b000000800010043f00000000010004140000039f0010009c0000039f01008041000000c001100210000003d4011001c70000800d020000390000000103000039000003d704000041000004ce0000013d000003c40020009c000001b60000613d000003c50020009c000009460000c13d000000240040008c000009460000413d0000000002000416000000000002004b000009460000c13d0000000401100370000000000101043b000003a20010009c000009460000213d000000000200041a000003a2022001970000000003000411000000000023004b000005240000c13d0000000702000039000000000302041a000003a303300197000000000313019f000000000032041b000000800010043f00000000010004140000039f0010009c0000039f01008041000000c001100210000003d4011001c70000800d020000390000000103000039000003ea04000041000004ce0000013d000003b30020009c000001d30000613d000003b40020009c000009460000c13d000000240040008c000009460000413d0000000002000416000000000002004b000009460000c13d0000000401100370000000000601043b000003a20060009c000009460000213d000000000100041a000003a2021001970000000005000411000000000025004b000005240000c13d000003a301100197000000000161019f000000000010041b00000000010004140000039f0010009c0000039f01008041000000c001100210000003a4011001c70000800d020000390000000303000039000003a504000041000004ce0000013d0000000001000416000000000001004b000009460000c13d0000000801000039000004ea0000013d000000240040008c000009460000413d0000000002000416000000000002004b000009460000c13d0000000401100370000000000101043b000000000010043f0000000601000039000000200010043f000000400200003900000000010000190e760e390000040f000000000101041a0000ffff0210018f000000800020043f00000010021002700000ffff0220018f000000a00020043f00000020011002700000ffff0110018f000000c00010043f000003d30100004100000e770001042e000000240040008c000009460000413d0000000002000416000000000002004b000009460000c13d0000000401100370000000000101043b000003a20010009c000009460000213d000000000200041a000003a2022001970000000003000411000000000023004b000005240000c13d0000000402000039000000000302041a000003a303300197000000000313019f000000000032041b000000800010043f00000000010004140000039f0010009c0000039f01008041000000c001100210000003d4011001c70000800d020000390000000103000039000003eb04000041000004ce0000013d0000000001000416000000000001004b000009460000c13d0000000201000039000004ea0000013d000000240040008c000009460000413d0000000002000416000000000002004b000009460000c13d0000000401100370000000000101043b000003a20010009c000009460000213d000000000200041a000003a2022001970000000003000411000000000023004b000005240000c13d000003a2011001970000000103000039000000000203041a000003a302200197000000000212019f000000000023041b000000800010043f00000000010004140000039f0010009c0000039f01008041000000c001100210000003d4011001c70000800d020000390000040204000041000004ce0000013d0000000001000416000000000001004b000009460000c13d000003d601000041000000800010043f000003d20100004100000e770001042e000000240040008c000009460000413d0000000002000416000000000002004b000009460000c13d0000000402100370000000000202043b000003da0020009c000009460000213d0000002303200039000000000043004b000009460000813d0000000403200039000000000131034f000000000101043b000200000001001d000003da0010009c000009460000213d000100240020003d000000020100002900000005011002100000000101100029000000000041004b000009460000213d000000020000006b000004d10000613d000300000000001d0000000301000029000000050110021000000001011000290000000101100367000000000101043b000c00000001001d000000000010043f0000000901000039000000200010043f00000000010004140000039f0010009c0000039f01008041000000c001100210000003e1011001c700008010020000390e760e710000040f0000000100200190000009460000613d000000400200043d001000000002001d000003fd0020009c0000008d0000213d000000000101043b00000010030000290000006002300039000000400020043f000000000201041a000003a20220019700000000022304360000000101100039000000000101041a00000040043000390000008003100270000f00000004001d0000000000340435000003d90110019700000000001204350000000502000039000000000202041a000003a2022001970000000003000411000000000023004b000007d10000c13d000000000010043f0000000601000039000000200010043f00000000010004140000039f0010009c0000039f01008041000000c001100210000003e1011001c700008010020000390e760e710000040f0000000100200190000009460000613d000000000501043b000000400100043d001100000001001d000004040010009c0000008d0000213d0000001104000029000000a001400039000000400010043f000000000105041a00000020021002700000ffff0220018f000000400340003900000000002304350000ffff0210018f000000000224043600000010011002700000ffff0110018f000b00000002001d0000000000120435001200000005001d0000000101500039000000000301041a000000400200043d000e00000002001d000a00000003001d0000000002320436000d00000002001d000000000010043f00000000010004140000039f0010009c0000039f01008041000000c001100210000003e5011001c700008010020000390e760e710000040f0000000100200190000009460000613d0000000a06000029000000000006004b000002810000613d000000000101043b000000000200001900000012040000290000000d05000029000000000301041a000000000535043600000001011000390000000102200039000000000062004b0000027a0000413d000002830000013d00000012040000290000000d050000290000000e0300002900000000013500490000001f0110003900000413021001970000000001320019000000000021004b00000000020000390000000102004039000003da0010009c0000008d0000213d00000001002001900000008d0000c13d000000400010043f00000011010000290000006001100039000a00000001001d00000000003104350000000201400039000000000301041a000000400200043d001200000002001d000d00000003001d0000000002320436000e00000002001d000000000010043f00000000010004140000039f0010009c0000039f01008041000000c001100210000003e5011001c700008010020000390e760e710000040f0000000100200190000009460000613d0000000d05000029000000000005004b000002b20000613d000000000101043b00000000020000190000000e04000029000000000301041a000000000434043600000001011000390000000102200039000000000052004b000002ab0000413d000002b30000013d0000000e04000029000000120300002900000000013400490000001f0110003900000413021001970000000001320019000000000021004b00000000020000390000000102004039000003da0010009c0000008d0000213d00000001002001900000008d0000c13d000000400010043f00000011010000290000008001100039000400000001001d00000000003104350000000101000039000000000201041a000000400400043d001200000004001d0000040501000041000000000014043500000004014000390000000c0300002900000000003104350000039f0040009c0000039f010000410000000001044019000000400110021000000000030004140000039f0030009c0000039f03008041000000c003300210000000000113019f00000406011001c7000003a2022001970e760e710000040f000000120a00002900000060031002700000039f03300197000000200030008c00000020040000390000000004034019000000200640019000000000056a0019000002e80000613d000000000701034f00000000080a0019000000007907043c0000000008980436000000000058004b000002e40000c13d0000001f07400190000002f50000613d000000000661034f0000000307700210000000000805043300000000087801cf000000000878022f000000000606043b0000010007700089000000000676022f00000000067601cf000000000686019f00000000006504350000000100200190000007d40000613d0000001f01400039000000600210018f0000000001a20019000000000021004b00000000020000390000000102004039000003da0010009c0000008d0000213d00000001002001900000008d0000c13d000000400010043f000000200030008c000009460000413d00000000020a0433000e00000002001d000000000002004b000007f20000613d0000000f010000290000000001010433000003d900100198000004080000613d0000000003000019000003210000013d00000000010004140000039f0010009c0000039f01008041000000c001100210000003a4011001c70000800d02000039000000040300003900000409040000410000000c050000290e760e6c0000040f0000000100200190000009460000613d000000120300002900000001033000390000000f010000290000000001010433000003d901100197000000000013004b000004080000813d000000400100043d0000004002100039001200000003001d0000000000320435000000400200003900000000022104360000000e030000290000000000320435000003fd0010009c0000008d0000213d0000006003100039000000400030043f0000039f0020009c0000039f02008041000000400220021000000000010104330000039f0010009c0000039f010080410000006001100210000000000121019f00000000020004140000039f0020009c0000039f02008041000000c002200210000000000112019f000003a4011001c700008010020000390e760e710000040f0000000100200190000009460000613d000000110200002900000000020204330000ffff0220018f000000000301043b0000ffff0130018f000027107010011a000000000072004b000003780000a13d00000010010000290000000001010433000d00000001001d000000400100043d000000200200003900000000022104360000000000320435000003a80010009c0000008d0000213d0000004003100039000000400030043f0000039f0020009c0000039f02008041000000400220021000000000010104330000039f0010009c0000039f010080410000006001100210000000000121019f00000000020004140000039f0020009c0000039f02008041000000c002200210000000000112019f000003a4011001c700008010020000390e760e710000040f0000000100200190000009460000613d000000000301043b0000000a0100002900000000010104330000000021010434000000000001004b0000031a0000613d0000000d04000029000003a2074001970000ffff0330018f000027104030011a0000000003000019000000050530021000000000065200190000000006060433000000000046004b000003950000213d0000000103300039000000000013004b0000036f0000413d0000031a0000013d0000000b0100002900000000010104330000ffff0110018f0000000001210019000004070010009c000004680000813d00000010020000290000000002020433000003a206200197000000000071004b0000030e0000213d000000400100043d000000200210003900000000006204350000000c0200002900000000002104350000039f0010009c0000039f01008041000000400110021000000000020004140000039f0020009c0000039f02008041000000c002200210000000000112019f000003e1011001c70000800d0200003900000001030000390000040804000041000004040000013d000d00000007001d000000040100002900000000010104330000000002010433000000000032004b000007a00000a13d000000000115001900000020011000390000000001010433000900000001001d000003ef010000410000000000100443000000000100041200000004001004430000004001000039000000240010044300000000010004140000039f0010009c0000039f01008041000000c001100210000003f0011001c700008005020000390e760e710000040f00000001002001900000079f0000613d000000000101043b0000040b020000410000000000200443000003a201100197000800000001001d000000040010044300000000010004140000039f0010009c0000039f01008041000000c0011002100000040c011001c700008002020000390e760e710000040f00000001002001900000079f0000613d000000000101043b000000000001004b0000000d03000029000009460000613d000000400200043d0000002401200039000000090400002900000000004104350000040d010000410000000001120436000500000001001d000000040120003900000000003104350000039f0020009c000700000002001d0000039f010000410000000001024019000600400010021800000000010004140000039f0010009c0000039f01008041000000c00110021000000006011001af0000040e011001c700000008020000290e760e6c0000040f0000000100200190000003ef0000613d0000000703000029000003da0030009c0000008d0000213d000000400030043f00000040013000390000000d0200002900000000002104350000000901000029000000050200002900000000001204350000000c01000029000000000013043500000000010004140000039f0010009c0000039f01008041000000c00110021000000006011001af0000040f011001c70000800d0200003900000001030000390000041104000041000004040000013d000000400100043d00000040021000390000000d0300002900000000003204350000002002100039000000090300002900000000003204350000000c0200002900000000002104350000039f0010009c0000039f01008041000000400110021000000000020004140000039f0020009c0000039f02008041000000c002200210000000000112019f0000040f011001c70000800d02000039000000010300003900000410040000410e760e6c0000040f00000001002001900000031a0000c13d000009460000013d0000000c01000029000000000010043f0000000901000039000000200010043f00000000010004140000039f0010009c0000039f01008041000000c001100210000003e1011001c700008010020000390e760e710000040f0000000100200190000009460000613d000000000101043b000000000001041b0000000101100039000000000001041b00000003020000290000000102200039000300000002001d000000020020006c000002170000413d000004d10000013d000000a40040008c000009460000413d0000000002000416000000000002004b000009460000c13d0000000402100370000000000202043b000003da0020009c000009460000213d0000002303200039000000000043004b000009460000813d0000000403200039000000000331034f000000000303043b001200000003001d000003da0030009c000009460000213d000000240320003900000012020000290000000502200210001000000003001d001100000002001d0000000002320019000000000042004b000009460000213d0000002403100370000000000303043b000003da0030009c000009460000213d0000002305300039000000000045004b000009460000813d0000000405300039000000000651034f000000000606043b000003da0060009c000009460000213d00000024073000390000000503600210000f00000003001d000e00000007001d0000000003730019000000000043004b000009460000213d0000004404100370000000000404043b000d00000004001d0000ffff0040008c000009460000213d0000006404100370000000000404043b000b00000004001d0000ffff0040008c000009460000213d0000008404100370000000000404043b000900000004001d0000ffff0040008c000009460000213d0000000804000039000000000404041a000003a2044001970000000007000411000000000047004b000007c20000c13d0000000b070000290000000d047000290000ffff0040008c000004680000213d00000009044000290000ffff0040008c000007f90000a13d0000040a01000041000000000010043f0000001101000039000000040010043f000004060100004100000e7800010430000000a40040008c000009460000413d0000004402100370000000000302043b000003a20030009c000009460000213d0000008402100370000000000502043b000003da0050009c000009460000213d0000002302500039000000000042004b000009460000813d0000000406500039000000000261034f000000000202043b000003da0020009c0000008d0000213d0000001f0820003900000413088001970000003f088000390000041308800197000003ec0080009c0000008d0000213d0000008008800039000000400080043f000000800020043f00000000052500190000002405500039000000000045004b000009460000213d0000002004600039000000000541034f00000413062001980000001f0720018f000000a004600039000004990000613d000000a008000039000000000905034f000000009a09043c0000000008a80436000000000048004b000004950000c13d000000000007004b000004a60000613d000000000565034f0000000306700210000000000704043300000000076701cf000000000767022f000000000505043b0000010006600089000000000565022f00000000056501cf000000000575019f0000000000540435000000a00220003900000000000204350000000402100370000000000602043b0000002402100370000000000202043b0000006401100370000000000401043b000000800500003900000000010600190e7609480000040f000001300000013d000000240040008c000009460000413d0000000002000416000000000002004b000009460000c13d0000000401100370000000000101043b000003a20010009c000009460000213d000000000200041a000003a2022001970000000003000411000000000023004b000005240000c13d0000000502000039000000000302041a000003a303300197000000000313019f000000000032041b000000800010043f00000000010004140000039f0010009c0000039f01008041000000c001100210000003d4011001c70000800d020000390000000103000039000003d8040000410e760e6c0000040f0000000100200190000009460000613d000000000100001900000e770001042e0000000001000416000000000001004b000009460000c13d0000000001000412001400000001001d001300400000003d000080050100003900000044030000390000000004000415000000140440008a0000000504400210000003ef020000410e760e4e0000040f000004eb0000013d0000000001000416000000000001004b000009460000c13d0000000101000039000004ea0000013d0000000001000416000000000001004b000009460000c13d0000000401000039000000000101041a000003a201100197000000800010043f000003d20100004100000e770001042e000000240040008c000009460000413d0000000002000416000000000002004b000009460000c13d0000000401100370000000000101043b000000000010043f0000000901000039000000200010043f000000400200003900000000010000190e760e390000040f0000000102100039000000000202041a000000000101041a000003a201100197000000800010043f000003d901200197000000a00010043f0000008001200270000000c00010043f000003d30100004100000e770001042e000000240040008c000009460000413d0000000002000416000000000002004b000009460000c13d0000000401100370000000000101043b000003a20010009c000009460000213d000000000010043f0000000a01000039000000200010043f000000400200003900000000010000190e760e390000040f000000000101041a000000800010043f000003d20100004100000e770001042e000000240040008c000009460000413d0000000002000416000000000002004b000009460000c13d0000000401100370000000000101043b0e760bfb0000040f000000000100001900000e770001042e000003fa01000041000000800010043f0000002001000039000000840010043f0000000c01000039000000a40010043f0000040001000041000000c40010043f000004010100004100000e7800010430001200000001001d0000004001200039000000400010043f00000013010000390000000001120436000003a90200004100000000002104350000039f0010009c0000039f01008041000000400110021000000000020004140000039f0020009c0000039f02008041000000c002200210000000000121019f000003aa011001c700008010020000390e760e710000040f0000000100200190000009460000613d000000000101043b000000400200043d000000a003200039000000000400041000000000004304350000008003200039000000120400002900000000004304350000006003200039000003ab040000410000000000430435000000400320003900000000001304350000002001200039000003ac030000410000000000310435000000a0030000390000000000320435000003ad0020009c0000008d0000213d000000c003200039000000400030043f00000000020204330e760e390000040f000000a00010043f000000800200043d0000014000000443000001600020044300000020020000390000018000200443000001a0001004430000004001000039000000c00300043d000001c000100443000001e000300443000001000020044300000003010000390000012000100443000003ae0100004100000e770001042e0000000004000019000d00000004001d000000070340021000000000032300190000000002300079000000240220008a000003ed0020009c000009460000213d000000800020008c000009460000413d000000400200043d000003ec0020009c0000008d0000213d0000008004200039000000400040043f0000002404300039000000000441034f000000000404043b000e00000004001d00000000044204360000004405300039000000000551034f000000000505043b001000000005001d00000000005404350000006403300039000000000431034f000000000404043b001200000004001d000003a20040009c000009460000213d0000004004200039000000120500002900000000005404350000002003300039000000000131034f000000000701043b00000060012000390000000000710435000000400300043d000003ee0030009c0000008d0000213d0000002004300039000000400040043f00000000000304350000000401000039000000000101041a000003a2011001970000000002000411000000000012004b000006c80000613d000a00000004001d000b00000003001d001100000007001d0000000001000411000000000010043f0000000a01000039000000200010043f00000000010004140000039f0010009c0000039f01008041000000c001100210000003e1011001c700008010020000390e760e710000040f0000000100200190000009460000613d000000000101043b000000000101041a000c00000001001d000003ef01000041000000000010044300000000010004120000000400100443000000240000044300000000010004140000039f0010009c0000039f01008041000000c001100210000003f0011001c700008005020000390e760e710000040f00000001002001900000079f0000613d000000000101043b000f00000001001d000003a601000041000000000010044300000000010004140000039f0010009c0000039f01008041000000c001100210000003a7011001c70000800b020000390e760e710000040f00000001002001900000079f0000613d000000000201043b0000000f0020006c000005de0000c13d000003ef010000410000000000100443000000000100041200000004001004430000002001000039000000240010044300000000010004140000039f0010009c0000039f01008041000000c001100210000003f0011001c700008005020000390e760e710000040f00000001002001900000060e0000c13d0000079f0000013d000000400100043d000003a80010009c0000008d0000213d0000004003100039000000400030043f0000002003100039000003a904000041000000000043043500000013030000390000000000310435000000400100043d000000a00310003900000000040004100000000000430435000000800310003900000000002304350000006002100039000003ab0300004100000000003204350000004002100039000003f1030000410000000000320435000000a0020000390000000002210436000003ac030000410000000000320435000003ad0010009c0000008d0000213d000000c003100039000000400030043f0000039f0020009c0000039f02008041000000400220021000000000010104330000039f0010009c0000039f010080410000006001100210000000000121019f00000000020004140000039f0020009c0000039f02008041000000c002200210000000000112019f000003a4011001c700008010020000390e760e710000040f0000000100200190000009460000613d000000000401043b000000400500043d000000c00150003900000012020000290000000000210435000000a0015000390000001102000029000000000021043500000080015000390000000c02000029000000000021043500000060015000390000001002000029000000000021043500000040015000390000000e0200002900000000002104350000002003500039000003d6010000410000000000130435000000c0010000390000000000150435000003f20050009c0000008d0000213d000000e001500039000000400010043f0000010002500039000003f306000041000000000062043500000102065000390000000000460435000000000405043300000413074001970000001f0640018f0000012205500039000000000053004b000006430000813d000000000007004b0000063f0000613d00000000096300190000000008650019000000200880008a000000200990008a000000000a780019000000000b790019000000000b0b04330000000000ba0435000000200770008c000006390000c13d000000000006004b000006590000613d00000000080500190000064f0000013d0000000008750019000000000007004b0000064c0000613d0000000009030019000000000a050019000000009b090434000000000aba043600000000008a004b000006480000c13d000000000006004b000006590000613d00000000037300190000000306600210000000000708043300000000076701cf000000000767022f00000000030304330000010006600089000000000363022f00000000036301cf000000000373019f00000000003804350000000003540019000000000003043500000022034000390000000000310435000000610340003900000413043001970000000003140019000000000043004b00000000040000390000000104004039000003da0030009c0000008d0000213d00000001004001900000008d0000c13d000000400030043f0000039f0020009c0000039f02008041000000400220021000000000010104330000039f0010009c0000039f010080410000006001100210000000000121019f00000000020004140000039f0020009c0000039f02008041000000c002200210000000000112019f000003a4011001c700008010020000390e760e710000040f0000000100200190000009460000613d000000000101043b000000400400043d000000000010043f0000000a010000290000000001010433000000400010043f0000000b030000290000000001030433000000400010008c0000068e0000613d000000410010008c0000000002000019000006960000c13d00000060013000390000000001010433000000f801100270000000200010043f00000040013000390000000001010433000006940000013d00000040013000390000000001010433000000ff021002700000001b02200039000000200020043f000003ed01100197000000600010043f0000000102000039000f00000004001d00000000010004140000039f0010009c0000039f01008041000000c001100210000003f4011001c70e760e710000040f00000060031002700000039f03300197000000200030008c00000020060000390000000006034019000000200560019000000001045001bf000006ab0000613d000000000701034f0000000108000039000000007907043c0000000008980436000000000048004b000006a70000c13d0000001f066001900000001107000029000006b90000613d000000000151034f0000000305600210000000000604043300000000065601cf000000000656022f000000000101043b0000010005500089000000000151022f00000000015101cf000000000161019f0000000000140435000000000003004b000007c60000613d000000010120018f0000000001010433000000600000043f0000000f04000029000000400040043f0000000002000411000000120020006b000007ca0000c13d0000000702000039000000000202041a000000000112013f000003a200100198000007ca0000c13d000000000007004b000006da0000613d0000000201000039000000000101041a0000000002000414000003a2041001970000039f0020009c0000039f02008041000000c001200210000003a4011001c70000800902000039000000000307001900000000050000190e760e6c0000040f000000400300043d0000000100200190000006db0000c13d000007b20000013d000000400300043d001100000003001d0000000101000039000000000201041a000003fc0100004100000000001304350000039f0030009c0000039f010000410000000001034019000000400110021000000000030004140000039f0030009c0000039f03008041000000c003300210000000000113019f000003f6011001c7000003a2022001970e760e6c0000040f000000110a00002900000060031002700000039f03300197000000200030008c00000020040000390000000004034019000000200640019000000000056a0019000006fb0000613d000000000701034f00000000080a0019000000007907043c0000000008980436000000000058004b000006f70000c13d0000001f07400190000007080000613d000000000661034f0000000307700210000000000805043300000000087801cf000000000878022f000000000606043b0000010007700089000000000676022f00000000067601cf000000000686019f00000000006504350000000100200190000007a60000613d0000001f01400039000000600110018f0000000002a10019000000000012004b00000000010000390000000101004039000003da0020009c0000008d0000213d00000001001001900000008d0000c13d000f00000002001d000000400020043f000000200030008c000009460000413d0000000f02000029000003fd0020009c0000008d0000213d00000000010a0433001100000001001d0000006001200039000000400010043f0000001001000029000003d9011001970000004003200039000c00000003001d0000000000130435000000120100002900000000021204360000000e01000029000003d901100197000b00000002001d00000000001204350000000001000411000000000010043f0000000a01000039000000200010043f00000000010004140000039f0010009c0000039f01008041000000c001100210000003e1011001c700008010020000390e760e710000040f0000000100200190000009460000613d000000000101043b000000000101041a000e00000001001d000000010010003a000004680000413d0000000001000411000000000010043f0000000a01000039000000200010043f00000000010004140000039f0010009c0000039f01008041000000c001100210000003e1011001c700008010020000390e760e710000040f0000000100200190000009460000613d0000000e020000290000000102200039000000000101043b000e00000002001d000000000021041b0000001101000029000000000010043f0000000901000039000000200010043f00000000010004140000039f0010009c0000039f01008041000000c001100210000003e1011001c700008010020000390e760e710000040f0000000100200190000009460000613d0000000f020000290000000002020433000003a202200197000000000101043b000000000301041a000003a303300197000000000223019f000000000021041b0000000b020000290000000002020433000003d9022001970000000c0300002900000000030304330000008003300210000000000223019f0000000101100039000000000021041b000000400100043d000000a0021000390000001103000029000000000032043500000080021000390000000e030000290000000000320435000000600210003900000000030004160000000000320435000000400210003900000010030000290000000000320435000000200210003900000012030000290000000000320435000000000200041100000000002104350000039f0010009c0000039f01008041000000400110021000000000020004140000039f0020009c0000039f02008041000000c002200210000000000112019f000003fe011001c70000800d020000390000000103000039000003ff040000410e760e6c0000040f0000000100200190000009460000613d000000800100043d0000000d04000029000000000041004b000007a00000a13d0000000501400210000000a0011000390000001102000029000000000021043500000001010003670000000402100370000000000202043b0000000403200039000000000331034f0000000104400039000000000303043b000000000034004b0000056b0000413d000000ea0000013d000000000001042f0000040a01000041000000000010043f0000003201000039000000040010043f000004060100004100000e78000104300000001f0530018f000003a106300198000000400200043d0000000004620019000007df0000613d000000000701034f0000000008020019000000007907043c0000000008980436000000000048004b000007ad0000c13d000007df0000013d0000004401300039000003f9020000410000000000210435000000240130003900000013020000390000000000210435000003fa0100004100000000001304350000000401300039000000200200003900000000002104350000039f0030009c0000039f030080410000004001300210000003fb011001c700000e7800010430000003db01000041000000800010043f000003dc0100004100000e7800010430000003f701000041000000000010043f000003f80100004100000e7800010430000003f50100004100000000001404350000039f0040009c0000039f040080410000004001400210000003f6011001c700000e7800010430000000400100043d0000040302000041000007f30000013d0000001f0530018f000003a106300198000000400200043d0000000004620019000007df0000613d000000000701034f0000000008020019000000007907043c0000000008980436000000000048004b000007db0000c13d000000000005004b000007ec0000613d000000000161034f0000000305500210000000000604043300000000065601cf000000000656022f000000000101043b0000010005500089000000000151022f00000000015101cf000000000161019f000000000014043500000060013002100000039f0020009c0000039f020080410000004002200210000000000112019f00000e7800010430000004120200004100000000002104350000039f0010009c0000039f010080410000004001100210000003f6011001c700000e7800010430000027100040008c000008100000c13d000000000006004b000004680000613d0000000f04500029000000000441034f000000000404043b000027100040008c00000012040000290000080c0000c13d000000000064004b000008140000c13d0000002004500039000000000441034f000000000604043b000027100060008c00000012090000290000000e0a000029000008180000a13d000003e901000041000000800010043f000003dc0100004100000e7800010430000003dd01000041000000800010043f000003dc0100004100000e7800010430000003de01000041000000800010043f000003dc0100004100000e7800010430000000020090008c000008290000413d000000010600003900000005076002100000000008a70019000000000881034f000000000808043b000027100080008c0000080c0000213d0000000007750019000000000771034f000000000707043b000000000078004b0000080c0000413d0000000106600039000000000096004b0000081b0000413d0000000305000039000000000605041a000800010060003e000004680000613d0000000806000029000000000065041b0000012005000039000000400050043f0000000d06000029000000800060043f0000000b06000029000000a00060043f0000000906000029000000c00060043f0000000f060000290000003f06600039000003df06600197000003e00060009c0000008d0000213d0000012006600039000000400060043f0000001206000029000001200060043f0000000e060000290000002005500039000000004704043c00000000007504350000002006600039000000000036004b000008410000413d0000012003000039000000e00030043f00000011030000290000003f03300039000003df04300197000000400300043d0000000004430019000000000034004b00000000050000390000000105004039000003da0040009c0000008d0000213d00000001005001900000008d0000c13d000000400040043f000000120400002900000000004304350000001005000029000000000151034f00000000040300190000002004400039000000001601043c00000000006404350000002005500039000000000025004b0000085b0000413d000001000030043f0000000801000029000000000010043f0000000601000039000000200010043f00000000010004140000039f0010009c0000039f01008041000000c001100210000003e1011001c700008010020000390e760e710000040f0000000100200190000009460000613d000000800200043d0000ffff0220018f000000000301043b000000000103041a000003e201100197000000000121019f000000a00200043d0000001002200210000003e302200197000000000121019f000000c00200043d0000002002200210000003e402200197000000000121019f000700000003001d000000000013041b000000e00100043d000a00000001001d0000000001010433000c00000001001d000003da0010009c0000008d0000213d00000007010000290000000102100039000000000302041a0000000c01000029000600000002001d000000000012041b000500000003001d000000000031004b000008a20000813d0000000601000029000000000010043f00000000010004140000039f0010009c0000039f01008041000000c001100210000003e5011001c700008010020000390e760e710000040f0000000100200190000009460000613d000000000201043b00000005012000290000000c02200029000000000012004b000008a20000813d000000000002041b0000000102200039000000000012004b0000089e0000413d0000000601000029000000000010043f00000000010004140000039f0010009c0000039f01008041000000c001100210000003e5011001c700008010020000390e760e710000040f0000000100200190000009460000613d000000000101043b0000000c06000029000000000006004b0000000a05000029000008ba0000613d0000000002000019000000000312001900000020055000390000000004050433000000000043041b0000000102200039000000000062004b000008b30000413d000001000100043d000c00000001001d0000000001010433000a00000001001d000003da0010009c0000008d0000213d00000007010000290000000202100039000000000302041a0000000a01000029000700000002001d000000000012041b000600000003001d000000000031004b000008dd0000813d0000000701000029000000000010043f00000000010004140000039f0010009c0000039f01008041000000c001100210000003e5011001c700008010020000390e760e710000040f0000000100200190000009460000613d000000000201043b0000000a012000290000000602200029000000000021004b000008dd0000813d000000000001041b0000000101100039000000000021004b000008d90000413d0000000701000029000000000010043f00000000010004140000039f0010009c0000039f01008041000000c001100210000003e5011001c700008010020000390e760e710000040f0000000100200190000009460000613d000000000101043b0000000a0000006b000008f50000613d000000000200001900000000031200190000000c040000290000002004400039000c00000004001d0000000004040433000000000043041b00000001022000390000000a0020006c000008ec0000413d000000400100043d000000c0020000390000000002210436000000c00310003900000012040000290000000000430435000003e60040009c000009460000213d000000010300036700000011070000290000001f0570018f000000e0061000390000000004760019000000000007004b000009090000613d0000001007300360000000007807043c0000000006860436000000000046004b000009050000c13d000000000005004b00000000051400490000000000520435000000120200002900000000022404360000000f050000290000001f0450018f000000000005004b000009190000613d0000000e033003600000000f052000290000000006020019000000003703043c0000000006760436000000000056004b000009150000c13d000000000004004b000000a0031000390000000804000029000000000043043500000009030000290000ffff0330018f000000800410003900000000003404350000000b030000290000ffff0330018f000000600410003900000000003404350000000d030000290000ffff0330018f000000400410003900000000003404350000000f0310006900000000022300190000039f0020009c0000039f0200804100000060022002100000039f0010009c0000039f010080410000004001100210000000000112019f00000000020004140000039f0020009c0000039f02008041000000c002200210000000000112019f000003a4011001c70000800d020000390000000103000039000003e7040000410e760e6c0000040f0000000100200190000009460000613d000000400100043d000000080200002900000000002104350000039f0010009c0000039f010080410000004001100210000003e8011001c700000e770001042e000000000100001900000e780001043000070000000000020000000006040019000400000003001d000600000002001d000300000001001d0000000401000039000000000101041a000003a2011001970000000002000411000000000012004b00000a810000613d000100000005001d000700000006001d0000000001000411000000000010043f0000000a01000039000000200010043f00000000010004140000039f0010009c0000039f01008041000000c001100210000003e1011001c700008010020000390e760e710000040f000000010020019000000b5b0000613d000000000101043b000000000101041a000200000001001d000003ef01000041000000000010044300000000010004120000000400100443000000240000044300000000010004140000039f0010009c0000039f01008041000000c001100210000003f0011001c700008005020000390e760e710000040f0000000100200190000009920000613d000000000101043b000500000001001d000003a601000041000000000010044300000000010004140000039f0010009c0000039f01008041000000c001100210000003a7011001c70000800b020000390e760e710000040f0000000100200190000009920000613d000000000201043b000000050020006c000009930000c13d000003ef010000410000000000100443000000000100041200000004001004430000002001000039000000240010044300000000010004140000039f0010009c0000039f01008041000000c001100210000003f0011001c700008005020000390e760e710000040f0000000100200190000009c30000c13d000000000001042f000000400100043d000004140010009c00000b5d0000813d0000004003100039000000400030043f0000002003100039000003a904000041000000000043043500000013030000390000000000310435000000400100043d000000a00310003900000000040004100000000000430435000000800310003900000000002304350000006002100039000003ab0300004100000000003204350000004002100039000003f1030000410000000000320435000000a0020000390000000002210436000003ac030000410000000000320435000003ad0010009c00000b5d0000213d000000c003100039000000400030043f0000039f0020009c0000039f02008041000000400220021000000000010104330000039f0010009c0000039f010080410000006001100210000000000121019f00000000020004140000039f0020009c0000039f02008041000000c002200210000000000112019f000003a4011001c700008010020000390e760e710000040f000000010020019000000b5b0000613d000000000401043b000000400600043d000000a001600039000000070200002900000000002104350000008001600039000000020200002900000000002104350000006001600039000000060200002900000000002104350000004001600039000000030200002900000000002104350000000401000029000003a20d100197000000c0016000390000000000d104350000002003600039000003d6010000410000000000130435000000c0010000390000000000160435000003f20060009c00000b5d0000213d000000e001600039000000400010043f0000010002600039000003f305000041000000000052043500000102056000390000000000450435000000000406043300000413084001970000001f0740018f0000012206600039000000000063004b000009f90000813d000000000008004b000009f50000613d000000000a7300190000000009760019000000200990008a000000200aa0008a000000000b890019000000000c8a0019000000000c0c04330000000000cb0435000000200880008c000009ef0000c13d000000000007004b00000a0f0000613d000000000906001900000a050000013d0000000009860019000000000008004b00000a020000613d000000000a030019000000000b06001900000000ac0a0434000000000bcb043600000000009b004b000009fe0000c13d000000000007004b00000a0f0000613d00000000038300190000000307700210000000000809043300000000087801cf000000000878022f00000000030304330000010007700089000000000373022f00000000037301cf000000000383019f00000000003904350000000003460019000000000003043500000022034000390000000000310435000000610340003900000413043001970000000003140019000000000043004b00000000040000390000000104004039000003da0030009c00000b5d0000213d000000010040019000000b5d0000c13d00050000000d001d000000400030043f0000039f0020009c0000039f02008041000000400220021000000000010104330000039f0010009c0000039f010080410000006001100210000000000121019f00000000020004140000039f0020009c0000039f02008041000000c002200210000000000112019f000003a4011001c700008010020000390e760e710000040f000000010020019000000b5b0000613d000000000101043b000000400200043d000200000002001d000000000010043f000000010300002900000020013000390000000001010433000000400010043f0000000001030433000000400010008c00000a460000613d000000410010008c000000000200001900000a4e0000c13d00000060013000390000000001010433000000f801100270000000200010043f0000004001300039000000000101043300000a4c0000013d00000040013000390000000001010433000000ff021002700000001b02200039000000200020043f000003ed01100197000000600010043f000000010200003900000000010004140000039f0010009c0000039f01008041000000c001100210000003f4011001c70e760e710000040f00000060031002700000039f03300197000000200030008c000000200400003900000000040340190000001f0540018f000000200640019000000001046001bf00000a630000613d0000000107000039000000000801034f000000008908043c0000000007970436000000000047004b00000a5f0000c13d000000000005004b000000050700002900000a710000613d000000000161034f0000000305500210000000000604043300000000065601cf000000000656022f000000000101043b0000010005500089000000000151022f00000000015101cf000000000161019f0000000000140435000000000003004b00000b810000613d000000010120018f0000000001010433000000600000043f0000000203000029000000400030043f0000000702000039000000000202041a000000000112013f000003a200100198000000070600002900000b850000c13d0000000001000411000000000017004b00000b850000c13d000000000006004b00000aa20000613d0000000201000039000000000101041a0000000002000414000003a2041001970000039f0020009c0000039f02008041000000c001200210000003a4011001c70000800902000039000000000306001900000000050000190e760e6c0000040f000000400300043d000000010020019000000aa30000c13d0000004401300039000003f9020000410000000000210435000000240130003900000013020000390000000000210435000003fa0100004100000000001304350000000401300039000000200200003900000000002104350000039f0030009c0000039f030080410000004001300210000003fb011001c700000e7800010430000000400300043d000700000003001d0000000101000039000000000201041a000003fc0100004100000000001304350000039f0030009c0000039f010000410000000001034019000000400110021000000000030004140000039f0030009c0000039f03008041000000c003300210000000000113019f000003f6011001c7000003a2022001970e760e6c0000040f000000070b00002900000060031002700000039f03300197000000200030008c000000200400003900000000040340190000001f0640018f000000200740019000000000057b001900000ac40000613d000000000801034f00000000090b0019000000008a08043c0000000009a90436000000000059004b00000ac00000c13d000000000006004b00000ad10000613d000000000771034f0000000306600210000000000805043300000000086801cf000000000868022f000000000707043b0000010006600089000000000767022f00000000066701cf000000000686019f0000000000650435000000010020019000000b630000613d0000001f01400039000000600110018f0000000002b10019000000000012004b00000000010000390000000101004039000003da0020009c00000b5d0000213d000000010010019000000b5d0000c13d000500000002001d000000400020043f000000200030008c00000b5b0000413d0000000502000029000003fd0020009c00000b5d0000213d00000000010b0433000700000001001d0000006001200039000000400010043f0000000601000029000003d9011001970000004003200039000200000003001d00000000001304350000000301000029000003d9011001970000002003200039000300000003001d00000000001304350000000401000029000003a201100197000400000001001d00000000001204350000000001000411000000000010043f0000000a01000039000000200010043f00000000010004140000039f0010009c0000039f01008041000000c001100210000003e1011001c700008010020000390e760e710000040f000000010020019000000b5b0000613d000000000101043b000000000101041a000100000001001d000000010010003a00000b8c0000413d0000000001000411000000000010043f0000000a01000039000000200010043f00000000010004140000039f0010009c0000039f01008041000000c001100210000003e1011001c700008010020000390e760e710000040f000000010020019000000b5b0000613d00000001020000290000000102200039000000000101043b000100000002001d000000000021041b0000000701000029000000000010043f0000000901000039000000200010043f00000000010004140000039f0010009c0000039f01008041000000c001100210000003e1011001c700008010020000390e760e710000040f000000010020019000000b5b0000613d00000005020000290000000002020433000003a202200197000000000101043b000000000301041a000003a303300197000000000223019f000000000021041b00000003020000290000000002020433000003d902200197000000020300002900000000030304330000008003300210000000000223019f0000000101100039000000000021041b000000400100043d000000a00210003900000007030000290000000000320435000000800210003900000001030000290000000000320435000000000200041600000060031000390000000000230435000000400210003900000006030000290000000000320435000000200210003900000004030000290000000000320435000000000200041100000000002104350000039f0010009c0000039f01008041000000400110021000000000020004140000039f0020009c0000039f02008041000000c002200210000000000112019f000003fe011001c70000800d020000390000000103000039000003ff040000410e760e6c0000040f000000010020019000000b5b0000613d0000000701000029000000000001042d000000000100001900000e78000104300000040a01000041000000000010043f0000004101000039000000040010043f000004060100004100000e78000104300000001f0530018f000003a106300198000000400200043d000000000462001900000b6e0000613d000000000701034f0000000008020019000000007907043c0000000008980436000000000048004b00000b6a0000c13d000000000005004b00000b7b0000613d000000000161034f0000000305500210000000000604043300000000065601cf000000000656022f000000000101043b0000010005500089000000000151022f00000000015101cf000000000161019f000000000014043500000060013002100000039f0020009c0000039f020080410000004002200210000000000112019f00000e7800010430000003f701000041000000000010043f000003f80100004100000e7800010430000003f50100004100000000001304350000039f0030009c0000039f030080410000004001300210000003f6011001c700000e78000104300000040a01000041000000000010043f0000001101000039000000040010043f000004060100004100000e78000104300001000000000002000003ef01000041000000000010044300000000010004120000000400100443000000240000044300000000010004140000039f0010009c0000039f01008041000000c001100210000003f0011001c700008005020000390e760e710000040f000000010020019000000bc00000613d000000000101043b000100000001001d000003a601000041000000000010044300000000010004140000039f0010009c0000039f01008041000000c001100210000003a7011001c70000800b020000390e760e710000040f000000010020019000000bc00000613d000000000201043b000000010020006c00000bc10000c13d000003ef010000410000000000100443000000000100041200000004001004430000002001000039000000240010044300000000010004140000039f0010009c0000039f01008041000000c001100210000003f0011001c700008005020000390e760e710000040f000000010020019000000bf10000c13d000000000001042f000000400100043d000004140010009c00000bf30000813d0000004003100039000000400030043f0000002003100039000003a904000041000000000043043500000013030000390000000000310435000000400100043d000000a00310003900000000040004100000000000430435000000800310003900000000002304350000006002100039000003ab0300004100000000003204350000004002100039000003f1030000410000000000320435000000a0020000390000000002210436000003ac030000410000000000320435000003ad0010009c00000bf30000213d000000c003100039000000400030043f0000039f0020009c0000039f02008041000000400220021000000000010104330000039f0010009c0000039f010080410000006001100210000000000121019f00000000020004140000039f0020009c0000039f02008041000000c002200210000000000112019f000003a4011001c700008010020000390e760e710000040f000000010020019000000bf90000613d000000000101043b000000000001042d0000040a01000041000000000010043f0000004101000039000000040010043f000004060100004100000e7800010430000000000100001900000e7800010430000f000000000002000900000001001d000000000010043f0000000901000039000000200010043f00000000010004140000039f0010009c0000039f01008041000000c001100210000003e1011001c700008010020000390e760e710000040f000000010020019000000dfb0000613d000000400200043d000d00000002001d000004150020009c00000dfd0000813d000000000101043b0000000d030000290000006002300039000000400020043f000000000201041a000003a20220019700000000022304360000000101100039000000000101041a00000040043000390000008003100270000c00000004001d0000000000340435000003d90110019700000000001204350000000502000039000000000202041a000003a2022001970000000003000411000000000023004b00000e100000c13d000000000010043f0000000601000039000000200010043f00000000010004140000039f0010009c0000039f01008041000000c001100210000003e1011001c700008010020000390e760e710000040f000000010020019000000dfb0000613d000000000501043b000000400100043d000e00000001001d000004040010009c00000dfd0000213d0000000e04000029000000a001400039000000400010043f000000000105041a00000020021002700000ffff0220018f000000400340003900000000002304350000ffff0210018f000000000224043600000010011002700000ffff0110018f000800000002001d0000000000120435000f00000005001d0000000101500039000000000301041a000000400200043d000b00000002001d000700000003001d0000000002320436000a00000002001d000000000010043f00000000010004140000039f0010009c0000039f01008041000000c001100210000003e5011001c700008010020000390e760e710000040f000000010020019000000dfb0000613d0000000706000029000000000006004b00000c610000613d000000000101043b00000000020000190000000f040000290000000a05000029000000000301041a000000000535043600000001011000390000000102200039000000000062004b00000c5a0000413d00000c630000013d0000000f040000290000000a050000290000000b0300002900000000013500490000001f0110003900000413021001970000000001320019000000000021004b00000000020000390000000102004039000003da0010009c00000dfd0000213d000000010020019000000dfd0000c13d000000400010043f0000000e010000290000006001100039000700000001001d00000000003104350000000201400039000000000301041a000000400200043d000f00000002001d000a00000003001d0000000002320436000b00000002001d000000000010043f00000000010004140000039f0010009c0000039f01008041000000c001100210000003e5011001c700008010020000390e760e710000040f000000010020019000000dfb0000613d0000000a05000029000000000005004b00000c920000613d000000000101043b00000000020000190000000b04000029000000000301041a000000000434043600000001011000390000000102200039000000000052004b00000c8b0000413d00000c930000013d0000000b040000290000000f0300002900000000013400490000001f0110003900000413021001970000000001320019000000000021004b00000000020000390000000102004039000003da0010009c00000dfd0000213d000000010020019000000dfd0000c13d000000400010043f0000000e010000290000008001100039000100000001001d00000000003104350000000101000039000000000201041a000000400400043d000f00000004001d000004050100004100000000001404350000000401400039000000090300002900000000003104350000039f0040009c0000039f010000410000000001044019000000400110021000000000030004140000039f0030009c0000039f03008041000000c003300210000000000113019f00000406011001c7000003a2022001970e760e710000040f0000000f0b00002900000060031002700000039f03300197000000200030008c000000200400003900000000040340190000001f0640018f000000200740019000000000057b001900000cc90000613d000000000801034f00000000090b0019000000008a08043c0000000009a90436000000000059004b00000cc50000c13d000000000006004b00000cd60000613d000000000771034f0000000306600210000000000805043300000000086801cf000000000868022f000000000707043b0000010006600089000000000767022f00000000066701cf000000000686019f0000000000650435000000010020019000000e130000613d0000001f01400039000000600210018f0000000001b20019000000000021004b00000000020000390000000102004039000003da0010009c00000dfd0000213d000000010020019000000dfd0000c13d000000400010043f000000200030008c00000dfb0000413d00000000020b0433000b00000002001d000000000002004b00000e310000613d0000000c010000290000000001010433000003d90010019800000de90000613d000000000300001900000cfc0000013d00000000010004140000039f0010009c0000039f01008041000000c001100210000003a4011001c70000800d020000390000000403000039000004090400004100000009050000290e760e6c0000040f000000010020019000000de20000c13d00000dfb0000013d000000400100043d0000004002100039000f00000003001d0000000000320435000000400200003900000000022104360000000b030000290000000000320435000003fd0010009c00000dfd0000213d0000006003100039000000400030043f0000039f0020009c0000039f02008041000000400220021000000000010104330000039f0010009c0000039f010080410000006001100210000000000121019f00000000020004140000039f0020009c0000039f02008041000000c002200210000000000112019f000003a4011001c700008010020000390e760e710000040f000000010020019000000dfb0000613d0000000e0200002900000000020204330000ffff0220018f000000000301043b0000ffff0130018f000027107010011a000000000072004b00000d530000a13d0000000d010000290000000001010433000a00000001001d000000400100043d000000200200003900000000022104360000000000320435000003a80010009c00000dfd0000213d0000004003100039000000400030043f0000039f0020009c0000039f02008041000000400220021000000000010104330000039f0010009c0000039f010080410000006001100210000000000121019f00000000020004140000039f0020009c0000039f02008041000000c002200210000000000112019f000003a4011001c700008010020000390e760e710000040f000000010020019000000dfb0000613d000000000301043b000000070100002900000000010104330000000021010434000000000001004b00000de20000613d0000000a04000029000003a2074001970000ffff0330018f000027104030011a0000000003000019000000050530021000000000065200190000000006060433000000000046004b00000d700000213d0000000103300039000000000013004b00000d4a0000413d00000de20000013d000000080100002900000000010104330000ffff0110018f0000000001210019000004070010009c00000e030000813d0000000d020000290000000002020433000003a206200197000000000071004b00000cef0000213d000000400100043d00000020021000390000000000620435000000090200002900000000002104350000039f0010009c0000039f01008041000000400110021000000000020004140000039f0020009c0000039f02008041000000c002200210000000000112019f000003e1011001c70000800d020000390000000103000039000004080400004100000ddf0000013d000a00000007001d000000010100002900000000010104330000000002010433000000000032004b00000e0a0000a13d000000000115001900000020011000390000000001010433000600000001001d000003ef010000410000000000100443000000000100041200000004001004430000004001000039000000240010044300000000010004140000039f0010009c0000039f01008041000000c001100210000003f0011001c700008005020000390e760e710000040f000000010020019000000e090000613d000000000101043b0000040b020000410000000000200443000003a201100197000500000001001d000000040010044300000000010004140000039f0010009c0000039f01008041000000c0011002100000040c011001c700008002020000390e760e710000040f000000010020019000000e090000613d000000000101043b000000000001004b0000000a0300002900000dfb0000613d000000400200043d0000002401200039000000060400002900000000004104350000040d010000410000000001120436000200000001001d000000040120003900000000003104350000039f0020009c000400000002001d0000039f010000410000000001024019000300400010021800000000010004140000039f0010009c0000039f01008041000000c00110021000000003011001af0000040e011001c700000005020000290e760e6c0000040f000000010020019000000dca0000613d0000000403000029000003da0030009c00000dfd0000213d000000400030043f00000040013000390000000a0200002900000000002104350000000601000029000000020200002900000000001204350000000901000029000000000013043500000000010004140000039f0010009c0000039f01008041000000c00110021000000003011001af0000040f011001c70000800d020000390000000103000039000004110400004100000ddf0000013d000000400100043d00000040021000390000000a030000290000000000320435000000200210003900000006030000290000000000320435000000090200002900000000002104350000039f0010009c0000039f01008041000000400110021000000000020004140000039f0020009c0000039f02008041000000c002200210000000000112019f0000040f011001c70000800d02000039000000010300003900000410040000410e760e6c0000040f000000010020019000000dfb0000613d0000000f0300002900000001033000390000000c010000290000000001010433000003d901100197000000000013004b00000cfc0000413d0000000901000029000000000010043f0000000901000039000000200010043f00000000010004140000039f0010009c0000039f01008041000000c001100210000003e1011001c700008010020000390e760e710000040f000000010020019000000dfb0000613d000000000101043b000000000001041b0000000101100039000000000001041b000000000001042d000000000100001900000e78000104300000040a01000041000000000010043f0000004101000039000000040010043f000004060100004100000e78000104300000040a01000041000000000010043f0000001101000039000000040010043f000004060100004100000e7800010430000000000001042f0000040a01000041000000000010043f0000003201000039000000040010043f000004060100004100000e7800010430000000400100043d000004030200004100000e320000013d0000001f0530018f000003a106300198000000400200043d000000000462001900000e1e0000613d000000000701034f0000000008020019000000007907043c0000000008980436000000000048004b00000e1a0000c13d000000000005004b00000e2b0000613d000000000161034f0000000305500210000000000604043300000000065601cf000000000656022f000000000101043b0000010005500089000000000151022f00000000015101cf000000000161019f000000000014043500000060013002100000039f0020009c0000039f020080410000004002200210000000000112019f00000e7800010430000004120200004100000000002104350000039f0010009c0000039f010080410000004001100210000003f6011001c700000e7800010430000000000001042f0000039f0010009c0000039f0100804100000040011002100000039f0020009c0000039f020080410000006002200210000000000112019f00000000020004140000039f0020009c0000039f02008041000000c002200210000000000112019f000003a4011001c700008010020000390e760e710000040f000000010020019000000e4c0000613d000000000101043b000000000001042d000000000100001900000e780001043000000000050100190000000000200443000000050030008c00000e5c0000413d000000040100003900000000020000190000000506200210000000000664001900000005066002700000000006060031000000000161043a0000000102200039000000000031004b00000e540000413d0000039f0030009c0000039f03008041000000600130021000000000020004140000039f0020009c0000039f02008041000000c002200210000000000112019f00000416011001c700000000020500190e760e710000040f000000010020019000000e6b0000613d000000000101043b000000000001042d000000000001042f00000e6f002104210000000102000039000000000001042d0000000002000019000000000001042d00000e74002104230000000102000039000000000001042d0000000002000019000000000001042d00000e760000043200000e770001042e00000e780001043000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000ffffffff00000000000000000000000000000000000000000000000000000001ffffffe000000000000000000000000000000000000000000000000000000000ffffffe0000000000000000000000000ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000008be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09a8a0592ac89c5ad3bc6df8224c17b485976f597df104ee20d0df415241f670b0200000200000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000000000000ffffffffffffffbf536f66616d6f6e47616368614d616368696e65000000000000000000000000000200000000000000000000000000000000000013000000000000000000000000c89efdaa54c0f20c7adf612882df0950f5a951637e0307cdcb4c672f298b8bc68b73c3c69bb8fe3d512ecc4cf759cc79239f7b179b0ffacaa9a75d522b39400f000000000000000000000000000000000000000000000000ffffffffffffff3f000000020000000000000000000000000000010000000100000000000000000000000000000000000000000000000000000000000000000000000000752cda5100000000000000000000000000000000000000000000000000000000c6786e0300000000000000000000000000000000000000000000000000000000e93b7b7c00000000000000000000000000000000000000000000000000000000ef36925100000000000000000000000000000000000000000000000000000000ef36925200000000000000000000000000000000000000000000000000000000f2fde38b00000000000000000000000000000000000000000000000000000000e93b7b7d00000000000000000000000000000000000000000000000000000000ea733e3c00000000000000000000000000000000000000000000000000000000c6786e0400000000000000000000000000000000000000000000000000000000d605787b00000000000000000000000000000000000000000000000000000000e0e6799f000000000000000000000000000000000000000000000000000000008fb2ed44000000000000000000000000000000000000000000000000000000008fb2ed45000000000000000000000000000000000000000000000000000000009d2baff100000000000000000000000000000000000000000000000000000000b3ab15fb00000000000000000000000000000000000000000000000000000000752cda5200000000000000000000000000000000000000000000000000000000871caa98000000000000000000000000000000000000000000000000000000008da5cb5b000000000000000000000000000000000000000000000000000000003b84edbc00000000000000000000000000000000000000000000000000000000570ca734000000000000000000000000000000000000000000000000000000006c000442000000000000000000000000000000000000000000000000000000006c000443000000000000000000000000000000000000000000000000000000006c19e78300000000000000000000000000000000000000000000000000000000570ca7350000000000000000000000000000000000000000000000000000000063c4c27f000000000000000000000000000000000000000000000000000000003b84edbd0000000000000000000000000000000000000000000000000000000048164e14000000000000000000000000000000000000000000000000000000004c6fa95a000000000000000000000000000000000000000000000000000000002d0751de000000000000000000000000000000000000000000000000000000002d0751df000000000000000000000000000000000000000000000000000000002e04b8e7000000000000000000000000000000000000000000000000000000003644e515000000000000000000000000000000000000000000000000000000000281e439000000000000000000000000000000000000000000000000000000000845fc6500000000000000000000000000000000000000000000000000000000238ac9330000000000000000000000000000000000000020000000800000000000000000000000000000000000000000000000000000006000000080000000000000000002000000000000000000000000000000000000200000008000000000000000005384cdf4313810fabc89429faf20f012efaa71e0a3bdebc9c0a6ecb9fe1f98e8ca2ed3885d62d76d1c4c44c62a19fcdac9618d4de624552881f6e79c18a073d5b3b3f5f64ab192e4b5fefde1f51ce9733bbdcf831951543b325aebd49cc27ec404fbc1ce8665061bf7215b141507fc4be48de60aa99be0b34095e6d21e4f97b000000000000000000000000000000000ffffffffffffffffffffffffffffffff000000000000000000000000000000000000000000000000ffffffffffffffff7c214f04000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004000000800000000000000000fdfffca700000000000000000000000000000000000000000000000000000000ff633a38000000000000000000000000000000000000000000000000000000007fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0000000000000000000000000000000000000000000000000fffffffffffffedf0200000000000000000000000000000000000040000000000000000000000000ffffffffffffffffffffffffffffffffffffffffffffffffffff00000000000000000000000000000000000000000000000000000000000000000000ffff00000000000000000000000000000000000000000000000000000000ffff00000000020000000000000000000000000000000000002000000000000000000000000007ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8535fa3c7535eb1e8cf7778000d998cca65624292ba60c9330ef2fca6a0852a10000000000000000000000000000000000000020000000000000000000000000eb8a8d5b000000000000000000000000000000000000000000000000000000005553331329228fbd4123164423717a4a7539f6dfa1c3279a923b98fd681a6c73a2c8aa46e374a7750d1e7c07ea6da1bc46de8408ddcd6a5f233253e818dcccf9000000000000000000000000000000000000000000000000ffffffffffffff7f7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff000000000000000000000000000000000000000000000000ffffffffffffffdf310ab089e4439a4c15d089f94afb7896ff553aecb10793d0ab882de59d99a32e02000002000000000000000000000000000000440000000000000000000000005f9cdf28ae0c4aa1ad91e496962fa941e69e735ba7d461e64e1d7b47a5cf9ee9000000000000000000000000000000000000000000000000ffffffffffffff1f19010000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000080000000000000000000000000c19f17a9000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000000000000000000008baa579f00000000000000000000000000000000000000040000001c00000000000000004554485f5452414e534645525f4641494c45440000000000000000000000000008c379a0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000064000000000000000000000000d605787b00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000ffffffffffffff9f02000000000000000000000000000000000000c000000000000000000000000031f8235e58765cd8220362529460c263e43698ad869471f2705b98c297b2554c554e415554484f52495a454400000000000000000000000000000000000000000000000000000000000000000000000000000064000000800000000000000000ce6d97d9e471ad4361c205d6023bbe789164886122fa09cd2f1646be26fe878623019e6700000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000ffffffffffffff5fbf82fe0f0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000240000000000000000000000000000000000000000000000000000000000000000000000000000000000010000927c37fba00a81cf820020aedd3cf3341ef4bf275c3233e87ada16b5e91c06d8b1581d8988f3dcfbfe7911878287ced97264330a83685198aeb521d7e8534f9c4e487b71000000000000000000000000000000000000000000000000000000001806aa1896bbf26568e884a7374b41e002500962caba6a15023a8d90e8508b83020000020000000000000000000000000000002400000000000000000000000040c10f190000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000440000000000000000000000000200000000000000000000000000000000000060000000000000000000000000acace544bca7db3171f608fa675094a0f8f570f141d1473ef2d28550deb737bde39f22ca47b4a095efc2fab20dc9f99f196019313205d257e2e5f3ea98ae2333c349402d00000000000000000000000000000000000000000000000000000000ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0000000000000000000000000000000000000000000000000ffffffffffffffc0000000000000000000000000000000000000000000000000ffffffffffffffa002000002000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000ebdc4f458e75a215fa16d02f692664306bcf7eca5125bc75e44cd16cbdf6a558

Block Transaction 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
[ 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.