ETH Price: $2,661.90 (+1.60%)

Contract

0xaf18417f32D73B92cC95b6968391991eDab96f75
 

Overview

ETH Balance

0 ETH

Eth Value

$0.00

Multichain Info

No addresses found
Transaction Hash
Method
Block
From
To
0x60806040152393832022-07-29 19:52:54824 days ago1659124374IN
 Create: MaxPerWalletFacet
0 ETH0.0165283717.05534875

View more zero value Internal Transactions in Advanced View mode

Advanced mode:
Loading...
Loading

Contract Source Code Verified (Exact Match)

Contract Name:
MaxPerWalletFacet

Compiler Version
v0.8.13+commit.abaa5c0e

Optimization Enabled:
No with 200 runs

Other Settings:
default evmVersion
File 1 of 6 : MaxPerWalletFacet.sol
// SPDX-License-Identifier: MIT

pragma solidity 0.8.13;

import {AppStorage, Modifiers} from "../libraries/LibAppStorage.sol";
import "../libraries/LibERC721.sol";

contract MaxPerWalletFacet is Modifiers {
    /// Set max allowed per transaction
    function setMaxPerWallet(uint256 maxPerWallet) external onlyEditor {
        s._maxPerWallet = maxPerWallet;
    }

    /// Set to enable and disable public max per wallet paid to mint
    function setMaxPerWalletPaidOpen(bool newValue) external onlyEditor {
        s.maxPerWalletPaidOpen = newValue;
    }

    /// Set to enable and disable public max per wallet free to mint
    function setMaxPerWalletFreeOpen(bool newValue) external onlyEditor {
        s.maxPerWalletFreeOpen = newValue;
    }

    /// Minting for max per wallet tokens paid
    function mintMaxPerWalletPaid(address targetAddress, uint16 quantity) external payable {
        /// Revert if public max per wallet sale is not open
        require(s.maxPerWalletPaidOpen, "Public max per wallet paid not open");
        /// Revert if over max allowed per wallet
        require(s._addressData[targetAddress].balance < s._maxPerWallet, "Max per wallet met");
        /// Revert if incorrect amount sent
        require(msg.value == s.priceWEI * quantity, "Incorrect value sent");
        /// Revert if outside sale limit
        require((s._currentIndex - 1) + quantity <= s.saleLimit, "Quanity more than available");

        _mint(targetAddress, quantity);
    }

    /// Minting for max per wallet  tokens paid
    function mintMaxPerWalletFree(address targetAddress, uint16 quantity) external payable {
        /// Revert if public max per wallet sale is not open
        require(s.maxPerWalletFreeOpen, "Public max per wallet free not open");
        /// Revert if over max allowed per wallet
        require(s._addressData[targetAddress].balance < s._maxPerWallet, "Max per wallet met");
        /// Revert if outside sale limit
        require((s._currentIndex - 1) + quantity <= s.saleLimit, "Quanity more than available");

        _mint(targetAddress, quantity);
    }

    /// Returns max allowed per transaction
    function getMaxPerWallet() external view returns (uint256) {
        return s._maxPerWallet;
    }

    /// Returns if public max per wallet paid mint is open
    function maxPerWalletPaidOpen() external view returns (bool) {
        return s.maxPerWalletPaidOpen;
    }

    /// Returns if public max per wallet mint free is open
    function maxPerWalletFreeOpen() external view returns (bool) {
        return s.maxPerWalletFreeOpen;
    }

    /**
     * @dev Mints `quantity` tokens and transfers them to `to`.
     *
     * Requirements:
     *
     * - `to` cannot be the zero address.
     * - `quantity` must be greater than 0.
     *
     * Emits a {Transfer} event.
     */
    function _mint(address to, uint256 quantity) internal {
        uint256 _startingId = s._currentIndex;
        require(to > address(0), "Zero address");
        require(quantity > 0, "Quantity zero");

        _beforeTokenTransfers(address(0), to, _startingId, quantity);

        // Overflows are incredibly unrealistic.
        // balance or numberMinted overflow if current value of either + quantity > 1.8e19 (2**64) - 1
        // updatedIndex overflows if _currentIndex + quantity > 1.2e77 (2**256) - 1
        unchecked {
            s._addressData[to].balance += uint64(quantity);
            s._addressData[to].numberMinted += uint64(quantity);

            s._ownerships[_startingId].addr = to;
            s._ownerships[_startingId].startTimestamp = uint64(block.timestamp);

            uint256 updatedIndex = _startingId;
            uint256 end = updatedIndex + quantity;

            do {
                emit LibERC721.Transfer(address(0), to, updatedIndex++);
            } while (updatedIndex != end);

            s._currentIndex = updatedIndex;
        }
        _afterTokenTransfers(address(0), to, _startingId, quantity);
    }

    /**
     * @dev Hook that is called before a set of serially-ordered token ids are about to be transferred. This includes minting.
     * And also called before burning one token.
     *
     * _startTokenId - the first token id to be transferred
     * quantity - the amount to be transferred
     *
     * Calling conditions:
     *
     * - When `from` and `to` are both non-zero, `from`'s `tokenId` will be
     * transferred to `to`.
     * - When `from` is zero, `tokenId` will be minted for `to`.
     * - When `to` is zero, `tokenId` will be burned by `from`.
     * - `from` and `to` are never both zero.
     */
    function _beforeTokenTransfers(
        address from,
        address to,
        uint256 _startingId,
        uint256 quantity
    ) internal virtual {}

    /**
     * @dev Hook that is called after a set of serially-ordered token ids have been transferred. This includes
     * minting.
     * And also called after one token has been burned.
     *
     * _startingId - the first token id to be transferred
     * quantity - the amount to be transferred
     *
     * Calling conditions:
     *
     * - When `from` and `to` are both non-zero, `from`'s `tokenId` has been
     * transferred to `to`.
     * - When `from` is zero, `tokenId` has been minted for `to`.
     * - When `to` is zero, `tokenId` has been burned by `from`.
     * - `from` and `to` are never both zero.
     */
    function _afterTokenTransfers(
        address from,
        address to,
        uint256 _startingId,
        uint256 quantity
    ) internal virtual {}
}

