ETH Price: $1,793.93 (+13.28%)

Contract

0x4999fF160B954b1A678e814EFA88D6bAB90116d0

Overview

ETH Balance

0 ETH

ETH Value

$0.00

Multichain Info

No addresses found
Transaction Hash
Method
Block
From
To

There are no matching entries

> 10 Internal Transactions found.

Latest 25 internal transactions (View All)

Advanced mode:
Parent Transaction Hash Block From To
97558752022-04-13 18:51:421105 days ago1649875902
0x4999fF16...AB90116d0
0 ETH
97558562022-04-13 18:50:391105 days ago1649875839
0x4999fF16...AB90116d0
0 ETH
97558492022-04-13 18:50:391105 days ago1649875839
0x4999fF16...AB90116d0
0 ETH
97556492022-04-13 18:44:261105 days ago1649875466
0x4999fF16...AB90116d0
0 ETH
97556042022-04-13 18:43:241105 days ago1649875404
0x4999fF16...AB90116d0
0 ETH
97555002022-04-13 18:40:581105 days ago1649875258
0x4999fF16...AB90116d0
0 ETH
97553412022-04-13 18:35:051105 days ago1649874905
0x4999fF16...AB90116d0
0 ETH
97553352022-04-13 18:35:051105 days ago1649874905
0x4999fF16...AB90116d0
0 ETH
97551542022-04-13 18:30:211105 days ago1649874621
0x4999fF16...AB90116d0
0 ETH
97551542022-04-13 18:30:211105 days ago1649874621
0x4999fF16...AB90116d0
0 ETH
97550822022-04-13 18:27:261105 days ago1649874446
0x4999fF16...AB90116d0
0 ETH
97550252022-04-13 18:26:181105 days ago1649874378
0x4999fF16...AB90116d0
0 ETH
97549542022-04-13 18:24:181105 days ago1649874258
0x4999fF16...AB90116d0
0 ETH
97548972022-04-13 18:22:041105 days ago1649874124
0x4999fF16...AB90116d0
0 ETH
97548952022-04-13 18:22:041105 days ago1649874124
0x4999fF16...AB90116d0
0 ETH
97548942022-04-13 18:22:041105 days ago1649874124
0x4999fF16...AB90116d0
0 ETH
97548782022-04-13 18:22:041105 days ago1649874124
0x4999fF16...AB90116d0
0 ETH
97547612022-04-13 18:18:091105 days ago1649873889
0x4999fF16...AB90116d0
0 ETH
97545602022-04-13 18:12:371105 days ago1649873557
0x4999fF16...AB90116d0
0 ETH
97545602022-04-13 18:12:371105 days ago1649873557
0x4999fF16...AB90116d0
0 ETH
97545112022-04-13 18:10:111105 days ago1649873411
0x4999fF16...AB90116d0
0 ETH
97543972022-04-13 18:06:491105 days ago1649873209
0x4999fF16...AB90116d0
0 ETH
97543972022-04-13 18:06:491105 days ago1649873209
0x4999fF16...AB90116d0
0 ETH
97543862022-04-13 18:06:081105 days ago1649873168
0x4999fF16...AB90116d0
0 ETH
97543862022-04-13 18:06:081105 days ago1649873168
0x4999fF16...AB90116d0
0 ETH
View All Internal Transactions

Loading...
Loading

Contract Source Code Verified (Exact Match)

Contract Name:
SmolFarm

Compiler Version
v0.8.9+commit.e5eed63a

Optimization Enabled:
Yes with 200 runs

Other Settings:
default evmVersion
File 1 of 25 : SmolFarm.sol
//SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;

import "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol";
import "@openzeppelin/contracts-upgradeable/token/ERC1155/extensions/ERC1155BurnableUpgradeable.sol";

import "./ISmolFarm.sol";
import "./SmolFarmContracts.sol";

contract SmolFarm is Initializable, ISmolFarm, SmolFarmContracts {

    using EnumerableSetUpgradeable for EnumerableSetUpgradeable.UintSet;

    function initialize() external initializer {
        SmolFarmContracts.__SmolFarmContracts_init();
    }

    function setRewards(
        uint256[] calldata _rewardIds,
        uint32[] calldata _rewardOdds)
    external
    onlyAdminOrOwner
    nonZeroLength(_rewardIds)
    {
        require(_rewardIds.length == _rewardOdds.length, "Bad lengths");

        delete rewardOptions;

        uint32 _totalOdds;
        for(uint256 i = 0; i < _rewardIds.length; i++) {
            _totalOdds += _rewardOdds[i];

            rewardOptions.push(_rewardIds[i]);
            rewardIdToOdds[_rewardIds[i]] = _rewardOdds[i];
        }

        require(_totalOdds == 100000, "Bad total odds");
    }

    function stakeSmol(
        uint256[] calldata _brainsTokens,
        uint256[] calldata _bodiesTokens)
    external
    onlyEOA
    contractsAreSet
    whenNotPaused
    {
        require(_brainsTokens.length > 0 || _bodiesTokens.length > 0, "no tokens given");
        for(uint256 i = 0; i < _brainsTokens.length; i++) {
            _stakeSmol(smolBrains, _brainsTokens[i]);
        }
        for(uint256 i = 0; i < _bodiesTokens.length; i++) {
            _stakeSmol(smolBodies, _bodiesTokens[i]);
        }
    }

    function _stakeSmol(IERC721 smol, uint256 _tokenId) private {
        userToTokensStaked[address(smol)][msg.sender].add(_tokenId);

        tokenIdToStakeStartTime[address(smol)][_tokenId] = block.timestamp;

        emit SmolStaked(msg.sender, address(smol), _tokenId, block.timestamp);

        // will revert if user does not own token
        smol.safeTransferFrom(msg.sender, address(this), _tokenId);
    }

    function unstakeSmol(
        uint256[] calldata _brainsTokens,
        uint256[] calldata _bodiesTokens)
    external
    onlyEOA
    contractsAreSet
    whenNotPaused
    {
        require(_brainsTokens.length > 0 || _bodiesTokens.length > 0, "no tokens given");
        for(uint256 i = 0; i < _brainsTokens.length; i++) {
            _unstakeSmol(smolBrains, _brainsTokens[i]);
        }
        for(uint256 i = 0; i < _bodiesTokens.length; i++) {
            _unstakeSmol(smolBodies, _bodiesTokens[i]);
        }
    }

    function _unstakeSmol(IERC721 smol, uint256 _tokenId) private {
        require(userToTokensStaked[address(smol)][msg.sender].contains(_tokenId), "Not owned by user");
        require(tokenIdToRequestId[address(smol)][_tokenId] == 0, "Claim in progress");
        require(numberOfRewardsToClaim(address(smol), _tokenId) == 0, "Rewards left unclaimed!");

        userToTokensStaked[address(smol)][msg.sender].remove(_tokenId);

        delete tokenIdToStakeStartTime[address(smol)][_tokenId];
        delete tokenIdToRewardsClaimed[address(smol)][_tokenId];

        emit SmolUnstaked(msg.sender, address(smol), _tokenId);

        smol.safeTransferFrom(address(this), msg.sender, _tokenId);
    }

    function startClaimingRewards(
        uint256[] calldata _brainsTokens,
        uint256[] calldata _bodiesTokens)
    external
    onlyEOA
    contractsAreSet
    whenNotPaused
    {
        require(_brainsTokens.length > 0 || _bodiesTokens.length > 0, "no tokens given");
        for(uint256 i = 0; i < _brainsTokens.length; i++) {
           _startClaimingReward(smolBrains, _brainsTokens[i]);
        }
        for(uint256 i = 0; i < _bodiesTokens.length; i++) {
           _startClaimingReward(smolBodies, _bodiesTokens[i]);
        }
    }

    function _startClaimingReward(IERC721 smol, uint256 _tokenId) private {
        require(userToTokensStaked[address(smol)][msg.sender].contains(_tokenId), "Not owned by user");
        require(tokenIdToRequestId[address(smol)][_tokenId] == 0, "Claim in progress");

        uint256 _numberToClaim = numberOfRewardsToClaim(address(smol), _tokenId);
        require(_numberToClaim > 0, "No rewards to claim");

        tokenIdToRewardsClaimed[address(smol)][_tokenId] += _numberToClaim;
        tokenIdToRewardsInProgress[address(smol)][_tokenId] = _numberToClaim;

        uint256 _requestId = randomizer.requestRandomNumber();
        tokenIdToRequestId[address(smol)][_tokenId] = _requestId;

        emit StartClaiming(msg.sender, address(smol), _tokenId, _requestId, _numberToClaim);
    }

    function finishClaimingRewards(
        uint256[] calldata _brainsTokens,
        uint256[] calldata _bodiesTokens)
    external
    onlyEOA
    contractsAreSet
    whenNotPaused
    {
        require(_brainsTokens.length > 0 || _bodiesTokens.length > 0, "no tokens given");
        for(uint256 i = 0; i < _brainsTokens.length; i++) {
           _finishClaimingReward(smolBrains, _brainsTokens[i]);
        }
        for(uint256 i = 0; i < _bodiesTokens.length; i++) {
           _finishClaimingReward(smolBodies, _bodiesTokens[i]);
        }
    }

    function _finishClaimingReward(IERC721 smol, uint256 _tokenId) private {
        require(userToTokensStaked[address(smol)][msg.sender].contains(_tokenId), "Not owned by user");
        require(rewardOptions.length > 0, "Rewards not setup");

        uint256 _requestId = tokenIdToRequestId[address(smol)][_tokenId];
        require(_requestId != 0, "No claim in progress");

        require(randomizer.isRandomReady(_requestId), "Random not ready");

        uint256 _randomNumber = randomizer.revealRandomNumber(_requestId);

        uint256 _numberToClaim = tokenIdToRewardsInProgress[address(smol)][_tokenId];

        for(uint256 i = 0; i < _numberToClaim; i++) {
            if(i != 0) {
                _randomNumber = uint256(keccak256(abi.encode(_randomNumber, i)));
            }

            _claimReward(smol, _tokenId, _randomNumber);
        }

        delete tokenIdToRewardsInProgress[address(smol)][_tokenId];
        delete tokenIdToRequestId[address(smol)][_tokenId];
    }

    function _claimReward(IERC721 smol, uint256 _tokenId, uint256 _randomNumber) private {
        uint256 _rewardResult = _randomNumber % 100000;

        uint256 _topRange = 0;
        uint256 _claimedRewardId = 0;
        for(uint256 i = 0; i < rewardOptions.length; i++) {
            uint256 _rewardId = rewardOptions[i];
            _topRange += rewardIdToOdds[_rewardId];
            if(_rewardResult < _topRange) {
                _claimedRewardId = _rewardId;

                treasures.mint(msg.sender, _claimedRewardId, 1);

                break;
            }
        }

        emit RewardClaimed(msg.sender, address(smol), _tokenId, _claimedRewardId, 1);
    }

    function numberOfRewardsToClaim(address smolAddress, uint256 _tokenId) public view returns(uint256) {
        if(tokenIdToStakeStartTime[smolAddress][_tokenId] == 0) {
            return 0;
        }

        uint256 _timeForCalculation = tokenIdToStakeStartTime[smolAddress][_tokenId] + (tokenIdToRewardsClaimed[smolAddress][_tokenId] * _timeForReward);

        return (block.timestamp - _timeForCalculation) / _timeForReward;
    }

    function setTimeForReward(uint256 _rewardTime) external onlyAdminOrOwner {
        _timeForReward = _rewardTime;
    }

    function ownsToken(address _collection, address _owner, uint256 _tokenId) external view returns (bool) {
        return userToTokensStaked[_collection][_owner].contains(_tokenId);
    }

}

File 2 of 25 : Initializable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (proxy/utils/Initializable.sol)

pragma solidity ^0.8.0;

import "../../utils/AddressUpgradeable.sol";

/**
 * @dev This is a base contract to aid in writing upgradeable contracts, or any kind of contract that will be deployed
 * behind a proxy. Since a proxied contract can't have a constructor, it's common to move constructor logic to an
 * external initializer function, usually called `initialize`. It then becomes necessary to protect this initializer
 * function so it can only be called once. The {initializer} modifier provided by this contract will have this effect.
 *
 * TIP: To avoid leaving the proxy in an uninitialized state, the initializer function should be called as early as
 * possible by providing the encoded function call as the `_data` argument to {ERC1967Proxy-constructor}.
 *
 * CAUTION: When used with inheritance, manual care must be taken to not invoke a parent initializer twice, or to ensure
 * that all initializers are idempotent. This is not verified automatically as constructors are by Solidity.
 *
 * [CAUTION]
 * ====
 * Avoid leaving a contract uninitialized.
 *
 * An uninitialized contract can be taken over by an attacker. This applies to both a proxy and its implementation
 * contract, which may impact the proxy. To initialize the implementation contract, you can either invoke the
 * initializer manually, or you can include a constructor to automatically mark it as initialized when it is deployed:
 *
 * [.hljs-theme-light.nopadding]
 * ```
 * /// @custom:oz-upgrades-unsafe-allow constructor
 * constructor() initializer {}
 * ```
 * ====
 */
