Forkchoice Ethereum Mainnet

Address Contract Verified

Address 0x9f1AF2C36ca7Cb1575a8f9DdfeFFC53858Df5357
Balance 0 ETH
Nonce 1
Code Size 4174 bytes
Indexed Transactions 0
External Etherscan · Sourcify

Contract Bytecode

4174 bytes
0x608060405234801561000f575f5ffd5b50600436106100e5575f3560e01c80638da5cb5b11610088578063d5a44f8611610063578063d5a44f86146101ea578063e449f3411461024d578063f2fde38b14610260578063fc8f877914610273575f5ffd5b80638da5cb5b1461019f578063aeca9670146101b5578063bf0e5b95146101d7575f5ffd5b80635c975abb116100c35780635c975abb1461015a5780635eb5be8f14610171578063715018a61461018457806378868c2f1461018c575f5ffd5b80630fbf0a93146100e9578063399e557b146100fe5780634cbf21d11461011b575b5f5ffd5b6100fc6100f7366004610e2b565b610286565b005b61010862278d0081565b6040519081526020015b60405180910390f35b6101427f000000000000000000000000b19e9b010264c837820c9113843f82115d35317681565b6040516001600160a01b039091168152602001610112565b60015460ff165b6040519015158152602001610112565b61010861017f366004610e9c565b610616565b6100fc6106b2565b61010861019a366004610ec7565b6106c5565b60015461010090046001600160a01b0316610142565b6101616101c3366004610e9c565b60046020525f908152604090205460ff1681565b6100fc6101e5366004610e2b565b6106f0565b6102256101f8366004610e9c565b60026020525f908152604090205467ffffffffffffffff811690600160401b90046001600160a01b031682565b6040805167ffffffffffffffff90931683526001600160a01b03909116602083015201610112565b6100fc61025b366004610e2b565b6108cf565b6100fc61026e366004610ef1565b610b7c565b610161610281366004610e9c565b610bbe565b61028e610c28565b610296610c7f565b5f8190036102b757604051631f2a200560e01b815260040160405180910390fd5b5f5b81811015610449575f8383838181106102d4576102d4610f0c565b602090810292909201355f818152600290935260409092205491925050600160401b90046001600160a01b03161561031f57604051630ae3514d60e01b815260040160405180910390fd5b6040516331a9108f60e11b81526004810182905233906001600160a01b037f000000000000000000000000b19e9b010264c837820c9113843f82115d3531761690636352211e90602401602060405180830381865afa158015610384573d5f5f3e3d5ffd5b505050506040513d601f19601f820116820180604052508101906103a89190610f20565b6001600160a01b0316146103cf576040516330cd747160e01b815260040160405180910390fd5b60408051808201825267ffffffffffffffff42811682523360208084018281525f878152600283528681209551865492516001600160a01b0316600160401b026001600160e01b031990931695169490941717909355815260038252918220805460018181018355918452919092200191909155016102b9565b507f000000000000000000000000b19e9b010264c837820c9113843f82115d3531766001600160a01b03166323b872dd333085855f81811061048d5761048d610f0c565b6040516001600160e01b031960e088901b1681526001600160a01b039586166004820152949093166024850152506020909102013560448201526064015f604051808303815f87803b1580156104e1575f5ffd5b505af11580156104f3573d5f5f3e3d5ffd5b505050600182111590506105c65760015b818110156105c4577f000000000000000000000000b19e9b010264c837820c9113843f82115d3531766001600160a01b03166323b872dd333086868681811061054f5761054f610f0c565b6040516001600160e01b031960e088901b1681526001600160a01b039586166004820152949093166024850152506020909102013560448201526064015f604051808303815f87803b1580156105a3575f5ffd5b505af11580156105b5573d5f5f3e3d5ffd5b50505050806001019050610504565b505b336001600160a01b03167f134b166c6094cc1ccbf1e3353ce5c3cd9fd29869051bdb999895854d77cc5ef68383604051610601929190610f84565b60405180910390a261061260015f55565b5050565b5f81815260026020908152604080832081518083019092525467ffffffffffffffff81168252600160401b90046001600160a01b0316918101829052901580610678575080516106749062278d009067ffffffffffffffff16610fb3565b4210155b1561068557505f92915050565b805142906106a19062278d009067ffffffffffffffff16610fb3565b6106ab9190610fcc565b9392505050565b6106ba610cd2565b6106c35f610d05565b565b6003602052815f5260405f2081815481106106de575f80fd5b905f5260205f20015f91509150505481565b6106f8610c28565b5f81900361071957604051631f2a200560e01b815260040160405180910390fd5b5f5b818110156107ce575f83838381811061073657610736610f0c565b602090810292909201355f8181526002845260409081902081518083019092525467ffffffffffffffff81168252600160401b90046001600160a01b0316938101849052909350913314905061079f576040516330cd747160e01b815260040160405180910390fd5b5f82815260026020526040902080546001600160e01b03191690556107c43383610d6b565b505060010161071b565b505f5b81811015610891577f000000000000000000000000b19e9b010264c837820c9113843f82115d3531766001600160a01b03166323b872dd303386868681811061081c5761081c610f0c565b6040516001600160e01b031960e088901b1681526001600160a01b039586166004820152949093166024850152506020909102013560448201526064015f604051808303815f87803b158015610870575f5ffd5b505af1158015610882573d5f5f3e3d5ffd5b505050508060010190506107d1565b50336001600160a01b03167fe9772f5cf0f7d78eab7beeb82cba02b00fdbab34ea285fbf4894a2dfc28b714f83835f60405161060193929190610fdf565b6108d7610c28565b5f8190036108f857604051631f2a200560e01b815260040160405180910390fd5b60015f5b828110156109d4575f84848381811061091757610917610f0c565b602090810292909201355f8181526002845260409081902081518083019092525467ffffffffffffffff81168252600160401b90046001600160a01b03169381018490529093509133149050610980576040516330cd747160e01b815260040160405180910390fd5b805161099a9062278d009067ffffffffffffffff16610fb3565b4210156109a5575f93505b5f82815260026020526040902080546001600160e01b03191690556109ca3383610d6b565b50506001016108fc565b508015610a6a575f5b82811015610a68575f8484838181106109f8576109f8610f0c565b602090810292909201355f81815260049093526040909220549192505060ff16610a5f575f81815260046020526040808220805460ff1916600117905551829133917ffac6e8638297c8dfdba6b60540c8b7d200c5318e539b96271e68145a385e152c9190a35b506001016109dd565b505b5f5b82811015610b2c577f000000000000000000000000b19e9b010264c837820c9113843f82115d3531766001600160a01b03166323b872dd3033878786818110610ab757610ab7610f0c565b6040516001600160e01b031960e088901b1681526001600160a01b039586166004820152949093166024850152506020909102013560448201526064015f604051808303815f87803b158015610b0b575f5ffd5b505af1158015610b1d573d5f5f3e3d5ffd5b50505050806001019050610a6c565b50336001600160a01b03167fe9772f5cf0f7d78eab7beeb82cba02b00fdbab34ea285fbf4894a2dfc28b714f848484604051610b6a93929190610fdf565b60405180910390a25061061260015f55565b610b84610cd2565b6001600160a01b038116610bb257604051631e4fbdf760e01b81525f60048201526024015b60405180910390fd5b610bbb81610d05565b50565b5f81815260026020908152604080832081518083019092525467ffffffffffffffff81168252600160401b90046001600160a01b031691810182905290158015906106ab57508051610c1e9062278d009067ffffffffffffffff16610fb3565b4210159392505050565b60025f5403610c795760405162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c006044820152606401610ba9565b60025f55565b60015460ff16156106c35760405162461bcd60e51b815260206004820152601060248201527f5061757361626c653a20706175736564000000000000000000000000000000006044820152606401610ba9565b6001546001600160a01b036101009091041633146106c35760405163118cdaa760e01b8152336004820152602401610ba9565b600180546001600160a01b0383811661010081810274ffffffffffffffffffffffffffffffffffffffff001985161790945560405193909204169182907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0905f90a35050565b6001600160a01b0382165f908152600360205260408120905b8154811015610e255782828281548110610da057610da0610f0c565b905f5260205f20015403610e1d5781548290610dbe90600190610fcc565b81548110610dce57610dce610f0c565b905f5260205f200154828281548110610de957610de9610f0c565b905f5260205f20018190555081805480610e0557610e05611004565b600190038181905f5260205f20015f90559055610e25565b600101610d84565b50505050565b5f5f60208385031215610e3c575f5ffd5b823567ffffffffffffffff811115610e52575f5ffd5b8301601f81018513610e62575f5ffd5b803567ffffffffffffffff811115610e78575f5ffd5b8560208260051b8401011115610e8c575f5ffd5b6020919091019590945092505050565b5f60208284031215610eac575f5ffd5b5035919050565b6001600160a01b0381168114610bbb575f5ffd5b5f5f60408385031215610ed8575f5ffd5b8235610ee381610eb3565b946020939093013593505050565b5f60208284031215610f01575f5ffd5b81356106ab81610eb3565b634e487b7160e01b5f52603260045260245ffd5b5f60208284031215610f30575f5ffd5b81516106ab81610eb3565b8183525f7f07ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff831115610f6b575f5ffd5b8260051b80836020870137939093016020019392505050565b602081525f610f97602083018486610f3b565b949350505050565b634e487b7160e01b5f52601160045260245ffd5b80820180821115610fc657610fc6610f9f565b92915050565b81810381811115610fc657610fc6610f9f565b604081525f610ff2604083018587610f3b565b90508215156020830152949350505050565b634e487b7160e01b5f52603160045260245ffdfea26469706673582212203de09494cf99fe7d9522f9e872c22fef8ef524399985672b09fe95942c35524564736f6c634300081e0033

