S Price: $0.563841 (-6.47%)

Contract

0xb7b7B8DF8cAF2829971329BD71D0b7127D0734be

Overview

S Balance

Sonic LogoSonic LogoSonic Logo0 S

S Value

$0.00

Multichain Info

No addresses found
Transaction Hash
Method
Block
From
To
Set Factory7685752024-12-19 22:28:1598 days ago1734647295IN
0xb7b7B8DF...27D0734be
0 S0.000030691.1

Latest 6 internal transactions

Parent Transaction Hash Block From To
32851182025-01-10 17:54:1276 days ago1736531652
0xb7b7B8DF...27D0734be
 Contract Creation0 S
31871102025-01-10 0:42:2177 days ago1736469741
0xb7b7B8DF...27D0734be
 Contract Creation0 S
31869982025-01-10 0:40:3377 days ago1736469633
0xb7b7B8DF...27D0734be
 Contract Creation0 S
31866442025-01-10 0:37:3277 days ago1736469452
0xb7b7B8DF...27D0734be
 Contract Creation0 S
13700642024-12-23 17:50:4094 days ago1734976240
0xb7b7B8DF...27D0734be
 Contract Creation0 S
9190102024-12-20 19:22:0197 days ago1734722521
0xb7b7B8DF...27D0734be
 Contract Creation0 S
Loading...
Loading

Contract Source Code Verified (Exact Match)

Contract Name:
XGBTFactory

Compiler Version
v0.8.24+commit.e11b9ed9

Optimization Enabled:
Yes with 200 runs

Other Settings:
paris EvmVersion
File 1 of 10 : XGBTFactory.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.11;

import "@openzeppelin/contracts/token/ERC20/IERC20.sol";
import "@openzeppelin/contracts/token/ERC721/IERC721.sol";
import "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol";
import "@openzeppelin/contracts/token/ERC721/IERC721Receiver.sol";
import "@openzeppelin/contracts/security/ReentrancyGuard.sol";
import "@openzeppelin/contracts/utils/math/Math.sol";

interface IGBT {
    function mustStayGBT(address account) external view returns (uint256);
    function getArtist() external view returns (address);
}

contract XGBT is ReentrancyGuard {
    using SafeERC20 for IERC20;

    uint256 public constant DURATION = 7 days;

    /* ========== STATE VARIABLES ========== */

    struct Reward {
        uint256 periodFinish;
        uint256 rewardRate;
        uint256 lastUpdateTime;
        uint256 rewardPerTokenStored;
    }

    IERC20 public immutable stakingToken;
    IERC721 public immutable stakingNFT;
    address public immutable factory;
    mapping(address => Reward) public rewardData;
    mapping(address => bool) public isRewardToken;
    address[] public rewardTokens;

    // user -> reward token -> amount
    mapping(address => mapping(address => uint256)) public userRewardPerTokenPaid;
    mapping(address => mapping(address => uint256)) public rewards;

    uint256 private _totalSupply; 
    mapping(address => uint256) private _balances;

    mapping(address => uint256) public balanceToken; // Accounts deposited GBTs
    mapping(address => uint256[]) public balanceNFT; // Accounts deposited NFTs

    uint256 private _totalToken;
    uint256 private _totalNFT;

    /* ========== CONSTRUCTOR ========== */

    constructor(
        address _factory,
        address _stakingToken,
        address _stakingNFT
    ) {
        factory = _factory;
        stakingToken = IERC20(_stakingToken);
        stakingNFT = IERC721(_stakingNFT);
    }

    function addReward(address _rewardsToken) external {
        require(msg.sender == factory || msg.sender == IGBT(address(stakingToken)).getArtist(), "!AUTH");
        require(!isRewardToken[_rewardsToken], "Reward token already exists");
        rewardTokens.push(_rewardsToken);
        isRewardToken[_rewardsToken] = true;
        emit RewardAdded(_rewardsToken);
    } 

    /* ========== VIEWS ========== */

    function balanceOfNFT(address user) external view returns (uint256 length, uint256[] memory arr) {
        return (balanceNFT[user].length, balanceNFT[user]);
    }

    function totalSupply() external view returns (uint256) {
        return _totalSupply;
    }

    function balanceOf(address account) external view returns (uint256) {
        return _balances[account];
    }

    function getRewardTokens() external view returns (address[] memory) {
        return rewardTokens;
    }

    function lastTimeRewardApplicable(address _rewardsToken) public view returns (uint256) {
        return Math.min(block.timestamp, rewardData[_rewardsToken].periodFinish);
    }

    function rewardPerToken(address _rewardsToken) public view returns (uint256) {
        if (_totalSupply == 0) {
            return rewardData[_rewardsToken].rewardPerTokenStored;
        }
        return
            rewardData[_rewardsToken].rewardPerTokenStored + ((lastTimeRewardApplicable(_rewardsToken) - rewardData[_rewardsToken].lastUpdateTime) * rewardData[_rewardsToken].rewardRate * 1e18 / _totalSupply);
    }

    function earned(address account, address _rewardsToken) public view returns (uint256) {
        return (_balances[account] * (rewardPerToken(_rewardsToken) - userRewardPerTokenPaid[account][_rewardsToken]) / 1e18) + rewards[account][_rewardsToken];
    }

    function getRewardForDuration(address _rewardsToken) external view returns (uint256) {
        return rewardData[_rewardsToken].rewardRate * DURATION;
    }

    /* ========== MUTATIVE FUNCTIONS ========== */

    function onERC721Received(address operator, address from, uint256 tokenId, bytes calldata data) public view returns (bytes4) {
        return IERC721Receiver(address(this)).onERC721Received.selector;
    }

    function depositToken(uint256 amount) external nonReentrant updateReward(msg.sender) {
        address account = msg.sender;
        require(amount > 0, "Cannot deposit 0");
        _totalToken += amount;
        _totalSupply += amount;
        
        balanceToken[account] = balanceToken[account] + amount;
        _balances[account] = _balances[account] + amount;
        stakingToken.safeTransferFrom(account, address(this), amount);
        emit Deposited(account, amount);
    }

    function withdrawToken(uint256 amount) external nonReentrant updateReward(msg.sender) {
        address account = msg.sender;
        require(amount > 0, "Cannot withdraw 0");
        require(amount <= balanceToken[account], "Insufficient balance"); 
        _totalToken -= amount;
        _totalSupply -= amount;
        
        balanceToken[account] = balanceToken[account] - amount;
        _balances[account] = _balances[account] - amount;
        require(_balances[account] >= IGBT(address(stakingToken)).mustStayGBT(account), "Borrow debt");
        stakingToken.safeTransfer(msg.sender, amount);
        emit Withdrawn(account, amount);
    }

        /** @dev Stake Gumball(s) NFTs to receive rewards
      * @param _id is an array of Gumballs desired for staking
    */
    function depositNFT(uint256[] calldata _id) external nonReentrant updateReward(msg.sender) {
        address account = msg.sender;
        require(_id.length > 0, "Cannot deposit 0");
        uint256 amount = _id.length * 1e18;
        _totalNFT += amount;
        _totalSupply += amount;
        _balances[account] = _balances[account] + amount;

        for (uint256 i = 0; i < _id.length; i++) {
            balanceNFT[account].push(_id[i]);
            IERC721(stakingNFT).transferFrom(account, address(this), _id[i]);
        }

        emit DepositNFT(msg.sender, address(stakingNFT), _id);
    }

    /** @dev Remove Gumball(s) from the contract and leave staking
      * @param _id is an array of Gumballs desired for unstaking
    */
    function withdrawNFT(uint256[] calldata _id) external nonReentrant updateReward(msg.sender) {
        address account = msg.sender;
        require(balanceNFT[account].length >= _id.length, "Withdrawal underflow");
        uint256 amount = _id.length * 1e18;

        for (uint256 i = 0; i < _id.length; i++) {
            uint256 ind = findNFT(account, _id[i]);
            _pop(account, ind);
        }

        _totalNFT -= amount;
        _totalSupply -= amount;
        _balances[account] = _balances[account] - amount;
        require(_balances[account] >= IGBT(address(stakingToken)).mustStayGBT(account), "Borrow debt");

        for (uint256 i = 0; i <_id.length; i++) {
            IERC721(stakingNFT).transferFrom(address(this), account, _id[i]);
        }

        emit WithdrawNFT(msg.sender, address(stakingNFT), _id);
    }

    function getReward(address account) external nonReentrant updateReward(account) {
        for (uint i; i < rewardTokens.length; i++) {
            address _rewardsToken = rewardTokens[i];
            uint256 reward = rewards[account][_rewardsToken];
            if (reward > 0) {
                rewards[account][_rewardsToken] = 0;
                IERC20(_rewardsToken).safeTransfer(account, reward);
                emit RewardPaid(account, _rewardsToken, reward);
            }
        }
        require(IERC20(stakingToken).balanceOf(address(this)) >= _totalToken);
    }

    /* ========== RESTRICTED FUNCTIONS ========== */

    function notifyRewardAmount(address _rewardsToken, uint256 reward) external updateReward(address(0)) {
        // handle the transfer of reward tokens via `transferFrom` to reduce the number
        // of transactions required and ensure correctness of the reward amount
        require(reward > DURATION, "<DURATION");
        IERC20(_rewardsToken).safeTransferFrom(msg.sender, address(this), reward);

        if (block.timestamp >= rewardData[_rewardsToken].periodFinish) {
            rewardData[_rewardsToken].rewardRate = reward / DURATION;
        } else {
            uint256 remaining = rewardData[_rewardsToken].periodFinish - block.timestamp;
            uint256 leftover = remaining * rewardData[_rewardsToken].rewardRate;
            rewardData[_rewardsToken].rewardRate = (reward + leftover) / DURATION;
        }

        rewardData[_rewardsToken].lastUpdateTime = block.timestamp;
        rewardData[_rewardsToken].periodFinish = block.timestamp + DURATION;
        emit RewardNotified(reward);
    }

    /* ========== INTERNAL FUNCTIONS ========== */

    /** @dev Locates gumball in an array */
    function findNFT(address user, uint256 _id) internal view returns (uint256 _index) {

        uint256 index;
        bool found = false;
        
        for (uint256 i = 0; i < balanceNFT[user].length; i++) {
            if (balanceNFT[user][i] == _id) {
                index = i;
                found = true;
                break;
            } 
        }

        if (!found) {
            revert ("!Found");
        } else {
            return index;
        }
    }

    /** @dev Removes an index from an array */
    function _pop(address user, uint256 _index) internal {
        uint256 tempID;
        uint256 swapID;

        tempID = balanceNFT[user][_index];
        swapID = balanceNFT[user][balanceNFT[user].length - 1];
        balanceNFT[user][_index] = swapID;
        balanceNFT[user][balanceNFT[user].length - 1] = tempID;

        balanceNFT[user].pop();
    }

    /* ========== MODIFIERS ========== */

    modifier updateReward(address account) {
        for (uint i; i < rewardTokens.length; i++) {
            address token = rewardTokens[i];
            rewardData[token].rewardPerTokenStored = rewardPerToken(token);
            rewardData[token].lastUpdateTime = lastTimeRewardApplicable(token);
            if (account != address(0)) {
                rewards[account][token] = earned(account, token);
                userRewardPerTokenPaid[account][token] = rewardData[token].rewardPerTokenStored;
            }
        }
        _;
    }

    /* ========== EVENTS ========== */

    event RewardNotified(uint256 reward);
    event Deposited(address indexed user, uint256 amount);
    event Withdrawn(address indexed user, uint256 amount);
    event DepositNFT(address indexed user, address colleciton, uint256[] id);
    event WithdrawNFT(address indexed user, address collection, uint256[] id);
    event RewardPaid(address indexed user, address indexed rewardsToken, uint256 reward);
    event RewardAdded(address reward);
}