abstract contract Initializable {
    /**
     * @dev Indicates that the contract has been initialized.
     */
    bool private _initialized;

    /**
     * @dev Indicates that the contract is in the process of being initialized.
     */
    bool private _initializing;

    /**
     * @dev Modifier to protect an initializer function from being invoked twice.
     */
    modifier initializer() {
        // If the contract is initializing we ignore whether _initialized is set in order to support multiple
        // inheritance patterns, but we only do this in the context of a constructor, because in other contexts the
        // contract may have been reentered.
        require(_initializing ? _isConstructor() : !_initialized, "Initializable: contract is already initialized");

        bool isTopLevelCall = !_initializing;
        if (isTopLevelCall) {
            _initializing = true;
            _initialized = true;
        }

        _;

        if (isTopLevelCall) {
            _initializing = false;
        }
    }

    /**
     * @dev Modifier to protect an initialization function so that it can only be invoked by functions with the
     * {initializer} modifier, directly or indirectly.
     */
    modifier onlyInitializing() {
        require(_initializing, "Initializable: contract is not initializing");
        _;
    }

    function _isConstructor() private view returns (bool) {
        return !AddressUpgradeable.isContract(address(this));
    }
}

File 3 of 25 : ERC1155BurnableUpgradeable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (token/ERC1155/extensions/ERC1155Burnable.sol)

pragma solidity ^0.8.0;

import "../ERC1155Upgradeable.sol";
import "../../../proxy/utils/Initializable.sol";

/**
 * @dev Extension of {ERC1155} that allows token holders to destroy both their
 * own tokens and those that they have been approved to use.
 *
 * _Available since v3.1._
 */
abstract contract ERC1155BurnableUpgradeable is Initializable, ERC1155Upgradeable {
    function __ERC1155Burnable_init() internal onlyInitializing {
        __Context_init_unchained();
        __ERC165_init_unchained();
        __ERC1155Burnable_init_unchained();
    }

    function __ERC1155Burnable_init_unchained() internal onlyInitializing {
    }
    function burn(
        address account,
        uint256 id,
        uint256 value
    ) public virtual {
        require(
            account == _msgSender() || isApprovedForAll(account, _msgSender()),
            "ERC1155: caller is not owner nor approved"
        );

        _burn(account, id, value);
    }

    function burnBatch(
        address account,
        uint256[] memory ids,
        uint256[] memory values
    ) public virtual {
        require(
            account == _msgSender() || isApprovedForAll(account, _msgSender()),
            "ERC1155: caller is not owner nor approved"
        );

        _burnBatch(account, ids, values);
    }
    uint256[50] private __gap;
}

File 4 of 25 : ISmolFarm.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;


interface ISmolFarm {
}

File 5 of 25 : SmolFarmContracts.sol
//SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;

import "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol";

import "./SmolFarmState.sol";

abstract contract SmolFarmContracts is Initializable, SmolFarmState {

    function __SmolFarmContracts_init() internal initializer {
        SmolFarmState.__SmolFarmState_init();
    }

    function setContracts(
        address _treasures,
        address _smolBrains,
        address _smolBodies,
        address _smolLand,
        address _randomizer)
    external onlyAdminOrOwner
    {
        treasures = ISmolTreasures(_treasures);
        smolBrains = IERC721(_smolBrains);
        smolBodies = IERC721(_smolBodies);
        smolLand = IERC721(_smolLand);
        randomizer = IRandomizer(_randomizer);
    }

    modifier contractsAreSet() {
        require(address(treasures) != address(0)
            && address(randomizer) != address(0)
            && address(smolBrains) != address(0)
            && address(smolBodies) != address(0)
            && address(smolLand) != address(0), "Contracts aren't set");

        _;
    }
}

File 6 of 25 : AddressUpgradeable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (utils/Address.sol)

pragma solidity ^0.8.0;

/**
 * @dev Collection of functions related to the address type
 */
library AddressUpgradeable {
    /**
     * @dev Returns true if `account` is a contract.
     *
     * [IMPORTANT]
     * ====
     * It is unsafe to assume that an address for which this function returns
     * false is an externally-owned account (EOA) and not a contract.
     *
     * Among others, `isContract` will return false for the following
     * types of addresses:
     *
     *  - an externally-owned account
     *  - a contract in construction
     *  - an address where a contract will be created
     *  - an address where a contract lived, but was destroyed
     * ====
     */
    function isContract(address account) internal view returns (bool) {
        // This method relies on extcodesize, which returns 0 for contracts in
        // construction, since the code is only stored at the end of the
        // constructor execution.

        uint256 size;
        assembly {
            size := extcodesize(account)
        }
        return size > 0;
    }

    /**
     * @dev Replacement for Solidity's `transfer`: sends `amount` wei to
     * `recipient`, forwarding all available gas and reverting on errors.
     *
     * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost
     * of certain opcodes, possibly making contracts go over the 2300 gas limit
     * imposed by `transfer`, making them unable to receive funds via
     * `transfer`. {sendValue} removes this limitation.
     *
     * https://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more].
     *
     * IMPORTANT: because control is transferred to `recipient`, care must be
     * taken to not create reentrancy vulnerabilities. Consider using
     * {ReentrancyGuard} or the
     * https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].
     */
    function sendValue(address payable recipient, uint256 amount) internal {
        require(address(this).balance >= amount, "Address: insufficient balance");

        (bool success, ) = recipient.call{value: amount}("");
        require(success, "Address: unable to send value, recipient may have reverted");
    }

    /**
     * @dev Performs a Solidity function call using a low level `call`. A
     * plain `call` is an unsafe replacement for a function call: use this
     * function instead.
     *
     * If `target` reverts with a revert reason, it is bubbled up by this
     * function (like regular Solidity function calls).
     *
     * Returns the raw returned data. To convert to the expected return value,
     * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`].
     *
     * Requirements:
     *
     * - `target` must be a contract.
     * - calling `target` with `data` must not revert.
     *
     * _Available since v3.1._
     */
    function functionCall(address target, bytes memory data) internal returns (bytes memory) {
        return functionCall(target, data, "Address: low-level call failed");
    }

    /**
     * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with
     * `errorMessage` as a fallback revert reason when `target` reverts.
     *
     * _Available since v3.1._
     */
    function functionCall(
        address target,
        bytes memory data,
        string memory errorMessage
    ) internal returns (bytes memory) {
        return functionCallWithValue(target, data, 0, errorMessage);
    }

    /**
     * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
     * but also transferring `value` wei to `target`.
     *
     * Requirements:
     *
     * - the calling contract must have an ETH balance of at least `value`.
     * - the called Solidity function must be `payable`.
     *
     * _Available since v3.1._
     */
    function functionCallWithValue(
        address target,
        bytes memory data,
        uint256 value
    ) internal returns (bytes memory) {
        return functionCallWithValue(target, data, value, "Address: low-level call with value failed");
    }

    /**
     * @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but
     * with `errorMessage` as a fallback revert reason when `target` reverts.
     *
     * _Available since v3.1._
     */
    function functionCallWithValue(
        address target,
        bytes memory data,
        uint256 value,
        string memory errorMessage
    ) internal returns (bytes memory) {
        require(address(this).balance >= value, "Address: insufficient balance for call");
        require(isContract(target), "Address: call to non-contract");

        (bool success, bytes memory returndata) = target.call{value: value}(data);
        return verifyCallResult(success, returndata, errorMessage);
    }

    /**
     * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
     * but performing a static call.
     *
     * _Available since v3.3._
     */
    function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) {
        return functionStaticCall(target, data, "Address: low-level static call failed");
    }

    /**
     * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],
     * but performing a static call.
     *
     * _Available since v3.3._
     */
    function functionStaticCall(
        address target,
        bytes memory data,
        string memory errorMessage
    ) internal view returns (bytes memory) {
        require(isContract(target), "Address: static call to non-contract");

        (bool success, bytes memory returndata) = target.staticcall(data);
        return verifyCallResult(success, returndata, errorMessage);
    }

    /**
     * @dev Tool to verifies that a low level call was successful, and revert if it wasn't, either by bubbling the
     * revert reason using the provided one.
     *
     * _Available since v4.3._
     */
    function verifyCallResult(
        bool success,
        bytes memory returndata,
        string memory errorMessage
    ) internal pure returns (bytes memory) {
        if (success) {
            return returndata;
        } else {
            // Look for revert reason and bubble it up if present
            if (returndata.length > 0) {
                // The easiest way to bubble the revert reason is using memory via assembly

                assembly {
                    let returndata_size := mload(returndata)
                    revert(add(32, returndata), returndata_size)
                }
            } else {
                revert(errorMessage);
            }
        }
    }
}

File 7 of 25 : ERC1155Upgradeable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (token/ERC1155/ERC1155.sol)

pragma solidity ^0.8.0;

import "./IERC1155Upgradeable.sol";
import "./IERC1155ReceiverUpgradeable.sol";
import "./extensions/IERC1155MetadataURIUpgradeable.sol";
import "../../utils/AddressUpgradeable.sol";
import "../../utils/ContextUpgradeable.sol";
import "../../utils/introspection/ERC165Upgradeable.sol";
import "../../proxy/utils/Initializable.sol";

/**
 * @dev Implementation of the basic standard multi-token.
 * See https://eips.ethereum.org/EIPS/eip-1155
 * Originally based on code by Enjin: https://github.com/enjin/erc-1155
 *
 * _Available since v3.1._
 */
