Contract 0xa0f3ff3f88ee2d1a5dc2a0c93d8d9f9a2fe73e96

 
 
Txn Hash
Method
Block
From
To
Value [Txn Fee]
0x4d86ff5917d5d8d62c41dcd46348faa66bedbe9aa018bd88cec3366d36c530070x60806040348407352022-10-26 23:40:42155 days 9 hrs ago0x31a14626579c3197b43de563128c2171f4f840ad IN  Create: AavegotchiOperator0 MATIC0.159440186749 67.44169255
[ Download CSV Export 
Parent Txn Hash Block From To Value
Loading

Contract Source Code Verified (Exact Match)

Contract Name:
AavegotchiOperator

Compiler Version
v0.8.9+commit.e5eed63a

Optimization Enabled:
No with 200 runs

Other Settings:
default evmVersion

Contract Source Code (Solidity Standard Json-Input format)

File 1 of 9 : AavegotchiOperator.sol
// SPDX-License-Identifier: GPL-3.0-only

pragma solidity ^0.8.9;

import "@openzeppelin/contracts/utils/structs/EnumerableSet.sol";
import "@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol";
import { LibArrayUtils } from "./libraries/LibArrayUtils.sol";
import { LibAavegotchiUtils } from "./libraries/LibAavegotchiUtils.sol";
import { IAavegotchiDiamond, TokenIdsWithKinship } from "./interfaces/IAavegotchiDiamond.sol";

contract AavegotchiOperator is OwnableUpgradeable {
    using EnumerableSet for EnumerableSet.AddressSet;
    struct AavegotchiOwner {
        address owner;
        bool isApproved;
        uint32[] tokenIds;
    }

    uint256 public _maxNumberOfAavegotchis;
    address public _aavegotchiDiamondAddress;
    address public _gelatoAddress;
    EnumerableSet.AddressSet private _approvedAddresses;

    event EnablePetOperator(address indexed owner);
    event DisablePetOperator(address indexed owner);
    event InteractAavegotchis(uint256[] tokenIds);

    mapping(address => bool) public _gelatoAddresses;
    uint256 public _lastPetBlockNumber;
    
    modifier onlyGelato() {
        require(_gelatoAddresses[msg.sender] || msg.sender == _gelatoAddress, "Only Gelato can invoke this function");
        _;
    }

    // @notice Proxy initializer function. Should be only callable once
    // @param aavegotchiDiamondContract The aavegotchi diamond contract
    // @param max_number_aavegotchis Maximum number of aavegotchis pet at a time
    // @param gelatoOps address for gelato executors smart contracts
    function initialize(address aavegotchiDiamondContract, uint256 max_number_aavegotchis, address gelatoAddress) public initializer {
        _gelatoAddress = gelatoAddress;
        _maxNumberOfAavegotchis = max_number_aavegotchis;
        _aavegotchiDiamondAddress = aavegotchiDiamondContract;
        __Ownable_init_unchained();
    }

    // @notice Fetch all approved and revoked addresses
    // @return approvedAddresses_ The list of approved addresses
    function listApprovedAddresses() external view returns (address[] memory approvedAddresses_) {
        address[] memory enabledAddresses = listEnabledAddresses();
        address[] memory approvedAddresses = new address[](enabledAddresses.length);
        uint256 numberOfApprovedAddresses;
        for (uint256 i; i < enabledAddresses.length; i++) {
            address enabledAddress = enabledAddresses[i];
            bool isApproved = IAavegotchiDiamond(_aavegotchiDiamondAddress).isPetOperatorForAll(enabledAddress, address(this));
            if (isApproved) {
                approvedAddresses[numberOfApprovedAddresses] = enabledAddress;
                numberOfApprovedAddresses++;
            }
        }
        approvedAddresses_ = LibArrayUtils.shortenArray(approvedAddresses, numberOfApprovedAddresses);
    }

    // @notice Fetch all approved and revoked addresses
    // @return revokedAddresses_ The list of revoked addresses
    function listRevokedAddresses() external view returns (address[] memory revokedAddresses_) {
        address[] memory enabledAddresses = listEnabledAddresses();
        address[] memory revokedAddresses = new address[](enabledAddresses.length);
        uint256 numberOfRevokedAddresses;
        for (uint256 i; i < enabledAddresses.length; i++) {
            address enabledAddress = enabledAddresses[i];
            bool isApproved = IAavegotchiDiamond(_aavegotchiDiamondAddress).isPetOperatorForAll(enabledAddress, address(this));
            if (!isApproved) {
                revokedAddresses[numberOfRevokedAddresses] = enabledAddress;
                numberOfRevokedAddresses++;
            }
        }
        revokedAddresses_ = LibArrayUtils.shortenArray(revokedAddresses, numberOfRevokedAddresses);
    }


    // @notice Retrieve the token ids of all aavegotchis to pet, and list all address to remove. The number of aavegotchis is capped to fit in a single transaction
    // @return tokenIds_ The token ids of all aavegotchis to pet
    // @return revokedAddresses_ The addresses that revoked pet approvals
    function listAavegotchisToPetAndAddressesToRemove() external view returns (uint256[] memory tokenIds_, address[] memory revokedAddresses_) {
        uint256 numberOfAavegotchis;
        uint256 numberOfRevokedAddresses;
        uint256 numberOfApprovedAddresses;
        address[] memory enabledAddresses = listEnabledAddresses();
        address[] memory revokedAddresses = new address[](enabledAddresses.length);
        uint256[][] memory tokenIdsOfOwners = new uint256[][](enabledAddresses.length);
        IAavegotchiDiamond aavegotchiDiamond = IAavegotchiDiamond(_aavegotchiDiamondAddress);
        for (uint256 i; i < enabledAddresses.length && numberOfAavegotchis < _maxNumberOfAavegotchis; i++) {
            address enabledAddress = enabledAddresses[i];
            bool isApproved = aavegotchiDiamond.isPetOperatorForAll(enabledAddress, address(this));
            if (isApproved == false) {
                revokedAddresses[numberOfRevokedAddresses] = enabledAddress;
                numberOfRevokedAddresses++;
            } else {
                uint256 aavegotchiCounter;
                TokenIdsWithKinship[] memory aavegotchis = aavegotchiDiamond.tokenIdsWithKinship(enabledAddress, 0, 0, true);
                uint256[] memory tokenIds = new uint256[](aavegotchis.length);
                for (uint256 j; j < aavegotchis.length && numberOfAavegotchis < _maxNumberOfAavegotchis; j++) {
                    TokenIdsWithKinship memory info = aavegotchis[j];
                    if (info.tokenId != 0 && LibAavegotchiUtils.isAavegotchiPetAble(info.lastInteracted) == true) {
                        tokenIds[aavegotchiCounter] = info.tokenId;
                        aavegotchiCounter++;
                        numberOfAavegotchis++;
                    }
                }
                tokenIdsOfOwners[numberOfApprovedAddresses] = LibArrayUtils.shortenArray(tokenIds, aavegotchiCounter);
                numberOfApprovedAddresses++;
            }
        }

        uint tokenIdCounter;
        tokenIds_ = new uint256[](numberOfAavegotchis);
        for (uint256 i; i < numberOfApprovedAddresses; i++) {
            uint256[] memory tokenIds = tokenIdsOfOwners[i];
            for (uint256 j; j < tokenIds.length; j++) {
                uint256 tokenId = tokenIds[j];
                tokenIds_[tokenIdCounter] = tokenId;
                tokenIdCounter++;
            }
        }

        revokedAddresses_ = LibArrayUtils.shortenArray(revokedAddresses, numberOfRevokedAddresses);
    }

    // @notice Pet aavegotchis of approved addresses and remove those that revoked
    // @param tokenIds Array of aavegotchi token ids that are going to be pet
    // @param revokedAddresses Array of address that are going to be removed from the approvals set
    // @dev Emits event InteractAavegotchis
    function petAavegotchisAndRemoveRevoked(uint256[] calldata tokenIds, address[] calldata revokedAddresses) external onlyGelato {
        IAavegotchiDiamond aavegotchiDiamond = IAavegotchiDiamond(_aavegotchiDiamondAddress);
        if (tokenIds.length > 0) {
            aavegotchiDiamond.interact(tokenIds);
            emit InteractAavegotchis(tokenIds);
            _lastPetBlockNumber = block.number;
        }
        for (uint256 i; i < revokedAddresses.length; i++) {
            address revokedAddress = revokedAddresses[i];
            bool isApproved = aavegotchiDiamond.isPetOperatorForAll(revokedAddress, address(this));
            if (isApproved == false) {
                disablePetOperatorForOwner(revokedAddress);
            }
        }
    }

    // @notice Enable this contract to pet all msg.sender aavegotchis
    // @dev Emits EnablePetOperator
    function enablePetOperator() external {
        IAavegotchiDiamond aavegotchiDiamond = IAavegotchiDiamond(_aavegotchiDiamondAddress);
        bool isApproved = aavegotchiDiamond.isPetOperatorForAll(msg.sender, address(this));
        require(isApproved == true, "AavegotchiOperator is not approved, please call setPetOperatorForAll");
        EnumerableSet.add(_approvedAddresses, msg.sender);
        emit EnablePetOperator(msg.sender);
    }

    // @notice Remove this contract's ability to pet msg.sender aavegotchis
    // @dev Emits DisablePetOperator if msg.sender was removed
    // @return true if msg.sender was removed
    function disablePetOperator() external {
        disablePetOperatorForOwner(msg.sender);
    }

    // @notice Remove this contract's ability to pet owner's aavegotchis
    // @dev Emits DisablePetOperator if owner was removed
    // @param owner The address approved for petting
    // @return true if msg.sender was removed
    function disablePetOperatorForOwner(address owner) private {
        bool removed = EnumerableSet.remove(_approvedAddresses, owner);
        if (removed == true) {
            emit DisablePetOperator(owner);
        }
    }

    // @notice Lists all address this contract is able to interact
    // @return approvedAddresses_ array of approved addresses
    function listEnabledAddresses() public view returns (address[] memory approvedAddresses_) {
        approvedAddresses_ = EnumerableSet.values(_approvedAddresses);
    }

    // @notice Changes Gelato address
    // @dev array length must be the same
    // @param address array of gelatoAddress Gelato addresses
    // @param bool array for addresses to be enabled or disabled
    function setGelatoAddresses(address[] calldata gelatoAddress, bool[] calldata isValid) public onlyOwner {
        require(gelatoAddress.length == isValid.length, "AavegotchiOperator: array length mismatch");
        for(uint256 i; i < gelatoAddress.length; i++) {
            _gelatoAddresses[gelatoAddress[i]] = isValid[i];
        }
    }

    function getLastPetBlockNumber() external view returns (uint256) {
        return _lastPetBlockNumber;
    }

}

File 2 of 9 : EnumerableSet.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.7.0) (utils/structs/EnumerableSet.sol)