contract XGBTFactory {
    address public factory;
    address public lastXGBT;

    event FactorySet(address indexed _factory);

    constructor() {
        factory = msg.sender;
    }

    function setFactory(address _factory) external OnlyFactory {
        factory = _factory;
        emit FactorySet(_factory);
    }

    function createXGBT(
        address _owner,
        address _stakingToken,
        address _stakingNFT
    ) external OnlyFactory returns (address) {
        XGBT newXGBT = new XGBT(_owner, _stakingToken, _stakingNFT);
        lastXGBT = address(newXGBT);
        return lastXGBT;
    }

    modifier OnlyFactory() {
        require(msg.sender == factory, "!AUTH");
        _;
    }
}

File 2 of 10 : ReentrancyGuard.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.8.0) (security/ReentrancyGuard.sol)

pragma solidity ^0.8.0;

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

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

    uint256 private _status;

    constructor() {
        _status = _NOT_ENTERED;
    }

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

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

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

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

File 3 of 10 : draft-IERC20Permit.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (token/ERC20/extensions/draft-IERC20Permit.sol)

pragma solidity ^0.8.0;

/**
 * @dev Interface of the ERC20 Permit extension allowing approvals to be made via signatures, as defined in
 * https://eips.ethereum.org/EIPS/eip-2612[EIP-2612].
 *
 * Adds the {permit} method, which can be used to change an account's ERC20 allowance (see {IERC20-allowance}) by
 * presenting a message signed by the account. By not relying on {IERC20-approve}, the token holder account doesn't
 * need to send a transaction, and thus is not required to hold Ether at all.
 */
interface IERC20Permit {
    /**
     * @dev Sets `value` as the allowance of `spender` over ``owner``'s tokens,
     * given ``owner``'s signed approval.
     *
     * IMPORTANT: The same issues {IERC20-approve} has related to transaction
     * ordering also apply here.
     *
     * Emits an {Approval} event.
     *
     * Requirements:
     *
     * - `spender` cannot be the zero address.
     * - `deadline` must be a timestamp in the future.
     * - `v`, `r` and `s` must be a valid `secp256k1` signature from `owner`
     * over the EIP712-formatted function arguments.
     * - the signature must use ``owner``'s current nonce (see {nonces}).
     *
     * For more information on the signature format, see the
     * https://eips.ethereum.org/EIPS/eip-2612#specification[relevant EIP
     * section].
     */
    function permit(
        address owner,
        address spender,
        uint256 value,
        uint256 deadline,
        uint8 v,
        bytes32 r,
        bytes32 s
    ) external;

    /**
     * @dev Returns the current nonce for `owner`. This value must be
     * included whenever a signature is generated for {permit}.
     *
     * Every successful call to {permit} increases ``owner``'s nonce by one. This
     * prevents a signature from being used multiple times.
     */
    function nonces(address owner) external view returns (uint256);

    /**
     * @dev Returns the domain separator used in the encoding of the signature for {permit}, as defined by {EIP712}.
     */
    // solhint-disable-next-line func-name-mixedcase
    function DOMAIN_SEPARATOR() external view returns (bytes32);
}

File 4 of 10 : IERC20.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.6.0) (token/ERC20/IERC20.sol)

pragma solidity ^0.8.0;

/**
 * @dev Interface of the ERC20 standard as defined in the EIP.
 */
interface IERC20 {
    /**
     * @dev Emitted when `value` tokens are moved from one account (`from`) to
     * another (`to`).
     *
     * Note that `value` may be zero.
     */
    event Transfer(address indexed from, address indexed to, uint256 value);

    /**
     * @dev Emitted when the allowance of a `spender` for an `owner` is set by
     * a call to {approve}. `value` is the new allowance.
     */
    event Approval(address indexed owner, address indexed spender, uint256 value);

    /**
     * @dev Returns the amount of tokens in existence.
     */
    function totalSupply() external view returns (uint256);

    /**
     * @dev Returns the amount of tokens owned by `account`.
     */
    function balanceOf(address account) external view returns (uint256);

    /**
     * @dev Moves `amount` tokens from the caller's account to `to`.
     *
     * Returns a boolean value indicating whether the operation succeeded.
     *
     * Emits a {Transfer} event.
     */
    function transfer(address to, uint256 amount) external returns (bool);

    /**
     * @dev Returns the remaining number of tokens that `spender` will be
     * allowed to spend on behalf of `owner` through {transferFrom}. This is
     * zero by default.
     *
     * This value changes when {approve} or {transferFrom} are called.
     */
    function allowance(address owner, address spender) external view returns (uint256);

    /**
     * @dev Sets `amount` as the allowance of `spender` over the caller's tokens.
     *
     * Returns a boolean value indicating whether the operation succeeded.
     *
     * IMPORTANT: Beware that changing an allowance with this method brings the risk
     * that someone may use both the old and the new allowance by unfortunate
     * transaction ordering. One possible solution to mitigate this race
     * condition is to first reduce the spender's allowance to 0 and set the
     * desired value afterwards:
     * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729
     *
     * Emits an {Approval} event.
     */
    function approve(address spender, uint256 amount) external returns (bool);

    /**
     * @dev Moves `amount` tokens from `from` to `to` using the
     * allowance mechanism. `amount` is then deducted from the caller's
     * allowance.
     *
     * Returns a boolean value indicating whether the operation succeeded.
     *
     * Emits a {Transfer} event.
     */
    function transferFrom(
        address from,
        address to,
        uint256 amount
    ) external returns (bool);
}

File 5 of 10 : SafeERC20.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.8.0) (token/ERC20/utils/SafeERC20.sol)

pragma solidity ^0.8.0;

import "../IERC20.sol";
import "../extensions/draft-IERC20Permit.sol";
import "../../../utils/Address.sol";

/**
 * @title SafeERC20
 * @dev Wrappers around ERC20 operations that throw on failure (when the token
 * contract returns false). Tokens that return no value (and instead revert or
 * throw on failure) are also supported, non-reverting calls are assumed to be
 * successful.
 * To use this library you can add a `using SafeERC20 for IERC20;` statement to your contract,
 * which allows you to call the safe operations as `token.safeTransfer(...)`, etc.
 */
