ETH Price: $3,399.17 (+6.40%)
 

Overview

Max Total Supply

0 AI-Index

Holders

9

Market

Volume (24H)

N/A

Min Price (24H)

N/A

Max Price (24H)

N/A
Filtered by Token Holder
jaysal1.eth
Balance
1 AI-Index
0x4ada1b9d9fe28abd9585f58cfeed2169a39e1c6b
Loading...
Loading
Loading...
Loading
Loading...
Loading

Click here to update the token information / general information
# Exchange Pair Price  24H Volume % Volume

Contract Source Code Verified (Exact Match)

Contract Name:
Aside0x01

Compiler Version
v0.8.25+commit.b61c2a91

Optimization Enabled:
Yes with 200 runs

Other Settings:
paris EvmVersion
File 1 of 24 : Aside0x01.sol
// SPDX-License-Identifier: MIT
pragma solidity 0.8.25;

import {AsideChainlink} from "./AsideChainlink.sol";

contract Aside0x01 is AsideChainlink {
    uint256 public constant SENTIMENT_INTERVAL = 10;

    uint256 private _lastSentiment;
    uint256 private _lastSentimentTimestamp;

    /**
     * @notice Creates a new Aside0x01 contract.
     * @param baseURI_ The base URI of the token.
     * @param admin_ The address to set as the DEFAULT_ADMIN of this contract.
     * @param minter_ The address to set as the MINTER of this contract.
     * @param updater_ The address to set as the UPDATER of this contract.
     * @param verse_ The address of Verse's custodial wallet.
     * @param timelock_ The duration of the timelock upon which all tokens are automatically unlocked.
     * @param router_ The address of the Chainlink Functions router.
     * @param donId_ The id of the Chainlink Functions DON.
     * @param subscriptionId_ The id of the Chainlink Functions subscription.
     * @param callbackGasLimit_ The callback gas limit of the Chainlink Functions call.
     * @param source_ The source of the Chainlink Functions call.
     */
    constructor(
        string memory baseURI_,
        address admin_,
        address minter_,
        address updater_,
        address verse_,
        uint256 timelock_,
        address router_,
        bytes32 donId_,
        uint64 subscriptionId_,
        uint32 callbackGasLimit_,
        string memory source_
    )
        AsideChainlink(
            "AI Index",
            "AI-Index",
            baseURI_,
            100,
            admin_,
            minter_,
            updater_,
            verse_,
            timelock_,
            router_,
            donId_,
            subscriptionId_,
            callbackGasLimit_,
            source_
        )
    {}

    // #region getter functions
    /**
     * @notice Returns the last AI sentiment fetched through Chainlink Functions.
     * @return sentiment The last AI sentiment fetched through Chainlink Functions.
     * @return timestamp The timestamp of the last AI sentiment fetched through Chainlink Functions.
     */
    function lastSentiment() public view returns (uint256 sentiment, uint256 timestamp) {
        sentiment = _lastSentiment;
        timestamp = _lastSentimentTimestamp;
    }

    /**
     * @notice Returns the sentiment associated to token `tokenId`.
     * @dev `tokenId` must exist.
     * @return The sentiment associated to token `tokenId`.
     */
    function sentimentOf(uint256 tokenId) public view returns (uint256) {
        _requireOwned(tokenId);

        return _sentimentOf(tokenId);
    }
    // #endregion

    // #region internal Chainlink functions
    /**
     * @notice Callback function for fulfilling a Chainlink Functions request.
     * @param requestId The id of the request to fulfill.
     * @param response The HTTP response data.
     * @param err Any errors from the Chainlink Functions request.
     */
    function fulfillRequest(bytes32 requestId, bytes memory response, bytes memory err)
        internal
        override
        onlyValidRequestId(requestId)
        onlyValidCallback(err)
    {
        _lastSentiment = uint256(bytes32(response));
        _lastSentimentTimestamp = block.timestamp;
    }
    // #endregion

    // #region internal hook functions
    function _beforeUnlock(uint256[] memory tokenIds) internal override {
        super._beforeUnlock(tokenIds);

        if (block.timestamp > _lastSentimentTimestamp + 1 hours) revert DeprecatedData();

        uint256 length = tokenIds.length;
        for (uint256 i = 0; i < length; i++) {
            uint256 tokenId = tokenIds[i];
            uint256 current = _lastSentiment;
            uint256 expected = _sentimentOf(tokenId);
            if (current < expected || current >= expected + SENTIMENT_INTERVAL) {
                revert InvalidUnlock(tokenId);
            }
        }
    }
    // #endregion

    // #region private functions
    function _sentimentOf(uint256 tokenId) private pure returns (uint256) {
        return tokenId - (tokenId % 10);
    }
    // #endregion
}

File 2 of 24 : AsideChainlink.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.25;

import {AsideBase} from "./AsideBase.sol";
import {FunctionsClient} from "chainlink/src/v0.8/functions/v1_0_0/FunctionsClient.sol";
import {FunctionsRequest} from "chainlink/src/v0.8/functions/v1_0_0/libraries/FunctionsRequest.sol";

abstract contract AsideChainlink is AsideBase, FunctionsClient {
    using FunctionsRequest for FunctionsRequest.Request;

    error InvalidDonId();
    error InvalidSubscriptionId();
    error InvalidCallbackGasLimit();
    error InvalidSource();
    error InvalidRequestId(bytes32 requestId);
    error InvalidCallback(bytes err);
    error DeprecatedData();

    modifier onlyValidRequestId(bytes32 requestId) {
        if (requestId != _lastRequestId) revert InvalidRequestId(requestId);
        _;
    }

    modifier onlyValidCallback(bytes memory err) {
        if (err.length != 0) revert InvalidCallback(err);
        _;
    }

    bytes32 public constant UPDATER_ROLE = keccak256("UPDATER_ROLE");
    bytes32 private _donId;
    uint64 private _subscriptionId;
    uint32 private _callbackGasLimit;
    string private _source;
    bytes32 private _lastRequestId;

    /**
     * @notice Creates a new AsideChainlink contract.
     * @param name_ The name of the token.
     * @param symbol_ The symbol of the token.
     * @param baseURI_ The base URI of the token.
     * @param nbOfTokens_ The number of tokens allowed to be minted.
     * @param admin_ The address to set as the DEFAULT_ADMIN of this contract.
     * @param minter_ The address to set as the MINTER of this contract.
     * @param updater_ The address to set as the UPDATER of this contract.
     * @param verse_ The address of Verse's custodial wallet.
     * @param timelock_ The duration of the timelock upon which all tokens are automatically unlocked.
     * @param router_ The address of the Chainlink Functions router.
     * @param donId_ The id of the Chainlink Functions DON.
     * @param subscriptionId_ The id of the Chainlink Functions subscription.
     * @param callbackGasLimit_ The callback gas limit of the Chainlink Functions call.
     * @param source_ The source of the Chainlink Functions call.
     */
    constructor(
        string memory name_,
        string memory symbol_,
        string memory baseURI_,
        uint256 nbOfTokens_,
        address admin_,
        address minter_,
        address updater_,
        address verse_,
        uint256 timelock_,
        address router_,
        bytes32 donId_,
        uint64 subscriptionId_,
        uint32 callbackGasLimit_,
        string memory source_
    ) AsideBase(name_, symbol_, baseURI_, nbOfTokens_, admin_, minter_, verse_, timelock_) FunctionsClient(router_) {
        _grantRole(UPDATER_ROLE, updater_);
        _setDonId(donId_);
        _setSubscriptionId(subscriptionId_);
        _setCallbackGasLimit(callbackGasLimit_);
        _setSource(source_);
    }

    function update(string[] calldata args) external onlyRole(UPDATER_ROLE) {
        FunctionsRequest.Request memory request;
        request.initializeRequestForInlineJavaScript(_source);
        if (args.length > 0) request.setArgs(args);
        bytes32 requestId = _sendRequest(request.encodeCBOR(), _subscriptionId, _callbackGasLimit, _donId);
        _lastRequestId = requestId;

        _afterUpdate(requestId, args);
    }

    // #region admin-only functions
    /**
     * @notice Sets the Chainlink Functions DON id.
     * @param donId_ The id of the Chainlink Functions DON.
     */
    function setDonId(bytes32 donId_) external onlyRole(DEFAULT_ADMIN_ROLE) {
        _setDonId(donId_);
    }

    /**
     * @notice Sets the Chainlink Functions subscription id.
     * @param subscriptionId_ The id of the Chainlink Functions subscription.
     */
    function setSubscriptionId(uint64 subscriptionId_) external onlyRole(DEFAULT_ADMIN_ROLE) {
        _setSubscriptionId(subscriptionId_);
    }

    /**
     * @notice Sets the callback gas limit of the Chainlink Functions call.
     * @param callbackGasLimit_ The callback gas limit of the Chainlink Functions call.
     */
    function setCallbackGasLimit(uint32 callbackGasLimit_) external onlyRole(DEFAULT_ADMIN_ROLE) {
        _setCallbackGasLimit(callbackGasLimit_);
    }

    /**
     * @notice Sets the source of the Chainlink Functions call.
     * @param source_ The source of the Chainlink Functions call.
     */
    function setSource(string memory source_) external onlyRole(DEFAULT_ADMIN_ROLE) {
        _setSource(source_);
    }
    // #endregion

    // #region getter functions
    /**
     * @notice Returns the Chainlink Functions router address.
     * @return The address of the Chainlink Functions router.
     */
    function router() public view returns (address) {
        return address(i_router);
    }

    /**
     * @notice Returns the Chainlink Functions DON id.
     * @return The id of the Chainlink Functions DON.
     */
    function donId() public view returns (bytes32) {
        return _donId;
    }

    /**
     * @notice Returns the Chainlink Functions subscription id.
     * @return The id of the Chainlink Functions subscription.
     */
    function subscriptionId() public view returns (uint64) {
        return _subscriptionId;
    }

    /**
     * @notice Returns the callback gas limit of the Chainlink Functions call.
     * @return The callback gas limit of the Chainlink Functions call.
     */
    function callbackGasLimit() public view returns (uint32) {
        return _callbackGasLimit;
    }

    /**
     * @notice Returns the source of the Chainlink Functions call.
     * @return The source of the Chainlink Functions call.
     */
    function source() public view returns (string memory) {
        return _source;
    }

    /**
     * @notice Returns the id of the last request made to Chainlink Functions.
     * @return The id of the last request made to Chainlink Functions.
     */
    function lastRequestId() public view returns (bytes32) {
        return _lastRequestId;
    }
    // #endregion

    // #region internal hook functions
    function _afterUpdate(bytes32, /*requestId*/ string[] memory /*args*/ ) internal virtual {}
    // #endregion

    // #region private functions
    function _setDonId(bytes32 donId_) private {
        if (donId_ == bytes32(0)) revert InvalidDonId();

        _donId = donId_;
    }

    function _setSubscriptionId(uint64 subscriptionId_) private {
        if (subscriptionId_ == uint64(0)) revert InvalidSubscriptionId();

        _subscriptionId = subscriptionId_;
    }

    function _setCallbackGasLimit(uint32 callbackGasLimit_) private {
        if (callbackGasLimit_ == uint32(0)) revert InvalidCallbackGasLimit();

        _callbackGasLimit = callbackGasLimit_;
    }

    function _setSource(string memory source_) private {
        if (bytes(source_).length == 0) revert InvalidSource();

        _source = source_;
    }
    // #endregion
}

File 3 of 24 : AsideBase.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.25;

import {ERC721} from "@openzeppelin/contracts/token/ERC721/ERC721.sol";
import {ERC721Burnable} from "@openzeppelin/contracts/token/ERC721/extensions/ERC721Burnable.sol";
import {AccessControl} from "@openzeppelin/contracts/access/AccessControl.sol";

abstract contract AsideBase is ERC721, ERC721Burnable, AccessControl {
    error TokenLocked(uint256 tokenId);
    error TokenAlreadyUnlocked(uint256 tokenId);
    error InvalidTokenId(uint256 tokenId);
    error InvalidUnlock(uint256 tokenId);
    error InvalidParametersMatch();

    event Unlock(uint256 indexed tokenId);
    event EmergencyUnlock();

    bytes32 public constant MINTER_ROLE = keccak256("MINTER_ROLE");
    uint256 public immutable NB_OF_TOKENS;
    address public immutable VERSE;
    uint256 public immutable TIMELOCK_DEADLINE;
    string public BASE_URI; // strings cannot be immutable
    bool private _eUnlocked = false; // emergency unlock
    mapping(uint256 => bool) private _unlocks; // tokenId => isUnlocked

    /**
     * @notice Creates a new AsideBase contract.
     * @param name_ The name of the token.
     * @param symbol_ The symbol of the token.
     * @param baseURI_ The base URI of the token.
     * @param nbOfTokens_ The number of tokens allowed to be minted.
     * @param admin_ The address to set as the DEFAULT_ADMIN of this contract.
     * @param minter_ The address to set as the MINTER of this contract.
     * @param verse_ The address of Verse's custodial wallet.
     * @param timelock_ The duration of the timelock upon which all tokens are automatically unlocked.
     */
    constructor(
        string memory name_,
        string memory symbol_,
        string memory baseURI_,
        uint256 nbOfTokens_,
        address admin_,
        address minter_,
        address verse_,
        uint256 timelock_
    ) ERC721(name_, symbol_) {
        _grantRole(DEFAULT_ADMIN_ROLE, admin_);
        _grantRole(MINTER_ROLE, minter_);
        BASE_URI = baseURI_;
        NB_OF_TOKENS = nbOfTokens_;
        VERSE = verse_;
        TIMELOCK_DEADLINE = block.timestamp + timelock_;
    }

    /**
     * @notice Mints `tokenId`, transfers it to `to` and checks for `to` acceptance.
     * @param to The address to receive the token to be minted.
     * @param tokenId The id of the token to be minted.
     */
    function mint(address to, uint256 tokenId) external onlyRole(MINTER_ROLE) {
        _aMint(to, tokenId);
    }

    /**
     * @notice Mints `tokenIds`, transfers them to `to` and checks for `to` acceptance.
     * @param to The addresses to receive the tokens to be minted.
     * @param tokenIds The ids of the tokens to be minted.
     */
    function mintBatch(address[] memory to, uint256[] memory tokenIds) external onlyRole(MINTER_ROLE) {
        uint256 length = to.length;
        if (length != tokenIds.length) revert InvalidParametersMatch();

        for (uint256 i = 0; i < length; i++) {
            _aMint(to[i], tokenIds[i]);
        }
    }

    /**
     * @notice Unlocks tokens `tokenIds`.
     * @dev Each tokenId in `tokenIds` must exist.
     * @dev Each tokenId in `tokenIds` must be locked.
     * @param tokenIds The ids of the tokens to unlock.
     */
    function unlock(uint256[] calldata tokenIds) external {
        _beforeUnlock(tokenIds);
        uint256 length = tokenIds.length;
        for (uint256 i = 0; i < length; i++) {
            _unlock(tokenIds[i]);
        }
    }

    // #region admin-only functions
    /**
     * @notice Unlocks all the tokens at once.
     * @dev This function is only to be used in case of an emergency.
     */
    function eUnlock() external onlyRole(DEFAULT_ADMIN_ROLE) {
        _eUnlocked = true;

        emit EmergencyUnlock();
    }
    // #endregion

    // #region getter functions
    /**
     * @notice Checks whether all the tokens have been unlocked at once in an emergency or not.
     * @return A boolean indicating whether all the tokens have been unlocked at once in an emergency or
     * not.
     */
    function isEUnlocked() public view returns (bool) {
        return _eUnlocked;
    }

    /**
     * @notice Checks whether all the tokens are unlocked, either because of an emergency unlock or
     * because the timelock deadline has been reached.
     * @return A boolean indicating whether all the tokens are unlocked or not.
     */
    function areAllUnlocked() public view returns (bool) {
        return _areAllUnlocked();
    }

    /**
     * @notice Checks whether token `tokenId` is unlocked or not.
     * @dev `tokenId` must exist.
     * @param tokenId The id of the token to check whether it is unlocked or not.
     * @return A boolean indicating whether token `tokenId` is unlocked or not.
     */
    function isUnlocked(uint256 tokenId) public view returns (bool) {
        _requireOwned(tokenId);

        return _isUnlocked(tokenId);
    }
    // #endregion

    // #region internal functions
    function _baseURI() internal view override returns (string memory) {
        return BASE_URI;
    }

    function _areAllUnlocked() internal view returns (bool) {
        return block.timestamp >= TIMELOCK_DEADLINE || _eUnlocked;
    }

    function _isUnlocked(uint256 tokenId) internal view returns (bool) {
        return _unlocks[tokenId] || _areAllUnlocked();
    }

    function _requireLocked(uint256 tokenId) internal view {
        _requireOwned(tokenId);
        if (_isUnlocked(tokenId)) revert TokenAlreadyUnlocked(tokenId);
    }

    function _aMint(address to, uint256 tokenId) internal {
        _safeMint(to, tokenId);
        _afterMint(to, tokenId);
    }

    function _unlock(uint256 tokenId) internal {
        _unlocks[tokenId] = true;
        emit Unlock(tokenId);
    }
    // #endregion

    // #region internal hook functions
    function _update(address to, uint256 tokenId, address auth) internal override(ERC721) returns (address) {
        address owner = _ownerOf(tokenId);
        if (!_isUnlocked(tokenId) && owner != address(0) && owner != VERSE) revert TokenLocked(tokenId);
        if (to == address(0)) _unlocks[tokenId] = false;
        return super._update(to, tokenId, auth);
    }

    function _afterMint(address, uint256 tokenId) internal virtual {
        if (tokenId >= NB_OF_TOKENS) revert InvalidTokenId(tokenId);
    }

    function _beforeUnlock(uint256[] memory tokenIds) internal virtual {
        uint256 length = tokenIds.length;
        for (uint256 i = 0; i < length; i++) {
            _requireLocked(tokenIds[i]);
        }
    }
    // #endregion

    // #region required overrides
    function supportsInterface(bytes4 interfaceId) public view override(ERC721, AccessControl) returns (bool) {
        return super.supportsInterface(interfaceId);
    }
    // #endregion
}

File 4 of 24 : FunctionsClient.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.19;

import {IFunctionsRouter} from "./interfaces/IFunctionsRouter.sol";
import {IFunctionsClient} from "./interfaces/IFunctionsClient.sol";

import {FunctionsRequest} from "./libraries/FunctionsRequest.sol";