pragma solidity ^0.8.0;

/**
 * @dev Library for managing
 * https://en.wikipedia.org/wiki/Set_(abstract_data_type)[sets] of primitive
 * types.
 *
 * Sets have the following properties:
 *
 * - Elements are added, removed, and checked for existence in constant time
 * (O(1)).
 * - Elements are enumerated in O(n). No guarantees are made on the ordering.
 *
 * ```
 * contract Example {
 *     // Add the library methods
 *     using EnumerableSet for EnumerableSet.AddressSet;
 *
 *     // Declare a set state variable
 *     EnumerableSet.AddressSet private mySet;
 * }
 * ```
 *
 * As of v3.3.0, sets of type `bytes32` (`Bytes32Set`), `address` (`AddressSet`)
 * and `uint256` (`UintSet`) are supported.
 *
 * [WARNING]
 * ====
 *  Trying to delete such a structure from storage will likely result in data corruption, rendering the structure unusable.
 *  See https://github.com/ethereum/solidity/pull/11843[ethereum/solidity#11843] for more info.
 *
 *  In order to clean an EnumerableSet, you can either remove all elements one by one or create a fresh instance using an array of EnumerableSet.
 * ====
 */
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;

        /// @solidity memory-safe-assembly
        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;

        /// @solidity memory-safe-assembly
        assembly {
            result := store
        }

        return result;
    }
}