library SafeERC20 {
    using Address for address;

    function safeTransfer(
        IERC20 token,
        address to,
        uint256 value
    ) internal {
        _callOptionalReturn(token, abi.encodeWithSelector(token.transfer.selector, to, value));
    }

    function safeTransferFrom(
        IERC20 token,
        address from,
        address to,
        uint256 value
    ) internal {
        _callOptionalReturn(token, abi.encodeWithSelector(token.transferFrom.selector, from, to, value));
    }

    /**
     * @dev Deprecated. This function has issues similar to the ones found in
     * {IERC20-approve}, and its usage is discouraged.
     *
     * Whenever possible, use {safeIncreaseAllowance} and
     * {safeDecreaseAllowance} instead.
     */
    function safeApprove(
        IERC20 token,
        address spender,
        uint256 value
    ) internal {
        // safeApprove should only be called when setting an initial allowance,
        // or when resetting it to zero. To increase and decrease it, use
        // 'safeIncreaseAllowance' and 'safeDecreaseAllowance'
        require(
            (value == 0) || (token.allowance(address(this), spender) == 0),
            "SafeERC20: approve from non-zero to non-zero allowance"
        );
        _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, value));
    }

    function safeIncreaseAllowance(
        IERC20 token,
        address spender,
        uint256 value
    ) internal {
        uint256 newAllowance = token.allowance(address(this), spender) + value;
        _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance));
    }

    function safeDecreaseAllowance(
        IERC20 token,
        address spender,
        uint256 value
    ) internal {
        unchecked {
            uint256 oldAllowance = token.allowance(address(this), spender);
            require(oldAllowance >= value, "SafeERC20: decreased allowance below zero");
            uint256 newAllowance = oldAllowance - value;
            _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance));
        }
    }

    function safePermit(
        IERC20Permit token,
        address owner,
        address spender,
        uint256 value,
        uint256 deadline,
        uint8 v,
        bytes32 r,
        bytes32 s
    ) internal {
        uint256 nonceBefore = token.nonces(owner);
        token.permit(owner, spender, value, deadline, v, r, s);
        uint256 nonceAfter = token.nonces(owner);
        require(nonceAfter == nonceBefore + 1, "SafeERC20: permit did not succeed");
    }

    /**
     * @dev Imitates a Solidity high-level call (i.e. a regular function call to a contract), relaxing the requirement
     * on the return value: the return value is optional (but if data is returned, it must not be false).
     * @param token The token targeted by the call.
     * @param data The call data (encoded using abi.encode or one of its variants).
     */
    function _callOptionalReturn(IERC20 token, bytes memory data) private {
        // We need to perform a low level call here, to bypass Solidity's return data size checking mechanism, since
        // we're implementing it ourselves. We use {Address-functionCall} to perform this call, which verifies that
        // the target address contains contract code and also asserts for success in the low-level call.

        bytes memory returndata = address(token).functionCall(data, "SafeERC20: low-level call failed");
        if (returndata.length > 0) {
            // Return data is optional
            require(abi.decode(returndata, (bool)), "SafeERC20: ERC20 operation did not succeed");
        }
    }
}

File 6 of 10 : IERC721.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.8.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: Note that the caller is responsible to confirm that the recipient is capable of receiving ERC721
     * or else they may be permanently lost. Usage of {safeTransferFrom} prevents loss, though the caller must
     * understand this adds an external call which potentially creates a reentrancy vulnerability.
     *
     * 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 7 of 10 : 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);
}