/// @title The Chainlink Functions client contract
/// @notice Contract developers can inherit this contract in order to make Chainlink Functions requests
abstract contract FunctionsClient is IFunctionsClient {
  using FunctionsRequest for FunctionsRequest.Request;

  IFunctionsRouter internal immutable i_router;

  event RequestSent(bytes32 indexed id);
  event RequestFulfilled(bytes32 indexed id);

  error OnlyRouterCanFulfill();

  constructor(address router) {
    i_router = IFunctionsRouter(router);
  }

  /// @notice Sends a Chainlink Functions request
  /// @param data The CBOR encoded bytes data for a Functions request
  /// @param subscriptionId The subscription ID that will be charged to service the request
  /// @param callbackGasLimit the amount of gas that will be available for the fulfillment callback
  /// @return requestId The generated request ID for this request
  function _sendRequest(
    bytes memory data,
    uint64 subscriptionId,
    uint32 callbackGasLimit,
    bytes32 donId
  ) internal returns (bytes32) {
    bytes32 requestId = i_router.sendRequest(
      subscriptionId,
      data,
      FunctionsRequest.REQUEST_DATA_VERSION,
      callbackGasLimit,
      donId
    );
    emit RequestSent(requestId);
    return requestId;
  }

  /// @notice User defined function to handle a response from the DON
  /// @param requestId The request ID, returned by sendRequest()
  /// @param response Aggregated response from the execution of the user's source code
  /// @param err Aggregated error from the execution of the user code or from the execution pipeline
  /// @dev Either response or error parameter will be set, but never both
  function fulfillRequest(bytes32 requestId, bytes memory response, bytes memory err) internal virtual;

  /// @inheritdoc IFunctionsClient
  function handleOracleFulfillment(bytes32 requestId, bytes memory response, bytes memory err) external override {
    if (msg.sender != address(i_router)) {
      revert OnlyRouterCanFulfill();
    }
    fulfillRequest(requestId, response, err);
    emit RequestFulfilled(requestId);
  }
}

File 5 of 24 : FunctionsRequest.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.19;

import {CBOR} from "../../../vendor/solidity-cborutils/v2.0.0/CBOR.sol";

/// @title Library for encoding the input data of a Functions request into CBOR
library FunctionsRequest {
  using CBOR for CBOR.CBORBuffer;

  uint16 public constant REQUEST_DATA_VERSION = 1;
  uint256 internal constant DEFAULT_BUFFER_SIZE = 256;

  enum Location {
    Inline, // Provided within the Request
    Remote, // Hosted through remote location that can be accessed through a provided URL
    DONHosted // Hosted on the DON's storage
  }

  enum CodeLanguage {
    JavaScript
    // In future version we may add other languages
  }

  struct Request {
    Location codeLocation; // ════════════╸ The location of the source code that will be executed on each node in the DON
    Location secretsLocation; // ═════════╸ The location of secrets that will be passed into the source code. *Only Remote secrets are supported
    CodeLanguage language; // ════════════╸ The coding language that the source code is written in
    string source; // ════════════════════╸ Raw source code for Request.codeLocation of Location.Inline, URL for Request.codeLocation of Location.Remote, or slot decimal number for Request.codeLocation of Location.DONHosted
    bytes encryptedSecretsReference; // ══╸ Encrypted URLs for Request.secretsLocation of Location.Remote (use addSecretsReference()), or CBOR encoded slotid+version for Request.secretsLocation of Location.DONHosted (use addDONHostedSecrets())
    string[] args; // ════════════════════╸ String arguments that will be passed into the source code
    bytes[] bytesArgs; // ════════════════╸ Bytes arguments that will be passed into the source code
  }

  error EmptySource();
  error EmptySecrets();
  error EmptyArgs();
  error NoInlineSecrets();

  /// @notice Encodes a Request to CBOR encoded bytes
  /// @param self The request to encode
  /// @return CBOR encoded bytes
  function encodeCBOR(Request memory self) internal pure returns (bytes memory) {
    CBOR.CBORBuffer memory buffer = CBOR.create(DEFAULT_BUFFER_SIZE);

    buffer.writeString("codeLocation");
    buffer.writeUInt256(uint256(self.codeLocation));

    buffer.writeString("language");
    buffer.writeUInt256(uint256(self.language));

    buffer.writeString("source");
    buffer.writeString(self.source);

    if (self.args.length > 0) {
      buffer.writeString("args");
      buffer.startArray();
      for (uint256 i = 0; i < self.args.length; ++i) {
        buffer.writeString(self.args[i]);
      }
      buffer.endSequence();
    }

    if (self.encryptedSecretsReference.length > 0) {
      if (self.secretsLocation == Location.Inline) {
        revert NoInlineSecrets();
      }
      buffer.writeString("secretsLocation");
      buffer.writeUInt256(uint256(self.secretsLocation));
      buffer.writeString("secrets");
      buffer.writeBytes(self.encryptedSecretsReference);
    }

    if (self.bytesArgs.length > 0) {
      buffer.writeString("bytesArgs");
      buffer.startArray();
      for (uint256 i = 0; i < self.bytesArgs.length; ++i) {
        buffer.writeBytes(self.bytesArgs[i]);
      }
      buffer.endSequence();
    }

    return buffer.buf.buf;
  }

  /// @notice Initializes a Chainlink Functions Request
  /// @dev Sets the codeLocation and code on the request
  /// @param self The uninitialized request
  /// @param codeLocation The user provided source code location
  /// @param language The programming language of the user code
  /// @param source The user provided source code or a url
  function initializeRequest(
    Request memory self,
    Location codeLocation,
    CodeLanguage language,
    string memory source
  ) internal pure {
    if (bytes(source).length == 0) revert EmptySource();

    self.codeLocation = codeLocation;
    self.language = language;
    self.source = source;
  }

  /// @notice Initializes a Chainlink Functions Request
  /// @dev Simplified version of initializeRequest for PoC
  /// @param self The uninitialized request
  /// @param javaScriptSource The user provided JS code (must not be empty)
  function initializeRequestForInlineJavaScript(Request memory self, string memory javaScriptSource) internal pure {
    initializeRequest(self, Location.Inline, CodeLanguage.JavaScript, javaScriptSource);
  }

  /// @notice Adds Remote user encrypted secrets to a Request
  /// @param self The initialized request
  /// @param encryptedSecretsReference Encrypted comma-separated string of URLs pointing to off-chain secrets
  function addSecretsReference(Request memory self, bytes memory encryptedSecretsReference) internal pure {
    if (encryptedSecretsReference.length == 0) revert EmptySecrets();

    self.secretsLocation = Location.Remote;
    self.encryptedSecretsReference = encryptedSecretsReference;
  }

  /// @notice Adds DON-hosted secrets reference to a Request
  /// @param self The initialized request
  /// @param slotID Slot ID of the user's secrets hosted on DON
  /// @param version User data version (for the slotID)
  function addDONHostedSecrets(Request memory self, uint8 slotID, uint64 version) internal pure {
    CBOR.CBORBuffer memory buffer = CBOR.create(DEFAULT_BUFFER_SIZE);

    buffer.writeString("slotID");
    buffer.writeUInt64(slotID);
    buffer.writeString("version");
    buffer.writeUInt64(version);

    self.secretsLocation = Location.DONHosted;
    self.encryptedSecretsReference = buffer.buf.buf;
  }

  /// @notice Sets args for the user run function
  /// @param self The initialized request
  /// @param args The array of string args (must not be empty)
  function setArgs(Request memory self, string[] memory args) internal pure {
    if (args.length == 0) revert EmptyArgs();

    self.args = args;
  }

  /// @notice Sets bytes args for the user run function
  /// @param self The initialized request
  /// @param args The array of bytes args (must not be empty)
  function setBytesArgs(Request memory self, bytes[] memory args) internal pure {
    if (args.length == 0) revert EmptyArgs();

    self.bytesArgs = args;
  }
}

File 6 of 24 : ERC721.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (token/ERC721/ERC721.sol)

pragma solidity ^0.8.20;

import {IERC721} from "./IERC721.sol";
import {IERC721Receiver} from "./IERC721Receiver.sol";
import {IERC721Metadata} from "./extensions/IERC721Metadata.sol";
import {Context} from "../../utils/Context.sol";
import {Strings} from "../../utils/Strings.sol";
import {IERC165, ERC165} from "../../utils/introspection/ERC165.sol";
import {IERC721Errors} from "../../interfaces/draft-IERC6093.sol";

/**
 * @dev Implementation of https://eips.ethereum.org/EIPS/eip-721[ERC-721] Non-Fungible Token Standard, including
 * the Metadata extension, but not including the Enumerable extension, which is available separately as
 * {ERC721Enumerable}.
 */
abstract contract ERC721 is Context, ERC165, IERC721, IERC721Metadata, IERC721Errors {
    using Strings for uint256;

    // Token name
    string private _name;

    // Token symbol
    string private _symbol;

    mapping(uint256 tokenId => address) private _owners;

    mapping(address owner => uint256) private _balances;

    mapping(uint256 tokenId => address) private _tokenApprovals;

    mapping(address owner => mapping(address operator => bool)) private _operatorApprovals;

    /**
     * @dev Initializes the contract by setting a `name` and a `symbol` to the token collection.
     */
    constructor(string memory name_, string memory symbol_) {
        _name = name_;
        _symbol = symbol_;
    }

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

    /**
     * @dev See {IERC721-balanceOf}.
     */
    function balanceOf(address owner) public view virtual returns (uint256) {
        if (owner == address(0)) {
            revert ERC721InvalidOwner(address(0));
        }
        return _balances[owner];
    }

    /**
     * @dev See {IERC721-ownerOf}.
     */
    function ownerOf(uint256 tokenId) public view virtual returns (address) {
        return _requireOwned(tokenId);
    }

    /**
     * @dev See {IERC721Metadata-name}.
     */
    function name() public view virtual returns (string memory) {
        return _name;
    }

    /**
     * @dev See {IERC721Metadata-symbol}.
     */
    function symbol() public view virtual returns (string memory) {
        return _symbol;
    }

    /**
     * @dev See {IERC721Metadata-tokenURI}.
     */
    function tokenURI(uint256 tokenId) public view virtual returns (string memory) {
        _requireOwned(tokenId);

        string memory baseURI = _baseURI();
        return bytes(baseURI).length > 0 ? string.concat(baseURI, tokenId.toString()) : "";
    }

    /**
     * @dev Base URI for computing {tokenURI}. If set, the resulting URI for each
     * token will be the concatenation of the `baseURI` and the `tokenId`. Empty
     * by default, can be overridden in child contracts.
     */
    function _baseURI() internal view virtual returns (string memory) {
        return "";
    }

    /**
     * @dev See {IERC721-approve}.
     */
    function approve(address to, uint256 tokenId) public virtual {
        _approve(to, tokenId, _msgSender());
    }

    /**
     * @dev See {IERC721-getApproved}.
     */
    function getApproved(uint256 tokenId) public view virtual returns (address) {
        _requireOwned(tokenId);

        return _getApproved(tokenId);
    }

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

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

    /**
     * @dev See {IERC721-transferFrom}.
     */
    function transferFrom(address from, address to, uint256 tokenId) public virtual {
        if (to == address(0)) {
            revert ERC721InvalidReceiver(address(0));
        }
        // Setting an "auth" arguments enables the `_isAuthorized` check which verifies that the token exists
        // (from != 0). Therefore, it is not needed to verify that the return value is not 0 here.
        address previousOwner = _update(to, tokenId, _msgSender());
        if (previousOwner != from) {
            revert ERC721IncorrectOwner(from, tokenId, previousOwner);
        }
    }

    /**
     * @dev See {IERC721-safeTransferFrom}.
     */
    function safeTransferFrom(address from, address to, uint256 tokenId) public {
        safeTransferFrom(from, to, tokenId, "");
    }

    /**
     * @dev See {IERC721-safeTransferFrom}.
     */
    function safeTransferFrom(address from, address to, uint256 tokenId, bytes memory data) public virtual {
        transferFrom(from, to, tokenId);
        _checkOnERC721Received(from, to, tokenId, data);
    }

    /**
     * @dev Returns the owner of the `tokenId`. Does NOT revert if token doesn't exist
     *
     * IMPORTANT: Any overrides to this function that add ownership of tokens not tracked by the
     * core ERC-721 logic MUST be matched with the use of {_increaseBalance} to keep balances
     * consistent with ownership. The invariant to preserve is that for any address `a` the value returned by
     * `balanceOf(a)` must be equal to the number of tokens such that `_ownerOf(tokenId)` is `a`.
     */
    function _ownerOf(uint256 tokenId) internal view virtual returns (address) {
        return _owners[tokenId];
    }

    /**
     * @dev Returns the approved address for `tokenId`. Returns 0 if `tokenId` is not minted.
     */
    function _getApproved(uint256 tokenId) internal view virtual returns (address) {
        return _tokenApprovals[tokenId];
    }

    /**
     * @dev Returns whether `spender` is allowed to manage `owner`'s tokens, or `tokenId` in
     * particular (ignoring whether it is owned by `owner`).
     *
     * WARNING: This function assumes that `owner` is the actual owner of `tokenId` and does not verify this
     * assumption.
     */
    function _isAuthorized(address owner, address spender, uint256 tokenId) internal view virtual returns (bool) {
        return
            spender != address(0) &&
            (owner == spender || isApprovedForAll(owner, spender) || _getApproved(tokenId) == spender);
    }

    /**
     * @dev Checks if `spender` can operate on `tokenId`, assuming the provided `owner` is the actual owner.
     * Reverts if `spender` does not have approval from the provided `owner` for the given token or for all its assets
     * the `spender` for the specific `tokenId`.
     *
     * WARNING: This function assumes that `owner` is the actual owner of `tokenId` and does not verify this
     * assumption.
     */
    function _checkAuthorized(address owner, address spender, uint256 tokenId) internal view virtual {
        if (!_isAuthorized(owner, spender, tokenId)) {
            if (owner == address(0)) {
                revert ERC721NonexistentToken(tokenId);
            } else {
                revert ERC721InsufficientApproval(spender, tokenId);
            }
        }
    }

    /**
     * @dev Unsafe write access to the balances, used by extensions that "mint" tokens using an {ownerOf} override.
     *
     * NOTE: the value is limited to type(uint128).max. This protect against _balance overflow. It is unrealistic that
     * a uint256 would ever overflow from increments when these increments are bounded to uint128 values.
     *
     * WARNING: Increasing an account's balance using this function tends to be paired with an override of the
     * {_ownerOf} function to resolve the ownership of the corresponding tokens so that balances and ownership
     * remain consistent with one another.
     */
    function _increaseBalance(address account, uint128 value) internal virtual {
        unchecked {
            _balances[account] += value;
        }
    }

    /**
     * @dev Transfers `tokenId` from its current owner to `to`, or alternatively mints (or burns) if the current owner
     * (or `to`) is the zero address. Returns the owner of the `tokenId` before the update.
     *
     * The `auth` argument is optional. If the value passed is non 0, then this function will check that
     * `auth` is either the owner of the token, or approved to operate on the token (by the owner).
     *
     * Emits a {Transfer} event.
     *
     * NOTE: If overriding this function in a way that tracks balances, see also {_increaseBalance}.
     */
    function _update(address to, uint256 tokenId, address auth) internal virtual returns (address) {
        address from = _ownerOf(tokenId);

        // Perform (optional) operator check
        if (auth != address(0)) {
            _checkAuthorized(from, auth, tokenId);
        }

        // Execute the update
        if (from != address(0)) {
            // Clear approval. No need to re-authorize or emit the Approval event
            _approve(address(0), tokenId, address(0), false);

            unchecked {
                _balances[from] -= 1;
            }
        }

        if (to != address(0)) {
            unchecked {
                _balances[to] += 1;
            }
        }

        _owners[tokenId] = to;

        emit Transfer(from, to, tokenId);

        return from;
    }

    /**
     * @dev Mints `tokenId` and transfers it to `to`.
     *
     * WARNING: Usage of this method is discouraged, use {_safeMint} whenever possible
     *
     * Requirements:
     *
     * - `tokenId` must not exist.
     * - `to` cannot be the zero address.
     *
     * Emits a {Transfer} event.
     */
    function _mint(address to, uint256 tokenId) internal {
        if (to == address(0)) {
            revert ERC721InvalidReceiver(address(0));
        }
        address previousOwner = _update(to, tokenId, address(0));
        if (previousOwner != address(0)) {
            revert ERC721InvalidSender(address(0));
        }
    }

    /**
     * @dev Mints `tokenId`, transfers it to `to` and checks for `to` acceptance.
     *
     * Requirements:
     *
     * - `tokenId` must not exist.
     * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer.
     *
     * Emits a {Transfer} event.
     */
    function _safeMint(address to, uint256 tokenId) internal {
        _safeMint(to, tokenId, "");
    }

    /**
     * @dev Same as {xref-ERC721-_safeMint-address-uint256-}[`_safeMint`], with an additional `data` parameter which is
     * forwarded in {IERC721Receiver-onERC721Received} to contract recipients.
     */
    function _safeMint(address to, uint256 tokenId, bytes memory data) internal virtual {
        _mint(to, tokenId);
        _checkOnERC721Received(address(0), to, tokenId, data);
    }

    /**
     * @dev Destroys `tokenId`.
     * The approval is cleared when the token is burned.
     * This is an internal function that does not check if the sender is authorized to operate on the token.
     *
     * Requirements:
     *
     * - `tokenId` must exist.
     *
     * Emits a {Transfer} event.
     */
    function _burn(uint256 tokenId) internal {
        address previousOwner = _update(address(0), tokenId, address(0));
        if (previousOwner == address(0)) {
            revert ERC721NonexistentToken(tokenId);
        }
    }

    /**
     * @dev Transfers `tokenId` from `from` to `to`.
     *  As opposed to {transferFrom}, this imposes no restrictions on msg.sender.
     *
     * Requirements:
     *
     * - `to` cannot be the zero address.
     * - `tokenId` token must be owned by `from`.
     *
     * Emits a {Transfer} event.
     */
    function _transfer(address from, address to, uint256 tokenId) internal {
        if (to == address(0)) {
            revert ERC721InvalidReceiver(address(0));
        }
        address previousOwner = _update(to, tokenId, address(0));
        if (previousOwner == address(0)) {
            revert ERC721NonexistentToken(tokenId);
        } else if (previousOwner != from) {
            revert ERC721IncorrectOwner(from, tokenId, previousOwner);
        }
    }

    /**
     * @dev Safely transfers `tokenId` token from `from` to `to`, checking that contract recipients
     * are aware of the ERC-721 standard to prevent tokens from being forever locked.
     *
     * `data` is additional data, it has no specified format and it is sent in call to `to`.
     *
     * This internal function is like {safeTransferFrom} in the sense that it invokes
     * {IERC721Receiver-onERC721Received} on the receiver, and can be used to e.g.
     * implement alternative mechanisms to perform token transfer, such as signature-based.
     *
     * Requirements:
     *
     * - `tokenId` token must exist and be owned by `from`.
     * - `to` cannot be the zero address.
     * - `from` cannot be the zero address.
     * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer.
     *
     * Emits a {Transfer} event.
     */
    function _safeTransfer(address from, address to, uint256 tokenId) internal {
        _safeTransfer(from, to, tokenId, "");
    }

    /**
     * @dev Same as {xref-ERC721-_safeTransfer-address-address-uint256-}[`_safeTransfer`], with an additional `data` parameter which is
     * forwarded in {IERC721Receiver-onERC721Received} to contract recipients.
     */
    function _safeTransfer(address from, address to, uint256 tokenId, bytes memory data) internal virtual {
        _transfer(from, to, tokenId);
        _checkOnERC721Received(from, to, tokenId, data);
    }

    /**
     * @dev Approve `to` to operate on `tokenId`
     *
     * The `auth` argument is optional. If the value passed is non 0, then this function will check that `auth` is
     * either the owner of the token, or approved to operate on all tokens held by this owner.
     *
     * Emits an {Approval} event.
     *
     * Overrides to this logic should be done to the variant with an additional `bool emitEvent` argument.
     */
    function _approve(address to, uint256 tokenId, address auth) internal {
        _approve(to, tokenId, auth, true);
    }

    /**
     * @dev Variant of `_approve` with an optional flag to enable or disable the {Approval} event. The event is not
     * emitted in the context of transfers.
     */
    function _approve(address to, uint256 tokenId, address auth, bool emitEvent) internal virtual {
        // Avoid reading the owner unless necessary
        if (emitEvent || auth != address(0)) {
            address owner = _requireOwned(tokenId);

            // We do not use _isAuthorized because single-token approvals should not be able to call approve
            if (auth != address(0) && owner != auth && !isApprovedForAll(owner, auth)) {
                revert ERC721InvalidApprover(auth);
            }

            if (emitEvent) {
                emit Approval(owner, to, tokenId);
            }
        }

        _tokenApprovals[tokenId] = to;
    }

    /**
     * @dev Approve `operator` to operate on all of `owner` tokens
     *
     * Requirements:
     * - operator can't be the address zero.
     *
     * Emits an {ApprovalForAll} event.
     */
    function _setApprovalForAll(address owner, address operator, bool approved) internal virtual {
        if (operator == address(0)) {
            revert ERC721InvalidOperator(operator);
        }
        _operatorApprovals[owner][operator] = approved;
        emit ApprovalForAll(owner, operator, approved);
    }

    /**
     * @dev Reverts if the `tokenId` doesn't have a current owner (it hasn't been minted, or it has been burned).
     * Returns the owner.
     *
     * Overrides to ownership logic should be done to {_ownerOf}.
     */
    function _requireOwned(uint256 tokenId) internal view returns (address) {
        address owner = _ownerOf(tokenId);
        if (owner == address(0)) {
            revert ERC721NonexistentToken(tokenId);
        }
        return owner;
    }

    /**
     * @dev Private function to invoke {IERC721Receiver-onERC721Received} on a target address. This will revert if the
     * recipient doesn't accept the token transfer. The call is not executed if the target address is not a contract.
     *
     * @param from address representing the previous owner of the given token ID
     * @param to target address that will receive the tokens
     * @param tokenId uint256 ID of the token to be transferred
     * @param data bytes optional data to send along with the call
     */
    function _checkOnERC721Received(address from, address to, uint256 tokenId, bytes memory data) private {
        if (to.code.length > 0) {
            try IERC721Receiver(to).onERC721Received(_msgSender(), from, tokenId, data) returns (bytes4 retval) {
                if (retval != IERC721Receiver.onERC721Received.selector) {
                    revert ERC721InvalidReceiver(to);
                }
            } catch (bytes memory reason) {
                if (reason.length == 0) {
                    revert ERC721InvalidReceiver(to);
                } else {
                    /// @solidity memory-safe-assembly
                    assembly {
                        revert(add(32, reason), mload(reason))
                    }
                }
            }
        }
    }
}