Verified Source Code Full Match

Compiler: v0.8.30+commit.73712a01 EVM: prague Optimization: Yes (555 runs)
Incubators.sol 140 lines
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.30;

import "@openzeppelin/contracts/security/ReentrancyGuard.sol";
import "@openzeppelin/contracts/security/Pausable.sol";
import "@openzeppelin/contracts/access/Ownable.sol";
import "erc721a/contracts/interfaces/IERC721A.sol";

contract Incubator is ReentrancyGuard, Pausable, Ownable {
    IERC721A public immutable poopers;

    uint256 public constant INCUBATION_PERIOD = 30 days;  

    struct Stake {
        uint64 stakeTimestamp;
        address owner;
    }

    mapping(uint256 => Stake) public stakes;
    mapping(address => uint256[]) public stakedTokensOf;

    mapping(uint256 => bool) public hasCompletedIncubation;

    event Staked(address indexed user, uint256[] tokenIds);
    event Unstaked(address indexed user, uint256[] tokenIds, bool incubated);
    event Incubated(address indexed user, uint256 indexed tokenId);  
    event IncubationPeriodUpdated(uint256 newPeriod);

    error NotOwner();
    error AlreadyStaked();
    error NotStaked();
    error ZeroAmount();

    constructor(address _poopers) Ownable(msg.sender) {
        poopers = IERC721A(_poopers);
    }

    function stake(uint256[] calldata tokenIds) external nonReentrant whenNotPaused {
        if (tokenIds.length == 0) revert ZeroAmount();

        for (uint256 i = 0; i < tokenIds.length; ++i) {
            uint256 tokenId = tokenIds[i];
            if (stakes[tokenId].owner != address(0)) revert AlreadyStaked();
            if (poopers.ownerOf(tokenId) != msg.sender) revert NotOwner();

            stakes[tokenId] = Stake(uint64(block.timestamp), msg.sender);
            stakedTokensOf[msg.sender].push(tokenId);
        }

        poopers.transferFrom(msg.sender, address(this), tokenIds[0]);
        if (tokenIds.length > 1) {
            for (uint256 i = 1; i < tokenIds.length; ++i) {
                poopers.transferFrom(msg.sender, address(this), tokenIds[i]);
            }
        }

        emit Staked(msg.sender, tokenIds);
    }

    function unstake(uint256[] calldata tokenIds) external nonReentrant {
        if (tokenIds.length == 0) revert ZeroAmount();

        bool incubated = true;

        for (uint256 i = 0; i < tokenIds.length; ++i) {
            uint256 tokenId = tokenIds[i];
            Stake memory st = stakes[tokenId];

            if (st.owner != msg.sender) revert NotOwner();

            if (block.timestamp < st.stakeTimestamp + INCUBATION_PERIOD) {
                incubated = false;
            }

            delete stakes[tokenId];
            _removeTokenFromArray(msg.sender, tokenId);
        }

        // ←←← PERMANENT RECORD IF FULLY INCUBATED
        if (incubated) {
            for (uint256 i = 0; i < tokenIds.length; ++i) {
                uint256 tokenId = tokenIds[i];
                if (!hasCompletedIncubation[tokenId]) {
                    hasCompletedIncubation[tokenId] = true;
                    emit Incubated(msg.sender, tokenId);
                }
            }
        }

        
        for (uint256 i = 0; i < tokenIds.length; ++i) {
            poopers.transferFrom(address(this), msg.sender, tokenIds[i]);
        }

        emit Unstaked(msg.sender, tokenIds, incubated);
    }

    function emergencyUnstake(uint256[] calldata tokenIds) external nonReentrant {
        if (tokenIds.length == 0) revert ZeroAmount();

        for (uint256 i = 0; i < tokenIds.length; ++i) {
            uint256 tokenId = tokenIds[i];
            Stake memory st = stakes[tokenId];
            if (st.owner != msg.sender) revert NotOwner();

            delete stakes[tokenId];
            _removeTokenFromArray(msg.sender, tokenId);
        }

        for (uint256 i = 0; i < tokenIds.length; ++i) {
            poopers.transferFrom(address(this), msg.sender, tokenIds[i]);
        }

        emit Unstaked(msg.sender, tokenIds, false);
    }

    // View functions
    function isIncubated(uint256 tokenId) external view returns (bool) {
        Stake memory st = stakes[tokenId];
        return st.owner != address(0) && block.timestamp >= st.stakeTimestamp + INCUBATION_PERIOD;
    }

    function timeUntilIncubationComplete(uint256 tokenId) external view returns (uint256) {
        Stake memory st = stakes[tokenId];
        if (st.owner == address(0) || block.timestamp >= st.stakeTimestamp + INCUBATION_PERIOD) return 0;
        return st.stakeTimestamp + INCUBATION_PERIOD - block.timestamp;
    }

    function _removeTokenFromArray(address user, uint256 tokenId) internal {
        uint256[] storage tokens = stakedTokensOf[user];
        for (uint256 i = 0; i < tokens.length; ++i) {
            if (tokens[i] == tokenId) {
                tokens[i] = tokens[tokens.length - 1];
                tokens.pop();
                break;
            }
        }
    }

}
IERC721A.sol 7 lines
// SPDX-License-Identifier: MIT
// ERC721A Contracts v4.3.0
// Creator: Chiru Labs