File 2 of 6 : LibAppStorage.sol
//SPDX-License-Identifier: MIT
pragma solidity 0.8.13;
import {LibDiamond} from "../../shared/libraries/LibDiamond.sol";

/// Compiler will pack this into a single 256bit word.
struct TokenOwnership {
    /// The address of the owner.
    address addr;
    /// Keeps track of the start time of ownership with minimal overhead for tokenomics.
    uint64 startTimestamp;
    /// Whether the token has been burned.
    bool burned;
}

/// Compiler will pack this into a single 256bit word.
struct AddressData {
    /// Realistically, 2**64-1 is more than enough.
    uint64 balance;
    /// Keeps track of mint count with minimal overhead for tokenomics.
    uint64 numberMinted;
    /// Keeps track of burn count with minimal overhead for tokenomics.
    uint64 numberBurned;
    /// For miscellaneous variable(s) pertaining to the address
    /// (e.g. number of whitelist mint slots used).
    /// If there are multiple variables, please pack them into a uint64.
    uint64 aux;
}

/// Defines attributes stored in diamond
/// Many come from ERC721A
struct AppStorage {
    /// Name of contract
    string name;
    /// Symbol for contract
    string symbol;
    /// Base URI
    string baseURI;
    /// If true the public mint is open
    bool publicMintOpen;
    /// Price in WEI
    uint256 priceWEI;
    /// Total allowed to be minted
    uint256 saleLimit;
    /// If true the paid allow list mint is open
    bool allowListPaidOpen;
    /// If true the free allow list mint is open
    bool allowListFreeOpen;
    /// Royalty target address for ERC2981
    address _royaltyTarget;
    /// The max tokens allowed to be purchased in one transaction
    uint256 _maxAllowed;
    /// The tokenId of the next token to be minted
    uint256 _currentIndex;
    /// The number of tokens burned
    uint256 _burnCounter;
    /// Total revenue shares
    uint256 _totalShares;
    /// Total revenue released
    uint256 _totalReleased;
    /// Mapping from token ID to ownership details
    /// An empty struct value does not necessarily mean the token is unowned. See _ownershipOf implementation for details.
    mapping(uint256 => TokenOwnership) _ownerships;
    /// Mapping owner address to address data
    mapping(address => AddressData) _addressData;
    /// Mapping from token ID to approved address
    mapping(uint256 => address) _tokenApprovals;
    /// Mapping from owner to operator approvals
    mapping(address => mapping(address => bool)) _operatorApprovals;
    /// Mapping of Editors to contract
    mapping(address => bool) _editors;
    /// Mapping of revenue shares
    mapping(address => uint256) _shares;
    /// Mapping of total revenue released to each address
    mapping(address => uint256) _released;
    /// Mapping of allowed addresses to pay for minting before mint starts
    mapping(address => uint16) _allowListPaid;
    /// Mapping of allowed addresses to mint for free plus gas
    mapping(address => uint16) _allowListFree;
    /// Address of signer for verified mints
    address signer;
    /// Mapping of used verified messages
    mapping(uint32 => bool) _usedVerifiedMessages;
    /// If true the paid public max per wallet is open
    bool maxPerWalletPaidOpen;
    /// If true the free public max per wallet is open
    bool maxPerWalletFreeOpen;
    /// The max tokens allowed to be purchased per wallet
    uint256 _maxPerWallet;
    /// If true the paid public max per wallet is open
    bool bulkBurningOpen;
    //always add new state variables at the end
}

library LibAppStorage {
    function diamondStorage() internal pure returns (AppStorage storage ds) {
        assembly {
            ds.slot := 0
        }
    }
}

error CallerIsNotEditor();

contract Modifiers {
    AppStorage internal s;

    modifier onlyEditor() {
        if (!s._editors[msg.sender]) revert CallerIsNotEditor();
        _;
    }

    modifier onlyOwner() {
        LibDiamond.enforceIsContractOwner();
        _;
    }
}

