ETH Price: $1,834.99 (+1.68%)
Gas: 0.58 Gwei

Contract

0x42dddbA609589322E5c6133939Ddd20941F9abB2
 

Overview

ETH Balance

0 ETH

Eth Value

$0.00

Token Holdings

Multichain Info

No addresses found
Transaction Hash
Method
Block
From
To
Unstake178803902023-08-09 22:42:11600 days ago1691620931IN
0x42dddbA6...941F9abB2
0 ETH0.0011716714.92328439
Unstake178075002023-07-30 18:01:59610 days ago1690740119IN
0x42dddbA6...941F9abB2
0 ETH0.0013478717.16758936
Unstake178074882023-07-30 17:59:35610 days ago1690739975IN
0x42dddbA6...941F9abB2
0 ETH0.0012701716.17539616
Unstake178074852023-07-30 17:58:59610 days ago1690739939IN
0x42dddbA6...941F9abB2
0 ETH0.0012511415.93302341
Unstake178074822023-07-30 17:58:23610 days ago1690739903IN
0x42dddbA6...941F9abB2
0 ETH0.0012960116.50454596
Unstake178074792023-07-30 17:57:47610 days ago1690739867IN
0x42dddbA6...941F9abB2
0 ETH0.0012751716.23913898
Unstake178074752023-07-30 17:56:59610 days ago1690739819IN
0x42dddbA6...941F9abB2
0 ETH0.0012523315.94821466
Unstake178074692023-07-30 17:55:47610 days ago1690739747IN
0x42dddbA6...941F9abB2
0 ETH0.0012650616.11029169
Unstake164958352023-01-27 4:41:23794 days ago1674794483IN
0x42dddbA6...941F9abB2
0 ETH0.0064403914.44074617
Unstake164957252023-01-27 4:19:23795 days ago1674793163IN
0x42dddbA6...941F9abB2
0 ETH0.0011923915.18492323
Unstake164956912023-01-27 4:12:35795 days ago1674792755IN
0x42dddbA6...941F9abB2
0 ETH0.0013752314.38152249
Unstake164602082023-01-22 5:18:59799 days ago1674364739IN
0x42dddbA6...941F9abB2
0 ETH0.0021826314.98694655
Unstake164099712023-01-15 4:58:35806 days ago1673758715IN
0x42dddbA6...941F9abB2
0 ETH0.0010525215.08129332
Unstake164099692023-01-15 4:58:11806 days ago1673758691IN
0x42dddbA6...941F9abB2
0 ETH0.0016237616.98272052
Unstake163565872023-01-07 18:06:11814 days ago1673114771IN
0x42dddbA6...941F9abB2
0 ETH0.0013514416.19084078
Unstake163318592023-01-04 7:13:59817 days ago1672816439IN
0x42dddbA6...941F9abB2
0 ETH0.001321715.83446572
Unstake162903112022-12-29 12:07:35823 days ago1672315655IN
0x42dddbA6...941F9abB2
0 ETH0.0013425916.08471791
Unstake162795152022-12-27 23:58:23825 days ago1672185503IN
0x42dddbA6...941F9abB2
0 ETH0.0008924312.78747896
Unstake162795132022-12-27 23:57:59825 days ago1672185479IN
0x42dddbA6...941F9abB2
0 ETH0.0008551112.25267869
Unstake162795102022-12-27 23:57:23825 days ago1672185443IN
0x42dddbA6...941F9abB2
0 ETH0.0012483313.05448737
Unstake162794852022-12-27 23:52:23825 days ago1672185143IN
0x42dddbA6...941F9abB2
0 ETH0.0004610414.10532239
Unstake162164142022-12-19 4:40:47833 days ago1671424847IN
0x42dddbA6...941F9abB2
0 ETH0.0038969311.15778023
Unstake162164032022-12-19 4:38:35833 days ago1671424715IN
0x42dddbA6...941F9abB2
0 ETH0.0015468713.18242728
Unstake162163972022-12-19 4:37:23833 days ago1671424643IN
0x42dddbA6...941F9abB2
0 ETH0.0012927713.51917689
Unstake161526972022-12-10 7:05:47842 days ago1670655947IN
0x42dddbA6...941F9abB2
0 ETH0.0021642117.55757075
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:
FeudalzStaking

Compiler Version
v0.8.7+commit.e28d00a7

Optimization Enabled:
Yes with 200 runs

Other Settings:
default evmVersion
File 1 of 11 : FudalZtaking.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.2;

import "@openzeppelin/contracts/token/ERC721/IERC721.sol";
import "@openzeppelin/contracts/token/ERC20/IERC20.sol";
import "@openzeppelin/contracts/utils/cryptography/draft-EIP712.sol";
import "@openzeppelin/contracts/utils/math/SafeMath.sol";
import "@openzeppelin/contracts/access/Ownable.sol";
import "@openzeppelin/contracts/utils/structs/EnumerableSet.sol";
import "@openzeppelin/contracts/utils/Counters.sol";