File 7 of 24 : ERC721Burnable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (token/ERC721/extensions/ERC721Burnable.sol)

pragma solidity ^0.8.20;

import {ERC721} from "../ERC721.sol";
import {Context} from "../../../utils/Context.sol";

/**
 * @title ERC-721 Burnable Token
 * @dev ERC-721 Token that can be burned (destroyed).
 */
abstract contract ERC721Burnable is Context, ERC721 {
    /**
     * @dev Burns `tokenId`. See {ERC721-_burn}.
     *
     * Requirements:
     *
     * - The caller must own `tokenId` or be an approved operator.
     */
    function burn(uint256 tokenId) public virtual {
        // Setting an "auth" arguments enables the `_isAuthorized` check which verifies that the token exists
        // (from != 0). Therefore, it is not needed to verify that the return value is not 0 here.
        _update(address(0), tokenId, _msgSender());
    }
}

File 8 of 24 : AccessControl.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (access/AccessControl.sol)

pragma solidity ^0.8.20;

import {IAccessControl} from "./IAccessControl.sol";
import {Context} from "../utils/Context.sol";
import {ERC165} from "../utils/introspection/ERC165.sol";

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

    mapping(bytes32 role => RoleData) private _roles;

    bytes32 public constant DEFAULT_ADMIN_ROLE = 0x00;

    /**
     * @dev Modifier that checks that an account has a specific role. Reverts
     * with an {AccessControlUnauthorizedAccount} error including the required role.
     */
    modifier onlyRole(bytes32 role) {
        _checkRole(role);
        _;
    }

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

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

    /**
     * @dev Reverts with an {AccessControlUnauthorizedAccount} error if `_msgSender()`
     * is missing `role`. Overriding this function changes the behavior of the {onlyRole} modifier.
     */
    function _checkRole(bytes32 role) internal view virtual {
        _checkRole(role, _msgSender());
    }

    /**
     * @dev Reverts with an {AccessControlUnauthorizedAccount} error if `account`
     * is missing `role`.
     */
    function _checkRole(bytes32 role, address account) internal view virtual {
        if (!hasRole(role, account)) {
            revert AccessControlUnauthorizedAccount(account, role);
        }
    }

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

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

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

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

        _revokeRole(role, callerConfirmation);
    }

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

    /**
     * @dev Attempts to grant `role` to `account` and returns a boolean indicating if `role` was granted.
     *
     * Internal function without access restriction.
     *
     * May emit a {RoleGranted} event.
     */
    function _grantRole(bytes32 role, address account) internal virtual returns (bool) {
        if (!hasRole(role, account)) {
            _roles[role].hasRole[account] = true;
            emit RoleGranted(role, account, _msgSender());
            return true;
        } else {
            return false;
        }
    }

    /**
     * @dev Attempts to revoke `role` to `account` and returns a boolean indicating if `role` was revoked.
     *
     * Internal function without access restriction.
     *
     * May emit a {RoleRevoked} event.
     */
    function _revokeRole(bytes32 role, address account) internal virtual returns (bool) {
        if (hasRole(role, account)) {
            _roles[role].hasRole[account] = false;
            emit RoleRevoked(role, account, _msgSender());
            return true;
        } else {
            return false;
        }
    }
}

File 9 of 24 : IFunctionsRouter.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.19;

import {FunctionsResponse} from "../libraries/FunctionsResponse.sol";

/// @title Chainlink Functions Router interface.
interface IFunctionsRouter {
  /// @notice The identifier of the route to retrieve the address of the access control contract
  /// The access control contract controls which accounts can manage subscriptions
  /// @return id - bytes32 id that can be passed to the "getContractById" of the Router
  function getAllowListId() external view returns (bytes32);

  /// @notice Set the identifier of the route to retrieve the address of the access control contract
  /// The access control contract controls which accounts can manage subscriptions
  function setAllowListId(bytes32 allowListId) external;

  /// @notice Get the flat fee (in Juels of LINK) that will be paid to the Router owner for operation of the network
  /// @return adminFee
  function getAdminFee() external view returns (uint72 adminFee);

  /// @notice Sends a request using the provided subscriptionId
  /// @param subscriptionId - A unique subscription ID allocated by billing system,
  /// a client can make requests from different contracts referencing the same subscription
  /// @param data - CBOR encoded Chainlink Functions request data, use FunctionsClient API to encode a request
  /// @param dataVersion - Gas limit for the fulfillment callback
  /// @param callbackGasLimit - Gas limit for the fulfillment callback
  /// @param donId - An identifier used to determine which route to send the request along
  /// @return requestId - A unique request identifier
  function sendRequest(
    uint64 subscriptionId,
    bytes calldata data,
    uint16 dataVersion,
    uint32 callbackGasLimit,
    bytes32 donId
  ) external returns (bytes32);

  /// @notice Sends a request to the proposed contracts
  /// @param subscriptionId - A unique subscription ID allocated by billing system,
  /// a client can make requests from different contracts referencing the same subscription
  /// @param data - CBOR encoded Chainlink Functions request data, use FunctionsClient API to encode a request
  /// @param dataVersion - Gas limit for the fulfillment callback
  /// @param callbackGasLimit - Gas limit for the fulfillment callback
  /// @param donId - An identifier used to determine which route to send the request along
  /// @return requestId - A unique request identifier
  function sendRequestToProposed(
    uint64 subscriptionId,
    bytes calldata data,
    uint16 dataVersion,
    uint32 callbackGasLimit,
    bytes32 donId
  ) external returns (bytes32);

  /// @notice Fulfill the request by:
  /// - calling back the data that the Oracle returned to the client contract
  /// - pay the DON for processing the request
  /// @dev Only callable by the Coordinator contract that is saved in the commitment
  /// @param response response data from DON consensus
  /// @param err error from DON consensus
  /// @param juelsPerGas - current rate of juels/gas
  /// @param costWithoutFulfillment - The cost of processing the request (in Juels of LINK ), without fulfillment
  /// @param transmitter - The Node that transmitted the OCR report
  /// @param commitment - The parameters of the request that must be held consistent between request and response time
  /// @return fulfillResult -
  /// @return callbackGasCostJuels -
  function fulfill(
    bytes memory response,
    bytes memory err,
    uint96 juelsPerGas,
    uint96 costWithoutFulfillment,
    address transmitter,
    FunctionsResponse.Commitment memory commitment
  ) external returns (FunctionsResponse.FulfillResult, uint96);

  /// @notice Validate requested gas limit is below the subscription max.
  /// @param subscriptionId subscription ID
  /// @param callbackGasLimit desired callback gas limit
  function isValidCallbackGasLimit(uint64 subscriptionId, uint32 callbackGasLimit) external view;

  /// @notice Get the current contract given an ID
  /// @param id A bytes32 identifier for the route
  /// @return contract The current contract address
  function getContractById(bytes32 id) external view returns (address);

  /// @notice Get the proposed next contract given an ID
  /// @param id A bytes32 identifier for the route
  /// @return contract The current or proposed contract address
  function getProposedContractById(bytes32 id) external view returns (address);

  /// @notice Return the latest proprosal set
  /// @return ids The identifiers of the contracts to update
  /// @return to The addresses of the contracts that will be updated to
  function getProposedContractSet() external view returns (bytes32[] memory, address[] memory);

  /// @notice Proposes one or more updates to the contract routes
  /// @dev Only callable by owner
  function proposeContractsUpdate(bytes32[] memory proposalSetIds, address[] memory proposalSetAddresses) external;

  /// @notice Updates the current contract routes to the proposed contracts
  /// @dev Only callable by owner
  function updateContracts() external;

  /// @dev Puts the system into an emergency stopped state.
  /// @dev Only callable by owner
  function pause() external;

  /// @dev Takes the system out of an emergency stopped state.
  /// @dev Only callable by owner
  function unpause() external;
}

File 10 of 24 : IFunctionsClient.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.19;

/// @title Chainlink Functions client interface.
interface IFunctionsClient {
  /// @notice Chainlink Functions response handler called by the Functions Router
  /// during fullilment from the designated transmitter node in an OCR round.
  /// @param requestId The requestId returned by FunctionsClient.sendRequest().
  /// @param response Aggregated response from the request's source code.
  /// @param err Aggregated error either from the request's source code or from the execution pipeline.
  /// @dev Either response or error parameter will be set, but never both.
  function handleOracleFulfillment(bytes32 requestId, bytes memory response, bytes memory err) external;
}

File 11 of 24 : CBOR.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.4;

import "../../@ensdomains/buffer/v0.1.0/Buffer.sol";

/**
* @dev A library for populating CBOR encoded payload in Solidity.
*
* https://datatracker.ietf.org/doc/html/rfc7049
*
* The library offers various write* and start* methods to encode values of different types.
* The resulted buffer can be obtained with data() method.
* Encoding of primitive types is staightforward, whereas encoding of sequences can result
* in an invalid CBOR if start/write/end flow is violated.
* For the purpose of gas saving, the library does not verify start/write/end flow internally,
* except for nested start/end pairs.
*/

library CBOR {
    using Buffer for Buffer.buffer;

    struct CBORBuffer {
        Buffer.buffer buf;
        uint256 depth;
    }

    uint8 private constant MAJOR_TYPE_INT = 0;
    uint8 private constant MAJOR_TYPE_NEGATIVE_INT = 1;
    uint8 private constant MAJOR_TYPE_BYTES = 2;
    uint8 private constant MAJOR_TYPE_STRING = 3;
    uint8 private constant MAJOR_TYPE_ARRAY = 4;
    uint8 private constant MAJOR_TYPE_MAP = 5;
    uint8 private constant MAJOR_TYPE_TAG = 6;
    uint8 private constant MAJOR_TYPE_CONTENT_FREE = 7;

    uint8 private constant TAG_TYPE_BIGNUM = 2;
    uint8 private constant TAG_TYPE_NEGATIVE_BIGNUM = 3;

    uint8 private constant CBOR_FALSE = 20;
    uint8 private constant CBOR_TRUE = 21;
    uint8 private constant CBOR_NULL = 22;
    uint8 private constant CBOR_UNDEFINED = 23;

    function create(uint256 capacity) internal pure returns(CBORBuffer memory cbor) {
        Buffer.init(cbor.buf, capacity);
        cbor.depth = 0;
        return cbor;
    }

    function data(CBORBuffer memory buf) internal pure returns(bytes memory) {
        require(buf.depth == 0, "Invalid CBOR");
        return buf.buf.buf;
    }

    function writeUInt256(CBORBuffer memory buf, uint256 value) internal pure {
        buf.buf.appendUint8(uint8((MAJOR_TYPE_TAG << 5) | TAG_TYPE_BIGNUM));
        writeBytes(buf, abi.encode(value));
    }

    function writeInt256(CBORBuffer memory buf, int256 value) internal pure {
        if (value < 0) {
            buf.buf.appendUint8(
                uint8((MAJOR_TYPE_TAG << 5) | TAG_TYPE_NEGATIVE_BIGNUM)
            );
            writeBytes(buf, abi.encode(uint256(-1 - value)));
        } else {
            writeUInt256(buf, uint256(value));
        }
    }

    function writeUInt64(CBORBuffer memory buf, uint64 value) internal pure {
        writeFixedNumeric(buf, MAJOR_TYPE_INT, value);
    }

    function writeInt64(CBORBuffer memory buf, int64 value) internal pure {
        if(value >= 0) {
            writeFixedNumeric(buf, MAJOR_TYPE_INT, uint64(value));
        } else{
            writeFixedNumeric(buf, MAJOR_TYPE_NEGATIVE_INT, uint64(-1 - value));
        }
    }

    function writeBytes(CBORBuffer memory buf, bytes memory value) internal pure {
        writeFixedNumeric(buf, MAJOR_TYPE_BYTES, uint64(value.length));
        buf.buf.append(value);
    }

    function writeString(CBORBuffer memory buf, string memory value) internal pure {
        writeFixedNumeric(buf, MAJOR_TYPE_STRING, uint64(bytes(value).length));
        buf.buf.append(bytes(value));
    }

    function writeBool(CBORBuffer memory buf, bool value) internal pure {
        writeContentFree(buf, value ? CBOR_TRUE : CBOR_FALSE);
    }

    function writeNull(CBORBuffer memory buf) internal pure {
        writeContentFree(buf, CBOR_NULL);
    }

    function writeUndefined(CBORBuffer memory buf) internal pure {
        writeContentFree(buf, CBOR_UNDEFINED);
    }

    function startArray(CBORBuffer memory buf) internal pure {
        writeIndefiniteLengthType(buf, MAJOR_TYPE_ARRAY);
        buf.depth += 1;
    }

    function startFixedArray(CBORBuffer memory buf, uint64 length) internal pure {
        writeDefiniteLengthType(buf, MAJOR_TYPE_ARRAY, length);
    }

    function startMap(CBORBuffer memory buf) internal pure {
        writeIndefiniteLengthType(buf, MAJOR_TYPE_MAP);
        buf.depth += 1;
    }

    function startFixedMap(CBORBuffer memory buf, uint64 length) internal pure {
        writeDefiniteLengthType(buf, MAJOR_TYPE_MAP, length);
    }

    function endSequence(CBORBuffer memory buf) internal pure {
        writeIndefiniteLengthType(buf, MAJOR_TYPE_CONTENT_FREE);
        buf.depth -= 1;
    }

    function writeKVString(CBORBuffer memory buf, string memory key, string memory value) internal pure {
        writeString(buf, key);
        writeString(buf, value);
    }

    function writeKVBytes(CBORBuffer memory buf, string memory key, bytes memory value) internal pure {
        writeString(buf, key);
        writeBytes(buf, value);
    }

    function writeKVUInt256(CBORBuffer memory buf, string memory key, uint256 value) internal pure {
        writeString(buf, key);
        writeUInt256(buf, value);
    }

    function writeKVInt256(CBORBuffer memory buf, string memory key, int256 value) internal pure {
        writeString(buf, key);
        writeInt256(buf, value);
    }

    function writeKVUInt64(CBORBuffer memory buf, string memory key, uint64 value) internal pure {
        writeString(buf, key);
        writeUInt64(buf, value);
    }

    function writeKVInt64(CBORBuffer memory buf, string memory key, int64 value) internal pure {
        writeString(buf, key);
        writeInt64(buf, value);
    }

    function writeKVBool(CBORBuffer memory buf, string memory key, bool value) internal pure {
        writeString(buf, key);
        writeBool(buf, value);
    }

    function writeKVNull(CBORBuffer memory buf, string memory key) internal pure {
        writeString(buf, key);
        writeNull(buf);
    }

    function writeKVUndefined(CBORBuffer memory buf, string memory key) internal pure {
        writeString(buf, key);
        writeUndefined(buf);
    }

    function writeKVMap(CBORBuffer memory buf, string memory key) internal pure {
        writeString(buf, key);
        startMap(buf);
    }

    function writeKVArray(CBORBuffer memory buf, string memory key) internal pure {
        writeString(buf, key);
        startArray(buf);
    }

    function writeFixedNumeric(
        CBORBuffer memory buf,
        uint8 major,
        uint64 value
    ) private pure {
        if (value <= 23) {
            buf.buf.appendUint8(uint8((major << 5) | value));
        } else if (value <= 0xFF) {
            buf.buf.appendUint8(uint8((major << 5) | 24));
            buf.buf.appendInt(value, 1);
        } else if (value <= 0xFFFF) {
            buf.buf.appendUint8(uint8((major << 5) | 25));
            buf.buf.appendInt(value, 2);
        } else if (value <= 0xFFFFFFFF) {
            buf.buf.appendUint8(uint8((major << 5) | 26));
            buf.buf.appendInt(value, 4);
        } else {
            buf.buf.appendUint8(uint8((major << 5) | 27));
            buf.buf.appendInt(value, 8);
        }
    }

    function writeIndefiniteLengthType(CBORBuffer memory buf, uint8 major)
        private
        pure
    {
        buf.buf.appendUint8(uint8((major << 5) | 31));
    }

    function writeDefiniteLengthType(CBORBuffer memory buf, uint8 major, uint64 length)
        private
        pure
    {
        writeFixedNumeric(buf, major, length);
    }

    function writeContentFree(CBORBuffer memory buf, uint8 value) private pure {
        buf.buf.appendUint8(uint8((MAJOR_TYPE_CONTENT_FREE << 5) | value));
    }
}