File 3 of 6 : LibERC721.sol
// SPDX-License-Identifier: MIT
pragma solidity 0.8.13;

import "../interfaces/IERC721TokenReceiver.sol";

library LibERC721 {
    /// @dev This emits when ownership of any NFT changes by any mechanism.
    ///  This event emits when NFTs are created (`from` == 0) and destroyed
    ///  (`to` == 0). Exception: during contract creation, any number of NFTs
    ///  may be created and assigned without emitting Transfer. At the time of
    ///  any transfer, the approved address for that NFT (if any) is reset to none.
    event Transfer(address indexed _from, address indexed _to, uint256 indexed _tokenId);

    /// @dev This emits when the approved address for an NFT is changed or
    ///  reaffirmed. The zero address indicates there is no approved address.
    ///  When a Transfer event emits, this also indicates that the approved
    ///  address for that NFT (if any) is reset to none.
    event Approval(address indexed _owner, address indexed _approved, uint256 indexed _tokenId);

    /// @dev This emits when an operator is enabled or disabled for an owner.
    ///  The operator can manage all NFTs of the owner.
    event ApprovalForAll(address indexed _owner, address indexed _operator, bool _approved);

    bytes4 internal constant ERC721_RECEIVED = 0x150b7a02;

    function checkOnERC721Received(
        address _operator,
        address _from,
        address _to,
        uint256 _tokenId,
        bytes memory _data
    ) internal {
        uint256 size;
        assembly {
            size := extcodesize(_to)
        }
        if (size > 0) {
            require(
                ERC721_RECEIVED == IERC721TokenReceiver(_to).onERC721Received(_operator, _from, _tokenId, _data),
                "Transfer rejected/failed by _to"
            );
        }
    }
}

File 4 of 6 : LibDiamond.sol
// SPDX-License-Identifier: MIT
pragma solidity 0.8.13;

/******************************************************************************\
* Author: Nick Mudge <[email protected]> (https://twitter.com/mudgen)
* EIP-2535 Diamonds: https://eips.ethereum.org/EIPS/eip-2535
/******************************************************************************/
import { IDiamondCut } from "../interfaces/IDiamondCut.sol";