contract FeudalzStaking is EIP712, Ownable {
    using EnumerableSet for EnumerableSet.AddressSet;
    using EnumerableSet for EnumerableSet.UintSet;
    using Counters for Counters.Counter;
    
    IERC20 goldz = IERC20(0x7bE647634A942e73F8492d15Ae492D867Ce5245c);

    struct StakedContract {
        bool active;
        IERC721 instance;
    }

    mapping(address => mapping(address => EnumerableSet.UintSet)) addressToStakedTokensSet;
    mapping(address => mapping(uint => address)) contractTokenIdToOwner;
    mapping(address => mapping(uint => uint)) contractTokenIdToStakedTimestamp;
    mapping(address => StakedContract) public contracts;
    mapping(address => Counters.Counter) addressToNonce;
    mapping(address => uint) public accountToLastWithdraw;
    mapping(address => uint) public accountToLastWithdrawAmount;
    
    EnumerableSet.AddressSet activeContracts;
    address _signerAddress;
    
    event Stake(uint tokenId, address contractAddress, address owner);
    event Unstake(uint tokenId, address contractAddress, address owner);
    event Withdraw(address owner, uint amount);

    modifier ifContractExists(address contractAddress) {
        require(activeContracts.contains(contractAddress), "contract does not exists");
        _;
    }

    modifier incrementNonce() {
        addressToNonce[msg.sender].increment();
        _;
    }

    constructor() EIP712("FeudalzStaking", "1.0.0") {}

    function stake(address contractAddress, uint[] memory tokenIds) external incrementNonce {
        StakedContract storage _contract = contracts[contractAddress];
        require(_contract.active, "token contract is not active");

        for (uint i = 0; i < tokenIds.length; i++) {
            uint tokenId = tokenIds[i];

            // Assign token to his owner
            contractTokenIdToOwner[contractAddress][tokenId] = msg.sender;

            // Transfer token to this smart contract
            _contract.instance.safeTransferFrom(msg.sender, address(this), tokenId);

            // Add this token to user staked tokens
            addressToStakedTokensSet[contractAddress][msg.sender].add(tokenId);

            // Save stake timestamp
            contractTokenIdToStakedTimestamp[contractAddress][tokenId] = block.timestamp;

            emit Stake(tokenId, contractAddress, msg.sender);
        }
    }

    function unstake(address contractAddress, uint[] memory tokenIds) external incrementNonce ifContractExists(contractAddress) {
        StakedContract storage _contract = contracts[contractAddress];

        for (uint i = 0; i < tokenIds.length; i++) {
            uint tokenId = tokenIds[i];
            require(addressToStakedTokensSet[contractAddress][msg.sender].contains(tokenId), "token is not staked");

            // Remove owner of this token
            delete contractTokenIdToOwner[contractAddress][tokenId];

            // Transfer token to his owner
            _contract.instance.safeTransferFrom(address(this), msg.sender, tokenId);

            // Remove this token from user staked tokens
            addressToStakedTokensSet[contractAddress][msg.sender].remove(tokenId);

            // Remove stake timestamp
            delete contractTokenIdToStakedTimestamp[contractAddress][tokenId];

            emit Unstake(tokenId, contractAddress, msg.sender);
        }
    }

    function stakedTokensOfOwner(address contractAddress, address owner) external view ifContractExists(contractAddress) returns (uint[] memory) {
        EnumerableSet.UintSet storage userTokens = addressToStakedTokensSet[contractAddress][owner];

        uint[] memory tokenIds = new uint[](userTokens.length());

        for (uint i = 0; i < userTokens.length(); i++) {
            tokenIds[i] = userTokens.at(i);
        }

        return tokenIds;
    }

    function stakedTokenTimestamp(address contractAddress, uint tokenId) external view ifContractExists(contractAddress) returns (uint) {
        return contractTokenIdToStakedTimestamp[contractAddress][tokenId];
    }

    function withdrawGoldz(uint amount, bytes calldata signature) external {
        require(_signerAddress == recoverAddress(msg.sender, amount, accountNonce(msg.sender), signature), "invalid signature");
        goldz.transferFrom(address(this), msg.sender, amount);
        addressToNonce[msg.sender].increment();
        accountToLastWithdraw[msg.sender] = block.timestamp;
        accountToLastWithdrawAmount[msg.sender] = amount;
        emit Withdraw(msg.sender, amount);
    }

    function addContract(address contractAddress) public onlyOwner {
        contracts[contractAddress].active = true;
        contracts[contractAddress].instance = IERC721(contractAddress);
        activeContracts.add(contractAddress);
    }

    function updateContract(address contractAddress, bool active) public onlyOwner ifContractExists(contractAddress) {
        require(activeContracts.contains(contractAddress), "contract not added");
        contracts[contractAddress].active = active;
    }

    function accountNonce(address accountAddress) public view returns (uint) {
        return addressToNonce[accountAddress].current();
    }
    
    function setSignerAddress(address signerAddress) external onlyOwner {
        _signerAddress = signerAddress;
    }

    function _hash(address account, uint amount, uint nonce) internal view returns (bytes32) {
        return
            _hashTypedDataV4(
                keccak256(
                    abi.encode(
                        keccak256("MyGoldz(uint256 amount,address account,uint256 nonce)"),
                        amount,
                        account,
                        nonce
                    )
                )
            );
    }

    function recoverAddress(address account, uint amount, uint nonce, bytes calldata signature) public view returns(address) {
        return ECDSA.recover(_hash(account, amount, nonce), signature);
    }

    function onERC721Received(address operator, address, uint256, bytes calldata) external returns(bytes4) {
        require(operator == address(this), "token must be staked over stake method");
        return bytes4(keccak256("onERC721Received(address,address,uint256,bytes)"));
    }
}

File 2 of 11 : Counters.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.0;

/**
 * @title Counters
 * @author Matt Condon (@shrugs)
 * @dev Provides counters that can only be incremented, decremented or reset. This can be used e.g. to track the number
 * of elements in a mapping, issuing ERC721 ids, or counting request ids.
 *
 * Include with `using Counters for Counters.Counter;`
 */
library Counters {
    struct Counter {
        // This variable should never be directly accessed by users of the library: interactions must be restricted to
        // the library's function. As of Solidity v0.5.2, this cannot be enforced, though there is a proposal to add
        // this feature: see https://github.com/ethereum/solidity/issues/4637
        uint256 _value; // default: 0
    }

    function current(Counter storage counter) internal view returns (uint256) {
        return counter._value;
    }

    function increment(Counter storage counter) internal {
        unchecked {
            counter._value += 1;
        }
    }

    function decrement(Counter storage counter) internal {
        uint256 value = counter._value;
        require(value > 0, "Counter: decrement overflow");
        unchecked {
            counter._value = value - 1;
        }
    }

    function reset(Counter storage counter) internal {
        counter._value = 0;
    }
}

File 3 of 11 : EnumerableSet.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.0;

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

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

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

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

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

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

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

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

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

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

            return true;
        } else {
            return false;
        }
    }

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

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

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

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

    // Bytes32Set

    struct Bytes32Set {
        Set _inner;
    }

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

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

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

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

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

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

    // AddressSet

    struct AddressSet {
        Set _inner;
    }

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

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

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

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

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

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

        assembly {
            result := store
        }

        return result;
    }

    // UintSet

    struct UintSet {
        Set _inner;
    }

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

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

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

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

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

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

        assembly {
            result := store
        }

        return result;
    }
}

File 4 of 11 : Ownable.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.0;

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

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

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

    /**
     * @dev Initializes the contract setting the deployer as the initial owner.
     */
    constructor() {
        _setOwner(_msgSender());
    }

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

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

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

    /**
     * @dev Transfers ownership of the contract to a new account (`newOwner`).
     * Can only be called by the current owner.
     */
    function transferOwnership(address newOwner) public virtual onlyOwner {
        require(newOwner != address(0), "Ownable: new owner is the zero address");
        _setOwner(newOwner);
    }

    function _setOwner(address newOwner) private {
        address oldOwner = _owner;
        _owner = newOwner;
        emit OwnershipTransferred(oldOwner, newOwner);
    }
}

File 5 of 11 : SafeMath.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.0;

// CAUTION
// This version of SafeMath should only be used with Solidity 0.8 or later,
// because it relies on the compiler's built in overflow checks.

/**
 * @dev Wrappers over Solidity's arithmetic operations.
 *
 * NOTE: `SafeMath` is no longer needed starting with Solidity 0.8. The compiler
 * now has built in overflow checking.
 */