contract ERC1155Upgradeable is Initializable, ContextUpgradeable, ERC165Upgradeable, IERC1155Upgradeable, IERC1155MetadataURIUpgradeable {
    using AddressUpgradeable for address;

    // Mapping from token ID to account balances
    mapping(uint256 => mapping(address => uint256)) private _balances;

    // Mapping from account to operator approvals
    mapping(address => mapping(address => bool)) private _operatorApprovals;

    // Used as the URI for all token types by relying on ID substitution, e.g. https://token-cdn-domain/{id}.json
    string private _uri;

    /**
     * @dev See {_setURI}.
     */
    function __ERC1155_init(string memory uri_) internal onlyInitializing {
        __Context_init_unchained();
        __ERC165_init_unchained();
        __ERC1155_init_unchained(uri_);
    }

    function __ERC1155_init_unchained(string memory uri_) internal onlyInitializing {
        _setURI(uri_);
    }

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

    /**
     * @dev See {IERC1155MetadataURI-uri}.
     *
     * This implementation returns the same URI for *all* token types. It relies
     * on the token type ID substitution mechanism
     * https://eips.ethereum.org/EIPS/eip-1155#metadata[defined in the EIP].
     *
     * Clients calling this function must replace the `\{id\}` substring with the
     * actual token type ID.
     */
    function uri(uint256) public view virtual override returns (string memory) {
        return _uri;
    }

    /**
     * @dev See {IERC1155-balanceOf}.
     *
     * Requirements:
     *
     * - `account` cannot be the zero address.
     */
    function balanceOf(address account, uint256 id) public view virtual override returns (uint256) {
        require(account != address(0), "ERC1155: balance query for the zero address");
        return _balances[id][account];
    }

    /**
     * @dev See {IERC1155-balanceOfBatch}.
     *
     * Requirements:
     *
     * - `accounts` and `ids` must have the same length.
     */
    function balanceOfBatch(address[] memory accounts, uint256[] memory ids)
        public
        view
        virtual
        override
        returns (uint256[] memory)
    {
        require(accounts.length == ids.length, "ERC1155: accounts and ids length mismatch");

        uint256[] memory batchBalances = new uint256[](accounts.length);

        for (uint256 i = 0; i < accounts.length; ++i) {
            batchBalances[i] = balanceOf(accounts[i], ids[i]);
        }

        return batchBalances;
    }

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

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

    /**
     * @dev See {IERC1155-safeTransferFrom}.
     */
    function safeTransferFrom(
        address from,
        address to,
        uint256 id,
        uint256 amount,
        bytes memory data
    ) public virtual override {
        require(
            from == _msgSender() || isApprovedForAll(from, _msgSender()),
            "ERC1155: caller is not owner nor approved"
        );
        _safeTransferFrom(from, to, id, amount, data);
    }

    /**
     * @dev See {IERC1155-safeBatchTransferFrom}.
     */
    function safeBatchTransferFrom(
        address from,
        address to,
        uint256[] memory ids,
        uint256[] memory amounts,
        bytes memory data
    ) public virtual override {
        require(
            from == _msgSender() || isApprovedForAll(from, _msgSender()),
            "ERC1155: transfer caller is not owner nor approved"
        );
        _safeBatchTransferFrom(from, to, ids, amounts, data);
    }

    /**
     * @dev Transfers `amount` tokens of token type `id` from `from` to `to`.
     *
     * Emits a {TransferSingle} event.
     *
     * Requirements:
     *
     * - `to` cannot be the zero address.
     * - `from` must have a balance of tokens of type `id` of at least `amount`.
     * - If `to` refers to a smart contract, it must implement {IERC1155Receiver-onERC1155Received} and return the
     * acceptance magic value.
     */
    function _safeTransferFrom(
        address from,
        address to,
        uint256 id,
        uint256 amount,
        bytes memory data
    ) internal virtual {
        require(to != address(0), "ERC1155: transfer to the zero address");

        address operator = _msgSender();

        _beforeTokenTransfer(operator, from, to, _asSingletonArray(id), _asSingletonArray(amount), data);

        uint256 fromBalance = _balances[id][from];
        require(fromBalance >= amount, "ERC1155: insufficient balance for transfer");
        unchecked {
            _balances[id][from] = fromBalance - amount;
        }
        _balances[id][to] += amount;

        emit TransferSingle(operator, from, to, id, amount);

        _doSafeTransferAcceptanceCheck(operator, from, to, id, amount, data);
    }

    /**
     * @dev xref:ROOT:erc1155.adoc#batch-operations[Batched] version of {_safeTransferFrom}.
     *
     * Emits a {TransferBatch} event.
     *
     * Requirements:
     *
     * - If `to` refers to a smart contract, it must implement {IERC1155Receiver-onERC1155BatchReceived} and return the
     * acceptance magic value.
     */
    function _safeBatchTransferFrom(
        address from,
        address to,
        uint256[] memory ids,
        uint256[] memory amounts,
        bytes memory data
    ) internal virtual {
        require(ids.length == amounts.length, "ERC1155: ids and amounts length mismatch");
        require(to != address(0), "ERC1155: transfer to the zero address");

        address operator = _msgSender();

        _beforeTokenTransfer(operator, from, to, ids, amounts, data);

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

            uint256 fromBalance = _balances[id][from];
            require(fromBalance >= amount, "ERC1155: insufficient balance for transfer");
            unchecked {
                _balances[id][from] = fromBalance - amount;
            }
            _balances[id][to] += amount;
        }

        emit TransferBatch(operator, from, to, ids, amounts);

        _doSafeBatchTransferAcceptanceCheck(operator, from, to, ids, amounts, data);
    }

    /**
     * @dev Sets a new URI for all token types, by relying on the token type ID
     * substitution mechanism
     * https://eips.ethereum.org/EIPS/eip-1155#metadata[defined in the EIP].
     *
     * By this mechanism, any occurrence of the `\{id\}` substring in either the
     * URI or any of the amounts in the JSON file at said URI will be replaced by
     * clients with the token type ID.
     *
     * For example, the `https://token-cdn-domain/\{id\}.json` URI would be
     * interpreted by clients as
     * `https://token-cdn-domain/000000000000000000000000000000000000000000000000000000000004cce0.json`
     * for token type ID 0x4cce0.
     *
     * See {uri}.
     *
     * Because these URIs cannot be meaningfully represented by the {URI} event,
     * this function emits no events.
     */
    function _setURI(string memory newuri) internal virtual {
        _uri = newuri;
    }

    /**
     * @dev Creates `amount` tokens of token type `id`, and assigns them to `to`.
     *
     * Emits a {TransferSingle} event.
     *
     * Requirements:
     *
     * - `to` cannot be the zero address.
     * - If `to` refers to a smart contract, it must implement {IERC1155Receiver-onERC1155Received} and return the
     * acceptance magic value.
     */
    function _mint(
        address to,
        uint256 id,
        uint256 amount,
        bytes memory data
    ) internal virtual {
        require(to != address(0), "ERC1155: mint to the zero address");

        address operator = _msgSender();

        _beforeTokenTransfer(operator, address(0), to, _asSingletonArray(id), _asSingletonArray(amount), data);

        _balances[id][to] += amount;
        emit TransferSingle(operator, address(0), to, id, amount);

        _doSafeTransferAcceptanceCheck(operator, address(0), to, id, amount, data);
    }

    /**
     * @dev xref:ROOT:erc1155.adoc#batch-operations[Batched] version of {_mint}.
     *
     * Requirements:
     *
     * - `ids` and `amounts` must have the same length.
     * - If `to` refers to a smart contract, it must implement {IERC1155Receiver-onERC1155BatchReceived} and return the
     * acceptance magic value.
     */
    function _mintBatch(
        address to,
        uint256[] memory ids,
        uint256[] memory amounts,
        bytes memory data
    ) internal virtual {
        require(to != address(0), "ERC1155: mint to the zero address");
        require(ids.length == amounts.length, "ERC1155: ids and amounts length mismatch");

        address operator = _msgSender();

        _beforeTokenTransfer(operator, address(0), to, ids, amounts, data);

        for (uint256 i = 0; i < ids.length; i++) {
            _balances[ids[i]][to] += amounts[i];
        }

        emit TransferBatch(operator, address(0), to, ids, amounts);

        _doSafeBatchTransferAcceptanceCheck(operator, address(0), to, ids, amounts, data);
    }

    /**
     * @dev Destroys `amount` tokens of token type `id` from `from`
     *
     * Requirements:
     *
     * - `from` cannot be the zero address.
     * - `from` must have at least `amount` tokens of token type `id`.
     */
    function _burn(
        address from,
        uint256 id,
        uint256 amount
    ) internal virtual {
        require(from != address(0), "ERC1155: burn from the zero address");

        address operator = _msgSender();

        _beforeTokenTransfer(operator, from, address(0), _asSingletonArray(id), _asSingletonArray(amount), "");

        uint256 fromBalance = _balances[id][from];
        require(fromBalance >= amount, "ERC1155: burn amount exceeds balance");
        unchecked {
            _balances[id][from] = fromBalance - amount;
        }

        emit TransferSingle(operator, from, address(0), id, amount);
    }

    /**
     * @dev xref:ROOT:erc1155.adoc#batch-operations[Batched] version of {_burn}.
     *
     * Requirements:
     *
     * - `ids` and `amounts` must have the same length.
     */
    function _burnBatch(
        address from,
        uint256[] memory ids,
        uint256[] memory amounts
    ) internal virtual {
        require(from != address(0), "ERC1155: burn from the zero address");
        require(ids.length == amounts.length, "ERC1155: ids and amounts length mismatch");

        address operator = _msgSender();

        _beforeTokenTransfer(operator, from, address(0), ids, amounts, "");

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

            uint256 fromBalance = _balances[id][from];
            require(fromBalance >= amount, "ERC1155: burn amount exceeds balance");
            unchecked {
                _balances[id][from] = fromBalance - amount;
            }
        }

        emit TransferBatch(operator, from, address(0), ids, amounts);
    }

    /**
     * @dev Approve `operator` to operate on all of `owner` tokens
     *
     * Emits a {ApprovalForAll} event.
     */
    function _setApprovalForAll(
        address owner,
        address operator,
        bool approved
    ) internal virtual {
        require(owner != operator, "ERC1155: setting approval status for self");
        _operatorApprovals[owner][operator] = approved;
        emit ApprovalForAll(owner, operator, approved);
    }

    /**
     * @dev Hook that is called before any token transfer. This includes minting
     * and burning, as well as batched variants.
     *
     * The same hook is called on both single and batched variants. For single
     * transfers, the length of the `id` and `amount` arrays will be 1.
     *
     * Calling conditions (for each `id` and `amount` pair):
     *
     * - When `from` and `to` are both non-zero, `amount` of ``from``'s tokens
     * of token type `id` will be  transferred to `to`.
     * - When `from` is zero, `amount` tokens of token type `id` will be minted
     * for `to`.
     * - when `to` is zero, `amount` of ``from``'s tokens of token type `id`
     * will be burned.
     * - `from` and `to` are never both zero.
     * - `ids` and `amounts` have the same, non-zero length.
     *
     * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks].
     */
    function _beforeTokenTransfer(
        address operator,
        address from,
        address to,
        uint256[] memory ids,
        uint256[] memory amounts,
        bytes memory data
    ) internal virtual {}

    function _doSafeTransferAcceptanceCheck(
        address operator,
        address from,
        address to,
        uint256 id,
        uint256 amount,
        bytes memory data
    ) private {
        if (to.isContract()) {
            try IERC1155ReceiverUpgradeable(to).onERC1155Received(operator, from, id, amount, data) returns (bytes4 response) {
                if (response != IERC1155ReceiverUpgradeable.onERC1155Received.selector) {
                    revert("ERC1155: ERC1155Receiver rejected tokens");
                }
            } catch Error(string memory reason) {
                revert(reason);
            } catch {
                revert("ERC1155: transfer to non ERC1155Receiver implementer");
            }
        }
    }

    function _doSafeBatchTransferAcceptanceCheck(
        address operator,
        address from,
        address to,
        uint256[] memory ids,
        uint256[] memory amounts,
        bytes memory data
    ) private {
        if (to.isContract()) {
            try IERC1155ReceiverUpgradeable(to).onERC1155BatchReceived(operator, from, ids, amounts, data) returns (
                bytes4 response
            ) {
                if (response != IERC1155ReceiverUpgradeable.onERC1155BatchReceived.selector) {
                    revert("ERC1155: ERC1155Receiver rejected tokens");
                }
            } catch Error(string memory reason) {
                revert(reason);
            } catch {
                revert("ERC1155: transfer to non ERC1155Receiver implementer");
            }
        }
    }

    function _asSingletonArray(uint256 element) private pure returns (uint256[] memory) {
        uint256[] memory array = new uint256[](1);
        array[0] = element;

        return array;
    }
    uint256[47] private __gap;
}

File 8 of 25 : IERC1155Upgradeable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (token/ERC1155/IERC1155.sol)

pragma solidity ^0.8.0;

import "../../utils/introspection/IERC165Upgradeable.sol";

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

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

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

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

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

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

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

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

    /**
     * @dev Transfers `amount` tokens of token type `id` from `from` to `to`.
     *
     * Emits a {TransferSingle} event.
     *
     * Requirements:
     *
     * - `to` cannot be the zero address.
     * - If the caller is not `from`, it must be have been approved to spend ``from``'s tokens via {setApprovalForAll}.
     * - `from` must have a balance of tokens of type `id` of at least `amount`.
     * - If `to` refers to a smart contract, it must implement {IERC1155Receiver-onERC1155Received} and return the
     * acceptance magic value.
     */
    function safeTransferFrom(
        address from,
        address to,
        uint256 id,
        uint256 amount,
        bytes calldata data
    ) external;

    /**
     * @dev xref:ROOT:erc1155.adoc#batch-operations[Batched] version of {safeTransferFrom}.
     *
     * Emits a {TransferBatch} event.
     *
     * Requirements:
     *
     * - `ids` and `amounts` must have the same length.
     * - If `to` refers to a smart contract, it must implement {IERC1155Receiver-onERC1155BatchReceived} and return the
     * acceptance magic value.
     */
    function safeBatchTransferFrom(
        address from,
        address to,
        uint256[] calldata ids,
        uint256[] calldata amounts,
        bytes calldata data
    ) external;
}

File 9 of 25 : IERC1155ReceiverUpgradeable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (token/ERC1155/IERC1155Receiver.sol)

pragma solidity ^0.8.0;

import "../../utils/introspection/IERC165Upgradeable.sol";

/**
 * @dev _Available since v3.1._
 */
interface IERC1155ReceiverUpgradeable is IERC165Upgradeable {
    /**
        @dev Handles the receipt of a single ERC1155 token type. This function is
        called at the end of a `safeTransferFrom` after the balance has been updated.
        To accept the transfer, this must return
        `bytes4(keccak256("onERC1155Received(address,address,uint256,uint256,bytes)"))`
        (i.e. 0xf23a6e61, or its own function selector).
        @param operator The address which initiated the transfer (i.e. msg.sender)
        @param from The address which previously owned the token
        @param id The ID of the token being transferred
        @param value The amount of tokens being transferred
        @param data Additional data with no specified format
        @return `bytes4(keccak256("onERC1155Received(address,address,uint256,uint256,bytes)"))` if transfer is allowed
    */
    function onERC1155Received(
        address operator,
        address from,
        uint256 id,
        uint256 value,
        bytes calldata data
    ) external returns (bytes4);

    /**
        @dev Handles the receipt of a multiple ERC1155 token types. This function
        is called at the end of a `safeBatchTransferFrom` after the balances have
        been updated. To accept the transfer(s), this must return
        `bytes4(keccak256("onERC1155BatchReceived(address,address,uint256[],uint256[],bytes)"))`
        (i.e. 0xbc197c81, or its own function selector).
        @param operator The address which initiated the batch transfer (i.e. msg.sender)
        @param from The address which previously owned the token
        @param ids An array containing ids of each token being transferred (order and length must match values array)
        @param values An array containing amounts of each token being transferred (order and length must match ids array)
        @param data Additional data with no specified format
        @return `bytes4(keccak256("onERC1155BatchReceived(address,address,uint256[],uint256[],bytes)"))` if transfer is allowed
    */
    function onERC1155BatchReceived(
        address operator,
        address from,
        uint256[] calldata ids,
        uint256[] calldata values,
        bytes calldata data
    ) external returns (bytes4);
}

File 10 of 25 : IERC1155MetadataURIUpgradeable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (token/ERC1155/extensions/IERC1155MetadataURI.sol)

pragma solidity ^0.8.0;

import "../IERC1155Upgradeable.sol";

/**
 * @dev Interface of the optional ERC1155MetadataExtension interface, as defined
 * in the https://eips.ethereum.org/EIPS/eip-1155#metadata-extensions[EIP].
 *
 * _Available since v3.1._
 */
interface IERC1155MetadataURIUpgradeable is IERC1155Upgradeable {
    /**
     * @dev Returns the URI for token type `id`.
     *
     * If the `\{id\}` substring is present in the URI, it must be replaced by
     * clients with the actual token type ID.
     */
    function uri(uint256 id) external view returns (string memory);
}

File 11 of 25 : ContextUpgradeable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (utils/Context.sol)

pragma solidity ^0.8.0;
import "../proxy/utils/Initializable.sol";

/**
 * @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 ContextUpgradeable is Initializable {
    function __Context_init() internal onlyInitializing {
        __Context_init_unchained();
    }

    function __Context_init_unchained() internal onlyInitializing {
    }
    function _msgSender() internal view virtual returns (address) {
        return msg.sender;
    }

    function _msgData() internal view virtual returns (bytes calldata) {
        return msg.data;
    }
    uint256[50] private __gap;
}

File 12 of 25 : ERC165Upgradeable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (utils/introspection/ERC165.sol)

pragma solidity ^0.8.0;

import "./IERC165Upgradeable.sol";
import "../../proxy/utils/Initializable.sol";

/**
 * @dev Implementation of the {IERC165} interface.
 *
 * Contracts that want to implement ERC165 should inherit from this contract and override {supportsInterface} to check
 * for the additional interface id that will be supported. For example:
 *
 * ```solidity
 * function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {
 *     return interfaceId == type(MyInterface).interfaceId || super.supportsInterface(interfaceId);
 * }
 * ```
 *
 * Alternatively, {ERC165Storage} provides an easier to use but more expensive implementation.
 */