File 3 of 9 : OwnableUpgradeable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.7.0) (access/Ownable.sol)

pragma solidity ^0.8.0;

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

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

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

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

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

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

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

    /**
     * @dev Throws if the sender is not the owner.
     */
    function _checkOwner() internal view virtual {
        require(owner() == _msgSender(), "Ownable: caller is not the owner");
    }

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

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

    /**
     * @dev Transfers ownership of the contract to a new account (`newOwner`).
     * Internal function without access restriction.
     */
    function _transferOwnership(address newOwner) internal virtual {
        address oldOwner = _owner;
        _owner = newOwner;
        emit OwnershipTransferred(oldOwner, newOwner);
    }

    /**
     * @dev This empty reserved space is put in place to allow future versions to add new
     * variables without shifting down storage in the inheritance chain.
     * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps
     */
    uint256[49] private __gap;
}

File 4 of 9 : LibArrayUtils.sol
// SPDX-License-Identifier: GPL-3.0-only

pragma solidity ^0.8.9;

library LibArrayUtils {

    function shortenArray(uint256[] memory array, uint256 length) internal pure returns (uint256[] memory array_) {
        array_ = new uint256[](length);
        for (uint256 i; i < length; i++) {
            array_[i] = array[i];
        }
    }

    function shortenArray(address[] memory array, uint256 length) internal pure returns (address[] memory array_) {
        array_ = new address[](length);
        for (uint256 i; i < length; i++) {
            array_[i] = array[i];
        }
    }

}

File 5 of 9 : LibAavegotchiUtils.sol
// SPDX-License-Identifier: GPL-3.0-only

pragma solidity ^0.8.9;

library LibAavegotchiUtils {

    function isAavegotchiPetAble(uint256 lastInteracted) internal view returns (bool isPetAble_) {
        isPetAble_ = block.timestamp > lastInteracted + 12 hours;
    }

}

File 6 of 9 : IAavegotchiDiamond.sol
// SPDX-License-Identifier: GPL-3.0-only

pragma solidity ^0.8.9;

struct TokenIdsWithKinship {
    uint256 tokenId;
    uint256 kinship;
    uint256 lastInteracted;
}

interface IAavegotchiDiamond {

    event PetOperatorApprovalForAll(address indexed _owner, address indexed _operator, bool _approved);

    // @notice Enable or disable approval for a third party("operator") to help pet LibMeta.msgSender()'s gotchis
    // @dev Emits the PetOperatorApprovalForAll event
    // @param _operator Address to disable/enable as a pet operator
    // @param _approved True if operator is approved,False if approval is revoked
    function setPetOperatorForAll(address _operator, bool _approved) external;

    // @notice Query the tokenId,kinship and lastInteracted values of a set of NFTs belonging to an address
    // @dev Will throw if `_count` is greater than the number of NFTs owned by `_owner`
    // @param _owner Address to query
    // @param _count Number of NFTs to check
    // @param _skip Number of NFTs to skip while querying
    // @param all If true, query all NFTs owned by `_owner`; if false, query `_count` NFTs owned by `_owner`
    // @return tokenIdsWithKinship_ An array of structs where each struct contains the `tokenId`,`kinship`and `lastInteracted` of each NFT
    function tokenIdsWithKinship(
        address _owner, uint256 _count, uint256 _skip, bool all
    ) external view returns (TokenIdsWithKinship[] memory tokenIdsWithKinship_);

    // @notice Check if an address `_operator` is an authorized pet operator for another address `_owner`
    // @param _owner address of the lender of the NFTs
    // @param _operator address that acts pets the gotchis on behalf of the owner
    // @return approved_ true if `operator` is an approved pet operator, False if otherwise
    function isPetOperatorForAll(address _owner, address _operator) external view returns (bool approved_);

