ETH Price: $1,581.62 (+0.13%)
 
Transaction Hash
Method
Block
From
To
Pause217760442025-02-04 22:13:3575 days ago1738707215IN
0x252C40C3...35b8aD9e2
0 ETH0.000115043.83410218
Withdraw Force217760272025-02-04 22:10:1175 days ago1738707011IN
0x252C40C3...35b8aD9e2
0 ETH0.000290724.57403721
Withdraw Force217760272025-02-04 22:10:1175 days ago1738707011IN
0x252C40C3...35b8aD9e2
0 ETH0.00038494.57403721
Withdraw Force217760222025-02-04 22:09:1175 days ago1738706951IN
0x252C40C3...35b8aD9e2
0 ETH0.000424885.04916646
Withdraw Force217760222025-02-04 22:09:1175 days ago1738706951IN
0x252C40C3...35b8aD9e2
0 ETH0.000424885.04916646
Withdraw Force217760222025-02-04 22:09:1175 days ago1738706951IN
0x252C40C3...35b8aD9e2
0 ETH0.000338545.04916646
Withdraw Force217760222025-02-04 22:09:1175 days ago1738706951IN
0x252C40C3...35b8aD9e2
0 ETH0.000338545.04916646
Withdraw Force217760222025-02-04 22:09:1175 days ago1738706951IN
0x252C40C3...35b8aD9e2
0 ETH0.000424885.04916646
Withdraw Force217760222025-02-04 22:09:1175 days ago1738706951IN
0x252C40C3...35b8aD9e2
0 ETH0.000424885.04916646
Withdraw Force217760222025-02-04 22:09:1175 days ago1738706951IN
0x252C40C3...35b8aD9e2
0 ETH0.000424885.04916646
Withdraw Force217760222025-02-04 22:09:1175 days ago1738706951IN
0x252C40C3...35b8aD9e2
0 ETH0.000424885.04916646
Withdraw Force217760222025-02-04 22:09:1175 days ago1738706951IN
0x252C40C3...35b8aD9e2
0 ETH0.000424885.04916646
Withdraw Force217760202025-02-04 22:08:4775 days ago1738706927IN
0x252C40C3...35b8aD9e2
0 ETH0.000441665.24856562
Withdraw Force217760202025-02-04 22:08:4775 days ago1738706927IN
0x252C40C3...35b8aD9e2
0 ETH0.000441665.24856562
Withdraw Force217760202025-02-04 22:08:4775 days ago1738706927IN
0x252C40C3...35b8aD9e2
0 ETH0.000441665.24856562
Withdraw Force217760202025-02-04 22:08:4775 days ago1738706927IN
0x252C40C3...35b8aD9e2
0 ETH0.000441665.24856562
Withdraw Force217760202025-02-04 22:08:4775 days ago1738706927IN
0x252C40C3...35b8aD9e2
0 ETH0.000351915.24856562
Withdraw Force217760202025-02-04 22:08:4775 days ago1738706927IN
0x252C40C3...35b8aD9e2
0 ETH0.000351915.24856562
Withdraw Force217760202025-02-04 22:08:4775 days ago1738706927IN
0x252C40C3...35b8aD9e2
0 ETH0.000351915.24856562
Withdraw Force217760202025-02-04 22:08:4775 days ago1738706927IN
0x252C40C3...35b8aD9e2
0 ETH0.000441665.24856562
Withdraw Force217760202025-02-04 22:08:4775 days ago1738706927IN
0x252C40C3...35b8aD9e2
0 ETH0.000351915.24856562
Withdraw Force217760202025-02-04 22:08:4775 days ago1738706927IN
0x252C40C3...35b8aD9e2
0 ETH0.000441665.24856562
Withdraw Force217760202025-02-04 22:08:4775 days ago1738706927IN
0x252C40C3...35b8aD9e2
0 ETH0.000441665.24856562
Withdraw Force217760202025-02-04 22:08:4775 days ago1738706927IN
0x252C40C3...35b8aD9e2
0 ETH0.000351915.24856562
Withdraw Force217760202025-02-04 22:08:4775 days ago1738706927IN
0x252C40C3...35b8aD9e2
0 ETH0.000351915.24856562
View all transactions

View more zero value Internal Transactions in Advanced View mode

Advanced mode:
Loading...
Loading

Contract Source Code Verified (Exact Match)

Contract Name:
IslandG1Staking

Compiler Version
v0.8.17+commit.8df45f5f

Optimization Enabled:
Yes with 200 runs

Other Settings:
default evmVersion
File 1 of 13 : IslandG1Staking.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.17;

import "@openzeppelin/contracts/token/ERC721/IERC721.sol";
import "@openzeppelin/contracts/token/ERC721/utils/ERC721Holder.sol";
import "@openzeppelin/contracts/access/AccessControl.sol";
import "@openzeppelin/contracts/security/ReentrancyGuard.sol";
import "@openzeppelin/contracts/security/Pausable.sol";
import "@openzeppelin/contracts/utils/Address.sol";
import "@openzeppelin/contracts/utils/Strings.sol";