abstract contract ERC165Upgradeable is Initializable, IERC165Upgradeable {
    function __ERC165_init() internal onlyInitializing {
        __ERC165_init_unchained();
    }

    function __ERC165_init_unchained() internal onlyInitializing {
    }
    /**
     * @dev See {IERC165-supportsInterface}.
     */
    function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {
        return interfaceId == type(IERC165Upgradeable).interfaceId;
    }
    uint256[50] private __gap;
}

File 13 of 25 : IERC165Upgradeable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (utils/introspection/IERC165.sol)

pragma solidity ^0.8.0;

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

File 14 of 25 : SmolFarmState.sol
//SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;

import "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol";
import "@openzeppelin/contracts-upgradeable/utils/structs/EnumerableSetUpgradeable.sol";
import "@openzeppelin/contracts-upgradeable/token/ERC721/utils/ERC721HolderUpgradeable.sol";
import "@openzeppelin/contracts/token/ERC721/IERC721.sol";

import "../../shared/AdminableUpgradeable.sol";
import "../../shared/randomizer/IRandomizer.sol";
import "../treasures/ISmolTreasures.sol";

abstract contract SmolFarmState is
    Initializable,
    AdminableUpgradeable,
    ERC721HolderUpgradeable
{
    event SmolStaked(
        address indexed _owner,
        address indexed _smolAddress,
        uint256 indexed _tokenId,
        uint256 _stakeTime
    );
    event SmolUnstaked(address indexed _owner, address indexed _smolAddress, uint256 indexed _tokenId);

    event StartClaiming(
        address indexed _owner,
        address indexed _smolAddress,
        uint256 indexed _tokenId,
        uint256 _requestId,
        uint256 _numberRewards
    );
    event RewardClaimed(
        address indexed _owner,
        address indexed _smolAddress,
        uint256 indexed _tokenId,
        uint256 _claimedRewardId,
        uint256 _amount
    );

    ISmolTreasures public treasures;
    IRandomizer public randomizer;
    IERC721 public smolBrains;
    IERC721 public smolBodies;
    IERC721 public smolLand;

    // collection address -> user address -> tokens staked for collection
    mapping(address => mapping(address => EnumerableSetUpgradeable.UintSet)) internal userToTokensStaked;

    // collection address -> tokenId -> info
    mapping(address => mapping(uint256 => uint256)) public tokenIdToStakeStartTime;
    mapping(address => mapping(uint256 => uint256)) public tokenIdToRewardsClaimed;
    mapping(address => mapping(uint256 => uint256)) public tokenIdToRequestId;
    mapping(address => mapping(uint256 => uint256)) public tokenIdToRewardsInProgress;

    uint256[] public rewardOptions;
    // Odds out of 100,000
    mapping(uint256 => uint32) public rewardIdToOdds;

    uint256 public _timeForReward;

    function __SmolFarmState_init() internal initializer {
        AdminableUpgradeable.__Adminable_init();
        ERC721HolderUpgradeable.__ERC721Holder_init();

        _timeForReward = 1 days;
    }
}

File 15 of 25 : EnumerableSetUpgradeable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (utils/structs/EnumerableSet.sol)

pragma solidity ^0.8.0;

/**
 * @dev Library for managing
 * https://en.wikipedia.org/wiki/Set_(abstract_data_type)[sets] of primitive
 * types.
 *
 * Sets have the following properties:
 *
 * - Elements are added, removed, and checked for existence in constant time
 * (O(1)).
 * - Elements are enumerated in O(n). No guarantees are made on the ordering.
 *
 * ```
 * contract Example {
 *     // Add the library methods
 *     using EnumerableSet for EnumerableSet.AddressSet;
 *
 *     // Declare a set state variable
 *     EnumerableSet.AddressSet private mySet;
 * }
 * ```
 *
 * As of v3.3.0, sets of type `bytes32` (`Bytes32Set`), `address` (`AddressSet`)
 * and `uint256` (`UintSet`) are supported.
 */
library EnumerableSetUpgradeable {
    // To implement this library for multiple types with as little code
    // repetition as possible, we write it in terms of a generic Set type with
    // bytes32 values.
    // The Set implementation uses private functions, and user-facing
    // implementations (such as AddressSet) are just wrappers around the
    // underlying Set.
    // This means that we can only create new EnumerableSets for types that fit
    // in bytes32.

    struct Set {
        // Storage of set values
        bytes32[] _values;
        // Position of the value in the `values` array, plus 1 because index 0
        // means a value is not in the set.
        mapping(bytes32 => uint256) _indexes;
    }

    /**
     * @dev Add a value to a set. O(1).
     *
     * Returns true if the value was added to the set, that is if it was not
     * already present.
     */
    function _add(Set storage set, bytes32 value) private returns (bool) {
        if (!_contains(set, value)) {
            set._values.push(value);
            // The value is stored at length-1, but we add 1 to all indexes
            // and use 0 as a sentinel value
            set._indexes[value] = set._values.length;
            return true;
        } else {
            return false;
        }
    }

    /**
     * @dev Removes a value from a set. O(1).
     *
     * Returns true if the value was removed from the set, that is if it was
     * present.
     */
    function _remove(Set storage set, bytes32 value) private returns (bool) {
        // We read and store the value's index to prevent multiple reads from the same storage slot
        uint256 valueIndex = set._indexes[value];

        if (valueIndex != 0) {
            // Equivalent to contains(set, value)
            // To delete an element from the _values array in O(1), we swap the element to delete with the last one in
            // the array, and then remove the last element (sometimes called as 'swap and pop').
            // This modifies the order of the array, as noted in {at}.

            uint256 toDeleteIndex = valueIndex - 1;
            uint256 lastIndex = set._values.length - 1;

            if (lastIndex != toDeleteIndex) {
                bytes32 lastvalue = set._values[lastIndex];

                // Move the last value to the index where the value to delete is
                set._values[toDeleteIndex] = lastvalue;
                // Update the index for the moved value
                set._indexes[lastvalue] = valueIndex; // Replace lastvalue's index to valueIndex
            }

            // Delete the slot where the moved value was stored
            set._values.pop();

            // Delete the index for the deleted slot
            delete set._indexes[value];

            return true;
        } else {
            return false;
        }
    }

    /**
     * @dev Returns true if the value is in the set. O(1).
     */
    function _contains(Set storage set, bytes32 value) private view returns (bool) {
        return set._indexes[value] != 0;
    }

    /**
     * @dev Returns the number of values on the set. O(1).
     */
    function _length(Set storage set) private view returns (uint256) {
        return set._values.length;
    }

    /**
     * @dev Returns the value stored at position `index` in the set. O(1).
     *
     * Note that there are no guarantees on the ordering of values inside the
     * array, and it may change when more values are added or removed.
     *
     * Requirements:
     *
     * - `index` must be strictly less than {length}.
     */
    function _at(Set storage set, uint256 index) private view returns (bytes32) {
        return set._values[index];
    }

    /**
     * @dev Return the entire set in an array
     *
     * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed
     * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that
     * this function has an unbounded cost, and using it as part of a state-changing function may render the function
     * uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block.
     */
    function _values(Set storage set) private view returns (bytes32[] memory) {
        return set._values;
    }

    // Bytes32Set

    struct Bytes32Set {
        Set _inner;
    }

    /**
     * @dev Add a value to a set. O(1).
     *
     * Returns true if the value was added to the set, that is if it was not
     * already present.
     */
    function add(Bytes32Set storage set, bytes32 value) internal returns (bool) {
        return _add(set._inner, value);
    }

    /**
     * @dev Removes a value from a set. O(1).
     *
     * Returns true if the value was removed from the set, that is if it was
     * present.
     */
    function remove(Bytes32Set storage set, bytes32 value) internal returns (bool) {
        return _remove(set._inner, value);
    }

    /**
     * @dev Returns true if the value is in the set. O(1).
     */
    function contains(Bytes32Set storage set, bytes32 value) internal view returns (bool) {
        return _contains(set._inner, value);
    }

    /**
     * @dev Returns the number of values in the set. O(1).
     */
    function length(Bytes32Set storage set) internal view returns (uint256) {
        return _length(set._inner);
    }

    /**
     * @dev Returns the value stored at position `index` in the set. O(1).
     *
     * Note that there are no guarantees on the ordering of values inside the
     * array, and it may change when more values are added or removed.
     *
     * Requirements:
     *
     * - `index` must be strictly less than {length}.
     */
    function at(Bytes32Set storage set, uint256 index) internal view returns (bytes32) {
        return _at(set._inner, index);
    }

    /**
     * @dev Return the entire set in an array
     *
     * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed
     * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that
     * this function has an unbounded cost, and using it as part of a state-changing function may render the function
     * uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block.
     */
    function values(Bytes32Set storage set) internal view returns (bytes32[] memory) {
        return _values(set._inner);
    }

    // AddressSet

    struct AddressSet {
        Set _inner;
    }

    /**
     * @dev Add a value to a set. O(1).
     *
     * Returns true if the value was added to the set, that is if it was not
     * already present.
     */
    function add(AddressSet storage set, address value) internal returns (bool) {
        return _add(set._inner, bytes32(uint256(uint160(value))));
    }

    /**
     * @dev Removes a value from a set. O(1).
     *
     * Returns true if the value was removed from the set, that is if it was
     * present.
     */
    function remove(AddressSet storage set, address value) internal returns (bool) {
        return _remove(set._inner, bytes32(uint256(uint160(value))));
    }

    /**
     * @dev Returns true if the value is in the set. O(1).
     */
    function contains(AddressSet storage set, address value) internal view returns (bool) {
        return _contains(set._inner, bytes32(uint256(uint160(value))));
    }

    /**
     * @dev Returns the number of values in the set. O(1).
     */
    function length(AddressSet storage set) internal view returns (uint256) {
        return _length(set._inner);
    }

    /**
     * @dev Returns the value stored at position `index` in the set. O(1).
     *
     * Note that there are no guarantees on the ordering of values inside the
     * array, and it may change when more values are added or removed.
     *
     * Requirements:
     *
     * - `index` must be strictly less than {length}.
     */
    function at(AddressSet storage set, uint256 index) internal view returns (address) {
        return address(uint160(uint256(_at(set._inner, index))));
    }

    /**
     * @dev Return the entire set in an array
     *
     * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed
     * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that
     * this function has an unbounded cost, and using it as part of a state-changing function may render the function
     * uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block.
     */
    function values(AddressSet storage set) internal view returns (address[] memory) {
        bytes32[] memory store = _values(set._inner);
        address[] memory result;

        assembly {
            result := store
        }

        return result;
    }

    // UintSet

    struct UintSet {
        Set _inner;
    }

    /**
     * @dev Add a value to a set. O(1).
     *
     * Returns true if the value was added to the set, that is if it was not
     * already present.
     */
    function add(UintSet storage set, uint256 value) internal returns (bool) {
        return _add(set._inner, bytes32(value));
    }

    /**
     * @dev Removes a value from a set. O(1).
     *
     * Returns true if the value was removed from the set, that is if it was
     * present.
     */
    function remove(UintSet storage set, uint256 value) internal returns (bool) {
        return _remove(set._inner, bytes32(value));
    }

    /**
     * @dev Returns true if the value is in the set. O(1).
     */
    function contains(UintSet storage set, uint256 value) internal view returns (bool) {
        return _contains(set._inner, bytes32(value));
    }

    /**
     * @dev Returns the number of values on the set. O(1).
     */
    function length(UintSet storage set) internal view returns (uint256) {
        return _length(set._inner);
    }

    /**
     * @dev Returns the value stored at position `index` in the set. O(1).
     *
     * Note that there are no guarantees on the ordering of values inside the
     * array, and it may change when more values are added or removed.
     *
     * Requirements:
     *
     * - `index` must be strictly less than {length}.
     */
    function at(UintSet storage set, uint256 index) internal view returns (uint256) {
        return uint256(_at(set._inner, index));
    }

    /**
     * @dev Return the entire set in an array
     *
     * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed
     * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that
     * this function has an unbounded cost, and using it as part of a state-changing function may render the function
     * uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block.
     */
    function values(UintSet storage set) internal view returns (uint256[] memory) {
        bytes32[] memory store = _values(set._inner);
        uint256[] memory result;

        assembly {
            result := store
        }

        return result;
    }
}

File 16 of 25 : ERC721HolderUpgradeable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (token/ERC721/utils/ERC721Holder.sol)

pragma solidity ^0.8.0;

import "../IERC721ReceiverUpgradeable.sol";
import "../../../proxy/utils/Initializable.sol";

/**
 * @dev Implementation of the {IERC721Receiver} interface.
 *
 * Accepts all token transfers.
 * Make sure the contract is able to use its token with {IERC721-safeTransferFrom}, {IERC721-approve} or {IERC721-setApprovalForAll}.
 */
contract ERC721HolderUpgradeable is Initializable, IERC721ReceiverUpgradeable {
    function __ERC721Holder_init() internal onlyInitializing {
        __ERC721Holder_init_unchained();
    }

    function __ERC721Holder_init_unchained() internal onlyInitializing {
    }
    /**
     * @dev See {IERC721Receiver-onERC721Received}.
     *
     * Always returns `IERC721Receiver.onERC721Received.selector`.
     */
    function onERC721Received(
        address,
        address,
        uint256,
        bytes memory
    ) public virtual override returns (bytes4) {
        return this.onERC721Received.selector;
    }
    uint256[50] private __gap;
}

File 17 of 25 : IERC721.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (token/ERC721/IERC721.sol)

pragma solidity ^0.8.0;