library LibDiamond {
    bytes32 constant DIAMOND_STORAGE_POSITION = keccak256("diamond.standard.diamond.storage");

    struct DiamondStorage {
        // maps function selectors to the facets that execute the functions.
        // and maps the selectors to their position in the selectorSlots array.
        // func selector => address facet, selector position
        mapping(bytes4 => bytes32) facets;
        // array of slots of function selectors.
        // each slot holds 8 function selectors.
        mapping(uint256 => bytes32) selectorSlots;
        // The number of function selectors in selectorSlots
        uint16 selectorCount;
        // Used to query if a contract implements an interface.
        // Used to implement ERC-165.
        mapping(bytes4 => bool) supportedInterfaces;
        // owner of the contract
        address contractOwner;
    }

    function diamondStorage() internal pure returns (DiamondStorage storage ds) {
        bytes32 position = DIAMOND_STORAGE_POSITION;
        assembly {
            ds.slot := position
        }
    }

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

    function setContractOwner(address _newOwner) internal {
        DiamondStorage storage ds = diamondStorage();
        address previousOwner = ds.contractOwner;
        ds.contractOwner = _newOwner;
        emit OwnershipTransferred(previousOwner, _newOwner);
    }

    function contractOwner() internal view returns (address contractOwner_) {
        contractOwner_ = diamondStorage().contractOwner;
    }

    function enforceIsContractOwner() internal view {
        require(msg.sender == diamondStorage().contractOwner, "LibDiamond: Must be contract owner");
    }

    event DiamondCut(IDiamondCut.FacetCut[] _diamondCut, address _init, bytes _calldata);

    bytes32 constant CLEAR_ADDRESS_MASK = bytes32(uint256(0xffffffffffffffffffffffff));
    bytes32 constant CLEAR_SELECTOR_MASK = bytes32(uint256(0xffffffff << 224));

    // Internal function version of diamondCut
    // This code is almost the same as the external diamondCut,
    // except it is using 'Facet[] memory _diamondCut' instead of
    // 'Facet[] calldata _diamondCut'.
    // The code is duplicated to prevent copying calldata to memory which
    // causes an error for a two dimensional array.
    function diamondCut(
        IDiamondCut.FacetCut[] memory _diamondCut,
        address _init,
        bytes memory _calldata
    ) internal {
        DiamondStorage storage ds = diamondStorage();
        uint256 originalSelectorCount = ds.selectorCount;
        uint256 selectorCount = originalSelectorCount;
        bytes32 selectorSlot;
        // Check if last selector slot is not full
        // "selectorCount & 7" is a gas efficient modulo by eight "selectorCount % 8" 
        if (selectorCount & 7 > 0) {
            // get last selectorSlot
            // "selectorSlot >> 3" is a gas efficient division by 8 "selectorSlot / 8"
            selectorSlot = ds.selectorSlots[selectorCount >> 3];
        }
        // loop through diamond cut
        for (uint256 facetIndex; facetIndex < _diamondCut.length; facetIndex++) {
            (selectorCount, selectorSlot) = addReplaceRemoveFacetSelectors(
                selectorCount,
                selectorSlot,
                _diamondCut[facetIndex].facetAddress,
                _diamondCut[facetIndex].action,
                _diamondCut[facetIndex].functionSelectors
            );
        }
        if (selectorCount != originalSelectorCount) {
            ds.selectorCount = uint16(selectorCount);
        }
        // If last selector slot is not full
        // "selectorCount & 7" is a gas efficient modulo by eight "selectorCount % 8" 
        if (selectorCount & 7 > 0) {
            // "selectorSlot >> 3" is a gas efficient division by 8 "selectorSlot / 8"
            ds.selectorSlots[selectorCount >> 3] = selectorSlot;
        }
        emit DiamondCut(_diamondCut, _init, _calldata);
        initializeDiamondCut(_init, _calldata);
    }

    function addReplaceRemoveFacetSelectors(
        uint256 _selectorCount,
        bytes32 _selectorSlot,
        address _newFacetAddress,
        IDiamondCut.FacetCutAction _action,
        bytes4[] memory _selectors
    ) internal returns (uint256, bytes32) {
        DiamondStorage storage ds = diamondStorage();
        require(_selectors.length > 0, "LibDiamondCut: No selectors in facet to cut");
        if (_action == IDiamondCut.FacetCutAction.Add) {
            enforceHasContractCode(_newFacetAddress, "LibDiamondCut: Add facet has no code");
            for (uint256 selectorIndex; selectorIndex < _selectors.length; selectorIndex++) {
                bytes4 selector = _selectors[selectorIndex];
                bytes32 oldFacet = ds.facets[selector];
                require(address(bytes20(oldFacet)) == address(0), "LibDiamondCut: Can't add function that already exists");
                // add facet for selector
                ds.facets[selector] = bytes20(_newFacetAddress) | bytes32(_selectorCount);
                // "_selectorCount & 7" is a gas efficient modulo by eight "_selectorCount % 8" 
                uint256 selectorInSlotPosition = (_selectorCount & 7) << 5;
                // clear selector position in slot and add selector
                _selectorSlot = (_selectorSlot & ~(CLEAR_SELECTOR_MASK >> selectorInSlotPosition)) | (bytes32(selector) >> selectorInSlotPosition);
                // if slot is full then write it to storage
                if (selectorInSlotPosition == 224) {
                    // "_selectorSlot >> 3" is a gas efficient division by 8 "_selectorSlot / 8"
                    ds.selectorSlots[_selectorCount >> 3] = _selectorSlot;
                    _selectorSlot = 0;
                }
                _selectorCount++;
            }
        } else if (_action == IDiamondCut.FacetCutAction.Replace) {
            enforceHasContractCode(_newFacetAddress, "LibDiamondCut: Replace facet has no code");
            for (uint256 selectorIndex; selectorIndex < _selectors.length; selectorIndex++) {
                bytes4 selector = _selectors[selectorIndex];
                bytes32 oldFacet = ds.facets[selector];
                address oldFacetAddress = address(bytes20(oldFacet));
                // only useful if immutable functions exist
                require(oldFacetAddress != address(this), "LibDiamondCut: Can't replace immutable function");
                require(oldFacetAddress != _newFacetAddress, "LibDiamondCut: Can't replace function with same function");
                require(oldFacetAddress != address(0), "LibDiamondCut: Can't replace function that doesn't exist");
                // replace old facet address
                ds.facets[selector] = (oldFacet & CLEAR_ADDRESS_MASK) | bytes20(_newFacetAddress);
            }
        } else if (_action == IDiamondCut.FacetCutAction.Remove) {
            require(_newFacetAddress == address(0), "LibDiamondCut: Remove facet address must be address(0)");
            // "_selectorCount >> 3" is a gas efficient division by 8 "_selectorCount / 8"
            uint256 selectorSlotCount = _selectorCount >> 3;
            // "_selectorCount & 7" is a gas efficient modulo by eight "_selectorCount % 8" 
            uint256 selectorInSlotIndex = _selectorCount & 7;
            for (uint256 selectorIndex; selectorIndex < _selectors.length; selectorIndex++) {
                if (_selectorSlot == 0) {
                    // get last selectorSlot
                    selectorSlotCount--;
                    _selectorSlot = ds.selectorSlots[selectorSlotCount];
                    selectorInSlotIndex = 7;
                } else {
                    selectorInSlotIndex--;
                }
                bytes4 lastSelector;
                uint256 oldSelectorsSlotCount;
                uint256 oldSelectorInSlotPosition;
                // adding a block here prevents stack too deep error
                {
                    bytes4 selector = _selectors[selectorIndex];
                    bytes32 oldFacet = ds.facets[selector];
                    require(address(bytes20(oldFacet)) != address(0), "LibDiamondCut: Can't remove function that doesn't exist");
                    // only useful if immutable functions exist
                    require(address(bytes20(oldFacet)) != address(this), "LibDiamondCut: Can't remove immutable function");
                    // replace selector with last selector in ds.facets
                    // gets the last selector
                    lastSelector = bytes4(_selectorSlot << (selectorInSlotIndex << 5));
                    if (lastSelector != selector) {
                        // update last selector slot position info
                        ds.facets[lastSelector] = (oldFacet & CLEAR_ADDRESS_MASK) | bytes20(ds.facets[lastSelector]);
                    }
                    delete ds.facets[selector];
                    uint256 oldSelectorCount = uint16(uint256(oldFacet));
                    // "oldSelectorCount >> 3" is a gas efficient division by 8 "oldSelectorCount / 8"
                    oldSelectorsSlotCount = oldSelectorCount >> 3;
                    // "oldSelectorCount & 7" is a gas efficient modulo by eight "oldSelectorCount % 8" 
                    oldSelectorInSlotPosition = (oldSelectorCount & 7) << 5;
                }
                if (oldSelectorsSlotCount != selectorSlotCount) {
                    bytes32 oldSelectorSlot = ds.selectorSlots[oldSelectorsSlotCount];
                    // clears the selector we are deleting and puts the last selector in its place.
                    oldSelectorSlot =
                        (oldSelectorSlot & ~(CLEAR_SELECTOR_MASK >> oldSelectorInSlotPosition)) |
                        (bytes32(lastSelector) >> oldSelectorInSlotPosition);
                    // update storage with the modified slot
                    ds.selectorSlots[oldSelectorsSlotCount] = oldSelectorSlot;
                } else {
                    // clears the selector we are deleting and puts the last selector in its place.
                    _selectorSlot =
                        (_selectorSlot & ~(CLEAR_SELECTOR_MASK >> oldSelectorInSlotPosition)) |
                        (bytes32(lastSelector) >> oldSelectorInSlotPosition);
                }
                if (selectorInSlotIndex == 0) {
                    delete ds.selectorSlots[selectorSlotCount];
                    _selectorSlot = 0;
                }
            }
            _selectorCount = selectorSlotCount * 8 + selectorInSlotIndex;
        } else {
            revert("LibDiamondCut: Incorrect FacetCutAction");
        }
        return (_selectorCount, _selectorSlot);
    }

    function initializeDiamondCut(address _init, bytes memory _calldata) internal {
        if (_init == address(0)) {
            require(_calldata.length == 0, "LibDiamondCut: _init is address(0) but_calldata is not empty");
        } else {
            require(_calldata.length > 0, "LibDiamondCut: _calldata is empty but _init is not address(0)");
            if (_init != address(this)) {
                enforceHasContractCode(_init, "LibDiamondCut: _init address has no code");
            }
            (bool success, bytes memory error) = _init.delegatecall(_calldata);
            if (!success) {
                if (error.length > 0) {
                    // bubble up the error
                    revert(string(error));
                } else {
                    revert("LibDiamondCut: _init function reverted");
                }
            }
        }
    }

    function enforceHasContractCode(address _contract, string memory _errorMessage) internal view {
        uint256 contractSize;
        assembly {
            contractSize := extcodesize(_contract)
        }
        require(contractSize > 0, _errorMessage);
    }
}