/// @title IslandG1Staking contract
/// @custom:juice 100%
/// @custom:security-contact [email protected]
contract IslandG1Staking is ERC721Holder, ReentrancyGuard, AccessControl, Pausable {
    using Address for address;
    using Strings for uint256;
    
    bytes32 public constant MANAGER_ROLE = keccak256("MANAGER_ROLE");

    IERC721 public token;

    uint256 public totalStaked;
    mapping(address => uint256) private balances;
    mapping(uint256 => address) private assets;

    constructor(
        address token_
    ) {
        token = IERC721(token_);

        _grantRole(DEFAULT_ADMIN_ROLE, _msgSender());
        _grantRole(MANAGER_ROLE, _msgSender());
    }

    function stake(uint256 tokenId)
        public
        nonReentrant
        whenNotPaused
    {
        assets[tokenId] = _msgSender();

        balances[_msgSender()] += 1;

        totalStaked += 1;

        token.safeTransferFrom(_msgSender(), address(this), tokenId);

        emit Staked(_msgSender(), tokenId);
    }

    function withdraw(uint256 tokenId)
        public
        nonReentrant
        whenNotPaused
    {
        require(assets[tokenId] == _msgSender(), "IslandG1Staking: not the staker");

        assets[tokenId] = address(0);

        balances[_msgSender()] -= 1;
        
        totalStaked -= 1;

        token.safeTransferFrom(address(this), _msgSender(), tokenId);

        emit Withdrawn(_msgSender(), tokenId);
    }
    
    function withdrawForce(uint256 tokenId)
        public
        nonReentrant
        onlyRole (MANAGER_ROLE)
    {
        address staker = assets[tokenId];

        require(staker != address(0), "IslandG1Staking: not staked");

        assets[tokenId] = address(0);

        balances[staker] -= 1;
        
        totalStaked -= 1;

        token.safeTransferFrom(address(this), staker, tokenId);

        emit Withdrawn(staker, tokenId);
    }

    function pause()
        external
        onlyRole (MANAGER_ROLE)
    {
        _pause();
    }

    function unpause()
        external
        onlyRole (MANAGER_ROLE)
    {
        _unpause();
    }

    function balanceOf(address owner)
        public
        view
        virtual
        returns (uint256)
    {
        require(owner != address(0), "IslandG1Staking: address zero is not a valid owner");

        return balances[owner];
    }

    function ownerOf(uint256 tokenId)
        public
        view
        virtual
        returns (address)
    {
        address owner = assets[tokenId];

        require(owner != address(0), "IslandG1Staking: invalid token ID");

        return owner;
    }

    function supportsInterface(bytes4 interfaceId)
        public
        view
        override (AccessControl)
        returns (bool)
    {
        return super.supportsInterface(interfaceId);
    }

    event Staked(address indexed staker, uint256 indexed tokenId);
    event Withdrawn(address indexed staker, uint256 indexed tokenId);
}

File 2 of 13 : AccessControl.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.7.0) (access/AccessControl.sol)

pragma solidity ^0.8.0;

import "./IAccessControl.sol";
import "../utils/Context.sol";
import "../utils/Strings.sol";
import "../utils/introspection/ERC165.sol";

/**
 * @dev Contract module that allows children to implement role-based access
 * control mechanisms. This is a lightweight version that doesn't allow enumerating role
 * members except through off-chain means by accessing the contract event logs. Some
 * applications may benefit from on-chain enumerability, for those cases see
 * {AccessControlEnumerable}.
 *
 * Roles are referred to by their `bytes32` identifier. These should be exposed
 * in the external API and be unique. The best way to achieve this is by
 * using `public constant` hash digests:
 *
 * ```
 * bytes32 public constant MY_ROLE = keccak256("MY_ROLE");
 * ```
 *
 * Roles can be used to represent a set of permissions. To restrict access to a
 * function call, use {hasRole}:
 *
 * ```
 * function foo() public {
 *     require(hasRole(MY_ROLE, msg.sender));
 *     ...
 * }
 * ```
 *
 * Roles can be granted and revoked dynamically via the {grantRole} and
 * {revokeRole} functions. Each role has an associated admin role, and only
 * accounts that have a role's admin role can call {grantRole} and {revokeRole}.
 *
 * By default, the admin role for all roles is `DEFAULT_ADMIN_ROLE`, which means
 * that only accounts with this role will be able to grant or revoke other
 * roles. More complex role relationships can be created by using
 * {_setRoleAdmin}.
 *
 * WARNING: The `DEFAULT_ADMIN_ROLE` is also its own admin: it has permission to
 * grant and revoke this role. Extra precautions should be taken to secure
 * accounts that have been granted it.
 */