import "../../utils/introspection/IERC165.sol";

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

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

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

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

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

    /**
     * @dev Safely transfers `tokenId` token from `from` to `to`, 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
    ) external;

    /**
     * @dev Transfers `tokenId` token 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;

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

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

    /**
     * @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 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);

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

File 18 of 25 : AdminableUpgradeable.sol
//SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;

import "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol";

import "./UtilitiesUpgradeable.sol";

// Do not add state to this contract.
//
contract AdminableUpgradeable is UtilitiesUpgradeable {

    mapping(address => bool) private admins;

    function __Adminable_init() internal initializer {
        UtilitiesUpgradeable.__Utilities__init();
    }

    function addAdmin(address _address) external onlyOwner {
        admins[_address] = true;
    }

    function addAdmins(address[] calldata _addresses) external onlyOwner {
        for(uint256 i = 0; i < _addresses.length; i++) {
            admins[_addresses[i]] = true;
        }
    }

    function removeAdmin(address _address) external onlyOwner {
        admins[_address] = false;
    }

    function removeAdmins(address[] calldata _addresses) external onlyOwner {
        for(uint256 i = 0; i < _addresses.length; i++) {
            admins[_addresses[i]] = false;
        }
    }

    function setPause(bool _shouldPause) external onlyAdminOrOwner {
        if(_shouldPause) {
            _pause();
        } else {
            _unpause();
        }
    }

    function isAdmin(address _address) public view returns(bool) {
        return admins[_address];
    }

    modifier onlyAdmin() {
        require(admins[msg.sender], "Not admin");
        _;
    }

    modifier onlyAdminOrOwner() {
        require(admins[msg.sender] || isOwner(), "Not admin or owner");
        _;
    }

    uint256[50] private __gap;
}

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

interface IRandomizer {

    // Sets the number of blocks that must pass between increment the commitId and seeding the random
    // Admin
    function setNumBlocksAfterIncrement(uint8 _numBlocksAfterIncrement) external;

    // Increments the commit id.
    // Admin
    function incrementCommitId() external;

    // Adding the random number needs to be done AFTER incrementing the commit id on a separate transaction. If
    // these are done together, there is a potential vulnerability to front load a commit when the bad actor
    // sees the value of the random number.
    function addRandomForCommit(uint256 _seed) external;

    // Returns a request ID for a random number. This is unique.
    function requestRandomNumber() external returns(uint256);

    // Returns the random number for the given request ID. Will revert
    // if the random is not ready.
    function revealRandomNumber(uint256 _requestId) external view returns(uint256);

    // Returns if the random number for the given request ID is ready or not. Call
    // before calling revealRandomNumber.
    function isRandomReady(uint256 _requestId) external view returns(bool);
}

File 20 of 25 : ISmolTreasures.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;

import "@openzeppelin/contracts-upgradeable/token/ERC1155/IERC1155Upgradeable.sol";

interface ISmolTreasures is IERC1155Upgradeable {

    function mint(address _to, uint256 _id, uint256 _amount) external;

    function burn(address account, uint256 id, uint256 value) external;

    function burnBatch(address account, uint256[] memory ids, uint256[] memory values) external;

    function adminSafeTransferFrom(address _from, address _to, uint256 _id, uint256 _amount) external;

    function adminSafeBatchTransferFrom(address _from, address _to, uint256[] calldata _ids, uint256[] calldata _amounts) external;
}

File 21 of 25 : IERC721ReceiverUpgradeable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (token/ERC721/IERC721Receiver.sol)

pragma solidity ^0.8.0;

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

File 22 of 25 : IERC165.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (utils/introspection/IERC165.sol)

pragma solidity ^0.8.0;

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

File 23 of 25 : UtilitiesUpgradeable.sol
//SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;

import "@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol";
import "@openzeppelin/contracts-upgradeable/security/PausableUpgradeable.sol";
import "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol";

contract UtilitiesUpgradeable is Initializable, OwnableUpgradeable, PausableUpgradeable {

    function __Utilities__init() internal initializer {
        OwnableUpgradeable.__Ownable_init();
        PausableUpgradeable.__Pausable_init();

        _pause();
    }

    modifier nonZeroAddress(address _address) {
        require(address(0) != _address, "0 address");
        _;
    }

    modifier nonZeroLength(uint[] memory _array) {
        require(_array.length > 0, "Empty array");
        _;
    }

    modifier lengthsAreEqual(uint[] memory _array1, uint[] memory _array2) {
        require(_array1.length == _array2.length, "Unequal lengths");
        _;
    }

    modifier onlyEOA() {
        /* solhint-disable avoid-tx-origin */
        require(msg.sender == tx.origin, "No contracts");
        _;
    }

    function isOwner() internal view returns(bool) {
        return owner() == msg.sender;
    }
}

File 24 of 25 : OwnableUpgradeable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (access/Ownable.sol)

pragma solidity ^0.8.0;

import "../utils/ContextUpgradeable.sol";
import "../proxy/utils/Initializable.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.
 *
 * By default, the owner account will be the one that deploys the contract. 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 OwnableUpgradeable is Initializable, ContextUpgradeable {
    address private _owner;

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

    /**
     * @dev Initializes the contract setting the deployer as the initial owner.
     */
    function __Ownable_init() internal onlyInitializing {
        __Context_init_unchained();
        __Ownable_init_unchained();
    }

    function __Ownable_init_unchained() internal onlyInitializing {
        _transferOwnership(_msgSender());
    }

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

    /**
     * @dev Throws if called by any account other than the owner.
     */
    modifier onlyOwner() {
        require(owner() == _msgSender(), "Ownable: caller is not the owner");
        _;
    }

    /**
     * @dev Leaves the contract without owner. It will not be possible to call
     * `onlyOwner` functions anymore. Can only be called by the current owner.
     *
     * NOTE: Renouncing ownership will leave the contract without an owner,
     * thereby removing 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 {
        require(newOwner != address(0), "Ownable: new owner is the zero address");
        _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);
    }
    uint256[49] private __gap;
}

File 25 of 25 : PausableUpgradeable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (security/Pausable.sol)

pragma solidity ^0.8.0;

import "../utils/ContextUpgradeable.sol";
import "../proxy/utils/Initializable.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 PausableUpgradeable is Initializable, ContextUpgradeable {
    /**
     * @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.
     */
    function __Pausable_init() internal onlyInitializing {
        __Context_init_unchained();
        __Pausable_init_unchained();
    }

    function __Pausable_init_unchained() internal onlyInitializing {
        _paused = false;
    }

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

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

    /**
     * @dev Modifier to make a function callable only when the contract is paused.
     *
     * Requirements:
     *
     * - The contract must be paused.
     */
    modifier whenPaused() {
        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());
    }
    uint256[49] private __gap;
}

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

Contract Security Audit

Contract ABI

API
[{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"account","type":"address"}],"name":"Paused","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"_owner","type":"address"},{"indexed":true,"internalType":"address","name":"_smolAddress","type":"address"},{"indexed":true,"internalType":"uint256","name":"_tokenId","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"_claimedRewardId","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"_amount","type":"uint256"}],"name":"RewardClaimed","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"_owner","type":"address"},{"indexed":true,"internalType":"address","name":"_smolAddress","type":"address"},{"indexed":true,"internalType":"uint256","name":"_tokenId","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"_stakeTime","type":"uint256"}],"name":"SmolStaked","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"_owner","type":"address"},{"indexed":true,"internalType":"address","name":"_smolAddress","type":"address"},{"indexed":true,"internalType":"uint256","name":"_tokenId","type":"uint256"}],"name":"SmolUnstaked","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"_owner","type":"address"},{"indexed":true,"internalType":"address","name":"_smolAddress","type":"address"},{"indexed":true,"internalType":"uint256","name":"_tokenId","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"_requestId","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"_numberRewards","type":"uint256"}],"name":"StartClaiming","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"account","type":"address"}],"name":"Unpaused","type":"event"},{"inputs":[],"name":"_timeForReward","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_address","type":"address"}],"name":"addAdmin","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address[]","name":"_addresses","type":"address[]"}],"name":"addAdmins","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256[]","name":"_brainsTokens","type":"uint256[]"},{"internalType":"uint256[]","name":"_bodiesTokens","type":"uint256[]"}],"name":"finishClaimingRewards","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"initialize","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_address","type":"address"}],"name":"isAdmin","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"smolAddress","type":"address"},{"internalType":"uint256","name":"_tokenId","type":"uint256"}],"name":"numberOfRewardsToClaim","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"},{"internalType":"address","name":"","type":"address"},{"internalType":"uint256","name":"","type":"uint256"},{"internalType":"bytes","name":"","type":"bytes"}],"name":"onERC721Received","outputs":[{"internalType":"bytes4","name":"","type":"bytes4"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_collection","type":"address"},{"internalType":"address","name":"_owner","type":"address"},{"internalType":"uint256","name":"_tokenId","type":"uint256"}],"name":"ownsToken","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"paused","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"randomizer","outputs":[{"internalType":"contract IRandomizer","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_address","type":"address"}],"name":"removeAdmin","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address[]","name":"_addresses","type":"address[]"}],"name":"removeAdmins","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"rewardIdToOdds","outputs":[{"internalType":"uint32","name":"","type":"uint32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"rewardOptions","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_treasures","type":"address"},{"internalType":"address","name":"_smolBrains","type":"address"},{"internalType":"address","name":"_smolBodies","type":"address"},{"internalType":"address","name":"_smolLand","type":"address"},{"internalType":"address","name":"_randomizer","type":"address"}],"name":"setContracts","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bool","name":"_shouldPause","type":"bool"}],"name":"setPause","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256[]","name":"_rewardIds","type":"uint256[]"},{"internalType":"uint32[]","name":"_rewardOdds","type":"uint32[]"}],"name":"setRewards","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_rewardTime","type":"uint256"}],"name":"setTimeForReward","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"smolBodies","outputs":[{"internalType":"contract IERC721","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"smolBrains","outputs":[{"internalType":"contract IERC721","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"smolLand","outputs":[{"internalType":"contract IERC721","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256[]","name":"_brainsTokens","type":"uint256[]"},{"internalType":"uint256[]","name":"_bodiesTokens","type":"uint256[]"}],"name":"stakeSmol","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256[]","name":"_brainsTokens","type":"uint256[]"},{"internalType":"uint256[]","name":"_bodiesTokens","type":"uint256[]"}],"name":"startClaimingRewards","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"},{"internalType":"uint256","name":"","type":"uint256"}],"name":"tokenIdToRequestId","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"},{"internalType":"uint256","name":"","type":"uint256"}],"name":"tokenIdToRewardsClaimed","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"},{"internalType":"uint256","name":"","type":"uint256"}],"name":"tokenIdToRewardsInProgress","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"},{"internalType":"uint256","name":"","type":"uint256"}],"name":"tokenIdToStakeStartTime","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"treasures","outputs":[{"internalType":"contract ISmolTreasures","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256[]","name":"_brainsTokens","type":"uint256[]"},{"internalType":"uint256[]","name":"_bodiesTokens","type":"uint256[]"}],"name":"unstakeSmol","outputs":[],"stateMutability":"nonpayable","type":"function"}]