File 5 of 6 : IDiamondCut.sol
// SPDX-License-Identifier: MIT
pragma solidity 0.8.13;

/******************************************************************************\
* Author: Nick Mudge <[email protected]> (https://twitter.com/mudgen)
* EIP-2535 Diamonds: https://eips.ethereum.org/EIPS/eip-2535
/******************************************************************************/

interface IDiamondCut {
    enum FacetCutAction {Add, Replace, Remove}
    // Add=0, Replace=1, Remove=2

    struct FacetCut {
        address facetAddress;
        FacetCutAction action;
        bytes4[] functionSelectors;
    }

    /// @notice Add/replace/remove any number of functions and optionally execute
    ///         a function with delegatecall
    /// @param _diamondCut Contains the facet addresses and function selectors
    /// @param _init The address of the contract or facet to execute _calldata
    /// @param _calldata A function call, including function selector and arguments
    ///                  _calldata is executed with delegatecall on _init
    function diamondCut(
        FacetCut[] calldata _diamondCut,
        address _init,
        bytes calldata _calldata
    ) external;

    event DiamondCut(FacetCut[] _diamondCut, address _init, bytes _calldata);
}

File 6 of 6 : IERC721TokenReceiver.sol
// SPDX-License-Identifier: MIT
pragma solidity 0.8.13;

/// @dev Note: the ERC-165 identifier for this interface is 0x150b7a02.
interface IERC721TokenReceiver {
    /// @notice Handle the receipt of an NFT
    /// @dev The ERC721 smart contract calls this function on the recipient
    ///  after a `transfer`. This function MAY throw to revert and reject the
    ///  transfer. Return of other than the magic value MUST result in the
    ///  transaction being reverted.
    ///  Note: the contract address is always the message sender.
    /// @param _operator The address which called `safeTransferFrom` function
    /// @param _from The address which previously owned the token
    /// @param _tokenId The NFT identifier which is being transferred
    /// @param _data Additional data with no specified format
    /// @return `bytes4(keccak256("onERC721Received(address,address,uint256,bytes)"))`
    ///  unless throwing
    function onERC721Received(
        address _operator,
        address _from,
        uint256 _tokenId,
        bytes calldata _data
    ) external returns (bytes4);
}

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