pragma solidity ^0.8.4;

import '../IERC721A.sol';
Ownable.sol 100 lines
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (access/Ownable.sol)

pragma solidity ^0.8.20;

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

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

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

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

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

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

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

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

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

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

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

    /**
     * @dev Transfers ownership of the contract to a new account (`newOwner`).
     * Internal function without access restriction.
     */
    function _transferOwnership(address newOwner) internal virtual {
        address oldOwner = _owner;
        _owner = newOwner;
        emit OwnershipTransferred(oldOwner, newOwner);
    }
}
Pausable.sol 105 lines
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.7.0) (security/Pausable.sol)

pragma solidity ^0.8.0;

import "../utils/Context.sol";

/**
 * @dev Contract module which allows children to implement an emergency stop
 * mechanism that can be triggered by an authorized account.
 *
 * This module is used through inheritance. It will make available the
 * modifiers `whenNotPaused` and `whenPaused`, which can be applied to
 * the functions of your contract. Note that they will not be pausable by
 * simply including this module, only once the modifiers are put in place.
 */
abstract contract Pausable is Context {
    /**
     * @dev Emitted when the pause is triggered by `account`.
     */
    event Paused(address account);

    /**
     * @dev Emitted when the pause is lifted by `account`.
     */
    event Unpaused(address account);

    bool private _paused;

    /**
     * @dev Initializes the contract in unpaused state.
     */
    constructor() {
        _paused = false;
    }

    /**
     * @dev Modifier to make a function callable only when the contract is not paused.
     *
     * Requirements:
     *
     * - The contract must not be paused.
     */
    modifier whenNotPaused() {
        _requireNotPaused();
        _;
    }

    /**
     * @dev Modifier to make a function callable only when the contract is paused.
     *
     * Requirements:
     *
     * - The contract must be paused.
     */
    modifier whenPaused() {
        _requirePaused();
        _;
    }

    /**
     * @dev Returns true if the contract is paused, and false otherwise.
     */
    function paused() public view virtual returns (bool) {
        return _paused;
    }

    /**
     * @dev Throws if the contract is paused.
     */
    function _requireNotPaused() internal view virtual {
        require(!paused(), "Pausable: paused");
    }

    /**
     * @dev Throws if the contract is not paused.
     */
    function _requirePaused() internal view virtual {
        require(paused(), "Pausable: not paused");
    }

    /**
     * @dev Triggers stopped state.
     *
     * Requirements:
     *
     * - The contract must not be paused.
     */
    function _pause() internal virtual whenNotPaused {
        _paused = true;
        emit Paused(_msgSender());
    }

    /**
     * @dev Returns to normal state.
     *
     * Requirements:
     *
     * - The contract must be paused.
     */
    function _unpause() internal virtual whenPaused {
        _paused = false;
        emit Unpaused(_msgSender());
    }
}
ReentrancyGuard.sol 77 lines
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.0) (security/ReentrancyGuard.sol)