abstract contract AccessControl is Context, IAccessControl, ERC165 {
    struct RoleData {
        mapping(address => bool) members;
        bytes32 adminRole;
    }

    mapping(bytes32 => RoleData) private _roles;

    bytes32 public constant DEFAULT_ADMIN_ROLE = 0x00;

    /**
     * @dev Modifier that checks that an account has a specific role. Reverts
     * with a standardized message including the required role.
     *
     * The format of the revert reason is given by the following regular expression:
     *
     *  /^AccessControl: account (0x[0-9a-f]{40}) is missing role (0x[0-9a-f]{64})$/
     *
     * _Available since v4.1._
     */
    modifier onlyRole(bytes32 role) {
        _checkRole(role);
        _;
    }

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

    /**
     * @dev Returns `true` if `account` has been granted `role`.
     */
    function hasRole(bytes32 role, address account) public view virtual override returns (bool) {
        return _roles[role].members[account];
    }

    /**
     * @dev Revert with a standard message if `_msgSender()` is missing `role`.
     * Overriding this function changes the behavior of the {onlyRole} modifier.
     *
     * Format of the revert message is described in {_checkRole}.
     *
     * _Available since v4.6._
     */
    function _checkRole(bytes32 role) internal view virtual {
        _checkRole(role, _msgSender());
    }

    /**
     * @dev Revert with a standard message if `account` is missing `role`.
     *
     * The format of the revert reason is given by the following regular expression:
     *
     *  /^AccessControl: account (0x[0-9a-f]{40}) is missing role (0x[0-9a-f]{64})$/
     */
    function _checkRole(bytes32 role, address account) internal view virtual {
        if (!hasRole(role, account)) {
            revert(
                string(
                    abi.encodePacked(
                        "AccessControl: account ",
                        Strings.toHexString(uint160(account), 20),
                        " is missing role ",
                        Strings.toHexString(uint256(role), 32)
                    )
                )
            );
        }
    }

    /**
     * @dev Returns the admin role that controls `role`. See {grantRole} and
     * {revokeRole}.
     *
     * To change a role's admin, use {_setRoleAdmin}.
     */
    function getRoleAdmin(bytes32 role) public view virtual override returns (bytes32) {
        return _roles[role].adminRole;
    }

    /**
     * @dev Grants `role` to `account`.
     *
     * If `account` had not been already granted `role`, emits a {RoleGranted}
     * event.
     *
     * Requirements:
     *
     * - the caller must have ``role``'s admin role.
     *
     * May emit a {RoleGranted} event.
     */
    function grantRole(bytes32 role, address account) public virtual override onlyRole(getRoleAdmin(role)) {
        _grantRole(role, account);
    }

    /**
     * @dev Revokes `role` from `account`.
     *
     * If `account` had been granted `role`, emits a {RoleRevoked} event.
     *
     * Requirements:
     *
     * - the caller must have ``role``'s admin role.
     *
     * May emit a {RoleRevoked} event.
     */
    function revokeRole(bytes32 role, address account) public virtual override onlyRole(getRoleAdmin(role)) {
        _revokeRole(role, account);
    }

    /**
     * @dev Revokes `role` from the calling account.
     *
     * Roles are often managed via {grantRole} and {revokeRole}: this function's
     * purpose is to provide a mechanism for accounts to lose their privileges
     * if they are compromised (such as when a trusted device is misplaced).
     *
     * If the calling account had been revoked `role`, emits a {RoleRevoked}
     * event.
     *
     * Requirements:
     *
     * - the caller must be `account`.
     *
     * May emit a {RoleRevoked} event.
     */
    function renounceRole(bytes32 role, address account) public virtual override {
        require(account == _msgSender(), "AccessControl: can only renounce roles for self");

        _revokeRole(role, account);
    }

    /**
     * @dev Grants `role` to `account`.
     *
     * If `account` had not been already granted `role`, emits a {RoleGranted}
     * event. Note that unlike {grantRole}, this function doesn't perform any
     * checks on the calling account.
     *
     * May emit a {RoleGranted} event.
     *
     * [WARNING]
     * ====
     * This function should only be called from the constructor when setting
     * up the initial roles for the system.
     *
     * Using this function in any other way is effectively circumventing the admin
     * system imposed by {AccessControl}.
     * ====
     *
     * NOTE: This function is deprecated in favor of {_grantRole}.
     */
    function _setupRole(bytes32 role, address account) internal virtual {
        _grantRole(role, account);
    }

    /**
     * @dev Sets `adminRole` as ``role``'s admin role.
     *
     * Emits a {RoleAdminChanged} event.
     */
    function _setRoleAdmin(bytes32 role, bytes32 adminRole) internal virtual {
        bytes32 previousAdminRole = getRoleAdmin(role);
        _roles[role].adminRole = adminRole;
        emit RoleAdminChanged(role, previousAdminRole, adminRole);
    }

    /**
     * @dev Grants `role` to `account`.
     *
     * Internal function without access restriction.
     *
     * May emit a {RoleGranted} event.
     */
    function _grantRole(bytes32 role, address account) internal virtual {
        if (!hasRole(role, account)) {
            _roles[role].members[account] = true;
            emit RoleGranted(role, account, _msgSender());
        }
    }

    /**
     * @dev Revokes `role` from `account`.
     *
     * Internal function without access restriction.
     *
     * May emit a {RoleRevoked} event.
     */
    function _revokeRole(bytes32 role, address account) internal virtual {
        if (hasRole(role, account)) {
            _roles[role].members[account] = false;
            emit RoleRevoked(role, account, _msgSender());
        }
    }
}

File 3 of 13 : Address.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.7.0) (utils/Address.sol)

pragma solidity ^0.8.1;

/**
 * @dev Collection of functions related to the address type
 */
library Address {
    /**
     * @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
     * ====
     *
     * [IMPORTANT]
     * ====
     * You shouldn't rely on `isContract` to protect against flash loan attacks!
     *
     * Preventing calls from contracts is highly discouraged. It breaks composability, breaks support for smart wallets
     * like Gnosis Safe, and does not provide security since it can be circumvented by calling from a contract
     * constructor.
     * ====
     */
    function isContract(address account) internal view returns (bool) {
        // This method relies on extcodesize/address.code.length, which returns 0
        // for contracts in construction, since the code is only stored at the end
        // of the constructor execution.

        return account.code.length > 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 Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
     * but performing a delegate call.
     *
     * _Available since v3.4._
     */
    function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) {
        return functionDelegateCall(target, data, "Address: low-level delegate call failed");
    }

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

        (bool success, bytes memory returndata) = target.delegatecall(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
                /// @solidity memory-safe-assembly
                assembly {
                    let returndata_size := mload(returndata)
                    revert(add(32, returndata), returndata_size)
                }
            } else {
                revert(errorMessage);
            }
        }
    }
}

File 4 of 13 : ReentrancyGuard.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (security/ReentrancyGuard.sol)

pragma solidity ^0.8.0;

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

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

    uint256 private _status;

    constructor() {
        _status = _NOT_ENTERED;
    }

    /**
     * @dev Prevents a contract from calling itself, directly or indirectly.
     * Calling a `nonReentrant` function from another `nonReentrant`
     * function is not supported. It is possible to prevent this from happening
     * by making the `nonReentrant` function external, and making it call a
     * `private` function that does the actual work.
     */
    modifier nonReentrant() {
        // On the first call to nonReentrant, _notEntered will be true
        require(_status != _ENTERED, "ReentrancyGuard: reentrant call");

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

        _;

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

File 5 of 13 : Pausable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.7.0) (security/Pausable.sol)

pragma solidity ^0.8.0;

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

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

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

    bool private _paused;

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

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

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

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

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

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

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

    /**
     * @dev Returns to normal state.
     *
     * Requirements:
     *
     * - The contract must be paused.
     */
    function _unpause() internal virtual whenPaused {
        _paused = false;
        emit Unpaused(_msgSender());
    }
}

File 6 of 13 : Strings.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.7.0) (utils/Strings.sol)

pragma solidity ^0.8.0;

/**
 * @dev String operations.
 */