Contract Security Audit

Contract ABI

[{"inputs":[],"name":"CallerIsNotEditor","type":"error"},{"inputs":[],"name":"getMaxPerWallet","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"maxPerWalletFreeOpen","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"maxPerWalletPaidOpen","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"targetAddress","type":"address"},{"internalType":"uint16","name":"quantity","type":"uint16"}],"name":"mintMaxPerWalletFree","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"address","name":"targetAddress","type":"address"},{"internalType":"uint16","name":"quantity","type":"uint16"}],"name":"mintMaxPerWalletPaid","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"uint256","name":"maxPerWallet","type":"uint256"}],"name":"setMaxPerWallet","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bool","name":"newValue","type":"bool"}],"name":"setMaxPerWalletFreeOpen","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bool","name":"newValue","type":"bool"}],"name":"setMaxPerWalletPaidOpen","outputs":[],"stateMutability":"nonpayable","type":"function"}]

608060405234801561001057600080fd5b506110b0806100206000396000f3fe60806040526004361061007b5760003560e01c806373d63f9e1161004e57806373d63f9e1461012857806376b75e9314610153578063be641fbd1461016f578063e268e4d31461018b5761007b565b80633492292a146100805780633add4464146100ab57806344120fdf146100d45780636bbc4291146100fd575b600080fd5b34801561008c57600080fd5b506100956101b4565b6040516100a29190610a38565b60405180910390f35b3480156100b757600080fd5b506100d260048036038101906100cd9190610a84565b6101cd565b005b3480156100e057600080fd5b506100fb60048036038101906100f69190610a84565b610273565b005b34801561010957600080fd5b50610112610319565b60405161011f9190610aca565b60405180910390f35b34801561013457600080fd5b5061013d610325565b60405161014a9190610a38565b60405180910390f35b61016d60048036038101906101689190610b7d565b61033e565b005b61018960048036038101906101849190610b7d565b6104b4565b005b34801561019757600080fd5b506101b260048036038101906101ad9190610be9565b610680565b005b60008060170160009054906101000a900460ff16905090565b600060100160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16610253576040517f344e1b3700000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b80600060170160006101000a81548160ff02191690831515021790555050565b600060100160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff166102f9576040517f344e1b3700000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b80600060170160016101000a81548160ff02191690831515021790555050565b60008060180154905090565b60008060170160019054906101000a900460ff16905090565b600060170160019054906101000a900460ff16610390576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161038790610c99565b60405180910390fd5b6000601801546000600d0160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060000160009054906101000a900467ffffffffffffffff1667ffffffffffffffff161061043a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161043190610d05565b60405180910390fd5b6000600501548161ffff1660016000600801546104579190610d54565b6104619190610d88565b11156104a2576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161049990610e2a565b60405180910390fd5b6104b0828261ffff16610713565b5050565b600060170160009054906101000a900460ff16610506576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016104fd90610ebc565b60405180910390fd5b6000601801546000600d0160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060000160009054906101000a900467ffffffffffffffff1667ffffffffffffffff16106105b0576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016105a790610d05565b60405180910390fd5b8061ffff166000600401546105c59190610edc565b3414610606576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016105fd90610f82565b60405180910390fd5b6000600501548161ffff1660016000600801546106239190610d54565b61062d9190610d88565b111561066e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161066590610e2a565b60405180910390fd5b61067c828261ffff16610713565b5050565b600060100160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16610706576040517f344e1b3700000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b8060006018018190555050565b600080600801549050600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161161078b576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161078290610fee565b60405180910390fd5b600082116107ce576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016107c59061105a565b60405180910390fd5b6107db6000848385610a11565b816000600d0160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060000160008282829054906101000a900467ffffffffffffffff160192506101000a81548167ffffffffffffffff021916908367ffffffffffffffff160217905550816000600d0160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060000160088282829054906101000a900467ffffffffffffffff160192506101000a81548167ffffffffffffffff021916908367ffffffffffffffff160217905550826000600c01600083815260200190815260200160002060000160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550426000600c01600083815260200190815260200160002060000160146101000a81548167ffffffffffffffff021916908367ffffffffffffffff1602179055506000819050600083820190505b818060010192508573ffffffffffffffffffffffffffffffffffffffff16600073ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef60405160405180910390a480820361098a57816000600801819055505050610a0c6000848385610a17565b505050565b50505050565b50505050565b60008115159050919050565b610a3281610a1d565b82525050565b6000602082019050610a4d6000830184610a29565b92915050565b600080fd5b610a6181610a1d565b8114610a6c57600080fd5b50565b600081359050610a7e81610a58565b92915050565b600060208284031215610a9a57610a99610a53565b5b6000610aa884828501610a6f565b91505092915050565b6000819050919050565b610ac481610ab1565b82525050565b6000602082019050610adf6000830184610abb565b92915050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000610b1082610ae5565b9050919050565b610b2081610b05565b8114610b2b57600080fd5b50565b600081359050610b3d81610b17565b92915050565b600061ffff82169050919050565b610b5a81610b43565b8114610b6557600080fd5b50565b600081359050610b7781610b51565b92915050565b60008060408385031215610b9457610b93610a53565b5b6000610ba285828601610b2e565b9250506020610bb385828601610b68565b9150509250929050565b610bc681610ab1565b8114610bd157600080fd5b50565b600081359050610be381610bbd565b92915050565b600060208284031215610bff57610bfe610a53565b5b6000610c0d84828501610bd4565b91505092915050565b600082825260208201905092915050565b7f5075626c6963206d6178207065722077616c6c65742066726565206e6f74206f60008201527f70656e0000000000000000000000000000000000000000000000000000000000602082015250565b6000610c83602383610c16565b9150610c8e82610c27565b604082019050919050565b60006020820190508181036000830152610cb281610c76565b9050919050565b7f4d6178207065722077616c6c6574206d65740000000000000000000000000000600082015250565b6000610cef601283610c16565b9150610cfa82610cb9565b602082019050919050565b60006020820190508181036000830152610d1e81610ce2565b9050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b6000610d5f82610ab1565b9150610d6a83610ab1565b925082821015610d7d57610d7c610d25565b5b828203905092915050565b6000610d9382610ab1565b9150610d9e83610ab1565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff03821115610dd357610dd2610d25565b5b828201905092915050565b7f5175616e697479206d6f7265207468616e20617661696c61626c650000000000600082015250565b6000610e14601b83610c16565b9150610e1f82610dde565b602082019050919050565b60006020820190508181036000830152610e4381610e07565b9050919050565b7f5075626c6963206d6178207065722077616c6c65742070616964206e6f74206f60008201527f70656e0000000000000000000000000000000000000000000000000000000000602082015250565b6000610ea6602383610c16565b9150610eb182610e4a565b604082019050919050565b60006020820190508181036000830152610ed581610e99565b9050919050565b6000610ee782610ab1565b9150610ef283610ab1565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0483118215151615610f2b57610f2a610d25565b5b828202905092915050565b7f496e636f72726563742076616c75652073656e74000000000000000000000000600082015250565b6000610f6c601483610c16565b9150610f7782610f36565b602082019050919050565b60006020820190508181036000830152610f9b81610f5f565b9050919050565b7f5a65726f20616464726573730000000000000000000000000000000000000000600082015250565b6000610fd8600c83610c16565b9150610fe382610fa2565b602082019050919050565b6000602082019050818103600083015261100781610fcb565b9050919050565b7f5175616e74697479207a65726f00000000000000000000000000000000000000600082015250565b6000611044600d83610c16565b915061104f8261100e565b602082019050919050565b6000602082019050818103600083015261107381611037565b905091905056fea2646970667358221220a4c12200b25d2c572da1d2dd463ce03d0f0731afe35432cf5131731a99e5b90f64736f6c634300080d0033