pragma solidity ^0.8.0;

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

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

    uint256 private _status;

    constructor() {
        _status = _NOT_ENTERED;
    }

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

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

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

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

    /**
     * @dev Returns true if the reentrancy guard is currently set to "entered", which indicates there is a
     * `nonReentrant` function in the call stack.
     */
    function _reentrancyGuardEntered() internal view returns (bool) {
        return _status == _ENTERED;
    }
}
IERC721A.sol 307 lines
// SPDX-License-Identifier: MIT
// ERC721A Contracts v4.3.0
// Creator: Chiru Labs

pragma solidity ^0.8.4;

/**
 * @dev Interface of ERC721A.
 */
interface IERC721A {
    /**
     * The caller must own the token or be an approved operator.
     */
    error ApprovalCallerNotOwnerNorApproved();

    /**
     * The token does not exist.
     */
    error ApprovalQueryForNonexistentToken();

    /**
     * Cannot query the balance for the zero address.
     */
    error BalanceQueryForZeroAddress();

    /**
     * Cannot mint to the zero address.
     */
    error MintToZeroAddress();

    /**
     * The quantity of tokens minted must be more than zero.
     */
    error MintZeroQuantity();

    /**
     * The token does not exist.
     */
    error OwnerQueryForNonexistentToken();