File 8 of 10 : Address.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.8.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 functionCallWithValue(target, data, 0, "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");
        (bool success, bytes memory returndata) = target.call{value: value}(data);
        return verifyCallResultFromTarget(target, 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) {
        (bool success, bytes memory returndata) = target.staticcall(data);
        return verifyCallResultFromTarget(target, 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) {
        (bool success, bytes memory returndata) = target.delegatecall(data);
        return verifyCallResultFromTarget(target, success, returndata, errorMessage);
    }

    /**
     * @dev Tool to verify that a low level call to smart-contract was successful, and revert (either by bubbling
     * the revert reason or using the provided one) in case of unsuccessful call or if target was not a contract.
     *
     * _Available since v4.8._
     */
    function verifyCallResultFromTarget(
        address target,
        bool success,
        bytes memory returndata,
        string memory errorMessage
    ) internal view returns (bytes memory) {
        if (success) {
            if (returndata.length == 0) {
                // only check isContract if the call was successful and the return data is empty
                // otherwise we already know that it was a contract
                require(isContract(target), "Address: call to non-contract");
            }
            return returndata;
        } else {
            _revert(returndata, errorMessage);
        }
    }

    /**
     * @dev Tool to verify that a low level call was successful, and revert if it wasn't, either by bubbling the
     * revert reason or 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 {
            _revert(returndata, errorMessage);
        }
    }

    function _revert(bytes memory returndata, string memory errorMessage) private pure {
        // 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 9 of 10 : 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 10 of 10 : Math.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.8.0) (utils/math/Math.sol)

pragma solidity ^0.8.0;

/**
 * @dev Standard math utilities missing in the Solidity language.
 */
library Math {
    enum Rounding {
        Down, // Toward negative infinity
        Up, // Toward infinity
        Zero // Toward zero
    }

    /**
     * @dev Returns the largest of two numbers.
     */
    function max(uint256 a, uint256 b) internal pure returns (uint256) {
        return a > b ? a : b;
    }

    /**
     * @dev Returns the smallest of two numbers.
     */
    function min(uint256 a, uint256 b) internal pure returns (uint256) {
        return a < b ? a : b;
    }

    /**
     * @dev Returns the average of two numbers. The result is rounded towards
     * zero.
     */
    function average(uint256 a, uint256 b) internal pure returns (uint256) {
        // (a + b) / 2 can overflow.
        return (a & b) + (a ^ b) / 2;
    }

    /**
     * @dev Returns the ceiling of the division of two numbers.
     *
     * This differs from standard division with `/` in that it rounds up instead
     * of rounding down.
     */
    function ceilDiv(uint256 a, uint256 b) internal pure returns (uint256) {
        // (a + b - 1) / b can overflow on addition, so we distribute.
        return a == 0 ? 0 : (a - 1) / b + 1;
    }

    /**
     * @notice Calculates floor(x * y / denominator) with full precision. Throws if result overflows a uint256 or denominator == 0
     * @dev Original credit to Remco Bloemen under MIT license (https://xn--2-umb.com/21/muldiv)
     * with further edits by Uniswap Labs also under MIT license.
     */
    function mulDiv(
        uint256 x,
        uint256 y,
        uint256 denominator
    ) internal pure returns (uint256 result) {
        unchecked {
            // 512-bit multiply [prod1 prod0] = x * y. Compute the product mod 2^256 and mod 2^256 - 1, then use
            // use the Chinese Remainder Theorem to reconstruct the 512 bit result. The result is stored in two 256
            // variables such that product = prod1 * 2^256 + prod0.
            uint256 prod0; // Least significant 256 bits of the product
            uint256 prod1; // Most significant 256 bits of the product
            assembly {
                let mm := mulmod(x, y, not(0))
                prod0 := mul(x, y)
                prod1 := sub(sub(mm, prod0), lt(mm, prod0))
            }

            // Handle non-overflow cases, 256 by 256 division.
            if (prod1 == 0) {
                return prod0 / denominator;
            }

            // Make sure the result is less than 2^256. Also prevents denominator == 0.
            require(denominator > prod1);

            ///////////////////////////////////////////////
            // 512 by 256 division.
            ///////////////////////////////////////////////

            // Make division exact by subtracting the remainder from [prod1 prod0].
            uint256 remainder;
            assembly {
                // Compute remainder using mulmod.
                remainder := mulmod(x, y, denominator)

                // Subtract 256 bit number from 512 bit number.
                prod1 := sub(prod1, gt(remainder, prod0))
                prod0 := sub(prod0, remainder)
            }

            // Factor powers of two out of denominator and compute largest power of two divisor of denominator. Always >= 1.
            // See https://cs.stackexchange.com/q/138556/92363.

            // Does not overflow because the denominator cannot be zero at this stage in the function.
            uint256 twos = denominator & (~denominator + 1);
            assembly {
                // Divide denominator by twos.
                denominator := div(denominator, twos)

                // Divide [prod1 prod0] by twos.
                prod0 := div(prod0, twos)

                // Flip twos such that it is 2^256 / twos. If twos is zero, then it becomes one.
                twos := add(div(sub(0, twos), twos), 1)
            }

            // Shift in bits from prod1 into prod0.
            prod0 |= prod1 * twos;

            // Invert denominator mod 2^256. Now that denominator is an odd number, it has an inverse modulo 2^256 such
            // that denominator * inv = 1 mod 2^256. Compute the inverse by starting with a seed that is correct for
            // four bits. That is, denominator * inv = 1 mod 2^4.
            uint256 inverse = (3 * denominator) ^ 2;

            // Use the Newton-Raphson iteration to improve the precision. Thanks to Hensel's lifting lemma, this also works
            // in modular arithmetic, doubling the correct bits in each step.
            inverse *= 2 - denominator * inverse; // inverse mod 2^8
            inverse *= 2 - denominator * inverse; // inverse mod 2^16
            inverse *= 2 - denominator * inverse; // inverse mod 2^32
            inverse *= 2 - denominator * inverse; // inverse mod 2^64
            inverse *= 2 - denominator * inverse; // inverse mod 2^128
            inverse *= 2 - denominator * inverse; // inverse mod 2^256

            // Because the division is now exact we can divide by multiplying with the modular inverse of denominator.
            // This will give us the correct result modulo 2^256. Since the preconditions guarantee that the outcome is
            // less than 2^256, this is the final result. We don't need to compute the high bits of the result and prod1
            // is no longer required.
            result = prod0 * inverse;
            return result;
        }
    }

    /**
     * @notice Calculates x * y / denominator with full precision, following the selected rounding direction.
     */
    function mulDiv(
        uint256 x,
        uint256 y,
        uint256 denominator,
        Rounding rounding
    ) internal pure returns (uint256) {
        uint256 result = mulDiv(x, y, denominator);
        if (rounding == Rounding.Up && mulmod(x, y, denominator) > 0) {
            result += 1;
        }
        return result;
    }

    /**
     * @dev Returns the square root of a number. If the number is not a perfect square, the value is rounded down.
     *
     * Inspired by Henry S. Warren, Jr.'s "Hacker's Delight" (Chapter 11).
     */
    function sqrt(uint256 a) internal pure returns (uint256) {
        if (a == 0) {
            return 0;
        }

        // For our first guess, we get the biggest power of 2 which is smaller than the square root of the target.
        //
        // We know that the "msb" (most significant bit) of our target number `a` is a power of 2 such that we have
        // `msb(a) <= a < 2*msb(a)`. This value can be written `msb(a)=2**k` with `k=log2(a)`.
        //
        // This can be rewritten `2**log2(a) <= a < 2**(log2(a) + 1)`
        // → `sqrt(2**k) <= sqrt(a) < sqrt(2**(k+1))`
        // → `2**(k/2) <= sqrt(a) < 2**((k+1)/2) <= 2**(k/2 + 1)`
        //
        // Consequently, `2**(log2(a) / 2)` is a good first approximation of `sqrt(a)` with at least 1 correct bit.
        uint256 result = 1 << (log2(a) >> 1);

        // At this point `result` is an estimation with one bit of precision. We know the true value is a uint128,
        // since it is the square root of a uint256. Newton's method converges quadratically (precision doubles at
        // every iteration). We thus need at most 7 iteration to turn our partial result with one bit of precision
        // into the expected uint128 result.
        unchecked {
            result = (result + a / result) >> 1;
            result = (result + a / result) >> 1;
            result = (result + a / result) >> 1;
            result = (result + a / result) >> 1;
            result = (result + a / result) >> 1;
            result = (result + a / result) >> 1;
            result = (result + a / result) >> 1;
            return min(result, a / result);
        }
    }

    /**
     * @notice Calculates sqrt(a), following the selected rounding direction.
     */
    function sqrt(uint256 a, Rounding rounding) internal pure returns (uint256) {
        unchecked {
            uint256 result = sqrt(a);
            return result + (rounding == Rounding.Up && result * result < a ? 1 : 0);
        }
    }

    /**
     * @dev Return the log in base 2, rounded down, of a positive value.
     * Returns 0 if given 0.
     */
    function log2(uint256 value) internal pure returns (uint256) {
        uint256 result = 0;
        unchecked {
            if (value >> 128 > 0) {
                value >>= 128;
                result += 128;
            }
            if (value >> 64 > 0) {
                value >>= 64;
                result += 64;
            }
            if (value >> 32 > 0) {
                value >>= 32;
                result += 32;
            }
            if (value >> 16 > 0) {
                value >>= 16;
                result += 16;
            }
            if (value >> 8 > 0) {
                value >>= 8;
                result += 8;
            }
            if (value >> 4 > 0) {
                value >>= 4;
                result += 4;
            }
            if (value >> 2 > 0) {
                value >>= 2;
                result += 2;
            }
            if (value >> 1 > 0) {
                result += 1;
            }
        }
        return result;
    }

    /**
     * @dev Return the log in base 2, following the selected rounding direction, of a positive value.
     * Returns 0 if given 0.
     */
    function log2(uint256 value, Rounding rounding) internal pure returns (uint256) {
        unchecked {
            uint256 result = log2(value);
            return result + (rounding == Rounding.Up && 1 << result < value ? 1 : 0);
        }
    }

    /**
     * @dev Return the log in base 10, rounded down, of a positive value.
     * Returns 0 if given 0.
     */
    function log10(uint256 value) internal pure returns (uint256) {
        uint256 result = 0;
        unchecked {
            if (value >= 10**64) {
                value /= 10**64;
                result += 64;
            }
            if (value >= 10**32) {
                value /= 10**32;
                result += 32;
            }
            if (value >= 10**16) {
                value /= 10**16;
                result += 16;
            }
            if (value >= 10**8) {
                value /= 10**8;
                result += 8;
            }
            if (value >= 10**4) {
                value /= 10**4;
                result += 4;
            }
            if (value >= 10**2) {
                value /= 10**2;
                result += 2;
            }
            if (value >= 10**1) {
                result += 1;
            }
        }
        return result;
    }

    /**
     * @dev Return the log in base 10, following the selected rounding direction, of a positive value.
     * Returns 0 if given 0.
     */
    function log10(uint256 value, Rounding rounding) internal pure returns (uint256) {
        unchecked {
            uint256 result = log10(value);
            return result + (rounding == Rounding.Up && 10**result < value ? 1 : 0);
        }
    }

    /**
     * @dev Return the log in base 256, rounded down, of a positive value.
     * Returns 0 if given 0.
     *
     * Adding one to the result gives the number of pairs of hex symbols needed to represent `value` as a hex string.
     */
    function log256(uint256 value) internal pure returns (uint256) {
        uint256 result = 0;
        unchecked {
            if (value >> 128 > 0) {
                value >>= 128;
                result += 16;
            }
            if (value >> 64 > 0) {
                value >>= 64;
                result += 8;
            }
            if (value >> 32 > 0) {
                value >>= 32;
                result += 4;
            }
            if (value >> 16 > 0) {
                value >>= 16;
                result += 2;
            }
            if (value >> 8 > 0) {
                result += 1;
            }
        }
        return result;
    }

    /**
     * @dev Return the log in base 10, following the selected rounding direction, of a positive value.
     * Returns 0 if given 0.
     */
    function log256(uint256 value, Rounding rounding) internal pure returns (uint256) {
        unchecked {
            uint256 result = log256(value);
            return result + (rounding == Rounding.Up && 1 << (result * 8) < value ? 1 : 0);
        }
    }
}

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

Contract Security Audit

Contract ABI

API
[{"inputs":[],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"_factory","type":"address"}],"name":"FactorySet","type":"event"},{"inputs":[{"internalType":"address","name":"_owner","type":"address"},{"internalType":"address","name":"_stakingToken","type":"address"},{"internalType":"address","name":"_stakingNFT","type":"address"}],"name":"createXGBT","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"factory","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"lastXGBT","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_factory","type":"address"}],"name":"setFactory","outputs":[],"stateMutability":"nonpayable","type":"function"}]