Deployed Bytecode

0x60806040526004361061007b5760003560e01c806373d63f9e1161004e57806373d63f9e1461012857806376b75e9314610153578063be641fbd1461016f578063e268e4d31461018b5761007b565b80633492292a146100805780633add4464146100ab57806344120fdf146100d45780636bbc4291146100fd575b600080fd5b34801561008c57600080fd5b506100956101b4565b6040516100a29190610a38565b60405180910390f35b3480156100b757600080fd5b506100d260048036038101906100cd9190610a84565b6101cd565b005b3480156100e057600080fd5b506100fb60048036038101906100f69190610a84565b610273565b005b34801561010957600080fd5b50610112610319565b60405161011f9190610aca565b60405180910390f35b34801561013457600080fd5b5061013d610325565b60405161014a9190610a38565b60405180910390f35b61016d60048036038101906101689190610b7d565b61033e565b005b61018960048036038101906101849190610b7d565b6104b4565b005b34801561019757600080fd5b506101b260048036038101906101ad9190610be9565b610680565b005b60008060170160009054906101000a900460ff16905090565b600060100160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16610253576040517f344e1b3700000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b80600060170160006101000a81548160ff02191690831515021790555050565b600060100160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff166102f9576040517f344e1b3700000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b80600060170160016101000a81548160ff02191690831515021790555050565b60008060180154905090565b60008060170160019054906101000a900460ff16905090565b600060170160019054906101000a900460ff16610390576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161038790610c99565b60405180910390fd5b6000601801546000600d0160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060000160009054906101000a900467ffffffffffffffff1667ffffffffffffffff161061043a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161043190610d05565b60405180910390fd5b6000600501548161ffff1660016000600801546104579190610d54565b6104619190610d88565b11156104a2576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161049990610e2a565b60405180910390fd5b6104b0828261ffff16610713565b5050565b600060170160009054906101000a900460ff16610506576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016104fd90610ebc565b60405180910390fd5b6000601801546000600d0160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060000160009054906101000a900467ffffffffffffffff1667ffffffffffffffff16106105b0576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016105a790610d05565b60405180910390fd5b8061ffff166000600401546105c59190610edc565b3414610606576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016105fd90610f82565b60405180910390fd5b6000600501548161ffff1660016000600801546106239190610d54565b61062d9190610d88565b111561066e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161066590610e2a565b60405180910390fd5b61067c828261ffff16610713565b5050565b600060100160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16610706576040517f344e1b3700000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b8060006018018190555050565b600080600801549050600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161161078b576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161078290610fee565b60405180910390fd5b600082116107ce576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016107c59061105a565b60405180910390fd5b6107db6000848385610a11565b816000600d0160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060000160008282829054906101000a900467ffffffffffffffff160192506101000a81548167ffffffffffffffff021916908367ffffffffffffffff160217905550816000600d0160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060000160088282829054906101000a900467ffffffffffffffff160192506101000a81548167ffffffffffffffff021916908367ffffffffffffffff160217905550826000600c01600083815260200190815260200160002060000160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550426000600c01600083815260200190815260200160002060000160146101000a81548167ffffffffffffffff021916908367ffffffffffffffff1602179055506000819050600083820190505b818060010192508573ffffffffffffffffffffffffffffffffffffffff16600073ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef60405160405180910390a480820361098a57816000600801819055505050610a0c6000848385610a17565b505050565b50505050565b50505050565b60008115159050919050565b610a3281610a1d565b82525050565b6000602082019050610a4d6000830184610a29565b92915050565b600080fd5b610a6181610a1d565b8114610a6c57600080fd5b50565b600081359050610a7e81610a58565b92915050565b600060208284031215610a9a57610a99610a53565b5b6000610aa884828501610a6f565b91505092915050565b6000819050919050565b610ac481610ab1565b82525050565b6000602082019050610adf6000830184610abb565b92915050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000610b1082610ae5565b9050919050565b610b2081610b05565b8114610b2b57600080fd5b50565b600081359050610b3d81610b17565b92915050565b600061ffff82169050919050565b610b5a81610b43565b8114610b6557600080fd5b50565b600081359050610b7781610b51565b92915050565b60008060408385031215610b9457610b93610a53565b5b6000610ba285828601610b2e565b9250506020610bb385828601610b68565b9150509250929050565b610bc681610ab1565b8114610bd157600080fd5b50565b600081359050610be381610bbd565b92915050565b600060208284031215610bff57610bfe610a53565b5b6000610c0d84828501610bd4565b91505092915050565b600082825260208201905092915050565b7f5075626c6963206d6178207065722077616c6c65742066726565206e6f74206f60008201527f70656e0000000000000000000000000000000000000000000000000000000000602082015250565b6000610c83602383610c16565b9150610c8e82610c27565b604082019050919050565b60006020820190508181036000830152610cb281610c76565b9050919050565b7f4d6178207065722077616c6c6574206d65740000000000000000000000000000600082015250565b6000610cef601283610c16565b9150610cfa82610cb9565b602082019050919050565b60006020820190508181036000830152610d1e81610ce2565b9050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b6000610d5f82610ab1565b9150610d6a83610ab1565b925082821015610d7d57610d7c610d25565b5b828203905092915050565b6000610d9382610ab1565b9150610d9e83610ab1565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff03821115610dd357610dd2610d25565b5b828201905092915050565b7f5175616e697479206d6f7265207468616e20617661696c61626c650000000000600082015250565b6000610e14601b83610c16565b9150610e1f82610dde565b602082019050919050565b60006020820190508181036000830152610e4381610e07565b9050919050565b7f5075626c6963206d6178207065722077616c6c65742070616964206e6f74206f60008201527f70656e0000000000000000000000000000000000000000000000000000000000602082015250565b6000610ea6602383610c16565b9150610eb182610e4a565b604082019050919050565b60006020820190508181036000830152610ed581610e99565b9050919050565b6000610ee782610ab1565b9150610ef283610ab1565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0483118215151615610f2b57610f2a610d25565b5b828202905092915050565b7f496e636f72726563742076616c75652073656e74000000000000000000000000600082015250565b6000610f6c601483610c16565b9150610f7782610f36565b602082019050919050565b60006020820190508181036000830152610f9b81610f5f565b9050919050565b7f5a65726f20616464726573730000000000000000000000000000000000000000600082015250565b6000610fd8600c83610c16565b9150610fe382610fa2565b602082019050919050565b6000602082019050818103600083015261100781610fcb565b9050919050565b7f5175616e74697479207a65726f00000000000000000000000000000000000000600082015250565b6000611044600d83610c16565b915061104f8261100e565b602082019050919050565b6000602082019050818103600083015261107381611037565b905091905056fea2646970667358221220a4c12200b25d2c572da1d2dd463ce03d0f0731afe35432cf5131731a99e5b90f64736f6c634300080d0033

Block Transaction Difficulty Gas Used Reward
View All Blocks Produced

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

Validator Index Block Amount
View All Withdrawals

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

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.