    // @notice Allow the owner of an NFT to interact with them.thereby increasing their kinship(petting)
    // @dev only valid for claimed aavegotchis
    // @dev Kinship will only increase if the lastInteracted minus the current time is greater than or equal to 12 hours
    // @param _tokenIds An array containing the token identifiers of the claimed aavegotchis that are to be interacted with
    function interact(uint256[] calldata _tokenIds) external;

}

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

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

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

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

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

    /**
     * @dev This empty reserved space is put in place to allow future versions to add new
     * variables without shifting down storage in the inheritance chain.
     * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps
     */
    uint256[50] private __gap;
}

File 8 of 9 : Initializable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.7.0) (proxy/utils/Initializable.sol)

pragma solidity ^0.8.2;

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

/**
 * @dev This is a base contract to aid in writing upgradeable contracts, or any kind of contract that will be deployed
 * behind a proxy. Since proxied contracts do not make use of a constructor, it's common to move constructor logic to an
 * external initializer function, usually called `initialize`. It then becomes necessary to protect this initializer
 * function so it can only be called once. The {initializer} modifier provided by this contract will have this effect.
 *
 * The initialization functions use a version number. Once a version number is used, it is consumed and cannot be
 * reused. This mechanism prevents re-execution of each "step" but allows the creation of new initialization steps in
 * case an upgrade adds a module that needs to be initialized.
 *
 * For example:
 *
 * [.hljs-theme-light.nopadding]
 * ```
 * contract MyToken is ERC20Upgradeable {
 *     function initialize() initializer public {
 *         __ERC20_init("MyToken", "MTK");
 *     }
 * }
 * contract MyTokenV2 is MyToken, ERC20PermitUpgradeable {
 *     function initializeV2() reinitializer(2) public {
 *         __ERC20Permit_init("MyToken");
 *     }
 * }
 * ```
 *
 * TIP: To avoid leaving the proxy in an uninitialized state, the initializer function should be called as early as
 * possible by providing the encoded function call as the `_data` argument to {ERC1967Proxy-constructor}.
 *
 * CAUTION: When used with inheritance, manual care must be taken to not invoke a parent initializer twice, or to ensure
 * that all initializers are idempotent. This is not verified automatically as constructors are by Solidity.
 *
 * [CAUTION]
 * ====
 * Avoid leaving a contract uninitialized.
 *
 * An uninitialized contract can be taken over by an attacker. This applies to both a proxy and its implementation
 * contract, which may impact the proxy. To prevent the implementation contract from being used, you should invoke
 * the {_disableInitializers} function in the constructor to automatically lock it when it is deployed:
 *
 * [.hljs-theme-light.nopadding]
 * ```
 * /// @custom:oz-upgrades-unsafe-allow constructor
 * constructor() {
 *     _disableInitializers();
 * }
 * ```
 * ====
 */
abstract contract Initializable {
    /**
     * @dev Indicates that the contract has been initialized.
     * @custom:oz-retyped-from bool
     */
    uint8 private _initialized;

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

    /**
     * @dev Triggered when the contract has been initialized or reinitialized.
     */
    event Initialized(uint8 version);

    /**
     * @dev A modifier that defines a protected initializer function that can be invoked at most once. In its scope,
     * `onlyInitializing` functions can be used to initialize parent contracts. Equivalent to `reinitializer(1)`.
     */
    modifier initializer() {
        bool isTopLevelCall = !_initializing;
        require(
            (isTopLevelCall && _initialized < 1) || (!AddressUpgradeable.isContract(address(this)) && _initialized == 1),
            "Initializable: contract is already initialized"
        );
        _initialized = 1;
        if (isTopLevelCall) {
            _initializing = true;
        }
        _;
        if (isTopLevelCall) {
            _initializing = false;
            emit Initialized(1);
        }
    }

    /**
     * @dev A modifier that defines a protected reinitializer function that can be invoked at most once, and only if the
     * contract hasn't been initialized to a greater version before. In its scope, `onlyInitializing` functions can be
     * used to initialize parent contracts.
     *
     * `initializer` is equivalent to `reinitializer(1)`, so a reinitializer may be used after the original
     * initialization step. This is essential to configure modules that are added through upgrades and that require
     * initialization.
     *
     * Note that versions can jump in increments greater than 1; this implies that if multiple reinitializers coexist in
     * a contract, executing them in the right order is up to the developer or operator.
     */
    modifier reinitializer(uint8 version) {
        require(!_initializing && _initialized < version, "Initializable: contract is already initialized");
        _initialized = version;
        _initializing = true;
        _;
        _initializing = false;
        emit Initialized(version);
    }

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

    /**
     * @dev Locks the contract, preventing any future reinitialization. This cannot be part of an initializer call.
     * Calling this in the constructor of a contract will prevent that contract from being initialized or reinitialized
     * to any version. It is recommended to use this to lock implementation contracts that are designed to be called
     * through proxies.
     */
    function _disableInitializers() internal virtual {
        require(!_initializing, "Initializable: contract is initializing");
        if (_initialized < type(uint8).max) {
            _initialized = type(uint8).max;
            emit Initialized(type(uint8).max);
        }
    }
}

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

pragma solidity ^0.8.1;

/**
 * @dev Collection of functions related to the address type
 */