608060405234801561001057600080fd5b506128d9806100206000396000f3fe608060405234801561001057600080fd5b50600436106101fb5760003560e01c80638129fc1c1161011a578063ccf63845116100ad578063ead657c71161007c578063ead657c7146104da578063eb54d5c7146104ed578063f10fb58414610519578063f2fde38b1461052c578063f63bf8bd1461053f57600080fd5b8063ccf6384514610496578063d8447dad146104a0578063e0e3818e146104b4578063eaafd1dd146104c757600080fd5b8063b64d309f116100e9578063b64d309f1461044a578063bbf65ab71461045d578063bedb86fb14610470578063c03f36701461048357600080fd5b80638129fc1c1461040b5780638da5cb5b146104135780639c54df6414610424578063a87e54701461043757600080fd5b806335b3c18a11610192578063686dd20b11610161578063686dd20b146103ca57806370480275146103dd578063715018a6146103f05780637bd6babb146103f857600080fd5b806335b3c18a14610386578063377e11e01461039957806349a5572b146103ac5780635c975abb146103bf57600080fd5b806319842fb5116101ce57806319842fb5146102c75780631f823805146102f357806324d7806c1461031e5780632b5f94bd1461035a57600080fd5b8063030c4225146102005780630a5ff95a1461023f578063150b7a021461027b5780631785f53c146102b2575b600080fd5b61022c61020e366004612254565b61010360209081526000928352604080842090915290825290205481565b6040519081526020015b60405180910390f35b61026661024d36600461227e565b6101076020526000908152604090205463ffffffff1681565b60405163ffffffff9091168152602001610236565b6102996102893660046122ad565b630a85bd0160e11b949350505050565b6040516001600160e01b03199091168152602001610236565b6102c56102c0366004612389565b610552565b005b61022c6102d5366004612254565b61010460209081526000928352604080842090915290825290205481565b60fc54610306906001600160a01b031681565b6040516001600160a01b039091168152602001610236565b61034a61032c366004612389565b6001600160a01b031660009081526097602052604090205460ff1690565b6040519015158152602001610236565b61022c610368366004612254565b61010260209081526000928352604080842090915290825290205481565b6102c56103943660046123f0565b6105a6565b6102c56103a736600461245c565b610726565b60fe54610306906001600160a01b031681565b60655460ff1661034a565b61022c6103d836600461227e565b6107c7565b6102c56103eb366004612389565b6107e9565b6102c5610837565b60ff54610306906001600160a01b031681565b6102c561086d565b6033546001600160a01b0316610306565b6102c561043236600461245c565b6108e7565b61022c610445366004612254565b610983565b6102c56104583660046123f0565b610a3c565b6102c561046b3660046123f0565b610bb5565b6102c561047e3660046124ac565b610d2e565b6102c56104913660046123f0565b610d81565b61022c6101085481565b61010054610306906001600160a01b031681565b6102c56104c23660046123f0565b610efa565b61034a6104d53660046124c9565b611140565b6102c56104e836600461227e565b61117a565b61022c6104fb366004612254565b61010560209081526000928352604080842090915290825290205481565b60fd54610306906001600160a01b031681565b6102c561053a366004612389565b6111bd565b6102c561054d366004612505565b611255565b6033546001600160a01b031633146105855760405162461bcd60e51b815260040161057c9061256a565b60405180910390fd5b6001600160a01b03166000908152609760205260409020805460ff19169055565b3332146105c55760405162461bcd60e51b815260040161057c9061259f565b60fc546001600160a01b0316158015906105e9575060fd546001600160a01b031615155b80156105ff575060fe546001600160a01b031615155b8015610615575060ff546001600160a01b031615155b801561062c5750610100546001600160a01b031615155b6106485760405162461bcd60e51b815260040161057c906125c5565b60655460ff161561066b5760405162461bcd60e51b815260040161057c906125f3565b8215158061067857508015155b6106945760405162461bcd60e51b815260040161057c9061261d565b60005b838110156106df5760fe546106cd906001600160a01b03168686848181106106c1576106c1612646565b905060200201356112f2565b806106d781612672565b915050610697565b5060005b8181101561071f5760ff5461070d906001600160a01b03168484848181106106c1576106c1612646565b8061071781612672565b9150506106e3565b5050505050565b6033546001600160a01b031633146107505760405162461bcd60e51b815260040161057c9061256a565b60005b818110156107c25760006097600085858581811061077357610773612646565b90506020020160208101906107889190612389565b6001600160a01b031681526020810191909152604001600020805460ff1916911515919091179055806107ba81612672565b915050610753565b505050565b61010681815481106107d857600080fd5b600091825260209091200154905081565b6033546001600160a01b031633146108135760405162461bcd60e51b815260040161057c9061256a565b6001600160a01b03166000908152609760205260409020805460ff19166001179055565b6033546001600160a01b031633146108615760405162461bcd60e51b815260040161057c9061256a565b61086b60006113e3565b565b600054610100900460ff166108885760005460ff161561088c565b303b155b6108a85760405162461bcd60e51b815260040161057c9061268d565b600054610100900460ff161580156108ca576000805461ffff19166101011790555b6108d2611435565b80156108e4576000805461ff00191690555b50565b6033546001600160a01b031633146109115760405162461bcd60e51b815260040161057c9061256a565b60005b818110156107c25760016097600085858581811061093457610934612646565b90506020020160208101906109499190612389565b6001600160a01b031681526020810191909152604001600020805460ff19169115159190911790558061097b81612672565b915050610914565b6001600160a01b0382166000908152610102602090815260408083208484529091528120546109b457506000610a36565b610108546001600160a01b03841660009081526101036020908152604080832086845290915281205490916109e8916126db565b6001600160a01b038516600090815261010260209081526040808320878452909152902054610a1791906126fa565b61010854909150610a288242612712565b610a32919061273f565b9150505b92915050565b333214610a5b5760405162461bcd60e51b815260040161057c9061259f565b60fc546001600160a01b031615801590610a7f575060fd546001600160a01b031615155b8015610a95575060fe546001600160a01b031615155b8015610aab575060ff546001600160a01b031615155b8015610ac25750610100546001600160a01b031615155b610ade5760405162461bcd60e51b815260040161057c906125c5565b60655460ff1615610b015760405162461bcd60e51b815260040161057c906125f3565b82151580610b0e57508015155b610b2a5760405162461bcd60e51b815260040161057c9061261d565b60005b83811015610b755760fe54610b63906001600160a01b0316868684818110610b5757610b57612646565b9050602002013561149a565b80610b6d81612672565b915050610b2d565b5060005b8181101561071f5760ff54610ba3906001600160a01b0316848484818110610b5757610b57612646565b80610bad81612672565b915050610b79565b333214610bd45760405162461bcd60e51b815260040161057c9061259f565b60fc546001600160a01b031615801590610bf8575060fd546001600160a01b031615155b8015610c0e575060fe546001600160a01b031615155b8015610c24575060ff546001600160a01b031615155b8015610c3b5750610100546001600160a01b031615155b610c575760405162461bcd60e51b815260040161057c906125c5565b60655460ff1615610c7a5760405162461bcd60e51b815260040161057c906125f3565b82151580610c8757508015155b610ca35760405162461bcd60e51b815260040161057c9061261d565b60005b83811015610cee5760fe54610cdc906001600160a01b0316868684818110610cd057610cd0612646565b90506020020135611790565b80610ce681612672565b915050610ca6565b5060005b8181101561071f5760ff54610d1c906001600160a01b0316848484818110610cd057610cd0612646565b80610d2681612672565b915050610cf2565b3360009081526097602052604090205460ff1680610d4f5750610d4f611967565b610d6b5760405162461bcd60e51b815260040161057c90612753565b8015610d79576108e461198b565b6108e4611a00565b333214610da05760405162461bcd60e51b815260040161057c9061259f565b60fc546001600160a01b031615801590610dc4575060fd546001600160a01b031615155b8015610dda575060fe546001600160a01b031615155b8015610df0575060ff546001600160a01b031615155b8015610e075750610100546001600160a01b031615155b610e235760405162461bcd60e51b815260040161057c906125c5565b60655460ff1615610e465760405162461bcd60e51b815260040161057c906125f3565b82151580610e5357508015155b610e6f5760405162461bcd60e51b815260040161057c9061261d565b60005b83811015610eba5760fe54610ea8906001600160a01b0316868684818110610e9c57610e9c612646565b90506020020135611a7a565b80610eb281612672565b915050610e72565b5060005b8181101561071f5760ff54610ee8906001600160a01b0316848484818110610e9c57610e9c612646565b80610ef281612672565b915050610ebe565b3360009081526097602052604090205460ff1680610f1b5750610f1b611967565b610f375760405162461bcd60e51b815260040161057c90612753565b83838080602002602001604051908101604052809392919081815260200183836020028082843760009201919091525050825115159150610faa90505760405162461bcd60e51b815260206004820152600b60248201526a456d70747920617272617960a81b604482015260640161057c565b838214610fe75760405162461bcd60e51b815260206004820152600b60248201526a426164206c656e6774687360a81b604482015260640161057c565b610ff46101066000612206565b6000805b858110156110ee5784848281811061101257611012612646565b9050602002016020810190611027919061277f565b61103190836127a5565b915061010687878381811061104857611048612646565b8354600181018555600094855260209485902091909402929092013591909201555084848281811061107c5761107c612646565b9050602002016020810190611091919061277f565b61010760008989858181106110a8576110a8612646565b90506020020135815260200190815260200160002060006101000a81548163ffffffff021916908363ffffffff16021790555080806110e690612672565b915050610ff8565b508063ffffffff16620186a0146111385760405162461bcd60e51b815260206004820152600e60248201526d42616420746f74616c206f64647360901b604482015260640161057c565b505050505050565b6001600160a01b0380841660009081526101016020908152604080832093861683529290529081206111729083611cbb565b949350505050565b3360009081526097602052604090205460ff168061119b575061119b611967565b6111b75760405162461bcd60e51b815260040161057c90612753565b61010855565b6033546001600160a01b031633146111e75760405162461bcd60e51b815260040161057c9061256a565b6001600160a01b03811661124c5760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b606482015260840161057c565b6108e4816113e3565b3360009081526097602052604090205460ff16806112765750611276611967565b6112925760405162461bcd60e51b815260040161057c90612753565b60fc80546001600160a01b03199081166001600160a01b039788161790915560fe805482169587169590951790945560ff80548516938616939093179092556101008054841691851691909117905560fd80549092169216919091179055565b6001600160a01b03821660009081526101016020908152604080832033845290915290206113209082611cd6565b506001600160a01b0382166000818152610102602090815260408083208584528252918290204290819055915191825283929133917f133489e9ddda3b16ddd3b9b961284c406b0a5da8cce1dc3ba03f7838764c93e7910160405180910390a4604051632142170760e11b8152336004820152306024820152604481018290526001600160a01b038316906342842e0e906064015b600060405180830381600087803b1580156113cf57600080fd5b505af1158015611138573d6000803e3d6000fd5b603380546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b600054610100900460ff166114505760005460ff1615611454565b303b155b6114705760405162461bcd60e51b815260040161057c9061268d565b600054610100900460ff16158015611492576000805461ffff19166101011790555b6108d2611ce2565b6001600160a01b03821660009081526101016020908152604080832033845290915290206114c89082611cbb565b6114e45760405162461bcd60e51b815260040161057c906127cd565b610106546115285760405162461bcd60e51b8152602060048201526011602482015270052657761726473206e6f7420736574757607c1b604482015260640161057c565b6001600160a01b038216600090815261010460209081526040808320848452909152902054806115915760405162461bcd60e51b81526020600482015260146024820152734e6f20636c61696d20696e2070726f677265737360601b604482015260640161057c565b60fd5460405163f030210760e01b8152600481018390526001600160a01b039091169063f03021079060240160206040518083038186803b1580156115d557600080fd5b505afa1580156115e9573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061160d91906127f8565b61164c5760405162461bcd60e51b815260206004820152601060248201526f52616e646f6d206e6f7420726561647960801b604482015260640161057c565b60fd54604051634ad30a7560e01b8152600481018390526000916001600160a01b031690634ad30a759060240160206040518083038186803b15801561169157600080fd5b505afa1580156116a5573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906116c99190612815565b6001600160a01b0385166000908152610105602090815260408083208784529091528120549192505b8181101561174d5780156117305760408051602081018590529081018290526060016040516020818303038152906040528051906020012060001c92505b61173b868685611d6b565b8061174581612672565b9150506116f2565b5050506001600160a01b03909216600081815261010560209081526040808320858452825280832083905592825261010481528282209382529290925281205550565b6001600160a01b03821660009081526101016020908152604080832033845290915290206117be9082611cbb565b6117da5760405162461bcd60e51b815260040161057c906127cd565b6001600160a01b038216600090815261010460209081526040808320848452909152902054156118405760405162461bcd60e51b8152602060048201526011602482015270436c61696d20696e2070726f677265737360781b604482015260640161057c565b61184a8282610983565b156118975760405162461bcd60e51b815260206004820152601760248201527f52657761726473206c65667420756e636c61696d656421000000000000000000604482015260640161057c565b6001600160a01b03821660009081526101016020908152604080832033845290915290206118c59082611eb7565b506001600160a01b038216600081815261010260209081526040808320858452825280832083905583835261010382528083208584529091528082208290555183929133917f0e0892e64dffe15b2a80856d3fa02b3b3df09de56739118dc5b9a6050b8d553f9190a4604051632142170760e11b8152306004820152336024820152604481018290526001600160a01b038316906342842e0e906064016113b5565b60003361197c6033546001600160a01b031690565b6001600160a01b031614905090565b60655460ff16156119ae5760405162461bcd60e51b815260040161057c906125f3565b6065805460ff191660011790557f62e78cea01bee320cd4e420270b5ea74000d11b0c9f74754ebdbfc544b05a2586119e33390565b6040516001600160a01b03909116815260200160405180910390a1565b60655460ff16611a495760405162461bcd60e51b815260206004820152601460248201527314185d5cd8589b194e881b9bdd081c185d5cd95960621b604482015260640161057c565b6065805460ff191690557f5db9ee0a495bf2e6ff9c91a7834c1ba4fdd244a5e8aa4e537bd38aeae4b073aa336119e3565b6001600160a01b0382166000908152610101602090815260408083203384529091529020611aa89082611cbb565b611ac45760405162461bcd60e51b815260040161057c906127cd565b6001600160a01b03821660009081526101046020908152604080832084845290915290205415611b2a5760405162461bcd60e51b8152602060048201526011602482015270436c61696d20696e2070726f677265737360781b604482015260640161057c565b6000611b368383610983565b905060008111611b7e5760405162461bcd60e51b81526020600482015260136024820152724e6f207265776172647320746f20636c61696d60681b604482015260640161057c565b6001600160a01b03831660009081526101036020908152604080832085845290915281208054839290611bb29084906126fa565b90915550506001600160a01b03808416600090815261010560209081526040808320868452825280832085905560fd54815163433c53d960e11b8152915193941692638678a7b29260048084019391929182900301818787803b158015611c1857600080fd5b505af1158015611c2c573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611c509190612815565b6001600160a01b0385166000818152610104602090815260408083208884528252918290208490558151848152908101869052929350859233917f961177686f8f4c3873b7414b6f60339b49b32781a671d26be8a490508d4122b2910160405180910390a450505050565b600081815260018301602052604081205415155b9392505050565b6000611ccf8383611ec3565b600054610100900460ff16611cfd5760005460ff1615611d01565b303b155b611d1d5760405162461bcd60e51b815260040161057c9061268d565b600054610100900460ff16158015611d3f576000805461ffff19166101011790555b611d47611f12565b611d4f611f77565b620151806101085580156108e4576000805461ff001916905550565b6000611d7a620186a08361282e565b905060008060005b61010654811015611e665760006101068281548110611da357611da3612646565b6000918252602080832090910154808352610107909152604090912054909150611dd39063ffffffff16856126fa565b935083851015611e535760fc54604051630ab714fb60e11b8152336004820152602481018390526001604482015291935083916001600160a01b039091169063156e29f690606401600060405180830381600087803b158015611e3557600080fd5b505af1158015611e49573d6000803e3d6000fd5b5050505050611e66565b5080611e5e81612672565b915050611d82565b50604080518281526001602082015286916001600160a01b0389169133917f17db246e2b79d27e01c800967d89cbee46000807213e933b6e4c4fddac899a78910160405180910390a4505050505050565b6000611ccf8383611fa6565b6000818152600183016020526040812054611f0a57508154600181810184556000848152602080822090930184905584548482528286019093526040902091909155610a36565b506000610a36565b600054610100900460ff16611f2d5760005460ff1615611f31565b303b155b611f4d5760405162461bcd60e51b815260040161057c9061268d565b600054610100900460ff16158015611f6f576000805461ffff19166101011790555b6108d2612099565b600054610100900460ff16611f9e5760405162461bcd60e51b815260040161057c90612842565b61086b61210e565b6000818152600183016020526040812054801561208f576000611fca600183612712565b8554909150600090611fde90600190612712565b9050818114612043576000866000018281548110611ffe57611ffe612646565b906000526020600020015490508087600001848154811061202157612021612646565b6000918252602080832090910192909255918252600188019052604090208390555b85548690806120545761205461288d565b600190038181906000526020600020016000905590558560010160008681526020019081526020016000206000905560019350505050610a36565b6000915050610a36565b600054610100900460ff166120b45760005460ff16156120b8565b303b155b6120d45760405162461bcd60e51b815260040161057c9061268d565b600054610100900460ff161580156120f6576000805461ffff19166101011790555b6120fe612135565b61210661216c565b6108d261198b565b600054610100900460ff1661086b5760405162461bcd60e51b815260040161057c90612842565b600054610100900460ff1661215c5760405162461bcd60e51b815260040161057c90612842565b61216461210e565b61086b6121a3565b600054610100900460ff166121935760405162461bcd60e51b815260040161057c90612842565b61219b61210e565b61086b6121d3565b600054610100900460ff166121ca5760405162461bcd60e51b815260040161057c90612842565b61086b336113e3565b600054610100900460ff166121fa5760405162461bcd60e51b815260040161057c90612842565b6065805460ff19169055565b50805460008255906000526020600020908101906108e491905b808211156122345760008155600101612220565b5090565b80356001600160a01b038116811461224f57600080fd5b919050565b6000806040838503121561226757600080fd5b61227083612238565b946020939093013593505050565b60006020828403121561229057600080fd5b5035919050565b634e487b7160e01b600052604160045260246000fd5b600080600080608085870312156122c357600080fd5b6122cc85612238565b93506122da60208601612238565b925060408501359150606085013567ffffffffffffffff808211156122fe57600080fd5b818701915087601f83011261231257600080fd5b81358181111561232457612324612297565b604051601f8201601f19908116603f0116810190838211818310171561234c5761234c612297565b816040528281528a602084870101111561236557600080fd5b82602086016020830137600060208483010152809550505050505092959194509250565b60006020828403121561239b57600080fd5b611ccf82612238565b60008083601f8401126123b657600080fd5b50813567ffffffffffffffff8111156123ce57600080fd5b6020830191508360208260051b85010111156123e957600080fd5b9250929050565b6000806000806040858703121561240657600080fd5b843567ffffffffffffffff8082111561241e57600080fd5b61242a888389016123a4565b9096509450602087013591508082111561244357600080fd5b50612450878288016123a4565b95989497509550505050565b6000806020838503121561246f57600080fd5b823567ffffffffffffffff81111561248657600080fd5b612492858286016123a4565b90969095509350505050565b80151581146108e457600080fd5b6000602082840312156124be57600080fd5b8135611ccf8161249e565b6000806000606084860312156124de57600080fd5b6124e784612238565b92506124f560208501612238565b9150604084013590509250925092565b600080600080600060a0868803121561251d57600080fd5b61252686612238565b945061253460208701612238565b935061254260408701612238565b925061255060608701612238565b915061255e60808701612238565b90509295509295909350565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b6020808252600c908201526b4e6f20636f6e74726163747360a01b604082015260600190565b60208082526014908201527310dbdb9d1c9858dd1cc8185c995b89dd081cd95d60621b604082015260600190565b60208082526010908201526f14185d5cd8589b194e881c185d5cd95960821b604082015260600190565b6020808252600f908201526e3737903a37b5b2b7399033b4bb32b760891b604082015260600190565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b60006000198214156126865761268661265c565b5060010190565b6020808252602e908201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160408201526d191e481a5b9a5d1a585b1a5e995960921b606082015260800190565b60008160001904831182151516156126f5576126f561265c565b500290565b6000821982111561270d5761270d61265c565b500190565b6000828210156127245761272461265c565b500390565b634e487b7160e01b600052601260045260246000fd5b60008261274e5761274e612729565b500490565b6020808252601290820152712737ba1030b236b4b71037b91037bbb732b960711b604082015260600190565b60006020828403121561279157600080fd5b813563ffffffff81168114611ccf57600080fd5b600063ffffffff8083168185168083038211156127c4576127c461265c565b01949350505050565b6020808252601190820152702737ba1037bbb732b210313c903ab9b2b960791b604082015260600190565b60006020828403121561280a57600080fd5b8151611ccf8161249e565b60006020828403121561282757600080fd5b5051919050565b60008261283d5761283d612729565b500690565b6020808252602b908201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960408201526a6e697469616c697a696e6760a81b606082015260800190565b634e487b7160e01b600052603160045260246000fdfea2646970667358221220b83e8e288f403d62fb72850059d8bcf2e6b5df7322718a62fdbb626f801fbf6464736f6c63430008090033