File 12 of 24 : IERC721.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (token/ERC721/IERC721.sol)

pragma solidity ^0.8.20;

import {IERC165} from "../../utils/introspection/IERC165.sol";

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

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

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

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

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

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

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

    /**
     * @dev Transfers `tokenId` token from `from` to `to`.
     *
     * WARNING: Note that the caller is responsible to confirm that the recipient is capable of receiving ERC-721
     * or else they may be permanently lost. Usage of {safeTransferFrom} prevents loss, though the caller must
     * understand this adds an external call which potentially creates a reentrancy vulnerability.
     *
     * Requirements:
     *
     * - `from` cannot be the zero address.
     * - `to` cannot be the zero address.
     * - `tokenId` token must be owned by `from`.
     * - If the caller is not `from`, it must be approved to move this token by either {approve} or {setApprovalForAll}.
     *
     * Emits a {Transfer} event.
     */
    function transferFrom(address from, address to, uint256 tokenId) external;

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

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

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

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

File 13 of 24 : IERC721Receiver.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (token/ERC721/IERC721Receiver.sol)

pragma solidity ^0.8.20;

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

File 14 of 24 : IERC721Metadata.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (token/ERC721/extensions/IERC721Metadata.sol)

pragma solidity ^0.8.20;

import {IERC721} from "../IERC721.sol";

/**
 * @title ERC-721 Non-Fungible Token Standard, optional metadata extension
 * @dev See https://eips.ethereum.org/EIPS/eip-721
 */
interface IERC721Metadata is IERC721 {
    /**
     * @dev Returns the token collection name.
     */
    function name() external view returns (string memory);

    /**
     * @dev Returns the token collection symbol.
     */
    function symbol() external view returns (string memory);

    /**
     * @dev Returns the Uniform Resource Identifier (URI) for `tokenId` token.
     */
    function tokenURI(uint256 tokenId) external view returns (string memory);
}

File 15 of 24 : Context.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.1) (utils/Context.sol)

pragma solidity ^0.8.20;

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

    function _contextSuffixLength() internal view virtual returns (uint256) {
        return 0;
    }
}

File 16 of 24 : Strings.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (utils/Strings.sol)

pragma solidity ^0.8.20;

import {Math} from "./math/Math.sol";
import {SignedMath} from "./math/SignedMath.sol";

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

    /**
     * @dev The `value` string doesn't fit in the specified `length`.
     */
    error StringsInsufficientHexLength(uint256 value, uint256 length);

    /**
     * @dev Converts a `uint256` to its ASCII `string` decimal representation.
     */
    function toString(uint256 value) internal pure returns (string memory) {
        unchecked {
            uint256 length = Math.log10(value) + 1;
            string memory buffer = new string(length);
            uint256 ptr;
            /// @solidity memory-safe-assembly
            assembly {
                ptr := add(buffer, add(32, length))
            }
            while (true) {
                ptr--;
                /// @solidity memory-safe-assembly
                assembly {
                    mstore8(ptr, byte(mod(value, 10), HEX_DIGITS))
                }
                value /= 10;
                if (value == 0) break;
            }
            return buffer;
        }
    }

    /**
     * @dev Converts a `int256` to its ASCII `string` decimal representation.
     */
    function toStringSigned(int256 value) internal pure returns (string memory) {
        return string.concat(value < 0 ? "-" : "", toString(SignedMath.abs(value)));
    }

    /**
     * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation.
     */
    function toHexString(uint256 value) internal pure returns (string memory) {
        unchecked {
            return toHexString(value, Math.log256(value) + 1);
        }
    }

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

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

    /**
     * @dev Returns true if the two strings are equal.
     */
    function equal(string memory a, string memory b) internal pure returns (bool) {
        return bytes(a).length == bytes(b).length && keccak256(bytes(a)) == keccak256(bytes(b));
    }
}

File 17 of 24 : ERC165.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (utils/introspection/ERC165.sol)

pragma solidity ^0.8.20;

import {IERC165} from "./IERC165.sol";

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

File 18 of 24 : draft-IERC6093.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (interfaces/draft-IERC6093.sol)
pragma solidity ^0.8.20;

/**
 * @dev Standard ERC-20 Errors
 * Interface of the https://eips.ethereum.org/EIPS/eip-6093[ERC-6093] custom errors for ERC-20 tokens.
 */
interface IERC20Errors {
    /**
     * @dev Indicates an error related to the current `balance` of a `sender`. Used in transfers.
     * @param sender Address whose tokens are being transferred.
     * @param balance Current balance for the interacting account.
     * @param needed Minimum amount required to perform a transfer.
     */
    error ERC20InsufficientBalance(address sender, uint256 balance, uint256 needed);

    /**
     * @dev Indicates a failure with the token `sender`. Used in transfers.
     * @param sender Address whose tokens are being transferred.
     */
    error ERC20InvalidSender(address sender);

    /**
     * @dev Indicates a failure with the token `receiver`. Used in transfers.
     * @param receiver Address to which tokens are being transferred.
     */
    error ERC20InvalidReceiver(address receiver);

    /**
     * @dev Indicates a failure with the `spender`’s `allowance`. Used in transfers.
     * @param spender Address that may be allowed to operate on tokens without being their owner.
     * @param allowance Amount of tokens a `spender` is allowed to operate with.
     * @param needed Minimum amount required to perform a transfer.
     */
    error ERC20InsufficientAllowance(address spender, uint256 allowance, uint256 needed);

    /**
     * @dev Indicates a failure with the `approver` of a token to be approved. Used in approvals.
     * @param approver Address initiating an approval operation.
     */
    error ERC20InvalidApprover(address approver);

    /**
     * @dev Indicates a failure with the `spender` to be approved. Used in approvals.
     * @param spender Address that may be allowed to operate on tokens without being their owner.
     */
    error ERC20InvalidSpender(address spender);
}

/**
 * @dev Standard ERC-721 Errors
 * Interface of the https://eips.ethereum.org/EIPS/eip-6093[ERC-6093] custom errors for ERC-721 tokens.
 */
interface IERC721Errors {
    /**
     * @dev Indicates that an address can't be an owner. For example, `address(0)` is a forbidden owner in ERC-20.
     * Used in balance queries.
     * @param owner Address of the current owner of a token.
     */
    error ERC721InvalidOwner(address owner);

    /**
     * @dev Indicates a `tokenId` whose `owner` is the zero address.
     * @param tokenId Identifier number of a token.
     */
    error ERC721NonexistentToken(uint256 tokenId);

    /**
     * @dev Indicates an error related to the ownership over a particular token. Used in transfers.
     * @param sender Address whose tokens are being transferred.
     * @param tokenId Identifier number of a token.
     * @param owner Address of the current owner of a token.
     */
    error ERC721IncorrectOwner(address sender, uint256 tokenId, address owner);

    /**
     * @dev Indicates a failure with the token `sender`. Used in transfers.
     * @param sender Address whose tokens are being transferred.
     */
    error ERC721InvalidSender(address sender);

    /**
     * @dev Indicates a failure with the token `receiver`. Used in transfers.
     * @param receiver Address to which tokens are being transferred.
     */
    error ERC721InvalidReceiver(address receiver);

    /**
     * @dev Indicates a failure with the `operator`’s approval. Used in transfers.
     * @param operator Address that may be allowed to operate on tokens without being their owner.
     * @param tokenId Identifier number of a token.
     */
    error ERC721InsufficientApproval(address operator, uint256 tokenId);

    /**
     * @dev Indicates a failure with the `approver` of a token to be approved. Used in approvals.
     * @param approver Address initiating an approval operation.
     */
    error ERC721InvalidApprover(address approver);

    /**
     * @dev Indicates a failure with the `operator` to be approved. Used in approvals.
     * @param operator Address that may be allowed to operate on tokens without being their owner.
     */
    error ERC721InvalidOperator(address operator);
}

/**
 * @dev Standard ERC-1155 Errors
 * Interface of the https://eips.ethereum.org/EIPS/eip-6093[ERC-6093] custom errors for ERC-1155 tokens.
 */
interface IERC1155Errors {
    /**
     * @dev Indicates an error related to the current `balance` of a `sender`. Used in transfers.
     * @param sender Address whose tokens are being transferred.
     * @param balance Current balance for the interacting account.
     * @param needed Minimum amount required to perform a transfer.
     * @param tokenId Identifier number of a token.
     */
    error ERC1155InsufficientBalance(address sender, uint256 balance, uint256 needed, uint256 tokenId);

    /**
     * @dev Indicates a failure with the token `sender`. Used in transfers.
     * @param sender Address whose tokens are being transferred.
     */
    error ERC1155InvalidSender(address sender);

    /**
     * @dev Indicates a failure with the token `receiver`. Used in transfers.
     * @param receiver Address to which tokens are being transferred.
     */
    error ERC1155InvalidReceiver(address receiver);

    /**
     * @dev Indicates a failure with the `operator`’s approval. Used in transfers.
     * @param operator Address that may be allowed to operate on tokens without being their owner.
     * @param owner Address of the current owner of a token.
     */
    error ERC1155MissingApprovalForAll(address operator, address owner);

    /**
     * @dev Indicates a failure with the `approver` of a token to be approved. Used in approvals.
     * @param approver Address initiating an approval operation.
     */
    error ERC1155InvalidApprover(address approver);

    /**
     * @dev Indicates a failure with the `operator` to be approved. Used in approvals.
     * @param operator Address that may be allowed to operate on tokens without being their owner.
     */
    error ERC1155InvalidOperator(address operator);

    /**
     * @dev Indicates an array length mismatch between ids and values in a safeBatchTransferFrom operation.
     * Used in batch transfers.
     * @param idsLength Length of the array of token identifiers
     * @param valuesLength Length of the array of token amounts
     */
    error ERC1155InvalidArrayLength(uint256 idsLength, uint256 valuesLength);
}

File 19 of 24 : IAccessControl.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (access/IAccessControl.sol)

pragma solidity ^0.8.20;

/**
 * @dev External interface of AccessControl declared to support ERC-165 detection.
 */
interface IAccessControl {
    /**
     * @dev The `account` is missing a role.
     */
    error AccessControlUnauthorizedAccount(address account, bytes32 neededRole);

    /**
     * @dev The caller of a function is not the expected one.
     *
     * NOTE: Don't confuse with {AccessControlUnauthorizedAccount}.
     */
    error AccessControlBadConfirmation();

    /**
     * @dev Emitted when `newAdminRole` is set as ``role``'s admin role, replacing `previousAdminRole`
     *
     * `DEFAULT_ADMIN_ROLE` is the starting admin for all roles, despite
     * {RoleAdminChanged} not being emitted signaling this.
     */
    event RoleAdminChanged(bytes32 indexed role, bytes32 indexed previousAdminRole, bytes32 indexed newAdminRole);

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

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

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

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

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

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

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

File 20 of 24 : FunctionsResponse.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.19;

/// @title Library of types that are used for fulfillment of a Functions request
library FunctionsResponse {
  // Used to send request information from the Router to the Coordinator
  struct RequestMeta {
    bytes data; // ══════════════════╸ CBOR encoded Chainlink Functions request data, use FunctionsRequest library to encode a request
    bytes32 flags; // ═══════════════╸ Per-subscription flags
    address requestingContract; // ══╗ The client contract that is sending the request
    uint96 availableBalance; // ═════╝ Common LINK balance of the subscription that is controlled by the Router to be used for all consumer requests.
    uint72 adminFee; // ═════════════╗ Flat fee (in Juels of LINK) that will be paid to the Router Owner for operation of the network
    uint64 subscriptionId; //        ║ Identifier of the billing subscription that will be charged for the request
    uint64 initiatedRequests; //     ║ The number of requests that have been started
    uint32 callbackGasLimit; //      ║ The amount of gas that the callback to the consuming contract will be given
    uint16 dataVersion; // ══════════╝ The version of the structure of the CBOR encoded request data
    uint64 completedRequests; // ════╗ The number of requests that have successfully completed or timed out
    address subscriptionOwner; // ═══╝ The owner of the billing subscription
  }

  enum FulfillResult {
    FULFILLED, // 0
    USER_CALLBACK_ERROR, // 1
    INVALID_REQUEST_ID, // 2
    COST_EXCEEDS_COMMITMENT, // 3
    INSUFFICIENT_GAS_PROVIDED, // 4
    SUBSCRIPTION_BALANCE_INVARIANT_VIOLATION, // 5
    INVALID_COMMITMENT // 6
  }

  struct Commitment {
    bytes32 requestId; // ═════════════════╸ A unique identifier for a Chainlink Functions request
    address coordinator; // ═══════════════╗ The Coordinator contract that manages the DON that is servicing a request
    uint96 estimatedTotalCostJuels; // ════╝ The maximum cost in Juels (1e18) of LINK that will be charged to fulfill a request
    address client; // ════════════════════╗ The client contract that sent the request
    uint64 subscriptionId; //              ║ Identifier of the billing subscription that will be charged for the request
    uint32 callbackGasLimit; // ═══════════╝ The amount of gas that the callback to the consuming contract will be given
    uint72 adminFee; // ═══════════════════╗ Flat fee (in Juels of LINK) that will be paid to the Router Owner for operation of the network
    uint72 donFee; //                      ║ Fee (in Juels of LINK) that will be split between Node Operators for servicing a request
    uint40 gasOverheadBeforeCallback; //   ║ Represents the average gas execution cost before the fulfillment callback.
    uint40 gasOverheadAfterCallback; //    ║ Represents the average gas execution cost after the fulfillment callback.
    uint32 timeoutTimestamp; // ═══════════╝ The timestamp at which a request will be eligible to be timed out
  }
}

File 21 of 24 : Buffer.sol
// SPDX-License-Identifier: BSD-2-Clause
pragma solidity ^0.8.4;

/**
* @dev A library for working with mutable byte buffers in Solidity.
*
* Byte buffers are mutable and expandable, and provide a variety of primitives
* for appending to them. At any time you can fetch a bytes object containing the
* current contents of the buffer. The bytes object should not be stored between
* operations, as it may change due to resizing of the buffer.
*/
library Buffer {
    /**
    * @dev Represents a mutable buffer. Buffers have a current value (buf) and
    *      a capacity. The capacity may be longer than the current value, in
    *      which case it can be extended without the need to allocate more memory.
    */
    struct buffer {
        bytes buf;
        uint capacity;
    }

    /**
    * @dev Initializes a buffer with an initial capacity.
    * @param buf The buffer to initialize.
    * @param capacity The number of bytes of space to allocate the buffer.
    * @return The buffer, for chaining.
    */
    function init(buffer memory buf, uint capacity) internal pure returns(buffer memory) {
        if (capacity % 32 != 0) {
            capacity += 32 - (capacity % 32);
        }
        // Allocate space for the buffer data
        buf.capacity = capacity;
        assembly {
            let ptr := mload(0x40)
            mstore(buf, ptr)
            mstore(ptr, 0)
            let fpm := add(32, add(ptr, capacity))
            if lt(fpm, ptr) {
                revert(0, 0)
            }
            mstore(0x40, fpm)
        }
        return buf;
    }

    /**
    * @dev Initializes a new buffer from an existing bytes object.
    *      Changes to the buffer may mutate the original value.
    * @param b The bytes object to initialize the buffer with.
    * @return A new buffer.
    */
    function fromBytes(bytes memory b) internal pure returns(buffer memory) {
        buffer memory buf;
        buf.buf = b;
        buf.capacity = b.length;
        return buf;
    }

    function resize(buffer memory buf, uint capacity) private pure {
        bytes memory oldbuf = buf.buf;
        init(buf, capacity);
        append(buf, oldbuf);
    }

    /**
    * @dev Sets buffer length to 0.
    * @param buf The buffer to truncate.
    * @return The original buffer, for chaining..
    */
    function truncate(buffer memory buf) internal pure returns (buffer memory) {
        assembly {
            let bufptr := mload(buf)
            mstore(bufptr, 0)
        }
        return buf;
    }

    /**
    * @dev Appends len bytes of a byte string to a buffer. Resizes if doing so would exceed
    *      the capacity of the buffer.
    * @param buf The buffer to append to.
    * @param data The data to append.
    * @param len The number of bytes to copy.
    * @return The original buffer, for chaining.
    */
    function append(buffer memory buf, bytes memory data, uint len) internal pure returns(buffer memory) {
        require(len <= data.length);

        uint off = buf.buf.length;
        uint newCapacity = off + len;
        if (newCapacity > buf.capacity) {
            resize(buf, newCapacity * 2);
        }

        uint dest;
        uint src;
        assembly {
            // Memory address of the buffer data
            let bufptr := mload(buf)
            // Length of existing buffer data
            let buflen := mload(bufptr)
            // Start address = buffer address + offset + sizeof(buffer length)
            dest := add(add(bufptr, 32), off)
            // Update buffer length if we're extending it
            if gt(newCapacity, buflen) {
                mstore(bufptr, newCapacity)
            }
            src := add(data, 32)
        }

        // Copy word-length chunks while possible
        for (; len >= 32; len -= 32) {
            assembly {
                mstore(dest, mload(src))
            }
            dest += 32;
            src += 32;
        }

        // Copy remaining bytes
        unchecked {
            uint mask = (256 ** (32 - len)) - 1;
            assembly {
                let srcpart := and(mload(src), not(mask))
                let destpart := and(mload(dest), mask)
                mstore(dest, or(destpart, srcpart))
            }
        }

        return buf;
    }

    /**
    * @dev Appends a byte string to a buffer. Resizes if doing so would exceed
    *      the capacity of the buffer.
    * @param buf The buffer to append to.
    * @param data The data to append.
    * @return The original buffer, for chaining.
    */
    function append(buffer memory buf, bytes memory data) internal pure returns (buffer memory) {
        return append(buf, data, data.length);
    }

    /**
    * @dev Appends a byte to the buffer. Resizes if doing so would exceed the
    *      capacity of the buffer.
    * @param buf The buffer to append to.
    * @param data The data to append.
    * @return The original buffer, for chaining.
    */
    function appendUint8(buffer memory buf, uint8 data) internal pure returns(buffer memory) {
        uint off = buf.buf.length;
        uint offPlusOne = off + 1;
        if (off >= buf.capacity) {
            resize(buf, offPlusOne * 2);
        }

        assembly {
            // Memory address of the buffer data
            let bufptr := mload(buf)
            // Address = buffer address + sizeof(buffer length) + off
            let dest := add(add(bufptr, off), 32)
            mstore8(dest, data)
            // Update buffer length if we extended it
            if gt(offPlusOne, mload(bufptr)) {
                mstore(bufptr, offPlusOne)
            }
        }

        return buf;
    }

    /**
    * @dev Appends len bytes of bytes32 to a buffer. Resizes if doing so would
    *      exceed the capacity of the buffer.
    * @param buf The buffer to append to.
    * @param data The data to append.
    * @param len The number of bytes to write (left-aligned).
    * @return The original buffer, for chaining.
    */
    function append(buffer memory buf, bytes32 data, uint len) private pure returns(buffer memory) {
        uint off = buf.buf.length;
        uint newCapacity = len + off;
        if (newCapacity > buf.capacity) {
            resize(buf, newCapacity * 2);
        }

        unchecked {
            uint mask = (256 ** len) - 1;
            // Right-align data
            data = data >> (8 * (32 - len));
            assembly {
                // Memory address of the buffer data
                let bufptr := mload(buf)
                // Address = buffer address + sizeof(buffer length) + newCapacity
                let dest := add(bufptr, newCapacity)
                mstore(dest, or(and(mload(dest), not(mask)), data))
                // Update buffer length if we extended it
                if gt(newCapacity, mload(bufptr)) {
                    mstore(bufptr, newCapacity)
                }
            }
        }
        return buf;
    }

    /**
    * @dev Appends a bytes20 to the buffer. Resizes if doing so would exceed
    *      the capacity of the buffer.
    * @param buf The buffer to append to.
    * @param data The data to append.
    * @return The original buffer, for chhaining.
    */
    function appendBytes20(buffer memory buf, bytes20 data) internal pure returns (buffer memory) {
        return append(buf, bytes32(data), 20);
    }

    /**
    * @dev Appends a bytes32 to the buffer. Resizes if doing so would exceed
    *      the capacity of the buffer.
    * @param buf The buffer to append to.
    * @param data The data to append.
    * @return The original buffer, for chaining.
    */
    function appendBytes32(buffer memory buf, bytes32 data) internal pure returns (buffer memory) {
        return append(buf, data, 32);
    }

    /**
     * @dev Appends a byte to the end of the buffer. Resizes if doing so would
     *      exceed the capacity of the buffer.
     * @param buf The buffer to append to.
     * @param data The data to append.
     * @param len The number of bytes to write (right-aligned).
     * @return The original buffer.
     */
    function appendInt(buffer memory buf, uint data, uint len) internal pure returns(buffer memory) {
        uint off = buf.buf.length;
        uint newCapacity = len + off;
        if (newCapacity > buf.capacity) {
            resize(buf, newCapacity * 2);
        }

        uint mask = (256 ** len) - 1;
        assembly {
            // Memory address of the buffer data
            let bufptr := mload(buf)
            // Address = buffer address + sizeof(buffer length) + newCapacity
            let dest := add(bufptr, newCapacity)
            mstore(dest, or(and(mload(dest), not(mask)), data))
            // Update buffer length if we extended it
            if gt(newCapacity, mload(bufptr)) {
                mstore(bufptr, newCapacity)
            }
        }
        return buf;
    }
}

File 22 of 24 : IERC165.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (utils/introspection/IERC165.sol)

pragma solidity ^0.8.20;

/**
 * @dev Interface of the ERC-165 standard, as defined in the
 * https://eips.ethereum.org/EIPS/eip-165[ERC].
 *
 * 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[ERC section]
     * to learn more about how these ids are created.
     *
     * This function call must use less than 30 000 gas.
     */
    function supportsInterface(bytes4 interfaceId) external view returns (bool);
}