    /**
     * The caller must own the token or be an approved operator.
     */
    error TransferCallerNotOwnerNorApproved();

    /**
     * The token must be owned by `from`.
     */
    error TransferFromIncorrectOwner();

    /**
     * Cannot safely transfer to a contract that does not implement the
     * ERC721Receiver interface.
     */
    error TransferToNonERC721ReceiverImplementer();

    /**
     * Cannot transfer to the zero address.
     */
    error TransferToZeroAddress();

    /**
     * The token does not exist.
     */
    error URIQueryForNonexistentToken();

    /**
     * The `quantity` minted with ERC2309 exceeds the safety limit.
     */
    error MintERC2309QuantityExceedsLimit();

    /**
     * The `extraData` cannot be set on an unintialized ownership slot.
     */
    error OwnershipNotInitializedForExtraData();

    /**
     * `_sequentialUpTo()` must be greater than `_startTokenId()`.
     */
    error SequentialUpToTooSmall();

    /**
     * The `tokenId` of a sequential mint exceeds `_sequentialUpTo()`.
     */
    error SequentialMintExceedsLimit();

    /**
     * Spot minting requires a `tokenId` greater than `_sequentialUpTo()`.
     */
    error SpotMintTokenIdTooSmall();

    /**
     * Cannot mint over a token that already exists.
     */
    error TokenAlreadyExists();

    /**
     * The feature is not compatible with spot mints.
     */
    error NotCompatibleWithSpotMints();

    // =============================================================
    //                            STRUCTS
    // =============================================================