library AddressUpgradeable {
    /**
     * @dev Returns true if `account` is a contract.
     *
     * [IMPORTANT]
     * ====
     * It is unsafe to assume that an address for which this function returns
     * false is an externally-owned account (EOA) and not a contract.
     *
     * Among others, `isContract` will return false for the following
     * types of addresses:
     *
     *  - an externally-owned account
     *  - a contract in construction
     *  - an address where a contract will be created
     *  - an address where a contract lived, but was destroyed
     * ====
     *
     * [IMPORTANT]
     * ====
     * You shouldn't rely on `isContract` to protect against flash loan attacks!
     *
     * Preventing calls from contracts is highly discouraged. It breaks composability, breaks support for smart wallets
     * like Gnosis Safe, and does not provide security since it can be circumvented by calling from a contract
     * constructor.
     * ====
     */
    function isContract(address account) internal view returns (bool) {
        // This method relies on extcodesize/address.code.length, which returns 0
        // for contracts in construction, since the code is only stored at the end
        // of the constructor execution.

        return account.code.length > 0;
    }

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

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

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

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

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

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

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

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

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

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

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

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

Contract Security Audit

Contract ABI

[{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"owner","type":"address"}],"name":"DisablePetOperator","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"owner","type":"address"}],"name":"EnablePetOperator","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint8","name":"version","type":"uint8"}],"name":"Initialized","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256[]","name":"tokenIds","type":"uint256[]"}],"name":"InteractAavegotchis","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"inputs":[],"name":"_aavegotchiDiamondAddress","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"_gelatoAddress","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"_gelatoAddresses","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"_lastPetBlockNumber","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"_maxNumberOfAavegotchis","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"disablePetOperator","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"enablePetOperator","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"getLastPetBlockNumber","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"aavegotchiDiamondContract","type":"address"},{"internalType":"uint256","name":"max_number_aavegotchis","type":"uint256"},{"internalType":"address","name":"gelatoAddress","type":"address"}],"name":"initialize","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"listAavegotchisToPetAndAddressesToRemove","outputs":[{"internalType":"uint256[]","name":"tokenIds_","type":"uint256[]"},{"internalType":"address[]","name":"revokedAddresses_","type":"address[]"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"listApprovedAddresses","outputs":[{"internalType":"address[]","name":"approvedAddresses_","type":"address[]"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"listEnabledAddresses","outputs":[{"internalType":"address[]","name":"approvedAddresses_","type":"address[]"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"listRevokedAddresses","outputs":[{"internalType":"address[]","name":"revokedAddresses_","type":"address[]"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256[]","name":"tokenIds","type":"uint256[]"},{"internalType":"address[]","name":"revokedAddresses","type":"address[]"}],"name":"petAavegotchisAndRemoveRevoked","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address[]","name":"gelatoAddress","type":"address[]"},{"internalType":"bool[]","name":"isValid","type":"bool[]"}],"name":"setGelatoAddresses","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"}]