library SafeMath {
    /**
     * @dev Returns the addition of two unsigned integers, with an overflow flag.
     *
     * _Available since v3.4._
     */
    function tryAdd(uint256 a, uint256 b) internal pure returns (bool, uint256) {
        unchecked {
            uint256 c = a + b;
            if (c < a) return (false, 0);
            return (true, c);
        }
    }

    /**
     * @dev Returns the substraction of two unsigned integers, with an overflow flag.
     *
     * _Available since v3.4._
     */
    function trySub(uint256 a, uint256 b) internal pure returns (bool, uint256) {
        unchecked {
            if (b > a) return (false, 0);
            return (true, a - b);
        }
    }

    /**
     * @dev Returns the multiplication of two unsigned integers, with an overflow flag.
     *
     * _Available since v3.4._
     */
    function tryMul(uint256 a, uint256 b) internal pure returns (bool, uint256) {
        unchecked {
            // Gas optimization: this is cheaper than requiring 'a' not being zero, but the
            // benefit is lost if 'b' is also tested.
            // See: https://github.com/OpenZeppelin/openzeppelin-contracts/pull/522
            if (a == 0) return (true, 0);
            uint256 c = a * b;
            if (c / a != b) return (false, 0);
            return (true, c);
        }
    }

    /**
     * @dev Returns the division of two unsigned integers, with a division by zero flag.
     *
     * _Available since v3.4._
     */
    function tryDiv(uint256 a, uint256 b) internal pure returns (bool, uint256) {
        unchecked {
            if (b == 0) return (false, 0);
            return (true, a / b);
        }
    }

    /**
     * @dev Returns the remainder of dividing two unsigned integers, with a division by zero flag.
     *
     * _Available since v3.4._
     */
    function tryMod(uint256 a, uint256 b) internal pure returns (bool, uint256) {
        unchecked {
            if (b == 0) return (false, 0);
            return (true, a % b);
        }
    }

    /**
     * @dev Returns the addition of two unsigned integers, reverting on
     * overflow.
     *
     * Counterpart to Solidity's `+` operator.
     *
     * Requirements:
     *
     * - Addition cannot overflow.
     */
    function add(uint256 a, uint256 b) internal pure returns (uint256) {
        return a + b;
    }

    /**
     * @dev Returns the subtraction of two unsigned integers, reverting on
     * overflow (when the result is negative).
     *
     * Counterpart to Solidity's `-` operator.
     *
     * Requirements:
     *
     * - Subtraction cannot overflow.
     */
    function sub(uint256 a, uint256 b) internal pure returns (uint256) {
        return a - b;
    }

    /**
     * @dev Returns the multiplication of two unsigned integers, reverting on
     * overflow.
     *
     * Counterpart to Solidity's `*` operator.
     *
     * Requirements:
     *
     * - Multiplication cannot overflow.
     */
    function mul(uint256 a, uint256 b) internal pure returns (uint256) {
        return a * b;
    }

    /**
     * @dev Returns the integer division of two unsigned integers, reverting on
     * division by zero. The result is rounded towards zero.
     *
     * Counterpart to Solidity's `/` operator.
     *
     * Requirements:
     *
     * - The divisor cannot be zero.
     */
    function div(uint256 a, uint256 b) internal pure returns (uint256) {
        return a / b;
    }

    /**
     * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo),
     * reverting when dividing by zero.
     *
     * Counterpart to Solidity's `%` operator. This function uses a `revert`
     * opcode (which leaves remaining gas untouched) while Solidity uses an
     * invalid opcode to revert (consuming all remaining gas).
     *
     * Requirements:
     *
     * - The divisor cannot be zero.
     */
    function mod(uint256 a, uint256 b) internal pure returns (uint256) {
        return a % b;
    }

    /**
     * @dev Returns the subtraction of two unsigned integers, reverting with custom message on
     * overflow (when the result is negative).
     *
     * CAUTION: This function is deprecated because it requires allocating memory for the error
     * message unnecessarily. For custom revert reasons use {trySub}.
     *
     * Counterpart to Solidity's `-` operator.
     *
     * Requirements:
     *
     * - Subtraction cannot overflow.
     */
    function sub(
        uint256 a,
        uint256 b,
        string memory errorMessage
    ) internal pure returns (uint256) {
        unchecked {
            require(b <= a, errorMessage);
            return a - b;
        }
    }

    /**
     * @dev Returns the integer division of two unsigned integers, reverting with custom message on
     * division by zero. The result is rounded towards zero.
     *
     * Counterpart to Solidity's `/` operator. Note: this function uses a
     * `revert` opcode (which leaves remaining gas untouched) while Solidity
     * uses an invalid opcode to revert (consuming all remaining gas).
     *
     * Requirements:
     *
     * - The divisor cannot be zero.
     */
    function div(
        uint256 a,
        uint256 b,
        string memory errorMessage
    ) internal pure returns (uint256) {
        unchecked {
            require(b > 0, errorMessage);
            return a / b;
        }
    }

    /**
     * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo),
     * reverting with custom message when dividing by zero.
     *
     * CAUTION: This function is deprecated because it requires allocating memory for the error
     * message unnecessarily. For custom revert reasons use {tryMod}.
     *
     * Counterpart to Solidity's `%` operator. This function uses a `revert`
     * opcode (which leaves remaining gas untouched) while Solidity uses an
     * invalid opcode to revert (consuming all remaining gas).
     *
     * Requirements:
     *
     * - The divisor cannot be zero.
     */
    function mod(
        uint256 a,
        uint256 b,
        string memory errorMessage
    ) internal pure returns (uint256) {
        unchecked {
            require(b > 0, errorMessage);
            return a % b;
        }
    }
}

File 6 of 11 : draft-EIP712.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.0;

import "./ECDSA.sol";

/**
 * @dev https://eips.ethereum.org/EIPS/eip-712[EIP 712] is a standard for hashing and signing of typed structured data.
 *
 * The encoding specified in the EIP is very generic, and such a generic implementation in Solidity is not feasible,
 * thus this contract does not implement the encoding itself. Protocols need to implement the type-specific encoding
 * they need in their contracts using a combination of `abi.encode` and `keccak256`.
 *
 * This contract implements the EIP 712 domain separator ({_domainSeparatorV4}) that is used as part of the encoding
 * scheme, and the final step of the encoding to obtain the message digest that is then signed via ECDSA
 * ({_hashTypedDataV4}).
 *
 * The implementation of the domain separator was designed to be as efficient as possible while still properly updating
 * the chain id to protect against replay attacks on an eventual fork of the chain.
 *
 * NOTE: This contract implements the version of the encoding known as "v4", as implemented by the JSON RPC method
 * https://docs.metamask.io/guide/signing-data.html[`eth_signTypedDataV4` in MetaMask].
 *
 * _Available since v3.4._
 */
abstract contract EIP712 {
    /* solhint-disable var-name-mixedcase */
    // Cache the domain separator as an immutable value, but also store the chain id that it corresponds to, in order to
    // invalidate the cached domain separator if the chain id changes.
    bytes32 private immutable _CACHED_DOMAIN_SEPARATOR;
    uint256 private immutable _CACHED_CHAIN_ID;

    bytes32 private immutable _HASHED_NAME;
    bytes32 private immutable _HASHED_VERSION;
    bytes32 private immutable _TYPE_HASH;

    /* solhint-enable var-name-mixedcase */

    /**
     * @dev Initializes the domain separator and parameter caches.
     *
     * The meaning of `name` and `version` is specified in
     * https://eips.ethereum.org/EIPS/eip-712#definition-of-domainseparator[EIP 712]:
     *
     * - `name`: the user readable name of the signing domain, i.e. the name of the DApp or the protocol.
     * - `version`: the current major version of the signing domain.
     *
     * NOTE: These parameters cannot be changed except through a xref:learn::upgrading-smart-contracts.adoc[smart
     * contract upgrade].
     */
    constructor(string memory name, string memory version) {
        bytes32 hashedName = keccak256(bytes(name));
        bytes32 hashedVersion = keccak256(bytes(version));
        bytes32 typeHash = keccak256(
            "EIP712Domain(string name,string version,uint256 chainId,address verifyingContract)"
        );
        _HASHED_NAME = hashedName;
        _HASHED_VERSION = hashedVersion;
        _CACHED_CHAIN_ID = block.chainid;
        _CACHED_DOMAIN_SEPARATOR = _buildDomainSeparator(typeHash, hashedName, hashedVersion);
        _TYPE_HASH = typeHash;
    }

    /**
     * @dev Returns the domain separator for the current chain.
     */
    function _domainSeparatorV4() internal view returns (bytes32) {
        if (block.chainid == _CACHED_CHAIN_ID) {
            return _CACHED_DOMAIN_SEPARATOR;
        } else {
            return _buildDomainSeparator(_TYPE_HASH, _HASHED_NAME, _HASHED_VERSION);
        }
    }

    function _buildDomainSeparator(
        bytes32 typeHash,
        bytes32 nameHash,
        bytes32 versionHash
    ) private view returns (bytes32) {
        return keccak256(abi.encode(typeHash, nameHash, versionHash, block.chainid, address(this)));
    }

    /**
     * @dev Given an already https://eips.ethereum.org/EIPS/eip-712#definition-of-hashstruct[hashed struct], this
     * function returns the hash of the fully encoded EIP712 message for this domain.
     *
     * This hash can be used together with {ECDSA-recover} to obtain the signer of a message. For example:
     *
     * ```solidity
     * bytes32 digest = _hashTypedDataV4(keccak256(abi.encode(
     *     keccak256("Mail(address to,string contents)"),
     *     mailTo,
     *     keccak256(bytes(mailContents))
     * )));
     * address signer = ECDSA.recover(digest, signature);
     * ```
     */
    function _hashTypedDataV4(bytes32 structHash) internal view virtual returns (bytes32) {
        return ECDSA.toTypedDataHash(_domainSeparatorV4(), structHash);
    }
}