library Strings {
    bytes16 private constant _HEX_SYMBOLS = "0123456789abcdef";
    uint8 private constant _ADDRESS_LENGTH = 20;

    /**
     * @dev Converts a `uint256` to its ASCII `string` decimal representation.
     */
    function toString(uint256 value) internal pure returns (string memory) {
        // Inspired by OraclizeAPI's implementation - MIT licence
        // https://github.com/oraclize/ethereum-api/blob/b42146b063c7d6ee1358846c198246239e9360e8/oraclizeAPI_0.4.25.sol

        if (value == 0) {
            return "0";
        }
        uint256 temp = value;
        uint256 digits;
        while (temp != 0) {
            digits++;
            temp /= 10;
        }
        bytes memory buffer = new bytes(digits);
        while (value != 0) {
            digits -= 1;
            buffer[digits] = bytes1(uint8(48 + uint256(value % 10)));
            value /= 10;
        }
        return string(buffer);
    }

    /**
     * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation.
     */
    function toHexString(uint256 value) internal pure returns (string memory) {
        if (value == 0) {
            return "0x00";
        }
        uint256 temp = value;
        uint256 length = 0;
        while (temp != 0) {
            length++;
            temp >>= 8;
        }
        return toHexString(value, length);
    }

    /**
     * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation with fixed length.
     */
    function toHexString(uint256 value, uint256 length) internal pure returns (string memory) {
        bytes memory buffer = new bytes(2 * length + 2);
        buffer[0] = "0";
        buffer[1] = "x";
        for (uint256 i = 2 * length + 1; i > 1; --i) {
            buffer[i] = _HEX_SYMBOLS[value & 0xf];
            value >>= 4;
        }
        require(value == 0, "Strings: hex length insufficient");
        return string(buffer);
    }

    /**
     * @dev Converts an `address` with fixed length of 20 bytes to its not checksummed ASCII `string` hexadecimal representation.
     */
    function toHexString(address addr) internal pure returns (string memory) {
        return toHexString(uint256(uint160(addr)), _ADDRESS_LENGTH);
    }
}