File 23 of 24 : Math.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (utils/math/Math.sol)

pragma solidity ^0.8.20;

/**
 * @dev Standard math utilities missing in the Solidity language.
 */
library Math {
    /**
     * @dev Muldiv operation overflow.
     */
    error MathOverflowedMulDiv();

    enum Rounding {
        Floor, // Toward negative infinity
        Ceil, // Toward positive infinity
        Trunc, // Toward zero
        Expand // Away from zero
    }

    /**
     * @dev Returns the addition of two unsigned integers, with an success flag (no overflow).
     */
    function tryAdd(uint256 a, uint256 b) internal pure returns (bool success, uint256 result) {
        unchecked {
            uint256 c = a + b;
            if (c < a) return (false, 0);
            return (true, c);
        }
    }

    /**
     * @dev Returns the subtraction of two unsigned integers, with an success flag (no overflow).
     */
    function trySub(uint256 a, uint256 b) internal pure returns (bool success, uint256 result) {
        unchecked {
            if (b > a) return (false, 0);
            return (true, a - b);
        }
    }

    /**
     * @dev Returns the multiplication of two unsigned integers, with an success flag (no overflow).
     */
    function tryMul(uint256 a, uint256 b) internal pure returns (bool success, uint256 result) {
        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 success flag (no division by zero).
     */
    function tryDiv(uint256 a, uint256 b) internal pure returns (bool success, uint256 result) {
        unchecked {
            if (b == 0) return (false, 0);
            return (true, a / b);
        }
    }

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

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

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

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

    /**
     * @dev Returns the ceiling of the division of two numbers.
     *
     * This differs from standard division with `/` in that it rounds towards infinity instead
     * of rounding towards zero.
     */
    function ceilDiv(uint256 a, uint256 b) internal pure returns (uint256) {
        if (b == 0) {
            // Guarantee the same behavior as in a regular Solidity division.
            return a / b;
        }

        // The following calculation ensures accurate ceiling division without overflow.
        // Since a is non-zero, (a - 1) / b will not overflow.
        // The largest possible result occurs when (a - 1) / b is type(uint256).max,
        // but the largest value we can obtain is type(uint256).max - 1, which happens
        // when a = type(uint256).max and b = 1.
        unchecked {
            return a == 0 ? 0 : (a - 1) / b + 1;
        }
    }

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

            // Handle non-overflow cases, 256 by 256 division.
            if (prod1 == 0) {
                // Solidity will revert if denominator == 0, unlike the div opcode on its own.
                // The surrounding unchecked block does not change this fact.
                // See https://docs.soliditylang.org/en/latest/control-structures.html#checked-or-unchecked-arithmetic.
                return prod0 / denominator;
            }

            // Make sure the result is less than 2^256. Also prevents denominator == 0.
            if (denominator <= prod1) {
                revert MathOverflowedMulDiv();
            }

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

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

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

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

            uint256 twos = denominator & (0 - denominator);
            assembly {
                // Divide denominator by twos.
                denominator := div(denominator, twos)

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    /**
     * @dev Returns whether a provided rounding mode is considered rounding up for unsigned integers.
     */
    function unsignedRoundsUp(Rounding rounding) internal pure returns (bool) {
        return uint8(rounding) % 2 == 1;
    }
}

File 24 of 24 : SignedMath.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (utils/math/SignedMath.sol)

pragma solidity ^0.8.20;

/**
 * @dev Standard signed math utilities missing in the Solidity language.
 */
library SignedMath {
    /**
     * @dev Returns the largest of two signed numbers.
     */
    function max(int256 a, int256 b) internal pure returns (int256) {
        return a > b ? a : b;
    }

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

    /**
     * @dev Returns the average of two signed numbers without overflow.
     * The result is rounded towards zero.
     */
    function average(int256 a, int256 b) internal pure returns (int256) {
        // Formula from the book "Hacker's Delight"
        int256 x = (a & b) + ((a ^ b) >> 1);
        return x + (int256(uint256(x) >> 255) & (a ^ b));
    }

    /**
     * @dev Returns the absolute unsigned value of a signed value.
     */
    function abs(int256 n) internal pure returns (uint256) {
        unchecked {
            // must be unchecked in order to support `n = type(int256).min`
            return uint256(n >= 0 ? n : -n);
        }
    }
}

Settings
{
  "remappings": [
    "@openzeppelin/contracts/=lib/openzeppelin-contracts/contracts/",
    "chainlink/=lib/chainlink/contracts/",
    "ds-test/=lib/forge-std/lib/ds-test/src/",
    "erc4626-tests/=lib/openzeppelin-contracts/lib/erc4626-tests/",
    "forge-std/=lib/forge-std/src/",
    "openzeppelin-contracts/=lib/openzeppelin-contracts/"
  ],
  "optimizer": {
    "enabled": true,
    "runs": 200
  },
  "metadata": {
    "useLiteralContent": false,
    "bytecodeHash": "ipfs",
    "appendCBOR": true
  },
  "outputSelection": {
    "*": {
      "*": [
        "evm.bytecode",
        "evm.deployedBytecode",
        "devdoc",
        "userdoc",
        "metadata",
        "abi"
      ]
    }
  },
  "evmVersion": "paris",
  "viaIR": false,
  "libraries": {}
}

Contract Security Audit

Contract ABI

[{"inputs":[{"internalType":"string","name":"baseURI_","type":"string"},{"internalType":"address","name":"admin_","type":"address"},{"internalType":"address","name":"minter_","type":"address"},{"internalType":"address","name":"updater_","type":"address"},{"internalType":"address","name":"verse_","type":"address"},{"internalType":"uint256","name":"timelock_","type":"uint256"},{"internalType":"address","name":"router_","type":"address"},{"internalType":"bytes32","name":"donId_","type":"bytes32"},{"internalType":"uint64","name":"subscriptionId_","type":"uint64"},{"internalType":"uint32","name":"callbackGasLimit_","type":"uint32"},{"internalType":"string","name":"source_","type":"string"}],"stateMutability":"nonpayable","type":"constructor"},{"inputs":[],"name":"AccessControlBadConfirmation","type":"error"},{"inputs":[{"internalType":"address","name":"account","type":"address"},{"internalType":"bytes32","name":"neededRole","type":"bytes32"}],"name":"AccessControlUnauthorizedAccount","type":"error"},{"inputs":[],"name":"DeprecatedData","type":"error"},{"inputs":[{"internalType":"address","name":"sender","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"address","name":"owner","type":"address"}],"name":"ERC721IncorrectOwner","type":"error"},{"inputs":[{"internalType":"address","name":"operator","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"ERC721InsufficientApproval","type":"error"},{"inputs":[{"internalType":"address","name":"approver","type":"address"}],"name":"ERC721InvalidApprover","type":"error"},{"inputs":[{"internalType":"address","name":"operator","type":"address"}],"name":"ERC721InvalidOperator","type":"error"},{"inputs":[{"internalType":"address","name":"owner","type":"address"}],"name":"ERC721InvalidOwner","type":"error"},{"inputs":[{"internalType":"address","name":"receiver","type":"address"}],"name":"ERC721InvalidReceiver","type":"error"},{"inputs":[{"internalType":"address","name":"sender","type":"address"}],"name":"ERC721InvalidSender","type":"error"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"ERC721NonexistentToken","type":"error"},{"inputs":[],"name":"EmptyArgs","type":"error"},{"inputs":[],"name":"EmptySource","type":"error"},{"inputs":[{"internalType":"bytes","name":"err","type":"bytes"}],"name":"InvalidCallback","type":"error"},{"inputs":[],"name":"InvalidCallbackGasLimit","type":"error"},{"inputs":[],"name":"InvalidDonId","type":"error"},{"inputs":[],"name":"InvalidParametersMatch","type":"error"},{"inputs":[{"internalType":"bytes32","name":"requestId","type":"bytes32"}],"name":"InvalidRequestId","type":"error"},{"inputs":[],"name":"InvalidSource","type":"error"},{"inputs":[],"name":"InvalidSubscriptionId","type":"error"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"InvalidTokenId","type":"error"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"InvalidUnlock","type":"error"},{"inputs":[],"name":"NoInlineSecrets","type":"error"},{"inputs":[],"name":"OnlyRouterCanFulfill","type":"error"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"TokenAlreadyUnlocked","type":"error"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"TokenLocked","type":"error"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"owner","type":"address"},{"indexed":true,"internalType":"address","name":"approved","type":"address"},{"indexed":true,"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"Approval","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"owner","type":"address"},{"indexed":true,"internalType":"address","name":"operator","type":"address"},{"indexed":false,"internalType":"bool","name":"approved","type":"bool"}],"name":"ApprovalForAll","type":"event"},{"anonymous":false,"inputs":[],"name":"EmergencyUnlock","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"id","type":"bytes32"}],"name":"RequestFulfilled","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"id","type":"bytes32"}],"name":"RequestSent","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"role","type":"bytes32"},{"indexed":true,"internalType":"bytes32","name":"previousAdminRole","type":"bytes32"},{"indexed":true,"internalType":"bytes32","name":"newAdminRole","type":"bytes32"}],"name":"RoleAdminChanged","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"role","type":"bytes32"},{"indexed":true,"internalType":"address","name":"account","type":"address"},{"indexed":true,"internalType":"address","name":"sender","type":"address"}],"name":"RoleGranted","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"role","type":"bytes32"},{"indexed":true,"internalType":"address","name":"account","type":"address"},{"indexed":true,"internalType":"address","name":"sender","type":"address"}],"name":"RoleRevoked","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"from","type":"address"},{"indexed":true,"internalType":"address","name":"to","type":"address"},{"indexed":true,"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"Transfer","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"Unlock","type":"event"},{"inputs":[],"name":"BASE_URI","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"DEFAULT_ADMIN_ROLE","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"MINTER_ROLE","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"NB_OF_TOKENS","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"SENTIMENT_INTERVAL","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"TIMELOCK_DEADLINE","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"UPDATER_ROLE","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"VERSE","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"approve","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"areAllUnlocked","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"}],"name":"balanceOf","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"burn","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"callbackGasLimit","outputs":[{"internalType":"uint32","name":"","type":"uint32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"donId","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"eUnlock","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"getApproved","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"}],"name":"getRoleAdmin","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"grantRole","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"requestId","type":"bytes32"},{"internalType":"bytes","name":"response","type":"bytes"},{"internalType":"bytes","name":"err","type":"bytes"}],"name":"handleOracleFulfillment","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"hasRole","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"},{"internalType":"address","name":"operator","type":"address"}],"name":"isApprovedForAll","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"isEUnlocked","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"isUnlocked","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"lastRequestId","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"lastSentiment","outputs":[{"internalType":"uint256","name":"sentiment","type":"uint256"},{"internalType":"uint256","name":"timestamp","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"mint","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address[]","name":"to","type":"address[]"},{"internalType":"uint256[]","name":"tokenIds","type":"uint256[]"}],"name":"mintBatch","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"name","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"ownerOf","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"callerConfirmation","type":"address"}],"name":"renounceRole","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"revokeRole","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"router","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"safeTransferFrom","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"bytes","name":"data","type":"bytes"}],"name":"safeTransferFrom","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"sentimentOf","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"operator","type":"address"},{"internalType":"bool","name":"approved","type":"bool"}],"name":"setApprovalForAll","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint32","name":"callbackGasLimit_","type":"uint32"}],"name":"setCallbackGasLimit","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"donId_","type":"bytes32"}],"name":"setDonId","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"string","name":"source_","type":"string"}],"name":"setSource","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint64","name":"subscriptionId_","type":"uint64"}],"name":"setSubscriptionId","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"source","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"subscriptionId","outputs":[{"internalType":"uint64","name":"","type":"uint64"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes4","name":"interfaceId","type":"bytes4"}],"name":"supportsInterface","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"symbol","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"tokenURI","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"transferFrom","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256[]","name":"tokenIds","type":"uint256[]"}],"name":"unlock","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"string[]","name":"args","type":"string[]"}],"name":"update","outputs":[],"stateMutability":"nonpayable","type":"function"}]