File 7 of 11 : IERC20.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.0;

/**
 * @dev Interface of the ERC20 standard as defined in the EIP.
 */
interface IERC20 {
    /**
     * @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 `recipient`.
     *
     * Returns a boolean value indicating whether the operation succeeded.
     *
     * Emits a {Transfer} event.
     */
    function transfer(address recipient, 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 `sender` to `recipient` 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 sender,
        address recipient,
        uint256 amount
    ) external returns (bool);

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

File 8 of 11 : IERC721.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.0;

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

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

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

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

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

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

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

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

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

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

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

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

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

File 9 of 11 : ECDSA.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.0;

/**
 * @dev Elliptic Curve Digital Signature Algorithm (ECDSA) operations.
 *
 * These functions can be used to verify that a message was signed by the holder
 * of the private keys of a given address.
 */
library ECDSA {
    enum RecoverError {
        NoError,
        InvalidSignature,
        InvalidSignatureLength,
        InvalidSignatureS,
        InvalidSignatureV
    }

    function _throwError(RecoverError error) private pure {
        if (error == RecoverError.NoError) {
            return; // no error: do nothing
        } else if (error == RecoverError.InvalidSignature) {
            revert("ECDSA: invalid signature");
        } else if (error == RecoverError.InvalidSignatureLength) {
            revert("ECDSA: invalid signature length");
        } else if (error == RecoverError.InvalidSignatureS) {
            revert("ECDSA: invalid signature 's' value");
        } else if (error == RecoverError.InvalidSignatureV) {
            revert("ECDSA: invalid signature 'v' value");
        }
    }

    /**
     * @dev Returns the address that signed a hashed message (`hash`) with
     * `signature` or error string. This address can then be used for verification purposes.
     *
     * The `ecrecover` EVM opcode allows for malleable (non-unique) signatures:
     * this function rejects them by requiring the `s` value to be in the lower
     * half order, and the `v` value to be either 27 or 28.
     *
     * IMPORTANT: `hash` _must_ be the result of a hash operation for the
     * verification to be secure: it is possible to craft signatures that
     * recover to arbitrary addresses for non-hashed data. A safe way to ensure
     * this is by receiving a hash of the original message (which may otherwise
     * be too long), and then calling {toEthSignedMessageHash} on it.
     *
     * Documentation for signature generation:
     * - with https://web3js.readthedocs.io/en/v1.3.4/web3-eth-accounts.html#sign[Web3.js]
     * - with https://docs.ethers.io/v5/api/signer/#Signer-signMessage[ethers]
     *
     * _Available since v4.3._
     */
    function tryRecover(bytes32 hash, bytes memory signature) internal pure returns (address, RecoverError) {
        // Check the signature length
        // - case 65: r,s,v signature (standard)
        // - case 64: r,vs signature (cf https://eips.ethereum.org/EIPS/eip-2098) _Available since v4.1._
        if (signature.length == 65) {
            bytes32 r;
            bytes32 s;
            uint8 v;
            // ecrecover takes the signature parameters, and the only way to get them
            // currently is to use assembly.
            assembly {
                r := mload(add(signature, 0x20))
                s := mload(add(signature, 0x40))
                v := byte(0, mload(add(signature, 0x60)))
            }
            return tryRecover(hash, v, r, s);
        } else if (signature.length == 64) {
            bytes32 r;
            bytes32 vs;
            // ecrecover takes the signature parameters, and the only way to get them
            // currently is to use assembly.
            assembly {
                r := mload(add(signature, 0x20))
                vs := mload(add(signature, 0x40))
            }
            return tryRecover(hash, r, vs);
        } else {
            return (address(0), RecoverError.InvalidSignatureLength);
        }
    }

    /**
     * @dev Returns the address that signed a hashed message (`hash`) with
     * `signature`. This address can then be used for verification purposes.
     *
     * The `ecrecover` EVM opcode allows for malleable (non-unique) signatures:
     * this function rejects them by requiring the `s` value to be in the lower
     * half order, and the `v` value to be either 27 or 28.
     *
     * IMPORTANT: `hash` _must_ be the result of a hash operation for the
     * verification to be secure: it is possible to craft signatures that
     * recover to arbitrary addresses for non-hashed data. A safe way to ensure
     * this is by receiving a hash of the original message (which may otherwise
     * be too long), and then calling {toEthSignedMessageHash} on it.
     */
    function recover(bytes32 hash, bytes memory signature) internal pure returns (address) {
        (address recovered, RecoverError error) = tryRecover(hash, signature);
        _throwError(error);
        return recovered;
    }

    /**
     * @dev Overload of {ECDSA-tryRecover} that receives the `r` and `vs` short-signature fields separately.
     *
     * See https://eips.ethereum.org/EIPS/eip-2098[EIP-2098 short signatures]
     *
     * _Available since v4.3._
     */
    function tryRecover(
        bytes32 hash,
        bytes32 r,
        bytes32 vs
    ) internal pure returns (address, RecoverError) {
        bytes32 s;
        uint8 v;
        assembly {
            s := and(vs, 0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff)
            v := add(shr(255, vs), 27)
        }
        return tryRecover(hash, v, r, s);
    }

    /**
     * @dev Overload of {ECDSA-recover} that receives the `r and `vs` short-signature fields separately.
     *
     * _Available since v4.2._
     */
    function recover(
        bytes32 hash,
        bytes32 r,
        bytes32 vs
    ) internal pure returns (address) {
        (address recovered, RecoverError error) = tryRecover(hash, r, vs);
        _throwError(error);
        return recovered;
    }

    /**
     * @dev Overload of {ECDSA-tryRecover} that receives the `v`,
     * `r` and `s` signature fields separately.
     *
     * _Available since v4.3._
     */
    function tryRecover(
        bytes32 hash,
        uint8 v,
        bytes32 r,
        bytes32 s
    ) internal pure returns (address, RecoverError) {
        // EIP-2 still allows signature malleability for ecrecover(). Remove this possibility and make the signature
        // unique. Appendix F in the Ethereum Yellow paper (https://ethereum.github.io/yellowpaper/paper.pdf), defines
        // the valid range for s in (301): 0 < s < secp256k1n ÷ 2 + 1, and for v in (302): v ∈ {27, 28}. Most
        // signatures from current libraries generate a unique signature with an s-value in the lower half order.
        //
        // If your library generates malleable signatures, such as s-values in the upper range, calculate a new s-value
        // with 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEBAAEDCE6AF48A03BBFD25E8CD0364141 - s1 and flip v from 27 to 28 or
        // vice versa. If your library also generates signatures with 0/1 for v instead 27/28, add 27 to v to accept
        // these malleable signatures as well.
        if (uint256(s) > 0x7FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF5D576E7357A4501DDFE92F46681B20A0) {
            return (address(0), RecoverError.InvalidSignatureS);
        }
        if (v != 27 && v != 28) {
            return (address(0), RecoverError.InvalidSignatureV);
        }

        // If the signature is valid (and not malleable), return the signer address
        address signer = ecrecover(hash, v, r, s);
        if (signer == address(0)) {
            return (address(0), RecoverError.InvalidSignature);
        }

        return (signer, RecoverError.NoError);
    }

    /**
     * @dev Overload of {ECDSA-recover} that receives the `v`,
     * `r` and `s` signature fields separately.
     */
    function recover(
        bytes32 hash,
        uint8 v,
        bytes32 r,
        bytes32 s
    ) internal pure returns (address) {
        (address recovered, RecoverError error) = tryRecover(hash, v, r, s);
        _throwError(error);
        return recovered;
    }

    /**
     * @dev Returns an Ethereum Signed Message, created from a `hash`. This
     * produces hash corresponding to the one signed with the
     * https://eth.wiki/json-rpc/API#eth_sign[`eth_sign`]
     * JSON-RPC method as part of EIP-191.
     *
     * See {recover}.
     */
    function toEthSignedMessageHash(bytes32 hash) internal pure returns (bytes32) {
        // 32 is the length in bytes of hash,
        // enforced by the type signature above
        return keccak256(abi.encodePacked("\x19Ethereum Signed Message:\n32", hash));
    }

    /**
     * @dev Returns an Ethereum Signed Typed Data, created from a
     * `domainSeparator` and a `structHash`. This produces hash corresponding
     * to the one signed with the
     * https://eips.ethereum.org/EIPS/eip-712[`eth_signTypedData`]
     * JSON-RPC method as part of EIP-712.
     *
     * See {recover}.
     */
    function toTypedDataHash(bytes32 domainSeparator, bytes32 structHash) internal pure returns (bytes32) {
        return keccak256(abi.encodePacked("\x19\x01", domainSeparator, structHash));
    }
}

File 10 of 11 : IERC165.sol
// SPDX-License-Identifier: MIT

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 11 of 11 : Context.sol
// SPDX-License-Identifier: MIT

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;
    }
}

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