File 7 of 13 : IERC721.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.7.0) (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`.
     *
     * Requirements:
     *
     * - `from` cannot be the zero address.
     * - `to` cannot be the zero address.
     * - `tokenId` token must exist and be owned by `from`.
     * - If the caller is not `from`, it must be approved to move this token by either {approve} or {setApprovalForAll}.
     * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer.
     *
     * Emits a {Transfer} event.
     */
    function safeTransferFrom(
        address from,
        address to,
        uint256 tokenId,
        bytes calldata data
    ) external;

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

    /**
     * @dev Transfers `tokenId` token from `from` to `to`.
     *
     * WARNING: 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 Approve or remove `operator` as an operator for the caller.
     * Operators can call {transferFrom} or {safeTransferFrom} for any token owned by the caller.
     *
     * Requirements:
     *
     * - The `operator` cannot be the caller.
     *
     * Emits an {ApprovalForAll} event.
     */
    function setApprovalForAll(address operator, bool _approved) external;

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

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

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

pragma solidity ^0.8.0;

import "../IERC721Receiver.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 ERC721Holder is IERC721Receiver {
    /**
     * @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;
    }
}

File 9 of 13 : IAccessControl.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (access/IAccessControl.sol)

pragma solidity ^0.8.0;

/**
 * @dev External interface of AccessControl declared to support ERC165 detection.
 */
interface IAccessControl {
    /**
     * @dev Emitted when `newAdminRole` is set as ``role``'s admin role, replacing `previousAdminRole`
     *
     * `DEFAULT_ADMIN_ROLE` is the starting admin for all roles, despite
     * {RoleAdminChanged} not being emitted signaling this.
     *
     * _Available since v3.1._
     */
    event RoleAdminChanged(bytes32 indexed role, bytes32 indexed previousAdminRole, bytes32 indexed newAdminRole);

    /**
     * @dev Emitted when `account` is granted `role`.
     *
     * `sender` is the account that originated the contract call, an admin role
     * bearer except when using {AccessControl-_setupRole}.
     */
    event RoleGranted(bytes32 indexed role, address indexed account, address indexed sender);

    /**
     * @dev Emitted when `account` is revoked `role`.
     *
     * `sender` is the account that originated the contract call:
     *   - if using `revokeRole`, it is the admin role bearer
     *   - if using `renounceRole`, it is the role bearer (i.e. `account`)
     */
    event RoleRevoked(bytes32 indexed role, address indexed account, address indexed sender);

    /**
     * @dev Returns `true` if `account` has been granted `role`.
     */
    function hasRole(bytes32 role, address account) external view returns (bool);

    /**
     * @dev Returns the admin role that controls `role`. See {grantRole} and
     * {revokeRole}.
     *
     * To change a role's admin, use {AccessControl-_setRoleAdmin}.
     */
    function getRoleAdmin(bytes32 role) external view returns (bytes32);

    /**
     * @dev Grants `role` to `account`.
     *
     * If `account` had not been already granted `role`, emits a {RoleGranted}
     * event.
     *
     * Requirements:
     *
     * - the caller must have ``role``'s admin role.
     */
    function grantRole(bytes32 role, address account) external;

    /**
     * @dev Revokes `role` from `account`.
     *
     * If `account` had been granted `role`, emits a {RoleRevoked} event.
     *
     * Requirements:
     *
     * - the caller must have ``role``'s admin role.
     */
    function revokeRole(bytes32 role, address account) external;

    /**
     * @dev Revokes `role` from the calling account.
     *
     * Roles are often managed via {grantRole} and {revokeRole}: this function's
     * purpose is to provide a mechanism for accounts to lose their privileges
     * if they are compromised (such as when a trusted device is misplaced).
     *
     * If the calling account had been granted `role`, emits a {RoleRevoked}
     * event.
     *
     * Requirements:
     *
     * - the caller must be `account`.
     */
    function renounceRole(bytes32 role, address account) external;
}

File 10 of 13 : Context.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (utils/Context.sol)

pragma solidity ^0.8.0;

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

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

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

pragma solidity ^0.8.0;

import "./IERC165.sol";

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

File 12 of 13 : 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 13 of 13 : IERC721Receiver.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.6.0) (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 IERC721Receiver {
    /**
     * @dev Whenever an {IERC721} `tokenId` token is transferred to this contract via {IERC721-safeTransferFrom}
     * by `operator` from `from`, this function is called.
     *
     * It must return its Solidity selector to confirm the token transfer.
     * If any other value is returned or the interface is not implemented by the recipient, the transfer will be reverted.
     *
     * The selector can be obtained in Solidity with `IERC721Receiver.onERC721Received.selector`.
     */
    function onERC721Received(
        address operator,
        address from,
        uint256 tokenId,
        bytes calldata data
    ) external returns (bytes4);
}

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

Contract Security Audit

Contract ABI

API
[{"inputs":[{"internalType":"address","name":"token_","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"account","type":"address"}],"name":"Paused","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"role","type":"bytes32"},{"indexed":true,"internalType":"bytes32","name":"previousAdminRole","type":"bytes32"},{"indexed":true,"internalType":"bytes32","name":"newAdminRole","type":"bytes32"}],"name":"RoleAdminChanged","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"role","type":"bytes32"},{"indexed":true,"internalType":"address","name":"account","type":"address"},{"indexed":true,"internalType":"address","name":"sender","type":"address"}],"name":"RoleGranted","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"role","type":"bytes32"},{"indexed":true,"internalType":"address","name":"account","type":"address"},{"indexed":true,"internalType":"address","name":"sender","type":"address"}],"name":"RoleRevoked","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"staker","type":"address"},{"indexed":true,"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"Staked","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"account","type":"address"}],"name":"Unpaused","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"staker","type":"address"},{"indexed":true,"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"Withdrawn","type":"event"},{"inputs":[],"name":"DEFAULT_ADMIN_ROLE","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"MANAGER_ROLE","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"}],"name":"balanceOf","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"}],"name":"getRoleAdmin","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"grantRole","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"hasRole","outputs":[{"internalType":"bool","name":"","type":"bool"}],"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":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"ownerOf","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"pause","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"paused","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"renounceRole","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"revokeRole","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"stake","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes4","name":"interfaceId","type":"bytes4"}],"name":"supportsInterface","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"token","outputs":[{"internalType":"contract IERC721","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"totalStaked","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"unpause","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"withdraw","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"withdrawForce","outputs":[],"stateMutability":"nonpayable","type":"function"}]

608060405234801561001057600080fd5b506040516112e73803806112e783398101604081905261002f9161011d565b60016000908155600280546001600160a81b0319166101006001600160a01b03851602179055610065906100603390565b610095565b61008f7f241ecf16d79d0f8dbfb92cbc07fe17840425976cf0667f022fe9877caa831b0833610095565b5061014d565b60008281526001602090815260408083206001600160a01b038516845290915290205460ff166101195760008281526001602081815260408084206001600160a01b0386168086529252808420805460ff19169093179092559051339285917f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d9190a45b5050565b60006020828403121561012f57600080fd5b81516001600160a01b038116811461014657600080fd5b9392505050565b61118b8061015c6000396000f3fe608060405234801561001057600080fd5b50600436106101215760003560e01c80636352211e116100ad578063a217fddf11610071578063a217fddf1461027a578063a694fc3a14610282578063d547741f14610295578063ec87621c146102a8578063fc0c546a146102bd57600080fd5b80636352211e1461021857806370a0823114610243578063817b1cd2146102565780638456cb591461025f57806391d148541461026757600080fd5b80632e1a7d4d116100f45780632e1a7d4d146101cc5780632f2ff15d146101df57806336568abe146101f25780633f4ba83a146102055780635c975abb1461020d57600080fd5b806301ffc9a71461012657806313c7ec141461014e578063150b7a0214610163578063248a9ca31461019a575b600080fd5b610139610134366004610e1a565b6102d5565b60405190151581526020015b60405180910390f35b61016161015c366004610e44565b6102e6565b005b610181610171366004610e8f565b630a85bd0160e11b949350505050565b6040516001600160e01b03199091168152602001610145565b6101be6101a8366004610e44565b6000908152600160208190526040909120015490565b604051908152602001610145565b6101616101da366004610e44565b6104a7565b6101616101ed366004610f6b565b610659565b610161610200366004610f6b565b610684565b610161610702565b60025460ff16610139565b61022b610226366004610e44565b610725565b6040516001600160a01b039091168152602001610145565b6101be610251366004610f97565b610794565b6101be60035481565b610161610823565b610139610275366004610f6b565b610843565b6101be600081565b610161610290366004610e44565b61086e565b6101616102a3366004610f6b565b6109bc565b6101be60008051602061113683398151915281565b60025461022b9061010090046001600160a01b031681565b60006102e0826109e2565b92915050565b6002600054036103115760405162461bcd60e51b815260040161030890610fb2565b60405180910390fd5b600260005560008051602061113683398151915261032e81610a17565b6000828152600560205260409020546001600160a01b0316806103935760405162461bcd60e51b815260206004820152601b60248201527f49736c616e6447315374616b696e673a206e6f74207374616b656400000000006044820152606401610308565b600083815260056020908152604080832080546001600160a01b03191690556001600160a01b0384168352600490915281208054600192906103d6908490610fff565b925050819055506001600360008282546103f09190610fff565b9091555050600254604051632142170760e11b81523060048201526001600160a01b03838116602483015260448201869052610100909204909116906342842e0e90606401600060405180830381600087803b15801561044f57600080fd5b505af1158015610463573d6000803e3d6000fd5b50506040518592506001600160a01b03841691507f7084f5476618d8e60b11ef0d7d3f06914655adb8793e28ff7f018d4c76d505d590600090a35050600160005550565b6002600054036104c95760405162461bcd60e51b815260040161030890610fb2565b60026000556104d6610a21565b6000818152600560205260409020546001600160a01b0316331461053c5760405162461bcd60e51b815260206004820152601f60248201527f49736c616e6447315374616b696e673a206e6f7420746865207374616b6572006044820152606401610308565b600081815260056020908152604080832080546001600160a01b031916905533835260049091528120805460019290610576908490610fff565b925050819055506001600360008282546105909190610fff565b909155505060025461010090046001600160a01b03166342842e0e30336040516001600160e01b031960e085901b1681526001600160a01b0392831660048201529116602482015260448101849052606401600060405180830381600087803b1580156105fc57600080fd5b505af1158015610610573d6000803e3d6000fd5b505050508061061c3390565b6001600160a01b03167f7084f5476618d8e60b11ef0d7d3f06914655adb8793e28ff7f018d4c76d505d560405160405180910390a3506001600055565b6000828152600160208190526040909120015461067581610a17565b61067f8383610a69565b505050565b6001600160a01b03811633146106f45760405162461bcd60e51b815260206004820152602f60248201527f416363657373436f6e74726f6c3a2063616e206f6e6c792072656e6f756e636560448201526e103937b632b9903337b91039b2b63360891b6064820152608401610308565b6106fe8282610ad4565b5050565b60008051602061113683398151915261071a81610a17565b610722610b3b565b50565b6000818152600560205260408120546001600160a01b0316806102e05760405162461bcd60e51b815260206004820152602160248201527f49736c616e6447315374616b696e673a20696e76616c696420746f6b656e20496044820152601160fa1b6064820152608401610308565b60006001600160a01b0382166108075760405162461bcd60e51b815260206004820152603260248201527f49736c616e6447315374616b696e673a2061646472657373207a65726f206973604482015271103737ba1030903b30b634b21037bbb732b960711b6064820152608401610308565b506001600160a01b031660009081526004602052604090205490565b60008051602061113683398151915261083b81610a17565b610722610b8d565b60009182526001602090815260408084206001600160a01b0393909316845291905290205460ff1690565b6002600054036108905760405162461bcd60e51b815260040161030890610fb2565b600260005561089d610a21565b600081815260056020908152604080832080546001600160a01b031916339081179091558352600490915281208054600192906108db908490611012565b925050819055506001600360008282546108f59190611012565b909155505060025461010090046001600160a01b03166342842e0e336040516001600160e01b031960e084901b1681526001600160a01b03909116600482015230602482015260448101849052606401600060405180830381600087803b15801561095f57600080fd5b505af1158015610973573d6000803e3d6000fd5b505050508061097f3390565b6001600160a01b03167f9e71bc8eea02a63969f509818f2dafb9254532904319f9dbda79b67bd34a5f3d60405160405180910390a3506001600055565b600082815260016020819052604090912001546109d881610a17565b61067f8383610ad4565b60006001600160e01b03198216637965db0b60e01b14806102e057506301ffc9a760e01b6001600160e01b03198316146102e0565b6107228133610bca565b60025460ff1615610a675760405162461bcd60e51b815260206004820152601060248201526f14185d5cd8589b194e881c185d5cd95960821b6044820152606401610308565b565b610a738282610843565b6106fe5760008281526001602081815260408084206001600160a01b0386168086529252808420805460ff19169093179092559051339285917f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d9190a45050565b610ade8282610843565b156106fe5760008281526001602090815260408083206001600160a01b0385168085529252808320805460ff1916905551339285917ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b9190a45050565b610b43610c2e565b6002805460ff191690557f5db9ee0a495bf2e6ff9c91a7834c1ba4fdd244a5e8aa4e537bd38aeae4b073aa335b6040516001600160a01b03909116815260200160405180910390a1565b610b95610a21565b6002805460ff191660011790557f62e78cea01bee320cd4e420270b5ea74000d11b0c9f74754ebdbfc544b05a258610b703390565b610bd48282610843565b6106fe57610bec816001600160a01b03166014610c77565b610bf7836020610c77565b604051602001610c08929190611049565b60408051601f198184030181529082905262461bcd60e51b8252610308916004016110be565b60025460ff16610a675760405162461bcd60e51b815260206004820152601460248201527314185d5cd8589b194e881b9bdd081c185d5cd95960621b6044820152606401610308565b60606000610c868360026110f1565b610c91906002611012565b67ffffffffffffffff811115610ca957610ca9610e79565b6040519080825280601f01601f191660200182016040528015610cd3576020820181803683370190505b509050600360fc1b81600081518110610cee57610cee611108565b60200101906001600160f81b031916908160001a905350600f60fb1b81600181518110610d1d57610d1d611108565b60200101906001600160f81b031916908160001a9053506000610d418460026110f1565b610d4c906001611012565b90505b6001811115610dc4576f181899199a1a9b1b9c1cb0b131b232b360811b85600f1660108110610d8057610d80611108565b1a60f81b828281518110610d9657610d96611108565b60200101906001600160f81b031916908160001a90535060049490941c93610dbd8161111e565b9050610d4f565b508315610e135760405162461bcd60e51b815260206004820181905260248201527f537472696e67733a20686578206c656e67746820696e73756666696369656e746044820152606401610308565b9392505050565b600060208284031215610e2c57600080fd5b81356001600160e01b031981168114610e1357600080fd5b600060208284031215610e5657600080fd5b5035919050565b80356001600160a01b0381168114610e7457600080fd5b919050565b634e487b7160e01b600052604160045260246000fd5b60008060008060808587031215610ea557600080fd5b610eae85610e5d565b9350610ebc60208601610e5d565b925060408501359150606085013567ffffffffffffffff80821115610ee057600080fd5b818701915087601f830112610ef457600080fd5b813581811115610f0657610f06610e79565b604051601f8201601f19908116603f01168101908382118183101715610f2e57610f2e610e79565b816040528281528a6020848701011115610f4757600080fd5b82602086016020830137600060208483010152809550505050505092959194509250565b60008060408385031215610f7e57600080fd5b82359150610f8e60208401610e5d565b90509250929050565b600060208284031215610fa957600080fd5b610e1382610e5d565b6020808252601f908201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c00604082015260600190565b634e487b7160e01b600052601160045260246000fd5b818103818111156102e0576102e0610fe9565b808201808211156102e0576102e0610fe9565b60005b83811015611040578181015183820152602001611028565b50506000910152565b7f416363657373436f6e74726f6c3a206163636f756e7420000000000000000000815260008351611081816017850160208801611025565b7001034b99036b4b9b9b4b733903937b6329607d1b60179184019182015283516110b2816028840160208801611025565b01602801949350505050565b60208152600082518060208401526110dd816040850160208701611025565b601f01601f19169190910160400192915050565b80820281158282048414176102e0576102e0610fe9565b634e487b7160e01b600052603260045260246000fd5b60008161112d5761112d610fe9565b50600019019056fe241ecf16d79d0f8dbfb92cbc07fe17840425976cf0667f022fe9877caa831b08a2646970667358221220d04cb42efe115d3a1f9f5842249ff9eb11c42986844bf4fac959bc1d7cec06c564736f6c6343000811003300000000000000000000000051946231074a627487ee3173a9a35b8aaee5a80a

Deployed Bytecode

0x608060405234801561001057600080fd5b50600436106101215760003560e01c80636352211e116100ad578063a217fddf11610071578063a217fddf1461027a578063a694fc3a14610282578063d547741f14610295578063ec87621c146102a8578063fc0c546a146102bd57600080fd5b80636352211e1461021857806370a0823114610243578063817b1cd2146102565780638456cb591461025f57806391d148541461026757600080fd5b80632e1a7d4d116100f45780632e1a7d4d146101cc5780632f2ff15d146101df57806336568abe146101f25780633f4ba83a146102055780635c975abb1461020d57600080fd5b806301ffc9a71461012657806313c7ec141461014e578063150b7a0214610163578063248a9ca31461019a575b600080fd5b610139610134366004610e1a565b6102d5565b60405190151581526020015b60405180910390f35b61016161015c366004610e44565b6102e6565b005b610181610171366004610e8f565b630a85bd0160e11b949350505050565b6040516001600160e01b03199091168152602001610145565b6101be6101a8366004610e44565b6000908152600160208190526040909120015490565b604051908152602001610145565b6101616101da366004610e44565b6104a7565b6101616101ed366004610f6b565b610659565b610161610200366004610f6b565b610684565b610161610702565b60025460ff16610139565b61022b610226366004610e44565b610725565b6040516001600160a01b039091168152602001610145565b6101be610251366004610f97565b610794565b6101be60035481565b610161610823565b610139610275366004610f6b565b610843565b6101be600081565b610161610290366004610e44565b61086e565b6101616102a3366004610f6b565b6109bc565b6101be60008051602061113683398151915281565b60025461022b9061010090046001600160a01b031681565b60006102e0826109e2565b92915050565b6002600054036103115760405162461bcd60e51b815260040161030890610fb2565b60405180910390fd5b600260005560008051602061113683398151915261032e81610a17565b6000828152600560205260409020546001600160a01b0316806103935760405162461bcd60e51b815260206004820152601b60248201527f49736c616e6447315374616b696e673a206e6f74207374616b656400000000006044820152606401610308565b600083815260056020908152604080832080546001600160a01b03191690556001600160a01b0384168352600490915281208054600192906103d6908490610fff565b925050819055506001600360008282546103f09190610fff565b9091555050600254604051632142170760e11b81523060048201526001600160a01b03838116602483015260448201869052610100909204909116906342842e0e90606401600060405180830381600087803b15801561044f57600080fd5b505af1158015610463573d6000803e3d6000fd5b50506040518592506001600160a01b03841691507f7084f5476618d8e60b11ef0d7d3f06914655adb8793e28ff7f018d4c76d505d590600090a35050600160005550565b6002600054036104c95760405162461bcd60e51b815260040161030890610fb2565b60026000556104d6610a21565b6000818152600560205260409020546001600160a01b0316331461053c5760405162461bcd60e51b815260206004820152601f60248201527f49736c616e6447315374616b696e673a206e6f7420746865207374616b6572006044820152606401610308565b600081815260056020908152604080832080546001600160a01b031916905533835260049091528120805460019290610576908490610fff565b925050819055506001600360008282546105909190610fff565b909155505060025461010090046001600160a01b03166342842e0e30336040516001600160e01b031960e085901b1681526001600160a01b0392831660048201529116602482015260448101849052606401600060405180830381600087803b1580156105fc57600080fd5b505af1158015610610573d6000803e3d6000fd5b505050508061061c3390565b6001600160a01b03167f7084f5476618d8e60b11ef0d7d3f06914655adb8793e28ff7f018d4c76d505d560405160405180910390a3506001600055565b6000828152600160208190526040909120015461067581610a17565b61067f8383610a69565b505050565b6001600160a01b03811633146106f45760405162461bcd60e51b815260206004820152602f60248201527f416363657373436f6e74726f6c3a2063616e206f6e6c792072656e6f756e636560448201526e103937b632b9903337b91039b2b63360891b6064820152608401610308565b6106fe8282610ad4565b5050565b60008051602061113683398151915261071a81610a17565b610722610b3b565b50565b6000818152600560205260408120546001600160a01b0316806102e05760405162461bcd60e51b815260206004820152602160248201527f49736c616e6447315374616b696e673a20696e76616c696420746f6b656e20496044820152601160fa1b6064820152608401610308565b60006001600160a01b0382166108075760405162461bcd60e51b815260206004820152603260248201527f49736c616e6447315374616b696e673a2061646472657373207a65726f206973604482015271103737ba1030903b30b634b21037bbb732b960711b6064820152608401610308565b506001600160a01b031660009081526004602052604090205490565b60008051602061113683398151915261083b81610a17565b610722610b8d565b60009182526001602090815260408084206001600160a01b0393909316845291905290205460ff1690565b6002600054036108905760405162461bcd60e51b815260040161030890610fb2565b600260005561089d610a21565b600081815260056020908152604080832080546001600160a01b031916339081179091558352600490915281208054600192906108db908490611012565b925050819055506001600360008282546108f59190611012565b909155505060025461010090046001600160a01b03166342842e0e336040516001600160e01b031960e084901b1681526001600160a01b03909116600482015230602482015260448101849052606401600060405180830381600087803b15801561095f57600080fd5b505af1158015610973573d6000803e3d6000fd5b505050508061097f3390565b6001600160a01b03167f9e71bc8eea02a63969f509818f2dafb9254532904319f9dbda79b67bd34a5f3d60405160405180910390a3506001600055565b600082815260016020819052604090912001546109d881610a17565b61067f8383610ad4565b60006001600160e01b03198216637965db0b60e01b14806102e057506301ffc9a760e01b6001600160e01b03198316146102e0565b6107228133610bca565b60025460ff1615610a675760405162461bcd60e51b815260206004820152601060248201526f14185d5cd8589b194e881c185d5cd95960821b6044820152606401610308565b565b610a738282610843565b6106fe5760008281526001602081815260408084206001600160a01b0386168086529252808420805460ff19169093179092559051339285917f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d9190a45050565b610ade8282610843565b156106fe5760008281526001602090815260408083206001600160a01b0385168085529252808320805460ff1916905551339285917ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b9190a45050565b610b43610c2e565b6002805460ff191690557f5db9ee0a495bf2e6ff9c91a7834c1ba4fdd244a5e8aa4e537bd38aeae4b073aa335b6040516001600160a01b03909116815260200160405180910390a1565b610b95610a21565b6002805460ff191660011790557f62e78cea01bee320cd4e420270b5ea74000d11b0c9f74754ebdbfc544b05a258610b703390565b610bd48282610843565b6106fe57610bec816001600160a01b03166014610c77565b610bf7836020610c77565b604051602001610c08929190611049565b60408051601f198184030181529082905262461bcd60e51b8252610308916004016110be565b60025460ff16610a675760405162461bcd60e51b815260206004820152601460248201527314185d5cd8589b194e881b9bdd081c185d5cd95960621b6044820152606401610308565b60606000610c868360026110f1565b610c91906002611012565b67ffffffffffffffff811115610ca957610ca9610e79565b6040519080825280601f01601f191660200182016040528015610cd3576020820181803683370190505b509050600360fc1b81600081518110610cee57610cee611108565b60200101906001600160f81b031916908160001a905350600f60fb1b81600181518110610d1d57610d1d611108565b60200101906001600160f81b031916908160001a9053506000610d418460026110f1565b610d4c906001611012565b90505b6001811115610dc4576f181899199a1a9b1b9c1cb0b131b232b360811b85600f1660108110610d8057610d80611108565b1a60f81b828281518110610d9657610d96611108565b60200101906001600160f81b031916908160001a90535060049490941c93610dbd8161111e565b9050610d4f565b508315610e135760405162461bcd60e51b815260206004820181905260248201527f537472696e67733a20686578206c656e67746820696e73756666696369656e746044820152606401610308565b9392505050565b600060208284031215610e2c57600080fd5b81356001600160e01b031981168114610e1357600080fd5b600060208284031215610e5657600080fd5b5035919050565b80356001600160a01b0381168114610e7457600080fd5b919050565b634e487b7160e01b600052604160045260246000fd5b60008060008060808587031215610ea557600080fd5b610eae85610e5d565b9350610ebc60208601610e5d565b925060408501359150606085013567ffffffffffffffff80821115610ee057600080fd5b818701915087601f830112610ef457600080fd5b813581811115610f0657610f06610e79565b604051601f8201601f19908116603f01168101908382118183101715610f2e57610f2e610e79565b816040528281528a6020848701011115610f4757600080fd5b82602086016020830137600060208483010152809550505050505092959194509250565b60008060408385031215610f7e57600080fd5b82359150610f8e60208401610e5d565b90509250929050565b600060208284031215610fa957600080fd5b610e1382610e5d565b6020808252601f908201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c00604082015260600190565b634e487b7160e01b600052601160045260246000fd5b818103818111156102e0576102e0610fe9565b808201808211156102e0576102e0610fe9565b60005b83811015611040578181015183820152602001611028565b50506000910152565b7f416363657373436f6e74726f6c3a206163636f756e7420000000000000000000815260008351611081816017850160208801611025565b7001034b99036b4b9b9b4b733903937b6329607d1b60179184019182015283516110b2816028840160208801611025565b01602801949350505050565b60208152600082518060208401526110dd816040850160208701611025565b601f01601f19169190910160400192915050565b80820281158282048414176102e0576102e0610fe9565b634e487b7160e01b600052603260045260246000fd5b60008161112d5761112d610fe9565b50600019019056fe241ecf16d79d0f8dbfb92cbc07fe17840425976cf0667f022fe9877caa831b08a2646970667358221220d04cb42efe115d3a1f9f5842249ff9eb11c42986844bf4fac959bc1d7cec06c564736f6c63430008110033

Constructor Arguments (ABI-Encoded and is the last bytes of the Contract Creation Code above)

00000000000000000000000051946231074a627487ee3173a9a35b8aaee5a80a

-----Decoded View---------------
Arg [0] : token_ (address): 0x51946231074a627487eE3173a9A35B8aAeE5a80a

-----Encoded View---------------
1 Constructor Arguments found :
Arg [0] : 00000000000000000000000051946231074a627487ee3173a9a35b8aaee5a80a


Block Transaction Difficulty Gas Used Reward
View All Blocks Produced

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

Validator Index Block Amount
View All Withdrawals

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

A contract address hosts a smart contract, which is a set of code stored on the blockchain that runs when predetermined conditions are met. Learn more about addresses in our Knowledge Base.