6101006040526008805460ff1916905534801561001b57600080fd5b506040516135c23803806135c283398101604081905261003a91610440565b60405180604001604052806008815260200167082924092dcc8caf60c31b81525060405180604001604052806008815260200167082925a92dcc8caf60c31b8152508c60648d8d8d8d8d8d8d8d8d8d848e8e8e8e8e8e8d8d878781600090816100a391906105be565b5060016100b082826105be565b506100c09150600090508561019e565b506100eb7f9f2df0fed2c77648de5860a4cc508cd0818c85b8b8a1ab4ceeef8d981c8956a68461019e565b5060076100f887826105be565b5060808590526001600160a01b03821660a052610115814261067d565b60c0525050506001600160a01b0390951660e0525061015b93507f73e573f9566d61418a34d5de3ff49360f9c51fec37f7486551670290f6285dab92508b91505061019e565b506101658461024e565b61016e83610271565b610177826102ba565b61018081610309565b5050505050505050505050505050505050505050505050505061069e565b60008281526006602090815260408083206001600160a01b038516845290915281205460ff166102445760008381526006602090815260408083206001600160a01b03861684529091529020805460ff191660011790556101fc3390565b6001600160a01b0316826001600160a01b0316847f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a4506001610248565b5060005b92915050565b8061026c576040516391f7443960e01b815260040160405180910390fd5b600a55565b6001600160401b03811661029857604051630ebd8d1960e11b815260040160405180910390fd5b600b80546001600160401b0319166001600160401b0392909216919091179055565b63ffffffff81166102de5760405163fe7036d760e01b815260040160405180910390fd5b600b805463ffffffff909216680100000000000000000263ffffffff60401b19909216919091179055565b805160000361032b57604051638154374b60e01b815260040160405180910390fd5b600c61033782826105be565b5050565b634e487b7160e01b600052604160045260246000fd5b600082601f83011261036257600080fd5b81516001600160401b038082111561037c5761037c61033b565b604051601f8301601f19908116603f011681019082821181831017156103a4576103a461033b565b81604052838152602092508660208588010111156103c157600080fd5b600091505b838210156103e357858201830151818301840152908201906103c6565b6000602085830101528094505050505092915050565b80516001600160a01b038116811461041057600080fd5b919050565b80516001600160401b038116811461041057600080fd5b805163ffffffff8116811461041057600080fd5b60008060008060008060008060008060006101608c8e03121561046257600080fd5b8b516001600160401b0381111561047857600080fd5b6104848e828f01610351565b9b505061049360208d016103f9565b99506104a160408d016103f9565b98506104af60608d016103f9565b97506104bd60808d016103f9565b965060a08c015195506104d260c08d016103f9565b945060e08c015193506104e86101008d01610415565b92506104f76101208d0161042c565b6101408d01519092506001600160401b0381111561051457600080fd5b6105208e828f01610351565b9150509295989b509295989b9093969950565b600181811c9082168061054757607f821691505b60208210810361056757634e487b7160e01b600052602260045260246000fd5b50919050565b601f8211156105b9576000816000526020600020601f850160051c810160208610156105965750805b601f850160051c820191505b818110156105b5578281556001016105a2565b5050505b505050565b81516001600160401b038111156105d7576105d761033b565b6105eb816105e58454610533565b8461056d565b602080601f83116001811461062057600084156106085750858301515b600019600386901b1c1916600185901b1785556105b5565b600085815260208120601f198616915b8281101561064f57888601518255948401946001909101908401610630565b508582101561066d5787850151600019600388901b60f8161c191681555b5050505050600190811b01905550565b8082018082111561024857634e487b7160e01b600052601160045260246000fd5b60805160a05160c05160e051612ec86106fa6000396000818161067b01528181610917015261125c0152600081816104530152610f0c0152600081816104a101526113ca0152600081816104ee0152611dd30152612ec86000f3fe608060405234801561001057600080fd5b50600436106102a05760003560e01c806370a0823111610167578063b88d4fde116100ce578063e985e9c511610087578063e985e9c514610640578063ea7b4f7714610653578063f82cd01714610666578063f887ea4014610679578063fb9b18361461069f578063fc2a88c3146106aa57600080fd5b8063b88d4fde146105d0578063c87b56dd146105e3578063d5391393146105f6578063d547741f1461061d578063dbddb26a14610630578063e7dee4181461063857600080fd5b806391d148541161012057806391d148541461057457806395d89b411461058757806399d254551461058f578063a217fddf146105a2578063a22cb465146105aa578063a4eb718c146105bd57600080fd5b806370a082311461051857806372abc8b71461052b57806378ca5de71461053e5780637c88e3d914610551578063880387c9146105645780638dbe7b9d1461056c57600080fd5b806336568abe1161020b57806347e63380116101c457806347e63380146104755780634cf4b61f1461049c5780635d36598f146104c35780636352211e146104d65780636506466b146104e957806367e828bf1461051057600080fd5b806336568abe146103e757806337e05331146103fa57806340c10f191461041557806342842e0e1461042857806342966c681461043b57806344148a921461044e57600080fd5b80630bd765db1161025d5780630bd765db146103455780630ca761751461035857806323b872dd1461036b578063248a9ca31461037e57806324f74697146103af5780632f2ff15d146103d457600080fd5b806301ffc9a7146102a557806306fdde03146102cd578063081812fc146102e25780630837d1cd1461030d578063095ea7b31461031557806309c1ba2e1461032a575b600080fd5b6102b86102b3366004612486565b6106b2565b60405190151581526020015b60405180910390f35b6102d56106c3565b6040516102c491906124f3565b6102f56102f0366004612506565b610755565b6040516001600160a01b0390911681526020016102c4565b6102b861077e565b61032861032336600461253b565b61078d565b005b600b546040516001600160401b0390911681526020016102c4565b6103286103533660046125b0565b61079c565b6103286103663660046126a6565b61090c565b610328610379366004612712565b610990565b6103a161038c366004612506565b60009081526006602052604090206001015490565b6040519081526020016102c4565b600b54600160401b900463ffffffff1660405163ffffffff90911681526020016102c4565b6103286103e236600461274e565b610a20565b6103286103f536600461274e565b610a45565b600e54600f54604080519283526020830191909152016102c4565b61032861042336600461253b565b610a7d565b610328610436366004612712565b610ab1565b610328610449366004612506565b610acc565b6103a17f000000000000000000000000000000000000000000000000000000000000000081565b6103a17f73e573f9566d61418a34d5de3ff49360f9c51fec37f7486551670290f6285dab81565b6102f57f000000000000000000000000000000000000000000000000000000000000000081565b6103286104d13660046125b0565b610ad8565b6102f56104e4366004612506565b610b49565b6103a17f000000000000000000000000000000000000000000000000000000000000000081565b6102d5610b54565b6103a161052636600461277a565b610b63565b6102b8610539366004612506565b610bab565b61032861054c366004612506565b610bc0565b61032861055f366004612827565b610bd4565b6103a1600a81565b600a546103a1565b6102b861058236600461274e565b610c70565b6102d5610c9b565b61032861059d3660046128e6565b610caa565b6103a1600081565b6103286105b836600461291a565b610cbe565b6103286105cb366004612956565b610cc9565b6103286105de36600461297c565b610cdd565b6102d56105f1366004612506565b610cf4565b6103a17f9f2df0fed2c77648de5860a4cc508cd0818c85b8b8a1ab4ceeef8d981c8956a681565b61032861062b36600461274e565b610d5c565b6102d5610d81565b610328610e0f565b6102b861064e3660046129e3565b610e53565b610328610661366004612a0d565b610e81565b6103a1610674366004612506565b610e95565b7f00000000000000000000000000000000000000000000000000000000000000006102f5565b60085460ff166102b8565b600d546103a1565b60006106bd82610eaa565b92915050565b6060600080546106d290612a36565b80601f01602080910402602001604051908101604052809291908181526020018280546106fe90612a36565b801561074b5780601f106107205761010080835404028352916020019161074b565b820191906000526020600020905b81548152906001019060200180831161072e57829003601f168201915b5050505050905090565b600061076082610ecf565b506000828152600460205260409020546001600160a01b03166106bd565b6000610788610f08565b905090565b610798828233610f3e565b5050565b7f73e573f9566d61418a34d5de3ff49360f9c51fec37f7486551670290f6285dab6107c681610f4b565b6108076040805160e0810190915280600081526020016000815260200160008152602001606081526020016060815260200160608152602001606081525090565b6108a4600c805461081790612a36565b80601f016020809104026020016040519081016040528092919081815260200182805461084390612a36565b80156108905780601f1061086557610100808354040283529160200191610890565b820191906000526020600020905b81548152906001019060200180831161087357829003601f168201915b505050505082610f5890919063ffffffff16565b82156108be576108be6108b78486612a70565b8290610f65565b60006108f06108cc83610f8f565b600b54600a546001600160401b03821691600160401b900463ffffffff1690611257565b600d8190559050610905816107988688612a70565b5050505050565b336001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016146109555760405163c6829f8360e01b815260040160405180910390fd5b610960838383611329565b60405183907f85e1543bf2f84fe80c6badbce3648c8539ad1df4d2b3d822938ca0538be727e690600090a2505050565b6001600160a01b0382166109bf57604051633250574960e11b8152600060048201526024015b60405180910390fd5b60006109cc83833361138b565b9050836001600160a01b0316816001600160a01b031614610a1a576040516364283d7b60e01b81526001600160a01b03808616600483015260248201849052821660448201526064016109b6565b50505050565b600082815260066020526040902060010154610a3b81610f4b565b610a1a8383611459565b6001600160a01b0381163314610a6e5760405163334bd91960e11b815260040160405180910390fd5b610a7882826114ed565b505050565b7f9f2df0fed2c77648de5860a4cc508cd0818c85b8b8a1ab4ceeef8d981c8956a6610aa781610f4b565b610a78838361155a565b610a7883838360405180602001604052806000815250610cdd565b6107986000823361138b565b610b1482828080602002602001604051908101604052809392919081815260200183836020028082843760009201919091525061156e92505050565b8060005b81811015610a1a57610b41848483818110610b3557610b35612ae3565b90506020020135611629565b600101610b18565b60006106bd82610ecf565b6060600c80546106d290612a36565b60006001600160a01b038216610b8f576040516322718ad960e21b8152600060048201526024016109b6565b506001600160a01b031660009081526003602052604090205490565b6000610bb682610ecf565b506106bd8261166c565b6000610bcb81610f4b565b6107988261168c565b7f9f2df0fed2c77648de5860a4cc508cd0818c85b8b8a1ab4ceeef8d981c8956a6610bfe81610f4b565b825182518114610c2157604051636b07401f60e01b815260040160405180910390fd5b60005b8181101561090557610c68858281518110610c4157610c41612ae3565b6020026020010151858381518110610c5b57610c5b612ae3565b602002602001015161155a565b600101610c24565b60009182526006602090815260408084206001600160a01b0393909316845291905290205460ff1690565b6060600180546106d290612a36565b6000610cb581610f4b565b610798826116af565b6107983383836116dd565b6000610cd481610f4b565b6107988261177c565b610ce8848484610990565b610a1a848484846117cb565b6060610cff82610ecf565b506000610d0a6118ed565b90506000815111610d2a5760405180602001604052806000815250610d55565b80610d34846118fc565b604051602001610d45929190612af9565b6040516020818303038152906040525b9392505050565b600082815260066020526040902060010154610d7781610f4b565b610a1a83836114ed565b60078054610d8e90612a36565b80601f0160208091040260200160405190810160405280929190818152602001828054610dba90612a36565b8015610e075780601f10610ddc57610100808354040283529160200191610e07565b820191906000526020600020905b815481529060010190602001808311610dea57829003601f168201915b505050505081565b6000610e1a81610f4b565b6008805460ff191660011790556040517fc530b67f06e79967fafaa0f1af1af798443e42526f8a0ff054bd2bd075198cf490600090a150565b6001600160a01b03918216600090815260056020908152604080832093909416825291909152205460ff1690565b6000610e8c81610f4b565b6107988261198e565b6000610ea082610ecf565b506106bd826119d8565b60006001600160e01b03198216637965db0b60e01b14806106bd57506106bd826119ef565b6000818152600260205260408120546001600160a01b0316806106bd57604051637e27328960e01b8152600481018490526024016109b6565b60007f00000000000000000000000000000000000000000000000000000000000000004210158061078857505060085460ff1690565b610a788383836001611a3f565b610f558133611b45565b50565b6107988260008084611b7e565b8051600003610f875760405163fe936cb760e01b815260040160405180910390fd5b60a090910152565b60606000610f9e610100611bfc565b9050610fd76040518060400160405280600c81526020016b31b7b232a637b1b0ba34b7b760a11b81525082611c1d90919063ffffffff16565b8251610ff5906002811115610fee57610fee612b28565b8290611c36565b6040805180820190915260088152676c616e677561676560c01b602082015261101f908290611c1d565b6040830151611036908015610fee57610fee612b28565b604080518082019091526006815265736f7572636560d01b602082015261105e908290611c1d565b606083015161106e908290611c1d565b60a083015151156110fa576040805180820190915260048152636172677360e01b602082015261109f908290611c1d565b6110a881611c6f565b60005b8360a00151518110156110f0576110e88460a0015182815181106110d1576110d1612ae3565b602002602001015183611c1d90919063ffffffff16565b6001016110ab565b506110fa81611c93565b608083015151156111be5760008360200151600281111561111d5761111d612b28565b0361113b5760405163a80d31f760e01b815260040160405180910390fd5b60408051808201909152600f81526e39b2b1b932ba39a637b1b0ba34b7b760891b602082015261116c908290611c1d565b61118583602001516002811115610fee57610fee612b28565b6040805180820190915260078152667365637265747360c81b60208201526111ae908290611c1d565b60808301516111be908290611cb1565b60c0830151511561124f5760408051808201909152600981526862797465734172677360b81b60208201526111f4908290611c1d565b6111fd81611c6f565b60005b8360c00151518110156112455761123d8460c00151828151811061122657611226612ae3565b602002602001015183611cb190919063ffffffff16565b600101611200565b5061124f81611c93565b515192915050565b6000807f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031663461d27628688600188886040518663ffffffff1660e01b81526004016112af959493929190612b3e565b6020604051808303816000875af11580156112ce573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906112f29190612b87565b60405190915081907f1131472297a800fee664d1d89cfa8f7676ff07189ecc53f80bbb5f4969099db890600090a295945050505050565b82600d54811461134f5760405163a48032d560e01b8152600481018290526024016109b6565b8180516000146113745780604051639d75e4a760e01b81526004016109b691906124f3565b61137d84612ba0565b600e55505042600f55505050565b6000828152600260205260408120546001600160a01b03166113ac8461166c565b1580156113c157506001600160a01b03811615155b80156113ff57507f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316816001600160a01b031614155b1561142057604051634432ba5960e11b8152600481018590526024016109b6565b6001600160a01b038516611445576000848152600960205260409020805460ff191690555b611450858585611cbe565b95945050505050565b60006114658383610c70565b6114e55760008381526006602090815260408083206001600160a01b03861684529091529020805460ff1916600117905561149d3390565b6001600160a01b0316826001600160a01b0316847f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a45060016106bd565b5060006106bd565b60006114f98383610c70565b156114e55760008381526006602090815260408083206001600160a01b0386168085529252808320805460ff1916905551339286917ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b9190a45060016106bd565b6115648282611db7565b6107988282611dd1565b61157781611e14565b600f5461158690610e10612bda565b4211156115a65760405163ea3dde0960e01b815260040160405180910390fd5b805160005b81811015610a785760008382815181106115c7576115c7612ae3565b602002602001015190506000600e54905060006115e3836119d8565b9050808210806115fd57506115f9600a82612bda565b8210155b1561161e57604051639d22e1fb60e01b8152600481018490526024016109b6565b5050506001016115ab565b600081815260096020526040808220805460ff191660011790555182917f832a253ad4e9e88f705006a24d9957b8aa1de307a0f9d0a6ad5fd0b0ac81050591a250565b60008181526009602052604081205460ff16806106bd57506106bd610f08565b806116aa576040516391f7443960e01b815260040160405180910390fd5b600a55565b80516000036116d157604051638154374b60e01b815260040160405180910390fd5b600c6107988282612c3d565b6001600160a01b03821661170f57604051630b61174360e31b81526001600160a01b03831660048201526024016109b6565b6001600160a01b03838116600081815260056020908152604080832094871680845294825291829020805460ff191686151590811790915591519182527f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31910160405180910390a3505050565b63ffffffff81166117a05760405163fe7036d760e01b815260040160405180910390fd5b600b805463ffffffff909216600160401b026bffffffff000000000000000019909216919091179055565b6001600160a01b0383163b15610a1a57604051630a85bd0160e11b81526001600160a01b0384169063150b7a029061180d903390889087908790600401612cfc565b6020604051808303816000875af1925050508015611848575060408051601f3d908101601f1916820190925261184591810190612d39565b60015b6118b1573d808015611876576040519150601f19603f3d011682016040523d82523d6000602084013e61187b565b606091505b5080516000036118a957604051633250574960e11b81526001600160a01b03851660048201526024016109b6565b805181602001fd5b6001600160e01b03198116630a85bd0160e11b1461090557604051633250574960e11b81526001600160a01b03851660048201526024016109b6565b6060600780546106d290612a36565b6060600061190983611e4b565b60010190506000816001600160401b03811115611928576119286125f1565b6040519080825280601f01601f191660200182016040528015611952576020820181803683370190505b5090508181016020015b600019016f181899199a1a9b1b9c1cb0b131b232b360811b600a86061a8153600a850494508461195c57509392505050565b6001600160401b0381166119b557604051630ebd8d1960e11b815260040160405180910390fd5b600b805467ffffffffffffffff19166001600160401b0392909216919091179055565b60006119e5600a83612d56565b6106bd9083612d78565b60006001600160e01b031982166380ac58cd60e01b1480611a2057506001600160e01b03198216635b5e139f60e01b145b806106bd57506301ffc9a760e01b6001600160e01b03198316146106bd565b8080611a5357506001600160a01b03821615155b15611b15576000611a6384610ecf565b90506001600160a01b03831615801590611a8f5750826001600160a01b0316816001600160a01b031614155b8015611aa25750611aa08184610e53565b155b15611acb5760405163a9fbf51f60e01b81526001600160a01b03841660048201526024016109b6565b8115611b135783856001600160a01b0316826001600160a01b03167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92560405160405180910390a45b505b5050600090815260046020526040902080546001600160a01b0319166001600160a01b0392909216919091179055565b611b4f8282610c70565b6107985760405163e2517d3f60e01b81526001600160a01b0382166004820152602481018390526044016109b6565b8051600003611ba0576040516322ce3edd60e01b815260040160405180910390fd5b83836002811115611bb357611bb3612b28565b90816002811115611bc657611bc6612b28565b90525060408401828015611bdc57611bdc612b28565b90818015611bec57611bec612b28565b9052506060909301929092525050565b611c0461243b565b8051611c109083611f23565b5060006020820152919050565b611c2a8260038351611f9a565b8151610a7890826120b3565b8151611c439060c26120d4565b506107988282604051602001611c5b91815260200190565b604051602081830303815290604052611cb1565b611c7a81600461213d565b600181602001818151611c8d9190612bda565b90525050565b611c9e81600761213d565b600181602001818151611c8d9190612d78565b611c2a8260028351611f9a565b6000828152600260205260408120546001600160a01b0390811690831615611ceb57611ceb818486612154565b6001600160a01b03811615611d2957611d08600085600080611a3f565b6001600160a01b038116600090815260036020526040902080546000190190555b6001600160a01b03851615611d58576001600160a01b0385166000908152600360205260409020805460010190555b60008481526002602052604080822080546001600160a01b0319166001600160a01b0389811691821790925591518793918516917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef91a4949350505050565b6107988282604051806020016040528060008152506121b8565b7f000000000000000000000000000000000000000000000000000000000000000081106107985760405163ed15e6cf60e01b8152600481018290526024016109b6565b805160005b81811015610a7857611e43838281518110611e3657611e36612ae3565b60200260200101516121cf565b600101611e19565b60008072184f03e93ff9f4daa797ed6e38ed64bf6a1f0160401b8310611e8a5772184f03e93ff9f4daa797ed6e38ed64bf6a1f0160401b830492506040015b6d04ee2d6d415b85acef81000000008310611eb6576d04ee2d6d415b85acef8100000000830492506020015b662386f26fc100008310611ed457662386f26fc10000830492506010015b6305f5e1008310611eec576305f5e100830492506008015b6127108310611f0057612710830492506004015b60648310611f12576064830492506002015b600a83106106bd5760010192915050565b604080518082019091526060815260006020820152611f43602083612d56565b15611f6b57611f53602083612d56565b611f5e906020612d78565b611f689083612bda565b91505b602080840183905260405180855260008152908184010181811015611f8f57600080fd5b604052509192915050565b6017816001600160401b031611611fc0578251610a1a9060e0600585901b1683176120d4565b60ff816001600160401b031611612000578251611fe8906018611fe0600586901b16176120d4565b508251610a1a906001600160401b0383166001612203565b61ffff816001600160401b031611612041578251612029906019611fe0600586901b16176120d4565b508251610a1a906001600160401b0383166002612203565b63ffffffff816001600160401b03161161208457825161206c90601a611fe0600586901b16176120d4565b508251610a1a906001600160401b0383166004612203565b825161209b90601b611fe0600586901b16176120d4565b508251610a1a906001600160401b0383166008612203565b604080518082019091526060815260006020820152610d5583838451612288565b60408051808201909152606081526000602082015282515160006120f9826001612bda565b90508460200151821061211a5761211a85612115836002612d8b565b612359565b8451602083820101858153508051821115612133578181525b5093949350505050565b8151610a7890601f611fe0600585901b16176120d4565b61215f838383612370565b610a78576001600160a01b03831661218d57604051637e27328960e01b8152600481018290526024016109b6565b60405163177e802f60e01b81526001600160a01b0383166004820152602481018290526044016109b6565b6121c283836123d6565b610a7860008484846117cb565b6121d881610ecf565b506121e28161166c565b15610f555760405163149fdcdb60e11b8152600481018290526024016109b6565b60408051808201909152606081526000602082015283515160006122278285612bda565b905085602001518111156122445761224486612115836002612d8b565b6000600161225486610100612e86565b61225e9190612d78565b9050865182810187831982511617815250805183111561227c578281525b50959695505050505050565b60408051808201909152606081526000602082015282518211156122ab57600080fd5b83515160006122ba8483612bda565b905085602001518111156122d7576122d786612115836002612d8b565b8551805183820160200191600091808511156122f1578482525b505050602086015b602086106123315780518252612310602083612bda565b915061231d602082612bda565b905061232a602087612d78565b95506122f9565b51815160001960208890036101000a0190811690199190911617905250849150509392505050565b81516123658383611f23565b50610a1a83826120b3565b60006001600160a01b038316158015906123ce5750826001600160a01b0316846001600160a01b031614806123aa57506123aa8484610e53565b806123ce57506000828152600460205260409020546001600160a01b038481169116145b949350505050565b6001600160a01b03821661240057604051633250574960e11b8152600060048201526024016109b6565b600061240e8383600061138b565b90506001600160a01b03811615610a78576040516339e3563760e11b8152600060048201526024016109b6565b6040518060400160405280612463604051806040016040528060608152602001600081525090565b8152602001600081525090565b6001600160e01b031981168114610f5557600080fd5b60006020828403121561249857600080fd5b8135610d5581612470565b60005b838110156124be5781810151838201526020016124a6565b50506000910152565b600081518084526124df8160208601602086016124a3565b601f01601f19169290920160200192915050565b602081526000610d5560208301846124c7565b60006020828403121561251857600080fd5b5035919050565b80356001600160a01b038116811461253657600080fd5b919050565b6000806040838503121561254e57600080fd5b6125578361251f565b946020939093013593505050565b60008083601f84011261257757600080fd5b5081356001600160401b0381111561258e57600080fd5b6020830191508360208260051b85010111156125a957600080fd5b9250929050565b600080602083850312156125c357600080fd5b82356001600160401b038111156125d957600080fd5b6125e585828601612565565b90969095509350505050565b634e487b7160e01b600052604160045260246000fd5b604051601f8201601f191681016001600160401b038111828210171561262f5761262f6125f1565b604052919050565b600082601f83011261264857600080fd5b81356001600160401b03811115612661576126616125f1565b612674601f8201601f1916602001612607565b81815284602083860101111561268957600080fd5b816020850160208301376000918101602001919091529392505050565b6000806000606084860312156126bb57600080fd5b8335925060208401356001600160401b03808211156126d957600080fd5b6126e587838801612637565b935060408601359150808211156126fb57600080fd5b5061270886828701612637565b9150509250925092565b60008060006060848603121561272757600080fd5b6127308461251f565b925061273e6020850161251f565b9150604084013590509250925092565b6000806040838503121561276157600080fd5b823591506127716020840161251f565b90509250929050565b60006020828403121561278c57600080fd5b610d558261251f565b60006001600160401b038211156127ae576127ae6125f1565b5060051b60200190565b600082601f8301126127c957600080fd5b813560206127de6127d983612795565b612607565b8083825260208201915060208460051b87010193508684111561280057600080fd5b602086015b8481101561281c5780358352918301918301612805565b509695505050505050565b6000806040838503121561283a57600080fd5b82356001600160401b038082111561285157600080fd5b818501915085601f83011261286557600080fd5b813560206128756127d983612795565b82815260059290921b8401810191818101908984111561289457600080fd5b948201945b838610156128b9576128aa8661251f565b82529482019490820190612899565b965050860135925050808211156128cf57600080fd5b506128dc858286016127b8565b9150509250929050565b6000602082840312156128f857600080fd5b81356001600160401b0381111561290e57600080fd5b6123ce84828501612637565b6000806040838503121561292d57600080fd5b6129368361251f565b91506020830135801515811461294b57600080fd5b809150509250929050565b60006020828403121561296857600080fd5b813563ffffffff81168114610d5557600080fd5b6000806000806080858703121561299257600080fd5b61299b8561251f565b93506129a96020860161251f565b92506040850135915060608501356001600160401b038111156129cb57600080fd5b6129d787828801612637565b91505092959194509250565b600080604083850312156129f657600080fd5b6129ff8361251f565b91506127716020840161251f565b600060208284031215612a1f57600080fd5b81356001600160401b0381168114610d5557600080fd5b600181811c90821680612a4a57607f821691505b602082108103612a6a57634e487b7160e01b600052602260045260246000fd5b50919050565b6000612a7e6127d984612795565b80848252602080830192508560051b850136811115612a9c57600080fd5b855b81811015612ad75780356001600160401b03811115612abd5760008081fd5b612ac936828a01612637565b865250938201938201612a9e565b50919695505050505050565b634e487b7160e01b600052603260045260246000fd5b60008351612b0b8184602088016124a3565b835190830190612b1f8183602088016124a3565b01949350505050565b634e487b7160e01b600052602160045260246000fd5b6001600160401b038616815260a060208201526000612b6060a08301876124c7565b61ffff9590951660408301525063ffffffff92909216606083015260809091015292915050565b600060208284031215612b9957600080fd5b5051919050565b80516020808301519190811015612a6a5760001960209190910360031b1b16919050565b634e487b7160e01b600052601160045260246000fd5b808201808211156106bd576106bd612bc4565b601f821115610a78576000816000526020600020601f850160051c81016020861015612c165750805b601f850160051c820191505b81811015612c3557828155600101612c22565b505050505050565b81516001600160401b03811115612c5657612c566125f1565b612c6a81612c648454612a36565b84612bed565b602080601f831160018114612c9f5760008415612c875750858301515b600019600386901b1c1916600185901b178555612c35565b600085815260208120601f198616915b82811015612cce57888601518255948401946001909101908401612caf565b5085821015612cec5787850151600019600388901b60f8161c191681555b5050505050600190811b01905550565b6001600160a01b0385811682528416602082015260408101839052608060608201819052600090612d2f908301846124c7565b9695505050505050565b600060208284031215612d4b57600080fd5b8151610d5581612470565b600082612d7357634e487b7160e01b600052601260045260246000fd5b500690565b818103818111156106bd576106bd612bc4565b80820281158282048414176106bd576106bd612bc4565b600181815b80851115612ddd578160001904821115612dc357612dc3612bc4565b80851615612dd057918102915b93841c9390800290612da7565b509250929050565b600082612df4575060016106bd565b81612e01575060006106bd565b8160018114612e175760028114612e2157612e3d565b60019150506106bd565b60ff841115612e3257612e32612bc4565b50506001821b6106bd565b5060208310610133831016604e8410600b8410161715612e60575081810a6106bd565b612e6a8383612da2565b8060001904821115612e7e57612e7e612bc4565b029392505050565b6000610d558383612de556fea26469706673582212201323d53f9262cb38cf0ab9402f317910a170c8fe7bad2c4136c350fec7181cbe64736f6c6343000819003300000000000000000000000000000000000000000000000000000000000001600000000000000000000000003c7e48216c74d7818ab1fd226e56c60c4d659ba6000000000000000000000000e445fb0297f7d1f507df708185946210eb6a9de60000000000000000000000003c7e48216c74d7818ab1fd226e56c60c4d659ba6000000000000000000000000b4b57125af2acf9bf605a9d9c3d256537876f65a00000000000000000000000000000000000000000000000000000000058fd40000000000000000000000000065dcc24f8ff9e51f10dcc7ed1e4e2a61e6e14bd666756e2d657468657265756d2d6d61696e6e65742d3100000000000000000000000000000000000000000000000000000000000000000000000000000000001e00000000000000000000000000000000000000000000000000000000000493e000000000000000000000000000000000000000000000000000000000000001c00000000000000000000000000000000000000000000000000000000000000036697066733a2f2f516d515172537862504134596a6164584d446f31443769716475576538763133777852454657334c7136656a7a352f0000000000000000000000000000000000000000000000000000000000000000000000000000000000e9636f6e737420726573706f6e7365203d2061776169742046756e6374696f6e732e6d616b654874747052657175657374287b75726c3a2768747470733a2f2f61736964652e646973747269627574656467616c6c6572792e6172742f6170692f616973656e74696d656e74272c206d6574686f643a27474554277d293b69662028726573706f6e73652e6572726f7229207b7468726f77204572726f72282752657175657374206661696c656427293b7d72657475726e2046756e6374696f6e732e656e636f646555696e7432353628726573706f6e73652e646174612e73656e74696d656e74293b0000000000000000000000000000000000000000000000