6080806040523461002857600080546001600160a01b031916331790556122a6908161002e8239f35b600080fdfe604060808152600436101561001357600080fd5b600090813560e01c80631e5e673f146101115780635bb478081461009d578063af448541146100755763c45a01551461004b57600080fd5b34610071578160031936011261007157905490516001600160a01b039091168152602090f35b5080fd5b503461007157816003193601126100715760015490516001600160a01b039091168152602090f35b823461010e57602036600319011261010e576100b76101ee565b8154906001600160a01b03906100d03383851614610209565b1680916bffffffffffffffffffffffff60a01b161782557f1edf3afd4ac789736e00d216cd88be164ddcef26a6eedcc30cdb0cb62f3741b18280a280f35b80fd5b50346100715760603660031901126100715761012b6101ee565b6001600160a01b039060243582811691908290036101ea576044358381168091036101e65761015e848754163314610209565b845192612033928385019385851067ffffffffffffffff8611176101d25791868694926060969461023e873916835260208301528682015203019084f080156101c657602093501690816bffffffffffffffffffffffff60a01b600154161760015551908152f35b505051903d90823e3d90fd5b634e487b7160e01b89526041600452602489fd5b8580fd5b8480fd5b600435906001600160a01b038216820361020457565b600080fd5b1561021057565b60405162461bcd60e51b815260206004820152600560248201526404282aaa8960db1b6044820152606490fdfe60e034620000e957601f6200203338819003918201601f19168301916001600160401b03831184841017620000ee57808492606094604052833981010312620000e9576200004d8162000104565b620000696040620000616020850162000104565b930162000104565b600160005560c0919091526001600160a01b039182166080521660a052604051611f1990816200011a82396080518181816105160152818161099701528181610a7301528181610ca001528181610e2101526110b9015260a0518181816110fe015281816114ee0152611650015260c051818181610352015261084d0152f35b600080fd5b634e487b7160e01b600052604160045260246000fd5b51906001600160a01b0382168203620000e95756fe60806040908082526004908136101561001757600080fd5b600091823560e01c918263045990121461178b575081630a72298e1461151d5781630ce71e32146114d9578163150b7a021461146657816318160ddd146114475781631be0528914611429578163211dc32d146113fb57816348e5d9f8146113a15781634b0b3dc714610f4e57816350baa62214610cd25781636215be7714610b4a578163638634ee14610b245781637035ab9814610ada57816370a0823114610aa257816372f702f314610a5e5781637bb7bed114610a1c5781639c9b2e2114610823578163b5fd73f8146107e5578163b66503cf1461064e578163b8d3fc41146105f8578163bcd1101414610593578163c00007b01461038157508063c45a01551461033d578063c4f59f9b14610279578063e70b9e2714610230578063f1229777146101ff5763f5b100ea1461014f57600080fd5b346101fc57602090816003193601126101fc5782906001600160a01b036101746117bf565b1681526009835281812090815483519480868381520180948452818420845b8481106101e8575050866101a8910387611951565b845195858796870193875282870152518092526060850193925b8281106101d157505050500390f35b8351855286955093810193928101926001016101c2565b815483529183019160019182019101610193565b80fd5b50903461022c57602036600319011261022c576020906102256102206117bf565b611a95565b9051908152f35b5080fd5b50903461022c578060031936011261022c578060209261024e6117bf565b6102566117da565b6001600160a01b0391821683526005865283832091168252845220549051908152f35b50346101fc57806003193601126101fc579080519182906003549182855260208095018093600384527fc2575a0e9e593c00f959f8c92f12db2869c3395a3b0502d05e2516446f71f85b90845b81811061032057505050816102dc910382611951565b83519485948186019282875251809352850193925b82811061030057505050500390f35b83516001600160a01b0316855286955093810193928101926001016102f1565b82546001600160a01b0316845292880192600192830192016102c6565b50903461022c578160031936011261022c57517f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03168152602090f35b90503461022c576020928360031936011261058f5761039e6117bf565b926103a7611b52565b6001600160a01b0394858516801515959094909190835b6003805482101561045957906001918a6103d78361183d565b905490831b1c16906103e882611a95565b828952848752898920820155838b6103ff84611a70565b848b5282895260028c8c20015561041a575b505050016103be565b61042483896119ba565b8b8a52600588528a8a20848b5288528a8a20558652888820015490898852848652888820908852855287872055388080610411565b50509550869492805b600380548210156104f757908760019261047b8361183d565b9054911b1c168684528660058087528986208387528752868a872054806104a8575b505050505001610462565b7f540798df468d7b23d11f156fdb954cb19ad414d150722a7b6d55ba369dea792e9284895282528b88208589528252878c8120556104e7818b87611c34565b8b51908152a3898681868161049d565b82878986808d60248551809581936370a0823160e01b835230908301527f0000000000000000000000000000000000000000000000000000000000000000165afa92831561058657508392610558575b5050600a54116101fc576001815580f35b90809250813d831161057f575b61056f8183611951565b8101031261022c57518280610547565b503d610565565b513d85823e3d90fd5b8280fd5b82843461022c57602036600319011261022c576001600160a01b036105b66117bf565b1682526001602052600181832001549162093a80928381029381850414901517156105e5576020838351908152f35b634e487b7160e01b815260118452602490fd5b82843461022c578060031936011261022c576106126117bf565b6001600160a01b031682526009602052808220805460243593908410156101fc57506020926106409161188a565b91905490519160031b1c8152f35b90503461022c578260031936011261022c576106686117bf565b9160243591815b600380548210156106c957906001916106878261183d565b848060a01b03915490831b1c169061069e82611a95565b9082875284916020918383528b892001556106b883611a70565b92875252600288862001550161066f565b828462093a80878a8a838311156107b6576001600160a01b03166106ef83303384611c86565b808552600160209481865280848820548042101560001461077b5750508287528186528085048285892001555b828752818652426002858920015542019182421161076857867ff9a5da3a173eca8cd77c02ece3ff1467b8aa461ed3822201817f2d72fbc542839798505284528186205551908152a180f35b634e487b7160e01b875260118852602487fd5b61079e61078c6107a49242906119ad565b868b52858a5285888c200154906118e1565b8761190a565b0483885282875282858920015561071c565b815162461bcd60e51b815260208188015260096024820152681e222aa920aa24a7a760b91b6044820152606490fd5b82843461022c57602036600319011261022c5760209160ff9082906001600160a01b036108106117bf565b1681526002855220541690519015158152f35b82843461022c576020908160031936011261058f576108406117bf565b6001600160a01b039190337f00000000000000000000000000000000000000000000000000000000000000008416148015610984575b15610959578216918285526002845260ff828620541661091657600354600160401b811015610903577fb13fd610fe4e1b384966826794a9b2f6100ad031f352cc5ec6f22667f60749809596508060016108d3920160035561183d565b819291549060031b9185831b921b191617905581855260028352808520600160ff1982541617905551908152a180f35b634e487b7160e01b865260418752602486fd5b815162461bcd60e51b8152808701859052601b60248201527f52657761726420746f6b656e20616c72656164792065786973747300000000006044820152606490fd5b815162461bcd60e51b8152808701859052600560248201526404282aaa8960db1b6044820152606490fd5b50815163e094826b60e01b8152848188817f000000000000000000000000000000000000000000000000000000000000000088165afa908115610a125790849187916109d4575b50163314610876565b809250868092503d8311610a0b575b6109ed8183611951565b81010312610a0757518381168103610a07578390886109cb565b8580fd5b503d6109e3565b83513d88823e3d90fd5b8391503461058f57602036600319011261058f5735916003548310156101fc5750610a4860209261183d565b60018060a01b0391549060031b1c169051908152f35b82843461022c578160031936011261022c57517f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03168152602090f35b82843461022c57602036600319011261022c5760209181906001600160a01b03610aca6117bf565b1681526007845220549051908152f35b8391503461058f578160031936011261058f576020928291610afa6117bf565b610b026117da565b6001600160a01b03918216845291865283832091168252845220549051908152f35b82843461022c57602036600319011261022c57602090610225610b456117bf565b611a70565b90503461022c576020928360031936011261058f57813592610b6a611b52565b331515815b60038054821015610c0f5790600191610b878261183d565b848060a01b03915490831b1c1690610b9e82611a95565b828752848b528787208201558385610bb584611a70565b848952828d5260028a8a200155610bd0575b50505001610b6f565b610bda83336119ba565b33885260058c528888208489528c52888820558a52868620015490338652878a52868620908652895285852055388080610bc7565b83877f2da466a7b24304f47e87fa2e1e5a81b9831ce54fec19055ce277ca2f39ba42c48a88610c3f8415156118a2565b610c4b84600a5461190a565b600a55610c5a8460065461190a565b60065533855260088252610c71848287205461190a565b338652600883528186205560078252610c8d848287205461190a565b3386526007835281862055610cc48430337f0000000000000000000000000000000000000000000000000000000000000000611c86565b519283523392a26001815580f35b90503461022c576020928360031936011261058f57813592610cf2611b52565b331515815b60038054821015610d975790600191610d0f8261183d565b848060a01b03915490831b1c1690610d2682611a95565b828752848b528787208201558385610d3d84611a70565b848952828d5260028a8a200155610d58575b50505001610cf7565b610d6283336119ba565b33885260058c528888208489528c52888820558a52868620015490338652878a52868620908652895285852055388080610d4f565b50505093908315610f195733855260088252808520548411610ee157610dbf84600a546119ad565b600a55610dce846006546119ad565b60065533855260088252610de584828720546119ad565b338652600883528186205560078252610e0184828720546119ad565b3380875260078452828720829055825163ce98fd6760e01b8152948501527f0000000000000000000000000000000000000000000000000000000000000000939083826024816001600160a01b0389165afa918215610ed757908692918892610e9f575b5094610e98610cc493927f7084f5476618d8e60b11ef0d7d3f06914655adb8793e28ff7f018d4c76d505d5971015611a36565b3390611c34565b925090508382813d8111610ed0575b610eb88183611951565b81010312610ecc5790518591610e98610e65565b8680fd5b503d610eae565b83513d89823e3d90fd5b5162461bcd60e51b8152918201526014602482015273496e73756666696369656e742062616c616e636560601b604482015260649150fd5b5162461bcd60e51b8152918201526011602482015270043616e6e6f74207769746864726177203607c1b604482015260649150fd5b8391503461058f57610f5f366117f0565b929093610f6a611b52565b33151593815b600380548210156110145790600191610f888261183d565b848060a01b03915490831b1c16610f9e81611a95565b9181875284602093818552828a8a2001558a610fb984611a70565b848a5282865260028b8b200155610fd5575b5050505001610f70565b610fdf83336119ba565b33895260058552898920848a528552898920558352878720015491338752888152878720918752528585205588808080610fcb565b505091935093338552600960209080825283868820541061136757670de0b6b3a76400009081850291858304148515171561135457875b8581106112185750508061106461108692600b546119ad565b600b55611073816006546119ad565b60065533885260078352868820546119ad565b3380885260078352868820829055865163ce98fd6760e01b8152868101919091526001600160a01b0392909181836024817f000000000000000000000000000000000000000000000000000000000000000088165afa91821561120e5789926111d8575b506110fa92509592951015611a36565b85937f000000000000000000000000000000000000000000000000000000000000000016935b83811061116557505061115b7f18e9b1b89c8ef058568b1f6c17ae88e5ccb891480d0a58fe7b7775ed42fcf454939451928392339684611973565b0390a26001815580f35b611170818585611917565b359087863b156101fc5787516323b872dd60e01b815230858201908152336020820152604081019490945292839081906060010381838a5af19182156111ce576001926111bf575b5001611120565b6111c890611927565b886111b8565b87513d8a823e3d90fd5b90915082813d8311611207575b6111ef8183611951565b81010312611203576110fa915190896110ea565b8780fd5b503d6111e5565b88513d8b823e3d90fd5b61122d611226828888611917565b3533611ba8565b338a5282855261123f818a8c2061188a565b91905491600392338d528588528b8d2092835460001994858201918211611340578f928f6112a0948b6112768f966112879661188a565b9054908c1b1c95338352522061188a565b90919082549060031b91821b91600019901b1916179055565b338d528588528b8d2080549084820191821161132d576112e29392916112c59161188a565b919092861b1c9082549060031b91821b91600019901b1916179055565b338b52838652898b20908154801561131a5790806001959493920192611308848461188a565b81939154921b1b19169055550161104b565b634e487b7160e01b8d5260318b5260248dfd5b634e487b7160e01b8f5260118d5260248ffd5b50634e487b7160e01b8f5260118d5260248ffd5b634e487b7160e01b885260118652602488fd5b855162461bcd60e51b815280860183905260146024820152735769746864726177616c20756e646572666c6f7760601b6044820152606490fd5b82843461022c57602036600319011261022c5760809181906001600160a01b036113c96117bf565b168152600160205220908154916001810154916003600283015492015492815194855260208501528301526060820152f35b82843461022c578060031936011261022c5760209061022561141b6117bf565b6114236117da565b906119ba565b82843461022c578160031936011261022c576020905162093a808152f35b82843461022c578160031936011261022c576020906006549051908152f35b8391503461058f57608036600319011261058f576114826117bf565b5061148b6117da565b506064359067ffffffffffffffff908183116114d557366023840112156114d5578201359081116114d1573691016024011161022c5751630a85bd0160e11b8152602090f35b8380fd5b8480fd5b82843461022c578160031936011261022c57517f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03168152602090f35b8391503461058f5761152e366117f0565b929093611539611b52565b33151593815b600380548210156115e357906001916115578261183d565b848060a01b03915490831b1c1661156d81611a95565b9181875284602093818552828a8a2001558a61158884611a70565b848a5282865260028b8b2001556115a4575b505050500161153f565b6115ae83336119ba565b33895260058552898920848a52855289892055835287872001549133875288815287872091875252858520558880808061159a565b838315848a888a6115f485156118a2565b670de0b6b3a76400009485850295858704141715611778579361161981600b5461190a565b600b556116288160065461190a565b60065533865261164260209160076020528388205461190a565b3387526007602052828720557f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031694865b8581106116b8575050509061115b7f66f123bb12c448858abe67013777a572dff5781ec2aab8cae00b90f1212e5dfd939251928392339684611973565b338852600983528388206116cd828888611917565b3590805490600160401b82101561176557816112879160016116f2959401815561188a565b6116fd818787611917565b3588883b156101fc5785516323b872dd60e01b815233858201908152306020820152604081019390935291829081906060010381838c5af1801561175b57906001929161174c575b500161167b565b61175590611927565b89611745565b85513d8b823e3d90fd5b634e487b7160e01b8b526041855260248bfd5b634e487b7160e01b865260119052602485fd5b8390853461058f57602036600319011261058f576020926001600160a01b036117b26117bf565b1681526008845220548152f35b600435906001600160a01b03821682036117d557565b600080fd5b602435906001600160a01b03821682036117d557565b9060206003198301126117d55760043567ffffffffffffffff928382116117d557806023830112156117d55781600401359384116117d55760248460051b830101116117d5576024019190565b6003548110156118745760036000527fc2575a0e9e593c00f959f8c92f12db2869c3395a3b0502d05e2516446f71f85b0190600090565b634e487b7160e01b600052603260045260246000fd5b80548210156118745760005260206000200190600090565b156118a957565b60405162461bcd60e51b815260206004820152601060248201526f043616e6e6f74206465706f73697420360841b6044820152606490fd5b818102929181159184041417156118f457565b634e487b7160e01b600052601160045260246000fd5b919082018092116118f457565b91908110156118745760051b0190565b67ffffffffffffffff811161193b57604052565b634e487b7160e01b600052604160045260246000fd5b90601f8019910116810190811067ffffffffffffffff82111761193b57604052565b6001600160a01b03909116815260406020820181905281018390526001600160fb1b0383116117d55760609260051b809284830137010190565b919082039182116118f457565b906040611a339260018060a01b0380911692670de0b6b3a7640000611a196000938685526007602052611a1386862054916119f486611a95565b90898852600460205288882096169586885260205287872054906119ad565b906118e1565b04938252600560205282822090825260205220549061190a565b90565b15611a3d57565b60405162461bcd60e51b815260206004820152600b60248201526a109bdc9c9bddc81919589d60aa1b6044820152606490fd5b6001600160a01b031660009081526001602052604090205442811115611a3357504290565b90600654918215611b335760018060a01b03811692611af86000948086526001602052611ae2611acc600360408920015495611a70565b82885260016020526002604089200154906119ad565b90865260016020526001604087200154906118e1565b670de0b6b3a764000090818102918183041490151715611b1f57611a33939450049061190a565b634e487b7160e01b85526011600452602485fd5b6001600160a01b03166000908152600160205260409020600301549150565b600260005414611b63576002600055565b60405162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c006044820152606490fd5b9060008060005b6001600160a01b03851660009081526009602052604090208054821015611c2957611bdb82869261188a565b90549060031b1c14611bef57600101611baf565b935050505060015b611a335760405162461bcd60e51b815260206004820152600660248201526508519bdd5b9960d21b6044820152606490fd5b505092509050611bf7565b60405163a9059cbb60e01b60208201526001600160a01b039092166024830152604480830193909352918152608081019167ffffffffffffffff83118284101761193b57611c8492604052611cca565b565b6040516323b872dd60e01b60208201526001600160a01b039283166024820152929091166044830152606480830193909352918152611c8491611cca608483611951565b60018060a01b0316906040516040810167ffffffffffffffff908281108282111761193b576040526020938483527f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564858401526000808587829751910182855af1903d15611e04573d928311611df05790611d6593929160405192611d5888601f19601f8401160185611951565b83523d868885013e611e0f565b805180611d73575b50505050565b8184918101031261022c57820151908115918215036101fc5750611d9957808080611d6d565b6084906040519062461bcd60e51b82526004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e6044820152691bdd081cdd58d8d9595960b21b6064820152fd5b634e487b7160e01b85526041600452602485fd5b90611d659392506060915b91929015611e715750815115611e23575090565b3b15611e2c5790565b60405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e74726163740000006044820152606490fd5b825190915015611e845750805190602001fd5b6040519062461bcd60e51b82528160208060048301528251908160248401526000935b828510611eca575050604492506000838284010152601f80199101168101030190fd5b8481018201518686016044015293810193859350611ea756fea2646970667358221220169b18225cec27a81cc90fccf4807db16596ec1b88a83ad0b54baa952e24374464736f6c63430008180033a2646970667358221220d6e9e7441a558a58a7830aedf66e77d533f8ac6496f87275a6b19ecc1d4f016e64736f6c63430008180033