Contract Security Audit

Contract ABI

API
[{"inputs":[],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"tokenId","type":"uint256"},{"indexed":false,"internalType":"address","name":"contractAddress","type":"address"},{"indexed":false,"internalType":"address","name":"owner","type":"address"}],"name":"Stake","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"tokenId","type":"uint256"},{"indexed":false,"internalType":"address","name":"contractAddress","type":"address"},{"indexed":false,"internalType":"address","name":"owner","type":"address"}],"name":"Unstake","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"owner","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"Withdraw","type":"event"},{"inputs":[{"internalType":"address","name":"accountAddress","type":"address"}],"name":"accountNonce","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"accountToLastWithdraw","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"accountToLastWithdrawAmount","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"contractAddress","type":"address"}],"name":"addContract","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"contracts","outputs":[{"internalType":"bool","name":"active","type":"bool"},{"internalType":"contract IERC721","name":"instance","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"operator","type":"address"},{"internalType":"address","name":"","type":"address"},{"internalType":"uint256","name":"","type":"uint256"},{"internalType":"bytes","name":"","type":"bytes"}],"name":"onERC721Received","outputs":[{"internalType":"bytes4","name":"","type":"bytes4"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"account","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"uint256","name":"nonce","type":"uint256"},{"internalType":"bytes","name":"signature","type":"bytes"}],"name":"recoverAddress","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"signerAddress","type":"address"}],"name":"setSignerAddress","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"contractAddress","type":"address"},{"internalType":"uint256[]","name":"tokenIds","type":"uint256[]"}],"name":"stake","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"contractAddress","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"stakedTokenTimestamp","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"contractAddress","type":"address"},{"internalType":"address","name":"owner","type":"address"}],"name":"stakedTokensOfOwner","outputs":[{"internalType":"uint256[]","name":"","type":"uint256[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"contractAddress","type":"address"},{"internalType":"uint256[]","name":"tokenIds","type":"uint256[]"}],"name":"unstake","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"contractAddress","type":"address"},{"internalType":"bool","name":"active","type":"bool"}],"name":"updateContract","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"bytes","name":"signature","type":"bytes"}],"name":"withdrawGoldz","outputs":[],"stateMutability":"nonpayable","type":"function"}]