Deployed Bytecode

0x608060405234801561001057600080fd5b50600436106102a05760003560e01c806370a0823111610167578063b88d4fde116100ce578063e985e9c511610087578063e985e9c514610640578063ea7b4f7714610653578063f82cd01714610666578063f887ea4014610679578063fb9b18361461069f578063fc2a88c3146106aa57600080fd5b8063b88d4fde146105d0578063c87b56dd146105e3578063d5391393146105f6578063d547741f1461061d578063dbddb26a14610630578063e7dee4181461063857600080fd5b806391d148541161012057806391d148541461057457806395d89b411461058757806399d254551461058f578063a217fddf146105a2578063a22cb465146105aa578063a4eb718c146105bd57600080fd5b806370a082311461051857806372abc8b71461052b57806378ca5de71461053e5780637c88e3d914610551578063880387c9146105645780638dbe7b9d1461056c57600080fd5b806336568abe1161020b57806347e63380116101c457806347e63380146104755780634cf4b61f1461049c5780635d36598f146104c35780636352211e146104d65780636506466b146104e957806367e828bf1461051057600080fd5b806336568abe146103e757806337e05331146103fa57806340c10f191461041557806342842e0e1461042857806342966c681461043b57806344148a921461044e57600080fd5b80630bd765db1161025d5780630bd765db146103455780630ca761751461035857806323b872dd1461036b578063248a9ca31461037e57806324f74697146103af5780632f2ff15d146103d457600080fd5b806301ffc9a7146102a557806306fdde03146102cd578063081812fc146102e25780630837d1cd1461030d578063095ea7b31461031557806309c1ba2e1461032a575b600080fd5b6102b86102b3366004612486565b6106b2565b60405190151581526020015b60405180910390f35b6102d56106c3565b6040516102c491906124f3565b6102f56102f0366004612506565b610755565b6040516001600160a01b0390911681526020016102c4565b6102b861077e565b61032861032336600461253b565b61078d565b005b600b546040516001600160401b0390911681526020016102c4565b6103286103533660046125b0565b61079c565b6103286103663660046126a6565b61090c565b610328610379366004612712565b610990565b6103a161038c366004612506565b60009081526006602052604090206001015490565b6040519081526020016102c4565b600b54600160401b900463ffffffff1660405163ffffffff90911681526020016102c4565b6103286103e236600461274e565b610a20565b6103286103f536600461274e565b610a45565b600e54600f54604080519283526020830191909152016102c4565b61032861042336600461253b565b610a7d565b610328610436366004612712565b610ab1565b610328610449366004612506565b610acc565b6103a17f000000000000000000000000000000000000000000000000000000006bdef5bb81565b6103a17f73e573f9566d61418a34d5de3ff49360f9c51fec37f7486551670290f6285dab81565b6102f57f000000000000000000000000b4b57125af2acf9bf605a9d9c3d256537876f65a81565b6103286104d13660046125b0565b610ad8565b6102f56104e4366004612506565b610b49565b6103a17f000000000000000000000000000000000000000000000000000000000000006481565b6102d5610b54565b6103a161052636600461277a565b610b63565b6102b8610539366004612506565b610bab565b61032861054c366004612506565b610bc0565b61032861055f366004612827565b610bd4565b6103a1600a81565b600a546103a1565b6102b861058236600461274e565b610c70565b6102d5610c9b565b61032861059d3660046128e6565b610caa565b6103a1600081565b6103286105b836600461291a565b610cbe565b6103286105cb366004612956565b610cc9565b6103286105de36600461297c565b610cdd565b6102d56105f1366004612506565b610cf4565b6103a17f9f2df0fed2c77648de5860a4cc508cd0818c85b8b8a1ab4ceeef8d981c8956a681565b61032861062b36600461274e565b610d5c565b6102d5610d81565b610328610e0f565b6102b861064e3660046129e3565b610e53565b610328610661366004612a0d565b610e81565b6103a1610674366004612506565b610e95565b7f00000000000000000000000065dcc24f8ff9e51f10dcc7ed1e4e2a61e6e14bd66102f5565b60085460ff166102b8565b600d546103a1565b60006106bd82610eaa565b92915050565b6060600080546106d290612a36565b80601f01602080910402602001604051908101604052809291908181526020018280546106fe90612a36565b801561074b5780601f106107205761010080835404028352916020019161074b565b820191906000526020600020905b81548152906001019060200180831161072e57829003601f168201915b5050505050905090565b600061076082610ecf565b506000828152600460205260409020546001600160a01b03166106bd565b6000610788610f08565b905090565b610798828233610f3e565b5050565b7f73e573f9566d61418a34d5de3ff49360f9c51fec37f7486551670290f6285dab6107c681610f4b565b6108076040805160e0810190915280600081526020016000815260200160008152602001606081526020016060815260200160608152602001606081525090565b6108a4600c805461081790612a36565b80601f016020809104026020016040519081016040528092919081815260200182805461084390612a36565b80156108905780601f1061086557610100808354040283529160200191610890565b820191906000526020600020905b81548152906001019060200180831161087357829003601f168201915b505050505082610f5890919063ffffffff16565b82156108be576108be6108b78486612a70565b8290610f65565b60006108f06108cc83610f8f565b600b54600a546001600160401b03821691600160401b900463ffffffff1690611257565b600d8190559050610905816107988688612a70565b5050505050565b336001600160a01b037f00000000000000000000000065dcc24f8ff9e51f10dcc7ed1e4e2a61e6e14bd616146109555760405163c6829f8360e01b815260040160405180910390fd5b610960838383611329565b60405183907f85e1543bf2f84fe80c6badbce3648c8539ad1df4d2b3d822938ca0538be727e690600090a2505050565b6001600160a01b0382166109bf57604051633250574960e11b8152600060048201526024015b60405180910390fd5b60006109cc83833361138b565b9050836001600160a01b0316816001600160a01b031614610a1a576040516364283d7b60e01b81526001600160a01b03808616600483015260248201849052821660448201526064016109b6565b50505050565b600082815260066020526040902060010154610a3b81610f4b565b610a1a8383611459565b6001600160a01b0381163314610a6e5760405163334bd91960e11b815260040160405180910390fd5b610a7882826114ed565b505050565b7f9f2df0fed2c77648de5860a4cc508cd0818c85b8b8a1ab4ceeef8d981c8956a6610aa781610f4b565b610a78838361155a565b610a7883838360405180602001604052806000815250610cdd565b6107986000823361138b565b610b1482828080602002602001604051908101604052809392919081815260200183836020028082843760009201919091525061156e92505050565b8060005b81811015610a1a57610b41848483818110610b3557610b35612ae3565b90506020020135611629565b600101610b18565b60006106bd82610ecf565b6060600c80546106d290612a36565b60006001600160a01b038216610b8f576040516322718ad960e21b8152600060048201526024016109b6565b506001600160a01b031660009081526003602052604090205490565b6000610bb682610ecf565b506106bd8261166c565b6000610bcb81610f4b565b6107988261168c565b7f9f2df0fed2c77648de5860a4cc508cd0818c85b8b8a1ab4ceeef8d981c8956a6610bfe81610f4b565b825182518114610c2157604051636b07401f60e01b815260040160405180910390fd5b60005b8181101561090557610c68858281518110610c4157610c41612ae3565b6020026020010151858381518110610c5b57610c5b612ae3565b602002602001015161155a565b600101610c24565b60009182526006602090815260408084206001600160a01b0393909316845291905290205460ff1690565b6060600180546106d290612a36565b6000610cb581610f4b565b610798826116af565b6107983383836116dd565b6000610cd481610f4b565b6107988261177c565b610ce8848484610990565b610a1a848484846117cb565b6060610cff82610ecf565b506000610d0a6118ed565b90506000815111610d2a5760405180602001604052806000815250610d55565b80610d34846118fc565b604051602001610d45929190612af9565b6040516020818303038152906040525b9392505050565b600082815260066020526040902060010154610d7781610f4b565b610a1a83836114ed565b60078054610d8e90612a36565b80601f0160208091040260200160405190810160405280929190818152602001828054610dba90612a36565b8015610e075780601f10610ddc57610100808354040283529160200191610e07565b820191906000526020600020905b815481529060010190602001808311610dea57829003601f168201915b505050505081565b6000610e1a81610f4b565b6008805460ff191660011790556040517fc530b67f06e79967fafaa0f1af1af798443e42526f8a0ff054bd2bd075198cf490600090a150565b6001600160a01b03918216600090815260056020908152604080832093909416825291909152205460ff1690565b6000610e8c81610f4b565b6107988261198e565b6000610ea082610ecf565b506106bd826119d8565b60006001600160e01b03198216637965db0b60e01b14806106bd57506106bd826119ef565b6000818152600260205260408120546001600160a01b0316806106bd57604051637e27328960e01b8152600481018490526024016109b6565b60007f000000000000000000000000000000000000000000000000000000006bdef5bb4210158061078857505060085460ff1690565b610a788383836001611a3f565b610f558133611b45565b50565b6107988260008084611b7e565b8051600003610f875760405163fe936cb760e01b815260040160405180910390fd5b60a090910152565b60606000610f9e610100611bfc565b9050610fd76040518060400160405280600c81526020016b31b7b232a637b1b0ba34b7b760a11b81525082611c1d90919063ffffffff16565b8251610ff5906002811115610fee57610fee612b28565b8290611c36565b6040805180820190915260088152676c616e677561676560c01b602082015261101f908290611c1d565b6040830151611036908015610fee57610fee612b28565b604080518082019091526006815265736f7572636560d01b602082015261105e908290611c1d565b606083015161106e908290611c1d565b60a083015151156110fa576040805180820190915260048152636172677360e01b602082015261109f908290611c1d565b6110a881611c6f565b60005b8360a00151518110156110f0576110e88460a0015182815181106110d1576110d1612ae3565b602002602001015183611c1d90919063ffffffff16565b6001016110ab565b506110fa81611c93565b608083015151156111be5760008360200151600281111561111d5761111d612b28565b0361113b5760405163a80d31f760e01b815260040160405180910390fd5b60408051808201909152600f81526e39b2b1b932ba39a637b1b0ba34b7b760891b602082015261116c908290611c1d565b61118583602001516002811115610fee57610fee612b28565b6040805180820190915260078152667365637265747360c81b60208201526111ae908290611c1d565b60808301516111be908290611cb1565b60c0830151511561124f5760408051808201909152600981526862797465734172677360b81b60208201526111f4908290611c1d565b6111fd81611c6f565b60005b8360c00151518110156112455761123d8460c00151828151811061122657611226612ae3565b602002602001015183611cb190919063ffffffff16565b600101611200565b5061124f81611c93565b515192915050565b6000807f00000000000000000000000065dcc24f8ff9e51f10dcc7ed1e4e2a61e6e14bd66001600160a01b031663461d27628688600188886040518663ffffffff1660e01b81526004016112af959493929190612b3e565b6020604051808303816000875af11580156112ce573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906112f29190612b87565b60405190915081907f1131472297a800fee664d1d89cfa8f7676ff07189ecc53f80bbb5f4969099db890600090a295945050505050565b82600d54811461134f5760405163a48032d560e01b8152600481018290526024016109b6565b8180516000146113745780604051639d75e4a760e01b81526004016109b691906124f3565b61137d84612ba0565b600e55505042600f55505050565b6000828152600260205260408120546001600160a01b03166113ac8461166c565b1580156113c157506001600160a01b03811615155b80156113ff57507f000000000000000000000000b4b57125af2acf9bf605a9d9c3d256537876f65a6001600160a01b0316816001600160a01b031614155b1561142057604051634432ba5960e11b8152600481018590526024016109b6565b6001600160a01b038516611445576000848152600960205260409020805460ff191690555b611450858585611cbe565b95945050505050565b60006114658383610c70565b6114e55760008381526006602090815260408083206001600160a01b03861684529091529020805460ff1916600117905561149d3390565b6001600160a01b0316826001600160a01b0316847f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a45060016106bd565b5060006106bd565b60006114f98383610c70565b156114e55760008381526006602090815260408083206001600160a01b0386168085529252808320805460ff1916905551339286917ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b9190a45060016106bd565b6115648282611db7565b6107988282611dd1565b61157781611e14565b600f5461158690610e10612bda565b4211156115a65760405163ea3dde0960e01b815260040160405180910390fd5b805160005b81811015610a785760008382815181106115c7576115c7612ae3565b602002602001015190506000600e54905060006115e3836119d8565b9050808210806115fd57506115f9600a82612bda565b8210155b1561161e57604051639d22e1fb60e01b8152600481018490526024016109b6565b5050506001016115ab565b600081815260096020526040808220805460ff191660011790555182917f832a253ad4e9e88f705006a24d9957b8aa1de307a0f9d0a6ad5fd0b0ac81050591a250565b60008181526009602052604081205460ff16806106bd57506106bd610f08565b806116aa576040516391f7443960e01b815260040160405180910390fd5b600a55565b80516000036116d157604051638154374b60e01b815260040160405180910390fd5b600c6107988282612c3d565b6001600160a01b03821661170f57604051630b61174360e31b81526001600160a01b03831660048201526024016109b6565b6001600160a01b03838116600081815260056020908152604080832094871680845294825291829020805460ff191686151590811790915591519182527f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31910160405180910390a3505050565b63ffffffff81166117a05760405163fe7036d760e01b815260040160405180910390fd5b600b805463ffffffff909216600160401b026bffffffff000000000000000019909216919091179055565b6001600160a01b0383163b15610a1a57604051630a85bd0160e11b81526001600160a01b0384169063150b7a029061180d903390889087908790600401612cfc565b6020604051808303816000875af1925050508015611848575060408051601f3d908101601f1916820190925261184591810190612d39565b60015b6118b1573d808015611876576040519150601f19603f3d011682016040523d82523d6000602084013e61187b565b606091505b5080516000036118a957604051633250574960e11b81526001600160a01b03851660048201526024016109b6565b805181602001fd5b6001600160e01b03198116630a85bd0160e11b1461090557604051633250574960e11b81526001600160a01b03851660048201526024016109b6565b6060600780546106d290612a36565b6060600061190983611e4b565b60010190506000816001600160401b03811115611928576119286125f1565b6040519080825280601f01601f191660200182016040528015611952576020820181803683370190505b5090508181016020015b600019016f181899199a1a9b1b9c1cb0b131b232b360811b600a86061a8153600a850494508461195c57509392505050565b6001600160401b0381166119b557604051630ebd8d1960e11b815260040160405180910390fd5b600b805467ffffffffffffffff19166001600160401b0392909216919091179055565b60006119e5600a83612d56565b6106bd9083612d78565b60006001600160e01b031982166380ac58cd60e01b1480611a2057506001600160e01b03198216635b5e139f60e01b145b806106bd57506301ffc9a760e01b6001600160e01b03198316146106bd565b8080611a5357506001600160a01b03821615155b15611b15576000611a6384610ecf565b90506001600160a01b03831615801590611a8f5750826001600160a01b0316816001600160a01b031614155b8015611aa25750611aa08184610e53565b155b15611acb5760405163a9fbf51f60e01b81526001600160a01b03841660048201526024016109b6565b8115611b135783856001600160a01b0316826001600160a01b03167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92560405160405180910390a45b505b5050600090815260046020526040902080546001600160a01b0319166001600160a01b0392909216919091179055565b611b4f8282610c70565b6107985760405163e2517d3f60e01b81526001600160a01b0382166004820152602481018390526044016109b6565b8051600003611ba0576040516322ce3edd60e01b815260040160405180910390fd5b83836002811115611bb357611bb3612b28565b90816002811115611bc657611bc6612b28565b90525060408401828015611bdc57611bdc612b28565b90818015611bec57611bec612b28565b9052506060909301929092525050565b611c0461243b565b8051611c109083611f23565b5060006020820152919050565b611c2a8260038351611f9a565b8151610a7890826120b3565b8151611c439060c26120d4565b506107988282604051602001611c5b91815260200190565b604051602081830303815290604052611cb1565b611c7a81600461213d565b600181602001818151611c8d9190612bda565b90525050565b611c9e81600761213d565b600181602001818151611c8d9190612d78565b611c2a8260028351611f9a565b6000828152600260205260408120546001600160a01b0390811690831615611ceb57611ceb818486612154565b6001600160a01b03811615611d2957611d08600085600080611a3f565b6001600160a01b038116600090815260036020526040902080546000190190555b6001600160a01b03851615611d58576001600160a01b0385166000908152600360205260409020805460010190555b60008481526002602052604080822080546001600160a01b0319166001600160a01b0389811691821790925591518793918516917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef91a4949350505050565b6107988282604051806020016040528060008152506121b8565b7f000000000000000000000000000000000000000000000000000000000000006481106107985760405163ed15e6cf60e01b8152600481018290526024016109b6565b805160005b81811015610a7857611e43838281518110611e3657611e36612ae3565b60200260200101516121cf565b600101611e19565b60008072184f03e93ff9f4daa797ed6e38ed64bf6a1f0160401b8310611e8a5772184f03e93ff9f4daa797ed6e38ed64bf6a1f0160401b830492506040015b6d04ee2d6d415b85acef81000000008310611eb6576d04ee2d6d415b85acef8100000000830492506020015b662386f26fc100008310611ed457662386f26fc10000830492506010015b6305f5e1008310611eec576305f5e100830492506008015b6127108310611f0057612710830492506004015b60648310611f12576064830492506002015b600a83106106bd5760010192915050565b604080518082019091526060815260006020820152611f43602083612d56565b15611f6b57611f53602083612d56565b611f5e906020612d78565b611f689083612bda565b91505b602080840183905260405180855260008152908184010181811015611f8f57600080fd5b604052509192915050565b6017816001600160401b031611611fc0578251610a1a9060e0600585901b1683176120d4565b60ff816001600160401b031611612000578251611fe8906018611fe0600586901b16176120d4565b508251610a1a906001600160401b0383166001612203565b61ffff816001600160401b031611612041578251612029906019611fe0600586901b16176120d4565b508251610a1a906001600160401b0383166002612203565b63ffffffff816001600160401b03161161208457825161206c90601a611fe0600586901b16176120d4565b508251610a1a906001600160401b0383166004612203565b825161209b90601b611fe0600586901b16176120d4565b508251610a1a906001600160401b0383166008612203565b604080518082019091526060815260006020820152610d5583838451612288565b60408051808201909152606081526000602082015282515160006120f9826001612bda565b90508460200151821061211a5761211a85612115836002612d8b565b612359565b8451602083820101858153508051821115612133578181525b5093949350505050565b8151610a7890601f611fe0600585901b16176120d4565b61215f838383612370565b610a78576001600160a01b03831661218d57604051637e27328960e01b8152600481018290526024016109b6565b60405163177e802f60e01b81526001600160a01b0383166004820152602481018290526044016109b6565b6121c283836123d6565b610a7860008484846117cb565b6121d881610ecf565b506121e28161166c565b15610f555760405163149fdcdb60e11b8152600481018290526024016109b6565b60408051808201909152606081526000602082015283515160006122278285612bda565b905085602001518111156122445761224486612115836002612d8b565b6000600161225486610100612e86565b61225e9190612d78565b9050865182810187831982511617815250805183111561227c578281525b50959695505050505050565b60408051808201909152606081526000602082015282518211156122ab57600080fd5b83515160006122ba8483612bda565b905085602001518111156122d7576122d786612115836002612d8b565b8551805183820160200191600091808511156122f1578482525b505050602086015b602086106123315780518252612310602083612bda565b915061231d602082612bda565b905061232a602087612d78565b95506122f9565b51815160001960208890036101000a0190811690199190911617905250849150509392505050565b81516123658383611f23565b50610a1a83826120b3565b60006001600160a01b038316158015906123ce5750826001600160a01b0316846001600160a01b031614806123aa57506123aa8484610e53565b806123ce57506000828152600460205260409020546001600160a01b038481169116145b949350505050565b6001600160a01b03821661240057604051633250574960e11b8152600060048201526024016109b6565b600061240e8383600061138b565b90506001600160a01b03811615610a78576040516339e3563760e11b8152600060048201526024016109b6565b6040518060400160405280612463604051806040016040528060608152602001600081525090565b8152602001600081525090565b6001600160e01b031981168114610f5557600080fd5b60006020828403121561249857600080fd5b8135610d5581612470565b60005b838110156124be5781810151838201526020016124a6565b50506000910152565b600081518084526124df8160208601602086016124a3565b601f01601f19169290920160200192915050565b602081526000610d5560208301846124c7565b60006020828403121561251857600080fd5b5035919050565b80356001600160a01b038116811461253657600080fd5b919050565b6000806040838503121561254e57600080fd5b6125578361251f565b946020939093013593505050565b60008083601f84011261257757600080fd5b5081356001600160401b0381111561258e57600080fd5b6020830191508360208260051b85010111156125a957600080fd5b9250929050565b600080602083850312156125c357600080fd5b82356001600160401b038111156125d957600080fd5b6125e585828601612565565b90969095509350505050565b634e487b7160e01b600052604160045260246000fd5b604051601f8201601f191681016001600160401b038111828210171561262f5761262f6125f1565b604052919050565b600082601f83011261264857600080fd5b81356001600160401b03811115612661576126616125f1565b612674601f8201601f1916602001612607565b81815284602083860101111561268957600080fd5b816020850160208301376000918101602001919091529392505050565b6000806000606084860312156126bb57600080fd5b8335925060208401356001600160401b03808211156126d957600080fd5b6126e587838801612637565b935060408601359150808211156126fb57600080fd5b5061270886828701612637565b9150509250925092565b60008060006060848603121561272757600080fd5b6127308461251f565b925061273e6020850161251f565b9150604084013590509250925092565b6000806040838503121561276157600080fd5b823591506127716020840161251f565b90509250929050565b60006020828403121561278c57600080fd5b610d558261251f565b60006001600160401b038211156127ae576127ae6125f1565b5060051b60200190565b600082601f8301126127c957600080fd5b813560206127de6127d983612795565b612607565b8083825260208201915060208460051b87010193508684111561280057600080fd5b602086015b8481101561281c5780358352918301918301612805565b509695505050505050565b6000806040838503121561283a57600080fd5b82356001600160401b038082111561285157600080fd5b818501915085601f83011261286557600080fd5b813560206128756127d983612795565b82815260059290921b8401810191818101908984111561289457600080fd5b948201945b838610156128b9576128aa8661251f565b82529482019490820190612899565b965050860135925050808211156128cf57600080fd5b506128dc858286016127b8565b9150509250929050565b6000602082840312156128f857600080fd5b81356001600160401b0381111561290e57600080fd5b6123ce84828501612637565b6000806040838503121561292d57600080fd5b6129368361251f565b91506020830135801515811461294b57600080fd5b809150509250929050565b60006020828403121561296857600080fd5b813563ffffffff81168114610d5557600080fd5b6000806000806080858703121561299257600080fd5b61299b8561251f565b93506129a96020860161251f565b92506040850135915060608501356001600160401b038111156129cb57600080fd5b6129d787828801612637565b91505092959194509250565b600080604083850312156129f657600080fd5b6129ff8361251f565b91506127716020840161251f565b600060208284031215612a1f57600080fd5b81356001600160401b0381168114610d5557600080fd5b600181811c90821680612a4a57607f821691505b602082108103612a6a57634e487b7160e01b600052602260045260246000fd5b50919050565b6000612a7e6127d984612795565b80848252602080830192508560051b850136811115612a9c57600080fd5b855b81811015612ad75780356001600160401b03811115612abd5760008081fd5b612ac936828a01612637565b865250938201938201612a9e565b50919695505050505050565b634e487b7160e01b600052603260045260246000fd5b60008351612b0b8184602088016124a3565b835190830190612b1f8183602088016124a3565b01949350505050565b634e487b7160e01b600052602160045260246000fd5b6001600160401b038616815260a060208201526000612b6060a08301876124c7565b61ffff9590951660408301525063ffffffff92909216606083015260809091015292915050565b600060208284031215612b9957600080fd5b5051919050565b80516020808301519190811015612a6a5760001960209190910360031b1b16919050565b634e487b7160e01b600052601160045260246000fd5b808201808211156106bd576106bd612bc4565b601f821115610a78576000816000526020600020601f850160051c81016020861015612c165750805b601f850160051c820191505b81811015612c3557828155600101612c22565b505050505050565b81516001600160401b03811115612c5657612c566125f1565b612c6a81612c648454612a36565b84612bed565b602080601f831160018114612c9f5760008415612c875750858301515b600019600386901b1c1916600185901b178555612c35565b600085815260208120601f198616915b82811015612cce57888601518255948401946001909101908401612caf565b5085821015612cec5787850151600019600388901b60f8161c191681555b5050505050600190811b01905550565b6001600160a01b0385811682528416602082015260408101839052608060608201819052600090612d2f908301846124c7565b9695505050505050565b600060208284031215612d4b57600080fd5b8151610d5581612470565b600082612d7357634e487b7160e01b600052601260045260246000fd5b500690565b818103818111156106bd576106bd612bc4565b80820281158282048414176106bd576106bd612bc4565b600181815b80851115612ddd578160001904821115612dc357612dc3612bc4565b80851615612dd057918102915b93841c9390800290612da7565b509250929050565b600082612df4575060016106bd565b81612e01575060006106bd565b8160018114612e175760028114612e2157612e3d565b60019150506106bd565b60ff841115612e3257612e32612bc4565b50506001821b6106bd565b5060208310610133831016604e8410600b8410161715612e60575081810a6106bd565b612e6a8383612da2565b8060001904821115612e7e57612e7e612bc4565b029392505050565b6000610d558383612de556fea26469706673582212201323d53f9262cb38cf0ab9402f317910a170c8fe7bad2c4136c350fec7181cbe64736f6c63430008190033

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