    struct TokenOwnership {
        // The address of the owner.
        address addr;
        // Stores the start time of ownership with minimal overhead for tokenomics.
        uint64 startTimestamp;
        // Whether the token has been burned.
        bool burned;
        // Arbitrary data similar to `startTimestamp` that can be set via {_extraData}.
        uint24 extraData;
    }

    // =============================================================
    //                         TOKEN COUNTERS
    // =============================================================

    /**
     * @dev Returns the total number of tokens in existence.
     * Burned tokens will reduce the count.
     * To get the total number of tokens minted, please see {_totalMinted}.
     */
    function totalSupply() external view returns (uint256);

    // =============================================================
    //                            IERC165
    // =============================================================

    /**
     * @dev Returns true if this contract implements the interface defined by
     * `interfaceId`. See the corresponding
     * [EIP section](https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified)
     * to learn more about how these ids are created.
     *
     * This function call must use less than 30000 gas.
     */
    function supportsInterface(bytes4 interfaceId) external view returns (bool);

    // =============================================================
    //                            IERC721
    // =============================================================

    /**
     * @dev Emitted when `tokenId` token is transferred from `from` to `to`.
     */
    event Transfer(address indexed from, address indexed to, uint256 indexed tokenId);

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

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

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

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

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

    /**
     * @dev Equivalent to `safeTransferFrom(from, to, tokenId, '')`.
     */
    function safeTransferFrom(
        address from,
        address to,
        uint256 tokenId
    ) external payable;

    /**
     * @dev Transfers `tokenId` from `from` to `to`.
     *
     * WARNING: Usage of this method is discouraged, use {safeTransferFrom}
     * whenever possible.
     *
     * Requirements:
     *
     * - `from` cannot be the zero address.
     * - `to` cannot be the zero address.
     * - `tokenId` token must be owned by `from`.
     * - If the caller is not `from`, it must be approved to move this token
     * by either {approve} or {setApprovalForAll}.
     *
     * Emits a {Transfer} event.
     */
    function transferFrom(
        address from,
        address to,
        uint256 tokenId
    ) external payable;

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

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

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

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

    // =============================================================
    //                        IERC721Metadata
    // =============================================================

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

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

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

    // =============================================================
    //                           IERC2309
    // =============================================================

    /**
     * @dev Emitted when tokens in `fromTokenId` to `toTokenId`
     * (inclusive) is transferred from `from` to `to`, as defined in the
     * [ERC2309](https://eips.ethereum.org/EIPS/eip-2309) standard.
     *
     * See {_mintERC2309} for more details.
     */
    event ConsecutiveTransfer(uint256 indexed fromTokenId, uint256 toTokenId, address indexed from, address indexed to);
}
Context.sol 28 lines
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.1) (utils/Context.sol)

pragma solidity ^0.8.20;

/**
 * @dev Provides information about the current execution context, including the
 * sender of the transaction and its data. While these are generally available
 * via msg.sender and msg.data, they should not be accessed in such a direct
 * manner, since when dealing with meta-transactions the account sending and
 * paying for execution may not be the actual sender (as far as an application
 * is concerned).
 *
 * This contract is only required for intermediate, library-like contracts.
 */
abstract contract Context {
    function _msgSender() internal view virtual returns (address) {
        return msg.sender;
    }

    function _msgData() internal view virtual returns (bytes calldata) {
        return msg.data;
    }

    function _contextSuffixLength() internal view virtual returns (uint256) {
        return 0;
    }
}

Read Contract

INCUBATION_PERIOD 0x399e557b → uint256
hasCompletedIncubation 0xaeca9670 → bool
isIncubated 0xfc8f8779 → bool
owner 0x8da5cb5b → address
paused 0x5c975abb → bool
poopers 0x4cbf21d1 → address
stakedTokensOf 0x78868c2f → uint256
stakes 0xd5a44f86 → uint64, address
timeUntilIncubationComplete 0x5eb5be8f → uint256

Write Contract 5 functions

These functions modify contract state and require a wallet transaction to execute.

emergencyUnstake 0xbf0e5b95
uint256[] tokenIds
renounceOwnership 0x715018a6
No parameters
stake 0x0fbf0a93
uint256[] tokenIds
transferOwnership 0xf2fde38b
address newOwner
unstake 0xe449f341
uint256[] tokenIds

Recent Transactions

No transactions found for this address