Deployed Bytecode

0x604060808152600436101561001357600080fd5b600090813560e01c80631e5e673f146101115780635bb478081461009d578063af448541146100755763c45a01551461004b57600080fd5b34610071578160031936011261007157905490516001600160a01b039091168152602090f35b5080fd5b503461007157816003193601126100715760015490516001600160a01b039091168152602090f35b823461010e57602036600319011261010e576100b76101ee565b8154906001600160a01b03906100d03383851614610209565b1680916bffffffffffffffffffffffff60a01b161782557f1edf3afd4ac789736e00d216cd88be164ddcef26a6eedcc30cdb0cb62f3741b18280a280f35b80fd5b50346100715760603660031901126100715761012b6101ee565b6001600160a01b039060243582811691908290036101ea576044358381168091036101e65761015e848754163314610209565b845192612033928385019385851067ffffffffffffffff8611176101d25791868694926060969461023e873916835260208301528682015203019084f080156101c657602093501690816bffffffffffffffffffffffff60a01b600154161760015551908152f35b505051903d90823e3d90fd5b634e487b7160e01b89526041600452602489fd5b8580fd5b8480fd5b600435906001600160a01b038216820361020457565b600080fd5b1561021057565b60405162461bcd60e51b815260206004820152600560248201526404282aaa8960db1b6044820152606490fdfe60e034620000e957601f6200203338819003918201601f19168301916001600160401b03831184841017620000ee57808492606094604052833981010312620000e9576200004d8162000104565b620000696040620000616020850162000104565b930162000104565b600160005560c0919091526001600160a01b039182166080521660a052604051611f1990816200011a82396080518181816105160152818161099701528181610a7301528181610ca001528181610e2101526110b9015260a0518181816110fe015281816114ee0152611650015260c051818181610352015261084d0152f35b600080fd5b634e487b7160e01b600052604160045260246000fd5b51906001600160a01b0382168203620000e95756fe60806040908082526004908136101561001757600080fd5b600091823560e01c918263045990121461178b575081630a72298e1461151d5781630ce71e32146114d9578163150b7a021461146657816318160ddd146114475781631be0528914611429578163211dc32d146113fb57816348e5d9f8146113a15781634b0b3dc714610f4e57816350baa62214610cd25781636215be7714610b4a578163638634ee14610b245781637035ab9814610ada57816370a0823114610aa257816372f702f314610a5e5781637bb7bed114610a1c5781639c9b2e2114610823578163b5fd73f8146107e5578163b66503cf1461064e578163b8d3fc41146105f8578163bcd1101414610593578163c00007b01461038157508063c45a01551461033d578063c4f59f9b14610279578063e70b9e2714610230578063f1229777146101ff5763f5b100ea1461014f57600080fd5b346101fc57602090816003193601126101fc5782906001600160a01b036101746117bf565b1681526009835281812090815483519480868381520180948452818420845b8481106101e8575050866101a8910387611951565b845195858796870193875282870152518092526060850193925b8281106101d157505050500390f35b8351855286955093810193928101926001016101c2565b815483529183019160019182019101610193565b80fd5b50903461022c57602036600319011261022c576020906102256102206117bf565b611a95565b9051908152f35b5080fd5b50903461022c578060031936011261022c578060209261024e6117bf565b6102566117da565b6001600160a01b0391821683526005865283832091168252845220549051908152f35b50346101fc57806003193601126101fc579080519182906003549182855260208095018093600384527fc2575a0e9e593c00f959f8c92f12db2869c3395a3b0502d05e2516446f71f85b90845b81811061032057505050816102dc910382611951565b83519485948186019282875251809352850193925b82811061030057505050500390f35b83516001600160a01b0316855286955093810193928101926001016102f1565b82546001600160a01b0316845292880192600192830192016102c6565b50903461022c578160031936011261022c57517f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03168152602090f35b90503461022c576020928360031936011261058f5761039e6117bf565b926103a7611b52565b6001600160a01b0394858516801515959094909190835b6003805482101561045957906001918a6103d78361183d565b905490831b1c16906103e882611a95565b828952848752898920820155838b6103ff84611a70565b848b5282895260028c8c20015561041a575b505050016103be565b61042483896119ba565b8b8a52600588528a8a20848b5288528a8a20558652888820015490898852848652888820908852855287872055388080610411565b50509550869492805b600380548210156104f757908760019261047b8361183d565b9054911b1c168684528660058087528986208387528752868a872054806104a8575b505050505001610462565b7f540798df468d7b23d11f156fdb954cb19ad414d150722a7b6d55ba369dea792e9284895282528b88208589528252878c8120556104e7818b87611c34565b8b51908152a3898681868161049d565b82878986808d60248551809581936370a0823160e01b835230908301527f0000000000000000000000000000000000000000000000000000000000000000165afa92831561058657508392610558575b5050600a54116101fc576001815580f35b90809250813d831161057f575b61056f8183611951565b8101031261022c57518280610547565b503d610565565b513d85823e3d90fd5b8280fd5b82843461022c57602036600319011261022c576001600160a01b036105b66117bf565b1682526001602052600181832001549162093a80928381029381850414901517156105e5576020838351908152f35b634e487b7160e01b815260118452602490fd5b82843461022c578060031936011261022c576106126117bf565b6001600160a01b031682526009602052808220805460243593908410156101fc57506020926106409161188a565b91905490519160031b1c8152f35b90503461022c578260031936011261022c576106686117bf565b9160243591815b600380548210156106c957906001916106878261183d565b848060a01b03915490831b1c169061069e82611a95565b9082875284916020918383528b892001556106b883611a70565b92875252600288862001550161066f565b828462093a80878a8a838311156107b6576001600160a01b03166106ef83303384611c86565b808552600160209481865280848820548042101560001461077b5750508287528186528085048285892001555b828752818652426002858920015542019182421161076857867ff9a5da3a173eca8cd77c02ece3ff1467b8aa461ed3822201817f2d72fbc542839798505284528186205551908152a180f35b634e487b7160e01b875260118852602487fd5b61079e61078c6107a49242906119ad565b868b52858a5285888c200154906118e1565b8761190a565b0483885282875282858920015561071c565b815162461bcd60e51b815260208188015260096024820152681e222aa920aa24a7a760b91b6044820152606490fd5b82843461022c57602036600319011261022c5760209160ff9082906001600160a01b036108106117bf565b1681526002855220541690519015158152f35b82843461022c576020908160031936011261058f576108406117bf565b6001600160a01b039190337f00000000000000000000000000000000000000000000000000000000000000008416148015610984575b15610959578216918285526002845260ff828620541661091657600354600160401b811015610903577fb13fd610fe4e1b384966826794a9b2f6100ad031f352cc5ec6f22667f60749809596508060016108d3920160035561183d565b819291549060031b9185831b921b191617905581855260028352808520600160ff1982541617905551908152a180f35b634e487b7160e01b865260418752602486fd5b815162461bcd60e51b8152808701859052601b60248201527f52657761726420746f6b656e20616c72656164792065786973747300000000006044820152606490fd5b815162461bcd60e51b8152808701859052600560248201526404282aaa8960db1b6044820152606490fd5b50815163e094826b60e01b8152848188817f000000000000000000000000000000000000000000000000000000000000000088165afa908115610a125790849187916109d4575b50163314610876565b809250868092503d8311610a0b575b6109ed8183611951565b81010312610a0757518381168103610a07578390886109cb565b8580fd5b503d6109e3565b83513d88823e3d90fd5b8391503461058f57602036600319011261058f5735916003548310156101fc5750610a4860209261183d565b60018060a01b0391549060031b1c169051908152f35b82843461022c578160031936011261022c57517f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03168152602090f35b82843461022c57602036600319011261022c5760209181906001600160a01b03610aca6117bf565b1681526007845220549051908152f35b8391503461058f578160031936011261058f576020928291610afa6117bf565b610b026117da565b6001600160a01b03918216845291865283832091168252845220549051908152f35b82843461022c57602036600319011261022c57602090610225610b456117bf565b611a70565b90503461022c576020928360031936011261058f57813592610b6a611b52565b331515815b60038054821015610c0f5790600191610b878261183d565b848060a01b03915490831b1c1690610b9e82611a95565b828752848b528787208201558385610bb584611a70565b848952828d5260028a8a200155610bd0575b50505001610b6f565b610bda83336119ba565b33885260058c528888208489528c52888820558a52868620015490338652878a52868620908652895285852055388080610bc7565b83877f2da466a7b24304f47e87fa2e1e5a81b9831ce54fec19055ce277ca2f39ba42c48a88610c3f8415156118a2565b610c4b84600a5461190a565b600a55610c5a8460065461190a565b60065533855260088252610c71848287205461190a565b338652600883528186205560078252610c8d848287205461190a565b3386526007835281862055610cc48430337f0000000000000000000000000000000000000000000000000000000000000000611c86565b519283523392a26001815580f35b90503461022c576020928360031936011261058f57813592610cf2611b52565b331515815b60038054821015610d975790600191610d0f8261183d565b848060a01b03915490831b1c1690610d2682611a95565b828752848b528787208201558385610d3d84611a70565b848952828d5260028a8a200155610d58575b50505001610cf7565b610d6283336119ba565b33885260058c528888208489528c52888820558a52868620015490338652878a52868620908652895285852055388080610d4f565b50505093908315610f195733855260088252808520548411610ee157610dbf84600a546119ad565b600a55610dce846006546119ad565b60065533855260088252610de584828720546119ad565b338652600883528186205560078252610e0184828720546119ad565b3380875260078452828720829055825163ce98fd6760e01b8152948501527f0000000000000000000000000000000000000000000000000000000000000000939083826024816001600160a01b0389165afa918215610ed757908692918892610e9f575b5094610e98610cc493927f7084f5476618d8e60b11ef0d7d3f06914655adb8793e28ff7f018d4c76d505d5971015611a36565b3390611c34565b925090508382813d8111610ed0575b610eb88183611951565b81010312610ecc5790518591610e98610e65565b8680fd5b503d610eae565b83513d89823e3d90fd5b5162461bcd60e51b8152918201526014602482015273496e73756666696369656e742062616c616e636560601b604482015260649150fd5b5162461bcd60e51b8152918201526011602482015270043616e6e6f74207769746864726177203607c1b604482015260649150fd5b8391503461058f57610f5f366117f0565b929093610f6a611b52565b33151593815b600380548210156110145790600191610f888261183d565b848060a01b03915490831b1c16610f9e81611a95565b9181875284602093818552828a8a2001558a610fb984611a70565b848a5282865260028b8b200155610fd5575b5050505001610f70565b610fdf83336119ba565b33895260058552898920848a528552898920558352878720015491338752888152878720918752528585205588808080610fcb565b505091935093338552600960209080825283868820541061136757670de0b6b3a76400009081850291858304148515171561135457875b8581106112185750508061106461108692600b546119ad565b600b55611073816006546119ad565b60065533885260078352868820546119ad565b3380885260078352868820829055865163ce98fd6760e01b8152868101919091526001600160a01b0392909181836024817f000000000000000000000000000000000000000000000000000000000000000088165afa91821561120e5789926111d8575b506110fa92509592951015611a36565b85937f000000000000000000000000000000000000000000000000000000000000000016935b83811061116557505061115b7f18e9b1b89c8ef058568b1f6c17ae88e5ccb891480d0a58fe7b7775ed42fcf454939451928392339684611973565b0390a26001815580f35b611170818585611917565b359087863b156101fc5787516323b872dd60e01b815230858201908152336020820152604081019490945292839081906060010381838a5af19182156111ce576001926111bf575b5001611120565b6111c890611927565b886111b8565b87513d8a823e3d90fd5b90915082813d8311611207575b6111ef8183611951565b81010312611203576110fa915190896110ea565b8780fd5b503d6111e5565b88513d8b823e3d90fd5b61122d611226828888611917565b3533611ba8565b338a5282855261123f818a8c2061188a565b91905491600392338d528588528b8d2092835460001994858201918211611340578f928f6112a0948b6112768f966112879661188a565b9054908c1b1c95338352522061188a565b90919082549060031b91821b91600019901b1916179055565b338d528588528b8d2080549084820191821161132d576112e29392916112c59161188a565b919092861b1c9082549060031b91821b91600019901b1916179055565b338b52838652898b20908154801561131a5790806001959493920192611308848461188a565b81939154921b1b19169055550161104b565b634e487b7160e01b8d5260318b5260248dfd5b634e487b7160e01b8f5260118d5260248ffd5b50634e487b7160e01b8f5260118d5260248ffd5b634e487b7160e01b885260118652602488fd5b855162461bcd60e51b815280860183905260146024820152735769746864726177616c20756e646572666c6f7760601b6044820152606490fd5b82843461022c57602036600319011261022c5760809181906001600160a01b036113c96117bf565b168152600160205220908154916001810154916003600283015492015492815194855260208501528301526060820152f35b82843461022c578060031936011261022c5760209061022561141b6117bf565b6114236117da565b906119ba565b82843461022c578160031936011261022c576020905162093a808152f35b82843461022c578160031936011261022c576020906006549051908152f35b8391503461058f57608036600319011261058f576114826117bf565b5061148b6117da565b506064359067ffffffffffffffff908183116114d557366023840112156114d5578201359081116114d1573691016024011161022c5751630a85bd0160e11b8152602090f35b8380fd5b8480fd5b82843461022c578160031936011261022c57517f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03168152602090f35b8391503461058f5761152e366117f0565b929093611539611b52565b33151593815b600380548210156115e357906001916115578261183d565b848060a01b03915490831b1c1661156d81611a95565b9181875284602093818552828a8a2001558a61158884611a70565b848a5282865260028b8b2001556115a4575b505050500161153f565b6115ae83336119ba565b33895260058552898920848a52855289892055835287872001549133875288815287872091875252858520558880808061159a565b838315848a888a6115f485156118a2565b670de0b6b3a76400009485850295858704141715611778579361161981600b5461190a565b600b556116288160065461190a565b60065533865261164260209160076020528388205461190a565b3387526007602052828720557f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031694865b8581106116b8575050509061115b7f66f123bb12c448858abe67013777a572dff5781ec2aab8cae00b90f1212e5dfd939251928392339684611973565b338852600983528388206116cd828888611917565b3590805490600160401b82101561176557816112879160016116f2959401815561188a565b6116fd818787611917565b3588883b156101fc5785516323b872dd60e01b815233858201908152306020820152604081019390935291829081906060010381838c5af1801561175b57906001929161174c575b500161167b565b61175590611927565b89611745565b85513d8b823e3d90fd5b634e487b7160e01b8b526041855260248bfd5b634e487b7160e01b865260119052602485fd5b8390853461058f57602036600319011261058f576020926001600160a01b036117b26117bf565b1681526008845220548152f35b600435906001600160a01b03821682036117d557565b600080fd5b602435906001600160a01b03821682036117d557565b9060206003198301126117d55760043567ffffffffffffffff928382116117d557806023830112156117d55781600401359384116117d55760248460051b830101116117d5576024019190565b6003548110156118745760036000527fc2575a0e9e593c00f959f8c92f12db2869c3395a3b0502d05e2516446f71f85b0190600090565b634e487b7160e01b600052603260045260246000fd5b80548210156118745760005260206000200190600090565b156118a957565b60405162461bcd60e51b815260206004820152601060248201526f043616e6e6f74206465706f73697420360841b6044820152606490fd5b818102929181159184041417156118f457565b634e487b7160e01b600052601160045260246000fd5b919082018092116118f457565b91908110156118745760051b0190565b67ffffffffffffffff811161193b57604052565b634e487b7160e01b600052604160045260246000fd5b90601f8019910116810190811067ffffffffffffffff82111761193b57604052565b6001600160a01b03909116815260406020820181905281018390526001600160fb1b0383116117d55760609260051b809284830137010190565b919082039182116118f457565b906040611a339260018060a01b0380911692670de0b6b3a7640000611a196000938685526007602052611a1386862054916119f486611a95565b90898852600460205288882096169586885260205287872054906119ad565b906118e1565b04938252600560205282822090825260205220549061190a565b90565b15611a3d57565b60405162461bcd60e51b815260206004820152600b60248201526a109bdc9c9bddc81919589d60aa1b6044820152606490fd5b6001600160a01b031660009081526001602052604090205442811115611a3357504290565b90600654918215611b335760018060a01b03811692611af86000948086526001602052611ae2611acc600360408920015495611a70565b82885260016020526002604089200154906119ad565b90865260016020526001604087200154906118e1565b670de0b6b3a764000090818102918183041490151715611b1f57611a33939450049061190a565b634e487b7160e01b85526011600452602485fd5b6001600160a01b03166000908152600160205260409020600301549150565b600260005414611b63576002600055565b60405162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c006044820152606490fd5b9060008060005b6001600160a01b03851660009081526009602052604090208054821015611c2957611bdb82869261188a565b90549060031b1c14611bef57600101611baf565b935050505060015b611a335760405162461bcd60e51b815260206004820152600660248201526508519bdd5b9960d21b6044820152606490fd5b505092509050611bf7565b60405163a9059cbb60e01b60208201526001600160a01b039092166024830152604480830193909352918152608081019167ffffffffffffffff83118284101761193b57611c8492604052611cca565b565b6040516323b872dd60e01b60208201526001600160a01b039283166024820152929091166044830152606480830193909352918152611c8491611cca608483611951565b60018060a01b0316906040516040810167ffffffffffffffff908281108282111761193b576040526020938483527f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564858401526000808587829751910182855af1903d15611e04573d928311611df05790611d6593929160405192611d5888601f19601f8401160185611951565b83523d868885013e611e0f565b805180611d73575b50505050565b8184918101031261022c57820151908115918215036101fc5750611d9957808080611d6d565b6084906040519062461bcd60e51b82526004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e6044820152691bdd081cdd58d8d9595960b21b6064820152fd5b634e487b7160e01b85526041600452602485fd5b90611d659392506060915b91929015611e715750815115611e23575090565b3b15611e2c5790565b60405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e74726163740000006044820152606490fd5b825190915015611e845750805190602001fd5b6040519062461bcd60e51b82528160208060048301528251908160248401526000935b828510611eca575050604492506000838284010152601f80199101168101030190fd5b8481018201518686016044015293810193859350611ea756fea2646970667358221220169b18225cec27a81cc90fccf4807db16596ec1b88a83ad0b54baa952e24374464736f6c63430008180033a2646970667358221220d6e9e7441a558a58a7830aedf66e77d533f8ac6496f87275a6b19ecc1d4f016e64736f6c63430008180033

Block Transaction Gas Used Reward
view all blocks ##produced##

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

Validator Index Block Amount
View All Withdrawals

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

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