00000000000000000000000000000000000000000000000000000000000001600000000000000000000000003c7e48216c74d7818ab1fd226e56c60c4d659ba6000000000000000000000000e445fb0297f7d1f507df708185946210eb6a9de60000000000000000000000003c7e48216c74d7818ab1fd226e56c60c4d659ba6000000000000000000000000b4b57125af2acf9bf605a9d9c3d256537876f65a00000000000000000000000000000000000000000000000000000000058fd40000000000000000000000000065dcc24f8ff9e51f10dcc7ed1e4e2a61e6e14bd666756e2d657468657265756d2d6d61696e6e65742d3100000000000000000000000000000000000000000000000000000000000000000000000000000000001e00000000000000000000000000000000000000000000000000000000000493e000000000000000000000000000000000000000000000000000000000000001c00000000000000000000000000000000000000000000000000000000000000036697066733a2f2f516d515172537862504134596a6164584d446f31443769716475576538763133777852454657334c7136656a7a352f0000000000000000000000000000000000000000000000000000000000000000000000000000000000e9636f6e737420726573706f6e7365203d2061776169742046756e6374696f6e732e6d616b654874747052657175657374287b75726c3a2768747470733a2f2f61736964652e646973747269627574656467616c6c6572792e6172742f6170692f616973656e74696d656e74272c206d6574686f643a27474554277d293b69662028726573706f6e73652e6572726f7229207b7468726f77204572726f72282752657175657374206661696c656427293b7d72657475726e2046756e6374696f6e732e656e636f646555696e7432353628726573706f6e73652e646174612e73656e74696d656e74293b0000000000000000000000000000000000000000000000

-----Decoded View---------------
Arg [0] : baseURI_ (string): ipfs://QmQQrSxbPA4YjadXMDo1D7iqduWe8v13wxREFW3Lq6ejz5/
Arg [1] : admin_ (address): 0x3c7e48216C74D7818aB1Fd226e56C60C4D659bA6
Arg [2] : minter_ (address): 0xe445Fb0297F7D1f507dF708185946210eB6a9DE6
Arg [3] : updater_ (address): 0x3c7e48216C74D7818aB1Fd226e56C60C4D659bA6
Arg [4] : verse_ (address): 0xB4B57125AF2aCf9Bf605A9D9C3D256537876f65A
Arg [5] : timelock_ (uint256): 93312000
Arg [6] : router_ (address): 0x65Dcc24F8ff9e51F10DCc7Ed1e4e2A61e6E14bd6
Arg [7] : donId_ (bytes32): 0x66756e2d657468657265756d2d6d61696e6e65742d3100000000000000000000
Arg [8] : subscriptionId_ (uint64): 30
Arg [9] : callbackGasLimit_ (uint32): 300000
Arg [10] : source_ (string): const response = await Functions.makeHttpRequest({url:'https://aside.distributedgallery.art/api/aisentiment', method:'GET'});if (response.error) {throw Error('Request failed');}return Functions.encodeUint256(response.data.sentiment);

-----Encoded View---------------
23 Constructor Arguments found :
Arg [0] : 0000000000000000000000000000000000000000000000000000000000000160
Arg [1] : 0000000000000000000000003c7e48216c74d7818ab1fd226e56c60c4d659ba6
Arg [2] : 000000000000000000000000e445fb0297f7d1f507df708185946210eb6a9de6
Arg [3] : 0000000000000000000000003c7e48216c74d7818ab1fd226e56c60c4d659ba6
Arg [4] : 000000000000000000000000b4b57125af2acf9bf605a9d9c3d256537876f65a
Arg [5] : 00000000000000000000000000000000000000000000000000000000058fd400
Arg [6] : 00000000000000000000000065dcc24f8ff9e51f10dcc7ed1e4e2a61e6e14bd6
Arg [7] : 66756e2d657468657265756d2d6d61696e6e65742d3100000000000000000000
Arg [8] : 000000000000000000000000000000000000000000000000000000000000001e
Arg [9] : 00000000000000000000000000000000000000000000000000000000000493e0
Arg [10] : 00000000000000000000000000000000000000000000000000000000000001c0
Arg [11] : 0000000000000000000000000000000000000000000000000000000000000036
Arg [12] : 697066733a2f2f516d515172537862504134596a6164584d446f314437697164
Arg [13] : 75576538763133777852454657334c7136656a7a352f00000000000000000000
Arg [14] : 00000000000000000000000000000000000000000000000000000000000000e9
Arg [15] : 636f6e737420726573706f6e7365203d2061776169742046756e6374696f6e73
Arg [16] : 2e6d616b654874747052657175657374287b75726c3a2768747470733a2f2f61
Arg [17] : 736964652e646973747269627574656467616c6c6572792e6172742f6170692f
Arg [18] : 616973656e74696d656e74272c206d6574686f643a27474554277d293b696620
Arg [19] : 28726573706f6e73652e6572726f7229207b7468726f77204572726f72282752
Arg [20] : 657175657374206661696c656427293b7d72657475726e2046756e6374696f6e
Arg [21] : 732e656e636f646555696e7432353628726573706f6e73652e646174612e7365
Arg [22] : 6e74696d656e74293b0000000000000000000000000000000000000000000000


Loading...
Loading
Loading...
Loading
[ Download: CSV Export  ]
[ Download: CSV Export  ]

A token is a representation of an on-chain or off-chain asset. The token page shows information such as price, total supply, holders, transfers and social links. Learn more about this page in our Knowledge Base.