610120604052600180546001600160a01b031916737be647634a942e73f8492d15ae492d867ce5245c17905534801561003757600080fd5b50604080518082018252600e81526d46657564616c7a5374616b696e6760901b60208083019182528351808501855260058152640312e302e360dc1b908201529151902060c08181527f06c015bd22b4c69690933c1058878ebdfef31f9aaae40bbe86d8a09fe1b2972c60e08190524660a081815286517f8b73c3c69bb8fe3d512ecc4cf759cc79239f7b179b0ffacaa9a75d522b39400f818801819052818901969096526060810193909352608080840192909252308382015286518084039091018152919092019094528351939092019290922090526101005261011c33610121565b610171565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b60805160a05160c05160e051610100516119186101b560003960006112c301526000611312015260006112ed015260006112710152600061129a01526119186000f3fe608060405234801561001057600080fd5b506004361061010b5760003560e01c8063715018a6116100a2578063a971ea0611610071578063a971ea0614610282578063c9a3911e14610295578063dfc8b2c7146102a8578063e8237df9146102bb578063f2fde38b146102db57600080fd5b8063715018a614610222578063754b069f1461022a5780638da5cb5b1461024a578063a686eb5f1461026f57600080fd5b80635dbe4756116100de5780635dbe47561461018a5780635f539d691461019d57806361d6c892146101b057806369dc9ff3146101d057600080fd5b806302bdbb9114610110578063046dc16614610125578063106cffe214610138578063150b7a021461015e575b600080fd5b61012361011e366004611738565b6102ee565b005b6101236101333660046114da565b61044d565b61014b6101463660046114da565b610499565b6040519081526020015b60405180910390f35b61017161016c366004611528565b6104b9565b6040516001600160e01b03199091168152602001610155565b610123610198366004611597565b61054d565b6101236101ab3660046114da565b610784565b61014b6101be3660046114da565b60076020526000908152604090205481565b6102036101de3660046114da565b60056020526000908152604090205460ff81169061010090046001600160a01b031682565b6040805192151583526001600160a01b03909116602083015201610155565b6101236107f2565b61023d6102383660046114f5565b610828565b6040516101559190611784565b6000546001600160a01b03165b6040516001600160a01b039091168152602001610155565b61014b61027d3660046116a6565b61091d565b61012361029036600461166f565b610971565b6101236102a3366004611597565b610a3b565b6102576102b63660046116d0565b610c30565b61014b6102c93660046114da565b60086020526000908152604090205481565b6101236102e93660046114da565b610c86565b61030333846102fc33610499565b8585610c30565b600b546001600160a01b039081169116146103595760405162461bcd60e51b8152602060048201526011602482015270696e76616c6964207369676e617475726560781b60448201526064015b60405180910390fd5b6001546040516323b872dd60e01b8152306004820152336024820152604481018590526001600160a01b03909116906323b872dd90606401602060405180830381600087803b1580156103ab57600080fd5b505af11580156103bf573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906103e3919061171b565b50336000818152600660209081526040808320805460010190556007825280832042905560088252918290208690558151928352820185905280517f884edad9ce6fa2440d8a54cc123490eb96d2768479d49ff9c7366125a94243649281900390910190a1505050565b6000546001600160a01b031633146104775760405162461bcd60e51b8152600401610350906117c8565b600b80546001600160a01b0319166001600160a01b0392909216919091179055565b6001600160a01b0381166000908152600660205260408120545b92915050565b60006001600160a01b03861630146105225760405162461bcd60e51b815260206004820152602660248201527f746f6b656e206d757374206265207374616b6564206f766572207374616b65206044820152651b595d1a1bd960d21b6064820152608401610350565b507f150b7a023d4804d13e8c85fb27262cb750cf6ba9f9dd3bb30d90f482ceeb4b1f95945050505050565b336000908152600660205260409020805460010190558161056f600982610d21565b61058b5760405162461bcd60e51b8152600401610350906117fd565b6001600160a01b0383166000908152600560205260408120905b835181101561077d5760008482815181106105c2576105c26118a8565b6020908102919091018101516001600160a01b0388166000908152600283526040808220338352909352919091209091506105fd9082610d46565b61063f5760405162461bcd60e51b81526020600482015260136024820152721d1bdad95b881a5cc81b9bdd081cdd185ad959606a1b6044820152606401610350565b6001600160a01b0386811660009081526003602090815260408083208584529091529081902080546001600160a01b031916905584549051632142170760e11b815230600482015233602482015260448101849052610100909104909116906342842e0e90606401600060405180830381600087803b1580156106c157600080fd5b505af11580156106d5573d6000803e3d6000fd5b5050506001600160a01b03871660009081526002602090815260408083203384529091529020610706915082610d5e565b506001600160a01b03861660008181526004602090815260408083208584528252808320929092558151848152908101929092523382820152517fda7b3993b5962cc80555cf305cbd92948048874e1a76a22272bdaaff09baeb659181900360600190a150806107758161184b565b9150506105a5565b5050505050565b6000546001600160a01b031633146107ae5760405162461bcd60e51b8152600401610350906117c8565b6001600160a01b038116600081815260056020526040902080546101009092026001600160a81b03199092169190911760011790556107ee600982610d6a565b5050565b6000546001600160a01b0316331461081c5760405162461bcd60e51b8152600401610350906117c8565b6108266000610d7f565b565b606082610836600982610d21565b6108525760405162461bcd60e51b8152600401610350906117fd565b6001600160a01b03808516600090815260026020908152604080832093871683529290529081209061088382610dcf565b67ffffffffffffffff81111561089b5761089b6118be565b6040519080825280602002602001820160405280156108c4578160200160208202803683370190505b50905060005b6108d383610dcf565b811015610913576108e48382610dd9565b8282815181106108f6576108f66118a8565b60209081029190910101528061090b8161184b565b9150506108ca565b5095945050505050565b60008261092b600982610d21565b6109475760405162461bcd60e51b8152600401610350906117fd565b50506001600160a01b03919091166000908152600460209081526040808320938352929052205490565b6000546001600160a01b0316331461099b5760405162461bcd60e51b8152600401610350906117c8565b816109a7600982610d21565b6109c35760405162461bcd60e51b8152600401610350906117fd565b6109ce600984610d21565b610a0f5760405162461bcd60e51b815260206004820152601260248201527118dbdb9d1c9858dd081b9bdd08185919195960721b6044820152606401610350565b506001600160a01b03919091166000908152600560205260409020805460ff1916911515919091179055565b336000908152600660205260409020805460010190556001600160a01b0382166000908152600560205260409020805460ff16610aba5760405162461bcd60e51b815260206004820152601c60248201527f746f6b656e20636f6e7472616374206973206e6f7420616374697665000000006044820152606401610350565b60005b8251811015610c2a576000838281518110610ada57610ada6118a8565b6020908102919091018101516001600160a01b03878116600090815260038452604080822084835290945283902080546001600160a01b0319163390811790915586549351632142170760e11b8152600481019190915230602482015260448101839052919350610100909204909116906342842e0e90606401600060405180830381600087803b158015610b6e57600080fd5b505af1158015610b82573d6000803e3d6000fd5b5050506001600160a01b03861660009081526002602090815260408083203384529091529020610bb3915082610de5565b506001600160a01b03851660008181526004602090815260408083208584528252918290204290558151848152908101929092523382820152517fae609c85500c59c843330d9c4f885719365cf818464f7efb761bd760411ac7b79181900360600190a15080610c228161184b565b915050610abd565b50505050565b6000610c7c610c40878787610df1565b84848080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250610e6492505050565b9695505050505050565b6000546001600160a01b03163314610cb05760405162461bcd60e51b8152600401610350906117c8565b6001600160a01b038116610d155760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608401610350565b610d1e81610d7f565b50565b6001600160a01b038116600090815260018301602052604081205415155b9392505050565b60008181526001830160205260408120541515610d3f565b6000610d3f8383610e88565b6000610d3f836001600160a01b038416610f7b565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b60006104b3825490565b6000610d3f8383610fca565b6000610d3f8383610f7b565b604080517f5d0db7706d1ae6167eaebc755b78e9e30c426647eaa27fa3eea42803b9ff9da260208201529081018390526001600160a01b038416606082015260808101829052600090610e5c9060a00160405160208183030381529060405280519060200120610ff4565b949350505050565b6000806000610e738585611042565b91509150610e80816110b2565b509392505050565b60008181526001830160205260408120548015610f71576000610eac600183611834565b8554909150600090610ec090600190611834565b9050818114610f25576000866000018281548110610ee057610ee06118a8565b9060005260206000200154905080876000018481548110610f0357610f036118a8565b6000918252602080832090910192909255918252600188019052604090208390555b8554869080610f3657610f36611892565b6001900381819060005260206000200160009055905585600101600086815260200190815260200160002060009055600193505050506104b3565b60009150506104b3565b6000818152600183016020526040812054610fc2575081546001818101845560008481526020808220909301849055845484825282860190935260409020919091556104b3565b5060006104b3565b6000826000018281548110610fe157610fe16118a8565b9060005260206000200154905092915050565b60006104b361100161126d565b8360405161190160f01b6020820152602281018390526042810182905260009060620160405160208183030381529060405280519060200120905092915050565b6000808251604114156110795760208301516040840151606085015160001a61106d87828585611360565b945094505050506110ab565b8251604014156110a3576020830151604084015161109886838361144d565b9350935050506110ab565b506000905060025b9250929050565b60008160048111156110c6576110c661187c565b14156110cf5750565b60018160048111156110e3576110e361187c565b14156111315760405162461bcd60e51b815260206004820152601860248201527f45434453413a20696e76616c6964207369676e617475726500000000000000006044820152606401610350565b60028160048111156111455761114561187c565b14156111935760405162461bcd60e51b815260206004820152601f60248201527f45434453413a20696e76616c6964207369676e6174757265206c656e677468006044820152606401610350565b60038160048111156111a7576111a761187c565b14156112005760405162461bcd60e51b815260206004820152602260248201527f45434453413a20696e76616c6964207369676e6174757265202773272076616c604482015261756560f01b6064820152608401610350565b60048160048111156112145761121461187c565b1415610d1e5760405162461bcd60e51b815260206004820152602260248201527f45434453413a20696e76616c6964207369676e6174757265202776272076616c604482015261756560f01b6064820152608401610350565b60007f00000000000000000000000000000000000000000000000000000000000000004614156112bc57507f000000000000000000000000000000000000000000000000000000000000000090565b50604080517f00000000000000000000000000000000000000000000000000000000000000006020808301919091527f0000000000000000000000000000000000000000000000000000000000000000828401527f000000000000000000000000000000000000000000000000000000000000000060608301524660808301523060a0808401919091528351808403909101815260c0909201909252805191012090565b6000807f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a08311156113975750600090506003611444565b8460ff16601b141580156113af57508460ff16601c14155b156113c05750600090506004611444565b6040805160008082526020820180845289905260ff881692820192909252606081018690526080810185905260019060a0016020604051602081039080840390855afa158015611414573d6000803e3d6000fd5b5050604051601f1901519150506001600160a01b03811661143d57600060019250925050611444565b9150600090505b94509492505050565b6000806001600160ff1b03831660ff84901c601b0161146e87828885611360565b935093505050935093915050565b80356001600160a01b038116811461149357600080fd5b919050565b60008083601f8401126114aa57600080fd5b50813567ffffffffffffffff8111156114c257600080fd5b6020830191508360208285010111156110ab57600080fd5b6000602082840312156114ec57600080fd5b610d3f8261147c565b6000806040838503121561150857600080fd5b6115118361147c565b915061151f6020840161147c565b90509250929050565b60008060008060006080868803121561154057600080fd5b6115498661147c565b94506115576020870161147c565b935060408601359250606086013567ffffffffffffffff81111561157a57600080fd5b61158688828901611498565b969995985093965092949392505050565b600080604083850312156115aa57600080fd5b6115b38361147c565b915060208084013567ffffffffffffffff808211156115d157600080fd5b818601915086601f8301126115e557600080fd5b8135818111156115f7576115f76118be565b8060051b604051601f19603f8301168101818110858211171561161c5761161c6118be565b604052828152858101935084860182860187018b101561163b57600080fd5b600095505b8386101561165e578035855260019590950194938601938601611640565b508096505050505050509250929050565b6000806040838503121561168257600080fd5b61168b8361147c565b9150602083013561169b816118d4565b809150509250929050565b600080604083850312156116b957600080fd5b6116c28361147c565b946020939093013593505050565b6000806000806000608086880312156116e857600080fd5b6116f18661147c565b94506020860135935060408601359250606086013567ffffffffffffffff81111561157a57600080fd5b60006020828403121561172d57600080fd5b8151610d3f816118d4565b60008060006040848603121561174d57600080fd5b83359250602084013567ffffffffffffffff81111561176b57600080fd5b61177786828701611498565b9497909650939450505050565b6020808252825182820181905260009190848201906040850190845b818110156117bc578351835292840192918401916001016117a0565b50909695505050505050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b60208082526018908201527f636f6e747261637420646f6573206e6f74206578697374730000000000000000604082015260600190565b60008282101561184657611846611866565b500390565b600060001982141561185f5761185f611866565b5060010190565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052602160045260246000fd5b634e487b7160e01b600052603160045260246000fd5b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052604160045260246000fd5b8015158114610d1e57600080fdfea2646970667358221220a76e6a8d403cf5184398e65a692f6b5ff1b86b345f3a0cf3bd1b22a8f7a3e42364736f6c63430008070033