608060405234801561001057600080fd5b506129ea806100206000396000f3fe608060405234801561001057600080fd5b50600436106101165760003560e01c80638da5cb5b116100a2578063c344d66311610071578063c344d66314610275578063c350a1b514610291578063d7f08b07146102ad578063df03bd65146102cb578063f2fde38b146102ea57610116565b80638da5cb5b146101ff5780638fc890ba1461021d57806393efb8181461023b578063b6217a311461026b57610116565b80634640532d116100e95780634640532d1461019357806346dfb84b146101b15780635accf075146101cd57806368ad2163146101eb578063715018a6146101f557610116565b80631b82b1b81461011b5780632b8b68801461013957806337ac9e6114610157578063439112bb14610175575b600080fd5b610123610306565b6040516101309190611a69565b60405180910390f35b610141610310565b60405161014e9190611b74565b60405180910390f35b61015f6104d4565b60405161016c9190611a69565b60405180910390f35b61017d6104da565b60405161018a9190611b74565b60405180910390f35b61019b6104eb565b6040516101a89190611ba5565b60405180910390f35b6101cb60048036038101906101c69190611c8f565b610511565b005b6101d56107d3565b6040516101e29190611a69565b60405180910390f35b6101f36107d9565b005b6101fd610929565b005b61020761093d565b6040516102149190611ba5565b60405180910390f35b610225610967565b6040516102329190611b74565b60405180910390f35b61025560048036038101906102509190611d3c565b610b2a565b6040516102629190611d84565b60405180910390f35b610273610b4a565b005b61028f600480360381019061028a9190611df5565b610b55565b005b6102ab60048036038101906102a69190611ea2565b610c72565b005b6102b5610e3c565b6040516102c29190611ba5565b60405180910390f35b6102d3610e62565b6040516102e1929190611fb3565b60405180910390f35b61030460048036038101906102ff9190611d3c565b611375565b005b6000606b54905090565b6060600061031c6104da565b90506000815167ffffffffffffffff81111561033b5761033a611fea565b5b6040519080825280602002602001820160405280156103695781602001602082028036833780820191505090505b5090506000805b83518110156104c157600084828151811061038e5761038d612019565b5b602002602001015190506000606660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663d7358fea83306040518363ffffffff1660e01b81526004016103f7929190612048565b60206040518083038186803b15801561040f57600080fd5b505afa158015610423573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610447919061209d565b905080156104ac578185858151811061046357610462612019565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff168152505083806104a8906120f9565b9450505b505080806104b9906120f9565b915050610370565b506104cc82826113f9565b935050505090565b60655481565b60606104e660686114d3565b905090565b606760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b606a60003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16806105b65750606760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16145b6105f5576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016105ec906121c5565b60405180910390fd5b6000606660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905060008585905011156106d6578073ffffffffffffffffffffffffffffffffffffffff166322c6751986866040518363ffffffff1660e01b8152600401610663929190612255565b600060405180830381600087803b15801561067d57600080fd5b505af1158015610691573d6000803e3d6000fd5b505050507fac51d74c7ec105daa2c1dc47202661af6daa7e77c31e2f50568c6616c549785185856040516106c6929190612255565b60405180910390a143606b819055505b60005b838390508110156107cb5760008484838181106106f9576106f8612019565b5b905060200201602081019061070e9190611d3c565b905060008373ffffffffffffffffffffffffffffffffffffffff1663d7358fea83306040518363ffffffff1660e01b815260040161074d929190612048565b60206040518083038186803b15801561076557600080fd5b505afa158015610779573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061079d919061209d565b90506000151581151514156107b6576107b5826114f4565b5b505080806107c3906120f9565b9150506106d9565b505050505050565b606b5481565b6000606660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905060008173ffffffffffffffffffffffffffffffffffffffff1663d7358fea33306040518363ffffffff1660e01b815260040161083d929190612048565b60206040518083038186803b15801561085557600080fd5b505afa158015610869573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061088d919061209d565b905060011515811515146108d6576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016108cd90612311565b60405180910390fd5b6108e1606833611558565b503373ffffffffffffffffffffffffffffffffffffffff167f36531038832ac386bf214ba7ba87f623282201917944811168ce61a674641cda60405160405180910390a25050565b610931611588565b61093b6000611606565b565b6000603360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b606060006109736104da565b90506000815167ffffffffffffffff81111561099257610991611fea565b5b6040519080825280602002602001820160405280156109c05781602001602082028036833780820191505090505b5090506000805b8351811015610b175760008482815181106109e5576109e4612019565b5b602002602001015190506000606660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663d7358fea83306040518363ffffffff1660e01b8152600401610a4e929190612048565b60206040518083038186803b158015610a6657600080fd5b505afa158015610a7a573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610a9e919061209d565b905080610b025781858581518110610ab957610ab8612019565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff16815250508380610afe906120f9565b9450505b50508080610b0f906120f9565b9150506109c7565b50610b2282826113f9565b935050505090565b606a6020528060005260406000206000915054906101000a900460ff1681565b610b53336114f4565b565b610b5d611588565b818190508484905014610ba5576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610b9c906123a3565b60405180910390fd5b60005b84849050811015610c6b57828282818110610bc657610bc5612019565b5b9050602002016020810190610bdb91906123d8565b606a6000878785818110610bf257610bf1612019565b5b9050602002016020810190610c079190611d3c565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055508080610c63906120f9565b915050610ba8565b5050505050565b60008060019054906101000a900460ff16159050808015610ca35750600160008054906101000a900460ff1660ff16105b80610cd05750610cb2306116cc565b158015610ccf5750600160008054906101000a900460ff1660ff16145b5b610d0f576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610d0690612477565b60405180910390fd5b60016000806101000a81548160ff021916908360ff1602179055508015610d4c576001600060016101000a81548160ff0219169083151502179055505b81606760006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508260658190555083606660006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550610ddd6116ef565b8015610e365760008060016101000a81548160ff0219169083151502179055507f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024986001604051610e2d91906124e9565b60405180910390a15b50505050565b606660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b606080600080600080610e736104da565b90506000815167ffffffffffffffff811115610e9257610e91611fea565b5b604051908082528060200260200182016040528015610ec05781602001602082028036833780820191505090505b5090506000825167ffffffffffffffff811115610ee057610edf611fea565b5b604051908082528060200260200182016040528015610f1357816020015b6060815260200190600190039081610efe5790505b5090506000606660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905060005b845181108015610f51575060655488105b15611262576000858281518110610f6b57610f6a612019565b5b6020026020010151905060008373ffffffffffffffffffffffffffffffffffffffff1663d7358fea83306040518363ffffffff1660e01b8152600401610fb2929190612048565b60206040518083038186803b158015610fca57600080fd5b505afa158015610fde573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611002919061209d565b90506000151581151514156110725781868a8151811061102557611024612019565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050888061106a906120f9565b99505061124d565b6000808573ffffffffffffffffffffffffffffffffffffffff16631436d4b18560008060016040518563ffffffff1660e01b81526004016110b6949392919061253f565b60006040518083038186803b1580156110ce57600080fd5b505afa1580156110e2573d6000803e3d6000fd5b505050506040513d6000823e3d601f19601f8201168201806040525081019061110b9190612722565b90506000815167ffffffffffffffff81111561112a57611129611fea565b5b6040519080825280602002602001820160405280156111585781602001602082028036833780820191505090505b50905060005b82518110801561116f57506065548e105b1561121257600083828151811061118957611188612019565b5b6020026020010151905060008160000151141580156111b85750600115156111b48260400151611750565b1515145b156111fe5780600001518386815181106111d5576111d4612019565b5b60200260200101818152505084806111ec906120f9565b9550508e806111fa906120f9565b9f50505b50808061120a906120f9565b91505061115e565b5061121d8184611769565b888c815181106112305761122f612019565b5b60200260200101819052508a80611246906120f9565b9b50505050505b5050808061125a906120f9565b915050610f40565b5060008767ffffffffffffffff81111561127f5761127e611fea565b5b6040519080825280602002602001820160405280156112ad5781602001602082028036833780820191505090505b50995060005b8681101561135c5760008482815181106112d0576112cf612019565b5b6020026020010151905060005b81518110156113475760008282815181106112fb576112fa612019565b5b60200260200101519050808e868151811061131957611318612019565b5b6020026020010181815250508480611330906120f9565b95505050808061133f906120f9565b9150506112dd565b50508080611354906120f9565b9150506112b3565b5061136784886113f9565b985050505050505050509091565b61137d611588565b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614156113ed576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016113e4906127dd565b60405180910390fd5b6113f681611606565b50565b60608167ffffffffffffffff81111561141557611414611fea565b5b6040519080825280602002602001820160405280156114435781602001602082028036833780820191505090505b50905060005b828110156114cc5783818151811061146457611463612019565b5b602002602001015182828151811061147f5761147e612019565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff168152505080806114c4906120f9565b915050611449565b5092915050565b606060006114e383600001611815565b905060608190508092505050919050565b6000611501606883611871565b9050600115158115151415611554578173ffffffffffffffffffffffffffffffffffffffff167f94335d3ce19ee49faa59c549e359ad0abdf32a02f926d2a013732f0376f300e960405160405180910390a25b5050565b6000611580836000018373ffffffffffffffffffffffffffffffffffffffff1660001b6118a1565b905092915050565b611590611911565b73ffffffffffffffffffffffffffffffffffffffff166115ae61093d565b73ffffffffffffffffffffffffffffffffffffffff1614611604576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016115fb90612849565b60405180910390fd5b565b6000603360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905081603360006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508173ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a35050565b6000808273ffffffffffffffffffffffffffffffffffffffff163b119050919050565b600060019054906101000a900460ff1661173e576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611735906128db565b60405180910390fd5b61174e611749611911565b611606565b565b600061a8c08261176091906128fb565b42119050919050565b60608167ffffffffffffffff81111561178557611784611fea565b5b6040519080825280602002602001820160405280156117b35781602001602082028036833780820191505090505b50905060005b8281101561180e578381815181106117d4576117d3612019565b5b60200260200101518282815181106117ef576117ee612019565b5b6020026020010181815250508080611806906120f9565b9150506117b9565b5092915050565b60608160000180548060200260200160405190810160405280929190818152602001828054801561186557602002820191906000526020600020905b815481526020019060010190808311611851575b50505050509050919050565b6000611899836000018373ffffffffffffffffffffffffffffffffffffffff1660001b611919565b905092915050565b60006118ad8383611a2d565b61190657826000018290806001815401808255809150506001900390600052602060002001600090919091909150558260000180549050836001016000848152602001908152602001600020819055506001905061190b565b600090505b92915050565b600033905090565b60008083600101600084815260200190815260200160002054905060008114611a2157600060018261194b9190612951565b90506000600186600001805490506119639190612951565b90508181146119d257600086600001828154811061198457611983612019565b5b90600052602060002001549050808760000184815481106119a8576119a7612019565b5b90600052602060002001819055508387600101600083815260200190815260200160002081905550505b856000018054806119e6576119e5612985565b5b600190038181906000526020600020016000905590558560010160008681526020019081526020016000206000905560019350505050611a27565b60009150505b92915050565b600080836001016000848152602001908152602001600020541415905092915050565b6000819050919050565b611a6381611a50565b82525050565b6000602082019050611a7e6000830184611a5a565b92915050565b600081519050919050565b600082825260208201905092915050565b6000819050602082019050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000611adb82611ab0565b9050919050565b611aeb81611ad0565b82525050565b6000611afd8383611ae2565b60208301905092915050565b6000602082019050919050565b6000611b2182611a84565b611b2b8185611a8f565b9350611b3683611aa0565b8060005b83811015611b67578151611b4e8882611af1565b9750611b5983611b09565b925050600181019050611b3a565b5085935050505092915050565b60006020820190508181036000830152611b8e8184611b16565b905092915050565b611b9f81611ad0565b82525050565b6000602082019050611bba6000830184611b96565b92915050565b6000604051905090565b600080fd5b600080fd5b600080fd5b600080fd5b600080fd5b60008083601f840112611bf957611bf8611bd4565b5b8235905067ffffffffffffffff811115611c1657611c15611bd9565b5b602083019150836020820283011115611c3257611c31611bde565b5b9250929050565b60008083601f840112611c4f57611c4e611bd4565b5b8235905067ffffffffffffffff811115611c6c57611c6b611bd9565b5b602083019150836020820283011115611c8857611c87611bde565b5b9250929050565b60008060008060408587031215611ca957611ca8611bca565b5b600085013567ffffffffffffffff811115611cc757611cc6611bcf565b5b611cd387828801611be3565b9450945050602085013567ffffffffffffffff811115611cf657611cf5611bcf565b5b611d0287828801611c39565b925092505092959194509250565b611d1981611ad0565b8114611d2457600080fd5b50565b600081359050611d3681611d10565b92915050565b600060208284031215611d5257611d51611bca565b5b6000611d6084828501611d27565b91505092915050565b60008115159050919050565b611d7e81611d69565b82525050565b6000602082019050611d996000830184611d75565b92915050565b60008083601f840112611db557611db4611bd4565b5b8235905067ffffffffffffffff811115611dd257611dd1611bd9565b5b602083019150836020820283011115611dee57611ded611bde565b5b9250929050565b60008060008060408587031215611e0f57611e0e611bca565b5b600085013567ffffffffffffffff811115611e2d57611e2c611bcf565b5b611e3987828801611c39565b9450945050602085013567ffffffffffffffff811115611e5c57611e5b611bcf565b5b611e6887828801611d9f565b925092505092959194509250565b611e7f81611a50565b8114611e8a57600080fd5b50565b600081359050611e9c81611e76565b92915050565b600080600060608486031215611ebb57611eba611bca565b5b6000611ec986828701611d27565b9350506020611eda86828701611e8d565b9250506040611eeb86828701611d27565b9150509250925092565b600081519050919050565b600082825260208201905092915050565b6000819050602082019050919050565b611f2a81611a50565b82525050565b6000611f3c8383611f21565b60208301905092915050565b6000602082019050919050565b6000611f6082611ef5565b611f6a8185611f00565b9350611f7583611f11565b8060005b83811015611fa6578151611f8d8882611f30565b9750611f9883611f48565b925050600181019050611f79565b5085935050505092915050565b60006040820190508181036000830152611fcd8185611f55565b90508181036020830152611fe18184611b16565b90509392505050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b600060408201905061205d6000830185611b96565b61206a6020830184611b96565b9392505050565b61207a81611d69565b811461208557600080fd5b50565b60008151905061209781612071565b92915050565b6000602082840312156120b3576120b2611bca565b5b60006120c184828501612088565b91505092915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b600061210482611a50565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff821415612137576121366120ca565b5b600182019050919050565b600082825260208201905092915050565b7f4f6e6c792047656c61746f2063616e20696e766f6b6520746869732066756e6360008201527f74696f6e00000000000000000000000000000000000000000000000000000000602082015250565b60006121af602483612142565b91506121ba82612153565b604082019050919050565b600060208201905081810360008301526121de816121a2565b9050919050565b600080fd5b82818337600083830152505050565b60006122058385611f00565b93507f07ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff831115612238576122376121e5565b5b6020830292506122498385846121ea565b82840190509392505050565b600060208201905081810360008301526122708184866121f9565b90509392505050565b7f41617665676f746368694f70657261746f72206973206e6f7420617070726f7660008201527f65642c20706c656173652063616c6c207365745065744f70657261746f72466f60208201527f72416c6c00000000000000000000000000000000000000000000000000000000604082015250565b60006122fb604483612142565b915061230682612279565b606082019050919050565b6000602082019050818103600083015261232a816122ee565b9050919050565b7f41617665676f746368694f70657261746f723a206172726179206c656e67746860008201527f206d69736d617463680000000000000000000000000000000000000000000000602082015250565b600061238d602983612142565b915061239882612331565b604082019050919050565b600060208201905081810360008301526123bc81612380565b9050919050565b6000813590506123d281612071565b92915050565b6000602082840312156123ee576123ed611bca565b5b60006123fc848285016123c3565b91505092915050565b7f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160008201527f647920696e697469616c697a6564000000000000000000000000000000000000602082015250565b6000612461602e83612142565b915061246c82612405565b604082019050919050565b6000602082019050818103600083015261249081612454565b9050919050565b6000819050919050565b600060ff82169050919050565b6000819050919050565b60006124d36124ce6124c984612497565b6124ae565b6124a1565b9050919050565b6124e3816124b8565b82525050565b60006020820190506124fe60008301846124da565b92915050565b6000819050919050565b600061252961252461251f84612504565b6124ae565b611a50565b9050919050565b6125398161250e565b82525050565b60006080820190506125546000830187611b96565b6125616020830186612530565b61256e6040830185612530565b61257b6060830184611d75565b95945050505050565b6000601f19601f8301169050919050565b61259e82612584565b810181811067ffffffffffffffff821117156125bd576125bc611fea565b5b80604052505050565b60006125d0611bc0565b90506125dc8282612595565b919050565b600067ffffffffffffffff8211156125fc576125fb611fea565b5b602082029050602081019050919050565b600080fd5b60008151905061262181611e76565b92915050565b60006060828403121561263d5761263c61260d565b5b61264760606125c6565b9050600061265784828501612612565b600083015250602061266b84828501612612565b602083015250604061267f84828501612612565b60408301525092915050565b600061269e612699846125e1565b6125c6565b905080838252602082019050606084028301858111156126c1576126c0611bde565b5b835b818110156126ea57806126d68882612627565b8452602084019350506060810190506126c3565b5050509392505050565b600082601f83011261270957612708611bd4565b5b815161271984826020860161268b565b91505092915050565b60006020828403121561273857612737611bca565b5b600082015167ffffffffffffffff81111561275657612755611bcf565b5b612762848285016126f4565b91505092915050565b7f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160008201527f6464726573730000000000000000000000000000000000000000000000000000602082015250565b60006127c7602683612142565b91506127d28261276b565b604082019050919050565b600060208201905081810360008301526127f6816127ba565b9050919050565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b6000612833602083612142565b915061283e826127fd565b602082019050919050565b6000602082019050818103600083015261286281612826565b9050919050565b7f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960008201527f6e697469616c697a696e67000000000000000000000000000000000000000000602082015250565b60006128c5602b83612142565b91506128d082612869565b604082019050919050565b600060208201905081810360008301526128f4816128b8565b9050919050565b600061290682611a50565b915061291183611a50565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff03821115612946576129456120ca565b5b828201905092915050565b600061295c82611a50565b915061296783611a50565b92508282101561297a576129796120ca565b5b828203905092915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603160045260246000fdfea26469706673582212201e7bfc7a786a40263106167bb4245f9cf2844313b2e4621be2a51647f7d6209464736f6c63430008090033

Block Transaction Gas Used Reward
Age Block Fee Address BC Fee Address Voting Power Jailed Incoming
Block Uncle Number Difficulty Gas Used Reward
Loading
Loading
Make sure to use the "Vote Down" button for any spammy posts, and the "Vote Up" for interesting conversations.