Deployed Bytecode

0x608060405234801561001057600080fd5b50600436106101fb5760003560e01c80638129fc1c1161011a578063ccf63845116100ad578063ead657c71161007c578063ead657c7146104da578063eb54d5c7146104ed578063f10fb58414610519578063f2fde38b1461052c578063f63bf8bd1461053f57600080fd5b8063ccf6384514610496578063d8447dad146104a0578063e0e3818e146104b4578063eaafd1dd146104c757600080fd5b8063b64d309f116100e9578063b64d309f1461044a578063bbf65ab71461045d578063bedb86fb14610470578063c03f36701461048357600080fd5b80638129fc1c1461040b5780638da5cb5b146104135780639c54df6414610424578063a87e54701461043757600080fd5b806335b3c18a11610192578063686dd20b11610161578063686dd20b146103ca57806370480275146103dd578063715018a6146103f05780637bd6babb146103f857600080fd5b806335b3c18a14610386578063377e11e01461039957806349a5572b146103ac5780635c975abb146103bf57600080fd5b806319842fb5116101ce57806319842fb5146102c75780631f823805146102f357806324d7806c1461031e5780632b5f94bd1461035a57600080fd5b8063030c4225146102005780630a5ff95a1461023f578063150b7a021461027b5780631785f53c146102b2575b600080fd5b61022c61020e366004612254565b61010360209081526000928352604080842090915290825290205481565b6040519081526020015b60405180910390f35b61026661024d36600461227e565b6101076020526000908152604090205463ffffffff1681565b60405163ffffffff9091168152602001610236565b6102996102893660046122ad565b630a85bd0160e11b949350505050565b6040516001600160e01b03199091168152602001610236565b6102c56102c0366004612389565b610552565b005b61022c6102d5366004612254565b61010460209081526000928352604080842090915290825290205481565b60fc54610306906001600160a01b031681565b6040516001600160a01b039091168152602001610236565b61034a61032c366004612389565b6001600160a01b031660009081526097602052604090205460ff1690565b6040519015158152602001610236565b61022c610368366004612254565b61010260209081526000928352604080842090915290825290205481565b6102c56103943660046123f0565b6105a6565b6102c56103a736600461245c565b610726565b60fe54610306906001600160a01b031681565b60655460ff1661034a565b61022c6103d836600461227e565b6107c7565b6102c56103eb366004612389565b6107e9565b6102c5610837565b60ff54610306906001600160a01b031681565b6102c561086d565b6033546001600160a01b0316610306565b6102c561043236600461245c565b6108e7565b61022c610445366004612254565b610983565b6102c56104583660046123f0565b610a3c565b6102c561046b3660046123f0565b610bb5565b6102c561047e3660046124ac565b610d2e565b6102c56104913660046123f0565b610d81565b61022c6101085481565b61010054610306906001600160a01b031681565b6102c56104c23660046123f0565b610efa565b61034a6104d53660046124c9565b611140565b6102c56104e836600461227e565b61117a565b61022c6104fb366004612254565b61010560209081526000928352604080842090915290825290205481565b60fd54610306906001600160a01b031681565b6102c561053a366004612389565b6111bd565b6102c561054d366004612505565b611255565b6033546001600160a01b031633146105855760405162461bcd60e51b815260040161057c9061256a565b60405180910390fd5b6001600160a01b03166000908152609760205260409020805460ff19169055565b3332146105c55760405162461bcd60e51b815260040161057c9061259f565b60fc546001600160a01b0316158015906105e9575060fd546001600160a01b031615155b80156105ff575060fe546001600160a01b031615155b8015610615575060ff546001600160a01b031615155b801561062c5750610100546001600160a01b031615155b6106485760405162461bcd60e51b815260040161057c906125c5565b60655460ff161561066b5760405162461bcd60e51b815260040161057c906125f3565b8215158061067857508015155b6106945760405162461bcd60e51b815260040161057c9061261d565b60005b838110156106df5760fe546106cd906001600160a01b03168686848181106106c1576106c1612646565b905060200201356112f2565b806106d781612672565b915050610697565b5060005b8181101561071f5760ff5461070d906001600160a01b03168484848181106106c1576106c1612646565b8061071781612672565b9150506106e3565b5050505050565b6033546001600160a01b031633146107505760405162461bcd60e51b815260040161057c9061256a565b60005b818110156107c25760006097600085858581811061077357610773612646565b90506020020160208101906107889190612389565b6001600160a01b031681526020810191909152604001600020805460ff1916911515919091179055806107ba81612672565b915050610753565b505050565b61010681815481106107d857600080fd5b600091825260209091200154905081565b6033546001600160a01b031633146108135760405162461bcd60e51b815260040161057c9061256a565b6001600160a01b03166000908152609760205260409020805460ff19166001179055565b6033546001600160a01b031633146108615760405162461bcd60e51b815260040161057c9061256a565b61086b60006113e3565b565b600054610100900460ff166108885760005460ff161561088c565b303b155b6108a85760405162461bcd60e51b815260040161057c9061268d565b600054610100900460ff161580156108ca576000805461ffff19166101011790555b6108d2611435565b80156108e4576000805461ff00191690555b50565b6033546001600160a01b031633146109115760405162461bcd60e51b815260040161057c9061256a565b60005b818110156107c25760016097600085858581811061093457610934612646565b90506020020160208101906109499190612389565b6001600160a01b031681526020810191909152604001600020805460ff19169115159190911790558061097b81612672565b915050610914565b6001600160a01b0382166000908152610102602090815260408083208484529091528120546109b457506000610a36565b610108546001600160a01b03841660009081526101036020908152604080832086845290915281205490916109e8916126db565b6001600160a01b038516600090815261010260209081526040808320878452909152902054610a1791906126fa565b61010854909150610a288242612712565b610a32919061273f565b9150505b92915050565b333214610a5b5760405162461bcd60e51b815260040161057c9061259f565b60fc546001600160a01b031615801590610a7f575060fd546001600160a01b031615155b8015610a95575060fe546001600160a01b031615155b8015610aab575060ff546001600160a01b031615155b8015610ac25750610100546001600160a01b031615155b610ade5760405162461bcd60e51b815260040161057c906125c5565b60655460ff1615610b015760405162461bcd60e51b815260040161057c906125f3565b82151580610b0e57508015155b610b2a5760405162461bcd60e51b815260040161057c9061261d565b60005b83811015610b755760fe54610b63906001600160a01b0316868684818110610b5757610b57612646565b9050602002013561149a565b80610b6d81612672565b915050610b2d565b5060005b8181101561071f5760ff54610ba3906001600160a01b0316848484818110610b5757610b57612646565b80610bad81612672565b915050610b79565b333214610bd45760405162461bcd60e51b815260040161057c9061259f565b60fc546001600160a01b031615801590610bf8575060fd546001600160a01b031615155b8015610c0e575060fe546001600160a01b031615155b8015610c24575060ff546001600160a01b031615155b8015610c3b5750610100546001600160a01b031615155b610c575760405162461bcd60e51b815260040161057c906125c5565b60655460ff1615610c7a5760405162461bcd60e51b815260040161057c906125f3565b82151580610c8757508015155b610ca35760405162461bcd60e51b815260040161057c9061261d565b60005b83811015610cee5760fe54610cdc906001600160a01b0316868684818110610cd057610cd0612646565b90506020020135611790565b80610ce681612672565b915050610ca6565b5060005b8181101561071f5760ff54610d1c906001600160a01b0316848484818110610cd057610cd0612646565b80610d2681612672565b915050610cf2565b3360009081526097602052604090205460ff1680610d4f5750610d4f611967565b610d6b5760405162461bcd60e51b815260040161057c90612753565b8015610d79576108e461198b565b6108e4611a00565b333214610da05760405162461bcd60e51b815260040161057c9061259f565b60fc546001600160a01b031615801590610dc4575060fd546001600160a01b031615155b8015610dda575060fe546001600160a01b031615155b8015610df0575060ff546001600160a01b031615155b8015610e075750610100546001600160a01b031615155b610e235760405162461bcd60e51b815260040161057c906125c5565b60655460ff1615610e465760405162461bcd60e51b815260040161057c906125f3565b82151580610e5357508015155b610e6f5760405162461bcd60e51b815260040161057c9061261d565b60005b83811015610eba5760fe54610ea8906001600160a01b0316868684818110610e9c57610e9c612646565b90506020020135611a7a565b80610eb281612672565b915050610e72565b5060005b8181101561071f5760ff54610ee8906001600160a01b0316848484818110610e9c57610e9c612646565b80610ef281612672565b915050610ebe565b3360009081526097602052604090205460ff1680610f1b5750610f1b611967565b610f375760405162461bcd60e51b815260040161057c90612753565b83838080602002602001604051908101604052809392919081815260200183836020028082843760009201919091525050825115159150610faa90505760405162461bcd60e51b815260206004820152600b60248201526a456d70747920617272617960a81b604482015260640161057c565b838214610fe75760405162461bcd60e51b815260206004820152600b60248201526a426164206c656e6774687360a81b604482015260640161057c565b610ff46101066000612206565b6000805b858110156110ee5784848281811061101257611012612646565b9050602002016020810190611027919061277f565b61103190836127a5565b915061010687878381811061104857611048612646565b8354600181018555600094855260209485902091909402929092013591909201555084848281811061107c5761107c612646565b9050602002016020810190611091919061277f565b61010760008989858181106110a8576110a8612646565b90506020020135815260200190815260200160002060006101000a81548163ffffffff021916908363ffffffff16021790555080806110e690612672565b915050610ff8565b508063ffffffff16620186a0146111385760405162461bcd60e51b815260206004820152600e60248201526d42616420746f74616c206f64647360901b604482015260640161057c565b505050505050565b6001600160a01b0380841660009081526101016020908152604080832093861683529290529081206111729083611cbb565b949350505050565b3360009081526097602052604090205460ff168061119b575061119b611967565b6111b75760405162461bcd60e51b815260040161057c90612753565b61010855565b6033546001600160a01b031633146111e75760405162461bcd60e51b815260040161057c9061256a565b6001600160a01b03811661124c5760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b606482015260840161057c565b6108e4816113e3565b3360009081526097602052604090205460ff16806112765750611276611967565b6112925760405162461bcd60e51b815260040161057c90612753565b60fc80546001600160a01b03199081166001600160a01b039788161790915560fe805482169587169590951790945560ff80548516938616939093179092556101008054841691851691909117905560fd80549092169216919091179055565b6001600160a01b03821660009081526101016020908152604080832033845290915290206113209082611cd6565b506001600160a01b0382166000818152610102602090815260408083208584528252918290204290819055915191825283929133917f133489e9ddda3b16ddd3b9b961284c406b0a5da8cce1dc3ba03f7838764c93e7910160405180910390a4604051632142170760e11b8152336004820152306024820152604481018290526001600160a01b038316906342842e0e906064015b600060405180830381600087803b1580156113cf57600080fd5b505af1158015611138573d6000803e3d6000fd5b603380546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b600054610100900460ff166114505760005460ff1615611454565b303b155b6114705760405162461bcd60e51b815260040161057c9061268d565b600054610100900460ff16158015611492576000805461ffff19166101011790555b6108d2611ce2565b6001600160a01b03821660009081526101016020908152604080832033845290915290206114c89082611cbb565b6114e45760405162461bcd60e51b815260040161057c906127cd565b610106546115285760405162461bcd60e51b8152602060048201526011602482015270052657761726473206e6f7420736574757607c1b604482015260640161057c565b6001600160a01b038216600090815261010460209081526040808320848452909152902054806115915760405162461bcd60e51b81526020600482015260146024820152734e6f20636c61696d20696e2070726f677265737360601b604482015260640161057c565b60fd5460405163f030210760e01b8152600481018390526001600160a01b039091169063f03021079060240160206040518083038186803b1580156115d557600080fd5b505afa1580156115e9573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061160d91906127f8565b61164c5760405162461bcd60e51b815260206004820152601060248201526f52616e646f6d206e6f7420726561647960801b604482015260640161057c565b60fd54604051634ad30a7560e01b8152600481018390526000916001600160a01b031690634ad30a759060240160206040518083038186803b15801561169157600080fd5b505afa1580156116a5573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906116c99190612815565b6001600160a01b0385166000908152610105602090815260408083208784529091528120549192505b8181101561174d5780156117305760408051602081018590529081018290526060016040516020818303038152906040528051906020012060001c92505b61173b868685611d6b565b8061174581612672565b9150506116f2565b5050506001600160a01b03909216600081815261010560209081526040808320858452825280832083905592825261010481528282209382529290925281205550565b6001600160a01b03821660009081526101016020908152604080832033845290915290206117be9082611cbb565b6117da5760405162461bcd60e51b815260040161057c906127cd565b6001600160a01b038216600090815261010460209081526040808320848452909152902054156118405760405162461bcd60e51b8152602060048201526011602482015270436c61696d20696e2070726f677265737360781b604482015260640161057c565b61184a8282610983565b156118975760405162461bcd60e51b815260206004820152601760248201527f52657761726473206c65667420756e636c61696d656421000000000000000000604482015260640161057c565b6001600160a01b03821660009081526101016020908152604080832033845290915290206118c59082611eb7565b506001600160a01b038216600081815261010260209081526040808320858452825280832083905583835261010382528083208584529091528082208290555183929133917f0e0892e64dffe15b2a80856d3fa02b3b3df09de56739118dc5b9a6050b8d553f9190a4604051632142170760e11b8152306004820152336024820152604481018290526001600160a01b038316906342842e0e906064016113b5565b60003361197c6033546001600160a01b031690565b6001600160a01b031614905090565b60655460ff16156119ae5760405162461bcd60e51b815260040161057c906125f3565b6065805460ff191660011790557f62e78cea01bee320cd4e420270b5ea74000d11b0c9f74754ebdbfc544b05a2586119e33390565b6040516001600160a01b03909116815260200160405180910390a1565b60655460ff16611a495760405162461bcd60e51b815260206004820152601460248201527314185d5cd8589b194e881b9bdd081c185d5cd95960621b604482015260640161057c565b6065805460ff191690557f5db9ee0a495bf2e6ff9c91a7834c1ba4fdd244a5e8aa4e537bd38aeae4b073aa336119e3565b6001600160a01b0382166000908152610101602090815260408083203384529091529020611aa89082611cbb565b611ac45760405162461bcd60e51b815260040161057c906127cd565b6001600160a01b03821660009081526101046020908152604080832084845290915290205415611b2a5760405162461bcd60e51b8152602060048201526011602482015270436c61696d20696e2070726f677265737360781b604482015260640161057c565b6000611b368383610983565b905060008111611b7e5760405162461bcd60e51b81526020600482015260136024820152724e6f207265776172647320746f20636c61696d60681b604482015260640161057c565b6001600160a01b03831660009081526101036020908152604080832085845290915281208054839290611bb29084906126fa565b90915550506001600160a01b03808416600090815261010560209081526040808320868452825280832085905560fd54815163433c53d960e11b8152915193941692638678a7b29260048084019391929182900301818787803b158015611c1857600080fd5b505af1158015611c2c573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611c509190612815565b6001600160a01b0385166000818152610104602090815260408083208884528252918290208490558151848152908101869052929350859233917f961177686f8f4c3873b7414b6f60339b49b32781a671d26be8a490508d4122b2910160405180910390a450505050565b600081815260018301602052604081205415155b9392505050565b6000611ccf8383611ec3565b600054610100900460ff16611cfd5760005460ff1615611d01565b303b155b611d1d5760405162461bcd60e51b815260040161057c9061268d565b600054610100900460ff16158015611d3f576000805461ffff19166101011790555b611d47611f12565b611d4f611f77565b620151806101085580156108e4576000805461ff001916905550565b6000611d7a620186a08361282e565b905060008060005b61010654811015611e665760006101068281548110611da357611da3612646565b6000918252602080832090910154808352610107909152604090912054909150611dd39063ffffffff16856126fa565b935083851015611e535760fc54604051630ab714fb60e11b8152336004820152602481018390526001604482015291935083916001600160a01b039091169063156e29f690606401600060405180830381600087803b158015611e3557600080fd5b505af1158015611e49573d6000803e3d6000fd5b5050505050611e66565b5080611e5e81612672565b915050611d82565b50604080518281526001602082015286916001600160a01b0389169133917f17db246e2b79d27e01c800967d89cbee46000807213e933b6e4c4fddac899a78910160405180910390a4505050505050565b6000611ccf8383611fa6565b6000818152600183016020526040812054611f0a57508154600181810184556000848152602080822090930184905584548482528286019093526040902091909155610a36565b506000610a36565b600054610100900460ff16611f2d5760005460ff1615611f31565b303b155b611f4d5760405162461bcd60e51b815260040161057c9061268d565b600054610100900460ff16158015611f6f576000805461ffff19166101011790555b6108d2612099565b600054610100900460ff16611f9e5760405162461bcd60e51b815260040161057c90612842565b61086b61210e565b6000818152600183016020526040812054801561208f576000611fca600183612712565b8554909150600090611fde90600190612712565b9050818114612043576000866000018281548110611ffe57611ffe612646565b906000526020600020015490508087600001848154811061202157612021612646565b6000918252602080832090910192909255918252600188019052604090208390555b85548690806120545761205461288d565b600190038181906000526020600020016000905590558560010160008681526020019081526020016000206000905560019350505050610a36565b6000915050610a36565b600054610100900460ff166120b45760005460ff16156120b8565b303b155b6120d45760405162461bcd60e51b815260040161057c9061268d565b600054610100900460ff161580156120f6576000805461ffff19166101011790555b6120fe612135565b61210661216c565b6108d261198b565b600054610100900460ff1661086b5760405162461bcd60e51b815260040161057c90612842565b600054610100900460ff1661215c5760405162461bcd60e51b815260040161057c90612842565b61216461210e565b61086b6121a3565b600054610100900460ff166121935760405162461bcd60e51b815260040161057c90612842565b61219b61210e565b61086b6121d3565b600054610100900460ff166121ca5760405162461bcd60e51b815260040161057c90612842565b61086b336113e3565b600054610100900460ff166121fa5760405162461bcd60e51b815260040161057c90612842565b6065805460ff19169055565b50805460008255906000526020600020908101906108e491905b808211156122345760008155600101612220565b5090565b80356001600160a01b038116811461224f57600080fd5b919050565b6000806040838503121561226757600080fd5b61227083612238565b946020939093013593505050565b60006020828403121561229057600080fd5b5035919050565b634e487b7160e01b600052604160045260246000fd5b600080600080608085870312156122c357600080fd5b6122cc85612238565b93506122da60208601612238565b925060408501359150606085013567ffffffffffffffff808211156122fe57600080fd5b818701915087601f83011261231257600080fd5b81358181111561232457612324612297565b604051601f8201601f19908116603f0116810190838211818310171561234c5761234c612297565b816040528281528a602084870101111561236557600080fd5b82602086016020830137600060208483010152809550505050505092959194509250565b60006020828403121561239b57600080fd5b611ccf82612238565b60008083601f8401126123b657600080fd5b50813567ffffffffffffffff8111156123ce57600080fd5b6020830191508360208260051b85010111156123e957600080fd5b9250929050565b6000806000806040858703121561240657600080fd5b843567ffffffffffffffff8082111561241e57600080fd5b61242a888389016123a4565b9096509450602087013591508082111561244357600080fd5b50612450878288016123a4565b95989497509550505050565b6000806020838503121561246f57600080fd5b823567ffffffffffffffff81111561248657600080fd5b612492858286016123a4565b90969095509350505050565b80151581146108e457600080fd5b6000602082840312156124be57600080fd5b8135611ccf8161249e565b6000806000606084860312156124de57600080fd5b6124e784612238565b92506124f560208501612238565b9150604084013590509250925092565b600080600080600060a0868803121561251d57600080fd5b61252686612238565b945061253460208701612238565b935061254260408701612238565b925061255060608701612238565b915061255e60808701612238565b90509295509295909350565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b6020808252600c908201526b4e6f20636f6e74726163747360a01b604082015260600190565b60208082526014908201527310dbdb9d1c9858dd1cc8185c995b89dd081cd95d60621b604082015260600190565b60208082526010908201526f14185d5cd8589b194e881c185d5cd95960821b604082015260600190565b6020808252600f908201526e3737903a37b5b2b7399033b4bb32b760891b604082015260600190565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b60006000198214156126865761268661265c565b5060010190565b6020808252602e908201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160408201526d191e481a5b9a5d1a585b1a5e995960921b606082015260800190565b60008160001904831182151516156126f5576126f561265c565b500290565b6000821982111561270d5761270d61265c565b500190565b6000828210156127245761272461265c565b500390565b634e487b7160e01b600052601260045260246000fd5b60008261274e5761274e612729565b500490565b6020808252601290820152712737ba1030b236b4b71037b91037bbb732b960711b604082015260600190565b60006020828403121561279157600080fd5b813563ffffffff81168114611ccf57600080fd5b600063ffffffff8083168185168083038211156127c4576127c461265c565b01949350505050565b6020808252601190820152702737ba1037bbb732b210313c903ab9b2b960791b604082015260600190565b60006020828403121561280a57600080fd5b8151611ccf8161249e565b60006020828403121561282757600080fd5b5051919050565b60008261283d5761283d612729565b500690565b6020808252602b908201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960408201526a6e697469616c697a696e6760a81b606082015260800190565b634e487b7160e01b600052603160045260246000fdfea2646970667358221220b83e8e288f403d62fb72850059d8bcf2e6b5df7322718a62fdbb626f801fbf6464736f6c63430008090033

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