Deployed Bytecode

0x608060405234801561001057600080fd5b506004361061010b5760003560e01c8063715018a6116100a2578063a971ea0611610071578063a971ea0614610282578063c9a3911e14610295578063dfc8b2c7146102a8578063e8237df9146102bb578063f2fde38b146102db57600080fd5b8063715018a614610222578063754b069f1461022a5780638da5cb5b1461024a578063a686eb5f1461026f57600080fd5b80635dbe4756116100de5780635dbe47561461018a5780635f539d691461019d57806361d6c892146101b057806369dc9ff3146101d057600080fd5b806302bdbb9114610110578063046dc16614610125578063106cffe214610138578063150b7a021461015e575b600080fd5b61012361011e366004611738565b6102ee565b005b6101236101333660046114da565b61044d565b61014b6101463660046114da565b610499565b6040519081526020015b60405180910390f35b61017161016c366004611528565b6104b9565b6040516001600160e01b03199091168152602001610155565b610123610198366004611597565b61054d565b6101236101ab3660046114da565b610784565b61014b6101be3660046114da565b60076020526000908152604090205481565b6102036101de3660046114da565b60056020526000908152604090205460ff81169061010090046001600160a01b031682565b6040805192151583526001600160a01b03909116602083015201610155565b6101236107f2565b61023d6102383660046114f5565b610828565b6040516101559190611784565b6000546001600160a01b03165b6040516001600160a01b039091168152602001610155565b61014b61027d3660046116a6565b61091d565b61012361029036600461166f565b610971565b6101236102a3366004611597565b610a3b565b6102576102b63660046116d0565b610c30565b61014b6102c93660046114da565b60086020526000908152604090205481565b6101236102e93660046114da565b610c86565b61030333846102fc33610499565b8585610c30565b600b546001600160a01b039081169116146103595760405162461bcd60e51b8152602060048201526011602482015270696e76616c6964207369676e617475726560781b60448201526064015b60405180910390fd5b6001546040516323b872dd60e01b8152306004820152336024820152604481018590526001600160a01b03909116906323b872dd90606401602060405180830381600087803b1580156103ab57600080fd5b505af11580156103bf573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906103e3919061171b565b50336000818152600660209081526040808320805460010190556007825280832042905560088252918290208690558151928352820185905280517f884edad9ce6fa2440d8a54cc123490eb96d2768479d49ff9c7366125a94243649281900390910190a1505050565b6000546001600160a01b031633146104775760405162461bcd60e51b8152600401610350906117c8565b600b80546001600160a01b0319166001600160a01b0392909216919091179055565b6001600160a01b0381166000908152600660205260408120545b92915050565b60006001600160a01b03861630146105225760405162461bcd60e51b815260206004820152602660248201527f746f6b656e206d757374206265207374616b6564206f766572207374616b65206044820152651b595d1a1bd960d21b6064820152608401610350565b507f150b7a023d4804d13e8c85fb27262cb750cf6ba9f9dd3bb30d90f482ceeb4b1f95945050505050565b336000908152600660205260409020805460010190558161056f600982610d21565b61058b5760405162461bcd60e51b8152600401610350906117fd565b6001600160a01b0383166000908152600560205260408120905b835181101561077d5760008482815181106105c2576105c26118a8565b6020908102919091018101516001600160a01b0388166000908152600283526040808220338352909352919091209091506105fd9082610d46565b61063f5760405162461bcd60e51b81526020600482015260136024820152721d1bdad95b881a5cc81b9bdd081cdd185ad959606a1b6044820152606401610350565b6001600160a01b0386811660009081526003602090815260408083208584529091529081902080546001600160a01b031916905584549051632142170760e11b815230600482015233602482015260448101849052610100909104909116906342842e0e90606401600060405180830381600087803b1580156106c157600080fd5b505af11580156106d5573d6000803e3d6000fd5b5050506001600160a01b03871660009081526002602090815260408083203384529091529020610706915082610d5e565b506001600160a01b03861660008181526004602090815260408083208584528252808320929092558151848152908101929092523382820152517fda7b3993b5962cc80555cf305cbd92948048874e1a76a22272bdaaff09baeb659181900360600190a150806107758161184b565b9150506105a5565b5050505050565b6000546001600160a01b031633146107ae5760405162461bcd60e51b8152600401610350906117c8565b6001600160a01b038116600081815260056020526040902080546101009092026001600160a81b03199092169190911760011790556107ee600982610d6a565b5050565b6000546001600160a01b0316331461081c5760405162461bcd60e51b8152600401610350906117c8565b6108266000610d7f565b565b606082610836600982610d21565b6108525760405162461bcd60e51b8152600401610350906117fd565b6001600160a01b03808516600090815260026020908152604080832093871683529290529081209061088382610dcf565b67ffffffffffffffff81111561089b5761089b6118be565b6040519080825280602002602001820160405280156108c4578160200160208202803683370190505b50905060005b6108d383610dcf565b811015610913576108e48382610dd9565b8282815181106108f6576108f66118a8565b60209081029190910101528061090b8161184b565b9150506108ca565b5095945050505050565b60008261092b600982610d21565b6109475760405162461bcd60e51b8152600401610350906117fd565b50506001600160a01b03919091166000908152600460209081526040808320938352929052205490565b6000546001600160a01b0316331461099b5760405162461bcd60e51b8152600401610350906117c8565b816109a7600982610d21565b6109c35760405162461bcd60e51b8152600401610350906117fd565b6109ce600984610d21565b610a0f5760405162461bcd60e51b815260206004820152601260248201527118dbdb9d1c9858dd081b9bdd08185919195960721b6044820152606401610350565b506001600160a01b03919091166000908152600560205260409020805460ff1916911515919091179055565b336000908152600660205260409020805460010190556001600160a01b0382166000908152600560205260409020805460ff16610aba5760405162461bcd60e51b815260206004820152601c60248201527f746f6b656e20636f6e7472616374206973206e6f7420616374697665000000006044820152606401610350565b60005b8251811015610c2a576000838281518110610ada57610ada6118a8565b6020908102919091018101516001600160a01b03878116600090815260038452604080822084835290945283902080546001600160a01b0319163390811790915586549351632142170760e11b8152600481019190915230602482015260448101839052919350610100909204909116906342842e0e90606401600060405180830381600087803b158015610b6e57600080fd5b505af1158015610b82573d6000803e3d6000fd5b5050506001600160a01b03861660009081526002602090815260408083203384529091529020610bb3915082610de5565b506001600160a01b03851660008181526004602090815260408083208584528252918290204290558151848152908101929092523382820152517fae609c85500c59c843330d9c4f885719365cf818464f7efb761bd760411ac7b79181900360600190a15080610c228161184b565b915050610abd565b50505050565b6000610c7c610c40878787610df1565b84848080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250610e6492505050565b9695505050505050565b6000546001600160a01b03163314610cb05760405162461bcd60e51b8152600401610350906117c8565b6001600160a01b038116610d155760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608401610350565b610d1e81610d7f565b50565b6001600160a01b038116600090815260018301602052604081205415155b9392505050565b60008181526001830160205260408120541515610d3f565b6000610d3f8383610e88565b6000610d3f836001600160a01b038416610f7b565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b60006104b3825490565b6000610d3f8383610fca565b6000610d3f8383610f7b565b604080517f5d0db7706d1ae6167eaebc755b78e9e30c426647eaa27fa3eea42803b9ff9da260208201529081018390526001600160a01b038416606082015260808101829052600090610e5c9060a00160405160208183030381529060405280519060200120610ff4565b949350505050565b6000806000610e738585611042565b91509150610e80816110b2565b509392505050565b60008181526001830160205260408120548015610f71576000610eac600183611834565b8554909150600090610ec090600190611834565b9050818114610f25576000866000018281548110610ee057610ee06118a8565b9060005260206000200154905080876000018481548110610f0357610f036118a8565b6000918252602080832090910192909255918252600188019052604090208390555b8554869080610f3657610f36611892565b6001900381819060005260206000200160009055905585600101600086815260200190815260200160002060009055600193505050506104b3565b60009150506104b3565b6000818152600183016020526040812054610fc2575081546001818101845560008481526020808220909301849055845484825282860190935260409020919091556104b3565b5060006104b3565b6000826000018281548110610fe157610fe16118a8565b9060005260206000200154905092915050565b60006104b361100161126d565b8360405161190160f01b6020820152602281018390526042810182905260009060620160405160208183030381529060405280519060200120905092915050565b6000808251604114156110795760208301516040840151606085015160001a61106d87828585611360565b945094505050506110ab565b8251604014156110a3576020830151604084015161109886838361144d565b9350935050506110ab565b506000905060025b9250929050565b60008160048111156110c6576110c661187c565b14156110cf5750565b60018160048111156110e3576110e361187c565b14156111315760405162461bcd60e51b815260206004820152601860248201527f45434453413a20696e76616c6964207369676e617475726500000000000000006044820152606401610350565b60028160048111156111455761114561187c565b14156111935760405162461bcd60e51b815260206004820152601f60248201527f45434453413a20696e76616c6964207369676e6174757265206c656e677468006044820152606401610350565b60038160048111156111a7576111a761187c565b14156112005760405162461bcd60e51b815260206004820152602260248201527f45434453413a20696e76616c6964207369676e6174757265202773272076616c604482015261756560f01b6064820152608401610350565b60048160048111156112145761121461187c565b1415610d1e5760405162461bcd60e51b815260206004820152602260248201527f45434453413a20696e76616c6964207369676e6174757265202776272076616c604482015261756560f01b6064820152608401610350565b60007f00000000000000000000000000000000000000000000000000000000000000014614156112bc57507f5636140a44bbaea330dfcdaf3b244db40dd2c6840a3a97b84fdd6aaeade090f190565b50604080517f8b73c3c69bb8fe3d512ecc4cf759cc79239f7b179b0ffacaa9a75d522b39400f6020808301919091527f7234d2001b081a1a1dfa0bc03aff5c6e18d69e8d554f91b61d600f8d1a30ca04828401527f06c015bd22b4c69690933c1058878ebdfef31f9aaae40bbe86d8a09fe1b2972c60608301524660808301523060a0808401919091528351808403909101815260c0909201909252805191012090565b6000807f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a08311156113975750600090506003611444565b8460ff16601b141580156113af57508460ff16601c14155b156113c05750600090506004611444565b6040805160008082526020820180845289905260ff881692820192909252606081018690526080810185905260019060a0016020604051602081039080840390855afa158015611414573d6000803e3d6000fd5b5050604051601f1901519150506001600160a01b03811661143d57600060019250925050611444565b9150600090505b94509492505050565b6000806001600160ff1b03831660ff84901c601b0161146e87828885611360565b935093505050935093915050565b80356001600160a01b038116811461149357600080fd5b919050565b60008083601f8401126114aa57600080fd5b50813567ffffffffffffffff8111156114c257600080fd5b6020830191508360208285010111156110ab57600080fd5b6000602082840312156114ec57600080fd5b610d3f8261147c565b6000806040838503121561150857600080fd5b6115118361147c565b915061151f6020840161147c565b90509250929050565b60008060008060006080868803121561154057600080fd5b6115498661147c565b94506115576020870161147c565b935060408601359250606086013567ffffffffffffffff81111561157a57600080fd5b61158688828901611498565b969995985093965092949392505050565b600080604083850312156115aa57600080fd5b6115b38361147c565b915060208084013567ffffffffffffffff808211156115d157600080fd5b818601915086601f8301126115e557600080fd5b8135818111156115f7576115f76118be565b8060051b604051601f19603f8301168101818110858211171561161c5761161c6118be565b604052828152858101935084860182860187018b101561163b57600080fd5b600095505b8386101561165e578035855260019590950194938601938601611640565b508096505050505050509250929050565b6000806040838503121561168257600080fd5b61168b8361147c565b9150602083013561169b816118d4565b809150509250929050565b600080604083850312156116b957600080fd5b6116c28361147c565b946020939093013593505050565b6000806000806000608086880312156116e857600080fd5b6116f18661147c565b94506020860135935060408601359250606086013567ffffffffffffffff81111561157a57600080fd5b60006020828403121561172d57600080fd5b8151610d3f816118d4565b60008060006040848603121561174d57600080fd5b83359250602084013567ffffffffffffffff81111561176b57600080fd5b61177786828701611498565b9497909650939450505050565b6020808252825182820181905260009190848201906040850190845b818110156117bc578351835292840192918401916001016117a0565b50909695505050505050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b60208082526018908201527f636f6e747261637420646f6573206e6f74206578697374730000000000000000604082015260600190565b60008282101561184657611846611866565b500390565b600060001982141561185f5761185f611866565b5060010190565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052602160045260246000fd5b634e487b7160e01b600052603160045260246000fd5b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052604160045260246000fd5b8015158114610d1e57600080fdfea2646970667358221220a76e6a8d403cf5184398e65a692f6b5ff1b86b345f3a0cf3bd1b22a8f7a3e42364736f6c63430008070033

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