Skip to content

Instantly share code, notes, and snippets.

@jtakalai
Created May 31, 2024 09:27
Show Gist options
  • Save jtakalai/44012fd56bf5a29b5975778b25a745e2 to your computer and use it in GitHub Desktop.
Save jtakalai/44012fd56bf5a29b5975778b25a745e2 to your computer and use it in GitHub Desktop.
Standard-JSON-Input of StreamRegistryV5
This file has been truncated, but you can view the full file.
{"id":"6e5117e7810cf9123b9fe6ad3edf861c","_format":"hh-sol-build-info-1","solcVersion":"0.8.9","solcLongVersion":"0.8.9+commit.e5eed63a","input":{"language":"Solidity","sources":{"@chainlink/contracts/src/v0.8/Chainlink.sol":{"content":"// SPDX-License-Identifier: MIT\npragma solidity ^0.8.0;\n\nimport {CBORChainlink} from \"./vendor/CBORChainlink.sol\";\nimport {BufferChainlink} from \"./vendor/BufferChainlink.sol\";\n\n/**\n * @title Library for common Chainlink functions\n * @dev Uses imported CBOR library for encoding to buffer\n */\nlibrary Chainlink {\n uint256 internal constant defaultBufferSize = 256; // solhint-disable-line const-name-snakecase\n\n using CBORChainlink for BufferChainlink.buffer;\n\n struct Request {\n bytes32 id;\n address callbackAddress;\n bytes4 callbackFunctionId;\n uint256 nonce;\n BufferChainlink.buffer buf;\n }\n\n /**\n * @notice Initializes a Chainlink request\n * @dev Sets the ID, callback address, and callback function signature on the request\n * @param self The uninitialized request\n * @param jobId The Job Specification ID\n * @param callbackAddr The callback address\n * @param callbackFunc The callback function signature\n * @return The initialized request\n */\n function initialize(\n Request memory self,\n bytes32 jobId,\n address callbackAddr,\n bytes4 callbackFunc\n ) internal pure returns (Chainlink.Request memory) {\n BufferChainlink.init(self.buf, defaultBufferSize);\n self.id = jobId;\n self.callbackAddress = callbackAddr;\n self.callbackFunctionId = callbackFunc;\n return self;\n }\n\n /**\n * @notice Sets the data for the buffer without encoding CBOR on-chain\n * @dev CBOR can be closed with curly-brackets {} or they can be left off\n * @param self The initialized request\n * @param data The CBOR data\n */\n function setBuffer(Request memory self, bytes memory data) internal pure {\n BufferChainlink.init(self.buf, data.length);\n BufferChainlink.append(self.buf, data);\n }\n\n /**\n * @notice Adds a string value to the request with a given key name\n * @param self The initialized request\n * @param key The name of the key\n * @param value The string value to add\n */\n function add(\n Request memory self,\n string memory key,\n string memory value\n ) internal pure {\n self.buf.encodeString(key);\n self.buf.encodeString(value);\n }\n\n /**\n * @notice Adds a bytes value to the request with a given key name\n * @param self The initialized request\n * @param key The name of the key\n * @param value The bytes value to add\n */\n function addBytes(\n Request memory self,\n string memory key,\n bytes memory value\n ) internal pure {\n self.buf.encodeString(key);\n self.buf.encodeBytes(value);\n }\n\n /**\n * @notice Adds a int256 value to the request with a given key name\n * @param self The initialized request\n * @param key The name of the key\n * @param value The int256 value to add\n */\n function addInt(\n Request memory self,\n string memory key,\n int256 value\n ) internal pure {\n self.buf.encodeString(key);\n self.buf.encodeInt(value);\n }\n\n /**\n * @notice Adds a uint256 value to the request with a given key name\n * @param self The initialized request\n * @param key The name of the key\n * @param value The uint256 value to add\n */\n function addUint(\n Request memory self,\n string memory key,\n uint256 value\n ) internal pure {\n self.buf.encodeString(key);\n self.buf.encodeUInt(value);\n }\n\n /**\n * @notice Adds an array of strings to the request with a given key name\n * @param self The initialized request\n * @param key The name of the key\n * @param values The array of string values to add\n */\n function addStringArray(\n Request memory self,\n string memory key,\n string[] memory values\n ) internal pure {\n self.buf.encodeString(key);\n self.buf.startArray();\n for (uint256 i = 0; i < values.length; i++) {\n self.buf.encodeString(values[i]);\n }\n self.buf.endSequence();\n }\n}\n"},"@chainlink/contracts/src/v0.8/ChainlinkClient.sol":{"content":"// SPDX-License-Identifier: MIT\npragma solidity ^0.8.0;\n\nimport \"./Chainlink.sol\";\nimport \"./interfaces/ENSInterface.sol\";\nimport \"./interfaces/LinkTokenInterface.sol\";\nimport \"./interfaces/ChainlinkRequestInterface.sol\";\nimport \"./interfaces/OperatorInterface.sol\";\nimport \"./interfaces/PointerInterface.sol\";\nimport {ENSResolver as ENSResolver_Chainlink} from \"./vendor/ENSResolver.sol\";\n\n/**\n * @title The ChainlinkClient contract\n * @notice Contract writers can inherit this contract in order to create requests for the\n * Chainlink network\n */\nabstract contract ChainlinkClient {\n using Chainlink for Chainlink.Request;\n\n uint256 internal constant LINK_DIVISIBILITY = 10**18;\n uint256 private constant AMOUNT_OVERRIDE = 0;\n address private constant SENDER_OVERRIDE = address(0);\n uint256 private constant ORACLE_ARGS_VERSION = 1;\n uint256 private constant OPERATOR_ARGS_VERSION = 2;\n bytes32 private constant ENS_TOKEN_SUBNAME = keccak256(\"link\");\n bytes32 private constant ENS_ORACLE_SUBNAME = keccak256(\"oracle\");\n address private constant LINK_TOKEN_POINTER = 0xC89bD4E1632D3A43CB03AAAd5262cbe4038Bc571;\n\n ENSInterface private s_ens;\n bytes32 private s_ensNode;\n LinkTokenInterface private s_link;\n OperatorInterface private s_oracle;\n uint256 private s_requestCount = 1;\n mapping(bytes32 => address) private s_pendingRequests;\n\n event ChainlinkRequested(bytes32 indexed id);\n event ChainlinkFulfilled(bytes32 indexed id);\n event ChainlinkCancelled(bytes32 indexed id);\n\n /**\n * @notice Creates a request that can hold additional parameters\n * @param specId The Job Specification ID that the request will be created for\n * @param callbackAddr address to operate the callback on\n * @param callbackFunctionSignature function signature to use for the callback\n * @return A Chainlink Request struct in memory\n */\n function buildChainlinkRequest(\n bytes32 specId,\n address callbackAddr,\n bytes4 callbackFunctionSignature\n ) internal pure returns (Chainlink.Request memory) {\n Chainlink.Request memory req;\n return req.initialize(specId, callbackAddr, callbackFunctionSignature);\n }\n\n /**\n * @notice Creates a request that can hold additional parameters\n * @param specId The Job Specification ID that the request will be created for\n * @param callbackFunctionSignature function signature to use for the callback\n * @return A Chainlink Request struct in memory\n */\n function buildOperatorRequest(bytes32 specId, bytes4 callbackFunctionSignature)\n internal\n view\n returns (Chainlink.Request memory)\n {\n Chainlink.Request memory req;\n return req.initialize(specId, address(this), callbackFunctionSignature);\n }\n\n /**\n * @notice Creates a Chainlink request to the stored oracle address\n * @dev Calls `chainlinkRequestTo` with the stored oracle address\n * @param req The initialized Chainlink Request\n * @param payment The amount of LINK to send for the request\n * @return requestId The request ID\n */\n function sendChainlinkRequest(Chainlink.Request memory req, uint256 payment) internal returns (bytes32) {\n return sendChainlinkRequestTo(address(s_oracle), req, payment);\n }\n\n /**\n * @notice Creates a Chainlink request to the specified oracle address\n * @dev Generates and stores a request ID, increments the local nonce, and uses `transferAndCall` to\n * send LINK which creates a request on the target oracle contract.\n * Emits ChainlinkRequested event.\n * @param oracleAddress The address of the oracle for the request\n * @param req The initialized Chainlink Request\n * @param payment The amount of LINK to send for the request\n * @return requestId The request ID\n */\n function sendChainlinkRequestTo(\n address oracleAddress,\n Chainlink.Request memory req,\n uint256 payment\n ) internal returns (bytes32 requestId) {\n uint256 nonce = s_requestCount;\n s_requestCount = nonce + 1;\n bytes memory encodedRequest = abi.encodeWithSelector(\n ChainlinkRequestInterface.oracleRequest.selector,\n SENDER_OVERRIDE, // Sender value - overridden by onTokenTransfer by the requesting contract's address\n AMOUNT_OVERRIDE, // Amount value - overridden by onTokenTransfer by the actual amount of LINK sent\n req.id,\n address(this),\n req.callbackFunctionId,\n nonce,\n ORACLE_ARGS_VERSION,\n req.buf.buf\n );\n return _rawRequest(oracleAddress, nonce, payment, encodedRequest);\n }\n\n /**\n * @notice Creates a Chainlink request to the stored oracle address\n * @dev This function supports multi-word response\n * @dev Calls `sendOperatorRequestTo` with the stored oracle address\n * @param req The initialized Chainlink Request\n * @param payment The amount of LINK to send for the request\n * @return requestId The request ID\n */\n function sendOperatorRequest(Chainlink.Request memory req, uint256 payment) internal returns (bytes32) {\n return sendOperatorRequestTo(address(s_oracle), req, payment);\n }\n\n /**\n * @notice Creates a Chainlink request to the specified oracle address\n * @dev This function supports multi-word response\n * @dev Generates and stores a request ID, increments the local nonce, and uses `transferAndCall` to\n * send LINK which creates a request on the target oracle contract.\n * Emits ChainlinkRequested event.\n * @param oracleAddress The address of the oracle for the request\n * @param req The initialized Chainlink Request\n * @param payment The amount of LINK to send for the request\n * @return requestId The request ID\n */\n function sendOperatorRequestTo(\n address oracleAddress,\n Chainlink.Request memory req,\n uint256 payment\n ) internal returns (bytes32 requestId) {\n uint256 nonce = s_requestCount;\n s_requestCount = nonce + 1;\n bytes memory encodedRequest = abi.encodeWithSelector(\n OperatorInterface.operatorRequest.selector,\n SENDER_OVERRIDE, // Sender value - overridden by onTokenTransfer by the requesting contract's address\n AMOUNT_OVERRIDE, // Amount value - overridden by onTokenTransfer by the actual amount of LINK sent\n req.id,\n req.callbackFunctionId,\n nonce,\n OPERATOR_ARGS_VERSION,\n req.buf.buf\n );\n return _rawRequest(oracleAddress, nonce, payment, encodedRequest);\n }\n\n /**\n * @notice Make a request to an oracle\n * @param oracleAddress The address of the oracle for the request\n * @param nonce used to generate the request ID\n * @param payment The amount of LINK to send for the request\n * @param encodedRequest data encoded for request type specific format\n * @return requestId The request ID\n */\n function _rawRequest(\n address oracleAddress,\n uint256 nonce,\n uint256 payment,\n bytes memory encodedRequest\n ) private returns (bytes32 requestId) {\n requestId = keccak256(abi.encodePacked(this, nonce));\n s_pendingRequests[requestId] = oracleAddress;\n emit ChainlinkRequested(requestId);\n require(s_link.transferAndCall(oracleAddress, payment, encodedRequest), \"unable to transferAndCall to oracle\");\n }\n\n /**\n * @notice Allows a request to be cancelled if it has not been fulfilled\n * @dev Requires keeping track of the expiration value emitted from the oracle contract.\n * Deletes the request from the `pendingRequests` mapping.\n * Emits ChainlinkCancelled event.\n * @param requestId The request ID\n * @param payment The amount of LINK sent for the request\n * @param callbackFunc The callback function specified for the request\n * @param expiration The time of the expiration for the request\n */\n function cancelChainlinkRequest(\n bytes32 requestId,\n uint256 payment,\n bytes4 callbackFunc,\n uint256 expiration\n ) internal {\n OperatorInterface requested = OperatorInterface(s_pendingRequests[requestId]);\n delete s_pendingRequests[requestId];\n emit ChainlinkCancelled(requestId);\n requested.cancelOracleRequest(requestId, payment, callbackFunc, expiration);\n }\n\n /**\n * @notice the next request count to be used in generating a nonce\n * @dev starts at 1 in order to ensure consistent gas cost\n * @return returns the next request count to be used in a nonce\n */\n function getNextRequestCount() internal view returns (uint256) {\n return s_requestCount;\n }\n\n /**\n * @notice Sets the stored oracle address\n * @param oracleAddress The address of the oracle contract\n */\n function setChainlinkOracle(address oracleAddress) internal {\n s_oracle = OperatorInterface(oracleAddress);\n }\n\n /**\n * @notice Sets the LINK token address\n * @param linkAddress The address of the LINK token contract\n */\n function setChainlinkToken(address linkAddress) internal {\n s_link = LinkTokenInterface(linkAddress);\n }\n\n /**\n * @notice Sets the Chainlink token address for the public\n * network as given by the Pointer contract\n */\n function setPublicChainlinkToken() internal {\n setChainlinkToken(PointerInterface(LINK_TOKEN_POINTER).getAddress());\n }\n\n /**\n * @notice Retrieves the stored address of the LINK token\n * @return The address of the LINK token\n */\n function chainlinkTokenAddress() internal view returns (address) {\n return address(s_link);\n }\n\n /**\n * @notice Retrieves the stored address of the oracle contract\n * @return The address of the oracle contract\n */\n function chainlinkOracleAddress() internal view returns (address) {\n return address(s_oracle);\n }\n\n /**\n * @notice Allows for a request which was created on another contract to be fulfilled\n * on this contract\n * @param oracleAddress The address of the oracle contract that will fulfill the request\n * @param requestId The request ID used for the response\n */\n function addChainlinkExternalRequest(address oracleAddress, bytes32 requestId) internal notPendingRequest(requestId) {\n s_pendingRequests[requestId] = oracleAddress;\n }\n\n /**\n * @notice Sets the stored oracle and LINK token contracts with the addresses resolved by ENS\n * @dev Accounts for subnodes having different resolvers\n * @param ensAddress The address of the ENS contract\n * @param node The ENS node hash\n */\n function useChainlinkWithENS(address ensAddress, bytes32 node) internal {\n s_ens = ENSInterface(ensAddress);\n s_ensNode = node;\n bytes32 linkSubnode = keccak256(abi.encodePacked(s_ensNode, ENS_TOKEN_SUBNAME));\n ENSResolver_Chainlink resolver = ENSResolver_Chainlink(s_ens.resolver(linkSubnode));\n setChainlinkToken(resolver.addr(linkSubnode));\n updateChainlinkOracleWithENS();\n }\n\n /**\n * @notice Sets the stored oracle contract with the address resolved by ENS\n * @dev This may be called on its own as long as `useChainlinkWithENS` has been called previously\n */\n function updateChainlinkOracleWithENS() internal {\n bytes32 oracleSubnode = keccak256(abi.encodePacked(s_ensNode, ENS_ORACLE_SUBNAME));\n ENSResolver_Chainlink resolver = ENSResolver_Chainlink(s_ens.resolver(oracleSubnode));\n setChainlinkOracle(resolver.addr(oracleSubnode));\n }\n\n /**\n * @notice Ensures that the fulfillment is valid for this contract\n * @dev Use if the contract developer prefers methods instead of modifiers for validation\n * @param requestId The request ID for fulfillment\n */\n function validateChainlinkCallback(bytes32 requestId)\n internal\n recordChainlinkFulfillment(requestId)\n // solhint-disable-next-line no-empty-blocks\n {\n\n }\n\n /**\n * @dev Reverts if the sender is not the oracle of the request.\n * Emits ChainlinkFulfilled event.\n * @param requestId The request ID for fulfillment\n */\n modifier recordChainlinkFulfillment(bytes32 requestId) {\n require(msg.sender == s_pendingRequests[requestId], \"Source must be the oracle of the request\");\n delete s_pendingRequests[requestId];\n emit ChainlinkFulfilled(requestId);\n _;\n }\n\n /**\n * @dev Reverts if the request is already pending\n * @param requestId The request ID for fulfillment\n */\n modifier notPendingRequest(bytes32 requestId) {\n require(s_pendingRequests[requestId] == address(0), \"Request is already pending\");\n _;\n }\n}\n"},"@chainlink/contracts/src/v0.8/interfaces/ChainlinkRequestInterface.sol":{"content":"// SPDX-License-Identifier: MIT\npragma solidity ^0.8.0;\n\ninterface ChainlinkRequestInterface {\n function oracleRequest(\n address sender,\n uint256 requestPrice,\n bytes32 serviceAgreementID,\n address callbackAddress,\n bytes4 callbackFunctionId,\n uint256 nonce,\n uint256 dataVersion,\n bytes calldata data\n ) external;\n\n function cancelOracleRequest(\n bytes32 requestId,\n uint256 payment,\n bytes4 callbackFunctionId,\n uint256 expiration\n ) external;\n}\n"},"@chainlink/contracts/src/v0.8/interfaces/ENSInterface.sol":{"content":"// SPDX-License-Identifier: MIT\npragma solidity ^0.8.0;\n\ninterface ENSInterface {\n // Logged when the owner of a node assigns a new owner to a subnode.\n event NewOwner(bytes32 indexed node, bytes32 indexed label, address owner);\n\n // Logged when the owner of a node transfers ownership to a new account.\n event Transfer(bytes32 indexed node, address owner);\n\n // Logged when the resolver for a node changes.\n event NewResolver(bytes32 indexed node, address resolver);\n\n // Logged when the TTL of a node changes\n event NewTTL(bytes32 indexed node, uint64 ttl);\n\n function setSubnodeOwner(\n bytes32 node,\n bytes32 label,\n address owner\n ) external;\n\n function setResolver(bytes32 node, address resolver) external;\n\n function setOwner(bytes32 node, address owner) external;\n\n function setTTL(bytes32 node, uint64 ttl) external;\n\n function owner(bytes32 node) external view returns (address);\n\n function resolver(bytes32 node) external view returns (address);\n\n function ttl(bytes32 node) external view returns (uint64);\n}\n"},"@chainlink/contracts/src/v0.8/interfaces/LinkTokenInterface.sol":{"content":"// SPDX-License-Identifier: MIT\npragma solidity ^0.8.0;\n\ninterface LinkTokenInterface {\n function allowance(address owner, address spender) external view returns (uint256 remaining);\n\n function approve(address spender, uint256 value) external returns (bool success);\n\n function balanceOf(address owner) external view returns (uint256 balance);\n\n function decimals() external view returns (uint8 decimalPlaces);\n\n function decreaseApproval(address spender, uint256 addedValue) external returns (bool success);\n\n function increaseApproval(address spender, uint256 subtractedValue) external;\n\n function name() external view returns (string memory tokenName);\n\n function symbol() external view returns (string memory tokenSymbol);\n\n function totalSupply() external view returns (uint256 totalTokensIssued);\n\n function transfer(address to, uint256 value) external returns (bool success);\n\n function transferAndCall(\n address to,\n uint256 value,\n bytes calldata data\n ) external returns (bool success);\n\n function transferFrom(\n address from,\n address to,\n uint256 value\n ) external returns (bool success);\n}\n"},"@chainlink/contracts/src/v0.8/interfaces/OperatorInterface.sol":{"content":"// SPDX-License-Identifier: MIT\npragma solidity ^0.8.0;\n\nimport \"./OracleInterface.sol\";\nimport \"./ChainlinkRequestInterface.sol\";\n\ninterface OperatorInterface is OracleInterface, ChainlinkRequestInterface {\n function operatorRequest(\n address sender,\n uint256 payment,\n bytes32 specId,\n bytes4 callbackFunctionId,\n uint256 nonce,\n uint256 dataVersion,\n bytes calldata data\n ) external;\n\n function fulfillOracleRequest2(\n bytes32 requestId,\n uint256 payment,\n address callbackAddress,\n bytes4 callbackFunctionId,\n uint256 expiration,\n bytes calldata data\n ) external returns (bool);\n\n function ownerTransferAndCall(\n address to,\n uint256 value,\n bytes calldata data\n ) external returns (bool success);\n\n function distributeFunds(address payable[] calldata receivers, uint256[] calldata amounts) external payable;\n\n function getAuthorizedSenders() external returns (address[] memory);\n\n function setAuthorizedSenders(address[] calldata senders) external;\n\n function getForwarder() external returns (address);\n}\n"},"@chainlink/contracts/src/v0.8/interfaces/OracleInterface.sol":{"content":"// SPDX-License-Identifier: MIT\npragma solidity ^0.8.0;\n\ninterface OracleInterface {\n function fulfillOracleRequest(\n bytes32 requestId,\n uint256 payment,\n address callbackAddress,\n bytes4 callbackFunctionId,\n uint256 expiration,\n bytes32 data\n ) external returns (bool);\n\n function isAuthorizedSender(address node) external view returns (bool);\n\n function withdraw(address recipient, uint256 amount) external;\n\n function withdrawable() external view returns (uint256);\n}\n"},"@chainlink/contracts/src/v0.8/interfaces/PointerInterface.sol":{"content":"// SPDX-License-Identifier: MIT\npragma solidity ^0.8.0;\n\ninterface PointerInterface {\n function getAddress() external view returns (address);\n}\n"},"@chainlink/contracts/src/v0.8/vendor/BufferChainlink.sol":{"content":"// SPDX-License-Identifier: MIT\npragma solidity ^0.8.0;\n\n/**\n * @dev A library for working with mutable byte buffers in Solidity.\n *\n * Byte buffers are mutable and expandable, and provide a variety of primitives\n * for writing to them. At any time you can fetch a bytes object containing the\n * current contents of the buffer. The bytes object should not be stored between\n * operations, as it may change due to resizing of the buffer.\n */\nlibrary BufferChainlink {\n /**\n * @dev Represents a mutable buffer. Buffers have a current value (buf) and\n * a capacity. The capacity may be longer than the current value, in\n * which case it can be extended without the need to allocate more memory.\n */\n struct buffer {\n bytes buf;\n uint256 capacity;\n }\n\n /**\n * @dev Initializes a buffer with an initial capacity.\n * @param buf The buffer to initialize.\n * @param capacity The number of bytes of space to allocate the buffer.\n * @return The buffer, for chaining.\n */\n function init(buffer memory buf, uint256 capacity) internal pure returns (buffer memory) {\n if (capacity % 32 != 0) {\n capacity += 32 - (capacity % 32);\n }\n // Allocate space for the buffer data\n buf.capacity = capacity;\n assembly {\n let ptr := mload(0x40)\n mstore(buf, ptr)\n mstore(ptr, 0)\n mstore(0x40, add(32, add(ptr, capacity)))\n }\n return buf;\n }\n\n /**\n * @dev Initializes a new buffer from an existing bytes object.\n * Changes to the buffer may mutate the original value.\n * @param b The bytes object to initialize the buffer with.\n * @return A new buffer.\n */\n function fromBytes(bytes memory b) internal pure returns (buffer memory) {\n buffer memory buf;\n buf.buf = b;\n buf.capacity = b.length;\n return buf;\n }\n\n function resize(buffer memory buf, uint256 capacity) private pure {\n bytes memory oldbuf = buf.buf;\n init(buf, capacity);\n append(buf, oldbuf);\n }\n\n function max(uint256 a, uint256 b) private pure returns (uint256) {\n if (a > b) {\n return a;\n }\n return b;\n }\n\n /**\n * @dev Sets buffer length to 0.\n * @param buf The buffer to truncate.\n * @return The original buffer, for chaining..\n */\n function truncate(buffer memory buf) internal pure returns (buffer memory) {\n assembly {\n let bufptr := mload(buf)\n mstore(bufptr, 0)\n }\n return buf;\n }\n\n /**\n * @dev Writes a byte string to a buffer. Resizes if doing so would exceed\n * the capacity of the buffer.\n * @param buf The buffer to append to.\n * @param off The start offset to write to.\n * @param data The data to append.\n * @param len The number of bytes to copy.\n * @return The original buffer, for chaining.\n */\n function write(\n buffer memory buf,\n uint256 off,\n bytes memory data,\n uint256 len\n ) internal pure returns (buffer memory) {\n require(len <= data.length);\n\n if (off + len > buf.capacity) {\n resize(buf, max(buf.capacity, len + off) * 2);\n }\n\n uint256 dest;\n uint256 src;\n assembly {\n // Memory address of the buffer data\n let bufptr := mload(buf)\n // Length of existing buffer data\n let buflen := mload(bufptr)\n // Start address = buffer address + offset + sizeof(buffer length)\n dest := add(add(bufptr, 32), off)\n // Update buffer length if we're extending it\n if gt(add(len, off), buflen) {\n mstore(bufptr, add(len, off))\n }\n src := add(data, 32)\n }\n\n // Copy word-length chunks while possible\n for (; len >= 32; len -= 32) {\n assembly {\n mstore(dest, mload(src))\n }\n dest += 32;\n src += 32;\n }\n\n // Copy remaining bytes\n unchecked {\n uint256 mask = (256**(32 - len)) - 1;\n assembly {\n let srcpart := and(mload(src), not(mask))\n let destpart := and(mload(dest), mask)\n mstore(dest, or(destpart, srcpart))\n }\n }\n\n return buf;\n }\n\n /**\n * @dev Appends a byte string to a buffer. Resizes if doing so would exceed\n * the capacity of the buffer.\n * @param buf The buffer to append to.\n * @param data The data to append.\n * @param len The number of bytes to copy.\n * @return The original buffer, for chaining.\n */\n function append(\n buffer memory buf,\n bytes memory data,\n uint256 len\n ) internal pure returns (buffer memory) {\n return write(buf, buf.buf.length, data, len);\n }\n\n /**\n * @dev Appends a byte string to a buffer. Resizes if doing so would exceed\n * the capacity of the buffer.\n * @param buf The buffer to append to.\n * @param data The data to append.\n * @return The original buffer, for chaining.\n */\n function append(buffer memory buf, bytes memory data) internal pure returns (buffer memory) {\n return write(buf, buf.buf.length, data, data.length);\n }\n\n /**\n * @dev Writes a byte to the buffer. Resizes if doing so would exceed the\n * capacity of the buffer.\n * @param buf The buffer to append to.\n * @param off The offset to write the byte at.\n * @param data The data to append.\n * @return The original buffer, for chaining.\n */\n function writeUint8(\n buffer memory buf,\n uint256 off,\n uint8 data\n ) internal pure returns (buffer memory) {\n if (off >= buf.capacity) {\n resize(buf, buf.capacity * 2);\n }\n\n assembly {\n // Memory address of the buffer data\n let bufptr := mload(buf)\n // Length of existing buffer data\n let buflen := mload(bufptr)\n // Address = buffer address + sizeof(buffer length) + off\n let dest := add(add(bufptr, off), 32)\n mstore8(dest, data)\n // Update buffer length if we extended it\n if eq(off, buflen) {\n mstore(bufptr, add(buflen, 1))\n }\n }\n return buf;\n }\n\n /**\n * @dev Appends a byte to the buffer. Resizes if doing so would exceed the\n * capacity of the buffer.\n * @param buf The buffer to append to.\n * @param data The data to append.\n * @return The original buffer, for chaining.\n */\n function appendUint8(buffer memory buf, uint8 data) internal pure returns (buffer memory) {\n return writeUint8(buf, buf.buf.length, data);\n }\n\n /**\n * @dev Writes up to 32 bytes to the buffer. Resizes if doing so would\n * exceed the capacity of the buffer.\n * @param buf The buffer to append to.\n * @param off The offset to write at.\n * @param data The data to append.\n * @param len The number of bytes to write (left-aligned).\n * @return The original buffer, for chaining.\n */\n function write(\n buffer memory buf,\n uint256 off,\n bytes32 data,\n uint256 len\n ) private pure returns (buffer memory) {\n if (len + off > buf.capacity) {\n resize(buf, (len + off) * 2);\n }\n\n unchecked {\n uint256 mask = (256**len) - 1;\n // Right-align data\n data = data >> (8 * (32 - len));\n assembly {\n // Memory address of the buffer data\n let bufptr := mload(buf)\n // Address = buffer address + sizeof(buffer length) + off + len\n let dest := add(add(bufptr, off), len)\n mstore(dest, or(and(mload(dest), not(mask)), data))\n // Update buffer length if we extended it\n if gt(add(off, len), mload(bufptr)) {\n mstore(bufptr, add(off, len))\n }\n }\n }\n return buf;\n }\n\n /**\n * @dev Writes a bytes20 to the buffer. Resizes if doing so would exceed the\n * capacity of the buffer.\n * @param buf The buffer to append to.\n * @param off The offset to write at.\n * @param data The data to append.\n * @return The original buffer, for chaining.\n */\n function writeBytes20(\n buffer memory buf,\n uint256 off,\n bytes20 data\n ) internal pure returns (buffer memory) {\n return write(buf, off, bytes32(data), 20);\n }\n\n /**\n * @dev Appends a bytes20 to the buffer. Resizes if doing so would exceed\n * the capacity of the buffer.\n * @param buf The buffer to append to.\n * @param data The data to append.\n * @return The original buffer, for chhaining.\n */\n function appendBytes20(buffer memory buf, bytes20 data) internal pure returns (buffer memory) {\n return write(buf, buf.buf.length, bytes32(data), 20);\n }\n\n /**\n * @dev Appends a bytes32 to the buffer. Resizes if doing so would exceed\n * the capacity of the buffer.\n * @param buf The buffer to append to.\n * @param data The data to append.\n * @return The original buffer, for chaining.\n */\n function appendBytes32(buffer memory buf, bytes32 data) internal pure returns (buffer memory) {\n return write(buf, buf.buf.length, data, 32);\n }\n\n /**\n * @dev Writes an integer to the buffer. Resizes if doing so would exceed\n * the capacity of the buffer.\n * @param buf The buffer to append to.\n * @param off The offset to write at.\n * @param data The data to append.\n * @param len The number of bytes to write (right-aligned).\n * @return The original buffer, for chaining.\n */\n function writeInt(\n buffer memory buf,\n uint256 off,\n uint256 data,\n uint256 len\n ) private pure returns (buffer memory) {\n if (len + off > buf.capacity) {\n resize(buf, (len + off) * 2);\n }\n\n uint256 mask = (256**len) - 1;\n assembly {\n // Memory address of the buffer data\n let bufptr := mload(buf)\n // Address = buffer address + off + sizeof(buffer length) + len\n let dest := add(add(bufptr, off), len)\n mstore(dest, or(and(mload(dest), not(mask)), data))\n // Update buffer length if we extended it\n if gt(add(off, len), mload(bufptr)) {\n mstore(bufptr, add(off, len))\n }\n }\n return buf;\n }\n\n /**\n * @dev Appends a byte to the end of the buffer. Resizes if doing so would\n * exceed the capacity of the buffer.\n * @param buf The buffer to append to.\n * @param data The data to append.\n * @return The original buffer.\n */\n function appendInt(\n buffer memory buf,\n uint256 data,\n uint256 len\n ) internal pure returns (buffer memory) {\n return writeInt(buf, buf.buf.length, data, len);\n }\n}\n"},"@chainlink/contracts/src/v0.8/vendor/CBORChainlink.sol":{"content":"// SPDX-License-Identifier: MIT\npragma solidity >=0.4.19;\n\nimport {BufferChainlink} from \"./BufferChainlink.sol\";\n\nlibrary CBORChainlink {\n using BufferChainlink for BufferChainlink.buffer;\n\n uint8 private constant MAJOR_TYPE_INT = 0;\n uint8 private constant MAJOR_TYPE_NEGATIVE_INT = 1;\n uint8 private constant MAJOR_TYPE_BYTES = 2;\n uint8 private constant MAJOR_TYPE_STRING = 3;\n uint8 private constant MAJOR_TYPE_ARRAY = 4;\n uint8 private constant MAJOR_TYPE_MAP = 5;\n uint8 private constant MAJOR_TYPE_TAG = 6;\n uint8 private constant MAJOR_TYPE_CONTENT_FREE = 7;\n\n uint8 private constant TAG_TYPE_BIGNUM = 2;\n uint8 private constant TAG_TYPE_NEGATIVE_BIGNUM = 3;\n\n function encodeFixedNumeric(BufferChainlink.buffer memory buf, uint8 major, uint64 value) private pure {\n if(value <= 23) {\n buf.appendUint8(uint8((major << 5) | value));\n } else if (value <= 0xFF) {\n buf.appendUint8(uint8((major << 5) | 24));\n buf.appendInt(value, 1);\n } else if (value <= 0xFFFF) {\n buf.appendUint8(uint8((major << 5) | 25));\n buf.appendInt(value, 2);\n } else if (value <= 0xFFFFFFFF) {\n buf.appendUint8(uint8((major << 5) | 26));\n buf.appendInt(value, 4);\n } else {\n buf.appendUint8(uint8((major << 5) | 27));\n buf.appendInt(value, 8);\n }\n }\n\n function encodeIndefiniteLengthType(BufferChainlink.buffer memory buf, uint8 major) private pure {\n buf.appendUint8(uint8((major << 5) | 31));\n }\n\n function encodeUInt(BufferChainlink.buffer memory buf, uint value) internal pure {\n if(value > 0xFFFFFFFFFFFFFFFF) {\n encodeBigNum(buf, value);\n } else {\n encodeFixedNumeric(buf, MAJOR_TYPE_INT, uint64(value));\n }\n }\n\n function encodeInt(BufferChainlink.buffer memory buf, int value) internal pure {\n if(value < -0x10000000000000000) {\n encodeSignedBigNum(buf, value);\n } else if(value > 0xFFFFFFFFFFFFFFFF) {\n encodeBigNum(buf, uint(value));\n } else if(value >= 0) {\n encodeFixedNumeric(buf, MAJOR_TYPE_INT, uint64(uint256(value)));\n } else {\n encodeFixedNumeric(buf, MAJOR_TYPE_NEGATIVE_INT, uint64(uint256(-1 - value)));\n }\n }\n\n function encodeBytes(BufferChainlink.buffer memory buf, bytes memory value) internal pure {\n encodeFixedNumeric(buf, MAJOR_TYPE_BYTES, uint64(value.length));\n buf.append(value);\n }\n\n function encodeBigNum(BufferChainlink.buffer memory buf, uint value) internal pure {\n buf.appendUint8(uint8((MAJOR_TYPE_TAG << 5) | TAG_TYPE_BIGNUM));\n encodeBytes(buf, abi.encode(value));\n }\n\n function encodeSignedBigNum(BufferChainlink.buffer memory buf, int input) internal pure {\n buf.appendUint8(uint8((MAJOR_TYPE_TAG << 5) | TAG_TYPE_NEGATIVE_BIGNUM));\n encodeBytes(buf, abi.encode(uint256(-1 - input)));\n }\n\n function encodeString(BufferChainlink.buffer memory buf, string memory value) internal pure {\n encodeFixedNumeric(buf, MAJOR_TYPE_STRING, uint64(bytes(value).length));\n buf.append(bytes(value));\n }\n\n function startArray(BufferChainlink.buffer memory buf) internal pure {\n encodeIndefiniteLengthType(buf, MAJOR_TYPE_ARRAY);\n }\n\n function startMap(BufferChainlink.buffer memory buf) internal pure {\n encodeIndefiniteLengthType(buf, MAJOR_TYPE_MAP);\n }\n\n function endSequence(BufferChainlink.buffer memory buf) internal pure {\n encodeIndefiniteLengthType(buf, MAJOR_TYPE_CONTENT_FREE);\n }\n}\n"},"@chainlink/contracts/src/v0.8/vendor/ENSResolver.sol":{"content":"// SPDX-License-Identifier: MIT\npragma solidity ^0.8.0;\n\nabstract contract ENSResolver {\n function addr(bytes32 node) public view virtual returns (address);\n}\n"},"@openzeppelin/contracts-upgradeable-4.4.2/access/AccessControlUpgradeable.sol":{"content":"// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (access/AccessControl.sol)\n\npragma solidity ^0.8.0;\n\nimport \"./IAccessControlUpgradeable.sol\";\nimport \"../utils/ContextUpgradeable.sol\";\nimport \"../utils/StringsUpgradeable.sol\";\nimport \"../utils/introspection/ERC165Upgradeable.sol\";\nimport \"../proxy/utils/Initializable.sol\";\n\n/**\n * @dev Contract module that allows children to implement role-based access\n * control mechanisms. This is a lightweight version that doesn't allow enumerating role\n * members except through off-chain means by accessing the contract event logs. Some\n * applications may benefit from on-chain enumerability, for those cases see\n * {AccessControlEnumerable}.\n *\n * Roles are referred to by their `bytes32` identifier. These should be exposed\n * in the external API and be unique. The best way to achieve this is by\n * using `public constant` hash digests:\n *\n * ```\n * bytes32 public constant MY_ROLE = keccak256(\"MY_ROLE\");\n * ```\n *\n * Roles can be used to represent a set of permissions. To restrict access to a\n * function call, use {hasRole}:\n *\n * ```\n * function foo() public {\n * require(hasRole(MY_ROLE, msg.sender));\n * ...\n * }\n * ```\n *\n * Roles can be granted and revoked dynamically via the {grantRole} and\n * {revokeRole} functions. Each role has an associated admin role, and only\n * accounts that have a role's admin role can call {grantRole} and {revokeRole}.\n *\n * By default, the admin role for all roles is `DEFAULT_ADMIN_ROLE`, which means\n * that only accounts with this role will be able to grant or revoke other\n * roles. More complex role relationships can be created by using\n * {_setRoleAdmin}.\n *\n * WARNING: The `DEFAULT_ADMIN_ROLE` is also its own admin: it has permission to\n * grant and revoke this role. Extra precautions should be taken to secure\n * accounts that have been granted it.\n */\nabstract contract AccessControlUpgradeable is Initializable, ContextUpgradeable, IAccessControlUpgradeable, ERC165Upgradeable {\n function __AccessControl_init() internal onlyInitializing {\n __Context_init_unchained();\n __ERC165_init_unchained();\n __AccessControl_init_unchained();\n }\n\n function __AccessControl_init_unchained() internal onlyInitializing {\n }\n struct RoleData {\n mapping(address => bool) members;\n bytes32 adminRole;\n }\n\n mapping(bytes32 => RoleData) private _roles;\n\n bytes32 public constant DEFAULT_ADMIN_ROLE = 0x00;\n\n /**\n * @dev Modifier that checks that an account has a specific role. Reverts\n * with a standardized message including the required role.\n *\n * The format of the revert reason is given by the following regular expression:\n *\n * /^AccessControl: account (0x[0-9a-f]{40}) is missing role (0x[0-9a-f]{64})$/\n *\n * _Available since v4.1._\n */\n modifier onlyRole(bytes32 role) {\n _checkRole(role, _msgSender());\n _;\n }\n\n /**\n * @dev See {IERC165-supportsInterface}.\n */\n function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {\n return interfaceId == type(IAccessControlUpgradeable).interfaceId || super.supportsInterface(interfaceId);\n }\n\n /**\n * @dev Returns `true` if `account` has been granted `role`.\n */\n function hasRole(bytes32 role, address account) public view override returns (bool) {\n return _roles[role].members[account];\n }\n\n /**\n * @dev Revert with a standard message if `account` is missing `role`.\n *\n * The format of the revert reason is given by the following regular expression:\n *\n * /^AccessControl: account (0x[0-9a-f]{40}) is missing role (0x[0-9a-f]{64})$/\n */\n function _checkRole(bytes32 role, address account) internal view {\n if (!hasRole(role, account)) {\n revert(\n string(\n abi.encodePacked(\n \"AccessControl: account \",\n StringsUpgradeable.toHexString(uint160(account), 20),\n \" is missing role \",\n StringsUpgradeable.toHexString(uint256(role), 32)\n )\n )\n );\n }\n }\n\n /**\n * @dev Returns the admin role that controls `role`. See {grantRole} and\n * {revokeRole}.\n *\n * To change a role's admin, use {_setRoleAdmin}.\n */\n function getRoleAdmin(bytes32 role) public view override returns (bytes32) {\n return _roles[role].adminRole;\n }\n\n /**\n * @dev Grants `role` to `account`.\n *\n * If `account` had not been already granted `role`, emits a {RoleGranted}\n * event.\n *\n * Requirements:\n *\n * - the caller must have ``role``'s admin role.\n */\n function grantRole(bytes32 role, address account) public virtual override onlyRole(getRoleAdmin(role)) {\n _grantRole(role, account);\n }\n\n /**\n * @dev Revokes `role` from `account`.\n *\n * If `account` had been granted `role`, emits a {RoleRevoked} event.\n *\n * Requirements:\n *\n * - the caller must have ``role``'s admin role.\n */\n function revokeRole(bytes32 role, address account) public virtual override onlyRole(getRoleAdmin(role)) {\n _revokeRole(role, account);\n }\n\n /**\n * @dev Revokes `role` from the calling account.\n *\n * Roles are often managed via {grantRole} and {revokeRole}: this function's\n * purpose is to provide a mechanism for accounts to lose their privileges\n * if they are compromised (such as when a trusted device is misplaced).\n *\n * If the calling account had been revoked `role`, emits a {RoleRevoked}\n * event.\n *\n * Requirements:\n *\n * - the caller must be `account`.\n */\n function renounceRole(bytes32 role, address account) public virtual override {\n require(account == _msgSender(), \"AccessControl: can only renounce roles for self\");\n\n _revokeRole(role, account);\n }\n\n /**\n * @dev Grants `role` to `account`.\n *\n * If `account` had not been already granted `role`, emits a {RoleGranted}\n * event. Note that unlike {grantRole}, this function doesn't perform any\n * checks on the calling account.\n *\n * [WARNING]\n * ====\n * This function should only be called from the constructor when setting\n * up the initial roles for the system.\n *\n * Using this function in any other way is effectively circumventing the admin\n * system imposed by {AccessControl}.\n * ====\n *\n * NOTE: This function is deprecated in favor of {_grantRole}.\n */\n function _setupRole(bytes32 role, address account) internal virtual {\n _grantRole(role, account);\n }\n\n /**\n * @dev Sets `adminRole` as ``role``'s admin role.\n *\n * Emits a {RoleAdminChanged} event.\n */\n function _setRoleAdmin(bytes32 role, bytes32 adminRole) internal virtual {\n bytes32 previousAdminRole = getRoleAdmin(role);\n _roles[role].adminRole = adminRole;\n emit RoleAdminChanged(role, previousAdminRole, adminRole);\n }\n\n /**\n * @dev Grants `role` to `account`.\n *\n * Internal function without access restriction.\n */\n function _grantRole(bytes32 role, address account) internal virtual {\n if (!hasRole(role, account)) {\n _roles[role].members[account] = true;\n emit RoleGranted(role, account, _msgSender());\n }\n }\n\n /**\n * @dev Revokes `role` from `account`.\n *\n * Internal function without access restriction.\n */\n function _revokeRole(bytes32 role, address account) internal virtual {\n if (hasRole(role, account)) {\n _roles[role].members[account] = false;\n emit RoleRevoked(role, account, _msgSender());\n }\n }\n uint256[49] private __gap;\n}\n"},"@openzeppelin/contracts-upgradeable-4.4.2/access/IAccessControlUpgradeable.sol":{"content":"// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (access/IAccessControl.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @dev External interface of AccessControl declared to support ERC165 detection.\n */\ninterface IAccessControlUpgradeable {\n /**\n * @dev Emitted when `newAdminRole` is set as ``role``'s admin role, replacing `previousAdminRole`\n *\n * `DEFAULT_ADMIN_ROLE` is the starting admin for all roles, despite\n * {RoleAdminChanged} not being emitted signaling this.\n *\n * _Available since v3.1._\n */\n event RoleAdminChanged(bytes32 indexed role, bytes32 indexed previousAdminRole, bytes32 indexed newAdminRole);\n\n /**\n * @dev Emitted when `account` is granted `role`.\n *\n * `sender` is the account that originated the contract call, an admin role\n * bearer except when using {AccessControl-_setupRole}.\n */\n event RoleGranted(bytes32 indexed role, address indexed account, address indexed sender);\n\n /**\n * @dev Emitted when `account` is revoked `role`.\n *\n * `sender` is the account that originated the contract call:\n * - if using `revokeRole`, it is the admin role bearer\n * - if using `renounceRole`, it is the role bearer (i.e. `account`)\n */\n event RoleRevoked(bytes32 indexed role, address indexed account, address indexed sender);\n\n /**\n * @dev Returns `true` if `account` has been granted `role`.\n */\n function hasRole(bytes32 role, address account) external view returns (bool);\n\n /**\n * @dev Returns the admin role that controls `role`. See {grantRole} and\n * {revokeRole}.\n *\n * To change a role's admin, use {AccessControl-_setRoleAdmin}.\n */\n function getRoleAdmin(bytes32 role) external view returns (bytes32);\n\n /**\n * @dev Grants `role` to `account`.\n *\n * If `account` had not been already granted `role`, emits a {RoleGranted}\n * event.\n *\n * Requirements:\n *\n * - the caller must have ``role``'s admin role.\n */\n function grantRole(bytes32 role, address account) external;\n\n /**\n * @dev Revokes `role` from `account`.\n *\n * If `account` had been granted `role`, emits a {RoleRevoked} event.\n *\n * Requirements:\n *\n * - the caller must have ``role``'s admin role.\n */\n function revokeRole(bytes32 role, address account) external;\n\n /**\n * @dev Revokes `role` from the calling account.\n *\n * Roles are often managed via {grantRole} and {revokeRole}: this function's\n * purpose is to provide a mechanism for accounts to lose their privileges\n * if they are compromised (such as when a trusted device is misplaced).\n *\n * If the calling account had been granted `role`, emits a {RoleRevoked}\n * event.\n *\n * Requirements:\n *\n * - the caller must be `account`.\n */\n function renounceRole(bytes32 role, address account) external;\n}\n"},"@openzeppelin/contracts-upgradeable-4.4.2/access/OwnableUpgradeable.sol":{"content":"// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (access/Ownable.sol)\n\npragma solidity ^0.8.0;\n\nimport \"../utils/ContextUpgradeable.sol\";\nimport \"../proxy/utils/Initializable.sol\";\n\n/**\n * @dev Contract module which provides a basic access control mechanism, where\n * there is an account (an owner) that can be granted exclusive access to\n * specific functions.\n *\n * By default, the owner account will be the one that deploys the contract. This\n * can later be changed with {transferOwnership}.\n *\n * This module is used through inheritance. It will make available the modifier\n * `onlyOwner`, which can be applied to your functions to restrict their use to\n * the owner.\n */\nabstract contract OwnableUpgradeable is Initializable, ContextUpgradeable {\n address private _owner;\n\n event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);\n\n /**\n * @dev Initializes the contract setting the deployer as the initial owner.\n */\n function __Ownable_init() internal onlyInitializing {\n __Context_init_unchained();\n __Ownable_init_unchained();\n }\n\n function __Ownable_init_unchained() internal onlyInitializing {\n _transferOwnership(_msgSender());\n }\n\n /**\n * @dev Returns the address of the current owner.\n */\n function owner() public view virtual returns (address) {\n return _owner;\n }\n\n /**\n * @dev Throws if called by any account other than the owner.\n */\n modifier onlyOwner() {\n require(owner() == _msgSender(), \"Ownable: caller is not the owner\");\n _;\n }\n\n /**\n * @dev Leaves the contract without owner. It will not be possible to call\n * `onlyOwner` functions anymore. Can only be called by the current owner.\n *\n * NOTE: Renouncing ownership will leave the contract without an owner,\n * thereby removing any functionality that is only available to the owner.\n */\n function renounceOwnership() public virtual onlyOwner {\n _transferOwnership(address(0));\n }\n\n /**\n * @dev Transfers ownership of the contract to a new account (`newOwner`).\n * Can only be called by the current owner.\n */\n function transferOwnership(address newOwner) public virtual onlyOwner {\n require(newOwner != address(0), \"Ownable: new owner is the zero address\");\n _transferOwnership(newOwner);\n }\n\n /**\n * @dev Transfers ownership of the contract to a new account (`newOwner`).\n * Internal function without access restriction.\n */\n function _transferOwnership(address newOwner) internal virtual {\n address oldOwner = _owner;\n _owner = newOwner;\n emit OwnershipTransferred(oldOwner, newOwner);\n }\n uint256[49] private __gap;\n}\n"},"@openzeppelin/contracts-upgradeable-4.4.2/metatx/ERC2771ContextUpgradeable.sol":{"content":"// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (metatx/ERC2771Context.sol)\n\npragma solidity ^0.8.0;\n\nimport \"../utils/ContextUpgradeable.sol\";\nimport \"../proxy/utils/Initializable.sol\";\n\n/**\n * @dev Context variant with ERC2771 support.\n */\nabstract contract ERC2771ContextUpgradeable is Initializable, ContextUpgradeable {\n address private _trustedForwarder;\n\n function __ERC2771Context_init(address trustedForwarder) internal onlyInitializing {\n __Context_init_unchained();\n __ERC2771Context_init_unchained(trustedForwarder);\n }\n\n function __ERC2771Context_init_unchained(address trustedForwarder) internal onlyInitializing {\n _trustedForwarder = trustedForwarder;\n }\n\n function isTrustedForwarder(address forwarder) public view virtual returns (bool) {\n return forwarder == _trustedForwarder;\n }\n\n function _msgSender() internal view virtual override returns (address sender) {\n if (isTrustedForwarder(msg.sender)) {\n // The assembly code is more direct than the Solidity version using `abi.decode`.\n assembly {\n sender := shr(96, calldataload(sub(calldatasize(), 20)))\n }\n } else {\n return super._msgSender();\n }\n }\n\n function _msgData() internal view virtual override returns (bytes calldata) {\n if (isTrustedForwarder(msg.sender)) {\n return msg.data[:msg.data.length - 20];\n } else {\n return super._msgData();\n }\n }\n uint256[49] private __gap;\n}\n"},"@openzeppelin/contracts-upgradeable-4.4.2/proxy/beacon/IBeaconUpgradeable.sol":{"content":"// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (proxy/beacon/IBeacon.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @dev This is the interface that {BeaconProxy} expects of its beacon.\n */\ninterface IBeaconUpgradeable {\n /**\n * @dev Must return an address that can be used as a delegate call target.\n *\n * {BeaconProxy} will check that this address is a contract.\n */\n function implementation() external view returns (address);\n}\n"},"@openzeppelin/contracts-upgradeable-4.4.2/proxy/ERC1967/ERC1967UpgradeUpgradeable.sol":{"content":"// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (proxy/ERC1967/ERC1967Upgrade.sol)\n\npragma solidity ^0.8.2;\n\nimport \"../beacon/IBeaconUpgradeable.sol\";\nimport \"../../utils/AddressUpgradeable.sol\";\nimport \"../../utils/StorageSlotUpgradeable.sol\";\nimport \"../utils/Initializable.sol\";\n\n/**\n * @dev This abstract contract provides getters and event emitting update functions for\n * https://eips.ethereum.org/EIPS/eip-1967[EIP1967] slots.\n *\n * _Available since v4.1._\n *\n * @custom:oz-upgrades-unsafe-allow delegatecall\n */\nabstract contract ERC1967UpgradeUpgradeable is Initializable {\n function __ERC1967Upgrade_init() internal onlyInitializing {\n __ERC1967Upgrade_init_unchained();\n }\n\n function __ERC1967Upgrade_init_unchained() internal onlyInitializing {\n }\n // This is the keccak-256 hash of \"eip1967.proxy.rollback\" subtracted by 1\n bytes32 private constant _ROLLBACK_SLOT = 0x4910fdfa16fed3260ed0e7147f7cc6da11a60208b5b9406d12a635614ffd9143;\n\n /**\n * @dev Storage slot with the address of the current implementation.\n * This is the keccak-256 hash of \"eip1967.proxy.implementation\" subtracted by 1, and is\n * validated in the constructor.\n */\n bytes32 internal constant _IMPLEMENTATION_SLOT = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc;\n\n /**\n * @dev Emitted when the implementation is upgraded.\n */\n event Upgraded(address indexed implementation);\n\n /**\n * @dev Returns the current implementation address.\n */\n function _getImplementation() internal view returns (address) {\n return StorageSlotUpgradeable.getAddressSlot(_IMPLEMENTATION_SLOT).value;\n }\n\n /**\n * @dev Stores a new address in the EIP1967 implementation slot.\n */\n function _setImplementation(address newImplementation) private {\n require(AddressUpgradeable.isContract(newImplementation), \"ERC1967: new implementation is not a contract\");\n StorageSlotUpgradeable.getAddressSlot(_IMPLEMENTATION_SLOT).value = newImplementation;\n }\n\n /**\n * @dev Perform implementation upgrade\n *\n * Emits an {Upgraded} event.\n */\n function _upgradeTo(address newImplementation) internal {\n _setImplementation(newImplementation);\n emit Upgraded(newImplementation);\n }\n\n /**\n * @dev Perform implementation upgrade with additional setup call.\n *\n * Emits an {Upgraded} event.\n */\n function _upgradeToAndCall(\n address newImplementation,\n bytes memory data,\n bool forceCall\n ) internal {\n _upgradeTo(newImplementation);\n if (data.length > 0 || forceCall) {\n _functionDelegateCall(newImplementation, data);\n }\n }\n\n /**\n * @dev Perform implementation upgrade with security checks for UUPS proxies, and additional setup call.\n *\n * Emits an {Upgraded} event.\n */\n function _upgradeToAndCallSecure(\n address newImplementation,\n bytes memory data,\n bool forceCall\n ) internal {\n address oldImplementation = _getImplementation();\n\n // Initial upgrade and setup call\n _setImplementation(newImplementation);\n if (data.length > 0 || forceCall) {\n _functionDelegateCall(newImplementation, data);\n }\n\n // Perform rollback test if not already in progress\n StorageSlotUpgradeable.BooleanSlot storage rollbackTesting = StorageSlotUpgradeable.getBooleanSlot(_ROLLBACK_SLOT);\n if (!rollbackTesting.value) {\n // Trigger rollback using upgradeTo from the new implementation\n rollbackTesting.value = true;\n _functionDelegateCall(\n newImplementation,\n abi.encodeWithSignature(\"upgradeTo(address)\", oldImplementation)\n );\n rollbackTesting.value = false;\n // Check rollback was effective\n require(oldImplementation == _getImplementation(), \"ERC1967Upgrade: upgrade breaks further upgrades\");\n // Finally reset to the new implementation and log the upgrade\n _upgradeTo(newImplementation);\n }\n }\n\n /**\n * @dev Storage slot with the admin of the contract.\n * This is the keccak-256 hash of \"eip1967.proxy.admin\" subtracted by 1, and is\n * validated in the constructor.\n */\n bytes32 internal constant _ADMIN_SLOT = 0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103;\n\n /**\n * @dev Emitted when the admin account has changed.\n */\n event AdminChanged(address previousAdmin, address newAdmin);\n\n /**\n * @dev Returns the current admin.\n */\n function _getAdmin() internal view returns (address) {\n return StorageSlotUpgradeable.getAddressSlot(_ADMIN_SLOT).value;\n }\n\n /**\n * @dev Stores a new address in the EIP1967 admin slot.\n */\n function _setAdmin(address newAdmin) private {\n require(newAdmin != address(0), \"ERC1967: new admin is the zero address\");\n StorageSlotUpgradeable.getAddressSlot(_ADMIN_SLOT).value = newAdmin;\n }\n\n /**\n * @dev Changes the admin of the proxy.\n *\n * Emits an {AdminChanged} event.\n */\n function _changeAdmin(address newAdmin) internal {\n emit AdminChanged(_getAdmin(), newAdmin);\n _setAdmin(newAdmin);\n }\n\n /**\n * @dev The storage slot of the UpgradeableBeacon contract which defines the implementation for this proxy.\n * This is bytes32(uint256(keccak256('eip1967.proxy.beacon')) - 1)) and is validated in the constructor.\n */\n bytes32 internal constant _BEACON_SLOT = 0xa3f0ad74e5423aebfd80d3ef4346578335a9a72aeaee59ff6cb3582b35133d50;\n\n /**\n * @dev Emitted when the beacon is upgraded.\n */\n event BeaconUpgraded(address indexed beacon);\n\n /**\n * @dev Returns the current beacon.\n */\n function _getBeacon() internal view returns (address) {\n return StorageSlotUpgradeable.getAddressSlot(_BEACON_SLOT).value;\n }\n\n /**\n * @dev Stores a new beacon in the EIP1967 beacon slot.\n */\n function _setBeacon(address newBeacon) private {\n require(AddressUpgradeable.isContract(newBeacon), \"ERC1967: new beacon is not a contract\");\n require(\n AddressUpgradeable.isContract(IBeaconUpgradeable(newBeacon).implementation()),\n \"ERC1967: beacon implementation is not a contract\"\n );\n StorageSlotUpgradeable.getAddressSlot(_BEACON_SLOT).value = newBeacon;\n }\n\n /**\n * @dev Perform beacon upgrade with additional setup call. Note: This upgrades the address of the beacon, it does\n * not upgrade the implementation contained in the beacon (see {UpgradeableBeacon-_setImplementation} for that).\n *\n * Emits a {BeaconUpgraded} event.\n */\n function _upgradeBeaconToAndCall(\n address newBeacon,\n bytes memory data,\n bool forceCall\n ) internal {\n _setBeacon(newBeacon);\n emit BeaconUpgraded(newBeacon);\n if (data.length > 0 || forceCall) {\n _functionDelegateCall(IBeaconUpgradeable(newBeacon).implementation(), data);\n }\n }\n\n /**\n * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\n * but performing a delegate call.\n *\n * _Available since v3.4._\n */\n function _functionDelegateCall(address target, bytes memory data) private returns (bytes memory) {\n require(AddressUpgradeable.isContract(target), \"Address: delegate call to non-contract\");\n\n // solhint-disable-next-line avoid-low-level-calls\n (bool success, bytes memory returndata) = target.delegatecall(data);\n return AddressUpgradeable.verifyCallResult(success, returndata, \"Address: low-level delegate call failed\");\n }\n uint256[50] private __gap;\n}\n"},"@openzeppelin/contracts-upgradeable-4.4.2/proxy/utils/Initializable.sol":{"content":"// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (proxy/utils/Initializable.sol)\n\npragma solidity ^0.8.0;\n\nimport \"../../utils/AddressUpgradeable.sol\";\n\n/**\n * @dev This is a base contract to aid in writing upgradeable contracts, or any kind of contract that will be deployed\n * behind a proxy. Since a proxied contract can't have a constructor, it's common to move constructor logic to an\n * external initializer function, usually called `initialize`. It then becomes necessary to protect this initializer\n * function so it can only be called once. The {initializer} modifier provided by this contract will have this effect.\n *\n * TIP: To avoid leaving the proxy in an uninitialized state, the initializer function should be called as early as\n * possible by providing the encoded function call as the `_data` argument to {ERC1967Proxy-constructor}.\n *\n * CAUTION: When used with inheritance, manual care must be taken to not invoke a parent initializer twice, or to ensure\n * that all initializers are idempotent. This is not verified automatically as constructors are by Solidity.\n *\n * [CAUTION]\n * ====\n * Avoid leaving a contract uninitialized.\n *\n * An uninitialized contract can be taken over by an attacker. This applies to both a proxy and its implementation\n * contract, which may impact the proxy. To initialize the implementation contract, you can either invoke the\n * initializer manually, or you can include a constructor to automatically mark it as initialized when it is deployed:\n *\n * [.hljs-theme-light.nopadding]\n * ```\n * /// @custom:oz-upgrades-unsafe-allow constructor\n * constructor() initializer {}\n * ```\n * ====\n */\nabstract contract Initializable {\n /**\n * @dev Indicates that the contract has been initialized.\n */\n bool private _initialized;\n\n /**\n * @dev Indicates that the contract is in the process of being initialized.\n */\n bool private _initializing;\n\n /**\n * @dev Modifier to protect an initializer function from being invoked twice.\n */\n modifier initializer() {\n // If the contract is initializing we ignore whether _initialized is set in order to support multiple\n // inheritance patterns, but we only do this in the context of a constructor, because in other contexts the\n // contract may have been reentered.\n require(_initializing ? _isConstructor() : !_initialized, \"Initializable: contract is already initialized\");\n\n bool isTopLevelCall = !_initializing;\n if (isTopLevelCall) {\n _initializing = true;\n _initialized = true;\n }\n\n _;\n\n if (isTopLevelCall) {\n _initializing = false;\n }\n }\n\n /**\n * @dev Modifier to protect an initialization function so that it can only be invoked by functions with the\n * {initializer} modifier, directly or indirectly.\n */\n modifier onlyInitializing() {\n require(_initializing, \"Initializable: contract is not initializing\");\n _;\n }\n\n function _isConstructor() private view returns (bool) {\n return !AddressUpgradeable.isContract(address(this));\n }\n}\n"},"@openzeppelin/contracts-upgradeable-4.4.2/proxy/utils/UUPSUpgradeable.sol":{"content":"// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (proxy/utils/UUPSUpgradeable.sol)\n\npragma solidity ^0.8.0;\n\nimport \"../ERC1967/ERC1967UpgradeUpgradeable.sol\";\nimport \"./Initializable.sol\";\n\n/**\n * @dev An upgradeability mechanism designed for UUPS proxies. The functions included here can perform an upgrade of an\n * {ERC1967Proxy}, when this contract is set as the implementation behind such a proxy.\n *\n * A security mechanism ensures that an upgrade does not turn off upgradeability accidentally, although this risk is\n * reinstated if the upgrade retains upgradeability but removes the security mechanism, e.g. by replacing\n * `UUPSUpgradeable` with a custom implementation of upgrades.\n *\n * The {_authorizeUpgrade} function must be overridden to include access restriction to the upgrade mechanism.\n *\n * _Available since v4.1._\n */\nabstract contract UUPSUpgradeable is Initializable, ERC1967UpgradeUpgradeable {\n function __UUPSUpgradeable_init() internal onlyInitializing {\n __ERC1967Upgrade_init_unchained();\n __UUPSUpgradeable_init_unchained();\n }\n\n function __UUPSUpgradeable_init_unchained() internal onlyInitializing {\n }\n /// @custom:oz-upgrades-unsafe-allow state-variable-immutable state-variable-assignment\n address private immutable __self = address(this);\n\n /**\n * @dev Check that the execution is being performed through a delegatecall call and that the execution context is\n * a proxy contract with an implementation (as defined in ERC1967) pointing to self. This should only be the case\n * for UUPS and transparent proxies that are using the current contract as their implementation. Execution of a\n * function through ERC1167 minimal proxies (clones) would not normally pass this test, but is not guaranteed to\n * fail.\n */\n modifier onlyProxy() {\n require(address(this) != __self, \"Function must be called through delegatecall\");\n require(_getImplementation() == __self, \"Function must be called through active proxy\");\n _;\n }\n\n /**\n * @dev Upgrade the implementation of the proxy to `newImplementation`.\n *\n * Calls {_authorizeUpgrade}.\n *\n * Emits an {Upgraded} event.\n */\n function upgradeTo(address newImplementation) external virtual onlyProxy {\n _authorizeUpgrade(newImplementation);\n _upgradeToAndCallSecure(newImplementation, new bytes(0), false);\n }\n\n /**\n * @dev Upgrade the implementation of the proxy to `newImplementation`, and subsequently execute the function call\n * encoded in `data`.\n *\n * Calls {_authorizeUpgrade}.\n *\n * Emits an {Upgraded} event.\n */\n function upgradeToAndCall(address newImplementation, bytes memory data) external payable virtual onlyProxy {\n _authorizeUpgrade(newImplementation);\n _upgradeToAndCallSecure(newImplementation, data, true);\n }\n\n /**\n * @dev Function that should revert when `msg.sender` is not authorized to upgrade the contract. Called by\n * {upgradeTo} and {upgradeToAndCall}.\n *\n * Normally, this function will use an xref:access.adoc[access control] modifier such as {Ownable-onlyOwner}.\n *\n * ```solidity\n * function _authorizeUpgrade(address) internal override onlyOwner {}\n * ```\n */\n function _authorizeUpgrade(address newImplementation) internal virtual;\n uint256[50] private __gap;\n}\n"},"@openzeppelin/contracts-upgradeable-4.4.2/utils/AddressUpgradeable.sol":{"content":"// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (utils/Address.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @dev Collection of functions related to the address type\n */\nlibrary AddressUpgradeable {\n /**\n * @dev Returns true if `account` is a contract.\n *\n * [IMPORTANT]\n * ====\n * It is unsafe to assume that an address for which this function returns\n * false is an externally-owned account (EOA) and not a contract.\n *\n * Among others, `isContract` will return false for the following\n * types of addresses:\n *\n * - an externally-owned account\n * - a contract in construction\n * - an address where a contract will be created\n * - an address where a contract lived, but was destroyed\n * ====\n */\n function isContract(address account) internal view returns (bool) {\n // This method relies on extcodesize, which returns 0 for contracts in\n // construction, since the code is only stored at the end of the\n // constructor execution.\n\n uint256 size;\n assembly {\n size := extcodesize(account)\n }\n return size > 0;\n }\n\n /**\n * @dev Replacement for Solidity's `transfer`: sends `amount` wei to\n * `recipient`, forwarding all available gas and reverting on errors.\n *\n * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost\n * of certain opcodes, possibly making contracts go over the 2300 gas limit\n * imposed by `transfer`, making them unable to receive funds via\n * `transfer`. {sendValue} removes this limitation.\n *\n * https://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more].\n *\n * IMPORTANT: because control is transferred to `recipient`, care must be\n * taken to not create reentrancy vulnerabilities. Consider using\n * {ReentrancyGuard} or the\n * https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].\n */\n function sendValue(address payable recipient, uint256 amount) internal {\n require(address(this).balance >= amount, \"Address: insufficient balance\");\n\n (bool success, ) = recipient.call{value: amount}(\"\");\n require(success, \"Address: unable to send value, recipient may have reverted\");\n }\n\n /**\n * @dev Performs a Solidity function call using a low level `call`. A\n * plain `call` is an unsafe replacement for a function call: use this\n * function instead.\n *\n * If `target` reverts with a revert reason, it is bubbled up by this\n * function (like regular Solidity function calls).\n *\n * Returns the raw returned data. To convert to the expected return value,\n * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`].\n *\n * Requirements:\n *\n * - `target` must be a contract.\n * - calling `target` with `data` must not revert.\n *\n * _Available since v3.1._\n */\n function functionCall(address target, bytes memory data) internal returns (bytes memory) {\n return functionCall(target, data, \"Address: low-level call failed\");\n }\n\n /**\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with\n * `errorMessage` as a fallback revert reason when `target` reverts.\n *\n * _Available since v3.1._\n */\n function functionCall(\n address target,\n bytes memory data,\n string memory errorMessage\n ) internal returns (bytes memory) {\n return functionCallWithValue(target, data, 0, errorMessage);\n }\n\n /**\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\n * but also transferring `value` wei to `target`.\n *\n * Requirements:\n *\n * - the calling contract must have an ETH balance of at least `value`.\n * - the called Solidity function must be `payable`.\n *\n * _Available since v3.1._\n */\n function functionCallWithValue(\n address target,\n bytes memory data,\n uint256 value\n ) internal returns (bytes memory) {\n return functionCallWithValue(target, data, value, \"Address: low-level call with value failed\");\n }\n\n /**\n * @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but\n * with `errorMessage` as a fallback revert reason when `target` reverts.\n *\n * _Available since v3.1._\n */\n function functionCallWithValue(\n address target,\n bytes memory data,\n uint256 value,\n string memory errorMessage\n ) internal returns (bytes memory) {\n require(address(this).balance >= value, \"Address: insufficient balance for call\");\n require(isContract(target), \"Address: call to non-contract\");\n\n (bool success, bytes memory returndata) = target.call{value: value}(data);\n return verifyCallResult(success, returndata, errorMessage);\n }\n\n /**\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\n * but performing a static call.\n *\n * _Available since v3.3._\n */\n function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) {\n return functionStaticCall(target, data, \"Address: low-level static call failed\");\n }\n\n /**\n * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\n * but performing a static call.\n *\n * _Available since v3.3._\n */\n function functionStaticCall(\n address target,\n bytes memory data,\n string memory errorMessage\n ) internal view returns (bytes memory) {\n require(isContract(target), \"Address: static call to non-contract\");\n\n (bool success, bytes memory returndata) = target.staticcall(data);\n return verifyCallResult(success, returndata, errorMessage);\n }\n\n /**\n * @dev Tool to verifies that a low level call was successful, and revert if it wasn't, either by bubbling the\n * revert reason using the provided one.\n *\n * _Available since v4.3._\n */\n function verifyCallResult(\n bool success,\n bytes memory returndata,\n string memory errorMessage\n ) internal pure returns (bytes memory) {\n if (success) {\n return returndata;\n } else {\n // Look for revert reason and bubble it up if present\n if (returndata.length > 0) {\n // The easiest way to bubble the revert reason is using memory via assembly\n\n assembly {\n let returndata_size := mload(returndata)\n revert(add(32, returndata), returndata_size)\n }\n } else {\n revert(errorMessage);\n }\n }\n }\n}\n"},"@openzeppelin/contracts-upgradeable-4.4.2/utils/ContextUpgradeable.sol":{"content":"// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (utils/Context.sol)\n\npragma solidity ^0.8.0;\nimport \"../proxy/utils/Initializable.sol\";\n\n/**\n * @dev Provides information about the current execution context, including the\n * sender of the transaction and its data. While these are generally available\n * via msg.sender and msg.data, they should not be accessed in such a direct\n * manner, since when dealing with meta-transactions the account sending and\n * paying for execution may not be the actual sender (as far as an application\n * is concerned).\n *\n * This contract is only required for intermediate, library-like contracts.\n */\nabstract contract ContextUpgradeable is Initializable {\n function __Context_init() internal onlyInitializing {\n __Context_init_unchained();\n }\n\n function __Context_init_unchained() internal onlyInitializing {\n }\n function _msgSender() internal view virtual returns (address) {\n return msg.sender;\n }\n\n function _msgData() internal view virtual returns (bytes calldata) {\n return msg.data;\n }\n uint256[50] private __gap;\n}\n"},"@openzeppelin/contracts-upgradeable-4.4.2/utils/introspection/ERC165Upgradeable.sol":{"content":"// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (utils/introspection/ERC165.sol)\n\npragma solidity ^0.8.0;\n\nimport \"./IERC165Upgradeable.sol\";\nimport \"../../proxy/utils/Initializable.sol\";\n\n/**\n * @dev Implementation of the {IERC165} interface.\n *\n * Contracts that want to implement ERC165 should inherit from this contract and override {supportsInterface} to check\n * for the additional interface id that will be supported. For example:\n *\n * ```solidity\n * function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {\n * return interfaceId == type(MyInterface).interfaceId || super.supportsInterface(interfaceId);\n * }\n * ```\n *\n * Alternatively, {ERC165Storage} provides an easier to use but more expensive implementation.\n */\nabstract contract ERC165Upgradeable is Initializable, IERC165Upgradeable {\n function __ERC165_init() internal onlyInitializing {\n __ERC165_init_unchained();\n }\n\n function __ERC165_init_unchained() internal onlyInitializing {\n }\n /**\n * @dev See {IERC165-supportsInterface}.\n */\n function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {\n return interfaceId == type(IERC165Upgradeable).interfaceId;\n }\n uint256[50] private __gap;\n}\n"},"@openzeppelin/contracts-upgradeable-4.4.2/utils/introspection/IERC165Upgradeable.sol":{"content":"// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (utils/introspection/IERC165.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @dev Interface of the ERC165 standard, as defined in the\n * https://eips.ethereum.org/EIPS/eip-165[EIP].\n *\n * Implementers can declare support of contract interfaces, which can then be\n * queried by others ({ERC165Checker}).\n *\n * For an implementation, see {ERC165}.\n */\ninterface IERC165Upgradeable {\n /**\n * @dev Returns true if this contract implements the interface defined by\n * `interfaceId`. See the corresponding\n * https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified[EIP section]\n * to learn more about how these ids are created.\n *\n * This function call must use less than 30 000 gas.\n */\n function supportsInterface(bytes4 interfaceId) external view returns (bool);\n}\n"},"@openzeppelin/contracts-upgradeable-4.4.2/utils/StorageSlotUpgradeable.sol":{"content":"// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (utils/StorageSlot.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @dev Library for reading and writing primitive types to specific storage slots.\n *\n * Storage slots are often used to avoid storage conflict when dealing with upgradeable contracts.\n * This library helps with reading and writing to such slots without the need for inline assembly.\n *\n * The functions in this library return Slot structs that contain a `value` member that can be used to read or write.\n *\n * Example usage to set ERC1967 implementation slot:\n * ```\n * contract ERC1967 {\n * bytes32 internal constant _IMPLEMENTATION_SLOT = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc;\n *\n * function _getImplementation() internal view returns (address) {\n * return StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value;\n * }\n *\n * function _setImplementation(address newImplementation) internal {\n * require(Address.isContract(newImplementation), \"ERC1967: new implementation is not a contract\");\n * StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value = newImplementation;\n * }\n * }\n * ```\n *\n * _Available since v4.1 for `address`, `bool`, `bytes32`, and `uint256`._\n */\nlibrary StorageSlotUpgradeable {\n struct AddressSlot {\n address value;\n }\n\n struct BooleanSlot {\n bool value;\n }\n\n struct Bytes32Slot {\n bytes32 value;\n }\n\n struct Uint256Slot {\n uint256 value;\n }\n\n /**\n * @dev Returns an `AddressSlot` with member `value` located at `slot`.\n */\n function getAddressSlot(bytes32 slot) internal pure returns (AddressSlot storage r) {\n assembly {\n r.slot := slot\n }\n }\n\n /**\n * @dev Returns an `BooleanSlot` with member `value` located at `slot`.\n */\n function getBooleanSlot(bytes32 slot) internal pure returns (BooleanSlot storage r) {\n assembly {\n r.slot := slot\n }\n }\n\n /**\n * @dev Returns an `Bytes32Slot` with member `value` located at `slot`.\n */\n function getBytes32Slot(bytes32 slot) internal pure returns (Bytes32Slot storage r) {\n assembly {\n r.slot := slot\n }\n }\n\n /**\n * @dev Returns an `Uint256Slot` with member `value` located at `slot`.\n */\n function getUint256Slot(bytes32 slot) internal pure returns (Uint256Slot storage r) {\n assembly {\n r.slot := slot\n }\n }\n}\n"},"@openzeppelin/contracts-upgradeable-4.4.2/utils/StringsUpgradeable.sol":{"content":"// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (utils/Strings.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @dev String operations.\n */\nlibrary StringsUpgradeable {\n bytes16 private constant _HEX_SYMBOLS = \"0123456789abcdef\";\n\n /**\n * @dev Converts a `uint256` to its ASCII `string` decimal representation.\n */\n function toString(uint256 value) internal pure returns (string memory) {\n // Inspired by OraclizeAPI's implementation - MIT licence\n // https://github.com/oraclize/ethereum-api/blob/b42146b063c7d6ee1358846c198246239e9360e8/oraclizeAPI_0.4.25.sol\n\n if (value == 0) {\n return \"0\";\n }\n uint256 temp = value;\n uint256 digits;\n while (temp != 0) {\n digits++;\n temp /= 10;\n }\n bytes memory buffer = new bytes(digits);\n while (value != 0) {\n digits -= 1;\n buffer[digits] = bytes1(uint8(48 + uint256(value % 10)));\n value /= 10;\n }\n return string(buffer);\n }\n\n /**\n * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation.\n */\n function toHexString(uint256 value) internal pure returns (string memory) {\n if (value == 0) {\n return \"0x00\";\n }\n uint256 temp = value;\n uint256 length = 0;\n while (temp != 0) {\n length++;\n temp >>= 8;\n }\n return toHexString(value, length);\n }\n\n /**\n * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation with fixed length.\n */\n function toHexString(uint256 value, uint256 length) internal pure returns (string memory) {\n bytes memory buffer = new bytes(2 * length + 2);\n buffer[0] = \"0\";\n buffer[1] = \"x\";\n for (uint256 i = 2 * length + 1; i > 1; --i) {\n buffer[i] = _HEX_SYMBOLS[value & 0xf];\n value >>= 4;\n }\n require(value == 0, \"Strings: hex length insufficient\");\n return string(buffer);\n }\n}\n"},"@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol":{"content":"// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.7.0) (access/Ownable.sol)\n\npragma solidity ^0.8.0;\n\nimport \"../utils/ContextUpgradeable.sol\";\nimport \"../proxy/utils/Initializable.sol\";\n\n/**\n * @dev Contract module which provides a basic access control mechanism, where\n * there is an account (an owner) that can be granted exclusive access to\n * specific functions.\n *\n * By default, the owner account will be the one that deploys the contract. This\n * can later be changed with {transferOwnership}.\n *\n * This module is used through inheritance. It will make available the modifier\n * `onlyOwner`, which can be applied to your functions to restrict their use to\n * the owner.\n */\nabstract contract OwnableUpgradeable is Initializable, ContextUpgradeable {\n address private _owner;\n\n event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);\n\n /**\n * @dev Initializes the contract setting the deployer as the initial owner.\n */\n function __Ownable_init() internal onlyInitializing {\n __Ownable_init_unchained();\n }\n\n function __Ownable_init_unchained() internal onlyInitializing {\n _transferOwnership(_msgSender());\n }\n\n /**\n * @dev Throws if called by any account other than the owner.\n */\n modifier onlyOwner() {\n _checkOwner();\n _;\n }\n\n /**\n * @dev Returns the address of the current owner.\n */\n function owner() public view virtual returns (address) {\n return _owner;\n }\n\n /**\n * @dev Throws if the sender is not the owner.\n */\n function _checkOwner() internal view virtual {\n require(owner() == _msgSender(), \"Ownable: caller is not the owner\");\n }\n\n /**\n * @dev Leaves the contract without owner. It will not be possible to call\n * `onlyOwner` functions anymore. Can only be called by the current owner.\n *\n * NOTE: Renouncing ownership will leave the contract without an owner,\n * thereby removing any functionality that is only available to the owner.\n */\n function renounceOwnership() public virtual onlyOwner {\n _transferOwnership(address(0));\n }\n\n /**\n * @dev Transfers ownership of the contract to a new account (`newOwner`).\n * Can only be called by the current owner.\n */\n function transferOwnership(address newOwner) public virtual onlyOwner {\n require(newOwner != address(0), \"Ownable: new owner is the zero address\");\n _transferOwnership(newOwner);\n }\n\n /**\n * @dev Transfers ownership of the contract to a new account (`newOwner`).\n * Internal function without access restriction.\n */\n function _transferOwnership(address newOwner) internal virtual {\n address oldOwner = _owner;\n _owner = newOwner;\n emit OwnershipTransferred(oldOwner, newOwner);\n }\n\n /**\n * @dev This empty reserved space is put in place to allow future versions to add new\n * variables without shifting down storage in the inheritance chain.\n * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps\n */\n uint256[49] private __gap;\n}\n"},"@openzeppelin/contracts-upgradeable/interfaces/draft-IERC1822Upgradeable.sol":{"content":"// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.5.0) (interfaces/draft-IERC1822.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @dev ERC1822: Universal Upgradeable Proxy Standard (UUPS) documents a method for upgradeability through a simplified\n * proxy whose upgrades are fully controlled by the current implementation.\n */\ninterface IERC1822ProxiableUpgradeable {\n /**\n * @dev Returns the storage slot that the proxiable contract assumes is being used to store the implementation\n * address.\n *\n * IMPORTANT: A proxy pointing at a proxiable contract should not be considered proxiable itself, because this risks\n * bricking a proxy that upgrades to it, by delegating to itself until out of gas. Thus it is critical that this\n * function revert if invoked through a proxy.\n */\n function proxiableUUID() external view returns (bytes32);\n}\n"},"@openzeppelin/contracts-upgradeable/proxy/beacon/IBeaconUpgradeable.sol":{"content":"// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (proxy/beacon/IBeacon.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @dev This is the interface that {BeaconProxy} expects of its beacon.\n */\ninterface IBeaconUpgradeable {\n /**\n * @dev Must return an address that can be used as a delegate call target.\n *\n * {BeaconProxy} will check that this address is a contract.\n */\n function implementation() external view returns (address);\n}\n"},"@openzeppelin/contracts-upgradeable/proxy/ERC1967/ERC1967UpgradeUpgradeable.sol":{"content":"// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.5.0) (proxy/ERC1967/ERC1967Upgrade.sol)\n\npragma solidity ^0.8.2;\n\nimport \"../beacon/IBeaconUpgradeable.sol\";\nimport \"../../interfaces/draft-IERC1822Upgradeable.sol\";\nimport \"../../utils/AddressUpgradeable.sol\";\nimport \"../../utils/StorageSlotUpgradeable.sol\";\nimport \"../utils/Initializable.sol\";\n\n/**\n * @dev This abstract contract provides getters and event emitting update functions for\n * https://eips.ethereum.org/EIPS/eip-1967[EIP1967] slots.\n *\n * _Available since v4.1._\n *\n * @custom:oz-upgrades-unsafe-allow delegatecall\n */\nabstract contract ERC1967UpgradeUpgradeable is Initializable {\n function __ERC1967Upgrade_init() internal onlyInitializing {\n }\n\n function __ERC1967Upgrade_init_unchained() internal onlyInitializing {\n }\n // This is the keccak-256 hash of \"eip1967.proxy.rollback\" subtracted by 1\n bytes32 private constant _ROLLBACK_SLOT = 0x4910fdfa16fed3260ed0e7147f7cc6da11a60208b5b9406d12a635614ffd9143;\n\n /**\n * @dev Storage slot with the address of the current implementation.\n * This is the keccak-256 hash of \"eip1967.proxy.implementation\" subtracted by 1, and is\n * validated in the constructor.\n */\n bytes32 internal constant _IMPLEMENTATION_SLOT = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc;\n\n /**\n * @dev Emitted when the implementation is upgraded.\n */\n event Upgraded(address indexed implementation);\n\n /**\n * @dev Returns the current implementation address.\n */\n function _getImplementation() internal view returns (address) {\n return StorageSlotUpgradeable.getAddressSlot(_IMPLEMENTATION_SLOT).value;\n }\n\n /**\n * @dev Stores a new address in the EIP1967 implementation slot.\n */\n function _setImplementation(address newImplementation) private {\n require(AddressUpgradeable.isContract(newImplementation), \"ERC1967: new implementation is not a contract\");\n StorageSlotUpgradeable.getAddressSlot(_IMPLEMENTATION_SLOT).value = newImplementation;\n }\n\n /**\n * @dev Perform implementation upgrade\n *\n * Emits an {Upgraded} event.\n */\n function _upgradeTo(address newImplementation) internal {\n _setImplementation(newImplementation);\n emit Upgraded(newImplementation);\n }\n\n /**\n * @dev Perform implementation upgrade with additional setup call.\n *\n * Emits an {Upgraded} event.\n */\n function _upgradeToAndCall(\n address newImplementation,\n bytes memory data,\n bool forceCall\n ) internal {\n _upgradeTo(newImplementation);\n if (data.length > 0 || forceCall) {\n _functionDelegateCall(newImplementation, data);\n }\n }\n\n /**\n * @dev Perform implementation upgrade with security checks for UUPS proxies, and additional setup call.\n *\n * Emits an {Upgraded} event.\n */\n function _upgradeToAndCallUUPS(\n address newImplementation,\n bytes memory data,\n bool forceCall\n ) internal {\n // Upgrades from old implementations will perform a rollback test. This test requires the new\n // implementation to upgrade back to the old, non-ERC1822 compliant, implementation. Removing\n // this special case will break upgrade paths from old UUPS implementation to new ones.\n if (StorageSlotUpgradeable.getBooleanSlot(_ROLLBACK_SLOT).value) {\n _setImplementation(newImplementation);\n } else {\n try IERC1822ProxiableUpgradeable(newImplementation).proxiableUUID() returns (bytes32 slot) {\n require(slot == _IMPLEMENTATION_SLOT, \"ERC1967Upgrade: unsupported proxiableUUID\");\n } catch {\n revert(\"ERC1967Upgrade: new implementation is not UUPS\");\n }\n _upgradeToAndCall(newImplementation, data, forceCall);\n }\n }\n\n /**\n * @dev Storage slot with the admin of the contract.\n * This is the keccak-256 hash of \"eip1967.proxy.admin\" subtracted by 1, and is\n * validated in the constructor.\n */\n bytes32 internal constant _ADMIN_SLOT = 0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103;\n\n /**\n * @dev Emitted when the admin account has changed.\n */\n event AdminChanged(address previousAdmin, address newAdmin);\n\n /**\n * @dev Returns the current admin.\n */\n function _getAdmin() internal view returns (address) {\n return StorageSlotUpgradeable.getAddressSlot(_ADMIN_SLOT).value;\n }\n\n /**\n * @dev Stores a new address in the EIP1967 admin slot.\n */\n function _setAdmin(address newAdmin) private {\n require(newAdmin != address(0), \"ERC1967: new admin is the zero address\");\n StorageSlotUpgradeable.getAddressSlot(_ADMIN_SLOT).value = newAdmin;\n }\n\n /**\n * @dev Changes the admin of the proxy.\n *\n * Emits an {AdminChanged} event.\n */\n function _changeAdmin(address newAdmin) internal {\n emit AdminChanged(_getAdmin(), newAdmin);\n _setAdmin(newAdmin);\n }\n\n /**\n * @dev The storage slot of the UpgradeableBeacon contract which defines the implementation for this proxy.\n * This is bytes32(uint256(keccak256('eip1967.proxy.beacon')) - 1)) and is validated in the constructor.\n */\n bytes32 internal constant _BEACON_SLOT = 0xa3f0ad74e5423aebfd80d3ef4346578335a9a72aeaee59ff6cb3582b35133d50;\n\n /**\n * @dev Emitted when the beacon is upgraded.\n */\n event BeaconUpgraded(address indexed beacon);\n\n /**\n * @dev Returns the current beacon.\n */\n function _getBeacon() internal view returns (address) {\n return StorageSlotUpgradeable.getAddressSlot(_BEACON_SLOT).value;\n }\n\n /**\n * @dev Stores a new beacon in the EIP1967 beacon slot.\n */\n function _setBeacon(address newBeacon) private {\n require(AddressUpgradeable.isContract(newBeacon), \"ERC1967: new beacon is not a contract\");\n require(\n AddressUpgradeable.isContract(IBeaconUpgradeable(newBeacon).implementation()),\n \"ERC1967: beacon implementation is not a contract\"\n );\n StorageSlotUpgradeable.getAddressSlot(_BEACON_SLOT).value = newBeacon;\n }\n\n /**\n * @dev Perform beacon upgrade with additional setup call. Note: This upgrades the address of the beacon, it does\n * not upgrade the implementation contained in the beacon (see {UpgradeableBeacon-_setImplementation} for that).\n *\n * Emits a {BeaconUpgraded} event.\n */\n function _upgradeBeaconToAndCall(\n address newBeacon,\n bytes memory data,\n bool forceCall\n ) internal {\n _setBeacon(newBeacon);\n emit BeaconUpgraded(newBeacon);\n if (data.length > 0 || forceCall) {\n _functionDelegateCall(IBeaconUpgradeable(newBeacon).implementation(), data);\n }\n }\n\n /**\n * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\n * but performing a delegate call.\n *\n * _Available since v3.4._\n */\n function _functionDelegateCall(address target, bytes memory data) private returns (bytes memory) {\n require(AddressUpgradeable.isContract(target), \"Address: delegate call to non-contract\");\n\n // solhint-disable-next-line avoid-low-level-calls\n (bool success, bytes memory returndata) = target.delegatecall(data);\n return AddressUpgradeable.verifyCallResult(success, returndata, \"Address: low-level delegate call failed\");\n }\n\n /**\n * @dev This empty reserved space is put in place to allow future versions to add new\n * variables without shifting down storage in the inheritance chain.\n * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps\n */\n uint256[50] private __gap;\n}\n"},"@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol":{"content":"// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.8.0) (proxy/utils/Initializable.sol)\n\npragma solidity ^0.8.2;\n\nimport \"../../utils/AddressUpgradeable.sol\";\n\n/**\n * @dev This is a base contract to aid in writing upgradeable contracts, or any kind of contract that will be deployed\n * behind a proxy. Since proxied contracts do not make use of a constructor, it's common to move constructor logic to an\n * external initializer function, usually called `initialize`. It then becomes necessary to protect this initializer\n * function so it can only be called once. The {initializer} modifier provided by this contract will have this effect.\n *\n * The initialization functions use a version number. Once a version number is used, it is consumed and cannot be\n * reused. This mechanism prevents re-execution of each \"step\" but allows the creation of new initialization steps in\n * case an upgrade adds a module that needs to be initialized.\n *\n * For example:\n *\n * [.hljs-theme-light.nopadding]\n * ```\n * contract MyToken is ERC20Upgradeable {\n * function initialize() initializer public {\n * __ERC20_init(\"MyToken\", \"MTK\");\n * }\n * }\n * contract MyTokenV2 is MyToken, ERC20PermitUpgradeable {\n * function initializeV2() reinitializer(2) public {\n * __ERC20Permit_init(\"MyToken\");\n * }\n * }\n * ```\n *\n * TIP: To avoid leaving the proxy in an uninitialized state, the initializer function should be called as early as\n * possible by providing the encoded function call as the `_data` argument to {ERC1967Proxy-constructor}.\n *\n * CAUTION: When used with inheritance, manual care must be taken to not invoke a parent initializer twice, or to ensure\n * that all initializers are idempotent. This is not verified automatically as constructors are by Solidity.\n *\n * [CAUTION]\n * ====\n * Avoid leaving a contract uninitialized.\n *\n * An uninitialized contract can be taken over by an attacker. This applies to both a proxy and its implementation\n * contract, which may impact the proxy. To prevent the implementation contract from being used, you should invoke\n * the {_disableInitializers} function in the constructor to automatically lock it when it is deployed:\n *\n * [.hljs-theme-light.nopadding]\n * ```\n * /// @custom:oz-upgrades-unsafe-allow constructor\n * constructor() {\n * _disableInitializers();\n * }\n * ```\n * ====\n */\nabstract contract Initializable {\n /**\n * @dev Indicates that the contract has been initialized.\n * @custom:oz-retyped-from bool\n */\n uint8 private _initialized;\n\n /**\n * @dev Indicates that the contract is in the process of being initialized.\n */\n bool private _initializing;\n\n /**\n * @dev Triggered when the contract has been initialized or reinitialized.\n */\n event Initialized(uint8 version);\n\n /**\n * @dev A modifier that defines a protected initializer function that can be invoked at most once. In its scope,\n * `onlyInitializing` functions can be used to initialize parent contracts.\n *\n * Similar to `reinitializer(1)`, except that functions marked with `initializer` can be nested in the context of a\n * constructor.\n *\n * Emits an {Initialized} event.\n */\n modifier initializer() {\n bool isTopLevelCall = !_initializing;\n require(\n (isTopLevelCall && _initialized < 1) || (!AddressUpgradeable.isContract(address(this)) && _initialized == 1),\n \"Initializable: contract is already initialized\"\n );\n _initialized = 1;\n if (isTopLevelCall) {\n _initializing = true;\n }\n _;\n if (isTopLevelCall) {\n _initializing = false;\n emit Initialized(1);\n }\n }\n\n /**\n * @dev A modifier that defines a protected reinitializer function that can be invoked at most once, and only if the\n * contract hasn't been initialized to a greater version before. In its scope, `onlyInitializing` functions can be\n * used to initialize parent contracts.\n *\n * A reinitializer may be used after the original initialization step. This is essential to configure modules that\n * are added through upgrades and that require initialization.\n *\n * When `version` is 1, this modifier is similar to `initializer`, except that functions marked with `reinitializer`\n * cannot be nested. If one is invoked in the context of another, execution will revert.\n *\n * Note that versions can jump in increments greater than 1; this implies that if multiple reinitializers coexist in\n * a contract, executing them in the right order is up to the developer or operator.\n *\n * WARNING: setting the version to 255 will prevent any future reinitialization.\n *\n * Emits an {Initialized} event.\n */\n modifier reinitializer(uint8 version) {\n require(!_initializing && _initialized < version, \"Initializable: contract is already initialized\");\n _initialized = version;\n _initializing = true;\n _;\n _initializing = false;\n emit Initialized(version);\n }\n\n /**\n * @dev Modifier to protect an initialization function so that it can only be invoked by functions with the\n * {initializer} and {reinitializer} modifiers, directly or indirectly.\n */\n modifier onlyInitializing() {\n require(_initializing, \"Initializable: contract is not initializing\");\n _;\n }\n\n /**\n * @dev Locks the contract, preventing any future reinitialization. This cannot be part of an initializer call.\n * Calling this in the constructor of a contract will prevent that contract from being initialized or reinitialized\n * to any version. It is recommended to use this to lock implementation contracts that are designed to be called\n * through proxies.\n *\n * Emits an {Initialized} event the first time it is successfully executed.\n */\n function _disableInitializers() internal virtual {\n require(!_initializing, \"Initializable: contract is initializing\");\n if (_initialized < type(uint8).max) {\n _initialized = type(uint8).max;\n emit Initialized(type(uint8).max);\n }\n }\n\n /**\n * @dev Internal function that returns the initialized version. Returns `_initialized`\n */\n function _getInitializedVersion() internal view returns (uint8) {\n return _initialized;\n }\n\n /**\n * @dev Internal function that returns the initialized version. Returns `_initializing`\n */\n function _isInitializing() internal view returns (bool) {\n return _initializing;\n }\n}\n"},"@openzeppelin/contracts-upgradeable/proxy/utils/UUPSUpgradeable.sol":{"content":"// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.8.0) (proxy/utils/UUPSUpgradeable.sol)\n\npragma solidity ^0.8.0;\n\nimport \"../../interfaces/draft-IERC1822Upgradeable.sol\";\nimport \"../ERC1967/ERC1967UpgradeUpgradeable.sol\";\nimport \"./Initializable.sol\";\n\n/**\n * @dev An upgradeability mechanism designed for UUPS proxies. The functions included here can perform an upgrade of an\n * {ERC1967Proxy}, when this contract is set as the implementation behind such a proxy.\n *\n * A security mechanism ensures that an upgrade does not turn off upgradeability accidentally, although this risk is\n * reinstated if the upgrade retains upgradeability but removes the security mechanism, e.g. by replacing\n * `UUPSUpgradeable` with a custom implementation of upgrades.\n *\n * The {_authorizeUpgrade} function must be overridden to include access restriction to the upgrade mechanism.\n *\n * _Available since v4.1._\n */\nabstract contract UUPSUpgradeable is Initializable, IERC1822ProxiableUpgradeable, ERC1967UpgradeUpgradeable {\n function __UUPSUpgradeable_init() internal onlyInitializing {\n }\n\n function __UUPSUpgradeable_init_unchained() internal onlyInitializing {\n }\n /// @custom:oz-upgrades-unsafe-allow state-variable-immutable state-variable-assignment\n address private immutable __self = address(this);\n\n /**\n * @dev Check that the execution is being performed through a delegatecall call and that the execution context is\n * a proxy contract with an implementation (as defined in ERC1967) pointing to self. This should only be the case\n * for UUPS and transparent proxies that are using the current contract as their implementation. Execution of a\n * function through ERC1167 minimal proxies (clones) would not normally pass this test, but is not guaranteed to\n * fail.\n */\n modifier onlyProxy() {\n require(address(this) != __self, \"Function must be called through delegatecall\");\n require(_getImplementation() == __self, \"Function must be called through active proxy\");\n _;\n }\n\n /**\n * @dev Check that the execution is not being performed through a delegate call. This allows a function to be\n * callable on the implementing contract but not through proxies.\n */\n modifier notDelegated() {\n require(address(this) == __self, \"UUPSUpgradeable: must not be called through delegatecall\");\n _;\n }\n\n /**\n * @dev Implementation of the ERC1822 {proxiableUUID} function. This returns the storage slot used by the\n * implementation. It is used to validate the implementation's compatibility when performing an upgrade.\n *\n * IMPORTANT: A proxy pointing at a proxiable contract should not be considered proxiable itself, because this risks\n * bricking a proxy that upgrades to it, by delegating to itself until out of gas. Thus it is critical that this\n * function revert if invoked through a proxy. This is guaranteed by the `notDelegated` modifier.\n */\n function proxiableUUID() external view virtual override notDelegated returns (bytes32) {\n return _IMPLEMENTATION_SLOT;\n }\n\n /**\n * @dev Upgrade the implementation of the proxy to `newImplementation`.\n *\n * Calls {_authorizeUpgrade}.\n *\n * Emits an {Upgraded} event.\n */\n function upgradeTo(address newImplementation) external virtual onlyProxy {\n _authorizeUpgrade(newImplementation);\n _upgradeToAndCallUUPS(newImplementation, new bytes(0), false);\n }\n\n /**\n * @dev Upgrade the implementation of the proxy to `newImplementation`, and subsequently execute the function call\n * encoded in `data`.\n *\n * Calls {_authorizeUpgrade}.\n *\n * Emits an {Upgraded} event.\n */\n function upgradeToAndCall(address newImplementation, bytes memory data) external payable virtual onlyProxy {\n _authorizeUpgrade(newImplementation);\n _upgradeToAndCallUUPS(newImplementation, data, true);\n }\n\n /**\n * @dev Function that should revert when `msg.sender` is not authorized to upgrade the contract. Called by\n * {upgradeTo} and {upgradeToAndCall}.\n *\n * Normally, this function will use an xref:access.adoc[access control] modifier such as {Ownable-onlyOwner}.\n *\n * ```solidity\n * function _authorizeUpgrade(address) internal override onlyOwner {}\n * ```\n */\n function _authorizeUpgrade(address newImplementation) internal virtual;\n\n /**\n * @dev This empty reserved space is put in place to allow future versions to add new\n * variables without shifting down storage in the inheritance chain.\n * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps\n */\n uint256[50] private __gap;\n}\n"},"@openzeppelin/contracts-upgradeable/utils/AddressUpgradeable.sol":{"content":"// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.8.0) (utils/Address.sol)\n\npragma solidity ^0.8.1;\n\n/**\n * @dev Collection of functions related to the address type\n */\nlibrary AddressUpgradeable {\n /**\n * @dev Returns true if `account` is a contract.\n *\n * [IMPORTANT]\n * ====\n * It is unsafe to assume that an address for which this function returns\n * false is an externally-owned account (EOA) and not a contract.\n *\n * Among others, `isContract` will return false for the following\n * types of addresses:\n *\n * - an externally-owned account\n * - a contract in construction\n * - an address where a contract will be created\n * - an address where a contract lived, but was destroyed\n * ====\n *\n * [IMPORTANT]\n * ====\n * You shouldn't rely on `isContract` to protect against flash loan attacks!\n *\n * Preventing calls from contracts is highly discouraged. It breaks composability, breaks support for smart wallets\n * like Gnosis Safe, and does not provide security since it can be circumvented by calling from a contract\n * constructor.\n * ====\n */\n function isContract(address account) internal view returns (bool) {\n // This method relies on extcodesize/address.code.length, which returns 0\n // for contracts in construction, since the code is only stored at the end\n // of the constructor execution.\n\n return account.code.length > 0;\n }\n\n /**\n * @dev Replacement for Solidity's `transfer`: sends `amount` wei to\n * `recipient`, forwarding all available gas and reverting on errors.\n *\n * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost\n * of certain opcodes, possibly making contracts go over the 2300 gas limit\n * imposed by `transfer`, making them unable to receive funds via\n * `transfer`. {sendValue} removes this limitation.\n *\n * https://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more].\n *\n * IMPORTANT: because control is transferred to `recipient`, care must be\n * taken to not create reentrancy vulnerabilities. Consider using\n * {ReentrancyGuard} or the\n * https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].\n */\n function sendValue(address payable recipient, uint256 amount) internal {\n require(address(this).balance >= amount, \"Address: insufficient balance\");\n\n (bool success, ) = recipient.call{value: amount}(\"\");\n require(success, \"Address: unable to send value, recipient may have reverted\");\n }\n\n /**\n * @dev Performs a Solidity function call using a low level `call`. A\n * plain `call` is an unsafe replacement for a function call: use this\n * function instead.\n *\n * If `target` reverts with a revert reason, it is bubbled up by this\n * function (like regular Solidity function calls).\n *\n * Returns the raw returned data. To convert to the expected return value,\n * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`].\n *\n * Requirements:\n *\n * - `target` must be a contract.\n * - calling `target` with `data` must not revert.\n *\n * _Available since v3.1._\n */\n function functionCall(address target, bytes memory data) internal returns (bytes memory) {\n return functionCallWithValue(target, data, 0, \"Address: low-level call failed\");\n }\n\n /**\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with\n * `errorMessage` as a fallback revert reason when `target` reverts.\n *\n * _Available since v3.1._\n */\n function functionCall(\n address target,\n bytes memory data,\n string memory errorMessage\n ) internal returns (bytes memory) {\n return functionCallWithValue(target, data, 0, errorMessage);\n }\n\n /**\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\n * but also transferring `value` wei to `target`.\n *\n * Requirements:\n *\n * - the calling contract must have an ETH balance of at least `value`.\n * - the called Solidity function must be `payable`.\n *\n * _Available since v3.1._\n */\n function functionCallWithValue(\n address target,\n bytes memory data,\n uint256 value\n ) internal returns (bytes memory) {\n return functionCallWithValue(target, data, value, \"Address: low-level call with value failed\");\n }\n\n /**\n * @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but\n * with `errorMessage` as a fallback revert reason when `target` reverts.\n *\n * _Available since v3.1._\n */\n function functionCallWithValue(\n address target,\n bytes memory data,\n uint256 value,\n string memory errorMessage\n ) internal returns (bytes memory) {\n require(address(this).balance >= value, \"Address: insufficient balance for call\");\n (bool success, bytes memory returndata) = target.call{value: value}(data);\n return verifyCallResultFromTarget(target, success, returndata, errorMessage);\n }\n\n /**\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\n * but performing a static call.\n *\n * _Available since v3.3._\n */\n function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) {\n return functionStaticCall(target, data, \"Address: low-level static call failed\");\n }\n\n /**\n * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\n * but performing a static call.\n *\n * _Available since v3.3._\n */\n function functionStaticCall(\n address target,\n bytes memory data,\n string memory errorMessage\n ) internal view returns (bytes memory) {\n (bool success, bytes memory returndata) = target.staticcall(data);\n return verifyCallResultFromTarget(target, success, returndata, errorMessage);\n }\n\n /**\n * @dev Tool to verify that a low level call to smart-contract was successful, and revert (either by bubbling\n * the revert reason or using the provided one) in case of unsuccessful call or if target was not a contract.\n *\n * _Available since v4.8._\n */\n function verifyCallResultFromTarget(\n address target,\n bool success,\n bytes memory returndata,\n string memory errorMessage\n ) internal view returns (bytes memory) {\n if (success) {\n if (returndata.length == 0) {\n // only check isContract if the call was successful and the return data is empty\n // otherwise we already know that it was a contract\n require(isContract(target), \"Address: call to non-contract\");\n }\n return returndata;\n } else {\n _revert(returndata, errorMessage);\n }\n }\n\n /**\n * @dev Tool to verify that a low level call was successful, and revert if it wasn't, either by bubbling the\n * revert reason or using the provided one.\n *\n * _Available since v4.3._\n */\n function verifyCallResult(\n bool success,\n bytes memory returndata,\n string memory errorMessage\n ) internal pure returns (bytes memory) {\n if (success) {\n return returndata;\n } else {\n _revert(returndata, errorMessage);\n }\n }\n\n function _revert(bytes memory returndata, string memory errorMessage) private pure {\n // Look for revert reason and bubble it up if present\n if (returndata.length > 0) {\n // The easiest way to bubble the revert reason is using memory via assembly\n /// @solidity memory-safe-assembly\n assembly {\n let returndata_size := mload(returndata)\n revert(add(32, returndata), returndata_size)\n }\n } else {\n revert(errorMessage);\n }\n }\n}\n"},"@openzeppelin/contracts-upgradeable/utils/ContextUpgradeable.sol":{"content":"// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (utils/Context.sol)\n\npragma solidity ^0.8.0;\nimport \"../proxy/utils/Initializable.sol\";\n\n/**\n * @dev Provides information about the current execution context, including the\n * sender of the transaction and its data. While these are generally available\n * via msg.sender and msg.data, they should not be accessed in such a direct\n * manner, since when dealing with meta-transactions the account sending and\n * paying for execution may not be the actual sender (as far as an application\n * is concerned).\n *\n * This contract is only required for intermediate, library-like contracts.\n */\nabstract contract ContextUpgradeable is Initializable {\n function __Context_init() internal onlyInitializing {\n }\n\n function __Context_init_unchained() internal onlyInitializing {\n }\n function _msgSender() internal view virtual returns (address) {\n return msg.sender;\n }\n\n function _msgData() internal view virtual returns (bytes calldata) {\n return msg.data;\n }\n\n /**\n * @dev This empty reserved space is put in place to allow future versions to add new\n * variables without shifting down storage in the inheritance chain.\n * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps\n */\n uint256[50] private __gap;\n}\n"},"@openzeppelin/contracts-upgradeable/utils/StorageSlotUpgradeable.sol":{"content":"// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.7.0) (utils/StorageSlot.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @dev Library for reading and writing primitive types to specific storage slots.\n *\n * Storage slots are often used to avoid storage conflict when dealing with upgradeable contracts.\n * This library helps with reading and writing to such slots without the need for inline assembly.\n *\n * The functions in this library return Slot structs that contain a `value` member that can be used to read or write.\n *\n * Example usage to set ERC1967 implementation slot:\n * ```\n * contract ERC1967 {\n * bytes32 internal constant _IMPLEMENTATION_SLOT = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc;\n *\n * function _getImplementation() internal view returns (address) {\n * return StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value;\n * }\n *\n * function _setImplementation(address newImplementation) internal {\n * require(Address.isContract(newImplementation), \"ERC1967: new implementation is not a contract\");\n * StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value = newImplementation;\n * }\n * }\n * ```\n *\n * _Available since v4.1 for `address`, `bool`, `bytes32`, and `uint256`._\n */\nlibrary StorageSlotUpgradeable {\n struct AddressSlot {\n address value;\n }\n\n struct BooleanSlot {\n bool value;\n }\n\n struct Bytes32Slot {\n bytes32 value;\n }\n\n struct Uint256Slot {\n uint256 value;\n }\n\n /**\n * @dev Returns an `AddressSlot` with member `value` located at `slot`.\n */\n function getAddressSlot(bytes32 slot) internal pure returns (AddressSlot storage r) {\n /// @solidity memory-safe-assembly\n assembly {\n r.slot := slot\n }\n }\n\n /**\n * @dev Returns an `BooleanSlot` with member `value` located at `slot`.\n */\n function getBooleanSlot(bytes32 slot) internal pure returns (BooleanSlot storage r) {\n /// @solidity memory-safe-assembly\n assembly {\n r.slot := slot\n }\n }\n\n /**\n * @dev Returns an `Bytes32Slot` with member `value` located at `slot`.\n */\n function getBytes32Slot(bytes32 slot) internal pure returns (Bytes32Slot storage r) {\n /// @solidity memory-safe-assembly\n assembly {\n r.slot := slot\n }\n }\n\n /**\n * @dev Returns an `Uint256Slot` with member `value` located at `slot`.\n */\n function getUint256Slot(bytes32 slot) internal pure returns (Uint256Slot storage r) {\n /// @solidity memory-safe-assembly\n assembly {\n r.slot := slot\n }\n }\n}\n"},"@openzeppelin/contracts/access/Ownable.sol":{"content":"// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (access/Ownable.sol)\n\npragma solidity ^0.8.0;\n\nimport \"../utils/Context.sol\";\n\n/**\n * @dev Contract module which provides a basic access control mechanism, where\n * there is an account (an owner) that can be granted exclusive access to\n * specific functions.\n *\n * By default, the owner account will be the one that deploys the contract. This\n * can later be changed with {transferOwnership}.\n *\n * This module is used through inheritance. It will make available the modifier\n * `onlyOwner`, which can be applied to your functions to restrict their use to\n * the owner.\n */\nabstract contract Ownable is Context {\n address private _owner;\n\n event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);\n\n /**\n * @dev Initializes the contract setting the deployer as the initial owner.\n */\n constructor() {\n _transferOwnership(_msgSender());\n }\n\n /**\n * @dev Returns the address of the current owner.\n */\n function owner() public view virtual returns (address) {\n return _owner;\n }\n\n /**\n * @dev Throws if called by any account other than the owner.\n */\n modifier onlyOwner() {\n require(owner() == _msgSender(), \"Ownable: caller is not the owner\");\n _;\n }\n\n /**\n * @dev Leaves the contract without owner. It will not be possible to call\n * `onlyOwner` functions anymore. Can only be called by the current owner.\n *\n * NOTE: Renouncing ownership will leave the contract without an owner,\n * thereby removing any functionality that is only available to the owner.\n */\n function renounceOwnership() public virtual onlyOwner {\n _transferOwnership(address(0));\n }\n\n /**\n * @dev Transfers ownership of the contract to a new account (`newOwner`).\n * Can only be called by the current owner.\n */\n function transferOwnership(address newOwner) public virtual onlyOwner {\n require(newOwner != address(0), \"Ownable: new owner is the zero address\");\n _transferOwnership(newOwner);\n }\n\n /**\n * @dev Transfers ownership of the contract to a new account (`newOwner`).\n * Internal function without access restriction.\n */\n function _transferOwnership(address newOwner) internal virtual {\n address oldOwner = _owner;\n _owner = newOwner;\n emit OwnershipTransferred(oldOwner, newOwner);\n }\n}\n"},"@openzeppelin/contracts/token/ERC20/ERC20.sol":{"content":"// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (token/ERC20/ERC20.sol)\n\npragma solidity ^0.8.0;\n\nimport \"./IERC20.sol\";\nimport \"./extensions/IERC20Metadata.sol\";\nimport \"../../utils/Context.sol\";\n\n/**\n * @dev Implementation of the {IERC20} interface.\n *\n * This implementation is agnostic to the way tokens are created. This means\n * that a supply mechanism has to be added in a derived contract using {_mint}.\n * For a generic mechanism see {ERC20PresetMinterPauser}.\n *\n * TIP: For a detailed writeup see our guide\n * https://forum.zeppelin.solutions/t/how-to-implement-erc20-supply-mechanisms/226[How\n * to implement supply mechanisms].\n *\n * We have followed general OpenZeppelin Contracts guidelines: functions revert\n * instead returning `false` on failure. This behavior is nonetheless\n * conventional and does not conflict with the expectations of ERC20\n * applications.\n *\n * Additionally, an {Approval} event is emitted on calls to {transferFrom}.\n * This allows applications to reconstruct the allowance for all accounts just\n * by listening to said events. Other implementations of the EIP may not emit\n * these events, as it isn't required by the specification.\n *\n * Finally, the non-standard {decreaseAllowance} and {increaseAllowance}\n * functions have been added to mitigate the well-known issues around setting\n * allowances. See {IERC20-approve}.\n */\ncontract ERC20 is Context, IERC20, IERC20Metadata {\n mapping(address => uint256) private _balances;\n\n mapping(address => mapping(address => uint256)) private _allowances;\n\n uint256 private _totalSupply;\n\n string private _name;\n string private _symbol;\n\n /**\n * @dev Sets the values for {name} and {symbol}.\n *\n * The default value of {decimals} is 18. To select a different value for\n * {decimals} you should overload it.\n *\n * All two of these values are immutable: they can only be set once during\n * construction.\n */\n constructor(string memory name_, string memory symbol_) {\n _name = name_;\n _symbol = symbol_;\n }\n\n /**\n * @dev Returns the name of the token.\n */\n function name() public view virtual override returns (string memory) {\n return _name;\n }\n\n /**\n * @dev Returns the symbol of the token, usually a shorter version of the\n * name.\n */\n function symbol() public view virtual override returns (string memory) {\n return _symbol;\n }\n\n /**\n * @dev Returns the number of decimals used to get its user representation.\n * For example, if `decimals` equals `2`, a balance of `505` tokens should\n * be displayed to a user as `5.05` (`505 / 10 ** 2`).\n *\n * Tokens usually opt for a value of 18, imitating the relationship between\n * Ether and Wei. This is the value {ERC20} uses, unless this function is\n * overridden;\n *\n * NOTE: This information is only used for _display_ purposes: it in\n * no way affects any of the arithmetic of the contract, including\n * {IERC20-balanceOf} and {IERC20-transfer}.\n */\n function decimals() public view virtual override returns (uint8) {\n return 18;\n }\n\n /**\n * @dev See {IERC20-totalSupply}.\n */\n function totalSupply() public view virtual override returns (uint256) {\n return _totalSupply;\n }\n\n /**\n * @dev See {IERC20-balanceOf}.\n */\n function balanceOf(address account) public view virtual override returns (uint256) {\n return _balances[account];\n }\n\n /**\n * @dev See {IERC20-transfer}.\n *\n * Requirements:\n *\n * - `recipient` cannot be the zero address.\n * - the caller must have a balance of at least `amount`.\n */\n function transfer(address recipient, uint256 amount) public virtual override returns (bool) {\n _transfer(_msgSender(), recipient, amount);\n return true;\n }\n\n /**\n * @dev See {IERC20-allowance}.\n */\n function allowance(address owner, address spender) public view virtual override returns (uint256) {\n return _allowances[owner][spender];\n }\n\n /**\n * @dev See {IERC20-approve}.\n *\n * Requirements:\n *\n * - `spender` cannot be the zero address.\n */\n function approve(address spender, uint256 amount) public virtual override returns (bool) {\n _approve(_msgSender(), spender, amount);\n return true;\n }\n\n /**\n * @dev See {IERC20-transferFrom}.\n *\n * Emits an {Approval} event indicating the updated allowance. This is not\n * required by the EIP. See the note at the beginning of {ERC20}.\n *\n * Requirements:\n *\n * - `sender` and `recipient` cannot be the zero address.\n * - `sender` must have a balance of at least `amount`.\n * - the caller must have allowance for ``sender``'s tokens of at least\n * `amount`.\n */\n function transferFrom(\n address sender,\n address recipient,\n uint256 amount\n ) public virtual override returns (bool) {\n _transfer(sender, recipient, amount);\n\n uint256 currentAllowance = _allowances[sender][_msgSender()];\n require(currentAllowance >= amount, \"ERC20: transfer amount exceeds allowance\");\n unchecked {\n _approve(sender, _msgSender(), currentAllowance - amount);\n }\n\n return true;\n }\n\n /**\n * @dev Atomically increases the allowance granted to `spender` by the caller.\n *\n * This is an alternative to {approve} that can be used as a mitigation for\n * problems described in {IERC20-approve}.\n *\n * Emits an {Approval} event indicating the updated allowance.\n *\n * Requirements:\n *\n * - `spender` cannot be the zero address.\n */\n function increaseAllowance(address spender, uint256 addedValue) public virtual returns (bool) {\n _approve(_msgSender(), spender, _allowances[_msgSender()][spender] + addedValue);\n return true;\n }\n\n /**\n * @dev Atomically decreases the allowance granted to `spender` by the caller.\n *\n * This is an alternative to {approve} that can be used as a mitigation for\n * problems described in {IERC20-approve}.\n *\n * Emits an {Approval} event indicating the updated allowance.\n *\n * Requirements:\n *\n * - `spender` cannot be the zero address.\n * - `spender` must have allowance for the caller of at least\n * `subtractedValue`.\n */\n function decreaseAllowance(address spender, uint256 subtractedValue) public virtual returns (bool) {\n uint256 currentAllowance = _allowances[_msgSender()][spender];\n require(currentAllowance >= subtractedValue, \"ERC20: decreased allowance below zero\");\n unchecked {\n _approve(_msgSender(), spender, currentAllowance - subtractedValue);\n }\n\n return true;\n }\n\n /**\n * @dev Moves `amount` of tokens from `sender` to `recipient`.\n *\n * This internal function is equivalent to {transfer}, and can be used to\n * e.g. implement automatic token fees, slashing mechanisms, etc.\n *\n * Emits a {Transfer} event.\n *\n * Requirements:\n *\n * - `sender` cannot be the zero address.\n * - `recipient` cannot be the zero address.\n * - `sender` must have a balance of at least `amount`.\n */\n function _transfer(\n address sender,\n address recipient,\n uint256 amount\n ) internal virtual {\n require(sender != address(0), \"ERC20: transfer from the zero address\");\n require(recipient != address(0), \"ERC20: transfer to the zero address\");\n\n _beforeTokenTransfer(sender, recipient, amount);\n\n uint256 senderBalance = _balances[sender];\n require(senderBalance >= amount, \"ERC20: transfer amount exceeds balance\");\n unchecked {\n _balances[sender] = senderBalance - amount;\n }\n _balances[recipient] += amount;\n\n emit Transfer(sender, recipient, amount);\n\n _afterTokenTransfer(sender, recipient, amount);\n }\n\n /** @dev Creates `amount` tokens and assigns them to `account`, increasing\n * the total supply.\n *\n * Emits a {Transfer} event with `from` set to the zero address.\n *\n * Requirements:\n *\n * - `account` cannot be the zero address.\n */\n function _mint(address account, uint256 amount) internal virtual {\n require(account != address(0), \"ERC20: mint to the zero address\");\n\n _beforeTokenTransfer(address(0), account, amount);\n\n _totalSupply += amount;\n _balances[account] += amount;\n emit Transfer(address(0), account, amount);\n\n _afterTokenTransfer(address(0), account, amount);\n }\n\n /**\n * @dev Destroys `amount` tokens from `account`, reducing the\n * total supply.\n *\n * Emits a {Transfer} event with `to` set to the zero address.\n *\n * Requirements:\n *\n * - `account` cannot be the zero address.\n * - `account` must have at least `amount` tokens.\n */\n function _burn(address account, uint256 amount) internal virtual {\n require(account != address(0), \"ERC20: burn from the zero address\");\n\n _beforeTokenTransfer(account, address(0), amount);\n\n uint256 accountBalance = _balances[account];\n require(accountBalance >= amount, \"ERC20: burn amount exceeds balance\");\n unchecked {\n _balances[account] = accountBalance - amount;\n }\n _totalSupply -= amount;\n\n emit Transfer(account, address(0), amount);\n\n _afterTokenTransfer(account, address(0), amount);\n }\n\n /**\n * @dev Sets `amount` as the allowance of `spender` over the `owner` s tokens.\n *\n * This internal function is equivalent to `approve`, and can be used to\n * e.g. set automatic allowances for certain subsystems, etc.\n *\n * Emits an {Approval} event.\n *\n * Requirements:\n *\n * - `owner` cannot be the zero address.\n * - `spender` cannot be the zero address.\n */\n function _approve(\n address owner,\n address spender,\n uint256 amount\n ) internal virtual {\n require(owner != address(0), \"ERC20: approve from the zero address\");\n require(spender != address(0), \"ERC20: approve to the zero address\");\n\n _allowances[owner][spender] = amount;\n emit Approval(owner, spender, amount);\n }\n\n /**\n * @dev Hook that is called before any transfer of tokens. This includes\n * minting and burning.\n *\n * Calling conditions:\n *\n * - when `from` and `to` are both non-zero, `amount` of ``from``'s tokens\n * will be transferred to `to`.\n * - when `from` is zero, `amount` tokens will be minted for `to`.\n * - when `to` is zero, `amount` of ``from``'s tokens will be burned.\n * - `from` and `to` are never both zero.\n *\n * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks].\n */\n function _beforeTokenTransfer(\n address from,\n address to,\n uint256 amount\n ) internal virtual {}\n\n /**\n * @dev Hook that is called after any transfer of tokens. This includes\n * minting and burning.\n *\n * Calling conditions:\n *\n * - when `from` and `to` are both non-zero, `amount` of ``from``'s tokens\n * has been transferred to `to`.\n * - when `from` is zero, `amount` tokens have been minted for `to`.\n * - when `to` is zero, `amount` of ``from``'s tokens have been burned.\n * - `from` and `to` are never both zero.\n *\n * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks].\n */\n function _afterTokenTransfer(\n address from,\n address to,\n uint256 amount\n ) internal virtual {}\n}\n"},"@openzeppelin/contracts/token/ERC20/extensions/IERC20Metadata.sol":{"content":"// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (token/ERC20/extensions/IERC20Metadata.sol)\n\npragma solidity ^0.8.0;\n\nimport \"../IERC20.sol\";\n\n/**\n * @dev Interface for the optional metadata functions from the ERC20 standard.\n *\n * _Available since v4.1._\n */\ninterface IERC20Metadata is IERC20 {\n /**\n * @dev Returns the name of the token.\n */\n function name() external view returns (string memory);\n\n /**\n * @dev Returns the symbol of the token.\n */\n function symbol() external view returns (string memory);\n\n /**\n * @dev Returns the decimals places of the token.\n */\n function decimals() external view returns (uint8);\n}\n"},"@openzeppelin/contracts/token/ERC20/IERC20.sol":{"content":"// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (token/ERC20/IERC20.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @dev Interface of the ERC20 standard as defined in the EIP.\n */\ninterface IERC20 {\n /**\n * @dev Returns the amount of tokens in existence.\n */\n function totalSupply() external view returns (uint256);\n\n /**\n * @dev Returns the amount of tokens owned by `account`.\n */\n function balanceOf(address account) external view returns (uint256);\n\n /**\n * @dev Moves `amount` tokens from the caller's account to `recipient`.\n *\n * Returns a boolean value indicating whether the operation succeeded.\n *\n * Emits a {Transfer} event.\n */\n function transfer(address recipient, uint256 amount) external returns (bool);\n\n /**\n * @dev Returns the remaining number of tokens that `spender` will be\n * allowed to spend on behalf of `owner` through {transferFrom}. This is\n * zero by default.\n *\n * This value changes when {approve} or {transferFrom} are called.\n */\n function allowance(address owner, address spender) external view returns (uint256);\n\n /**\n * @dev Sets `amount` as the allowance of `spender` over the caller's tokens.\n *\n * Returns a boolean value indicating whether the operation succeeded.\n *\n * IMPORTANT: Beware that changing an allowance with this method brings the risk\n * that someone may use both the old and the new allowance by unfortunate\n * transaction ordering. One possible solution to mitigate this race\n * condition is to first reduce the spender's allowance to 0 and set the\n * desired value afterwards:\n * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729\n *\n * Emits an {Approval} event.\n */\n function approve(address spender, uint256 amount) external returns (bool);\n\n /**\n * @dev Moves `amount` tokens from `sender` to `recipient` using the\n * allowance mechanism. `amount` is then deducted from the caller's\n * allowance.\n *\n * Returns a boolean value indicating whether the operation succeeded.\n *\n * Emits a {Transfer} event.\n */\n function transferFrom(\n address sender,\n address recipient,\n uint256 amount\n ) external returns (bool);\n\n /**\n * @dev Emitted when `value` tokens are moved from one account (`from`) to\n * another (`to`).\n *\n * Note that `value` may be zero.\n */\n event Transfer(address indexed from, address indexed to, uint256 value);\n\n /**\n * @dev Emitted when the allowance of a `spender` for an `owner` is set by\n * a call to {approve}. `value` is the new allowance.\n */\n event Approval(address indexed owner, address indexed spender, uint256 value);\n}\n"},"@openzeppelin/contracts/utils/Context.sol":{"content":"// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (utils/Context.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @dev Provides information about the current execution context, including the\n * sender of the transaction and its data. While these are generally available\n * via msg.sender and msg.data, they should not be accessed in such a direct\n * manner, since when dealing with meta-transactions the account sending and\n * paying for execution may not be the actual sender (as far as an application\n * is concerned).\n *\n * This contract is only required for intermediate, library-like contracts.\n */\nabstract contract Context {\n function _msgSender() internal view virtual returns (address) {\n return msg.sender;\n }\n\n function _msgData() internal view virtual returns (bytes calldata) {\n return msg.data;\n }\n}\n"},"contracts/chainlinkClient/ENSCache.sol":{"content":"// SPDX-License-Identifier: MIT\npragma solidity 0.8.9;\n\nimport \"@chainlink/contracts/src/v0.8/ChainlinkClient.sol\";\nimport \"@chainlink/contracts/src/v0.8/Chainlink.sol\";\nimport \"@openzeppelin/contracts/access/Ownable.sol\";\n\ninterface IStreamRegistry {\n // solhint-disable-next-line func-name-mixedcase\n function ENScreateStreamCallback(address requestorAddress, string memory ensName, string calldata streamIdPath, string calldata metadataJsonString) external;\n}\n\ncontract ENSCache is ChainlinkClient, Ownable {\n using Chainlink for Chainlink.Request;\n\n uint256 constant private ORACLE_PAYMENT = 0 * LINK_DIVISIBILITY;\n // uint256 constant private ORACLE_PAYMENT = 1;\n\n mapping(string => address) public owners;\n mapping(bytes32 => string) public tempENSnames;\n mapping(bytes32 => string) public tempIdPaths;\n mapping(bytes32 => string) public tempMetadatas;\n mapping(bytes32 => address) public tempRequestorAddress;\n\n address public oracle;\n string public jobId;\n IStreamRegistry private streamRegistry;\n\n constructor(address oracleAddress, string memory chainlinkJobId) ChainlinkClient() Ownable() {\n oracle = oracleAddress;\n jobId = chainlinkJobId;\n }\n\n function setOracleAddress(address oracleAddress) public onlyOwner {\n oracle = oracleAddress;\n }\n\n function setStreamRegistry(address streamRegistryAddress) public onlyOwner {\n streamRegistry = IStreamRegistry(streamRegistryAddress);\n }\n\n function setChainlinkTokenAddress(address _link) public onlyOwner {\n super.setChainlinkToken(_link);\n }\n\n function setChainlinkJobId(string calldata chainlinkJobId) public onlyOwner {\n jobId = chainlinkJobId;\n }\n\n /** Just update cache for ensName */\n function requestENSOwner(string calldata ensName) public {\n Chainlink.Request memory req = buildChainlinkRequest(stringToBytes32(jobId), address(this), this.fulfillENSOwner.selector);\n req.add(\"ensname\", ensName);\n bytes32 requestid = sendChainlinkRequestTo(oracle, req, ORACLE_PAYMENT);\n tempENSnames[requestid] = ensName;\n }\n\n /** Update cache and create a stream */\n function requestENSOwnerAndCreateStream(string calldata ensName, string calldata streamIdPath, string calldata metadataJsonString, address requestorAddress) public {\n require(bytes(streamIdPath).length > 0, \"error_emptyStreamIdPath\");\n Chainlink.Request memory req = buildChainlinkRequest(stringToBytes32(jobId), address(this), this.fulfillENSOwner.selector);\n req.add(\"ensname\", ensName);\n bytes32 requestid = sendChainlinkRequestTo(oracle, req, ORACLE_PAYMENT);\n tempRequestorAddress[requestid] = requestorAddress;\n tempENSnames[requestid] = ensName;\n tempIdPaths[requestid] = streamIdPath;\n tempMetadatas[requestid] = metadataJsonString;\n }\n\n function resetCacheForMyENSName(string calldata ensName) public {\n require(owners[ensName] == msg.sender, \"error_notOwnerOfThisENSName\");\n owners[ensName] = address(0);\n }\n\n function resetCacheForENSName(string calldata ensName) public onlyOwner {\n owners[ensName] = address(0);\n }\n\n /** Callback from Chainlink returning the results of the ENS lookup */\n function fulfillENSOwner(bytes32 requestId, bytes32 owneraddress) public recordChainlinkFulfillment(requestId) {\n owners[tempENSnames[requestId]] = address(uint160(uint256(owneraddress)));\n if (bytes(tempIdPaths[requestId]).length > 0) {\n streamRegistry.ENScreateStreamCallback(tempRequestorAddress[requestId], tempENSnames[requestId], tempIdPaths[requestId], tempMetadatas[requestId]);\n }\n }\n\n function getChainlinkToken() public view returns (address) {\n return chainlinkTokenAddress();\n }\n\n function withdrawLink() public onlyOwner {\n LinkTokenInterface link = LinkTokenInterface(chainlinkTokenAddress());\n require(link.transfer(_msgSender(), link.balanceOf(address(this))), \"Unable to transfer\");\n }\n\n function cancelRequest(bytes32 _requestId, uint256 _payment, bytes4 _callbackFunctionId,\n uint256 _expiration) public onlyOwner {\n cancelChainlinkRequest(_requestId, _payment, _callbackFunctionId, _expiration);\n }\n\n function stringToBytes32(string memory source) private pure returns (bytes32 result) {\n bytes memory tempEmptyStringTest = bytes(source);\n if (tempEmptyStringTest.length == 0) {\n return 0x0;\n }\n\n assembly { // solhint-disable-line no-inline-assembly\n result := mload(add(source, 32))\n }\n }\n}\n"},"contracts/chainlinkClient/ENSCacheV1.sol":{"content":"/**\n * Deployed on 2021-01-11 to 0x870528c1aDe8f5eB4676AA2d15FC0B034E276A1A\n */\n\n// SPDX-License-Identifier: MIT\npragma solidity 0.8.9;\n\nimport \"@chainlink/contracts/src/v0.8/ChainlinkClient.sol\";\nimport \"@chainlink/contracts/src/v0.8/Chainlink.sol\";\nimport \"@openzeppelin/contracts/access/Ownable.sol\";\n\ninterface IStreamRegistry {\n // solhint-disable-next-line func-name-mixedcase\n function ENScreateStreamCallback(address requestorAddress, string memory ensName, string calldata streamIdPath, string calldata metadataJsonString) external;\n}\n\ncontract ENSCacheV1 is ChainlinkClient, Ownable {\n using Chainlink for Chainlink.Request;\n\n uint256 constant private ORACLE_PAYMENT = 0 * LINK_DIVISIBILITY;\n // uint256 constant private ORACLE_PAYMENT = 1;\n\n mapping(string => address) public owners;\n mapping(bytes32 => string) public tempENSnames;\n mapping(bytes32 => string) public tempIdPaths;\n mapping(bytes32 => string) public tempMetadatas;\n mapping(bytes32 => address) public tempRequestorAddress;\n\n address public oracle;\n string public jobId;\n IStreamRegistry private streamRegistry;\n\n constructor(address oracleAddress, string memory chainlinkJobId) ChainlinkClient() Ownable() {\n oracle = oracleAddress;\n jobId = chainlinkJobId;\n }\n\n function setOracleAddress(address oracleAddress) public onlyOwner {\n oracle = oracleAddress;\n }\n\n function setStreamRegistry(address streamRegistryAddress) public onlyOwner {\n streamRegistry = IStreamRegistry(streamRegistryAddress);\n }\n\n function setChainlinkTokenAddress(address _link) public onlyOwner {\n super.setChainlinkToken(_link);\n }\n\n function setChainlinkJobId(string calldata chainlinkJobId) public onlyOwner {\n jobId = chainlinkJobId;\n }\n\n /** Just update cache for ensName */\n function requestENSOwner(string calldata ensName) public {\n Chainlink.Request memory req = buildChainlinkRequest(stringToBytes32(jobId), address(this), this.fulfillENSOwner.selector);\n req.add(\"ensname\", ensName);\n bytes32 requestid = sendChainlinkRequestTo(oracle, req, ORACLE_PAYMENT);\n tempENSnames[requestid] = ensName;\n }\n\n /** Update cache and create a stream */\n function requestENSOwnerAndCreateStream(string calldata ensName, string calldata streamIdPath, string calldata metadataJsonString, address requestorAddress) public {\n Chainlink.Request memory req = buildChainlinkRequest(stringToBytes32(jobId), address(this), this.fulfillENSOwner.selector);\n req.add(\"ensname\", ensName);\n bytes32 requestid = sendChainlinkRequestTo(oracle, req, ORACLE_PAYMENT);\n tempRequestorAddress[requestid] = requestorAddress;\n tempENSnames[requestid] = ensName;\n tempIdPaths[requestid] = streamIdPath;\n tempMetadatas[requestid] = metadataJsonString;\n }\n\n function fulfillENSOwner(bytes32 requestId, bytes32 owneraddress) public recordChainlinkFulfillment(requestId) {\n owners[tempENSnames[requestId]] = address(uint160(uint256(owneraddress)));\n streamRegistry.ENScreateStreamCallback(tempRequestorAddress[requestId], tempENSnames[requestId], tempIdPaths[requestId], tempMetadatas[requestId]);\n }\n\n function getChainlinkToken() public view returns (address) {\n return chainlinkTokenAddress();\n }\n\n function withdrawLink() public onlyOwner {\n LinkTokenInterface link = LinkTokenInterface(chainlinkTokenAddress());\n require(link.transfer(_msgSender(), link.balanceOf(address(this))), \"Unable to transfer\");\n }\n\n function cancelRequest(bytes32 _requestId, uint256 _payment, bytes4 _callbackFunctionId,\n uint256 _expiration) public onlyOwner {\n cancelChainlinkRequest(_requestId, _payment, _callbackFunctionId, _expiration);\n }\n\n function stringToBytes32(string memory source) private pure returns (bytes32 result) {\n bytes memory tempEmptyStringTest = bytes(source);\n if (tempEmptyStringTest.length == 0) {\n return 0x0;\n }\n\n assembly { // solhint-disable-line no-inline-assembly\n result := mload(add(source, 32))\n }\n }\n}"},"contracts/chainlinkClient/ENSCacheV2Streamr.sol":{"content":"/**\n * Deployed on 2021-01-11 to 0x870528c1aDe8f5eB4676AA2d15FC0B034E276A1A\n */\n\n// SPDX-License-Identifier: MIT\npragma solidity 0.8.9;\n\nimport \"./ENSCacheV1.sol\";\nimport \"@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol\";\nimport \"@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol\";\nimport \"@openzeppelin/contracts-upgradeable/proxy/utils/UUPSUpgradeable.sol\";\n\ncontract ENSCacheV2Streamr is Initializable, UUPSUpgradeable, OwnableUpgradeable {\n\n event RequestENSOwnerAndCreateStream(string ensName, string streamIdPath, string metadataJsonString, address requestorAddress);\n\n mapping(string => address) public owners;\n address private streamrScript; // TODO: make public\n IStreamRegistry private streamRegistry; // TODO: make public\n ENSCacheV1 private ensCacheV1; // TODO: make public\n\n modifier onlyStreamr() {\n require(msg.sender == address(streamrScript), \"onlyStreamrScript\");\n _;\n }\n\n modifier onlyStreamRegistry() {\n require(msg.sender == address(streamRegistry), \"onlyStreamRegistry\");\n _;\n }\n\n constructor() {\n }\n\n function initialize(address _streamrScript, IStreamRegistry _streamRegistry, ENSCacheV1 _ensCacheV1) public initializer {\n __Ownable_init();\n streamrScript = _streamrScript;\n streamRegistry = _streamRegistry;\n ensCacheV1 = _ensCacheV1;\n }\n\n function _authorizeUpgrade(address) internal override onlyOwner {}\n\n function setStreamRegistry(address streamRegistryAddress) public onlyOwner {\n streamRegistry = IStreamRegistry(streamRegistryAddress);\n }\n\n function setENSCacheV1(address ensCacheV1Address) public onlyOwner {\n ensCacheV1 = ENSCacheV1(ensCacheV1Address);\n }\n\n function setStreamrScript(address _streamrScript) public onlyOwner {\n streamrScript = _streamrScript;\n }\n\n /** Update cache and create a stream */\n function requestENSOwnerAndCreateStream(\n string calldata ensName,\n string calldata streamIdPath,\n string calldata metadataJsonString,\n address requestorAddress\n ) public onlyStreamRegistry() {\n address ownerAddress = address(ensCacheV1) != address(0) ? ensCacheV1.owners(ensName) : address(0);\n if (ownerAddress == requestorAddress) {\n owners[ensName] = ownerAddress;\n streamRegistry.ENScreateStreamCallback(ownerAddress, ensName, streamIdPath, metadataJsonString);\n } else {\n emit RequestENSOwnerAndCreateStream(ensName, streamIdPath, metadataJsonString, requestorAddress);\n }\n }\n\n function fulfillENSOwner(string calldata ensName, string calldata streamIdPath, string calldata metadataJsonString, address ownerAddress) public onlyStreamr() {\n owners[ensName] = ownerAddress;\n streamRegistry.ENScreateStreamCallback(ownerAddress, ensName, streamIdPath, metadataJsonString);\n }\n}"},"contracts/NodeRegistry/ERC20Mintable.sol":{"content":"// SPDX-License-Identifier: MIT\npragma solidity 0.8.9;\nimport \"@openzeppelin/contracts/token/ERC20/ERC20.sol\";\n\n/**\n * ERC20Mintable is missing from open-zeppelin 3.0\n * See https://forum.openzeppelin.com/t/where-is-erc20mintable-sol-in-openzeppelin-contracts-3-0/2283\n */\ncontract ERC20Mintable is ERC20 {\n address private creator;\n constructor(string memory name, string memory symbol) ERC20(name, symbol) {\n creator = msg.sender;\n }\n\n function mint(address receipient, uint amount) public {\n require(msg.sender == creator, \"only_creator\");\n _mint(receipient, amount);\n }\n}\n"},"contracts/NodeRegistry/NetworkParameters.sol":{"content":"// SPDX-License-Identifier: MIT\npragma solidity 0.8.9;\n\nimport \"./Ownable.sol\";\n\ncontract NetworkParameters is Ownable {\n uint public minControlLayerVersion;\n uint public minMessageLayerVersion;\n string public minNetworkReferenceCodeVersion;\n address public tokenAddress;\n\n constructor(address owner, uint minControlLayerVersion_, uint minMessageLayerVersion_, string memory minNetworkReferenceCodeVersion_, address tokenAddress_) Ownable(owner) {\n minControlLayerVersion = minControlLayerVersion_;\n minMessageLayerVersion = minMessageLayerVersion_;\n minNetworkReferenceCodeVersion = minNetworkReferenceCodeVersion_;\n tokenAddress = tokenAddress_;\n }\n\n function setMinControlLayerVersion(uint version) public onlyOwner {\n minControlLayerVersion = version;\n }\n\n function setMinMessageLayerVersion(uint version) public onlyOwner {\n minControlLayerVersion = version;\n }\n\n function setMinNetworkReferenceCodeVersion(string memory version) public onlyOwner {\n minNetworkReferenceCodeVersion = version;\n }\n\n function setTokenAddress(address tokenAddress_) public onlyOwner {\n tokenAddress = tokenAddress_;\n }\n}"},"contracts/NodeRegistry/NodeDomainNameHelper.sol":{"content":"// SPDX-License-Identifier: MIT\npragma solidity 0.8.9;\n\ncontract NodeDomainNameHelper {\n event Request(address indexed requestor, string indexed ipAddress, uint port);\n\n function request(string memory ipAddress, uint port) public {\n emit Request(msg.sender, ipAddress, port);\n }\n}"},"contracts/NodeRegistry/NodeRegistry.sol":{"content":"// SPDX-License-Identifier: MIT\npragma solidity 0.8.9;\npragma experimental ABIEncoderV2;\n\nimport \"@openzeppelin/contracts-upgradeable-4.4.2/proxy/utils/UUPSUpgradeable.sol\";\nimport \"@openzeppelin/contracts-upgradeable-4.4.2/access/OwnableUpgradeable.sol\";\nimport \"@openzeppelin/contracts-upgradeable-4.4.2/proxy/utils/Initializable.sol\";\n\n/**\n * @title NodeRegistry\n *\n * Streamr Network nodes register themselves here\n *\n * @dev OwnableUpgradable contract has an owner address, and provides basic authorization control functions.\n * @dev This simplifies the implementation of \"user permissions\".\n */\ncontract NodeRegistry is Initializable, UUPSUpgradeable, OwnableUpgradeable {\n\n // TODO: next version isNew should be boolean\n event NodeUpdated(address indexed nodeAddress, string metadata, uint indexed isNew, uint lastSeen);\n event NodeRemoved(address indexed nodeAddress);\n event NodeWhitelistApproved(address indexed nodeAddress);\n event NodeWhitelistRejected(address indexed nodeAddress);\n event RequiresWhitelistChanged(bool indexed value);\n\n enum WhitelistState {\n None,\n Approved,\n Rejected\n }\n\n struct Node {\n address nodeAddress; // Ethereum address of the node (unique id)\n string metadata; // Connection metadata, for example wss://node-domain-name:port\n uint lastSeen; // what's the best way to store timestamps in smart contracts?\n }\n\n struct NodeLinkedListItem {\n Node node;\n address next; //linked list\n address prev; //linked list\n }\n\n modifier whitelistOK() {\n require(!requiresWhitelist || whitelist[msg.sender] == WhitelistState.Approved, \"error_notApproved\");\n _;\n }\n\n uint64 public nodeCount;\n address public tailNode;\n address public headNode;\n bool public requiresWhitelist;\n mapping(address => NodeLinkedListItem) public nodes;\n mapping(address => WhitelistState) public whitelist;\n\n // Constructor can't be used with upgradeable contracts, so use initialize instead\n // this will not be called upon each upgrade, only once during first deployment\n function initialize(address owner, bool requiresWhitelist_, address[] memory initialNodes, string[] memory initialMetadata) public initializer {\n __Ownable_init();\n __UUPSUpgradeable_init();\n requiresWhitelist = requiresWhitelist_;\n require(initialNodes.length == initialMetadata.length, \"error_badTrackerData\");\n for (uint i = 0; i < initialNodes.length; i++) {\n createOrUpdateNode(initialNodes[i], initialMetadata[i]);\n }\n transferOwnership(owner);\n }\n function _authorizeUpgrade(address) internal override onlyOwner {}\n\n function getNode(address nodeAddress) public view returns (Node memory) {\n NodeLinkedListItem storage n = nodes[nodeAddress];\n return n.node;\n }\n\n // TODO: add function\n // function exists(address nodeAddress) public view returns (bool) {\n // NodeLinkedListItem storage n = nodes[nodeAddress];\n // return n.node.lastSeen != 0;\n // }\n\n // TODO: rename to adminCreateOrUpdateNode\n function createOrUpdateNode(address node, string memory metadata_) public onlyOwner {\n _createOrUpdateNode(node, metadata_);\n }\n\n // TODO: rename to createOrUpdateNode\n function createOrUpdateNodeSelf(string memory metadata_) public whitelistOK {\n _createOrUpdateNode(msg.sender, metadata_);\n }\n\n function _createOrUpdateNode(address nodeAddress, string memory metadata_) internal {\n NodeLinkedListItem storage n = nodes[nodeAddress];\n uint isNew = 0;\n if (n.node.lastSeen == 0) {\n isNew = 1;\n nodes[nodeAddress] = NodeLinkedListItem({\n node: Node({nodeAddress: nodeAddress, metadata: metadata_, lastSeen: block.timestamp}), // solhint-disable-line not-rely-on-time\n prev: tailNode, next: address(0)\n });\n nodeCount++;\n if (tailNode != address(0)) {\n NodeLinkedListItem storage prevNode = nodes[tailNode];\n prevNode.next = nodeAddress;\n }\n if (headNode == address(0)) {\n headNode = nodeAddress;\n }\n tailNode = nodeAddress;\n } else {\n n.node.metadata = metadata_;\n n.node.lastSeen = block.timestamp; // solhint-disable-line not-rely-on-time\n }\n emit NodeUpdated(nodeAddress, n.node.metadata, isNew, n.node.lastSeen);\n }\n\n function removeNode(address nodeAddress) public onlyOwner {\n _removeNode(nodeAddress);\n }\n function removeNodeSelf() public {\n _removeNode(msg.sender);\n }\n function _removeNode(address nodeAddress) internal {\n NodeLinkedListItem storage n = nodes[nodeAddress];\n require(n.node.lastSeen != 0, \"error_notFound\");\n if(n.prev != address(0)){\n NodeLinkedListItem storage prevNode = nodes[n.prev];\n prevNode.next = n.next;\n }\n if(n.next != address(0)){\n NodeLinkedListItem storage nextNode = nodes[n.next];\n nextNode.prev = n.prev;\n }\n nodeCount--;\n if(nodeAddress == tailNode) {\n NodeLinkedListItem storage tn = nodes[tailNode];\n tailNode = tn.prev;\n }\n if(nodeAddress == headNode) {\n NodeLinkedListItem storage hn = nodes[headNode];\n headNode = hn.next;\n }\n\n delete nodes[nodeAddress];\n emit NodeRemoved(nodeAddress);\n }\n\n function whitelistApproveNode(address nodeAddress) public onlyOwner {\n whitelist[nodeAddress] = WhitelistState.Approved;\n emit NodeWhitelistApproved(nodeAddress);\n }\n\n function whitelistRejectNode(address nodeAddress) public onlyOwner {\n whitelist[nodeAddress] = WhitelistState.Rejected;\n emit NodeWhitelistRejected(nodeAddress);\n }\n\n function kickOut(address nodeAddress) public onlyOwner {\n whitelistRejectNode(nodeAddress);\n removeNode(nodeAddress);\n }\n\n function setRequiresWhitelist(bool value) public onlyOwner {\n requiresWhitelist = value;\n emit RequiresWhitelistChanged(value);\n }\n /*\n this function is O(N) because we need linked list functionality.\n\n i=0 is first node\n */\n\n function getNodeByNumber(uint i) external view returns (Node memory) {\n require(i < nodeCount, \"error_indexOutOfBounds\");\n address currentNodeAddress = headNode;\n NodeLinkedListItem storage n = nodes[currentNodeAddress];\n for(uint nodeNum = 1; nodeNum <= i; nodeNum++){\n currentNodeAddress = n.next;\n n = nodes[currentNodeAddress];\n }\n return n.node;\n }\n\n function getNodes() external view returns (Node[] memory) {\n Node[] memory nodeArray = new Node[](nodeCount);\n address currentNodeAddress = headNode;\n for(uint nodeNum = 0; nodeNum < nodeCount; nodeNum++){\n NodeLinkedListItem storage n = nodes[currentNodeAddress];\n nodeArray[nodeNum] = n.node;\n currentNodeAddress = n.next;\n }\n return nodeArray;\n }\n}\n"},"contracts/NodeRegistry/Ownable.sol":{"content":"// SPDX-License-Identifier: MIT\npragma solidity 0.8.9;\n\n/**\n * @title Ownable\n * @dev The Ownable contract has an owner address, and provides basic authorization control\n * functions, this simplifies the implementation of \"user permissions\".\n */\ncontract Ownable {\n address public owner;\n address public pendingOwner;\n\n event OwnershipTransferred(\n address indexed previousOwner,\n address indexed newOwner\n );\n\n /**\n * @dev The Ownable constructor sets the original `owner` of the contract to the sender\n * account.\n */\n constructor(address owner_) {\n owner = owner_;\n }\n\n /**\n * @dev Throws if called by any account other than the owner.\n */\n modifier onlyOwner() {\n require(msg.sender == owner, \"onlyOwner\");\n _;\n }\n\n /**\n * @dev Allows the current owner to set the pendingOwner address.\n * @param newOwner The address to transfer ownership to.\n */\n function transferOwnership(address newOwner) public onlyOwner {\n pendingOwner = newOwner;\n }\n\n /**\n * @dev Allows the pendingOwner address to finalize the transfer.\n */\n function claimOwnership() public {\n require(msg.sender == pendingOwner, \"onlyPendingOwner\");\n emit OwnershipTransferred(owner, pendingOwner);\n owner = pendingOwner;\n pendingOwner = address(0);\n }\n}\n"},"contracts/NodeRegistry/TokenBalanceWeightStrategy.sol":{"content":"// SPDX-License-Identifier: MIT\npragma solidity 0.8.9;\n\nimport \"./WeightStrategy.sol\";\nimport \"@openzeppelin/contracts/token/ERC20/ERC20.sol\";\n\ncontract TokenBalanceWeightStrategy is WeightStrategy {\n ERC20 public token;\n\n constructor(address tokenAddress) {\n token = ERC20(tokenAddress);\n }\n\n function getWeight(address nodeAddress) public override view returns (uint) {\n return token.balanceOf(nodeAddress);\n }\n}\n"},"contracts/NodeRegistry/TrackerRegistry.sol":{"content":"// SPDX-License-Identifier: MIT\npragma solidity 0.8.9;\npragma experimental ABIEncoderV2;\n\nimport \"@openzeppelin/contracts/access/Ownable.sol\";\n\n/**\n * This is the original Noderegistry without the upgradable part that is deployed to the Mainnet and used as a tracker registry.\n * It is also deployed on the dev-env mainnet as a tracker registry.\n */\ncontract TrackerRegistry is Ownable {\n\n // TODO: next version isNew should be boolean\n event NodeUpdated(address indexed nodeAddress, string metadata, uint indexed isNew, uint lastSeen);\n event NodeRemoved(address indexed nodeAddress);\n event NodeWhitelistApproved(address indexed nodeAddress);\n event NodeWhitelistRejected(address indexed nodeAddress);\n event RequiresWhitelistChanged(bool indexed value);\n\n enum WhitelistState {\n None,\n Approved,\n Rejected\n }\n\n struct Node {\n address nodeAddress; // Ethereum address of the node (unique id)\n string metadata; // Connection metadata, for example wss://node-domain-name:port\n uint lastSeen; // what's the best way to store timestamps in smart contracts?\n }\n\n struct NodeLinkedListItem {\n Node node;\n address next; //linked list\n address prev; //linked list\n }\n\n modifier whitelistOK() {\n require(!requiresWhitelist || whitelist[msg.sender] == WhitelistState.Approved, \"error_notApproved\");\n _;\n }\n\n uint64 public nodeCount;\n address public tailNode;\n address public headNode;\n bool public requiresWhitelist;\n mapping(address => NodeLinkedListItem) public nodes;\n mapping(address => WhitelistState) public whitelist;\n\n constructor(address owner, bool requiresWhitelist_, address[] memory initialNodes, string[] memory initialMetadata) Ownable() { // Ownable(owner) {\n transferOwnership(owner);\n requiresWhitelist = requiresWhitelist_;\n require(initialNodes.length == initialMetadata.length, \"error_badTrackerData\");\n for (uint i = 0; i < initialNodes.length; i++) {\n createOrUpdateNode(initialNodes[i], initialMetadata[i]);\n }\n }\n\n function getNode(address nodeAddress) public view returns (Node memory) {\n NodeLinkedListItem storage n = nodes[nodeAddress];\n return n.node;\n }\n\n // TODO: add function\n // function exists(address nodeAddress) public view returns (bool) {\n // NodeLinkedListItem storage n = nodes[nodeAddress];\n // return n.node.lastSeen != 0;\n // }\n\n function createOrUpdateNode(address node, string memory metadata_) public onlyOwner {\n _createOrUpdateNode(node, metadata_);\n }\n\n function createOrUpdateNodeSelf(string memory metadata_) public whitelistOK {\n _createOrUpdateNode(msg.sender, metadata_);\n }\n\n function _createOrUpdateNode(address nodeAddress, string memory metadata_) internal {\n NodeLinkedListItem storage n = nodes[nodeAddress];\n uint isNew = 0;\n if (n.node.lastSeen == 0) {\n isNew = 1;\n nodes[nodeAddress] = NodeLinkedListItem({\n node: Node({nodeAddress: nodeAddress, metadata: metadata_, lastSeen: block.timestamp}), // solhint-disable-line not-rely-on-time\n prev: tailNode, next: address(0)\n });\n nodeCount++;\n if (tailNode != address(0)) {\n NodeLinkedListItem storage prevNode = nodes[tailNode];\n prevNode.next = nodeAddress;\n }\n if (headNode == address(0)) {\n headNode = nodeAddress;\n }\n tailNode = nodeAddress;\n } else {\n n.node.metadata = metadata_;\n n.node.lastSeen = block.timestamp; // solhint-disable-line not-rely-on-time\n }\n emit NodeUpdated(nodeAddress, n.node.metadata, isNew, n.node.lastSeen);\n }\n\n function removeNode(address nodeAddress) public onlyOwner {\n _removeNode(nodeAddress);\n }\n function removeNodeSelf() public {\n _removeNode(msg.sender);\n }\n function _removeNode(address nodeAddress) internal {\n NodeLinkedListItem storage n = nodes[nodeAddress];\n require(n.node.lastSeen != 0, \"error_notFound\");\n if(n.prev != address(0)){\n NodeLinkedListItem storage prevNode = nodes[n.prev];\n prevNode.next = n.next;\n }\n if(n.next != address(0)){\n NodeLinkedListItem storage nextNode = nodes[n.next];\n nextNode.prev = n.prev;\n }\n nodeCount--;\n if(nodeAddress == tailNode) {\n NodeLinkedListItem storage tn = nodes[tailNode];\n tailNode = tn.prev;\n }\n if(nodeAddress == headNode) {\n NodeLinkedListItem storage hn = nodes[headNode];\n headNode = hn.next;\n }\n\n delete nodes[nodeAddress];\n emit NodeRemoved(nodeAddress);\n }\n\n function whitelistApproveNode(address nodeAddress) public onlyOwner {\n whitelist[nodeAddress] = WhitelistState.Approved;\n emit NodeWhitelistApproved(nodeAddress);\n }\n\n function whitelistRejectNode(address nodeAddress) public onlyOwner {\n whitelist[nodeAddress] = WhitelistState.Rejected;\n emit NodeWhitelistRejected(nodeAddress);\n }\n\n function kickOut(address nodeAddress) public onlyOwner {\n whitelistRejectNode(nodeAddress);\n removeNode(nodeAddress);\n }\n\n function setRequiresWhitelist(bool value) public onlyOwner {\n requiresWhitelist = value;\n emit RequiresWhitelistChanged(value);\n }\n /*\n this function is O(N) because we need linked list functionality.\n\n i=0 is first node\n */\n\n function getNodeByNumber(uint i) external view returns (Node memory) {\n require(i < nodeCount, \"error_indexOutOfBounds\");\n address currentNodeAddress = headNode;\n NodeLinkedListItem storage n = nodes[currentNodeAddress];\n for(uint nodeNum = 1; nodeNum <= i; nodeNum++){\n currentNodeAddress = n.next;\n n = nodes[currentNodeAddress];\n }\n return n.node;\n }\n\n function getNodes() external view returns (Node[] memory) {\n Node[] memory nodeArray = new Node[](nodeCount);\n address currentNodeAddress = headNode;\n for(uint nodeNum = 0; nodeNum < nodeCount; nodeNum++){\n NodeLinkedListItem storage n = nodes[currentNodeAddress];\n nodeArray[nodeNum] = n.node;\n currentNodeAddress = n.next;\n }\n return nodeArray;\n }\n}"},"contracts/NodeRegistry/WeightedNodeRegistry.sol":{"content":"// SPDX-License-Identifier: MIT\npragma solidity 0.8.9;\npragma experimental ABIEncoderV2;\n\nimport \"./WeightStrategy.sol\";\nimport \"./NodeRegistry.sol\";\nimport \"@openzeppelin/contracts-upgradeable-4.4.2/proxy/utils/UUPSUpgradeable.sol\";\nimport \"@openzeppelin/contracts-upgradeable-4.4.2/proxy/utils/Initializable.sol\";\n\ncontract WeightedNodeRegistry is NodeRegistry {\n WeightStrategy public strat;\n\n // Constructor can't be used with upgradeable contracts, so use initialize instead\n // this will not be called upon each upgrade, only once during first deployment\n function initialize(address owner_, bool requiresWhitelist_, address weightStrategy_, address[] memory initialNodes, string[] memory initialUrls) public initializer {\n NodeRegistry.initialize(owner_, requiresWhitelist_, initialNodes, initialUrls);\n strat = WeightStrategy(weightStrategy_);\n }\n\n function getWeight(address nodeAddress) public view returns (uint) {\n return strat.getWeight(nodeAddress);\n }\n\n function setWeightStrategy(address weightStrategy_) public onlyOwner {\n strat = WeightStrategy(weightStrategy_);\n }\n}"},"contracts/NodeRegistry/WeightStrategy.sol":{"content":"// SPDX-License-Identifier: MIT\npragma solidity 0.8.9;\n\ninterface WeightStrategy {\n function getWeight(address nodeAddress) external view returns (uint);\n}"},"contracts/StreamRegistry/ERC2771ContextUpgradeable.sol":{"content":"// SPDX-License-Identifier: MIT\n\n// We forked this from OpenZeppelin's ERC2771ContextUpgradeable.sol and added the _setTrustedForwarder\n// function to be able to set the trusted forwarder address after deployment.\n\npragma solidity ^0.8.0;\n\nimport \"@openzeppelin/contracts-upgradeable-4.4.2/utils/ContextUpgradeable.sol\";\nimport \"@openzeppelin/contracts-upgradeable-4.4.2/proxy/utils/Initializable.sol\";\n\n/**\n * @dev Context variant with ERC2771 support.\n */\nabstract contract ERC2771ContextUpgradeable is Initializable, ContextUpgradeable {\n address private _trustedForwarder;\n\n // solhint-disable-next-line func-name-mixedcase\n function __ERC2771Context_init(address trustedForwarder) internal onlyInitializing {\n __Context_init_unchained();\n __ERC2771Context_init_unchained(trustedForwarder);\n }\n\n // solhint-disable-next-line func-name-mixedcase\n function __ERC2771Context_init_unchained(address trustedForwarder) internal onlyInitializing {\n _trustedForwarder = trustedForwarder;\n }\n\n function isTrustedForwarder(address forwarder) public view virtual returns (bool) {\n return forwarder == _trustedForwarder;\n }\n\n function _msgSender() internal view virtual override returns (address sender) {\n if (isTrustedForwarder(msg.sender)) {\n // The assembly code is more direct than the Solidity version using `abi.decode`.\n // solhint-disable-next-line no-inline-assembly\n assembly {\n sender := shr(96, calldataload(sub(calldatasize(), 20)))\n }\n } else {\n return super._msgSender();\n }\n }\n\n function _msgData() internal view virtual override returns (bytes calldata) {\n if (isTrustedForwarder(msg.sender)) {\n return msg.data[:msg.data.length - 20];\n } else {\n return super._msgData();\n }\n }\n uint256[49] private __gap;\n\n function _setTrustedForwarder(address trustedForwarder) internal {\n _trustedForwarder = trustedForwarder;\n }\n}\n"},"contracts/StreamRegistry/StreamRegistry.sol":{"content":"/**\n * Deployed on 2021-01-11 to 0x0D483E10612F327FC11965Fc82E90dC19b141641\n * DO NOT EDIT\n * Instead, make a copy with new version number\n */\n\n// SPDX-License-Identifier: MIT\npragma solidity 0.8.9;\npragma experimental ABIEncoderV2;\n/* solhint-disable not-rely-on-time */\n\nimport \"@openzeppelin/contracts-upgradeable-4.4.2/metatx/ERC2771ContextUpgradeable.sol\";\nimport \"@openzeppelin/contracts-upgradeable-4.4.2/proxy/utils/UUPSUpgradeable.sol\";\nimport \"../chainlinkClient/ENSCache.sol\";\nimport \"@openzeppelin/contracts-upgradeable-4.4.2/access/AccessControlUpgradeable.sol\";\nimport \"@openzeppelin/contracts-upgradeable-4.4.2/proxy/utils/Initializable.sol\";\n\ncontract StreamRegistry is Initializable, UUPSUpgradeable, ERC2771ContextUpgradeable, AccessControlUpgradeable {\n\n bytes32 public constant TRUSTED_ROLE = keccak256(\"TRUSTED_ROLE\");\n uint256 constant public MAX_INT = 0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff;\n\n event StreamCreated(string id, string metadata);\n event StreamDeleted(string id);\n event StreamUpdated(string id, string metadata);\n event PermissionUpdated(string streamId, address user, bool canEdit, bool canDelete, uint256 publishExpiration, uint256 subscribeExpiration, bool canGrant);\n\n enum PermissionType { Edit, Delete, Publish, Subscribe, Grant }\n\n struct Permission {\n bool canEdit;\n bool canDelete;\n uint256 publishExpiration;\n uint256 subscribeExpiration;\n bool canGrant;\n }\n\n // streamid -> keccak256(version, useraddress) -> permission struct above\n mapping (string => mapping(bytes32 => Permission)) public streamIdToPermissions;\n mapping (string => string) public streamIdToMetadata;\n ENSCache private ensCache;\n\n // incremented when stream is (re-)created, so that users from old streams with same don't re-appear in the new stream (if they have permissions)\n mapping (string => uint32) private streamIdToVersion;\n\n modifier hasGrantPermission(string calldata streamId) {\n require(streamIdToPermissions[streamId][getAddressKey(streamId, _msgSender())].canGrant, \"error_noSharePermission\"); //||\n _;\n }\n modifier hasSharePermissionOrIsRemovingOwn(string calldata streamId, address user) {\n require(streamIdToPermissions[streamId][getAddressKey(streamId, _msgSender())].canGrant ||\n _msgSender() == user, \"error_noSharePermission\"); //||\n _;\n }\n modifier hasDeletePermission(string calldata streamId) {\n require(streamIdToPermissions[streamId][getAddressKey(streamId, _msgSender())].canDelete, \"error_noDeletePermission\"); //||\n _;\n }\n modifier hasEditPermission(string calldata streamId) {\n require(streamIdToPermissions[streamId][getAddressKey(streamId, _msgSender())].canEdit, \"error_noEditPermission\"); //||\n _;\n }\n modifier streamExists(string calldata streamId) {\n require(exists(streamId), \"error_streamDoesNotExist\");\n _;\n }\n modifier isTrusted() {\n require(hasRole(TRUSTED_ROLE, _msgSender()), \"error_mustBeTrustedRole\");\n _;\n }\n\n // Constructor can't be used with upgradeable contracts, so use initialize instead\n // this will not be called upon each upgrade, only once during first deployment\n function initialize(address ensCacheAddr, address trustedForwarderAddress) public initializer {\n ensCache = ENSCache(ensCacheAddr);\n __AccessControl_init();\n _setupRole(DEFAULT_ADMIN_ROLE, msg.sender);\n ERC2771ContextUpgradeable.__ERC2771Context_init(trustedForwarderAddress);\n }\n\n function _authorizeUpgrade(address) internal override isTrusted() {}\n\n function _msgSender() internal view virtual override(ContextUpgradeable, ERC2771ContextUpgradeable) returns (address sender) {\n return super._msgSender();\n }\n\n function _msgData() internal view virtual override(ContextUpgradeable, ERC2771ContextUpgradeable) returns (bytes calldata) {\n return super._msgData();\n }\n\n function setEnsCache(address ensCacheAddr) public isTrusted() {\n ensCache = ENSCache(ensCacheAddr);\n }\n\n function createStream(string calldata streamIdPath, string calldata metadataJsonString) public {\n string memory ownerstring = addressToString(_msgSender());\n _createStreamAndPermission(ownerstring, streamIdPath, metadataJsonString);\n }\n\n function createStreamWithENS(string calldata ensName, string calldata streamIdPath, string calldata metadataJsonString) public {\n if (ensCache.owners(ensName) == _msgSender()) {\n _createStreamAndPermission(ensName, streamIdPath, metadataJsonString);\n } else {\n ensCache.requestENSOwnerAndCreateStream(ensName, streamIdPath, metadataJsonString, _msgSender());\n }\n }\n\n function exists(string calldata streamId) public view returns (bool) {\n return bytes(streamIdToMetadata[streamId]).length != 0;\n }\n\n /**\n * Called by the ENSCache when the lookup / update is complete\n */\n // solhint-disable-next-line func-name-mixedcase\n function ENScreateStreamCallback(address requestorAddress, string memory ensName, string calldata streamIdPath, string calldata metadataJsonString) public isTrusted() {\n require(ensCache.owners(ensName) == requestorAddress, \"error_notOwnerOfENSName\");\n _createStreamAndPermission(ensName, streamIdPath, metadataJsonString);\n }\n\n function _createStreamAndPermission(string memory ownerstring, string calldata streamIdPath, string calldata metadataJsonString) internal {\n require(bytes(metadataJsonString).length != 0, \"error_metadataJsonStringIsEmpty\");\n\n bytes memory pathBytes = bytes(streamIdPath);\n for (uint i = 1; i < pathBytes.length; i++) {\n // - . / 0 1 2 ... 9\n require((bytes1(\"-\") <= pathBytes[i] && pathBytes[i] <= bytes1(\"9\")) ||\n ((bytes1(\"A\") <= pathBytes[i] && pathBytes[i] <= bytes1(\"Z\"))) ||\n ((bytes1(\"a\") <= pathBytes[i] && pathBytes[i] <= bytes1(\"z\"))) ||\n pathBytes[i] == \"_\"\n , \"error_invalidPathChars\");\n }\n require(pathBytes[0] == \"/\", \"error_pathMustStartWithSlash\");\n\n // abi.encodePacked does simple string concatenation here\n string memory streamId = string(abi.encodePacked(ownerstring, streamIdPath));\n require(bytes(streamIdToMetadata[streamId]).length == 0, \"error_streamAlreadyExists\");\n\n streamIdToVersion[streamId] = streamIdToVersion[streamId] + 1;\n streamIdToMetadata[streamId] = metadataJsonString;\n streamIdToPermissions[streamId][getAddressKey(streamId, _msgSender())] = Permission({\n canEdit: true,\n canDelete: true,\n publishExpiration: MAX_INT,\n subscribeExpiration: MAX_INT,\n canGrant: true\n });\n emit StreamCreated(streamId, metadataJsonString);\n emit PermissionUpdated(streamId, _msgSender(), true, true, MAX_INT, MAX_INT, true);\n }\n\n function getAddressKey(string memory streamId, address user) public view returns (bytes32) {\n return keccak256(abi.encode(streamIdToVersion[streamId], user));\n }\n\n function updateStreamMetadata(string calldata streamId, string calldata metadata) public streamExists(streamId) hasEditPermission(streamId) {\n streamIdToMetadata[streamId] = metadata;\n emit StreamUpdated(streamId, metadata);\n }\n\n function getStreamMetadata(string calldata streamId) public view streamExists(streamId) returns (string memory des) {\n return streamIdToMetadata[streamId];\n }\n\n function deleteStream(string calldata streamId) public streamExists(streamId) hasDeletePermission(streamId) {\n delete streamIdToMetadata[streamId];\n emit StreamDeleted(streamId);\n }\n\n function getPermissionsForUser(string calldata streamId, address user) public view streamExists(streamId) returns (Permission memory permission) {\n permission = streamIdToPermissions[streamId][getAddressKey(streamId, user)];\n Permission memory publicPermission = streamIdToPermissions[streamId][getAddressKey(streamId, address(0))];\n if (permission.publishExpiration < block.timestamp && publicPermission.publishExpiration >= block.timestamp) {\n permission.publishExpiration = publicPermission.publishExpiration;\n }\n if (permission.subscribeExpiration < block.timestamp && publicPermission.subscribeExpiration >= block.timestamp) {\n permission.subscribeExpiration = publicPermission.subscribeExpiration;\n }\n return permission;\n }\n\n function getDirectPermissionsForUser(string calldata streamId, address user) public view streamExists(streamId) returns (Permission memory permission) {\n return streamIdToPermissions[streamId][getAddressKey(streamId, user)];\n }\n\n function setPermissionsForUser(string calldata streamId, address user, bool canEdit,\n bool deletePerm, uint256 publishExpiration, uint256 subscribeExpiration, bool canGrant) public hasGrantPermission(streamId) {\n _setPermissionBooleans(streamId, user, canEdit, deletePerm, publishExpiration, subscribeExpiration, canGrant);\n }\n\n function _setPermissionBooleans(string calldata streamId, address user, bool canEdit,\n bool deletePerm, uint256 publishExpiration, uint256 subscribeExpiration, bool canGrant) private {\n require(user != address(0) || !(canEdit || deletePerm || canGrant),\n \"error_publicCanOnlySubsPubl\");\n streamIdToPermissions[streamId][getAddressKey(streamId, user)] = Permission({\n canEdit: canEdit,\n canDelete: deletePerm,\n publishExpiration: publishExpiration,\n subscribeExpiration: subscribeExpiration,\n canGrant: canGrant\n });\n emit PermissionUpdated(streamId, user, canEdit, deletePerm, publishExpiration, subscribeExpiration, canGrant);\n }\n\n function revokeAllPermissionsForUser(string calldata streamId, address user) public hasSharePermissionOrIsRemovingOwn(streamId, user){\n delete streamIdToPermissions[streamId][getAddressKey(streamId, user)];\n emit PermissionUpdated(streamId, user, false, false, 0, 0, false);\n }\n\n function hasPermission(string calldata streamId, address user, PermissionType permissionType) public view returns (bool userHasPermission) {\n return hasDirectPermission(streamId, user, permissionType) ||\n hasDirectPermission(streamId, address(0), permissionType);\n }\n\n function hasPublicPermission(string calldata streamId, PermissionType permissionType) public view returns (bool userHasPermission) {\n return hasDirectPermission(streamId, address(0), permissionType);\n }\n\n function hasDirectPermission(string calldata streamId, address user, PermissionType permissionType) public view returns (bool userHasPermission) {\n if (permissionType == PermissionType.Edit) {\n return streamIdToPermissions[streamId][getAddressKey(streamId, user)].canEdit;\n }\n else if (permissionType == PermissionType.Delete) {\n return streamIdToPermissions[streamId][getAddressKey(streamId, user)].canDelete;\n }\n else if (permissionType == PermissionType.Publish) {\n return streamIdToPermissions[streamId][getAddressKey(streamId, user)].publishExpiration >= block.timestamp;\n }\n else if (permissionType == PermissionType.Subscribe) {\n return streamIdToPermissions[streamId][getAddressKey(streamId, user)].subscribeExpiration >= block.timestamp;\n }\n else if (permissionType == PermissionType.Grant) {\n return streamIdToPermissions[streamId][getAddressKey(streamId, user)].canGrant;\n }\n }\n\n function setPermissions(string calldata streamId, address[] calldata users, Permission[] calldata permissions) public hasGrantPermission(streamId) {\n require(users.length == permissions.length, \"error_invalidInputArrayLengths\");\n uint arrayLength = users.length;\n for (uint i=0; i<arrayLength; i++) {\n Permission memory permission = permissions[i];\n _setPermissionBooleans(streamId, users[i], permission.canEdit, permission.canDelete, permission.publishExpiration, permission.subscribeExpiration, permission.canGrant);\n emit PermissionUpdated(streamId, users[i], permission.canEdit, permission.canDelete, permission.publishExpiration, permission.subscribeExpiration, permission.canGrant);\n }\n }\n\n function grantPermission(string calldata streamId, address user, PermissionType permissionType) public hasGrantPermission(streamId) {\n _setPermission(streamId, user, permissionType, true);\n }\n\n function revokePermission(string calldata streamId, address user, PermissionType permissionType) public hasSharePermissionOrIsRemovingOwn(streamId, user) {\n _setPermission(streamId, user, permissionType, false);\n }\n\n function _setPermission(string calldata streamId, address user, PermissionType permissionType, bool grant) private {\n require(user != address(0) || permissionType == PermissionType.Subscribe || permissionType == PermissionType.Publish,\n \"error_publicCanOnlySubsPubl\");\n if (permissionType == PermissionType.Edit) {\n streamIdToPermissions[streamId][getAddressKey(streamId, user)].canEdit = grant;\n }\n else if (permissionType == PermissionType.Delete) {\n streamIdToPermissions[streamId][getAddressKey(streamId, user)].canDelete = grant;\n }\n else if (permissionType == PermissionType.Publish) {\n streamIdToPermissions[streamId][getAddressKey(streamId, user)].publishExpiration = grant ? MAX_INT : 0;\n }\n else if (permissionType == PermissionType.Subscribe) {\n streamIdToPermissions[streamId][getAddressKey(streamId, user)].subscribeExpiration = grant ? MAX_INT : 0;\n }\n else if (permissionType == PermissionType.Grant) {\n streamIdToPermissions[streamId][getAddressKey(streamId, user)].canGrant = grant;\n }\n Permission storage perm = streamIdToPermissions[streamId][getAddressKey(streamId, user)];\n emit PermissionUpdated(streamId, user, perm.canEdit, perm.canDelete, perm.publishExpiration, perm.subscribeExpiration, perm.canGrant);\n }\n\n function setExpirationTime(string calldata streamId, address user, PermissionType permissionType, uint256 expirationTime) public hasGrantPermission(streamId) {\n require(permissionType == PermissionType.Subscribe || permissionType == PermissionType.Publish, \"error_timeOnlyObPubSub\");\n if (permissionType == PermissionType.Publish) {\n streamIdToPermissions[streamId][getAddressKey(streamId, user)].publishExpiration = expirationTime;\n }\n else if (permissionType == PermissionType.Subscribe) {\n streamIdToPermissions[streamId][getAddressKey(streamId, user)].subscribeExpiration = expirationTime;\n }\n }\n\n function grantPublicPermission(string calldata streamId, PermissionType permissionType) public hasGrantPermission(streamId) {\n grantPermission(streamId, address(0), permissionType);\n }\n\n function revokePublicPermission(string calldata streamId, PermissionType permissionType) public hasGrantPermission(streamId) {\n revokePermission(streamId, address(0), permissionType);\n }\n\n function setPublicPermission(string calldata streamId, uint256 publishExpiration, uint256 subscribeExpiration) public hasGrantPermission(streamId) {\n setPermissionsForUser(streamId, address(0), false, false, publishExpiration, subscribeExpiration, false);\n }\n\n function transferAllPermissionsToUser(string calldata streamId, address recipient) public {\n Permission memory permSender = streamIdToPermissions[streamId][getAddressKey(streamId, _msgSender())];\n require(permSender.canEdit || permSender.canDelete || permSender.publishExpiration > 0 || permSender.subscribeExpiration > 0 ||\n permSender.canGrant, \"error_noPermissionToTransfer\");\n Permission memory permRecipient = streamIdToPermissions[streamId][getAddressKey(streamId, recipient)];\n uint256 publishExpiration = permSender.publishExpiration > permRecipient.publishExpiration ? permSender.publishExpiration : permRecipient.publishExpiration;\n uint256 subscribeExpiration = permSender.subscribeExpiration > permRecipient.subscribeExpiration ? permSender.subscribeExpiration : permRecipient.subscribeExpiration;\n _setPermissionBooleans(streamId, recipient, permSender.canEdit || permRecipient.canEdit, permSender.canDelete || permRecipient.canDelete,\n publishExpiration, subscribeExpiration, permSender.canGrant || permRecipient.canGrant);\n _setPermissionBooleans(streamId, _msgSender(), false, false, 0, 0, false);\n }\n\n function transferPermissionToUser(string calldata streamId, address recipient, PermissionType permissionType) public {\n require(hasDirectPermission(streamId, _msgSender(), permissionType), \"error_noPermissionToTransfer\");\n _setPermission(streamId, _msgSender(), permissionType, false);\n _setPermission(streamId, recipient, permissionType, true);\n }\n\n function trustedSetStreamMetadata(string calldata streamId, string calldata metadata) public isTrusted() {\n streamIdToMetadata[streamId] = metadata;\n emit StreamUpdated(streamId, metadata);\n }\n\n function trustedSetStreamWithPermission(\n string calldata streamId,\n string calldata metadata,\n address user,\n bool canEdit,\n bool deletePerm,\n uint256 publishExpiration,\n uint256 subscribeExpiration,\n bool canGrant\n ) public isTrusted() {\n streamIdToMetadata[streamId] = metadata;\n _setPermissionBooleans(streamId, user, canEdit, deletePerm, publishExpiration, subscribeExpiration, canGrant);\n emit StreamUpdated(streamId, metadata);\n }\n\n function trustedSetPermissionsForUser(\n string calldata streamId,\n address user,\n bool canEdit,\n bool deletePerm,\n uint256 publishExpiration,\n uint256 subscribeExpiration,\n bool canGrant\n ) public isTrusted() {\n _setPermissionBooleans(streamId, user, canEdit, deletePerm, publishExpiration, subscribeExpiration, canGrant);\n }\n\n function trustedSetStreams(string[] calldata streamids, address[] calldata users, string[] calldata metadatas, Permission[] calldata permissions) public isTrusted() {\n uint arrayLength = streamids.length;\n for (uint i = 0; i < arrayLength; i++) {\n string calldata streamId = streamids[i];\n streamIdToMetadata[streamId] = metadatas[i];\n Permission memory permission = permissions[i];\n _setPermissionBooleans(streamId, users[i], permission.canEdit, permission.canDelete, permission.publishExpiration, permission.subscribeExpiration, permission.canGrant);\n emit StreamCreated(streamId, metadatas[i]);\n emit PermissionUpdated(streamId, users[i], permission.canEdit, permission.canDelete, permission.publishExpiration, permission.subscribeExpiration, permission.canGrant);\n }\n }\n\n function addressToString(address _address) public pure returns(string memory) {\n bytes32 _bytes = bytes32(uint256(uint160(_address)));\n bytes memory _hex = \"0123456789abcdef\";\n bytes memory _string = new bytes(42);\n _string[0] = \"0\";\n _string[1] = \"x\";\n for(uint i = 0; i < 20; i++) {\n _string[2+i*2] = _hex[uint8(_bytes[i + 12] >> 4)];\n _string[3+i*2] = _hex[uint8(_bytes[i + 12] & 0x0f)];\n }\n return string(_string);\n }\n\n function getTrustedRole() public pure returns (bytes32) {\n return TRUSTED_ROLE;\n }\n}\n"},"contracts/StreamRegistry/StreamRegistryV2.sol":{"content":"/**\n * Upgraded on: 2021-01-12\n * DO NOT EDIT\n * Instead, make a copy with new version number\n */\n\n// SPDX-License-Identifier: MIT\npragma solidity 0.8.9;\npragma experimental ABIEncoderV2;\n/* solhint-disable not-rely-on-time */\n\nimport \"@openzeppelin/contracts-upgradeable-4.4.2/metatx/ERC2771ContextUpgradeable.sol\";\nimport \"@openzeppelin/contracts-upgradeable-4.4.2/proxy/utils/UUPSUpgradeable.sol\";\nimport \"../chainlinkClient/ENSCache.sol\";\nimport \"@openzeppelin/contracts-upgradeable-4.4.2/access/AccessControlUpgradeable.sol\";\nimport \"@openzeppelin/contracts-upgradeable-4.4.2/proxy/utils/Initializable.sol\";\n\ncontract StreamRegistryV2 is Initializable, UUPSUpgradeable, ERC2771ContextUpgradeable, AccessControlUpgradeable {\n\n bytes32 public constant TRUSTED_ROLE = keccak256(\"TRUSTED_ROLE\");\n uint256 constant public MAX_INT = 0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff;\n\n event StreamCreated(string id, string metadata);\n event StreamDeleted(string id);\n event StreamUpdated(string id, string metadata);\n event PermissionUpdated(string streamId, address user, bool canEdit, bool canDelete, uint256 publishExpiration, uint256 subscribeExpiration, bool canGrant);\n\n enum PermissionType { Edit, Delete, Publish, Subscribe, Grant }\n\n struct Permission {\n bool canEdit;\n bool canDelete;\n uint256 publishExpiration;\n uint256 subscribeExpiration;\n bool canGrant;\n }\n\n // streamid -> keccak256(version, useraddress) -> permission struct above\n mapping (string => mapping(bytes32 => Permission)) public streamIdToPermissions;\n mapping (string => string) public streamIdToMetadata;\n ENSCache private ensCache;\n\n // incremented when stream is (re-)created, so that users from old streams with same don't re-appear in the new stream (if they have permissions)\n mapping (string => uint32) private streamIdToVersion;\n\n modifier hasGrantPermission(string calldata streamId) {\n require(streamIdToPermissions[streamId][getAddressKey(streamId, _msgSender())].canGrant, \"error_noSharePermission\"); //||\n _;\n }\n modifier hasSharePermissionOrIsRemovingOwn(string calldata streamId, address user) {\n require(streamIdToPermissions[streamId][getAddressKey(streamId, _msgSender())].canGrant ||\n _msgSender() == user, \"error_noSharePermission\"); //||\n _;\n }\n modifier hasDeletePermission(string calldata streamId) {\n require(streamIdToPermissions[streamId][getAddressKey(streamId, _msgSender())].canDelete, \"error_noDeletePermission\"); //||\n _;\n }\n modifier hasEditPermission(string calldata streamId) {\n require(streamIdToPermissions[streamId][getAddressKey(streamId, _msgSender())].canEdit, \"error_noEditPermission\"); //||\n _;\n }\n modifier streamExists(string calldata streamId) {\n require(exists(streamId), \"error_streamDoesNotExist\");\n _;\n }\n modifier isTrusted() {\n require(hasRole(TRUSTED_ROLE, _msgSender()), \"error_mustBeTrustedRole\");\n _;\n }\n\n // Constructor can't be used with upgradeable contracts, so use initialize instead\n // this will not be called upon each upgrade, only once during first deployment\n function initialize(address ensCacheAddr, address trustedForwarderAddress) public initializer {\n ensCache = ENSCache(ensCacheAddr);\n __AccessControl_init();\n _setupRole(DEFAULT_ADMIN_ROLE, msg.sender);\n ERC2771ContextUpgradeable.__ERC2771Context_init(trustedForwarderAddress);\n }\n\n function _authorizeUpgrade(address) internal override isTrusted() {}\n\n\n function _msgSender() internal view virtual override(ContextUpgradeable, ERC2771ContextUpgradeable) returns (address sender) {\n return super._msgSender();\n }\n\n function _msgData() internal view virtual override(ContextUpgradeable, ERC2771ContextUpgradeable) returns (bytes calldata) {\n return super._msgData();\n }\n\n function setEnsCache(address ensCacheAddr) public isTrusted() {\n ensCache = ENSCache(ensCacheAddr);\n }\n\n function createStream(string calldata streamIdPath, string calldata metadataJsonString) public {\n string memory ownerstring = addressToString(_msgSender());\n _createStreamAndPermission(_msgSender(), ownerstring, streamIdPath, metadataJsonString);\n }\n\n function createStreamWithENS(string calldata ensName, string calldata streamIdPath, string calldata metadataJsonString) public {\n if (ensCache.owners(ensName) == _msgSender()) {\n _createStreamAndPermission(_msgSender(), ensName, streamIdPath, metadataJsonString);\n } else {\n ensCache.requestENSOwnerAndCreateStream(ensName, streamIdPath, metadataJsonString, _msgSender());\n }\n }\n\n function exists(string calldata streamId) public view returns (bool) {\n return bytes(streamIdToMetadata[streamId]).length != 0;\n }\n\n /**\n * Called by the ENSCache when the lookup / update is complete\n */\n // solhint-disable-next-line func-name-mixedcase\n function ENScreateStreamCallback(address ownerAddress, string memory ensName, string calldata streamIdPath, string calldata metadataJsonString) public isTrusted() {\n require(ensCache.owners(ensName) == ownerAddress, \"error_notOwnerOfENSName\");\n _createStreamAndPermission(ownerAddress, ensName, streamIdPath, metadataJsonString);\n }\n\n function _createStreamAndPermission(address ownerAddress, string memory ownerstring, string calldata streamIdPath, string calldata metadataJsonString) internal {\n require(bytes(metadataJsonString).length != 0, \"error_metadataJsonStringIsEmpty\");\n\n bytes memory pathBytes = bytes(streamIdPath);\n for (uint i = 1; i < pathBytes.length; i++) {\n // - . / 0 1 2 ... 9\n require((bytes1(\"-\") <= pathBytes[i] && pathBytes[i] <= bytes1(\"9\")) ||\n ((bytes1(\"A\") <= pathBytes[i] && pathBytes[i] <= bytes1(\"Z\"))) ||\n ((bytes1(\"a\") <= pathBytes[i] && pathBytes[i] <= bytes1(\"z\"))) ||\n pathBytes[i] == \"_\"\n , \"error_invalidPathChars\");\n }\n require(pathBytes[0] == \"/\", \"error_pathMustStartWithSlash\");\n\n // abi.encodePacked does simple string concatenation here\n string memory streamId = string(abi.encodePacked(ownerstring, streamIdPath));\n require(bytes(streamIdToMetadata[streamId]).length == 0, \"error_streamAlreadyExists\");\n\n streamIdToVersion[streamId] = streamIdToVersion[streamId] + 1;\n streamIdToMetadata[streamId] = metadataJsonString;\n streamIdToPermissions[streamId][getAddressKey(streamId, ownerAddress)] = Permission({\n canEdit: true,\n canDelete: true,\n publishExpiration: MAX_INT,\n subscribeExpiration: MAX_INT,\n canGrant: true\n });\n emit StreamCreated(streamId, metadataJsonString);\n emit PermissionUpdated(streamId, ownerAddress, true, true, MAX_INT, MAX_INT, true);\n }\n\n function getAddressKey(string memory streamId, address user) public view returns (bytes32) {\n return keccak256(abi.encode(streamIdToVersion[streamId], user));\n }\n\n function updateStreamMetadata(string calldata streamId, string calldata metadata) public streamExists(streamId) hasEditPermission(streamId) {\n streamIdToMetadata[streamId] = metadata;\n emit StreamUpdated(streamId, metadata);\n }\n\n function getStreamMetadata(string calldata streamId) public view streamExists(streamId) returns (string memory des) {\n return streamIdToMetadata[streamId];\n }\n\n function deleteStream(string calldata streamId) public streamExists(streamId) hasDeletePermission(streamId) {\n delete streamIdToMetadata[streamId];\n emit StreamDeleted(streamId);\n }\n\n function getPermissionsForUser(string calldata streamId, address user) public view streamExists(streamId) returns (Permission memory permission) {\n permission = streamIdToPermissions[streamId][getAddressKey(streamId, user)];\n Permission memory publicPermission = streamIdToPermissions[streamId][getAddressKey(streamId, address(0))];\n if (permission.publishExpiration < block.timestamp && publicPermission.publishExpiration >= block.timestamp) {\n permission.publishExpiration = publicPermission.publishExpiration;\n }\n if (permission.subscribeExpiration < block.timestamp && publicPermission.subscribeExpiration >= block.timestamp) {\n permission.subscribeExpiration = publicPermission.subscribeExpiration;\n }\n return permission;\n }\n\n function getDirectPermissionsForUser(string calldata streamId, address user) public view streamExists(streamId) returns (Permission memory permission) {\n return streamIdToPermissions[streamId][getAddressKey(streamId, user)];\n }\n\n function setPermissionsForUser(string calldata streamId, address user, bool canEdit,\n bool deletePerm, uint256 publishExpiration, uint256 subscribeExpiration, bool canGrant) public hasGrantPermission(streamId) {\n _setPermissionBooleans(streamId, user, canEdit, deletePerm, publishExpiration, subscribeExpiration, canGrant);\n }\n\n function _setPermissionBooleans(string calldata streamId, address user, bool canEdit,\n bool deletePerm, uint256 publishExpiration, uint256 subscribeExpiration, bool canGrant) private {\n require(user != address(0) || !(canEdit || deletePerm || canGrant),\n \"error_publicCanOnlySubsPubl\");\n streamIdToPermissions[streamId][getAddressKey(streamId, user)] = Permission({\n canEdit: canEdit,\n canDelete: deletePerm,\n publishExpiration: publishExpiration,\n subscribeExpiration: subscribeExpiration,\n canGrant: canGrant\n });\n emit PermissionUpdated(streamId, user, canEdit, deletePerm, publishExpiration, subscribeExpiration, canGrant);\n }\n\n function revokeAllPermissionsForUser(string calldata streamId, address user) public hasSharePermissionOrIsRemovingOwn(streamId, user){\n delete streamIdToPermissions[streamId][getAddressKey(streamId, user)];\n emit PermissionUpdated(streamId, user, false, false, 0, 0, false);\n }\n\n function hasPermission(string calldata streamId, address user, PermissionType permissionType) public view returns (bool userHasPermission) {\n return hasDirectPermission(streamId, user, permissionType) ||\n hasDirectPermission(streamId, address(0), permissionType);\n }\n\n function hasPublicPermission(string calldata streamId, PermissionType permissionType) public view returns (bool userHasPermission) {\n return hasDirectPermission(streamId, address(0), permissionType);\n }\n\n function hasDirectPermission(string calldata streamId, address user, PermissionType permissionType) public view returns (bool userHasPermission) {\n if (permissionType == PermissionType.Edit) {\n return streamIdToPermissions[streamId][getAddressKey(streamId, user)].canEdit;\n }\n else if (permissionType == PermissionType.Delete) {\n return streamIdToPermissions[streamId][getAddressKey(streamId, user)].canDelete;\n }\n else if (permissionType == PermissionType.Publish) {\n return streamIdToPermissions[streamId][getAddressKey(streamId, user)].publishExpiration >= block.timestamp;\n }\n else if (permissionType == PermissionType.Subscribe) {\n return streamIdToPermissions[streamId][getAddressKey(streamId, user)].subscribeExpiration >= block.timestamp;\n }\n else if (permissionType == PermissionType.Grant) {\n return streamIdToPermissions[streamId][getAddressKey(streamId, user)].canGrant;\n }\n }\n\n function setPermissions(string calldata streamId, address[] calldata users, Permission[] calldata permissions) public hasGrantPermission(streamId) {\n require(users.length == permissions.length, \"error_invalidInputArrayLengths\");\n uint arrayLength = users.length;\n for (uint i=0; i<arrayLength; i++) {\n Permission memory permission = permissions[i];\n _setPermissionBooleans(streamId, users[i], permission.canEdit, permission.canDelete, permission.publishExpiration, permission.subscribeExpiration, permission.canGrant);\n emit PermissionUpdated(streamId, users[i], permission.canEdit, permission.canDelete, permission.publishExpiration, permission.subscribeExpiration, permission.canGrant);\n }\n }\n\n function grantPermission(string calldata streamId, address user, PermissionType permissionType) public hasGrantPermission(streamId) {\n _setPermission(streamId, user, permissionType, true);\n }\n\n function revokePermission(string calldata streamId, address user, PermissionType permissionType) public hasSharePermissionOrIsRemovingOwn(streamId, user) {\n _setPermission(streamId, user, permissionType, false);\n }\n\n function _setPermission(string calldata streamId, address user, PermissionType permissionType, bool grant) private {\n require(user != address(0) || permissionType == PermissionType.Subscribe || permissionType == PermissionType.Publish,\n \"error_publicCanOnlySubsPubl\");\n if (permissionType == PermissionType.Edit) {\n streamIdToPermissions[streamId][getAddressKey(streamId, user)].canEdit = grant;\n }\n else if (permissionType == PermissionType.Delete) {\n streamIdToPermissions[streamId][getAddressKey(streamId, user)].canDelete = grant;\n }\n else if (permissionType == PermissionType.Publish) {\n streamIdToPermissions[streamId][getAddressKey(streamId, user)].publishExpiration = grant ? MAX_INT : 0;\n }\n else if (permissionType == PermissionType.Subscribe) {\n streamIdToPermissions[streamId][getAddressKey(streamId, user)].subscribeExpiration = grant ? MAX_INT : 0;\n }\n else if (permissionType == PermissionType.Grant) {\n streamIdToPermissions[streamId][getAddressKey(streamId, user)].canGrant = grant;\n }\n Permission storage perm = streamIdToPermissions[streamId][getAddressKey(streamId, user)];\n emit PermissionUpdated(streamId, user, perm.canEdit, perm.canDelete, perm.publishExpiration, perm.subscribeExpiration, perm.canGrant);\n }\n\n function setExpirationTime(string calldata streamId, address user, PermissionType permissionType, uint256 expirationTime) public hasGrantPermission(streamId) {\n require(permissionType == PermissionType.Subscribe || permissionType == PermissionType.Publish, \"error_timeOnlyObPubSub\");\n if (permissionType == PermissionType.Publish) {\n streamIdToPermissions[streamId][getAddressKey(streamId, user)].publishExpiration = expirationTime;\n }\n else if (permissionType == PermissionType.Subscribe) {\n streamIdToPermissions[streamId][getAddressKey(streamId, user)].subscribeExpiration = expirationTime;\n }\n }\n\n function grantPublicPermission(string calldata streamId, PermissionType permissionType) public hasGrantPermission(streamId) {\n grantPermission(streamId, address(0), permissionType);\n }\n\n function revokePublicPermission(string calldata streamId, PermissionType permissionType) public hasGrantPermission(streamId) {\n revokePermission(streamId, address(0), permissionType);\n }\n\n function setPublicPermission(string calldata streamId, uint256 publishExpiration, uint256 subscribeExpiration) public hasGrantPermission(streamId) {\n setPermissionsForUser(streamId, address(0), false, false, publishExpiration, subscribeExpiration, false);\n }\n\n function transferAllPermissionsToUser(string calldata streamId, address recipient) public {\n Permission memory permSender = streamIdToPermissions[streamId][getAddressKey(streamId, _msgSender())];\n require(permSender.canEdit || permSender.canDelete || permSender.publishExpiration > 0 || permSender.subscribeExpiration > 0 ||\n permSender.canGrant, \"error_noPermissionToTransfer\");\n Permission memory permRecipient = streamIdToPermissions[streamId][getAddressKey(streamId, recipient)];\n uint256 publishExpiration = permSender.publishExpiration > permRecipient.publishExpiration ? permSender.publishExpiration : permRecipient.publishExpiration;\n uint256 subscribeExpiration = permSender.subscribeExpiration > permRecipient.subscribeExpiration ? permSender.subscribeExpiration : permRecipient.subscribeExpiration;\n _setPermissionBooleans(streamId, recipient, permSender.canEdit || permRecipient.canEdit, permSender.canDelete || permRecipient.canDelete,\n publishExpiration, subscribeExpiration, permSender.canGrant || permRecipient.canGrant);\n _setPermissionBooleans(streamId, _msgSender(), false, false, 0, 0, false);\n }\n\n function transferPermissionToUser(string calldata streamId, address recipient, PermissionType permissionType) public {\n require(hasDirectPermission(streamId, _msgSender(), permissionType), \"error_noPermissionToTransfer\");\n _setPermission(streamId, _msgSender(), permissionType, false);\n _setPermission(streamId, recipient, permissionType, true);\n }\n\n function trustedSetStreamMetadata(string calldata streamId, string calldata metadata) public isTrusted() {\n streamIdToMetadata[streamId] = metadata;\n emit StreamUpdated(streamId, metadata);\n }\n\n function trustedSetStreamWithPermission(\n string calldata streamId,\n string calldata metadata,\n address user,\n bool canEdit,\n bool deletePerm,\n uint256 publishExpiration,\n uint256 subscribeExpiration,\n bool canGrant\n ) public isTrusted() {\n streamIdToMetadata[streamId] = metadata;\n _setPermissionBooleans(streamId, user, canEdit, deletePerm, publishExpiration, subscribeExpiration, canGrant);\n emit StreamUpdated(streamId, metadata);\n }\n\n function trustedSetPermissionsForUser(\n string calldata streamId,\n address user,\n bool canEdit,\n bool deletePerm,\n uint256 publishExpiration,\n uint256 subscribeExpiration,\n bool canGrant\n ) public isTrusted() {\n _setPermissionBooleans(streamId, user, canEdit, deletePerm, publishExpiration, subscribeExpiration, canGrant);\n }\n\n function trustedSetStreams(string[] calldata streamids, address[] calldata users, string[] calldata metadatas, Permission[] calldata permissions) public isTrusted() {\n uint arrayLength = streamids.length;\n for (uint i = 0; i < arrayLength; i++) {\n string calldata streamId = streamids[i];\n streamIdToMetadata[streamId] = metadatas[i];\n Permission memory permission = permissions[i];\n _setPermissionBooleans(streamId, users[i], permission.canEdit, permission.canDelete, permission.publishExpiration, permission.subscribeExpiration, permission.canGrant);\n emit StreamCreated(streamId, metadatas[i]);\n emit PermissionUpdated(streamId, users[i], permission.canEdit, permission.canDelete, permission.publishExpiration, permission.subscribeExpiration, permission.canGrant);\n }\n }\n\n function addressToString(address _address) public pure returns(string memory) {\n bytes32 _bytes = bytes32(uint256(uint160(_address)));\n bytes memory _hex = \"0123456789abcdef\";\n bytes memory _string = new bytes(42);\n _string[0] = \"0\";\n _string[1] = \"x\";\n for(uint i = 0; i < 20; i++) {\n _string[2+i*2] = _hex[uint8(_bytes[i + 12] >> 4)];\n _string[3+i*2] = _hex[uint8(_bytes[i + 12] & 0x0f)];\n }\n return string(_string);\n }\n\n function getTrustedRole() public pure returns (bytes32) {\n return TRUSTED_ROLE;\n }\n}\n"},"contracts/StreamRegistry/StreamRegistryV3.sol":{"content":"/**\n * Upgraded on: 2021-02-16\n * https://polygonscan.com/tx/0x47536e57cf8db693627438373635b22fa471311acdc79be234e9fa959f7f6a62\n * DO NOT EDIT\n * Instead, make a copy with new version number\n */\n\n// SPDX-License-Identifier: MIT\npragma solidity 0.8.9;\npragma experimental ABIEncoderV2;\n/* solhint-disable not-rely-on-time */\n\nimport \"@openzeppelin/contracts-upgradeable-4.4.2/metatx/ERC2771ContextUpgradeable.sol\";\nimport \"@openzeppelin/contracts-upgradeable-4.4.2/proxy/utils/UUPSUpgradeable.sol\";\nimport \"../chainlinkClient/ENSCache.sol\";\nimport \"@openzeppelin/contracts-upgradeable-4.4.2/access/AccessControlUpgradeable.sol\";\nimport \"@openzeppelin/contracts-upgradeable-4.4.2/proxy/utils/Initializable.sol\";\n\ncontract StreamRegistryV3 is Initializable, UUPSUpgradeable, ERC2771ContextUpgradeable, AccessControlUpgradeable {\n\n bytes32 public constant TRUSTED_ROLE = keccak256(\"TRUSTED_ROLE\");\n uint256 constant public MAX_INT = 0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff;\n\n event StreamCreated(string id, string metadata);\n event StreamDeleted(string id);\n event StreamUpdated(string id, string metadata);\n event PermissionUpdated(string streamId, address user, bool canEdit, bool canDelete, uint256 publishExpiration, uint256 subscribeExpiration, bool canGrant);\n\n enum PermissionType { Edit, Delete, Publish, Subscribe, Grant }\n\n struct Permission {\n bool canEdit;\n bool canDelete;\n uint256 publishExpiration;\n uint256 subscribeExpiration;\n bool canGrant;\n }\n\n // streamid -> keccak256(version, useraddress) -> permission struct above\n mapping (string => mapping(bytes32 => Permission)) public streamIdToPermissions;\n mapping (string => string) public streamIdToMetadata;\n ENSCache private ensCache;\n\n // incremented when stream is (re-)created, so that users from old streams with same don't re-appear in the new stream (if they have permissions)\n mapping (string => uint32) private streamIdToVersion;\n\n modifier hasGrantPermission(string calldata streamId) {\n require(streamIdToPermissions[streamId][getAddressKey(streamId, _msgSender())].canGrant, \"error_noSharePermission\"); //||\n _;\n }\n modifier hasSharePermissionOrIsRemovingOwn(string calldata streamId, address user) {\n require(streamIdToPermissions[streamId][getAddressKey(streamId, _msgSender())].canGrant ||\n _msgSender() == user, \"error_noSharePermission\"); //||\n _;\n }\n modifier hasDeletePermission(string calldata streamId) {\n require(streamIdToPermissions[streamId][getAddressKey(streamId, _msgSender())].canDelete, \"error_noDeletePermission\"); //||\n _;\n }\n modifier hasEditPermission(string calldata streamId) {\n require(streamIdToPermissions[streamId][getAddressKey(streamId, _msgSender())].canEdit, \"error_noEditPermission\"); //||\n _;\n }\n modifier streamExists(string calldata streamId) {\n require(exists(streamId), \"error_streamDoesNotExist\");\n _;\n }\n modifier isTrusted() {\n require(hasRole(TRUSTED_ROLE, _msgSender()), \"error_mustBeTrustedRole\");\n _;\n }\n\n // Constructor can't be used with upgradeable contracts, so use initialize instead\n // this will not be called upon each upgrade, only once during first deployment\n function initialize(address ensCacheAddr, address trustedForwarderAddress) public initializer {\n ensCache = ENSCache(ensCacheAddr);\n __AccessControl_init();\n _setupRole(DEFAULT_ADMIN_ROLE, msg.sender);\n ERC2771ContextUpgradeable.__ERC2771Context_init(trustedForwarderAddress);\n }\n\n function _authorizeUpgrade(address) internal override isTrusted() {}\n\n\n function _msgSender() internal view virtual override(ContextUpgradeable, ERC2771ContextUpgradeable) returns (address sender) {\n return super._msgSender();\n }\n\n function _msgData() internal view virtual override(ContextUpgradeable, ERC2771ContextUpgradeable) returns (bytes calldata) {\n return super._msgData();\n }\n\n function setEnsCache(address ensCacheAddr) public isTrusted() {\n ensCache = ENSCache(ensCacheAddr);\n }\n\n function createStream(string calldata streamIdPath, string calldata metadataJsonString) public {\n string memory ownerstring = addressToString(_msgSender());\n _createStreamAndPermission(_msgSender(), ownerstring, streamIdPath, metadataJsonString);\n }\n\n function createStreamWithENS(string calldata ensName, string calldata streamIdPath, string calldata metadataJsonString) public {\n if (ensCache.owners(ensName) == _msgSender()) {\n _createStreamAndPermission(_msgSender(), ensName, streamIdPath, metadataJsonString);\n } else {\n ensCache.requestENSOwnerAndCreateStream(ensName, streamIdPath, metadataJsonString, _msgSender());\n }\n }\n\n function exists(string calldata streamId) public view returns (bool) {\n return bytes(streamIdToMetadata[streamId]).length != 0;\n }\n\n /**\n * Called by the ENSCache when the lookup / update is complete\n */\n // solhint-disable-next-line func-name-mixedcase\n function ENScreateStreamCallback(address ownerAddress, string memory ensName, string calldata streamIdPath, string calldata metadataJsonString) public isTrusted() {\n require(ensCache.owners(ensName) == ownerAddress, \"error_notOwnerOfENSName\");\n _createStreamAndPermission(ownerAddress, ensName, streamIdPath, metadataJsonString);\n }\n\n function _createStreamAndPermission(address ownerAddress, string memory ownerstring, string calldata streamIdPath, string calldata metadataJsonString) internal {\n require(bytes(metadataJsonString).length != 0, \"error_metadataJsonStringIsEmpty\");\n\n bytes memory pathBytes = bytes(streamIdPath);\n for (uint i = 1; i < pathBytes.length; i++) {\n // - . / 0 1 2 ... 9\n require((bytes1(\"-\") <= pathBytes[i] && pathBytes[i] <= bytes1(\"9\")) ||\n ((bytes1(\"A\") <= pathBytes[i] && pathBytes[i] <= bytes1(\"Z\"))) ||\n ((bytes1(\"a\") <= pathBytes[i] && pathBytes[i] <= bytes1(\"z\"))) ||\n pathBytes[i] == \"_\"\n , \"error_invalidPathChars\");\n }\n require(pathBytes[0] == \"/\", \"error_pathMustStartWithSlash\");\n\n // abi.encodePacked does simple string concatenation here\n string memory streamId = string(abi.encodePacked(ownerstring, streamIdPath));\n require(bytes(streamIdToMetadata[streamId]).length == 0, \"error_streamAlreadyExists\");\n\n streamIdToVersion[streamId] = streamIdToVersion[streamId] + 1;\n streamIdToMetadata[streamId] = metadataJsonString;\n streamIdToPermissions[streamId][getAddressKey(streamId, ownerAddress)] = Permission({\n canEdit: true,\n canDelete: true,\n publishExpiration: MAX_INT,\n subscribeExpiration: MAX_INT,\n canGrant: true\n });\n emit StreamCreated(streamId, metadataJsonString);\n emit PermissionUpdated(streamId, ownerAddress, true, true, MAX_INT, MAX_INT, true);\n }\n\n function getAddressKey(string memory streamId, address user) public view returns (bytes32) {\n return keccak256(abi.encode(streamIdToVersion[streamId], user));\n }\n\n function updateStreamMetadata(string calldata streamId, string calldata metadata) public streamExists(streamId) hasEditPermission(streamId) {\n streamIdToMetadata[streamId] = metadata;\n emit StreamUpdated(streamId, metadata);\n }\n\n function getStreamMetadata(string calldata streamId) public view streamExists(streamId) returns (string memory des) {\n return streamIdToMetadata[streamId];\n }\n\n function deleteStream(string calldata streamId) public streamExists(streamId) hasDeletePermission(streamId) {\n delete streamIdToMetadata[streamId];\n emit StreamDeleted(streamId);\n }\n\n function getPermissionsForUser(string calldata streamId, address user) public view streamExists(streamId) returns (Permission memory permission) {\n permission = streamIdToPermissions[streamId][getAddressKey(streamId, user)];\n Permission memory publicPermission = streamIdToPermissions[streamId][getAddressKey(streamId, address(0))];\n if (permission.publishExpiration < block.timestamp && publicPermission.publishExpiration >= block.timestamp) {\n permission.publishExpiration = publicPermission.publishExpiration;\n }\n if (permission.subscribeExpiration < block.timestamp && publicPermission.subscribeExpiration >= block.timestamp) {\n permission.subscribeExpiration = publicPermission.subscribeExpiration;\n }\n return permission;\n }\n\n function getDirectPermissionsForUser(string calldata streamId, address user) public view streamExists(streamId) returns (Permission memory permission) {\n return streamIdToPermissions[streamId][getAddressKey(streamId, user)];\n }\n\n function setPermissionsForUser(string calldata streamId, address user, bool canEdit,\n bool deletePerm, uint256 publishExpiration, uint256 subscribeExpiration, bool canGrant) public hasGrantPermission(streamId) {\n _setPermissionBooleans(streamId, user, canEdit, deletePerm, publishExpiration, subscribeExpiration, canGrant);\n }\n\n function _setPermissionBooleans(string calldata streamId, address user, bool canEdit,\n bool deletePerm, uint256 publishExpiration, uint256 subscribeExpiration, bool canGrant) private {\n require(user != address(0) || !(canEdit || deletePerm || canGrant),\n \"error_publicCanOnlySubsPubl\");\n Permission memory perm = Permission({\n canEdit: canEdit,\n canDelete: deletePerm,\n publishExpiration: publishExpiration,\n subscribeExpiration: subscribeExpiration,\n canGrant: canGrant\n });\n streamIdToPermissions[streamId][getAddressKey(streamId, user)] = perm;\n _cleanUpIfAllFalse(streamId, user, perm);\n emit PermissionUpdated(streamId, user, canEdit, deletePerm, publishExpiration, subscribeExpiration, canGrant);\n }\n\n function revokeAllPermissionsForUser(string calldata streamId, address user) public hasSharePermissionOrIsRemovingOwn(streamId, user){\n delete streamIdToPermissions[streamId][getAddressKey(streamId, user)];\n emit PermissionUpdated(streamId, user, false, false, 0, 0, false);\n }\n\n function hasPermission(string calldata streamId, address user, PermissionType permissionType) public view returns (bool userHasPermission) {\n return hasDirectPermission(streamId, user, permissionType) ||\n hasDirectPermission(streamId, address(0), permissionType);\n }\n\n function hasPublicPermission(string calldata streamId, PermissionType permissionType) public view returns (bool userHasPermission) {\n return hasDirectPermission(streamId, address(0), permissionType);\n }\n\n function hasDirectPermission(string calldata streamId, address user, PermissionType permissionType) public view returns (bool userHasPermission) {\n if (permissionType == PermissionType.Edit) {\n return streamIdToPermissions[streamId][getAddressKey(streamId, user)].canEdit;\n }\n else if (permissionType == PermissionType.Delete) {\n return streamIdToPermissions[streamId][getAddressKey(streamId, user)].canDelete;\n }\n else if (permissionType == PermissionType.Publish) {\n return streamIdToPermissions[streamId][getAddressKey(streamId, user)].publishExpiration >= block.timestamp;\n }\n else if (permissionType == PermissionType.Subscribe) {\n return streamIdToPermissions[streamId][getAddressKey(streamId, user)].subscribeExpiration >= block.timestamp;\n }\n else if (permissionType == PermissionType.Grant) {\n return streamIdToPermissions[streamId][getAddressKey(streamId, user)].canGrant;\n }\n }\n\n function setPermissions(string calldata streamId, address[] calldata users, Permission[] calldata permissions) public hasGrantPermission(streamId) {\n require(users.length == permissions.length, \"error_invalidInputArrayLengths\");\n uint arrayLength = users.length;\n for (uint i=0; i<arrayLength; i++) {\n Permission memory permission = permissions[i];\n _setPermissionBooleans(streamId, users[i], permission.canEdit, permission.canDelete, permission.publishExpiration, permission.subscribeExpiration, permission.canGrant);\n emit PermissionUpdated(streamId, users[i], permission.canEdit, permission.canDelete, permission.publishExpiration, permission.subscribeExpiration, permission.canGrant);\n }\n }\n\n function setPermissionsMultipleStreans(string[] calldata streamIds, address[][] calldata users, Permission[][] calldata permissions) public {\n require(users.length == permissions.length && permissions.length == streamIds.length, \"error_invalidInputArrayLengths\");\n uint arrayLength = streamIds.length;\n for (uint i=0; i<arrayLength; i++) {\n setPermissions(streamIds[i], users[i], permissions[i]);\n }\n }\n\n function grantPermission(string calldata streamId, address user, PermissionType permissionType) public hasGrantPermission(streamId) {\n _setPermission(streamId, user, permissionType, true);\n }\n\n function revokePermission(string calldata streamId, address user, PermissionType permissionType) public hasSharePermissionOrIsRemovingOwn(streamId, user) {\n _setPermission(streamId, user, permissionType, false);\n }\n\n function _setPermission(string calldata streamId, address user, PermissionType permissionType, bool grant) private {\n require(user != address(0) || permissionType == PermissionType.Subscribe || permissionType == PermissionType.Publish,\n \"error_publicCanOnlySubsPubl\");\n if (permissionType == PermissionType.Edit) {\n streamIdToPermissions[streamId][getAddressKey(streamId, user)].canEdit = grant;\n }\n else if (permissionType == PermissionType.Delete) {\n streamIdToPermissions[streamId][getAddressKey(streamId, user)].canDelete = grant;\n }\n else if (permissionType == PermissionType.Publish) {\n streamIdToPermissions[streamId][getAddressKey(streamId, user)].publishExpiration = grant ? MAX_INT : 0;\n }\n else if (permissionType == PermissionType.Subscribe) {\n streamIdToPermissions[streamId][getAddressKey(streamId, user)].subscribeExpiration = grant ? MAX_INT : 0;\n }\n else if (permissionType == PermissionType.Grant) {\n streamIdToPermissions[streamId][getAddressKey(streamId, user)].canGrant = grant;\n }\n Permission memory perm = streamIdToPermissions[streamId][getAddressKey(streamId, user)];\n _cleanUpIfAllFalse(streamId, user, perm);\n emit PermissionUpdated(streamId, user, perm.canEdit, perm.canDelete, perm.publishExpiration, perm.subscribeExpiration, perm.canGrant);\n }\n\n function _cleanUpIfAllFalse(string calldata streamId, address user, Permission memory perm) private {\n if (!perm.canEdit && !perm.canDelete && !perm.canGrant && perm.publishExpiration < block.timestamp && perm.subscribeExpiration < block.timestamp) {\n delete streamIdToPermissions[streamId][getAddressKey(streamId, user)];\n }\n }\n\n function setExpirationTime(string calldata streamId, address user, PermissionType permissionType, uint256 expirationTime) public hasGrantPermission(streamId) {\n require(permissionType == PermissionType.Subscribe || permissionType == PermissionType.Publish, \"error_timeOnlyObPubSub\");\n if (permissionType == PermissionType.Publish) {\n streamIdToPermissions[streamId][getAddressKey(streamId, user)].publishExpiration = expirationTime;\n }\n else if (permissionType == PermissionType.Subscribe) {\n streamIdToPermissions[streamId][getAddressKey(streamId, user)].subscribeExpiration = expirationTime;\n }\n }\n\n function grantPublicPermission(string calldata streamId, PermissionType permissionType) public hasGrantPermission(streamId) {\n grantPermission(streamId, address(0), permissionType);\n }\n\n function revokePublicPermission(string calldata streamId, PermissionType permissionType) public hasGrantPermission(streamId) {\n revokePermission(streamId, address(0), permissionType);\n }\n\n function setPublicPermission(string calldata streamId, uint256 publishExpiration, uint256 subscribeExpiration) public hasGrantPermission(streamId) {\n setPermissionsForUser(streamId, address(0), false, false, publishExpiration, subscribeExpiration, false);\n }\n\n function transferAllPermissionsToUser(string calldata streamId, address recipient) public {\n Permission memory permSender = streamIdToPermissions[streamId][getAddressKey(streamId, _msgSender())];\n require(permSender.canEdit || permSender.canDelete || permSender.publishExpiration > 0 || permSender.subscribeExpiration > 0 ||\n permSender.canGrant, \"error_noPermissionToTransfer\");\n Permission memory permRecipient = streamIdToPermissions[streamId][getAddressKey(streamId, recipient)];\n uint256 publishExpiration = permSender.publishExpiration > permRecipient.publishExpiration ? permSender.publishExpiration : permRecipient.publishExpiration;\n uint256 subscribeExpiration = permSender.subscribeExpiration > permRecipient.subscribeExpiration ? permSender.subscribeExpiration : permRecipient.subscribeExpiration;\n _setPermissionBooleans(streamId, recipient, permSender.canEdit || permRecipient.canEdit, permSender.canDelete || permRecipient.canDelete,\n publishExpiration, subscribeExpiration, permSender.canGrant || permRecipient.canGrant);\n _setPermissionBooleans(streamId, _msgSender(), false, false, 0, 0, false);\n }\n\n function transferPermissionToUser(string calldata streamId, address recipient, PermissionType permissionType) public {\n require(hasDirectPermission(streamId, _msgSender(), permissionType), \"error_noPermissionToTransfer\");\n _setPermission(streamId, _msgSender(), permissionType, false);\n _setPermission(streamId, recipient, permissionType, true);\n }\n\n function trustedSetStreamMetadata(string calldata streamId, string calldata metadata) public isTrusted() {\n streamIdToMetadata[streamId] = metadata;\n emit StreamUpdated(streamId, metadata);\n }\n\n function trustedCreateStreams(string[] calldata streamIds, string[] calldata metadatas) public isTrusted() {\n uint arrayLength = streamIds.length;\n for (uint i = 0; i < arrayLength; i++) {\n streamIdToMetadata[streamIds[i]] = metadatas[i];\n emit StreamUpdated(streamIds[i], metadatas[i]);\n }\n }\n\n function trustedSetStreamWithPermission(\n string calldata streamId,\n string calldata metadata,\n address user,\n bool canEdit,\n bool deletePerm,\n uint256 publishExpiration,\n uint256 subscribeExpiration,\n bool canGrant\n ) public isTrusted() {\n streamIdToMetadata[streamId] = metadata;\n _setPermissionBooleans(streamId, user, canEdit, deletePerm, publishExpiration, subscribeExpiration, canGrant);\n emit StreamUpdated(streamId, metadata);\n }\n\n function trustedSetPermissionsForUser(\n string calldata streamId,\n address user,\n bool canEdit,\n bool deletePerm,\n uint256 publishExpiration,\n uint256 subscribeExpiration,\n bool canGrant\n ) public isTrusted() {\n _setPermissionBooleans(streamId, user, canEdit, deletePerm, publishExpiration, subscribeExpiration, canGrant);\n }\n\n function trustedSetStreams(string[] calldata streamids, address[] calldata users, string[] calldata metadatas, Permission[] calldata permissions) public isTrusted() {\n uint arrayLength = streamids.length;\n for (uint i = 0; i < arrayLength; i++) {\n string calldata streamId = streamids[i];\n streamIdToMetadata[streamId] = metadatas[i];\n Permission memory permission = permissions[i];\n _setPermissionBooleans(streamId, users[i], permission.canEdit, permission.canDelete, permission.publishExpiration, permission.subscribeExpiration, permission.canGrant);\n emit StreamCreated(streamId, metadatas[i]);\n emit PermissionUpdated(streamId, users[i], permission.canEdit, permission.canDelete, permission.publishExpiration, permission.subscribeExpiration, permission.canGrant);\n }\n }\n\n function trustedSetPermissions(string[] calldata streamids, address[] calldata users, Permission[] calldata permissions) public isTrusted() {\n uint arrayLength = streamids.length;\n for (uint i = 0; i < arrayLength; i++) {\n string calldata streamId = streamids[i];\n Permission memory permission = permissions[i];\n _setPermissionBooleans(streamId, users[i], permission.canEdit, permission.canDelete, permission.publishExpiration, permission.subscribeExpiration, permission.canGrant);\n emit PermissionUpdated(streamId, users[i], permission.canEdit, permission.canDelete, permission.publishExpiration, permission.subscribeExpiration, permission.canGrant);\n }\n }\n\n function addressToString(address _address) public pure returns(string memory) {\n bytes32 _bytes = bytes32(uint256(uint160(_address)));\n bytes memory _hex = \"0123456789abcdef\";\n bytes memory _string = new bytes(42);\n _string[0] = \"0\";\n _string[1] = \"x\";\n for(uint i = 0; i < 20; i++) {\n _string[2+i*2] = _hex[uint8(_bytes[i + 12] >> 4)];\n _string[3+i*2] = _hex[uint8(_bytes[i + 12] & 0x0f)];\n }\n return string(_string);\n }\n\n function getTrustedRole() public pure returns (bytes32) {\n return TRUSTED_ROLE;\n }\n}\n"},"contracts/StreamRegistry/StreamRegistryV4_1.sol":{"content":"/**\n * Polygon deployment tx hash: TODO\n *\n * Changes in V4_1:\n * - bugfix: setExpirationTime emits PermissionUpdated correctly\n */\n\n// SPDX-License-Identifier: MIT\npragma solidity 0.8.9;\n/* solhint-disable not-rely-on-time */\n\nimport \"./ERC2771ContextUpgradeable.sol\";\nimport \"@openzeppelin/contracts-upgradeable-4.4.2/proxy/utils/UUPSUpgradeable.sol\";\nimport \"../chainlinkClient/ENSCache.sol\";\nimport \"@openzeppelin/contracts-upgradeable-4.4.2/access/AccessControlUpgradeable.sol\";\nimport \"@openzeppelin/contracts-upgradeable-4.4.2/proxy/utils/Initializable.sol\";\n\n// solhint-disable-next-line contract-name-camelcase\ncontract StreamRegistryV4_1 is Initializable, UUPSUpgradeable, ERC2771ContextUpgradeable, AccessControlUpgradeable {\n\n bytes32 public constant TRUSTED_ROLE = keccak256(\"TRUSTED_ROLE\");\n uint256 constant public MAX_INT = 0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff;\n\n event StreamCreated(string id, string metadata);\n event StreamDeleted(string id);\n event StreamUpdated(string id, string metadata);\n event PermissionUpdated(string streamId, address user, bool canEdit, bool canDelete, uint256 publishExpiration, uint256 subscribeExpiration, bool canGrant);\n\n enum PermissionType { Edit, Delete, Publish, Subscribe, Grant }\n\n struct Permission {\n bool canEdit;\n bool canDelete;\n uint256 publishExpiration;\n uint256 subscribeExpiration;\n bool canGrant;\n }\n\n // streamid -> keccak256(version, useraddress) -> permission struct above\n mapping (string => mapping(bytes32 => Permission)) public streamIdToPermissions;\n mapping (string => string) public streamIdToMetadata;\n ENSCache private ensCache;\n\n // incremented when stream is (re-)created, so that users from old streams with same don't re-appear in the new stream (if they have permissions)\n mapping (string => uint32) private streamIdToVersion;\n\n modifier hasGrantPermission(string memory streamId) {\n require(streamIdToPermissions[streamId][getAddressKey(streamId, _msgSender())].canGrant, \"error_noSharePermission\"); //||\n _;\n }\n modifier hasSharePermissionOrIsRemovingOwn(string calldata streamId, address user) {\n require(\n streamIdToPermissions[streamId][getAddressKey(streamId, _msgSender())].canGrant\n || _msgSender() == user,\n \"error_noSharePermission\"\n );\n _;\n }\n modifier hasDeletePermission(string calldata streamId) {\n require(streamIdToPermissions[streamId][getAddressKey(streamId, _msgSender())].canDelete, \"error_noDeletePermission\"); //||\n _;\n }\n modifier hasEditPermission(string calldata streamId) {\n require(streamIdToPermissions[streamId][getAddressKey(streamId, _msgSender())].canEdit, \"error_noEditPermission\"); //||\n _;\n }\n modifier streamExists(string calldata streamId) {\n require(exists(streamId), \"error_streamDoesNotExist\");\n _;\n }\n modifier isTrusted() {\n require(hasRole(TRUSTED_ROLE, _msgSender()), \"error_mustBeTrustedRole\");\n _;\n }\n\n // Constructor can't be used with upgradeable contracts, so use initialize instead\n // this will not be called upon each upgrade, only once during first deployment\n function initialize(address ensCacheAddr, address trustedForwarderAddress) public initializer {\n ensCache = ENSCache(ensCacheAddr);\n __AccessControl_init();\n _setupRole(DEFAULT_ADMIN_ROLE, msg.sender);\n ERC2771ContextUpgradeable.__ERC2771Context_init(trustedForwarderAddress);\n }\n\n function _authorizeUpgrade(address) internal override isTrusted() {}\n\n function _msgSender() internal view virtual override(ContextUpgradeable, ERC2771ContextUpgradeable) returns (address sender) {\n return super._msgSender();\n }\n\n function _msgData() internal view virtual override(ContextUpgradeable, ERC2771ContextUpgradeable) returns (bytes calldata) {\n return super._msgData();\n }\n\n function setEnsCache(address ensCacheAddr) public isTrusted() {\n ensCache = ENSCache(ensCacheAddr);\n }\n\n function createStream(string calldata streamIdPath, string calldata metadataJsonString) public {\n string memory ownerstring = addressToString(_msgSender());\n _createStreamAndPermission(_msgSender(), ownerstring, streamIdPath, metadataJsonString);\n }\n\n function createStreamWithENS(string calldata ensName, string calldata streamIdPath, string calldata metadataJsonString) public {\n if (ensCache.owners(ensName) == _msgSender()) {\n _createStreamAndPermission(_msgSender(), ensName, streamIdPath, metadataJsonString);\n } else {\n ensCache.requestENSOwnerAndCreateStream(ensName, streamIdPath, metadataJsonString, _msgSender());\n }\n }\n\n function createStreamWithPermissions(string calldata streamIdPath, string calldata metadataJsonString, address[] calldata users, Permission[] calldata permissions) public {\n string memory ownerstring = addressToString(_msgSender());\n string memory streamId = _createStreamAndPermission(_msgSender(), ownerstring, streamIdPath, metadataJsonString);\n // external call so that memry is copied into calldata\n setPermissions(streamId, users, permissions);\n }\n\n function createMultipleStreamsWithPermissions(string[] calldata streamIdPaths, string[] calldata metadataJsonStrings, address[][] calldata users, Permission[][] calldata permissions) public {\n for (uint i = 0; i < streamIdPaths.length; i++) {\n createStreamWithPermissions(streamIdPaths[i], metadataJsonStrings[i], users[i], permissions[i]);\n }\n }\n\n function exists(string calldata streamId) public view returns (bool) {\n return bytes(streamIdToMetadata[streamId]).length != 0;\n }\n\n /**\n * Called by the ENSCache when the lookup / update is complete\n */\n // solhint-disable-next-line func-name-mixedcase\n function ENScreateStreamCallback(address ownerAddress, string memory ensName, string calldata streamIdPath, string calldata metadataJsonString) public isTrusted() {\n require(ensCache.owners(ensName) == ownerAddress, \"error_notOwnerOfENSName\");\n _createStreamAndPermission(ownerAddress, ensName, streamIdPath, metadataJsonString);\n }\n\n function _createStreamAndPermission(address ownerAddress, string memory ownerstring, string calldata streamIdPath, string calldata metadataJsonString) internal returns (string memory) {\n require(bytes(metadataJsonString).length != 0, \"error_metadataJsonStringIsEmpty\");\n\n bytes memory pathBytes = bytes(streamIdPath);\n for (uint i = 1; i < pathBytes.length; i++) {\n // - . / 0 1 2 ... 9\n require((bytes1(\"-\") <= pathBytes[i] && pathBytes[i] <= bytes1(\"9\")) ||\n ((bytes1(\"A\") <= pathBytes[i] && pathBytes[i] <= bytes1(\"Z\"))) ||\n ((bytes1(\"a\") <= pathBytes[i] && pathBytes[i] <= bytes1(\"z\"))) ||\n pathBytes[i] == \"_\"\n , \"error_invalidPathChars\");\n }\n require(pathBytes[0] == \"/\", \"error_pathMustStartWithSlash\");\n\n // abi.encodePacked does simple string concatenation here\n string memory streamId = string(abi.encodePacked(ownerstring, streamIdPath));\n require(bytes(streamIdToMetadata[streamId]).length == 0, \"error_streamAlreadyExists\");\n\n streamIdToVersion[streamId] = streamIdToVersion[streamId] + 1;\n streamIdToMetadata[streamId] = metadataJsonString;\n streamIdToPermissions[streamId][getAddressKey(streamId, ownerAddress)] = Permission({\n canEdit: true,\n canDelete: true,\n publishExpiration: MAX_INT,\n subscribeExpiration: MAX_INT,\n canGrant: true\n });\n emit StreamCreated(streamId, metadataJsonString);\n emit PermissionUpdated(streamId, ownerAddress, true, true, MAX_INT, MAX_INT, true);\n return streamId;\n }\n\n function getAddressKey(string memory streamId, address user) public view returns (bytes32) {\n return keccak256(abi.encode(streamIdToVersion[streamId], user));\n }\n\n function updateStreamMetadata(string calldata streamId, string calldata metadata) public streamExists(streamId) hasEditPermission(streamId) {\n streamIdToMetadata[streamId] = metadata;\n emit StreamUpdated(streamId, metadata);\n }\n\n function getStreamMetadata(string calldata streamId) public view streamExists(streamId) returns (string memory des) {\n return streamIdToMetadata[streamId];\n }\n\n function deleteStream(string calldata streamId) public streamExists(streamId) hasDeletePermission(streamId) {\n delete streamIdToMetadata[streamId];\n emit StreamDeleted(streamId);\n }\n\n /**\n * Get user's permissions to stream.\n * For publish/subscribe expiration, if public permission has a longer validity, use that.\n **/\n function getPermissionsForUser(string calldata streamId, address user) public view streamExists(streamId) returns (Permission memory permission) {\n permission = streamIdToPermissions[streamId][getAddressKey(streamId, user)];\n Permission memory publicPermission = streamIdToPermissions[streamId][getAddressKey(streamId, address(0))];\n if (permission.publishExpiration < block.timestamp && publicPermission.publishExpiration >= block.timestamp) {\n permission.publishExpiration = publicPermission.publishExpiration;\n }\n if (permission.subscribeExpiration < block.timestamp && publicPermission.subscribeExpiration >= block.timestamp) {\n permission.subscribeExpiration = publicPermission.subscribeExpiration;\n }\n return permission;\n }\n\n function getDirectPermissionsForUser(string calldata streamId, address user) public view streamExists(streamId) returns (Permission memory permission) {\n return streamIdToPermissions[streamId][getAddressKey(streamId, user)];\n }\n\n function setPermissionsForUser(string calldata streamId, address user, bool canEdit,\n bool deletePerm, uint256 publishExpiration, uint256 subscribeExpiration, bool canGrant) public hasGrantPermission(streamId) {\n _setPermissionBooleans(streamId, user, canEdit, deletePerm, publishExpiration, subscribeExpiration, canGrant);\n }\n\n function _setPermissionBooleans(string memory streamId, address user, bool canEdit,\n bool deletePerm, uint256 publishExpiration, uint256 subscribeExpiration, bool canGrant) private {\n require(user != address(0) || !(canEdit || deletePerm || canGrant),\n \"error_publicCanOnlySubsPubl\");\n Permission memory perm = Permission({\n canEdit: canEdit,\n canDelete: deletePerm,\n publishExpiration: publishExpiration,\n subscribeExpiration: subscribeExpiration,\n canGrant: canGrant\n });\n streamIdToPermissions[streamId][getAddressKey(streamId, user)] = perm;\n _cleanUpIfAllFalse(streamId, user, perm);\n emit PermissionUpdated(streamId, user, canEdit, deletePerm, publishExpiration, subscribeExpiration, canGrant);\n }\n\n function revokeAllPermissionsForUser(string calldata streamId, address user) public hasSharePermissionOrIsRemovingOwn(streamId, user){\n delete streamIdToPermissions[streamId][getAddressKey(streamId, user)];\n emit PermissionUpdated(streamId, user, false, false, 0, 0, false);\n }\n\n function hasPermission(string calldata streamId, address user, PermissionType permissionType) public view returns (bool userHasPermission) {\n return hasDirectPermission(streamId, user, permissionType) ||\n hasDirectPermission(streamId, address(0), permissionType);\n }\n\n function hasPublicPermission(string calldata streamId, PermissionType permissionType) public view returns (bool userHasPermission) {\n return hasDirectPermission(streamId, address(0), permissionType);\n }\n\n function hasDirectPermission(string calldata streamId, address user, PermissionType permissionType) public view returns (bool userHasPermission) {\n if (permissionType == PermissionType.Edit) {\n return streamIdToPermissions[streamId][getAddressKey(streamId, user)].canEdit;\n } else if (permissionType == PermissionType.Delete) {\n return streamIdToPermissions[streamId][getAddressKey(streamId, user)].canDelete;\n } else if (permissionType == PermissionType.Publish) {\n return streamIdToPermissions[streamId][getAddressKey(streamId, user)].publishExpiration >= block.timestamp;\n } else if (permissionType == PermissionType.Subscribe) {\n return streamIdToPermissions[streamId][getAddressKey(streamId, user)].subscribeExpiration >= block.timestamp;\n } else if (permissionType == PermissionType.Grant) {\n return streamIdToPermissions[streamId][getAddressKey(streamId, user)].canGrant;\n }\n }\n\n function setPermissions(string memory streamId, address[] calldata users, Permission[] calldata permissions) public hasGrantPermission(streamId) {\n require(users.length == permissions.length, \"error_invalidInputArrayLengths\");\n uint arrayLength = users.length;\n for (uint i=0; i<arrayLength; i++) {\n Permission memory permission = permissions[i];\n _setPermissionBooleans(streamId, users[i], permission.canEdit, permission.canDelete, permission.publishExpiration, permission.subscribeExpiration, permission.canGrant);\n // emit PermissionUpdated(streamId, users[i], permission.canEdit, permission.canDelete, permission.publishExpiration, permission.subscribeExpiration, permission.canGrant);\n }\n }\n\n // legacy typoed method name\n function setPermissionsMultipleStreans(string[] calldata streamIds, address[][] calldata users, Permission[][] calldata permissions) public {\n setPermissionsMultipleStreams(streamIds, users, permissions);\n }\n\n function setPermissionsMultipleStreams(string[] calldata streamIds, address[][] calldata users, Permission[][] calldata permissions) public {\n require(users.length == permissions.length && permissions.length == streamIds.length, \"error_invalidInputArrayLengths\");\n uint arrayLength = streamIds.length;\n for (uint i=0; i<arrayLength; i++) {\n setPermissions(streamIds[i], users[i], permissions[i]);\n }\n }\n\n function grantPermission(string calldata streamId, address user, PermissionType permissionType) public hasGrantPermission(streamId) {\n _setPermission(streamId, user, permissionType, true);\n }\n\n function revokePermission(string calldata streamId, address user, PermissionType permissionType) public hasSharePermissionOrIsRemovingOwn(streamId, user) {\n _setPermission(streamId, user, permissionType, false);\n }\n\n function _setPermission(string calldata streamId, address user, PermissionType permissionType, bool grant) private {\n require(user != address(0) || permissionType == PermissionType.Subscribe || permissionType == PermissionType.Publish,\n \"error_publicCanOnlySubsPubl\");\n if (permissionType == PermissionType.Edit) {\n streamIdToPermissions[streamId][getAddressKey(streamId, user)].canEdit = grant;\n } else if (permissionType == PermissionType.Delete) {\n streamIdToPermissions[streamId][getAddressKey(streamId, user)].canDelete = grant;\n } else if (permissionType == PermissionType.Publish) {\n streamIdToPermissions[streamId][getAddressKey(streamId, user)].publishExpiration = grant ? MAX_INT : 0;\n } else if (permissionType == PermissionType.Subscribe) {\n streamIdToPermissions[streamId][getAddressKey(streamId, user)].subscribeExpiration = grant ? MAX_INT : 0;\n } else if (permissionType == PermissionType.Grant) {\n streamIdToPermissions[streamId][getAddressKey(streamId, user)].canGrant = grant;\n }\n Permission memory perm = streamIdToPermissions[streamId][getAddressKey(streamId, user)];\n _cleanUpIfAllFalse(streamId, user, perm);\n emit PermissionUpdated(streamId, user, perm.canEdit, perm.canDelete, perm.publishExpiration, perm.subscribeExpiration, perm.canGrant);\n }\n\n function _cleanUpIfAllFalse(string memory streamId, address user, Permission memory perm) private {\n if (!perm.canEdit && !perm.canDelete && !perm.canGrant && perm.publishExpiration < block.timestamp && perm.subscribeExpiration < block.timestamp) {\n delete streamIdToPermissions[streamId][getAddressKey(streamId, user)];\n }\n }\n\n function setExpirationTime(string calldata streamId, address user, PermissionType permissionType, uint256 expirationTime) public hasGrantPermission(streamId) {\n require(permissionType == PermissionType.Subscribe || permissionType == PermissionType.Publish, \"error_timeOnlyObPubSub\");\n Permission storage perm = streamIdToPermissions[streamId][getAddressKey(streamId, user)];\n Permission memory p = perm;\n if (permissionType == PermissionType.Publish) {\n perm.publishExpiration = expirationTime;\n emit PermissionUpdated(streamId, user, p.canEdit, p.canDelete, expirationTime, p.subscribeExpiration, p.canGrant);\n } else if (permissionType == PermissionType.Subscribe) {\n perm.subscribeExpiration = expirationTime;\n emit PermissionUpdated(streamId, user, p.canEdit, p.canDelete, p.publishExpiration, expirationTime, p.canGrant);\n }\n }\n\n function grantPublicPermission(string calldata streamId, PermissionType permissionType) public hasGrantPermission(streamId) {\n grantPermission(streamId, address(0), permissionType);\n }\n\n function revokePublicPermission(string calldata streamId, PermissionType permissionType) public hasGrantPermission(streamId) {\n revokePermission(streamId, address(0), permissionType);\n }\n\n function setPublicPermission(string calldata streamId, uint256 publishExpiration, uint256 subscribeExpiration) public hasGrantPermission(streamId) {\n setPermissionsForUser(streamId, address(0), false, false, publishExpiration, subscribeExpiration, false);\n }\n\n function transferAllPermissionsToUser(string calldata streamId, address recipient) public {\n Permission memory permSender = streamIdToPermissions[streamId][getAddressKey(streamId, _msgSender())];\n require(permSender.canEdit || permSender.canDelete || permSender.publishExpiration > 0 || permSender.subscribeExpiration > 0 ||\n permSender.canGrant, \"error_noPermissionToTransfer\");\n Permission memory permRecipient = streamIdToPermissions[streamId][getAddressKey(streamId, recipient)];\n uint256 publishExpiration = permSender.publishExpiration > permRecipient.publishExpiration ? permSender.publishExpiration : permRecipient.publishExpiration;\n uint256 subscribeExpiration = permSender.subscribeExpiration > permRecipient.subscribeExpiration ? permSender.subscribeExpiration : permRecipient.subscribeExpiration;\n _setPermissionBooleans(streamId, recipient, permSender.canEdit || permRecipient.canEdit, permSender.canDelete || permRecipient.canDelete,\n publishExpiration, subscribeExpiration, permSender.canGrant || permRecipient.canGrant);\n _setPermissionBooleans(streamId, _msgSender(), false, false, 0, 0, false);\n }\n\n function transferPermissionToUser(string calldata streamId, address recipient, PermissionType permissionType) public {\n require(hasDirectPermission(streamId, _msgSender(), permissionType), \"error_noPermissionToTransfer\");\n _setPermission(streamId, _msgSender(), permissionType, false);\n _setPermission(streamId, recipient, permissionType, true);\n }\n\n function trustedSetStreamMetadata(string calldata streamId, string calldata metadata) public isTrusted() {\n streamIdToMetadata[streamId] = metadata;\n emit StreamUpdated(streamId, metadata);\n }\n\n function trustedCreateStreams(string[] calldata streamIds, string[] calldata metadatas) public isTrusted() {\n uint arrayLength = streamIds.length;\n for (uint i = 0; i < arrayLength; i++) {\n streamIdToMetadata[streamIds[i]] = metadatas[i];\n emit StreamUpdated(streamIds[i], metadatas[i]);\n }\n }\n\n function trustedSetStreamWithPermission(\n string calldata streamId,\n string calldata metadata,\n address user,\n bool canEdit,\n bool deletePerm,\n uint256 publishExpiration,\n uint256 subscribeExpiration,\n bool canGrant\n ) public isTrusted() {\n streamIdToMetadata[streamId] = metadata;\n _setPermissionBooleans(streamId, user, canEdit, deletePerm, publishExpiration, subscribeExpiration, canGrant);\n emit StreamUpdated(streamId, metadata);\n }\n\n function trustedSetPermissionsForUser(\n string calldata streamId,\n address user,\n bool canEdit,\n bool deletePerm,\n uint256 publishExpiration,\n uint256 subscribeExpiration,\n bool canGrant\n ) public isTrusted() {\n _setPermissionBooleans(streamId, user, canEdit, deletePerm, publishExpiration, subscribeExpiration, canGrant);\n }\n\n function trustedSetStreams(string[] calldata streamids, address[] calldata users, string[] calldata metadatas, Permission[] calldata permissions) public isTrusted() {\n uint arrayLength = streamids.length;\n for (uint i = 0; i < arrayLength; i++) {\n string calldata streamId = streamids[i];\n streamIdToMetadata[streamId] = metadatas[i];\n Permission memory permission = permissions[i];\n _setPermissionBooleans(streamId, users[i], permission.canEdit, permission.canDelete, permission.publishExpiration, permission.subscribeExpiration, permission.canGrant);\n emit StreamCreated(streamId, metadatas[i]);\n emit PermissionUpdated(streamId, users[i], permission.canEdit, permission.canDelete, permission.publishExpiration, permission.subscribeExpiration, permission.canGrant);\n }\n }\n\n function trustedSetPermissions(string[] calldata streamids, address[] calldata users, Permission[] calldata permissions) public isTrusted() {\n uint arrayLength = streamids.length;\n for (uint i = 0; i < arrayLength; i++) {\n string calldata streamId = streamids[i];\n Permission memory permission = permissions[i];\n _setPermissionBooleans(streamId, users[i], permission.canEdit, permission.canDelete, permission.publishExpiration, permission.subscribeExpiration, permission.canGrant);\n emit PermissionUpdated(streamId, users[i], permission.canEdit, permission.canDelete, permission.publishExpiration, permission.subscribeExpiration, permission.canGrant);\n }\n }\n\n function addressToString(address _address) public pure returns(string memory) {\n bytes32 _bytes = bytes32(uint256(uint160(_address)));\n bytes memory _hex = \"0123456789abcdef\";\n bytes memory _string = new bytes(42);\n _string[0] = \"0\";\n _string[1] = \"x\";\n for(uint i = 0; i < 20; i++) {\n _string[2+i*2] = _hex[uint8(_bytes[i + 12] >> 4)];\n _string[3+i*2] = _hex[uint8(_bytes[i + 12] & 0x0f)];\n }\n return string(_string);\n }\n\n function getTrustedRole() public pure returns (bytes32) {\n return TRUSTED_ROLE;\n }\n\n function setTrustedForwarder(address forwarder) public isTrusted() {\n _setTrustedForwarder(forwarder);\n }\n}\n"},"contracts/StreamRegistry/StreamRegistryV4.sol":{"content":"/**\n * Deployed on polygon on 2022-09-08\n */\n\n// SPDX-License-Identifier: MIT\npragma solidity 0.8.9;\n/* solhint-disable not-rely-on-time */\n\nimport \"./ERC2771ContextUpgradeable.sol\";\nimport \"@openzeppelin/contracts-upgradeable-4.4.2/proxy/utils/UUPSUpgradeable.sol\";\nimport \"../chainlinkClient/ENSCache.sol\";\nimport \"@openzeppelin/contracts-upgradeable-4.4.2/access/AccessControlUpgradeable.sol\";\nimport \"@openzeppelin/contracts-upgradeable-4.4.2/proxy/utils/Initializable.sol\";\n\ncontract StreamRegistryV4 is Initializable, UUPSUpgradeable, ERC2771ContextUpgradeable, AccessControlUpgradeable {\n\n bytes32 public constant TRUSTED_ROLE = keccak256(\"TRUSTED_ROLE\");\n uint256 constant public MAX_INT = 0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff;\n\n event StreamCreated(string id, string metadata);\n event StreamDeleted(string id);\n event StreamUpdated(string id, string metadata);\n event PermissionUpdated(string streamId, address user, bool canEdit, bool canDelete, uint256 publishExpiration, uint256 subscribeExpiration, bool canGrant);\n\n enum PermissionType { Edit, Delete, Publish, Subscribe, Grant }\n\n struct Permission {\n bool canEdit;\n bool canDelete;\n uint256 publishExpiration;\n uint256 subscribeExpiration;\n bool canGrant;\n }\n\n // streamid -> keccak256(version, useraddress) -> permission struct above\n mapping (string => mapping(bytes32 => Permission)) public streamIdToPermissions;\n mapping (string => string) public streamIdToMetadata;\n ENSCache private ensCache;\n\n // incremented when stream is (re-)created, so that users from old streams with same don't re-appear in the new stream (if they have permissions)\n mapping (string => uint32) private streamIdToVersion;\n\n modifier hasGrantPermission(string memory streamId) {\n require(streamIdToPermissions[streamId][getAddressKey(streamId, _msgSender())].canGrant, \"error_noSharePermission\"); //||\n _;\n }\n modifier hasSharePermissionOrIsRemovingOwn(string calldata streamId, address user) {\n require(streamIdToPermissions[streamId][getAddressKey(streamId, _msgSender())].canGrant ||\n _msgSender() == user, \"error_noSharePermission\"); //||\n _;\n }\n modifier hasDeletePermission(string calldata streamId) {\n require(streamIdToPermissions[streamId][getAddressKey(streamId, _msgSender())].canDelete, \"error_noDeletePermission\"); //||\n _;\n }\n modifier hasEditPermission(string calldata streamId) {\n require(streamIdToPermissions[streamId][getAddressKey(streamId, _msgSender())].canEdit, \"error_noEditPermission\"); //||\n _;\n }\n modifier streamExists(string calldata streamId) {\n require(exists(streamId), \"error_streamDoesNotExist\");\n _;\n }\n modifier isTrusted() {\n require(hasRole(TRUSTED_ROLE, _msgSender()), \"error_mustBeTrustedRole\");\n _;\n }\n\n // Constructor can't be used with upgradeable contracts, so use initialize instead\n // this will not be called upon each upgrade, only once during first deployment\n function initialize(address ensCacheAddr, address trustedForwarderAddress) public initializer {\n ensCache = ENSCache(ensCacheAddr);\n __AccessControl_init();\n _setupRole(DEFAULT_ADMIN_ROLE, msg.sender);\n ERC2771ContextUpgradeable.__ERC2771Context_init(trustedForwarderAddress);\n }\n\n function _authorizeUpgrade(address) internal override isTrusted() {}\n\n\n function _msgSender() internal view virtual override(ContextUpgradeable, ERC2771ContextUpgradeable) returns (address sender) {\n return super._msgSender();\n }\n\n function _msgData() internal view virtual override(ContextUpgradeable, ERC2771ContextUpgradeable) returns (bytes calldata) {\n return super._msgData();\n }\n\n function setEnsCache(address ensCacheAddr) public isTrusted() {\n ensCache = ENSCache(ensCacheAddr);\n }\n\n function createStream(string calldata streamIdPath, string calldata metadataJsonString) public {\n string memory ownerstring = addressToString(_msgSender());\n _createStreamAndPermission(_msgSender(), ownerstring, streamIdPath, metadataJsonString);\n }\n\n function createStreamWithENS(string calldata ensName, string calldata streamIdPath, string calldata metadataJsonString) public {\n if (ensCache.owners(ensName) == _msgSender()) {\n _createStreamAndPermission(_msgSender(), ensName, streamIdPath, metadataJsonString);\n } else {\n ensCache.requestENSOwnerAndCreateStream(ensName, streamIdPath, metadataJsonString, _msgSender());\n }\n }\n\n function createStreamWithPermissions(string calldata streamIdPath, string calldata metadataJsonString, address[] calldata users, Permission[] calldata permissions) public {\n string memory ownerstring = addressToString(_msgSender());\n string memory streamId = _createStreamAndPermission(_msgSender(), ownerstring, streamIdPath, metadataJsonString);\n // external call so that memry is copied into calldata\n setPermissions(streamId, users, permissions);\n }\n\n function createMultipleStreamsWithPermissions(string[] calldata streamIdPaths, string[] calldata metadataJsonStrings, address[][] calldata users, Permission[][] calldata permissions) public {\n for (uint i = 0; i < streamIdPaths.length; i++) {\n createStreamWithPermissions(streamIdPaths[i], metadataJsonStrings[i], users[i], permissions[i]);\n }\n }\n\n function exists(string calldata streamId) public view returns (bool) {\n return bytes(streamIdToMetadata[streamId]).length != 0;\n }\n\n /**\n * Called by the ENSCache when the lookup / update is complete\n */\n // solhint-disable-next-line func-name-mixedcase\n function ENScreateStreamCallback(address ownerAddress, string memory ensName, string calldata streamIdPath, string calldata metadataJsonString) public isTrusted() {\n require(ensCache.owners(ensName) == ownerAddress, \"error_notOwnerOfENSName\");\n _createStreamAndPermission(ownerAddress, ensName, streamIdPath, metadataJsonString);\n }\n\n function _createStreamAndPermission(address ownerAddress, string memory ownerstring, string calldata streamIdPath, string calldata metadataJsonString) internal returns (string memory) {\n require(bytes(metadataJsonString).length != 0, \"error_metadataJsonStringIsEmpty\");\n\n bytes memory pathBytes = bytes(streamIdPath);\n for (uint i = 1; i < pathBytes.length; i++) {\n // - . / 0 1 2 ... 9\n require((bytes1(\"-\") <= pathBytes[i] && pathBytes[i] <= bytes1(\"9\")) ||\n ((bytes1(\"A\") <= pathBytes[i] && pathBytes[i] <= bytes1(\"Z\"))) ||\n ((bytes1(\"a\") <= pathBytes[i] && pathBytes[i] <= bytes1(\"z\"))) ||\n pathBytes[i] == \"_\"\n , \"error_invalidPathChars\");\n }\n require(pathBytes[0] == \"/\", \"error_pathMustStartWithSlash\");\n\n // abi.encodePacked does simple string concatenation here\n string memory streamId = string(abi.encodePacked(ownerstring, streamIdPath));\n require(bytes(streamIdToMetadata[streamId]).length == 0, \"error_streamAlreadyExists\");\n\n streamIdToVersion[streamId] = streamIdToVersion[streamId] + 1;\n streamIdToMetadata[streamId] = metadataJsonString;\n streamIdToPermissions[streamId][getAddressKey(streamId, ownerAddress)] = Permission({\n canEdit: true,\n canDelete: true,\n publishExpiration: MAX_INT,\n subscribeExpiration: MAX_INT,\n canGrant: true\n });\n emit StreamCreated(streamId, metadataJsonString);\n emit PermissionUpdated(streamId, ownerAddress, true, true, MAX_INT, MAX_INT, true);\n return streamId;\n }\n\n function getAddressKey(string memory streamId, address user) public view returns (bytes32) {\n return keccak256(abi.encode(streamIdToVersion[streamId], user));\n }\n\n function updateStreamMetadata(string calldata streamId, string calldata metadata) public streamExists(streamId) hasEditPermission(streamId) {\n streamIdToMetadata[streamId] = metadata;\n emit StreamUpdated(streamId, metadata);\n }\n\n function getStreamMetadata(string calldata streamId) public view streamExists(streamId) returns (string memory des) {\n return streamIdToMetadata[streamId];\n }\n\n function deleteStream(string calldata streamId) public streamExists(streamId) hasDeletePermission(streamId) {\n delete streamIdToMetadata[streamId];\n emit StreamDeleted(streamId);\n }\n\n function getPermissionsForUser(string calldata streamId, address user) public view streamExists(streamId) returns (Permission memory permission) {\n permission = streamIdToPermissions[streamId][getAddressKey(streamId, user)];\n Permission memory publicPermission = streamIdToPermissions[streamId][getAddressKey(streamId, address(0))];\n if (permission.publishExpiration < block.timestamp && publicPermission.publishExpiration >= block.timestamp) {\n permission.publishExpiration = publicPermission.publishExpiration;\n }\n if (permission.subscribeExpiration < block.timestamp && publicPermission.subscribeExpiration >= block.timestamp) {\n permission.subscribeExpiration = publicPermission.subscribeExpiration;\n }\n return permission;\n }\n\n function getDirectPermissionsForUser(string calldata streamId, address user) public view streamExists(streamId) returns (Permission memory permission) {\n return streamIdToPermissions[streamId][getAddressKey(streamId, user)];\n }\n\n function setPermissionsForUser(string calldata streamId, address user, bool canEdit,\n bool deletePerm, uint256 publishExpiration, uint256 subscribeExpiration, bool canGrant) public hasGrantPermission(streamId) {\n _setPermissionBooleans(streamId, user, canEdit, deletePerm, publishExpiration, subscribeExpiration, canGrant);\n }\n\n function _setPermissionBooleans(string memory streamId, address user, bool canEdit,\n bool deletePerm, uint256 publishExpiration, uint256 subscribeExpiration, bool canGrant) private {\n require(user != address(0) || !(canEdit || deletePerm || canGrant),\n \"error_publicCanOnlySubsPubl\");\n Permission memory perm = Permission({\n canEdit: canEdit,\n canDelete: deletePerm,\n publishExpiration: publishExpiration,\n subscribeExpiration: subscribeExpiration,\n canGrant: canGrant\n });\n streamIdToPermissions[streamId][getAddressKey(streamId, user)] = perm;\n _cleanUpIfAllFalse(streamId, user, perm);\n emit PermissionUpdated(streamId, user, canEdit, deletePerm, publishExpiration, subscribeExpiration, canGrant);\n }\n\n function revokeAllPermissionsForUser(string calldata streamId, address user) public hasSharePermissionOrIsRemovingOwn(streamId, user){\n delete streamIdToPermissions[streamId][getAddressKey(streamId, user)];\n emit PermissionUpdated(streamId, user, false, false, 0, 0, false);\n }\n\n function hasPermission(string calldata streamId, address user, PermissionType permissionType) public view returns (bool userHasPermission) {\n return hasDirectPermission(streamId, user, permissionType) ||\n hasDirectPermission(streamId, address(0), permissionType);\n }\n\n function hasPublicPermission(string calldata streamId, PermissionType permissionType) public view returns (bool userHasPermission) {\n return hasDirectPermission(streamId, address(0), permissionType);\n }\n\n function hasDirectPermission(string calldata streamId, address user, PermissionType permissionType) public view returns (bool userHasPermission) {\n if (permissionType == PermissionType.Edit) {\n return streamIdToPermissions[streamId][getAddressKey(streamId, user)].canEdit;\n }\n else if (permissionType == PermissionType.Delete) {\n return streamIdToPermissions[streamId][getAddressKey(streamId, user)].canDelete;\n }\n else if (permissionType == PermissionType.Publish) {\n return streamIdToPermissions[streamId][getAddressKey(streamId, user)].publishExpiration >= block.timestamp;\n }\n else if (permissionType == PermissionType.Subscribe) {\n return streamIdToPermissions[streamId][getAddressKey(streamId, user)].subscribeExpiration >= block.timestamp;\n }\n else if (permissionType == PermissionType.Grant) {\n return streamIdToPermissions[streamId][getAddressKey(streamId, user)].canGrant;\n }\n }\n\n function setPermissions(string memory streamId, address[] calldata users, Permission[] calldata permissions) public hasGrantPermission(streamId) {\n require(users.length == permissions.length, \"error_invalidInputArrayLengths\");\n uint arrayLength = users.length;\n for (uint i=0; i<arrayLength; i++) {\n Permission memory permission = permissions[i];\n _setPermissionBooleans(streamId, users[i], permission.canEdit, permission.canDelete, permission.publishExpiration, permission.subscribeExpiration, permission.canGrant);\n // emit PermissionUpdated(streamId, users[i], permission.canEdit, permission.canDelete, permission.publishExpiration, permission.subscribeExpiration, permission.canGrant);\n }\n }\n\n // legacy typoed method name\n function setPermissionsMultipleStreans(string[] calldata streamIds, address[][] calldata users, Permission[][] calldata permissions) public {\n setPermissionsMultipleStreams(streamIds, users, permissions);\n }\n\n function setPermissionsMultipleStreams(string[] calldata streamIds, address[][] calldata users, Permission[][] calldata permissions) public {\n require(users.length == permissions.length && permissions.length == streamIds.length, \"error_invalidInputArrayLengths\");\n uint arrayLength = streamIds.length;\n for (uint i=0; i<arrayLength; i++) {\n setPermissions(streamIds[i], users[i], permissions[i]);\n }\n }\n\n function grantPermission(string calldata streamId, address user, PermissionType permissionType) public hasGrantPermission(streamId) {\n _setPermission(streamId, user, permissionType, true);\n }\n\n function revokePermission(string calldata streamId, address user, PermissionType permissionType) public hasSharePermissionOrIsRemovingOwn(streamId, user) {\n _setPermission(streamId, user, permissionType, false);\n }\n\n function _setPermission(string calldata streamId, address user, PermissionType permissionType, bool grant) private {\n require(user != address(0) || permissionType == PermissionType.Subscribe || permissionType == PermissionType.Publish,\n \"error_publicCanOnlySubsPubl\");\n if (permissionType == PermissionType.Edit) {\n streamIdToPermissions[streamId][getAddressKey(streamId, user)].canEdit = grant;\n }\n else if (permissionType == PermissionType.Delete) {\n streamIdToPermissions[streamId][getAddressKey(streamId, user)].canDelete = grant;\n }\n else if (permissionType == PermissionType.Publish) {\n streamIdToPermissions[streamId][getAddressKey(streamId, user)].publishExpiration = grant ? MAX_INT : 0;\n }\n else if (permissionType == PermissionType.Subscribe) {\n streamIdToPermissions[streamId][getAddressKey(streamId, user)].subscribeExpiration = grant ? MAX_INT : 0;\n }\n else if (permissionType == PermissionType.Grant) {\n streamIdToPermissions[streamId][getAddressKey(streamId, user)].canGrant = grant;\n }\n Permission memory perm = streamIdToPermissions[streamId][getAddressKey(streamId, user)];\n _cleanUpIfAllFalse(streamId, user, perm);\n emit PermissionUpdated(streamId, user, perm.canEdit, perm.canDelete, perm.publishExpiration, perm.subscribeExpiration, perm.canGrant);\n }\n\n function _cleanUpIfAllFalse(string memory streamId, address user, Permission memory perm) private {\n if (!perm.canEdit && !perm.canDelete && !perm.canGrant && perm.publishExpiration < block.timestamp && perm.subscribeExpiration < block.timestamp) {\n delete streamIdToPermissions[streamId][getAddressKey(streamId, user)];\n }\n }\n\n function setExpirationTime(string calldata streamId, address user, PermissionType permissionType, uint256 expirationTime) public hasGrantPermission(streamId) {\n require(permissionType == PermissionType.Subscribe || permissionType == PermissionType.Publish, \"error_timeOnlyObPubSub\");\n if (permissionType == PermissionType.Publish) {\n streamIdToPermissions[streamId][getAddressKey(streamId, user)].publishExpiration = expirationTime;\n }\n else if (permissionType == PermissionType.Subscribe) {\n streamIdToPermissions[streamId][getAddressKey(streamId, user)].subscribeExpiration = expirationTime;\n }\n }\n\n function grantPublicPermission(string calldata streamId, PermissionType permissionType) public hasGrantPermission(streamId) {\n grantPermission(streamId, address(0), permissionType);\n }\n\n function revokePublicPermission(string calldata streamId, PermissionType permissionType) public hasGrantPermission(streamId) {\n revokePermission(streamId, address(0), permissionType);\n }\n\n function setPublicPermission(string calldata streamId, uint256 publishExpiration, uint256 subscribeExpiration) public hasGrantPermission(streamId) {\n setPermissionsForUser(streamId, address(0), false, false, publishExpiration, subscribeExpiration, false);\n }\n\n function transferAllPermissionsToUser(string calldata streamId, address recipient) public {\n Permission memory permSender = streamIdToPermissions[streamId][getAddressKey(streamId, _msgSender())];\n require(permSender.canEdit || permSender.canDelete || permSender.publishExpiration > 0 || permSender.subscribeExpiration > 0 ||\n permSender.canGrant, \"error_noPermissionToTransfer\");\n Permission memory permRecipient = streamIdToPermissions[streamId][getAddressKey(streamId, recipient)];\n uint256 publishExpiration = permSender.publishExpiration > permRecipient.publishExpiration ? permSender.publishExpiration : permRecipient.publishExpiration;\n uint256 subscribeExpiration = permSender.subscribeExpiration > permRecipient.subscribeExpiration ? permSender.subscribeExpiration : permRecipient.subscribeExpiration;\n _setPermissionBooleans(streamId, recipient, permSender.canEdit || permRecipient.canEdit, permSender.canDelete || permRecipient.canDelete,\n publishExpiration, subscribeExpiration, permSender.canGrant || permRecipient.canGrant);\n _setPermissionBooleans(streamId, _msgSender(), false, false, 0, 0, false);\n }\n\n function transferPermissionToUser(string calldata streamId, address recipient, PermissionType permissionType) public {\n require(hasDirectPermission(streamId, _msgSender(), permissionType), \"error_noPermissionToTransfer\");\n _setPermission(streamId, _msgSender(), permissionType, false);\n _setPermission(streamId, recipient, permissionType, true);\n }\n\n function trustedSetStreamMetadata(string calldata streamId, string calldata metadata) public isTrusted() {\n streamIdToMetadata[streamId] = metadata;\n emit StreamUpdated(streamId, metadata);\n }\n\n function trustedCreateStreams(string[] calldata streamIds, string[] calldata metadatas) public isTrusted() {\n uint arrayLength = streamIds.length;\n for (uint i = 0; i < arrayLength; i++) {\n streamIdToMetadata[streamIds[i]] = metadatas[i];\n emit StreamUpdated(streamIds[i], metadatas[i]);\n }\n }\n\n function trustedSetStreamWithPermission(\n string calldata streamId,\n string calldata metadata,\n address user,\n bool canEdit,\n bool deletePerm,\n uint256 publishExpiration,\n uint256 subscribeExpiration,\n bool canGrant\n ) public isTrusted() {\n streamIdToMetadata[streamId] = metadata;\n _setPermissionBooleans(streamId, user, canEdit, deletePerm, publishExpiration, subscribeExpiration, canGrant);\n emit StreamUpdated(streamId, metadata);\n }\n\n function trustedSetPermissionsForUser(\n string calldata streamId,\n address user,\n bool canEdit,\n bool deletePerm,\n uint256 publishExpiration,\n uint256 subscribeExpiration,\n bool canGrant\n ) public isTrusted() {\n _setPermissionBooleans(streamId, user, canEdit, deletePerm, publishExpiration, subscribeExpiration, canGrant);\n }\n\n function trustedSetStreams(string[] calldata streamids, address[] calldata users, string[] calldata metadatas, Permission[] calldata permissions) public isTrusted() {\n uint arrayLength = streamids.length;\n for (uint i = 0; i < arrayLength; i++) {\n string calldata streamId = streamids[i];\n streamIdToMetadata[streamId] = metadatas[i];\n Permission memory permission = permissions[i];\n _setPermissionBooleans(streamId, users[i], permission.canEdit, permission.canDelete, permission.publishExpiration, permission.subscribeExpiration, permission.canGrant);\n emit StreamCreated(streamId, metadatas[i]);\n emit PermissionUpdated(streamId, users[i], permission.canEdit, permission.canDelete, permission.publishExpiration, permission.subscribeExpiration, permission.canGrant);\n }\n }\n\n function trustedSetPermissions(string[] calldata streamids, address[] calldata users, Permission[] calldata permissions) public isTrusted() {\n uint arrayLength = streamids.length;\n for (uint i = 0; i < arrayLength; i++) {\n string calldata streamId = streamids[i];\n Permission memory permission = permissions[i];\n _setPermissionBooleans(streamId, users[i], permission.canEdit, permission.canDelete, permission.publishExpiration, permission.subscribeExpiration, permission.canGrant);\n emit PermissionUpdated(streamId, users[i], permission.canEdit, permission.canDelete, permission.publishExpiration, permission.subscribeExpiration, permission.canGrant);\n }\n }\n\n function addressToString(address _address) public pure returns(string memory) {\n bytes32 _bytes = bytes32(uint256(uint160(_address)));\n bytes memory _hex = \"0123456789abcdef\";\n bytes memory _string = new bytes(42);\n _string[0] = \"0\";\n _string[1] = \"x\";\n for(uint i = 0; i < 20; i++) {\n _string[2+i*2] = _hex[uint8(_bytes[i + 12] >> 4)];\n _string[3+i*2] = _hex[uint8(_bytes[i + 12] & 0x0f)];\n }\n return string(_string);\n }\n\n function getTrustedRole() public pure returns (bytes32) {\n return TRUSTED_ROLE;\n }\n\n function setTrustedForwarder(address forwarder) public isTrusted() {\n _setTrustedForwarder(forwarder);\n }\n}\n"},"contracts/StreamRegistry/StreamRegistryV5.sol":{"content":"/**\n * Polygon deployment tx hash: TODO\n *\n * Changes in V5:\n * - Added *forUserId functions: replace user as address with user as bytes calldata\n * - this is to support permission targets longer than 20 bytes (different cryptography)\n * - due to size concerns:\n * - userIdHasPermission and userIdHasDirectPermission are not included in V5\n * - setExpirationTimeForUserId not included\n * - combined some internal functions to take userKey instead of address or bytes id\n * - Removed little used functions: transferAllPermissionsToUser, transferPermissionToUser\n */\n\n// SPDX-License-Identifier: MIT\npragma solidity 0.8.9;\n/* solhint-disable not-rely-on-time */\n\nimport \"./ERC2771ContextUpgradeable.sol\";\nimport \"@openzeppelin/contracts-upgradeable-4.4.2/proxy/utils/UUPSUpgradeable.sol\";\nimport \"../chainlinkClient/ENSCache.sol\";\nimport \"@openzeppelin/contracts-upgradeable-4.4.2/access/AccessControlUpgradeable.sol\";\nimport \"@openzeppelin/contracts-upgradeable-4.4.2/proxy/utils/Initializable.sol\";\n\n// solhint-disable-next-line contract-name-camelcase\ncontract StreamRegistryV5 is Initializable, UUPSUpgradeable, ERC2771ContextUpgradeable, AccessControlUpgradeable {\n\n bytes32 public constant TRUSTED_ROLE = keccak256(\"TRUSTED_ROLE\");\n uint256 constant public MAX_INT = 0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff;\n\n event StreamCreated(string id, string metadata);\n event StreamDeleted(string id);\n event StreamUpdated(string id, string metadata);\n event PermissionUpdated(string streamId, address user, bool canEdit, bool canDelete, uint256 publishExpiration, uint256 subscribeExpiration, bool canGrant);\n\n enum PermissionType { Edit, Delete, Publish, Subscribe, Grant }\n\n struct Permission {\n bool canEdit;\n bool canDelete;\n uint256 publishExpiration;\n uint256 subscribeExpiration;\n bool canGrant;\n }\n\n // streamid -> keccak256(version, useraddress) -> permission struct above\n mapping (string => mapping(bytes32 => Permission)) public streamIdToPermissions;\n mapping (string => string) public streamIdToMetadata;\n ENSCache public ensCache;\n\n // incremented when stream is (re-)created, so that users from old streams with same don't re-appear in the new stream (if they have permissions)\n mapping (string => uint32) public streamIdToVersion;\n\n modifier streamExists(string calldata streamId) {\n require(exists(streamId), \"error_streamDoesNotExist\");\n _;\n }\n modifier hasGrantPermission(string calldata streamId) {\n require(exists(streamId), \"error_streamDoesNotExist\");\n require(streamIdToPermissions[streamId][getAddressKey(streamId, _msgSender())].canGrant, \"error_noSharePermission\");\n _;\n }\n modifier hasSharePermissionOrIsRemovingOwn(string calldata streamId, address user) {\n require(exists(streamId), \"error_streamDoesNotExist\");\n require(\n streamIdToPermissions[streamId][getAddressKey(streamId, _msgSender())].canGrant\n || _msgSender() == user,\n \"error_noSharePermission\"\n );\n _;\n }\n modifier hasDeletePermission(string calldata streamId) {\n require(exists(streamId), \"error_streamDoesNotExist\");\n require(streamIdToPermissions[streamId][getAddressKey(streamId, _msgSender())].canDelete, \"error_noDeletePermission\");\n _;\n }\n modifier hasEditPermission(string calldata streamId) {\n require(exists(streamId), \"error_streamDoesNotExist\");\n require(streamIdToPermissions[streamId][getAddressKey(streamId, _msgSender())].canEdit, \"error_noEditPermission\");\n _;\n }\n modifier isTrusted() {\n require(hasRole(TRUSTED_ROLE, _msgSender()), \"error_mustBeTrustedRole\");\n _;\n }\n\n // Constructor can't be used with upgradeable contracts, so use initialize instead\n // this will not be called upon each upgrade, only once during first deployment\n function initialize(address ensCacheAddr, address trustedForwarderAddress) public initializer {\n ensCache = ENSCache(ensCacheAddr);\n __AccessControl_init();\n _setupRole(DEFAULT_ADMIN_ROLE, msg.sender);\n ERC2771ContextUpgradeable.__ERC2771Context_init(trustedForwarderAddress);\n }\n\n function _msgSender() internal view virtual override(ContextUpgradeable, ERC2771ContextUpgradeable) returns (address sender) {\n return super._msgSender();\n }\n\n function _msgData() internal view virtual override(ContextUpgradeable, ERC2771ContextUpgradeable) returns (bytes calldata) {\n return super._msgData();\n }\n\n function createStream(string calldata streamIdPath, string calldata metadataJsonString) public {\n string memory ownerstring = addressToString(_msgSender());\n _createStreamAndPermission(_msgSender(), ownerstring, streamIdPath, metadataJsonString);\n }\n\n function createStreamWithENS(string calldata ensName, string calldata streamIdPath, string calldata metadataJsonString) public {\n if (ensCache.owners(ensName) == _msgSender()) {\n _createStreamAndPermission(_msgSender(), ensName, streamIdPath, metadataJsonString);\n } else {\n ensCache.requestENSOwnerAndCreateStream(ensName, streamIdPath, metadataJsonString, _msgSender());\n }\n }\n\n function createStreamWithPermissions(string calldata streamIdPath, string calldata metadataJsonString, address[] calldata users, Permission[] calldata permissions) public {\n string memory ownerstring = addressToString(_msgSender());\n string memory streamId = _createStreamAndPermission(_msgSender(), ownerstring, streamIdPath, metadataJsonString);\n _setPermissionsBatch(streamId, users, permissions);\n }\n\n function createMultipleStreamsWithPermissions(string[] calldata streamIdPaths, string[] calldata metadataJsonStrings, address[][] calldata users, Permission[][] calldata permissions) public {\n for (uint i = 0; i < streamIdPaths.length; i++) {\n createStreamWithPermissions(streamIdPaths[i], metadataJsonStrings[i], users[i], permissions[i]);\n }\n }\n\n function exists(string calldata streamId) public view returns (bool) {\n return bytes(streamIdToMetadata[streamId]).length != 0;\n }\n\n function _createStreamAndPermission(address ownerAddress, string memory ownerstring, string calldata streamIdPath, string calldata metadataJsonString) internal returns (string memory) {\n require(bytes(metadataJsonString).length != 0, \"error_metadataJsonStringIsEmpty\");\n\n bytes memory pathBytes = bytes(streamIdPath);\n for (uint i = 1; i < pathBytes.length; i++) {\n // - . / 0 1 2 ... 9\n require((bytes1(\"-\") <= pathBytes[i] && pathBytes[i] <= bytes1(\"9\")) ||\n ((bytes1(\"A\") <= pathBytes[i] && pathBytes[i] <= bytes1(\"Z\"))) ||\n ((bytes1(\"a\") <= pathBytes[i] && pathBytes[i] <= bytes1(\"z\"))) ||\n pathBytes[i] == \"_\"\n , \"error_invalidPathChars\");\n }\n require(pathBytes[0] == \"/\", \"error_pathMustStartWithSlash\");\n\n // abi.encodePacked does simple string concatenation here\n string memory streamId = string(abi.encodePacked(ownerstring, streamIdPath));\n require(bytes(streamIdToMetadata[streamId]).length == 0, \"error_streamAlreadyExists\");\n\n streamIdToVersion[streamId] = streamIdToVersion[streamId] + 1;\n streamIdToMetadata[streamId] = metadataJsonString;\n streamIdToPermissions[streamId][getAddressKey(streamId, ownerAddress)] = Permission({\n canEdit: true,\n canDelete: true,\n publishExpiration: MAX_INT,\n subscribeExpiration: MAX_INT,\n canGrant: true\n });\n emit StreamCreated(streamId, metadataJsonString);\n emit PermissionUpdated(streamId, ownerAddress, true, true, MAX_INT, MAX_INT, true);\n return streamId;\n }\n\n function getAddressKey(string memory streamId, address user) public view returns (bytes32) {\n return keccak256(abi.encode(streamIdToVersion[streamId], user));\n }\n\n function updateStreamMetadata(string calldata streamId, string calldata metadata) public hasEditPermission(streamId) {\n streamIdToMetadata[streamId] = metadata;\n emit StreamUpdated(streamId, metadata);\n }\n\n function getStreamMetadata(string calldata streamId) public view streamExists(streamId) returns (string memory des) {\n return streamIdToMetadata[streamId];\n }\n\n function deleteStream(string calldata streamId) public hasDeletePermission(streamId) {\n delete streamIdToMetadata[streamId];\n emit StreamDeleted(streamId);\n }\n\n /**\n * Get user's permissions to stream.\n * For publish/subscribe expiration, if public permission has a longer validity, use that.\n **/\n function getPermissionsForUser(string calldata streamId, address user) public view streamExists(streamId) returns (Permission memory permission) {\n permission = streamIdToPermissions[streamId][getAddressKey(streamId, user)];\n Permission memory publicPermission = streamIdToPermissions[streamId][getAddressKey(streamId, address(0))];\n if (permission.publishExpiration < block.timestamp && publicPermission.publishExpiration >= block.timestamp) {\n permission.publishExpiration = publicPermission.publishExpiration;\n }\n if (permission.subscribeExpiration < block.timestamp && publicPermission.subscribeExpiration >= block.timestamp) {\n permission.subscribeExpiration = publicPermission.subscribeExpiration;\n }\n return permission;\n }\n\n function getDirectPermissionsForUser(string calldata streamId, address user) public view streamExists(streamId) returns (Permission memory permission) {\n return streamIdToPermissions[streamId][getAddressKey(streamId, user)];\n }\n\n function setPermissionsForUser(\n string calldata streamId, address user, bool canEdit, bool canDelete, uint256 publishExpiration, uint256 subscribeExpiration, bool canGrant\n ) public hasGrantPermission(streamId) {\n require(user != address(0) || !(canEdit || canDelete || canGrant), \"error_publicCanOnlySubsPubl\");\n bytes32 userKey = getAddressKey(streamId, user);\n _setAllPermissions(streamId, userKey, canEdit, canDelete, publishExpiration, subscribeExpiration, canGrant);\n emit PermissionUpdated(streamId, user, canEdit, canDelete, publishExpiration, subscribeExpiration, canGrant);\n }\n\n function _setAllPermissions(\n string memory streamId, bytes32 userKey, bool canEdit, bool canDelete, uint256 publishExpiration, uint256 subscribeExpiration, bool canGrant\n ) private {\n if (!canEdit && !canDelete && !canGrant && publishExpiration < block.timestamp && subscribeExpiration < block.timestamp) {\n delete streamIdToPermissions[streamId][userKey];\n return;\n }\n\n Permission storage perm = streamIdToPermissions[streamId][userKey];\n perm.canEdit = canEdit;\n perm.canDelete = canDelete;\n perm.publishExpiration = publishExpiration;\n perm.subscribeExpiration = subscribeExpiration;\n perm.canGrant = canGrant;\n }\n\n function revokeAllPermissionsForUser(string calldata streamId, address user) public hasSharePermissionOrIsRemovingOwn(streamId, user){\n delete streamIdToPermissions[streamId][getAddressKey(streamId, user)];\n emit PermissionUpdated(streamId, user, false, false, 0, 0, false);\n }\n\n function hasPermission(string calldata streamId, address user, PermissionType permissionType) public view returns (bool userHasPermission) {\n return hasDirectPermission(streamId, user, permissionType) ||\n hasDirectPermission(streamId, address(0), permissionType);\n }\n\n function hasPublicPermission(string calldata streamId, PermissionType permissionType) public view returns (bool userHasPermission) {\n return hasDirectPermission(streamId, address(0), permissionType);\n }\n\n function hasDirectPermission(string calldata streamId, address user, PermissionType permissionType) public view returns (bool userHasPermission) {\n bytes32 key = getAddressKey(streamId, user);\n if (permissionType == PermissionType.Edit) {\n return streamIdToPermissions[streamId][key].canEdit;\n } else if (permissionType == PermissionType.Delete) {\n return streamIdToPermissions[streamId][key].canDelete;\n } else if (permissionType == PermissionType.Publish) {\n return streamIdToPermissions[streamId][key].publishExpiration >= block.timestamp;\n } else if (permissionType == PermissionType.Subscribe) {\n return streamIdToPermissions[streamId][key].subscribeExpiration >= block.timestamp;\n } else if (permissionType == PermissionType.Grant) {\n return streamIdToPermissions[streamId][key].canGrant;\n }\n }\n\n function setPermissions(string calldata streamId, address[] calldata users, Permission[] calldata permissions) public hasGrantPermission(streamId) {\n _setPermissionsBatch(streamId, users, permissions);\n }\n\n function _setPermissionsBatch(string memory streamId, address[] calldata users, Permission[] calldata permissions) internal {\n require(users.length == permissions.length, \"error_invalidInputArrayLengths\");\n uint arrayLength = users.length;\n for (uint i = 0; i < arrayLength; i++) {\n Permission memory permission = permissions[i];\n bytes32 userKey = getAddressKey(streamId, users[i]);\n _setAllPermissions(streamId, userKey, permission.canEdit, permission.canDelete, permission.publishExpiration, permission.subscribeExpiration, permission.canGrant);\n emit PermissionUpdated(streamId, users[i], permission.canEdit, permission.canDelete, permission.publishExpiration, permission.subscribeExpiration, permission.canGrant);\n }\n }\n\n function setPermissionsMultipleStreams(string[] calldata streamIds, address[][] calldata users, Permission[][] calldata permissions) public {\n require(users.length == permissions.length && permissions.length == streamIds.length, \"error_invalidInputArrayLengths\");\n uint arrayLength = streamIds.length;\n for (uint i=0; i<arrayLength; i++) {\n setPermissions(streamIds[i], users[i], permissions[i]);\n }\n }\n\n function grantPermission(string calldata streamId, address user, PermissionType permissionType) public hasGrantPermission(streamId) {\n require(user != address(0) || permissionType == PermissionType.Subscribe || permissionType == PermissionType.Publish, \"error_publicCanOnlySubsPubl\");\n bytes32 userKey = getAddressKey(streamId, user);\n Permission memory perm = _setPermission(streamId, userKey, permissionType, true);\n emit PermissionUpdated(streamId, user, perm.canEdit, perm.canDelete, perm.publishExpiration, perm.subscribeExpiration, perm.canGrant);\n }\n\n function revokePermission(string calldata streamId, address user, PermissionType permissionType) public hasSharePermissionOrIsRemovingOwn(streamId, user) {\n require(user != address(0) || permissionType == PermissionType.Subscribe || permissionType == PermissionType.Publish, \"error_publicCanOnlySubsPubl\");\n bytes32 userKey = getAddressKey(streamId, user);\n Permission memory perm = _setPermission(streamId, userKey, permissionType, false);\n emit PermissionUpdated(streamId, user, perm.canEdit, perm.canDelete, perm.publishExpiration, perm.subscribeExpiration, perm.canGrant);\n }\n\n function _setPermission(string calldata streamId, bytes32 userKey, PermissionType permissionType, bool grant) private returns (Permission memory perm) {\n if (permissionType == PermissionType.Edit) {\n streamIdToPermissions[streamId][userKey].canEdit = grant;\n } else if (permissionType == PermissionType.Delete) {\n streamIdToPermissions[streamId][userKey].canDelete = grant;\n } else if (permissionType == PermissionType.Publish) {\n streamIdToPermissions[streamId][userKey].publishExpiration = grant ? MAX_INT : 0;\n } else if (permissionType == PermissionType.Subscribe) {\n streamIdToPermissions[streamId][userKey].subscribeExpiration = grant ? MAX_INT : 0;\n } else if (permissionType == PermissionType.Grant) {\n streamIdToPermissions[streamId][userKey].canGrant = grant;\n }\n perm = streamIdToPermissions[streamId][userKey];\n // _cleanUpIfAllFalse(streamId, user, perm);\n if (!perm.canEdit && !perm.canDelete && !perm.canGrant && perm.publishExpiration < block.timestamp && perm.subscribeExpiration < block.timestamp) {\n delete streamIdToPermissions[streamId][userKey];\n }\n }\n\n function setExpirationTime(string calldata streamId, address user, PermissionType permissionType, uint256 expirationTime) public hasGrantPermission(streamId) {\n require(permissionType == PermissionType.Subscribe || permissionType == PermissionType.Publish, \"error_timeOnlyObPubSub\");\n Permission storage perm = streamIdToPermissions[streamId][getAddressKey(streamId, user)];\n Permission memory p = perm;\n if (permissionType == PermissionType.Publish) {\n perm.publishExpiration = expirationTime;\n emit PermissionUpdated(streamId, user, p.canEdit, p.canDelete, expirationTime, p.subscribeExpiration, p.canGrant);\n } else if (permissionType == PermissionType.Subscribe) {\n perm.subscribeExpiration = expirationTime;\n emit PermissionUpdated(streamId, user, p.canEdit, p.canDelete, p.publishExpiration, expirationTime, p.canGrant);\n }\n }\n\n function grantPublicPermission(string calldata streamId, PermissionType permissionType) public hasGrantPermission(streamId) {\n grantPermission(streamId, address(0), permissionType);\n }\n\n function revokePublicPermission(string calldata streamId, PermissionType permissionType) public hasGrantPermission(streamId) {\n revokePermission(streamId, address(0), permissionType);\n }\n\n function setPublicPermission(string calldata streamId, uint256 publishExpiration, uint256 subscribeExpiration) public hasGrantPermission(streamId) {\n setPermissionsForUser(streamId, address(0), false, false, publishExpiration, subscribeExpiration, false);\n }\n\n // function transferAllPermissionsToUser(string calldata streamId, address recipient) public {\n // Permission memory permSender = streamIdToPermissions[streamId][getAddressKey(streamId, _msgSender())];\n // require(permSender.canEdit || permSender.canDelete || permSender.publishExpiration > 0 || permSender.subscribeExpiration > 0 ||\n // permSender.canGrant, \"error_noPermissionToTransfer\");\n // Permission memory permRecipient = streamIdToPermissions[streamId][getAddressKey(streamId, recipient)];\n // uint256 publishExpiration = permSender.publishExpiration > permRecipient.publishExpiration ? permSender.publishExpiration : permRecipient.publishExpiration;\n // uint256 subscribeExpiration = permSender.subscribeExpiration > permRecipient.subscribeExpiration ? permSender.subscribeExpiration : permRecipient.subscribeExpiration;\n // _setAllPermissions(streamId, recipient, permSender.canEdit || permRecipient.canEdit, permSender.canDelete || permRecipient.canDelete,\n // publishExpiration, subscribeExpiration, permSender.canGrant || permRecipient.canGrant);\n // _setAllPermissions(streamId, _msgSender(), false, false, 0, 0, false);\n // }\n\n // function transferPermissionToUser(string calldata streamId, address recipient, PermissionType permissionType) public {\n // require(hasDirectPermission(streamId, _msgSender(), permissionType), \"error_noPermissionToTransfer\");\n // _setPermission(streamId, _msgSender(), permissionType, false);\n // _setPermission(streamId, recipient, permissionType, true);\n // }\n\n function addressToString(address _address) public pure returns(string memory) {\n bytes32 _bytes = bytes32(uint256(uint160(_address)));\n bytes memory _hex = \"0123456789abcdef\";\n bytes memory _string = new bytes(42);\n _string[0] = \"0\";\n _string[1] = \"x\";\n for(uint i = 0; i < 20; i++) {\n _string[2+i*2] = _hex[uint8(_bytes[i + 12] >> 4)];\n _string[3+i*2] = _hex[uint8(_bytes[i + 12] & 0x0f)];\n }\n return string(_string);\n }\n\n //////////////////////////////////////////////////////////////////////////////////\n // *forUserId functions: replace user as address with user as bytes calldata\n //////////////////////////////////////////////////////////////////////////////////\n\n event PermissionUpdatedForUserId(string streamId, bytes user, bool canEdit, bool canDelete, uint256 publishExpiration, uint256 subscribeExpiration, bool canGrant);\n\n function getAddressKeyForUserId(string memory streamId, bytes calldata user) public view returns (bytes32) {\n return keccak256(abi.encode(streamIdToVersion[streamId], user));\n }\n\n // function userIdHasPermission(string calldata streamId, bytes calldata user, PermissionType permissionType) public view returns (bool userHasPermission) {\n // return userIdHasDirectPermission(streamId, user, permissionType) || hasDirectPermission(streamId, address(0), permissionType);\n // }\n\n // function userIdHasDirectPermission(string calldata streamId, bytes calldata user, PermissionType permissionType) public view returns (bool userHasPermission) {\n // bytes32 key = getAddressKeyForUserId(streamId, user);\n // Permission storage p = streamIdToPermissions[streamId][key];\n // if (permissionType == PermissionType.Edit) {\n // return p.canEdit;\n // } else if (permissionType == PermissionType.Delete) {\n // return p.canDelete;\n // } else if (permissionType == PermissionType.Publish) {\n // return p.publishExpiration >= block.timestamp;\n // } else if (permissionType == PermissionType.Subscribe) {\n // return p.subscribeExpiration >= block.timestamp;\n // } else if (permissionType == PermissionType.Grant) {\n // return p.canGrant;\n // }\n // }\n\n function grantPermissionForUserId(string calldata streamId, bytes calldata user, PermissionType permissionType) public hasGrantPermission(streamId) {\n bytes32 userKey = getAddressKeyForUserId(streamId, user);\n Permission memory perm = _setPermission(streamId, userKey, permissionType, true);\n emit PermissionUpdatedForUserId(streamId, user, perm.canEdit, perm.canDelete, perm.publishExpiration, perm.subscribeExpiration, perm.canGrant);\n }\n\n function revokePermissionForUserId(string calldata streamId, bytes calldata user, PermissionType permissionType) public hasGrantPermission(streamId) {\n bytes32 userKey = getAddressKeyForUserId(streamId, user);\n Permission memory perm = _setPermission(streamId, userKey, permissionType, false);\n emit PermissionUpdatedForUserId(streamId, user, perm.canEdit, perm.canDelete, perm.publishExpiration, perm.subscribeExpiration, perm.canGrant);\n }\n\n function revokeAllPermissionsForUserId(string calldata streamId, bytes calldata user) public hasGrantPermission(streamId) {\n delete streamIdToPermissions[streamId][getAddressKeyForUserId(streamId, user)];\n emit PermissionUpdatedForUserId(streamId, user, false, false, 0, 0, false);\n }\n\n // function setExpirationTimeForUserId(\n // string calldata streamId, bytes calldata user, PermissionType permissionType, uint256 expirationTime\n // ) public hasGrantPermission(streamId) {\n // require(permissionType == PermissionType.Subscribe || permissionType == PermissionType.Publish, \"error_timeOnlyObPubSub\");\n // Permission storage perm = streamIdToPermissions[streamId][getAddressKeyForUserId(streamId, user)];\n // Permission memory p = perm;\n // if (permissionType == PermissionType.Publish) {\n // perm.publishExpiration = expirationTime;\n // emit PermissionUpdatedForUserId(streamId, user, p.canEdit, p.canDelete, expirationTime, p.subscribeExpiration, p.canGrant);\n // } else if (permissionType == PermissionType.Subscribe) {\n // perm.subscribeExpiration = expirationTime;\n // emit PermissionUpdatedForUserId(streamId, user, p.canEdit, p.canDelete, p.publishExpiration, expirationTime, p.canGrant);\n // }\n // }\n\n // function createStreamWithPermissionsForUserIds(\n // string calldata streamIdPath, string calldata metadataJsonString, bytes[] calldata users, Permission[] calldata permissions\n // ) public {\n // string memory ownerstring = addressToString(_msgSender());\n // string memory streamId = _createStreamAndPermission(_msgSender(), ownerstring, streamIdPath, metadataJsonString);\n // _setPermissionsForUserIds(streamId, users, permissions);\n // }\n\n function setPermissionsForUserIds(string calldata streamId, bytes[] calldata users, Permission[] calldata permissions) public hasGrantPermission(streamId) {\n require(users.length == permissions.length, \"error_invalidInputArrayLengths\");\n uint arrayLength = users.length;\n for (uint i = 0; i < arrayLength; i++) {\n bytes32 userKey = getAddressKeyForUserId(streamId, users[i]);\n Permission calldata p = permissions[i];\n _setAllPermissions(streamId, userKey, p.canEdit, p.canDelete, p.publishExpiration, p.subscribeExpiration, p.canGrant);\n emit PermissionUpdatedForUserId(streamId, users[i], p.canEdit, p.canDelete, p.publishExpiration, p.subscribeExpiration, p.canGrant);\n }\n }\n // function setMultipleStreamPermissionsForUserIds(string[] calldata streamIds, bytes[][] calldata users, Permission[][] calldata permissions) public {\n // require(users.length == permissions.length && permissions.length == streamIds.length, \"error_invalidInputArrayLengths\");\n // uint arrayLength = streamIds.length;\n // for (uint i = 0; i < arrayLength; i++) {\n // setPermissionsForUserIds(streamIds[i], users[i], permissions[i]);\n // }\n // }\n\n // function setPermissionsForUserId(\n // string calldata streamId, bytes calldata user, bool canEdit, bool deletePerm, uint256 publishExpiration, uint256 subscribeExpiration, bool canGrant\n // ) public hasGrantPermission(streamId) {\n // _setPermissionsForUserId(streamId, user, canEdit, deletePerm, publishExpiration, subscribeExpiration, canGrant);\n // }\n\n // function _setPermissionsForUserId(\n // string memory streamId, bytes calldata user, bool canEdit, bool deletePerm, uint256 publishExpiration, uint256 subscribeExpiration, bool canGrant\n // ) private {\n // bytes32 userKey = getAddressKeyForUserId(streamId, user);\n // if (!canEdit && !deletePerm && !canGrant && publishExpiration < block.timestamp && subscribeExpiration < block.timestamp) {\n // delete streamIdToPermissions[streamId][userKey];\n // } else {\n // Permission storage p = streamIdToPermissions[streamId][userKey];\n // p.canEdit = canEdit;\n // p.canDelete = deletePerm;\n // p.publishExpiration = publishExpiration;\n // p.subscribeExpiration = subscribeExpiration;\n // p.canGrant = canGrant;\n // }\n // emit PermissionUpdatedForUserId(streamId, user, canEdit, deletePerm, publishExpiration, subscribeExpiration, canGrant);\n // }\n\n // function transferAllPermissionsToUserId(string calldata streamId, bytes calldata recipient) public {\n // Permission memory permSender = streamIdToPermissions[streamId][getAddressKey(streamId, _msgSender())];\n // require(permSender.canEdit || permSender.canDelete || permSender.publishExpiration > 0 || permSender.subscribeExpiration > 0 || permSender.canGrant, \"error_noPermissionToTransfer\");\n // Permission memory permRecipient = streamIdToPermissions[streamId][getAddressKeyForUserId(streamId, recipient)];\n // uint256 publishExpiration = permSender.publishExpiration > permRecipient.publishExpiration ? permSender.publishExpiration : permRecipient.publishExpiration;\n // uint256 subscribeExpiration = permSender.subscribeExpiration > permRecipient.subscribeExpiration ? permSender.subscribeExpiration : permRecipient.subscribeExpiration;\n // _setPermissionsForUserId(streamId, recipient, permSender.canEdit || permRecipient.canEdit, permSender.canDelete || permRecipient.canDelete,\n // publishExpiration, subscribeExpiration, permSender.canGrant || permRecipient.canGrant);\n // _setAllPermissions(streamId, _msgSender(), false, false, 0, 0, false);\n // }\n\n // function transferPermissionToUserId(string calldata streamId, bytes calldata recipient, PermissionType permissionType) public {\n // require(hasDirectPermission(streamId, _msgSender(), permissionType), \"error_noPermissionToTransfer\");\n // _setPermission(streamId, _msgSender(), permissionType, false);\n // _setPermissionForUserId(streamId, recipient, permissionType, true);\n // }\n\n /**\n * Get user's permissions to stream.\n * For publish/subscribe expiration, if public permission has a longer validity, use that.\n **/\n function getPermissionsForUserId(string calldata streamId, bytes calldata user) public view streamExists(streamId) returns (Permission memory permission) {\n permission = streamIdToPermissions[streamId][getAddressKeyForUserId(streamId, user)];\n Permission memory publicPermission = streamIdToPermissions[streamId][getAddressKey(streamId, address(0))];\n if (permission.publishExpiration < block.timestamp && publicPermission.publishExpiration >= block.timestamp) {\n permission.publishExpiration = publicPermission.publishExpiration;\n }\n if (permission.subscribeExpiration < block.timestamp && publicPermission.subscribeExpiration >= block.timestamp) {\n permission.subscribeExpiration = publicPermission.subscribeExpiration;\n }\n return permission;\n }\n\n function getDirectPermissionsForUserId(string calldata streamId, bytes calldata user) public view streamExists(streamId) returns (Permission memory permission) {\n return streamIdToPermissions[streamId][getAddressKeyForUserId(streamId, user)];\n }\n\n //////////////////////////////////////////////////////////////////////////////////\n // TRUSTED_ROLE functions: admin, integrations to known other smart contracts\n //////////////////////////////////////////////////////////////////////////////////\n\n function _authorizeUpgrade(address) internal override isTrusted() {}\n\n function setEnsCache(address ensCacheAddr) public isTrusted() {\n ensCache = ENSCache(ensCacheAddr);\n }\n\n function setTrustedForwarder(address forwarder) public isTrusted() {\n _setTrustedForwarder(forwarder);\n }\n\n /** used by StreamStorageRegistry when checking if caller has the trusted role */\n function getTrustedRole() public pure returns (bytes32) {\n return TRUSTED_ROLE;\n }\n\n /**\n * Called by the ENSCache when the lookup / update is complete\n */\n // solhint-disable-next-line func-name-mixedcase\n function ENScreateStreamCallback(address ownerAddress, string calldata ensName, string calldata streamIdPath, string calldata metadataJsonString) public isTrusted() {\n require(ensCache.owners(ensName) == ownerAddress, \"error_notOwnerOfENSName\");\n _createStreamAndPermission(ownerAddress, ensName, streamIdPath, metadataJsonString);\n }\n\n /** used by ProjectRegistry._grantSubscribeForStream when someone subscribes to a project */\n function trustedSetPermissionsForUser(\n string calldata streamId,\n address user,\n bool canEdit,\n bool deletePerm,\n uint256 publishExpiration,\n uint256 subscribeExpiration,\n bool canGrant\n ) public isTrusted() {\n bytes32 userKey = getAddressKey(streamId, user);\n _setAllPermissions(streamId, userKey, canEdit, deletePerm, publishExpiration, subscribeExpiration, canGrant);\n emit PermissionUpdated(streamId, user, canEdit, deletePerm, publishExpiration, subscribeExpiration, canGrant);\n }\n}\n"},"contracts/StreamStorageRegistry/StreamStorageRegistry.sol":{"content":"// SPDX-License-Identifier: MIT\npragma solidity 0.8.9;\npragma experimental ABIEncoderV2;\n\nimport \"@openzeppelin/contracts-upgradeable-4.4.2/metatx/ERC2771ContextUpgradeable.sol\";\nimport \"@openzeppelin/contracts-upgradeable-4.4.2/proxy/utils/UUPSUpgradeable.sol\";\nimport \"@openzeppelin/contracts-upgradeable-4.4.2/proxy/utils/Initializable.sol\";\nimport \"../StreamRegistry/StreamRegistry.sol\";\nimport \"../NodeRegistry/NodeRegistry.sol\";\n\n/**\n * StreamStorageRegistry associates streams to storage nodes in many-to-many relationship\n */\ncontract StreamStorageRegistry is Initializable, UUPSUpgradeable, ERC2771ContextUpgradeable {\n StreamRegistry public streamRegistry;\n NodeRegistry public nodeRegistry;\n\n // metadata attached to stream-storagenode-pairs, TODO: use it for something? Add getter?\n struct StreamNodePair {\n uint dateCreated;\n }\n mapping(string => mapping(address => StreamNodePair)) public pairs;\n\n event Added(string streamId, address indexed nodeAddress);\n event Removed(string streamId, address indexed nodeAddress);\n\n modifier onlyEditorOrTrusted(string calldata streamId) {\n require(streamRegistry.exists(streamId), \"error_streamDoesNotExist\");\n bool senderIsTrusted = streamRegistry.hasRole(streamRegistry.getTrustedRole(), _msgSender());\n if (!senderIsTrusted) {\n require(streamRegistry.hasPermission(streamId, _msgSender(), StreamRegistry.PermissionType.Edit), \"error_noEditPermission\");\n }\n _;\n }\n\n modifier isTrusted() {\n require(streamRegistry.hasRole(streamRegistry.getTrustedRole(), _msgSender()), \"error_mustBeTrustedRole\");\n _;\n }\n\n // Constructor can't be used with upgradeable contracts, so use initialize instead\n // this will not be called upon each upgrade, only once during first deployment\n function initialize(address streamRegistryAddress, address nodeRegistryAddress, address trustedForwarderAddress) public initializer {\n streamRegistry = StreamRegistry(streamRegistryAddress);\n nodeRegistry = NodeRegistry(nodeRegistryAddress);\n ERC2771ContextUpgradeable.__ERC2771Context_init(trustedForwarderAddress);\n }\n\n function _authorizeUpgrade(address) internal override isTrusted() {}\n\n function _addPair(string calldata streamId, address nodeAddress) private {\n if (pairs[streamId][nodeAddress].dateCreated == 0) { // don't overwrite existing creation date\n pairs[streamId][nodeAddress].dateCreated = block.timestamp; // solhint-disable-line not-rely-on-time\n }\n emit Added(streamId, nodeAddress);\n }\n function _removePair(string calldata streamId, address nodeAddress) private {\n delete pairs[streamId][nodeAddress];\n emit Removed(streamId, nodeAddress);\n }\n\n function isStorageNodeOf(string calldata streamId, address nodeAddress) public view returns (bool) {\n if (!streamRegistry.exists(streamId)) { return false; }\n NodeRegistry.Node memory node = nodeRegistry.getNode(nodeAddress);\n if (node.lastSeen == 0) { return false; }\n return pairs[streamId][nodeAddress].dateCreated != 0;\n }\n\n function addStorageNode(string calldata streamId, address nodeAddress) external onlyEditorOrTrusted(streamId) {\n NodeRegistry.Node memory node = nodeRegistry.getNode(nodeAddress);\n require(node.lastSeen != 0, \"error_storageNodeNotRegistered\");\n _addPair(streamId, nodeAddress);\n }\n\n function removeStorageNode(string calldata streamId, address nodeAddress) external onlyEditorOrTrusted(streamId) {\n _removePair(streamId, nodeAddress);\n }\n\n function addAndRemoveStorageNodes(string calldata streamId, address[] calldata addNodes, address[] calldata removeNodes) external onlyEditorOrTrusted(streamId) {\n for (uint i = 0; i < addNodes.length; i++) {\n address nodeAddress = addNodes[i];\n NodeRegistry.Node memory node = nodeRegistry.getNode(nodeAddress);\n require(node.lastSeen != 0, \"error_storageNodeNotRegistered\");\n _addPair(streamId, nodeAddress);\n }\n for (uint i = 0; i < removeNodes.length; i++) {\n _removePair(streamId, removeNodes[i]);\n }\n }\n}"},"contracts/StreamStorageRegistry/StreamStorageRegistryV2.sol":{"content":"/**\n * Deployed on polygon on 2022-09-09\n */\n\n// SPDX-License-Identifier: MIT\n\npragma solidity 0.8.9;\n\nimport \"../StreamRegistry/ERC2771ContextUpgradeable.sol\";\nimport \"@openzeppelin/contracts-upgradeable-4.4.2/proxy/utils/UUPSUpgradeable.sol\";\nimport \"@openzeppelin/contracts-upgradeable-4.4.2/proxy/utils/Initializable.sol\";\nimport \"../StreamRegistry/StreamRegistryV4.sol\";\nimport \"../NodeRegistry/NodeRegistry.sol\";\n\n/**\n * StreamStorageRegistry associates streams to storage nodes in many-to-many relationship\n */\ncontract StreamStorageRegistryV2 is Initializable, UUPSUpgradeable, ERC2771ContextUpgradeable {\n StreamRegistryV4 public streamRegistry;\n NodeRegistry public nodeRegistry;\n\n struct StreamNodePair {\n uint dateCreated;\n }\n mapping(string => mapping(address => StreamNodePair)) public pairs;\n\n event Added(string streamId, address indexed nodeAddress);\n event Removed(string streamId, address indexed nodeAddress);\n\n modifier onlyEditorOrTrusted(string calldata streamId) {\n require(streamRegistry.exists(streamId), \"error_streamDoesNotExist\");\n bool senderIsTrusted = streamRegistry.hasRole(streamRegistry.getTrustedRole(), _msgSender());\n if (!senderIsTrusted) {\n require(streamRegistry.hasPermission(streamId, _msgSender(), StreamRegistryV4.PermissionType.Edit), \"error_noEditPermission\");\n }\n _;\n }\n\n modifier isTrusted() {\n require(streamRegistry.hasRole(streamRegistry.getTrustedRole(), _msgSender()), \"error_mustBeTrustedRole\");\n _;\n }\n\n // Constructor can't be used with upgradeable contracts, so use initialize instead\n // this will not be called upon each upgrade, only once during first deployment\n function initialize(address streamRegistryAddress, address nodeRegistryAddress, address trustedForwarderAddress) public initializer {\n streamRegistry = StreamRegistryV4(streamRegistryAddress);\n nodeRegistry = NodeRegistry(nodeRegistryAddress);\n ERC2771ContextUpgradeable.__ERC2771Context_init(trustedForwarderAddress);\n }\n\n function _authorizeUpgrade(address) internal override isTrusted() {}\n\n function _addPair(string calldata streamId, address nodeAddress) private {\n if (pairs[streamId][nodeAddress].dateCreated == 0) { // don't overwrite existing creation date\n pairs[streamId][nodeAddress].dateCreated = block.timestamp; // solhint-disable-line not-rely-on-time\n }\n emit Added(streamId, nodeAddress);\n }\n function _removePair(string calldata streamId, address nodeAddress) private {\n delete pairs[streamId][nodeAddress];\n emit Removed(streamId, nodeAddress);\n }\n\n function isStorageNodeOf(string calldata streamId, address nodeAddress) public view returns (bool) {\n if (!streamRegistry.exists(streamId)) { return false; }\n NodeRegistry.Node memory node = nodeRegistry.getNode(nodeAddress);\n if (node.lastSeen == 0) { return false; }\n return pairs[streamId][nodeAddress].dateCreated != 0;\n }\n\n function addStorageNode(string calldata streamId, address nodeAddress) external onlyEditorOrTrusted(streamId) {\n NodeRegistry.Node memory node = nodeRegistry.getNode(nodeAddress);\n require(node.lastSeen != 0, \"error_storageNodeNotRegistered\");\n _addPair(streamId, nodeAddress);\n }\n\n function removeStorageNode(string calldata streamId, address nodeAddress) external onlyEditorOrTrusted(streamId) {\n _removePair(streamId, nodeAddress);\n }\n\n function addAndRemoveStorageNodes(string calldata streamId, address[] calldata addNodes, address[] calldata removeNodes) external onlyEditorOrTrusted(streamId) {\n for (uint i = 0; i < addNodes.length; i++) {\n address nodeAddress = addNodes[i];\n NodeRegistry.Node memory node = nodeRegistry.getNode(nodeAddress);\n require(node.lastSeen != 0, \"error_storageNodeNotRegistered\");\n _addPair(streamId, nodeAddress);\n }\n for (uint i = 0; i < removeNodes.length; i++) {\n _removePair(streamId, removeNodes[i]);\n }\n }\n\n function setTrustedForwarder(address forwarder) public isTrusted() {\n _setTrustedForwarder(forwarder);\n }\n}"}},"settings":{"optimizer":{"enabled":true,"runs":100},"outputSelection":{"*":{"*":["abi","evm.bytecode","evm.deployedBytecode","evm.methodIdentifiers","metadata","storageLayout"],"":["ast"]}}}},"output":{"sources":{"@chainlink/contracts/src/v0.8/Chainlink.sol":{"ast":{"absolutePath":"@chainlink/contracts/src/v0.8/Chainlink.sol","exportedSymbols":{"BufferChainlink":[1718],"CBORChainlink":[2165],"Chainlink":[268]},"id":269,"license":"MIT","nodeType":"SourceUnit","nodes":[{"id":1,"literals":["solidity","^","0.8",".0"],"nodeType":"PragmaDirective","src":"32:23:0"},{"absolutePath":"@chainlink/contracts/src/v0.8/vendor/CBORChainlink.sol","file":"./vendor/CBORChainlink.sol","id":3,"nameLocation":"-1:-1:-1","nodeType":"ImportDirective","scope":269,"sourceUnit":2166,"src":"57:57:0","symbolAliases":[{"foreign":{"id":2,"name":"CBORChainlink","nodeType":"Identifier","overloadedDeclarations":[],"src":"65:13:0","typeDescriptions":{}},"nameLocation":"-1:-1:-1"}],"unitAlias":""},{"absolutePath":"@chainlink/contracts/src/v0.8/vendor/BufferChainlink.sol","file":"./vendor/BufferChainlink.sol","id":5,"nameLocation":"-1:-1:-1","nodeType":"ImportDirective","scope":269,"sourceUnit":1719,"src":"115:61:0","symbolAliases":[{"foreign":{"id":4,"name":"BufferChainlink","nodeType":"Identifier","overloadedDeclarations":[],"src":"123:15:0","typeDescriptions":{}},"nameLocation":"-1:-1:-1"}],"unitAlias":""},{"abstract":false,"baseContracts":[],"canonicalName":"Chainlink","contractDependencies":[],"contractKind":"library","documentation":{"id":6,"nodeType":"StructuredDocumentation","src":"178:114:0","text":" @title Library for common Chainlink functions\n @dev Uses imported CBOR library for encoding to buffer"},"fullyImplemented":true,"id":268,"linearizedBaseContracts":[268],"name":"Chainlink","nameLocation":"301:9:0","nodeType":"ContractDefinition","nodes":[{"constant":true,"id":9,"mutability":"constant","name":"defaultBufferSize","nameLocation":"341:17:0","nodeType":"VariableDeclaration","scope":268,"src":"315:49:0","stateVariable":true,"storageLocation":"default","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"},"typeName":{"id":7,"name":"uint256","nodeType":"ElementaryTypeName","src":"315:7:0","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"}},"value":{"hexValue":"323536","id":8,"isConstant":false,"isLValue":false,"isPure":true,"kind":"number","lValueRequested":false,"nodeType":"Literal","src":"361:3:0","typeDescriptions":{"typeIdentifier":"t_rational_256_by_1","typeString":"int_const 256"},"value":"256"},"visibility":"internal"},{"id":13,"libraryName":{"id":10,"name":"CBORChainlink","nodeType":"IdentifierPath","referencedDeclaration":2165,"src":"420:13:0"},"nodeType":"UsingForDirective","src":"414:47:0","typeName":{"id":12,"nodeType":"UserDefinedTypeName","pathNode":{"id":11,"name":"BufferChainlink.buffer","nodeType":"IdentifierPath","referencedDeclaration":1204,"src":"438:22:0"},"referencedDeclaration":1204,"src":"438:22:0","typeDescriptions":{"typeIdentifier":"t_struct$_buffer_$1204_storage_ptr","typeString":"struct BufferChainlink.buffer"}}},{"canonicalName":"Chainlink.Request","id":25,"members":[{"constant":false,"id":15,"mutability":"mutable","name":"id","nameLocation":"494:2:0","nodeType":"VariableDeclaration","scope":25,"src":"486:10:0","stateVariable":false,"storageLocation":"default","typeDescriptions":{"typeIdentifier":"t_bytes32","typeString":"bytes32"},"typeName":{"id":14,"name":"bytes32","nodeType":"ElementaryTypeName","src":"486:7:0","typeDescriptions":{"typeIdentifier":"t_bytes32","typeString":"bytes32"}},"visibility":"internal"},{"constant":false,"id":17,"mutability":"mutable","name":"callbackAddress","nameLocation":"510:15:0","nodeType":"VariableDeclaration","scope":25,"src":"502:23:0","stateVariable":false,"storageLocation":"default","typeDescriptions":{"typeIdentifier":"t_address","typeString":"address"},"typeName":{"id":16,"name":"address","nodeType":"ElementaryTypeName","src":"502:7:0","stateMutability":"nonpayable","typeDescriptions":{"typeIdentifier":"t_address","typeString":"address"}},"visibility":"internal"},{"constant":false,"id":19,"mutability":"mutable","name":"callbackFunctionId","nameLocation":"538:18:0","nodeType":"VariableDeclaration","scope":25,"src":"531:25:0","stateVariable":false,"storageLocation":"default","typeDescriptions":{"typeIdentifier":"t_bytes4","typeString":"bytes4"},"typeName":{"id":18,"name":"bytes4","nodeType":"ElementaryTypeName","src":"531:6:0","typeDescriptions":{"typeIdentifier":"t_bytes4","typeString":"bytes4"}},"visibility":"internal"},{"constant":false,"id":21,"mutability":"mutable","name":"nonce","nameLocation":"570:5:0","nodeType":"VariableDeclaration","scope":25,"src":"562:13:0","stateVariable":false,"storageLocation":"default","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"},"typeName":{"id":20,"name":"uint256","nodeType":"ElementaryTypeName","src":"562:7:0","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"}},"visibility":"internal"},{"constant":false,"id":24,"mutability":"mutable","name":"buf","nameLocation":"604:3:0","nodeType":"VariableDeclaration","scope":25,"src":"581:26:0","stateVariable":false,"storageLocation":"default","typeDescriptions":{"typeIdentifier":"t_struct$_buffer_$1204_storage_ptr","typeString":"struct BufferChainlink.buffer"},"typeName":{"id":23,"nodeType":"UserDefinedTypeName","pathNode":{"id":22,"name":"BufferChainlink.buffer","nodeType":"IdentifierPath","referencedDeclaration":1204,"src":"581:22:0"},"referencedDeclaration":1204,"src":"581:22:0","typeDescriptions":{"typeIdentifier":"t_struct$_buffer_$1204_storage_ptr","typeString":"struct BufferChainlink.buffer"}},"visibility":"internal"}],"name":"Request","nameLocation":"472:7:0","nodeType":"StructDefinition","scope":268,"src":"465:147:0","visibility":"public"},{"body":{"id":69,"nodeType":"Block","src":"1155:183:0","statements":[{"expression":{"arguments":[{"expression":{"id":44,"name":"self","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":29,"src":"1182:4:0","typeDescriptions":{"typeIdentifier":"t_struct$_Request_$25_memory_ptr","typeString":"struct Chainlink.Request memory"}},"id":45,"isConstant":false,"isLValue":true,"isPure":false,"lValueRequested":false,"memberName":"buf","nodeType":"MemberAccess","referencedDeclaration":24,"src":"1182:8:0","typeDescriptions":{"typeIdentifier":"t_struct$_buffer_$1204_memory_ptr","typeString":"struct BufferChainlink.buffer memory"}},{"id":46,"name":"defaultBufferSize","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":9,"src":"1192:17:0","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"}}],"expression":{"argumentTypes":[{"typeIdentifier":"t_struct$_buffer_$1204_memory_ptr","typeString":"struct BufferChainlink.buffer memory"},{"typeIdentifier":"t_uint256","typeString":"uint256"}],"expression":{"id":41,"name":"BufferChainlink","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":1718,"src":"1161:15:0","typeDescriptions":{"typeIdentifier":"t_type$_t_contract$_BufferChainlink_$1718_$","typeString":"type(library BufferChainlink)"}},"id":43,"isConstant":false,"isLValue":false,"isPure":false,"lValueRequested":false,"memberName":"init","nodeType":"MemberAccess","referencedDeclaration":1242,"src":"1161:20:0","typeDescriptions":{"typeIdentifier":"t_function_internal_pure$_t_struct$_buffer_$1204_memory_ptr_$_t_uint256_$returns$_t_struct$_buffer_$1204_memory_ptr_$","typeString":"function (struct BufferChainlink.buffer memory,uint256) pure returns (struct BufferChainlink.buffer memory)"}},"id":47,"isConstant":false,"isLValue":false,"isPure":false,"kind":"functionCall","lValueRequested":false,"names":[],"nodeType":"FunctionCall","src":"1161:49:0","tryCall":false,"typeDescriptions":{"typeIdentifier":"t_struct$_buffer_$1204_memory_ptr","typeString":"struct BufferChainlink.buffer memory"}},"id":48,"nodeType":"ExpressionStatement","src":"1161:49:0"},{"expression":{"id":53,"isConstant":false,"isLValue":false,"isPure":false,"lValueRequested":false,"leftHandSide":{"expression":{"id":49,"name":"self","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":29,"src":"1216:4:0","typeDescriptions":{"typeIdentifier":"t_struct$_Request_$25_memory_ptr","typeString":"struct Chainlink.Request memory"}},"id":51,"isConstant":false,"isLValue":true,"isPure":false,"lValueRequested":true,"memberName":"id","nodeType":"MemberAccess","referencedDeclaration":15,"src":"1216:7:0","typeDescriptions":{"typeIdentifier":"t_bytes32","typeString":"bytes32"}},"nodeType":"Assignment","operator":"=","rightHandSide":{"id":52,"name":"jobId","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":31,"src":"1226:5:0","typeDescriptions":{"typeIdentifier":"t_bytes32","typeString":"bytes32"}},"src":"1216:15:0","typeDescriptions":{"typeIdentifier":"t_bytes32","typeString":"bytes32"}},"id":54,"nodeType":"ExpressionStatement","src":"1216:15:0"},{"expression":{"id":59,"isConstant":false,"isLValue":false,"isPure":false,"lValueRequested":false,"leftHandSide":{"expression":{"id":55,"name":"self","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":29,"src":"1237:4:0","typeDescriptions":{"typeIdentifier":"t_struct$_Request_$25_memory_ptr","typeString":"struct Chainlink.Request memory"}},"id":57,"isConstant":false,"isLValue":true,"isPure":false,"lValueRequested":true,"memberName":"callbackAddress","nodeType":"MemberAccess","referencedDeclaration":17,"src":"1237:20:0","typeDescriptions":{"typeIdentifier":"t_address","typeString":"address"}},"nodeType":"Assignment","operator":"=","rightHandSide":{"id":58,"name":"callbackAddr","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":33,"src":"1260:12:0","typeDescriptions":{"typeIdentifier":"t_address","typeString":"address"}},"src":"1237:35:0","typeDescriptions":{"typeIdentifier":"t_address","typeString":"address"}},"id":60,"nodeType":"ExpressionStatement","src":"1237:35:0"},{"expression":{"id":65,"isConstant":false,"isLValue":false,"isPure":false,"lValueRequested":false,"leftHandSide":{"expression":{"id":61,"name":"self","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":29,"src":"1278:4:0","typeDescriptions":{"typeIdentifier":"t_struct$_Request_$25_memory_ptr","typeString":"struct Chainlink.Request memory"}},"id":63,"isConstant":false,"isLValue":true,"isPure":false,"lValueRequested":true,"memberName":"callbackFunctionId","nodeType":"MemberAccess","referencedDeclaration":19,"src":"1278:23:0","typeDescriptions":{"typeIdentifier":"t_bytes4","typeString":"bytes4"}},"nodeType":"Assignment","operator":"=","rightHandSide":{"id":64,"name":"callbackFunc","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":35,"src":"1304:12:0","typeDescriptions":{"typeIdentifier":"t_bytes4","typeString":"bytes4"}},"src":"1278:38:0","typeDescriptions":{"typeIdentifier":"t_bytes4","typeString":"bytes4"}},"id":66,"nodeType":"ExpressionStatement","src":"1278:38:0"},{"expression":{"id":67,"name":"self","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":29,"src":"1329:4:0","typeDescriptions":{"typeIdentifier":"t_struct$_Request_$25_memory_ptr","typeString":"struct Chainlink.Request memory"}},"functionReturnParameters":40,"id":68,"nodeType":"Return","src":"1322:11:0"}]},"documentation":{"id":26,"nodeType":"StructuredDocumentation","src":"616:368:0","text":" @notice Initializes a Chainlink request\n @dev Sets the ID, callback address, and callback function signature on the request\n @param self The uninitialized request\n @param jobId The Job Specification ID\n @param callbackAddr The callback address\n @param callbackFunc The callback function signature\n @return The initialized request"},"id":70,"implemented":true,"kind":"function","modifiers":[],"name":"initialize","nameLocation":"996:10:0","nodeType":"FunctionDefinition","parameters":{"id":36,"nodeType":"ParameterList","parameters":[{"constant":false,"id":29,"mutability":"mutable","name":"self","nameLocation":"1027:4:0","nodeType":"VariableDeclaration","scope":70,"src":"1012:19:0","stateVariable":false,"storageLocation":"memory","typeDescriptions":{"typeIdentifier":"t_struct$_Request_$25_memory_ptr","typeString":"struct Chainlink.Request"},"typeName":{"id":28,"nodeType":"UserDefinedTypeName","pathNode":{"id":27,"name":"Request","nodeType":"IdentifierPath","referencedDeclaration":25,"src":"1012:7:0"},"referencedDeclaration":25,"src":"1012:7:0","typeDescriptions":{"typeIdentifier":"t_struct$_Request_$25_storage_ptr","typeString":"struct Chainlink.Request"}},"visibility":"internal"},{"constant":false,"id":31,"mutability":"mutable","name":"jobId","nameLocation":"1045:5:0","nodeType":"VariableDeclaration","scope":70,"src":"1037:13:0","stateVariable":false,"storageLocation":"default","typeDescriptions":{"typeIdentifier":"t_bytes32","typeString":"bytes32"},"typeName":{"id":30,"name":"bytes32","nodeType":"ElementaryTypeName","src":"1037:7:0","typeDescriptions":{"typeIdentifier":"t_bytes32","typeString":"bytes32"}},"visibility":"internal"},{"constant":false,"id":33,"mutability":"mutable","name":"callbackAddr","nameLocation":"1064:12:0","nodeType":"VariableDeclaration","scope":70,"src":"1056:20:0","stateVariable":false,"storageLocation":"default","typeDescriptions":{"typeIdentifier":"t_address","typeString":"address"},"typeName":{"id":32,"name":"address","nodeType":"ElementaryTypeName","src":"1056:7:0","stateMutability":"nonpayable","typeDescriptions":{"typeIdentifier":"t_address","typeString":"address"}},"visibility":"internal"},{"constant":false,"id":35,"mutability":"mutable","name":"callbackFunc","nameLocation":"1089:12:0","nodeType":"VariableDeclaration","scope":70,"src":"1082:19:0","stateVariable":false,"storageLocation":"default","typeDescriptions":{"typeIdentifier":"t_bytes4","typeString":"bytes4"},"typeName":{"id":34,"name":"bytes4","nodeType":"ElementaryTypeName","src":"1082:6:0","typeDescriptions":{"typeIdentifier":"t_bytes4","typeString":"bytes4"}},"visibility":"internal"}],"src":"1006:99:0"},"returnParameters":{"id":40,"nodeType":"ParameterList","parameters":[{"constant":false,"id":39,"mutability":"mutable","name":"","nameLocation":"-1:-1:-1","nodeType":"VariableDeclaration","scope":70,"src":"1129:24:0","stateVariable":false,"storageLocation":"memory","typeDescriptions":{"typeIdentifier":"t_struct$_Request_$25_memory_ptr","typeString":"struct Chainlink.Request"},"typeName":{"id":38,"nodeType":"UserDefinedTypeName","pathNode":{"id":37,"name":"Chainlink.Request","nodeType":"IdentifierPath","referencedDeclaration":25,"src":"1129:17:0"},"referencedDeclaration":25,"src":"1129:17:0","typeDescriptions":{"typeIdentifier":"t_struct$_Request_$25_storage_ptr","typeString":"struct Chainlink.Request"}},"visibility":"internal"}],"src":"1128:26:0"},"scope":268,"src":"987:351:0","stateMutability":"pure","virtual":false,"visibility":"internal"},{"body":{"id":96,"nodeType":"Block","src":"1648:98:0","statements":[{"expression":{"arguments":[{"expression":{"id":82,"name":"self","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":74,"src":"1675:4:0","typeDescriptions":{"typeIdentifier":"t_struct$_Request_$25_memory_ptr","typeString":"struct Chainlink.Request memory"}},"id":83,"isConstant":false,"isLValue":true,"isPure":false,"lValueRequested":false,"memberName":"buf","nodeType":"MemberAccess","referencedDeclaration":24,"src":"1675:8:0","typeDescriptions":{"typeIdentifier":"t_struct$_buffer_$1204_memory_ptr","typeString":"struct BufferChainlink.buffer memory"}},{"expression":{"id":84,"name":"data","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":76,"src":"1685:4:0","typeDescriptions":{"typeIdentifier":"t_bytes_memory_ptr","typeString":"bytes memory"}},"id":85,"isConstant":false,"isLValue":false,"isPure":false,"lValueRequested":false,"memberName":"length","nodeType":"MemberAccess","src":"1685:11:0","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"}}],"expression":{"argumentTypes":[{"typeIdentifier":"t_struct$_buffer_$1204_memory_ptr","typeString":"struct BufferChainlink.buffer memory"},{"typeIdentifier":"t_uint256","typeString":"uint256"}],"expression":{"id":79,"name":"BufferChainlink","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":1718,"src":"1654:15:0","typeDescriptions":{"typeIdentifier":"t_type$_t_contract$_BufferChainlink_$1718_$","typeString":"type(library BufferChainlink)"}},"id":81,"isConstant":false,"isLValue":false,"isPure":false,"lValueRequested":false,"memberName":"init","nodeType":"MemberAccess","referencedDeclaration":1242,"src":"1654:20:0","typeDescriptions":{"typeIdentifier":"t_function_internal_pure$_t_struct$_buffer_$1204_memory_ptr_$_t_uint256_$returns$_t_struct$_buffer_$1204_memory_ptr_$","typeString":"function (struct BufferChainlink.buffer memory,uint256) pure returns (struct BufferChainlink.buffer memory)"}},"id":86,"isConstant":false,"isLValue":false,"isPure":false,"kind":"functionCall","lValueRequested":false,"names":[],"nodeType":"FunctionCall","src":"1654:43:0","tryCall":false,"typeDescriptions":{"typeIdentifier":"t_struct$_buffer_$1204_memory_ptr","typeString":"struct BufferChainlink.buffer memory"}},"id":87,"nodeType":"ExpressionStatement","src":"1654:43:0"},{"expression":{"arguments":[{"expression":{"id":91,"name":"self","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":74,"src":"1726:4:0","typeDescriptions":{"typeIdentifier":"t_struct$_Request_$25_memory_ptr","typeString":"struct Chainlink.Request memory"}},"id":92,"isConstant":false,"isLValue":true,"isPure":false,"lValueRequested":false,"memberName":"buf","nodeType":"MemberAccess","referencedDeclaration":24,"src":"1726:8:0","typeDescriptions":{"typeIdentifier":"t_struct$_buffer_$1204_memory_ptr","typeString":"struct BufferChainlink.buffer memory"}},{"id":93,"name":"data","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":76,"src":"1736:4:0","typeDescriptions":{"typeIdentifier":"t_bytes_memory_ptr","typeString":"bytes memory"}}],"expression":{"argumentTypes":[{"typeIdentifier":"t_struct$_buffer_$1204_memory_ptr","typeString":"struct BufferChainlink.buffer memory"},{"typeIdentifier":"t_bytes_memory_ptr","typeString":"bytes memory"}],"expression":{"id":88,"name":"BufferChainlink","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":1718,"src":"1703:15:0","typeDescriptions":{"typeIdentifier":"t_type$_t_contract$_BufferChainlink_$1718_$","typeString":"type(library BufferChainlink)"}},"id":90,"isConstant":false,"isLValue":false,"isPure":false,"lValueRequested":false,"memberName":"append","nodeType":"MemberAccess","referencedDeclaration":1461,"src":"1703:22:0","typeDescriptions":{"typeIdentifier":"t_function_internal_pure$_t_struct$_buffer_$1204_memory_ptr_$_t_bytes_memory_ptr_$returns$_t_struct$_buffer_$1204_memory_ptr_$","typeString":"function (struct BufferChainlink.buffer memory,bytes memory) pure returns (struct BufferChainlink.buffer memory)"}},"id":94,"isConstant":false,"isLValue":false,"isPure":false,"kind":"functionCall","lValueRequested":false,"names":[],"nodeType":"FunctionCall","src":"1703:38:0","tryCall":false,"typeDescriptions":{"typeIdentifier":"t_struct$_buffer_$1204_memory_ptr","typeString":"struct BufferChainlink.buffer memory"}},"id":95,"nodeType":"ExpressionStatement","src":"1703:38:0"}]},"documentation":{"id":71,"nodeType":"StructuredDocumentation","src":"1342:230:0","text":" @notice Sets the data for the buffer without encoding CBOR on-chain\n @dev CBOR can be closed with curly-brackets {} or they can be left off\n @param self The initialized request\n @param data The CBOR data"},"id":97,"implemented":true,"kind":"function","modifiers":[],"name":"setBuffer","nameLocation":"1584:9:0","nodeType":"FunctionDefinition","parameters":{"id":77,"nodeType":"ParameterList","parameters":[{"constant":false,"id":74,"mutability":"mutable","name":"self","nameLocation":"1609:4:0","nodeType":"VariableDeclaration","scope":97,"src":"1594:19:0","stateVariable":false,"storageLocation":"memory","typeDescriptions":{"typeIdentifier":"t_struct$_Request_$25_memory_ptr","typeString":"struct Chainlink.Request"},"typeName":{"id":73,"nodeType":"UserDefinedTypeName","pathNode":{"id":72,"name":"Request","nodeType":"IdentifierPath","referencedDeclaration":25,"src":"1594:7:0"},"referencedDeclaration":25,"src":"1594:7:0","typeDescriptions":{"typeIdentifier":"t_struct$_Request_$25_storage_ptr","typeString":"struct Chainlink.Request"}},"visibility":"internal"},{"constant":false,"id":76,"mutability":"mutable","name":"data","nameLocation":"1628:4:0","nodeType":"VariableDeclaration","scope":97,"src":"1615:17:0","stateVariable":false,"storageLocation":"memory","typeDescriptions":{"typeIdentifier":"t_bytes_memory_ptr","typeString":"bytes"},"typeName":{"id":75,"name":"bytes","nodeType":"ElementaryTypeName","src":"1615:5:0","typeDescriptions":{"typeIdentifier":"t_bytes_storage_ptr","typeString":"bytes"}},"visibility":"internal"}],"src":"1593:40:0"},"returnParameters":{"id":78,"nodeType":"ParameterList","parameters":[],"src":"1648:0:0"},"scope":268,"src":"1575:171:0","stateMutability":"pure","virtual":false,"visibility":"internal"},{"body":{"id":124,"nodeType":"Block","src":"2055:71:0","statements":[{"expression":{"arguments":[{"id":113,"name":"key","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":103,"src":"2083:3:0","typeDescriptions":{"typeIdentifier":"t_string_memory_ptr","typeString":"string memory"}}],"expression":{"argumentTypes":[{"typeIdentifier":"t_string_memory_ptr","typeString":"string memory"}],"expression":{"expression":{"id":108,"name":"self","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":101,"src":"2061:4:0","typeDescriptions":{"typeIdentifier":"t_struct$_Request_$25_memory_ptr","typeString":"struct Chainlink.Request memory"}},"id":111,"isConstant":false,"isLValue":true,"isPure":false,"lValueRequested":false,"memberName":"buf","nodeType":"MemberAccess","referencedDeclaration":24,"src":"2061:8:0","typeDescriptions":{"typeIdentifier":"t_struct$_buffer_$1204_memory_ptr","typeString":"struct BufferChainlink.buffer memory"}},"id":112,"isConstant":false,"isLValue":true,"isPure":false,"lValueRequested":false,"memberName":"encodeString","nodeType":"MemberAccess","referencedDeclaration":2128,"src":"2061:21:0","typeDescriptions":{"typeIdentifier":"t_function_internal_pure$_t_struct$_buffer_$1204_memory_ptr_$_t_string_memory_ptr_$returns$__$bound_to$_t_struct$_buffer_$1204_memory_ptr_$","typeString":"function (struct BufferChainlink.buffer memory,string memory) pure"}},"id":114,"isConstant":false,"isLValue":false,"isPure":false,"kind":"functionCall","lValueRequested":false,"names":[],"nodeType":"FunctionCall","src":"2061:26:0","tryCall":false,"typeDescriptions":{"typeIdentifier":"t_tuple$__$","typeString":"tuple()"}},"id":115,"nodeType":"ExpressionStatement","src":"2061:26:0"},{"expression":{"arguments":[{"id":121,"name":"value","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":105,"src":"2115:5:0","typeDescriptions":{"typeIdentifier":"t_string_memory_ptr","typeString":"string memory"}}],"expression":{"argumentTypes":[{"typeIdentifier":"t_string_memory_ptr","typeString":"string memory"}],"expression":{"expression":{"id":116,"name":"self","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":101,"src":"2093:4:0","typeDescriptions":{"typeIdentifier":"t_struct$_Request_$25_memory_ptr","typeString":"struct Chainlink.Request memory"}},"id":119,"isConstant":false,"isLValue":true,"isPure":false,"lValueRequested":false,"memberName":"buf","nodeType":"MemberAccess","referencedDeclaration":24,"src":"2093:8:0","typeDescriptions":{"typeIdentifier":"t_struct$_buffer_$1204_memory_ptr","typeString":"struct BufferChainlink.buffer memory"}},"id":120,"isConstant":false,"isLValue":true,"isPure":false,"lValueRequested":false,"memberName":"encodeString","nodeType":"MemberAccess","referencedDeclaration":2128,"src":"2093:21:0","typeDescriptions":{"typeIdentifier":"t_function_internal_pure$_t_struct$_buffer_$1204_memory_ptr_$_t_string_memory_ptr_$returns$__$bound_to$_t_struct$_buffer_$1204_memory_ptr_$","typeString":"function (struct BufferChainlink.buffer memory,string memory) pure"}},"id":122,"isConstant":false,"isLValue":false,"isPure":false,"kind":"functionCall","lValueRequested":false,"names":[],"nodeType":"FunctionCall","src":"2093:28:0","tryCall":false,"typeDescriptions":{"typeIdentifier":"t_tuple$__$","typeString":"tuple()"}},"id":123,"nodeType":"ExpressionStatement","src":"2093:28:0"}]},"documentation":{"id":98,"nodeType":"StructuredDocumentation","src":"1750:198:0","text":" @notice Adds a string value to the request with a given key name\n @param self The initialized request\n @param key The name of the key\n @param value The string value to add"},"id":125,"implemented":true,"kind":"function","modifiers":[],"name":"add","nameLocation":"1960:3:0","nodeType":"FunctionDefinition","parameters":{"id":106,"nodeType":"ParameterList","parameters":[{"constant":false,"id":101,"mutability":"mutable","name":"self","nameLocation":"1984:4:0","nodeType":"VariableDeclaration","scope":125,"src":"1969:19:0","stateVariable":false,"storageLocation":"memory","typeDescriptions":{"typeIdentifier":"t_struct$_Request_$25_memory_ptr","typeString":"struct Chainlink.Request"},"typeName":{"id":100,"nodeType":"UserDefinedTypeName","pathNode":{"id":99,"name":"Request","nodeType":"IdentifierPath","referencedDeclaration":25,"src":"1969:7:0"},"referencedDeclaration":25,"src":"1969:7:0","typeDescriptions":{"typeIdentifier":"t_struct$_Request_$25_storage_ptr","typeString":"struct Chainlink.Request"}},"visibility":"internal"},{"constant":false,"id":103,"mutability":"mutable","name":"key","nameLocation":"2008:3:0","nodeType":"VariableDeclaration","scope":125,"src":"1994:17:0","stateVariable":false,"storageLocation":"memory","typeDescriptions":{"typeIdentifier":"t_string_memory_ptr","typeString":"string"},"typeName":{"id":102,"name":"string","nodeType":"ElementaryTypeName","src":"1994:6:0","typeDescriptions":{"typeIdentifier":"t_string_storage_ptr","typeString":"string"}},"visibility":"internal"},{"constant":false,"id":105,"mutability":"mutable","name":"value","nameLocation":"2031:5:0","nodeType":"VariableDeclaration","scope":125,"src":"2017:19:0","stateVariable":false,"storageLocation":"memory","typeDescriptions":{"typeIdentifier":"t_string_memory_ptr","typeString":"string"},"typeName":{"id":104,"name":"string","nodeType":"ElementaryTypeName","src":"2017:6:0","typeDescriptions":{"typeIdentifier":"t_string_storage_ptr","typeString":"string"}},"visibility":"internal"}],"src":"1963:77:0"},"returnParameters":{"id":107,"nodeType":"ParameterList","parameters":[],"src":"2055:0:0"},"scope":268,"src":"1951:175:0","stateMutability":"pure","virtual":false,"visibility":"internal"},{"body":{"id":152,"nodeType":"Block","src":"2437:70:0","statements":[{"expression":{"arguments":[{"id":141,"name":"key","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":131,"src":"2465:3:0","typeDescriptions":{"typeIdentifier":"t_string_memory_ptr","typeString":"string memory"}}],"expression":{"argumentTypes":[{"typeIdentifier":"t_string_memory_ptr","typeString":"string memory"}],"expression":{"expression":{"id":136,"name":"self","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":129,"src":"2443:4:0","typeDescriptions":{"typeIdentifier":"t_struct$_Request_$25_memory_ptr","typeString":"struct Chainlink.Request memory"}},"id":139,"isConstant":false,"isLValue":true,"isPure":false,"lValueRequested":false,"memberName":"buf","nodeType":"MemberAccess","referencedDeclaration":24,"src":"2443:8:0","typeDescriptions":{"typeIdentifier":"t_struct$_buffer_$1204_memory_ptr","typeString":"struct BufferChainlink.buffer memory"}},"id":140,"isConstant":false,"isLValue":true,"isPure":false,"lValueRequested":false,"memberName":"encodeString","nodeType":"MemberAccess","referencedDeclaration":2128,"src":"2443:21:0","typeDescriptions":{"typeIdentifier":"t_function_internal_pure$_t_struct$_buffer_$1204_memory_ptr_$_t_string_memory_ptr_$returns$__$bound_to$_t_struct$_buffer_$1204_memory_ptr_$","typeString":"function (struct BufferChainlink.buffer memory,string memory) pure"}},"id":142,"isConstant":false,"isLValue":false,"isPure":false,"kind":"functionCall","lValueRequested":false,"names":[],"nodeType":"FunctionCall","src":"2443:26:0","tryCall":false,"typeDescriptions":{"typeIdentifier":"t_tuple$__$","typeString":"tuple()"}},"id":143,"nodeType":"ExpressionStatement","src":"2443:26:0"},{"expression":{"arguments":[{"id":149,"name":"value","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":133,"src":"2496:5:0","typeDescriptions":{"typeIdentifier":"t_bytes_memory_ptr","typeString":"bytes memory"}}],"expression":{"argumentTypes":[{"typeIdentifier":"t_bytes_memory_ptr","typeString":"bytes memory"}],"expression":{"expression":{"id":144,"name":"self","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":129,"src":"2475:4:0","typeDescriptions":{"typeIdentifier":"t_struct$_Request_$25_memory_ptr","typeString":"struct Chainlink.Request memory"}},"id":147,"isConstant":false,"isLValue":true,"isPure":false,"lValueRequested":false,"memberName":"buf","nodeType":"MemberAccess","referencedDeclaration":24,"src":"2475:8:0","typeDescriptions":{"typeIdentifier":"t_struct$_buffer_$1204_memory_ptr","typeString":"struct BufferChainlink.buffer memory"}},"id":148,"isConstant":false,"isLValue":true,"isPure":false,"lValueRequested":false,"memberName":"encodeBytes","nodeType":"MemberAccess","referencedDeclaration":2029,"src":"2475:20:0","typeDescriptions":{"typeIdentifier":"t_function_internal_pure$_t_struct$_buffer_$1204_memory_ptr_$_t_bytes_memory_ptr_$returns$__$bound_to$_t_struct$_buffer_$1204_memory_ptr_$","typeString":"function (struct BufferChainlink.buffer memory,bytes memory) pure"}},"id":150,"isConstant":false,"isLValue":false,"isPure":false,"kind":"functionCall","lValueRequested":false,"names":[],"nodeType":"FunctionCall","src":"2475:27:0","tryCall":false,"typeDescriptions":{"typeIdentifier":"t_tuple$__$","typeString":"tuple()"}},"id":151,"nodeType":"ExpressionStatement","src":"2475:27:0"}]},"documentation":{"id":126,"nodeType":"StructuredDocumentation","src":"2130:196:0","text":" @notice Adds a bytes value to the request with a given key name\n @param self The initialized request\n @param key The name of the key\n @param value The bytes value to add"},"id":153,"implemented":true,"kind":"function","modifiers":[],"name":"addBytes","nameLocation":"2338:8:0","nodeType":"FunctionDefinition","parameters":{"id":134,"nodeType":"ParameterList","parameters":[{"constant":false,"id":129,"mutability":"mutable","name":"self","nameLocation":"2367:4:0","nodeType":"VariableDeclaration","scope":153,"src":"2352:19:0","stateVariable":false,"storageLocation":"memory","typeDescriptions":{"typeIdentifier":"t_struct$_Request_$25_memory_ptr","typeString":"struct Chainlink.Request"},"typeName":{"id":128,"nodeType":"UserDefinedTypeName","pathNode":{"id":127,"name":"Request","nodeType":"IdentifierPath","referencedDeclaration":25,"src":"2352:7:0"},"referencedDeclaration":25,"src":"2352:7:0","typeDescriptions":{"typeIdentifier":"t_struct$_Request_$25_storage_ptr","typeString":"struct Chainlink.Request"}},"visibility":"internal"},{"constant":false,"id":131,"mutability":"mutable","name":"key","nameLocation":"2391:3:0","nodeType":"VariableDeclaration","scope":153,"src":"2377:17:0","stateVariable":false,"storageLocation":"memory","typeDescriptions":{"typeIdentifier":"t_string_memory_ptr","typeString":"string"},"typeName":{"id":130,"name":"string","nodeType":"ElementaryTypeName","src":"2377:6:0","typeDescriptions":{"typeIdentifier":"t_string_storage_ptr","typeString":"string"}},"visibility":"internal"},{"constant":false,"id":133,"mutability":"mutable","name":"value","nameLocation":"2413:5:0","nodeType":"VariableDeclaration","scope":153,"src":"2400:18:0","stateVariable":false,"storageLocation":"memory","typeDescriptions":{"typeIdentifier":"t_bytes_memory_ptr","typeString":"bytes"},"typeName":{"id":132,"name":"bytes","nodeType":"ElementaryTypeName","src":"2400:5:0","typeDescriptions":{"typeIdentifier":"t_bytes_storage_ptr","typeString":"bytes"}},"visibility":"internal"}],"src":"2346:76:0"},"returnParameters":{"id":135,"nodeType":"ParameterList","parameters":[],"src":"2437:0:0"},"scope":268,"src":"2329:178:0","stateMutability":"pure","virtual":false,"visibility":"internal"},{"body":{"id":180,"nodeType":"Block","src":"2812:68:0","statements":[{"expression":{"arguments":[{"id":169,"name":"key","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":159,"src":"2840:3:0","typeDescriptions":{"typeIdentifier":"t_string_memory_ptr","typeString":"string memory"}}],"expression":{"argumentTypes":[{"typeIdentifier":"t_string_memory_ptr","typeString":"string memory"}],"expression":{"expression":{"id":164,"name":"self","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":157,"src":"2818:4:0","typeDescriptions":{"typeIdentifier":"t_struct$_Request_$25_memory_ptr","typeString":"struct Chainlink.Request memory"}},"id":167,"isConstant":false,"isLValue":true,"isPure":false,"lValueRequested":false,"memberName":"buf","nodeType":"MemberAccess","referencedDeclaration":24,"src":"2818:8:0","typeDescriptions":{"typeIdentifier":"t_struct$_buffer_$1204_memory_ptr","typeString":"struct BufferChainlink.buffer memory"}},"id":168,"isConstant":false,"isLValue":true,"isPure":false,"lValueRequested":false,"memberName":"encodeString","nodeType":"MemberAccess","referencedDeclaration":2128,"src":"2818:21:0","typeDescriptions":{"typeIdentifier":"t_function_internal_pure$_t_struct$_buffer_$1204_memory_ptr_$_t_string_memory_ptr_$returns$__$bound_to$_t_struct$_buffer_$1204_memory_ptr_$","typeString":"function (struct BufferChainlink.buffer memory,string memory) pure"}},"id":170,"isConstant":false,"isLValue":false,"isPure":false,"kind":"functionCall","lValueRequested":false,"names":[],"nodeType":"FunctionCall","src":"2818:26:0","tryCall":false,"typeDescriptions":{"typeIdentifier":"t_tuple$__$","typeString":"tuple()"}},"id":171,"nodeType":"ExpressionStatement","src":"2818:26:0"},{"expression":{"arguments":[{"id":177,"name":"value","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":161,"src":"2869:5:0","typeDescriptions":{"typeIdentifier":"t_int256","typeString":"int256"}}],"expression":{"argumentTypes":[{"typeIdentifier":"t_int256","typeString":"int256"}],"expression":{"expression":{"id":172,"name":"self","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":157,"src":"2850:4:0","typeDescriptions":{"typeIdentifier":"t_struct$_Request_$25_memory_ptr","typeString":"struct Chainlink.Request memory"}},"id":175,"isConstant":false,"isLValue":true,"isPure":false,"lValueRequested":false,"memberName":"buf","nodeType":"MemberAccess","referencedDeclaration":24,"src":"2850:8:0","typeDescriptions":{"typeIdentifier":"t_struct$_buffer_$1204_memory_ptr","typeString":"struct BufferChainlink.buffer memory"}},"id":176,"isConstant":false,"isLValue":true,"isPure":false,"lValueRequested":false,"memberName":"encodeInt","nodeType":"MemberAccess","referencedDeclaration":2004,"src":"2850:18:0","typeDescriptions":{"typeIdentifier":"t_function_internal_pure$_t_struct$_buffer_$1204_memory_ptr_$_t_int256_$returns$__$bound_to$_t_struct$_buffer_$1204_memory_ptr_$","typeString":"function (struct BufferChainlink.buffer memory,int256) pure"}},"id":178,"isConstant":false,"isLValue":false,"isPure":false,"kind":"functionCall","lValueRequested":false,"names":[],"nodeType":"FunctionCall","src":"2850:25:0","tryCall":false,"typeDescriptions":{"typeIdentifier":"t_tuple$__$","typeString":"tuple()"}},"id":179,"nodeType":"ExpressionStatement","src":"2850:25:0"}]},"documentation":{"id":154,"nodeType":"StructuredDocumentation","src":"2511:198:0","text":" @notice Adds a int256 value to the request with a given key name\n @param self The initialized request\n @param key The name of the key\n @param value The int256 value to add"},"id":181,"implemented":true,"kind":"function","modifiers":[],"name":"addInt","nameLocation":"2721:6:0","nodeType":"FunctionDefinition","parameters":{"id":162,"nodeType":"ParameterList","parameters":[{"constant":false,"id":157,"mutability":"mutable","name":"self","nameLocation":"2748:4:0","nodeType":"VariableDeclaration","scope":181,"src":"2733:19:0","stateVariable":false,"storageLocation":"memory","typeDescriptions":{"typeIdentifier":"t_struct$_Request_$25_memory_ptr","typeString":"struct Chainlink.Request"},"typeName":{"id":156,"nodeType":"UserDefinedTypeName","pathNode":{"id":155,"name":"Request","nodeType":"IdentifierPath","referencedDeclaration":25,"src":"2733:7:0"},"referencedDeclaration":25,"src":"2733:7:0","typeDescriptions":{"typeIdentifier":"t_struct$_Request_$25_storage_ptr","typeString":"struct Chainlink.Request"}},"visibility":"internal"},{"constant":false,"id":159,"mutability":"mutable","name":"key","nameLocation":"2772:3:0","nodeType":"VariableDeclaration","scope":181,"src":"2758:17:0","stateVariable":false,"storageLocation":"memory","typeDescriptions":{"typeIdentifier":"t_string_memory_ptr","typeString":"string"},"typeName":{"id":158,"name":"string","nodeType":"ElementaryTypeName","src":"2758:6:0","typeDescriptions":{"typeIdentifier":"t_string_storage_ptr","typeString":"string"}},"visibility":"internal"},{"constant":false,"id":161,"mutability":"mutable","name":"value","nameLocation":"2788:5:0","nodeType":"VariableDeclaration","scope":181,"src":"2781:12:0","stateVariable":false,"storageLocation":"default","typeDescriptions":{"typeIdentifier":"t_int256","typeString":"int256"},"typeName":{"id":160,"name":"int256","nodeType":"ElementaryTypeName","src":"2781:6:0","typeDescriptions":{"typeIdentifier":"t_int256","typeString":"int256"}},"visibility":"internal"}],"src":"2727:70:0"},"returnParameters":{"id":163,"nodeType":"ParameterList","parameters":[],"src":"2812:0:0"},"scope":268,"src":"2712:168:0","stateMutability":"pure","virtual":false,"visibility":"internal"},{"body":{"id":208,"nodeType":"Block","src":"3189:69:0","statements":[{"expression":{"arguments":[{"id":197,"name":"key","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":187,"src":"3217:3:0","typeDescriptions":{"typeIdentifier":"t_string_memory_ptr","typeString":"string memory"}}],"expression":{"argumentTypes":[{"typeIdentifier":"t_string_memory_ptr","typeString":"string memory"}],"expression":{"expression":{"id":192,"name":"self","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":185,"src":"3195:4:0","typeDescriptions":{"typeIdentifier":"t_struct$_Request_$25_memory_ptr","typeString":"struct Chainlink.Request memory"}},"id":195,"isConstant":false,"isLValue":true,"isPure":false,"lValueRequested":false,"memberName":"buf","nodeType":"MemberAccess","referencedDeclaration":24,"src":"3195:8:0","typeDescriptions":{"typeIdentifier":"t_struct$_buffer_$1204_memory_ptr","typeString":"struct BufferChainlink.buffer memory"}},"id":196,"isConstant":false,"isLValue":true,"isPure":false,"lValueRequested":false,"memberName":"encodeString","nodeType":"MemberAccess","referencedDeclaration":2128,"src":"3195:21:0","typeDescriptions":{"typeIdentifier":"t_function_internal_pure$_t_struct$_buffer_$1204_memory_ptr_$_t_string_memory_ptr_$returns$__$bound_to$_t_struct$_buffer_$1204_memory_ptr_$","typeString":"function (struct BufferChainlink.buffer memory,string memory) pure"}},"id":198,"isConstant":false,"isLValue":false,"isPure":false,"kind":"functionCall","lValueRequested":false,"names":[],"nodeType":"FunctionCall","src":"3195:26:0","tryCall":false,"typeDescriptions":{"typeIdentifier":"t_tuple$__$","typeString":"tuple()"}},"id":199,"nodeType":"ExpressionStatement","src":"3195:26:0"},{"expression":{"arguments":[{"id":205,"name":"value","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":189,"src":"3247:5:0","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"}}],"expression":{"argumentTypes":[{"typeIdentifier":"t_uint256","typeString":"uint256"}],"expression":{"expression":{"id":200,"name":"self","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":185,"src":"3227:4:0","typeDescriptions":{"typeIdentifier":"t_struct$_Request_$25_memory_ptr","typeString":"struct Chainlink.Request memory"}},"id":203,"isConstant":false,"isLValue":true,"isPure":false,"lValueRequested":false,"memberName":"buf","nodeType":"MemberAccess","referencedDeclaration":24,"src":"3227:8:0","typeDescriptions":{"typeIdentifier":"t_struct$_buffer_$1204_memory_ptr","typeString":"struct BufferChainlink.buffer memory"}},"id":204,"isConstant":false,"isLValue":true,"isPure":false,"lValueRequested":false,"memberName":"encodeUInt","nodeType":"MemberAccess","referencedDeclaration":1938,"src":"3227:19:0","typeDescriptions":{"typeIdentifier":"t_function_internal_pure$_t_struct$_buffer_$1204_memory_ptr_$_t_uint256_$returns$__$bound_to$_t_struct$_buffer_$1204_memory_ptr_$","typeString":"function (struct BufferChainlink.buffer memory,uint256) pure"}},"id":206,"isConstant":false,"isLValue":false,"isPure":false,"kind":"functionCall","lValueRequested":false,"names":[],"nodeType":"FunctionCall","src":"3227:26:0","tryCall":false,"typeDescriptions":{"typeIdentifier":"t_tuple$__$","typeString":"tuple()"}},"id":207,"nodeType":"ExpressionStatement","src":"3227:26:0"}]},"documentation":{"id":182,"nodeType":"StructuredDocumentation","src":"2884:200:0","text":" @notice Adds a uint256 value to the request with a given key name\n @param self The initialized request\n @param key The name of the key\n @param value The uint256 value to add"},"id":209,"implemented":true,"kind":"function","modifiers":[],"name":"addUint","nameLocation":"3096:7:0","nodeType":"FunctionDefinition","parameters":{"id":190,"nodeType":"ParameterList","parameters":[{"constant":false,"id":185,"mutability":"mutable","name":"self","nameLocation":"3124:4:0","nodeType":"VariableDeclaration","scope":209,"src":"3109:19:0","stateVariable":false,"storageLocation":"memory","typeDescriptions":{"typeIdentifier":"t_struct$_Request_$25_memory_ptr","typeString":"struct Chainlink.Request"},"typeName":{"id":184,"nodeType":"UserDefinedTypeName","pathNode":{"id":183,"name":"Request","nodeType":"IdentifierPath","referencedDeclaration":25,"src":"3109:7:0"},"referencedDeclaration":25,"src":"3109:7:0","typeDescriptions":{"typeIdentifier":"t_struct$_Request_$25_storage_ptr","typeString":"struct Chainlink.Request"}},"visibility":"internal"},{"constant":false,"id":187,"mutability":"mutable","name":"key","nameLocation":"3148:3:0","nodeType":"VariableDeclaration","scope":209,"src":"3134:17:0","stateVariable":false,"storageLocation":"memory","typeDescriptions":{"typeIdentifier":"t_string_memory_ptr","typeString":"string"},"typeName":{"id":186,"name":"string","nodeType":"ElementaryTypeName","src":"3134:6:0","typeDescriptions":{"typeIdentifier":"t_string_storage_ptr","typeString":"string"}},"visibility":"internal"},{"constant":false,"id":189,"mutability":"mutable","name":"value","nameLocation":"3165:5:0","nodeType":"VariableDeclaration","scope":209,"src":"3157:13:0","stateVariable":false,"storageLocation":"default","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"},"typeName":{"id":188,"name":"uint256","nodeType":"ElementaryTypeName","src":"3157:7:0","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"}},"visibility":"internal"}],"src":"3103:71:0"},"returnParameters":{"id":191,"nodeType":"ParameterList","parameters":[],"src":"3189:0:0"},"scope":268,"src":"3087:171:0","stateMutability":"pure","virtual":false,"visibility":"internal"},{"body":{"id":266,"nodeType":"Block","src":"3597:188:0","statements":[{"expression":{"arguments":[{"id":226,"name":"key","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":215,"src":"3625:3:0","typeDescriptions":{"typeIdentifier":"t_string_memory_ptr","typeString":"string memory"}}],"expression":{"argumentTypes":[{"typeIdentifier":"t_string_memory_ptr","typeString":"string memory"}],"expression":{"expression":{"id":221,"name":"self","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":213,"src":"3603:4:0","typeDescriptions":{"typeIdentifier":"t_struct$_Request_$25_memory_ptr","typeString":"struct Chainlink.Request memory"}},"id":224,"isConstant":false,"isLValue":true,"isPure":false,"lValueRequested":false,"memberName":"buf","nodeType":"MemberAccess","referencedDeclaration":24,"src":"3603:8:0","typeDescriptions":{"typeIdentifier":"t_struct$_buffer_$1204_memory_ptr","typeString":"struct BufferChainlink.buffer memory"}},"id":225,"isConstant":false,"isLValue":true,"isPure":false,"lValueRequested":false,"memberName":"encodeString","nodeType":"MemberAccess","referencedDeclaration":2128,"src":"3603:21:0","typeDescriptions":{"typeIdentifier":"t_function_internal_pure$_t_struct$_buffer_$1204_memory_ptr_$_t_string_memory_ptr_$returns$__$bound_to$_t_struct$_buffer_$1204_memory_ptr_$","typeString":"function (struct BufferChainlink.buffer memory,string memory) pure"}},"id":227,"isConstant":false,"isLValue":false,"isPure":false,"kind":"functionCall","lValueRequested":false,"names":[],"nodeType":"FunctionCall","src":"3603:26:0","tryCall":false,"typeDescriptions":{"typeIdentifier":"t_tuple$__$","typeString":"tuple()"}},"id":228,"nodeType":"ExpressionStatement","src":"3603:26:0"},{"expression":{"arguments":[],"expression":{"argumentTypes":[],"expression":{"expression":{"id":229,"name":"self","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":213,"src":"3635:4:0","typeDescriptions":{"typeIdentifier":"t_struct$_Request_$25_memory_ptr","typeString":"struct Chainlink.Request memory"}},"id":232,"isConstant":false,"isLValue":true,"isPure":false,"lValueRequested":false,"memberName":"buf","nodeType":"MemberAccess","referencedDeclaration":24,"src":"3635:8:0","typeDescriptions":{"typeIdentifier":"t_struct$_buffer_$1204_memory_ptr","typeString":"struct BufferChainlink.buffer memory"}},"id":233,"isConstant":false,"isLValue":true,"isPure":false,"lValueRequested":false,"memberName":"startArray","nodeType":"MemberAccess","referencedDeclaration":2140,"src":"3635:19:0","typeDescriptions":{"typeIdentifier":"t_function_internal_pure$_t_struct$_buffer_$1204_memory_ptr_$returns$__$bound_to$_t_struct$_buffer_$1204_memory_ptr_$","typeString":"function (struct BufferChainlink.buffer memory) pure"}},"id":234,"isConstant":false,"isLValue":false,"isPure":false,"kind":"functionCall","lValueRequested":false,"names":[],"nodeType":"FunctionCall","src":"3635:21:0","tryCall":false,"typeDescriptions":{"typeIdentifier":"t_tuple$__$","typeString":"tuple()"}},"id":235,"nodeType":"ExpressionStatement","src":"3635:21:0"},{"body":{"id":257,"nodeType":"Block","src":"3706:47:0","statements":[{"expression":{"arguments":[{"baseExpression":{"id":252,"name":"values","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":218,"src":"3736:6:0","typeDescriptions":{"typeIdentifier":"t_array$_t_string_memory_ptr_$dyn_memory_ptr","typeString":"string memory[] memory"}},"id":254,"indexExpression":{"id":253,"name":"i","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":237,"src":"3743:1:0","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"}},"isConstant":false,"isLValue":true,"isPure":false,"lValueRequested":false,"nodeType":"IndexAccess","src":"3736:9:0","typeDescriptions":{"typeIdentifier":"t_string_memory_ptr","typeString":"string memory"}}],"expression":{"argumentTypes":[{"typeIdentifier":"t_string_memory_ptr","typeString":"string memory"}],"expression":{"expression":{"id":247,"name":"self","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":213,"src":"3714:4:0","typeDescriptions":{"typeIdentifier":"t_struct$_Request_$25_memory_ptr","typeString":"struct Chainlink.Request memory"}},"id":250,"isConstant":false,"isLValue":true,"isPure":false,"lValueRequested":false,"memberName":"buf","nodeType":"MemberAccess","referencedDeclaration":24,"src":"3714:8:0","typeDescriptions":{"typeIdentifier":"t_struct$_buffer_$1204_memory_ptr","typeString":"struct BufferChainlink.buffer memory"}},"id":251,"isConstant":false,"isLValue":true,"isPure":false,"lValueRequested":false,"memberName":"encodeString","nodeType":"MemberAccess","referencedDeclaration":2128,"src":"3714:21:0","typeDescriptions":{"typeIdentifier":"t_function_internal_pure$_t_struct$_buffer_$1204_memory_ptr_$_t_string_memory_ptr_$returns$__$bound_to$_t_struct$_buffer_$1204_memory_ptr_$","typeString":"function (struct BufferChainlink.buffer memory,string memory) pure"}},"id":255,"isConstant":false,"isLValue":false,"isPure":false,"kind":"functionCall","lValueRequested":false,"names":[],"nodeType":"FunctionCall","src":"3714:32:0","tryCall":false,"typeDescriptions":{"typeIdentifier":"t_tuple$__$","typeString":"tuple()"}},"id":256,"nodeType":"ExpressionStatement","src":"3714:32:0"}]},"condition":{"commonType":{"typeIdentifier":"t_uint256","typeString":"uint256"},"id":243,"isConstant":false,"isLValue":false,"isPure":false,"lValueRequested":false,"leftExpression":{"id":240,"name":"i","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":237,"src":"3682:1:0","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"}},"nodeType":"BinaryOperation","operator":"<","rightExpression":{"expression":{"id":241,"name":"values","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":218,"src":"3686:6:0","typeDescriptions":{"typeIdentifier":"t_array$_t_string_memory_ptr_$dyn_memory_ptr","typeString":"string memory[] memory"}},"id":242,"isConstant":false,"isLValue":false,"isPure":false,"lValueRequested":false,"memberName":"length","nodeType":"MemberAccess","src":"3686:13:0","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"}},"src":"3682:17:0","typeDescriptions":{"typeIdentifier":"t_bool","typeString":"bool"}},"id":258,"initializationExpression":{"assignments":[237],"declarations":[{"constant":false,"id":237,"mutability":"mutable","name":"i","nameLocation":"3675:1:0","nodeType":"VariableDeclaration","scope":258,"src":"3667:9:0","stateVariable":false,"storageLocation":"default","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"},"typeName":{"id":236,"name":"uint256","nodeType":"ElementaryTypeName","src":"3667:7:0","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"}},"visibility":"internal"}],"id":239,"initialValue":{"hexValue":"30","id":238,"isConstant":false,"isLValue":false,"isPure":true,"kind":"number","lValueRequested":false,"nodeType":"Literal","src":"3679:1:0","typeDescriptions":{"typeIdentifier":"t_rational_0_by_1","typeString":"int_const 0"},"value":"0"},"nodeType":"VariableDeclarationStatement","src":"3667:13:0"},"loopExpression":{"expression":{"id":245,"isConstant":false,"isLValue":false,"isPure":false,"lValueRequested":false,"nodeType":"UnaryOperation","operator":"++","prefix":false,"src":"3701:3:0","subExpression":{"id":244,"name":"i","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":237,"src":"3701:1:0","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"}},"typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"}},"id":246,"nodeType":"ExpressionStatement","src":"3701:3:0"},"nodeType":"ForStatement","src":"3662:91:0"},{"expression":{"arguments":[],"expression":{"argumentTypes":[],"expression":{"expression":{"id":259,"name":"self","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":213,"src":"3758:4:0","typeDescriptions":{"typeIdentifier":"t_struct$_Request_$25_memory_ptr","typeString":"struct Chainlink.Request memory"}},"id":262,"isConstant":false,"isLValue":true,"isPure":false,"lValueRequested":false,"memberName":"buf","nodeType":"MemberAccess","referencedDeclaration":24,"src":"3758:8:0","typeDescriptions":{"typeIdentifier":"t_struct$_buffer_$1204_memory_ptr","typeString":"struct BufferChainlink.buffer memory"}},"id":263,"isConstant":false,"isLValue":true,"isPure":false,"lValueRequested":false,"memberName":"endSequence","nodeType":"MemberAccess","referencedDeclaration":2164,"src":"3758:20:0","typeDescriptions":{"typeIdentifier":"t_function_internal_pure$_t_struct$_buffer_$1204_memory_ptr_$returns$__$bound_to$_t_struct$_buffer_$1204_memory_ptr_$","typeString":"function (struct BufferChainlink.buffer memory) pure"}},"id":264,"isConstant":false,"isLValue":false,"isPure":false,"kind":"functionCall","lValueRequested":false,"names":[],"nodeType":"FunctionCall","src":"3758:22:0","tryCall":false,"typeDescriptions":{"typeIdentifier":"t_tuple$__$","typeString":"tuple()"}},"id":265,"nodeType":"ExpressionStatement","src":"3758:22:0"}]},"documentation":{"id":210,"nodeType":"StructuredDocumentation","src":"3262:214:0","text":" @notice Adds an array of strings to the request with a given key name\n @param self The initialized request\n @param key The name of the key\n @param values The array of string values to add"},"id":267,"implemented":true,"kind":"function","modifiers":[],"name":"addStringArray","nameLocation":"3488:14:0","nodeType":"FunctionDefinition","parameters":{"id":219,"nodeType":"ParameterList","parameters":[{"constant":false,"id":213,"mutability":"mutable","name":"self","nameLocation":"3523:4:0","nodeType":"VariableDeclaration","scope":267,"src":"3508:19:0","stateVariable":false,"storageLocation":"memory","typeDescriptions":{"typeIdentifier":"t_struct$_Request_$25_memory_ptr","typeString":"struct Chainlink.Request"},"typeName":{"id":212,"nodeType":"UserDefinedTypeName","pathNode":{"id":211,"name":"Request","nodeType":"IdentifierPath","referencedDeclaration":25,"src":"3508:7:0"},"referencedDeclaration":25,"src":"3508:7:0","typeDescriptions":{"typeIdentifier":"t_struct$_Request_$25_storage_ptr","typeString":"struct Chainlink.Request"}},"visibility":"internal"},{"constant":false,"id":215,"mutability":"mutable","name":"key","nameLocation":"3547:3:0","nodeType":"VariableDeclaration","scope":267,"src":"3533:17:0","stateVariable":false,"storageLocation":"memory","typeDescriptions":{"typeIdentifier":"t_string_memory_ptr","typeString":"string"},"typeName":{"id":214,"name":"string","nodeType":"ElementaryTypeName","src":"3533:6:0","typeDescriptions":{"typeIdentifier":"t_string_storage_ptr","typeString":"string"}},"visibility":"internal"},{"constant":false,"id":218,"mutability":"mutable","name":"values","nameLocation":"3572:6:0","nodeType":"VariableDeclaration","scope":267,"src":"3556:22:0","stateVariable":false,"storageLocation":"memory","typeDescriptions":{"typeIdentifier":"t_array$_t_string_memory_ptr_$dyn_memory_ptr","typeString":"string[]"},"typeName":{"baseType":{"id":216,"name":"string","nodeType":"ElementaryTypeName","src":"3556:6:0","typeDescriptions":{"typeIdentifier":"t_string_storage_ptr","typeString":"string"}},"id":217,"nodeType":"ArrayTypeName","src":"3556:8:0","typeDescriptions":{"typeIdentifier":"t_array$_t_string_storage_$dyn_storage_ptr","typeString":"string[]"}},"visibility":"internal"}],"src":"3502:80:0"},"returnParameters":{"id":220,"nodeType":"ParameterList","parameters":[],"src":"3597:0:0"},"scope":268,"src":"3479:306:0","stateMutability":"pure","virtual":false,"visibility":"internal"}],"scope":269,"src":"293:3494:0","usedErrors":[]}],"src":"32:3756:0"},"id":0},"@chainlink/contracts/src/v0.8/ChainlinkClient.sol":{"ast":{"absolutePath":"@chainlink/contracts/src/v0.8/ChainlinkClient.sol","exportedSymbols":{"BufferChainlink":[1718],"CBORChainlink":[2165],"Chainlink":[268],"ChainlinkClient":[861],"ChainlinkRequestInterface":[894],"ENSInterface":[974],"ENSResolver_Chainlink":[2175],"LinkTokenInterface":[1069],"OperatorInterface":[1149],"OracleInterface":[1188],"PointerInterface":[1196]},"id":862,"license":"MIT","nodeType":"SourceUnit","nodes":[{"id":270,"literals":["solidity","^","0.8",".0"],"nodeType":"PragmaDirective","src":"32:23:1"},{"absolutePath":"@chainlink/contracts/src/v0.8/Chainlink.sol","file":"./Chainlink.sol","id":271,"nameLocation":"-1:-1:-1","nodeType":"ImportDirective","scope":862,"sourceUnit":269,"src":"57:25:1","symbolAliases":[],"unitAlias":""},{"absolutePath":"@chainlink/contracts/src/v0.8/interfaces/ENSInterface.sol","file":"./interfaces/ENSInterface.sol","id":272,"nameLocation":"-1:-1:-1","nodeType":"ImportDirective","scope":862,"sourceUnit":975,"src":"83:39:1","symbolAliases":[],"unitAlias":""},{"absolutePath":"@chainlink/contracts/src/v0.8/interfaces/LinkTokenInterface.sol","file":"./interfaces/LinkTokenInterface.sol","id":273,"nameLocation":"-1:-1:-1","nodeType":"ImportDirective","scope":862,"sourceUnit":1070,"src":"123:45:1","symbolAliases":[],"unitAlias":""},{"absolutePath":"@chainlink/contracts/src/v0.8/interfaces/ChainlinkRequestInterface.sol","file":"./interfaces/ChainlinkRequestInterface.sol","id":274,"nameLocation":"-1:-1:-1","nodeType":"ImportDirective","scope":862,"sourceUnit":895,"src":"169:52:1","symbolAliases":[],"unitAlias":""},{"absolutePath":"@chainlink/contracts/src/v0.8/interfaces/OperatorInterface.sol","file":"./interfaces/OperatorInterface.sol","id":275,"nameLocation":"-1:-1:-1","nodeType":"ImportDirective","scope":862,"sourceUnit":1150,"src":"222:44:1","symbolAliases":[],"unitAlias":""},{"absolutePath":"@chainlink/contracts/src/v0.8/interfaces/PointerInterface.sol","file":"./interfaces/PointerInterface.sol","id":276,"nameLocation":"-1:-1:-1","nodeType":"ImportDirective","scope":862,"sourceUnit":1197,"src":"267:43:1","symbolAliases":[],"unitAlias":""},{"absolutePath":"@chainlink/contracts/src/v0.8/vendor/ENSResolver.sol","file":"./vendor/ENSResolver.sol","id":278,"nameLocation":"-1:-1:-1","nodeType":"ImportDirective","scope":862,"sourceUnit":2176,"src":"311:78:1","symbolAliases":[{"foreign":{"id":277,"name":"ENSResolver","nodeType":"Identifier","overloadedDeclarations":[],"src":"319:11:1","typeDescriptions":{}},"local":"ENSResolver_Chainlink","nameLocation":"-1:-1:-1"}],"unitAlias":""},{"abstract":true,"baseContracts":[],"canonicalName":"ChainlinkClient","contractDependencies":[],"contractKind":"contract","documentation":{"id":279,"nodeType":"StructuredDocumentation","src":"391:157:1","text":" @title The ChainlinkClient contract\n @notice Contract writers can inherit this contract in order to create requests for the\n Chainlink network"},"fullyImplemented":true,"id":861,"linearizedBaseContracts":[861],"name":"ChainlinkClient","nameLocation":"567:15:1","nodeType":"ContractDefinition","nodes":[{"id":283,"libraryName":{"id":280,"name":"Chainlink","nodeType":"IdentifierPath","referencedDeclaration":268,"src":"593:9:1"},"nodeType":"UsingForDirective","src":"587:38:1","typeName":{"id":282,"nodeType":"UserDefinedTypeName","pathNode":{"id":281,"name":"Chainlink.Request","nodeType":"IdentifierPath","referencedDeclaration":25,"src":"607:17:1"},"referencedDeclaration":25,"src":"607:17:1","typeDescriptions":{"typeIdentifier":"t_struct$_Request_$25_storage_ptr","typeString":"struct Chainlink.Request"}}},{"constant":true,"id":288,"mutability":"constant","name":"LINK_DIVISIBILITY","nameLocation":"655:17:1","nodeType":"VariableDeclaration","scope":861,"src":"629:52:1","stateVariable":true,"storageLocation":"default","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"},"typeName":{"id":284,"name":"uint256","nodeType":"ElementaryTypeName","src":"629:7:1","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"}},"value":{"commonType":{"typeIdentifier":"t_rational_1000000000000000000_by_1","typeString":"int_const 1000000000000000000"},"id":287,"isConstant":false,"isLValue":false,"isPure":true,"lValueRequested":false,"leftExpression":{"hexValue":"3130","id":285,"isConstant":false,"isLValue":false,"isPure":true,"kind":"number","lValueRequested":false,"nodeType":"Literal","src":"675:2:1","typeDescriptions":{"typeIdentifier":"t_rational_10_by_1","typeString":"int_const 10"},"value":"10"},"nodeType":"BinaryOperation","operator":"**","rightExpression":{"hexValue":"3138","id":286,"isConstant":false,"isLValue":false,"isPure":true,"kind":"number","lValueRequested":false,"nodeType":"Literal","src":"679:2:1","typeDescriptions":{"typeIdentifier":"t_rational_18_by_1","typeString":"int_const 18"},"value":"18"},"src":"675:6:1","typeDescriptions":{"typeIdentifier":"t_rational_1000000000000000000_by_1","typeString":"int_const 1000000000000000000"}},"visibility":"internal"},{"constant":true,"id":291,"mutability":"constant","name":"AMOUNT_OVERRIDE","nameLocation":"710:15:1","nodeType":"VariableDeclaration","scope":861,"src":"685:44:1","stateVariable":true,"storageLocation":"default","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"},"typeName":{"id":289,"name":"uint256","nodeType":"ElementaryTypeName","src":"685:7:1","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"}},"value":{"hexValue":"30","id":290,"isConstant":false,"isLValue":false,"isPure":true,"kind":"number","lValueRequested":false,"nodeType":"Literal","src":"728:1:1","typeDescriptions":{"typeIdentifier":"t_rational_0_by_1","typeString":"int_const 0"},"value":"0"},"visibility":"private"},{"constant":true,"id":297,"mutability":"constant","name":"SENDER_OVERRIDE","nameLocation":"758:15:1","nodeType":"VariableDeclaration","scope":861,"src":"733:53:1","stateVariable":true,"storageLocation":"default","typeDescriptions":{"typeIdentifier":"t_address","typeString":"address"},"typeName":{"id":292,"name":"address","nodeType":"ElementaryTypeName","src":"733:7:1","stateMutability":"nonpayable","typeDescriptions":{"typeIdentifier":"t_address","typeString":"address"}},"value":{"arguments":[{"hexValue":"30","id":295,"isConstant":false,"isLValue":false,"isPure":true,"kind":"number","lValueRequested":false,"nodeType":"Literal","src":"784:1:1","typeDescriptions":{"typeIdentifier":"t_rational_0_by_1","typeString":"int_const 0"},"value":"0"}],"expression":{"argumentTypes":[{"typeIdentifier":"t_rational_0_by_1","typeString":"int_const 0"}],"id":294,"isConstant":false,"isLValue":false,"isPure":true,"lValueRequested":false,"nodeType":"ElementaryTypeNameExpression","src":"776:7:1","typeDescriptions":{"typeIdentifier":"t_type$_t_address_$","typeString":"type(address)"},"typeName":{"id":293,"name":"address","nodeType":"ElementaryTypeName","src":"776:7:1","typeDescriptions":{}}},"id":296,"isConstant":false,"isLValue":false,"isPure":true,"kind":"typeConversion","lValueRequested":false,"names":[],"nodeType":"FunctionCall","src":"776:10:1","tryCall":false,"typeDescriptions":{"typeIdentifier":"t_address","typeString":"address"}},"visibility":"private"},{"constant":true,"id":300,"mutability":"constant","name":"ORACLE_ARGS_VERSION","nameLocation":"815:19:1","nodeType":"VariableDeclaration","scope":861,"src":"790:48:1","stateVariable":true,"storageLocation":"default","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"},"typeName":{"id":298,"name":"uint256","nodeType":"ElementaryTypeName","src":"790:7:1","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"}},"value":{"hexValue":"31","id":299,"isConstant":false,"isLValue":false,"isPure":true,"kind":"number","lValueRequested":false,"nodeType":"Literal","src":"837:1:1","typeDescriptions":{"typeIdentifier":"t_rational_1_by_1","typeString":"int_const 1"},"value":"1"},"visibility":"private"},{"constant":true,"id":303,"mutability":"constant","name":"OPERATOR_ARGS_VERSION","nameLocation":"867:21:1","nodeType":"VariableDeclaration","scope":861,"src":"842:50:1","stateVariable":true,"storageLocation":"default","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"},"typeName":{"id":301,"name":"uint256","nodeType":"ElementaryTypeName","src":"842:7:1","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"}},"value":{"hexValue":"32","id":302,"isConstant":false,"isLValue":false,"isPure":true,"kind":"number","lValueRequested":false,"nodeType":"Literal","src":"891:1:1","typeDescriptions":{"typeIdentifier":"t_rational_2_by_1","typeString":"int_const 2"},"value":"2"},"visibility":"private"},{"constant":true,"id":308,"mutability":"constant","name":"ENS_TOKEN_SUBNAME","nameLocation":"921:17:1","nodeType":"VariableDeclaration","scope":861,"src":"896:62:1","stateVariable":true,"storageLocation":"default","typeDescriptions":{"typeIdentifier":"t_bytes32","typeString":"bytes32"},"typeName":{"id":304,"name":"bytes32","nodeType":"ElementaryTypeName","src":"896:7:1","typeDescriptions":{"typeIdentifier":"t_bytes32","typeString":"bytes32"}},"value":{"arguments":[{"hexValue":"6c696e6b","id":306,"isConstant":false,"isLValue":false,"isPure":true,"kind":"string","lValueRequested":false,"nodeType":"Literal","src":"951:6:1","typeDescriptions":{"typeIdentifier":"t_stringliteral_90430203e2d9ce04f00738d355173358b054545ecb52218de9c6fb01cbd9aeaf","typeString":"literal_string \"link\""},"value":"link"}],"expression":{"argumentTypes":[{"typeIdentifier":"t_stringliteral_90430203e2d9ce04f00738d355173358b054545ecb52218de9c6fb01cbd9aeaf","typeString":"literal_string \"link\""}],"id":305,"name":"keccak256","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":-8,"src":"941:9:1","typeDescriptions":{"typeIdentifier":"t_function_keccak256_pure$_t_bytes_memory_ptr_$returns$_t_bytes32_$","typeString":"function (bytes memory) pure returns (bytes32)"}},"id":307,"isConstant":false,"isLValue":false,"isPure":true,"kind":"functionCall","lValueRequested":false,"names":[],"nodeType":"FunctionCall","src":"941:17:1","tryCall":false,"typeDescriptions":{"typeIdentifier":"t_bytes32","typeString":"bytes32"}},"visibility":"private"},{"constant":true,"id":313,"mutability":"constant","name":"ENS_ORACLE_SUBNAME","nameLocation":"987:18:1","nodeType":"VariableDeclaration","scope":861,"src":"962:65:1","stateVariable":true,"storageLocation":"default","typeDescriptions":{"typeIdentifier":"t_bytes32","typeString":"bytes32"},"typeName":{"id":309,"name":"bytes32","nodeType":"ElementaryTypeName","src":"962:7:1","typeDescriptions":{"typeIdentifier":"t_bytes32","typeString":"bytes32"}},"value":{"arguments":[{"hexValue":"6f7261636c65","id":311,"isConstant":false,"isLValue":false,"isPure":true,"kind":"string","lValueRequested":false,"nodeType":"Literal","src":"1018:8:1","typeDescriptions":{"typeIdentifier":"t_stringliteral_89cbf5af14e0328a3cd3a734f92c3832d729d431da79b7873a62cbeebd37beb6","typeString":"literal_string \"oracle\""},"value":"oracle"}],"expression":{"argumentTypes":[{"typeIdentifier":"t_stringliteral_89cbf5af14e0328a3cd3a734f92c3832d729d431da79b7873a62cbeebd37beb6","typeString":"literal_string \"oracle\""}],"id":310,"name":"keccak256","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":-8,"src":"1008:9:1","typeDescriptions":{"typeIdentifier":"t_function_keccak256_pure$_t_bytes_memory_ptr_$returns$_t_bytes32_$","typeString":"function (bytes memory) pure returns (bytes32)"}},"id":312,"isConstant":false,"isLValue":false,"isPure":true,"kind":"functionCall","lValueRequested":false,"names":[],"nodeType":"FunctionCall","src":"1008:19:1","tryCall":false,"typeDescriptions":{"typeIdentifier":"t_bytes32","typeString":"bytes32"}},"visibility":"private"},{"constant":true,"id":316,"mutability":"constant","name":"LINK_TOKEN_POINTER","nameLocation":"1056:18:1","nodeType":"VariableDeclaration","scope":861,"src":"1031:88:1","stateVariable":true,"storageLocation":"default","typeDescriptions":{"typeIdentifier":"t_address","typeString":"address"},"typeName":{"id":314,"name":"address","nodeType":"ElementaryTypeName","src":"1031:7:1","stateMutability":"nonpayable","typeDescriptions":{"typeIdentifier":"t_address","typeString":"address"}},"value":{"hexValue":"307843383962443445313633324433413433434230334141416435323632636265343033384263353731","id":315,"isConstant":false,"isLValue":false,"isPure":true,"kind":"number","lValueRequested":false,"nodeType":"Literal","src":"1077:42:1","typeDescriptions":{"typeIdentifier":"t_address","typeString":"address"},"value":"0xC89bD4E1632D3A43CB03AAAd5262cbe4038Bc571"},"visibility":"private"},{"constant":false,"id":319,"mutability":"mutable","name":"s_ens","nameLocation":"1145:5:1","nodeType":"VariableDeclaration","scope":861,"src":"1124:26:1","stateVariable":true,"storageLocation":"default","typeDescriptions":{"typeIdentifier":"t_contract$_ENSInterface_$974","typeString":"contract ENSInterface"},"typeName":{"id":318,"nodeType":"UserDefinedTypeName","pathNode":{"id":317,"name":"ENSInterface","nodeType":"IdentifierPath","referencedDeclaration":974,"src":"1124:12:1"},"referencedDeclaration":974,"src":"1124:12:1","typeDescriptions":{"typeIdentifier":"t_contract$_ENSInterface_$974","typeString":"contract ENSInterface"}},"visibility":"private"},{"constant":false,"id":321,"mutability":"mutable","name":"s_ensNode","nameLocation":"1170:9:1","nodeType":"VariableDeclaration","scope":861,"src":"1154:25:1","stateVariable":true,"storageLocation":"default","typeDescriptions":{"typeIdentifier":"t_bytes32","typeString":"bytes32"},"typeName":{"id":320,"name":"bytes32","nodeType":"ElementaryTypeName","src":"1154:7:1","typeDescriptions":{"typeIdentifier":"t_bytes32","typeString":"bytes32"}},"visibility":"private"},{"constant":false,"id":324,"mutability":"mutable","name":"s_link","nameLocation":"1210:6:1","nodeType":"VariableDeclaration","scope":861,"src":"1183:33:1","stateVariable":true,"storageLocation":"default","typeDescriptions":{"typeIdentifier":"t_contract$_LinkTokenInterface_$1069","typeString":"contract LinkTokenInterface"},"typeName":{"id":323,"nodeType":"UserDefinedTypeName","pathNode":{"id":322,"name":"LinkTokenInterface","nodeType":"IdentifierPath","referencedDeclaration":1069,"src":"1183:18:1"},"referencedDeclaration":1069,"src":"1183:18:1","typeDescriptions":{"typeIdentifier":"t_contract$_LinkTokenInterface_$1069","typeString":"contract LinkTokenInterface"}},"visibility":"private"},{"constant":false,"id":327,"mutability":"mutable","name":"s_oracle","nameLocation":"1246:8:1","nodeType":"VariableDeclaration","scope":861,"src":"1220:34:1","stateVariable":true,"storageLocation":"default","typeDescriptions":{"typeIdentifier":"t_contract$_OperatorInterface_$1149","typeString":"contract OperatorInterface"},"typeName":{"id":326,"nodeType":"UserDefinedTypeName","pathNode":{"id":325,"name":"OperatorInterface","nodeType":"IdentifierPath","referencedDeclaration":1149,"src":"1220:17:1"},"referencedDeclaration":1149,"src":"1220:17:1","typeDescriptions":{"typeIdentifier":"t_contract$_OperatorInterface_$1149","typeString":"contract OperatorInterface"}},"visibility":"private"},{"constant":false,"id":330,"mutability":"mutable","name":"s_requestCount","nameLocation":"1274:14:1","nodeType":"VariableDeclaration","scope":861,"src":"1258:34:1","stateVariable":true,"storageLocation":"default","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"},"typeName":{"id":328,"name":"uint256","nodeType":"ElementaryTypeName","src":"1258:7:1","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"}},"value":{"hexValue":"31","id":329,"isConstant":false,"isLValue":false,"isPure":true,"kind":"number","lValueRequested":false,"nodeType":"Literal","src":"1291:1:1","typeDescriptions":{"typeIdentifier":"t_rational_1_by_1","typeString":"int_const 1"},"value":"1"},"visibility":"private"},{"constant":false,"id":334,"mutability":"mutable","name":"s_pendingRequests","nameLocation":"1332:17:1","nodeType":"VariableDeclaration","scope":861,"src":"1296:53:1","stateVariable":true,"storageLocation":"default","typeDescriptions":{"typeIdentifier":"t_mapping$_t_bytes32_$_t_address_$","typeString":"mapping(bytes32 => address)"},"typeName":{"id":333,"keyType":{"id":331,"name":"bytes32","nodeType":"ElementaryTypeName","src":"1304:7:1","typeDescriptions":{"typeIdentifier":"t_bytes32","typeString":"bytes32"}},"nodeType":"Mapping","src":"1296:27:1","typeDescriptions":{"typeIdentifier":"t_mapping$_t_bytes32_$_t_address_$","typeString":"mapping(bytes32 => address)"},"valueType":{"id":332,"name":"address","nodeType":"ElementaryTypeName","src":"1315:7:1","stateMutability":"nonpayable","typeDescriptions":{"typeIdentifier":"t_address","typeString":"address"}}},"visibility":"private"},{"anonymous":false,"id":338,"name":"ChainlinkRequested","nameLocation":"1360:18:1","nodeType":"EventDefinition","parameters":{"id":337,"nodeType":"ParameterList","parameters":[{"constant":false,"id":336,"indexed":true,"mutability":"mutable","name":"id","nameLocation":"1395:2:1","nodeType":"VariableDeclaration","scope":338,"src":"1379:18:1","stateVariable":false,"storageLocation":"default","typeDescriptions":{"typeIdentifier":"t_bytes32","typeString":"bytes32"},"typeName":{"id":335,"name":"bytes32","nodeType":"ElementaryTypeName","src":"1379:7:1","typeDescriptions":{"typeIdentifier":"t_bytes32","typeString":"bytes32"}},"visibility":"internal"}],"src":"1378:20:1"},"src":"1354:45:1"},{"anonymous":false,"id":342,"name":"ChainlinkFulfilled","nameLocation":"1408:18:1","nodeType":"EventDefinition","parameters":{"id":341,"nodeType":"ParameterList","parameters":[{"constant":false,"id":340,"indexed":true,"mutability":"mutable","name":"id","nameLocation":"1443:2:1","nodeType":"VariableDeclaration","scope":342,"src":"1427:18:1","stateVariable":false,"storageLocation":"default","typeDescriptions":{"typeIdentifier":"t_bytes32","typeString":"bytes32"},"typeName":{"id":339,"name":"bytes32","nodeType":"ElementaryTypeName","src":"1427:7:1","typeDescriptions":{"typeIdentifier":"t_bytes32","typeString":"bytes32"}},"visibility":"internal"}],"src":"1426:20:1"},"src":"1402:45:1"},{"anonymous":false,"id":346,"name":"ChainlinkCancelled","nameLocation":"1456:18:1","nodeType":"EventDefinition","parameters":{"id":345,"nodeType":"ParameterList","parameters":[{"constant":false,"id":344,"indexed":true,"mutability":"mutable","name":"id","nameLocation":"1491:2:1","nodeType":"VariableDeclaration","scope":346,"src":"1475:18:1","stateVariable":false,"storageLocation":"default","typeDescriptions":{"typeIdentifier":"t_bytes32","typeString":"bytes32"},"typeName":{"id":343,"name":"bytes32","nodeType":"ElementaryTypeName","src":"1475:7:1","typeDescriptions":{"typeIdentifier":"t_bytes32","typeString":"bytes32"}},"visibility":"internal"}],"src":"1474:20:1"},"src":"1450:45:1"},{"body":{"id":372,"nodeType":"Block","src":"2018:115:1","statements":[{"assignments":[363],"declarations":[{"constant":false,"id":363,"mutability":"mutable","name":"req","nameLocation":"2049:3:1","nodeType":"VariableDeclaration","scope":372,"src":"2024:28:1","stateVariable":false,"storageLocation":"memory","typeDescriptions":{"typeIdentifier":"t_struct$_Request_$25_memory_ptr","typeString":"struct Chainlink.Request"},"typeName":{"id":362,"nodeType":"UserDefinedTypeName","pathNode":{"id":361,"name":"Chainlink.Request","nodeType":"IdentifierPath","referencedDeclaration":25,"src":"2024:17:1"},"referencedDeclaration":25,"src":"2024:17:1","typeDescriptions":{"typeIdentifier":"t_struct$_Request_$25_storage_ptr","typeString":"struct Chainlink.Request"}},"visibility":"internal"}],"id":364,"nodeType":"VariableDeclarationStatement","src":"2024:28:1"},{"expression":{"arguments":[{"id":367,"name":"specId","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":349,"src":"2080:6:1","typeDescriptions":{"typeIdentifier":"t_bytes32","typeString":"bytes32"}},{"id":368,"name":"callbackAddr","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":351,"src":"2088:12:1","typeDescriptions":{"typeIdentifier":"t_address","typeString":"address"}},{"id":369,"name":"callbackFunctionSignature","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":353,"src":"2102:25:1","typeDescriptions":{"typeIdentifier":"t_bytes4","typeString":"bytes4"}}],"expression":{"argumentTypes":[{"typeIdentifier":"t_bytes32","typeString":"bytes32"},{"typeIdentifier":"t_address","typeString":"address"},{"typeIdentifier":"t_bytes4","typeString":"bytes4"}],"expression":{"id":365,"name":"req","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":363,"src":"2065:3:1","typeDescriptions":{"typeIdentifier":"t_struct$_Request_$25_memory_ptr","typeString":"struct Chainlink.Request memory"}},"id":366,"isConstant":false,"isLValue":true,"isPure":false,"lValueRequested":false,"memberName":"initialize","nodeType":"MemberAccess","referencedDeclaration":70,"src":"2065:14:1","typeDescriptions":{"typeIdentifier":"t_function_internal_pure$_t_struct$_Request_$25_memory_ptr_$_t_bytes32_$_t_address_$_t_bytes4_$returns$_t_struct$_Request_$25_memory_ptr_$bound_to$_t_struct$_Request_$25_memory_ptr_$","typeString":"function (struct Chainlink.Request memory,bytes32,address,bytes4) pure returns (struct Chainlink.Request memory)"}},"id":370,"isConstant":false,"isLValue":false,"isPure":false,"kind":"functionCall","lValueRequested":false,"names":[],"nodeType":"FunctionCall","src":"2065:63:1","tryCall":false,"typeDescriptions":{"typeIdentifier":"t_struct$_Request_$25_memory_ptr","typeString":"struct Chainlink.Request memory"}},"functionReturnParameters":358,"id":371,"nodeType":"Return","src":"2058:70:1"}]},"documentation":{"id":347,"nodeType":"StructuredDocumentation","src":"1499:348:1","text":" @notice Creates a request that can hold additional parameters\n @param specId The Job Specification ID that the request will be created for\n @param callbackAddr address to operate the callback on\n @param callbackFunctionSignature function signature to use for the callback\n @return A Chainlink Request struct in memory"},"id":373,"implemented":true,"kind":"function","modifiers":[],"name":"buildChainlinkRequest","nameLocation":"1859:21:1","nodeType":"FunctionDefinition","parameters":{"id":354,"nodeType":"ParameterList","parameters":[{"constant":false,"id":349,"mutability":"mutable","name":"specId","nameLocation":"1894:6:1","nodeType":"VariableDeclaration","scope":373,"src":"1886:14:1","stateVariable":false,"storageLocation":"default","typeDescriptions":{"typeIdentifier":"t_bytes32","typeString":"bytes32"},"typeName":{"id":348,"name":"bytes32","nodeType":"ElementaryTypeName","src":"1886:7:1","typeDescriptions":{"typeIdentifier":"t_bytes32","typeString":"bytes32"}},"visibility":"internal"},{"constant":false,"id":351,"mutability":"mutable","name":"callbackAddr","nameLocation":"1914:12:1","nodeType":"VariableDeclaration","scope":373,"src":"1906:20:1","stateVariable":false,"storageLocation":"default","typeDescriptions":{"typeIdentifier":"t_address","typeString":"address"},"typeName":{"id":350,"name":"address","nodeType":"ElementaryTypeName","src":"1906:7:1","stateMutability":"nonpayable","typeDescriptions":{"typeIdentifier":"t_address","typeString":"address"}},"visibility":"internal"},{"constant":false,"id":353,"mutability":"mutable","name":"callbackFunctionSignature","nameLocation":"1939:25:1","nodeType":"VariableDeclaration","scope":373,"src":"1932:32:1","stateVariable":false,"storageLocation":"default","typeDescriptions":{"typeIdentifier":"t_bytes4","typeString":"bytes4"},"typeName":{"id":352,"name":"bytes4","nodeType":"ElementaryTypeName","src":"1932:6:1","typeDescriptions":{"typeIdentifier":"t_bytes4","typeString":"bytes4"}},"visibility":"internal"}],"src":"1880:88:1"},"returnParameters":{"id":358,"nodeType":"ParameterList","parameters":[{"constant":false,"id":357,"mutability":"mutable","name":"","nameLocation":"-1:-1:-1","nodeType":"VariableDeclaration","scope":373,"src":"1992:24:1","stateVariable":false,"storageLocation":"memory","typeDescriptions":{"typeIdentifier":"t_struct$_Request_$25_memory_ptr","typeString":"struct Chainlink.Request"},"typeName":{"id":356,"nodeType":"UserDefinedTypeName","pathNode":{"id":355,"name":"Chainlink.Request","nodeType":"IdentifierPath","referencedDeclaration":25,"src":"1992:17:1"},"referencedDeclaration":25,"src":"1992:17:1","typeDescriptions":{"typeIdentifier":"t_struct$_Request_$25_storage_ptr","typeString":"struct Chainlink.Request"}},"visibility":"internal"}],"src":"1991:26:1"},"scope":861,"src":"1850:283:1","stateMutability":"pure","virtual":false,"visibility":"internal"},{"body":{"id":400,"nodeType":"Block","src":"2571:116:1","statements":[{"assignments":[388],"declarations":[{"constant":false,"id":388,"mutability":"mutable","name":"req","nameLocation":"2602:3:1","nodeType":"VariableDeclaration","scope":400,"src":"2577:28:1","stateVariable":false,"storageLocation":"memory","typeDescriptions":{"typeIdentifier":"t_struct$_Request_$25_memory_ptr","typeString":"struct Chainlink.Request"},"typeName":{"id":387,"nodeType":"UserDefinedTypeName","pathNode":{"id":386,"name":"Chainlink.Request","nodeType":"IdentifierPath","referencedDeclaration":25,"src":"2577:17:1"},"referencedDeclaration":25,"src":"2577:17:1","typeDescriptions":{"typeIdentifier":"t_struct$_Request_$25_storage_ptr","typeString":"struct Chainlink.Request"}},"visibility":"internal"}],"id":389,"nodeType":"VariableDeclarationStatement","src":"2577:28:1"},{"expression":{"arguments":[{"id":392,"name":"specId","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":376,"src":"2633:6:1","typeDescriptions":{"typeIdentifier":"t_bytes32","typeString":"bytes32"}},{"arguments":[{"id":395,"name":"this","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":-28,"src":"2649:4:1","typeDescriptions":{"typeIdentifier":"t_contract$_ChainlinkClient_$861","typeString":"contract ChainlinkClient"}}],"expression":{"argumentTypes":[{"typeIdentifier":"t_contract$_ChainlinkClient_$861","typeString":"contract ChainlinkClient"}],"id":394,"isConstant":false,"isLValue":false,"isPure":true,"lValueRequested":false,"nodeType":"ElementaryTypeNameExpression","src":"2641:7:1","typeDescriptions":{"typeIdentifier":"t_type$_t_address_$","typeString":"type(address)"},"typeName":{"id":393,"name":"address","nodeType":"ElementaryTypeName","src":"2641:7:1","typeDescriptions":{}}},"id":396,"isConstant":false,"isLValue":false,"isPure":false,"kind":"typeConversion","lValueRequested":false,"names":[],"nodeType":"FunctionCall","src":"2641:13:1","tryCall":false,"typeDescriptions":{"typeIdentifier":"t_address","typeString":"address"}},{"id":397,"name":"callbackFunctionSignature","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":378,"src":"2656:25:1","typeDescriptions":{"typeIdentifier":"t_bytes4","typeString":"bytes4"}}],"expression":{"argumentTypes":[{"typeIdentifier":"t_bytes32","typeString":"bytes32"},{"typeIdentifier":"t_address","typeString":"address"},{"typeIdentifier":"t_bytes4","typeString":"bytes4"}],"expression":{"id":390,"name":"req","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":388,"src":"2618:3:1","typeDescriptions":{"typeIdentifier":"t_struct$_Request_$25_memory_ptr","typeString":"struct Chainlink.Request memory"}},"id":391,"isConstant":false,"isLValue":true,"isPure":false,"lValueRequested":false,"memberName":"initialize","nodeType":"MemberAccess","referencedDeclaration":70,"src":"2618:14:1","typeDescriptions":{"typeIdentifier":"t_function_internal_pure$_t_struct$_Request_$25_memory_ptr_$_t_bytes32_$_t_address_$_t_bytes4_$returns$_t_struct$_Request_$25_memory_ptr_$bound_to$_t_struct$_Request_$25_memory_ptr_$","typeString":"function (struct Chainlink.Request memory,bytes32,address,bytes4) pure returns (struct Chainlink.Request memory)"}},"id":398,"isConstant":false,"isLValue":false,"isPure":false,"kind":"functionCall","lValueRequested":false,"names":[],"nodeType":"FunctionCall","src":"2618:64:1","tryCall":false,"typeDescriptions":{"typeIdentifier":"t_struct$_Request_$25_memory_ptr","typeString":"struct Chainlink.Request memory"}},"functionReturnParameters":383,"id":399,"nodeType":"Return","src":"2611:71:1"}]},"documentation":{"id":374,"nodeType":"StructuredDocumentation","src":"2137:288:1","text":" @notice Creates a request that can hold additional parameters\n @param specId The Job Specification ID that the request will be created for\n @param callbackFunctionSignature function signature to use for the callback\n @return A Chainlink Request struct in memory"},"id":401,"implemented":true,"kind":"function","modifiers":[],"name":"buildOperatorRequest","nameLocation":"2437:20:1","nodeType":"FunctionDefinition","parameters":{"id":379,"nodeType":"ParameterList","parameters":[{"constant":false,"id":376,"mutability":"mutable","name":"specId","nameLocation":"2466:6:1","nodeType":"VariableDeclaration","scope":401,"src":"2458:14:1","stateVariable":false,"storageLocation":"default","typeDescriptions":{"typeIdentifier":"t_bytes32","typeString":"bytes32"},"typeName":{"id":375,"name":"bytes32","nodeType":"ElementaryTypeName","src":"2458:7:1","typeDescriptions":{"typeIdentifier":"t_bytes32","typeString":"bytes32"}},"visibility":"internal"},{"constant":false,"id":378,"mutability":"mutable","name":"callbackFunctionSignature","nameLocation":"2481:25:1","nodeType":"VariableDeclaration","scope":401,"src":"2474:32:1","stateVariable":false,"storageLocation":"default","typeDescriptions":{"typeIdentifier":"t_bytes4","typeString":"bytes4"},"typeName":{"id":377,"name":"bytes4","nodeType":"ElementaryTypeName","src":"2474:6:1","typeDescriptions":{"typeIdentifier":"t_bytes4","typeString":"bytes4"}},"visibility":"internal"}],"src":"2457:50:1"},"returnParameters":{"id":383,"nodeType":"ParameterList","parameters":[{"constant":false,"id":382,"mutability":"mutable","name":"","nameLocation":"-1:-1:-1","nodeType":"VariableDeclaration","scope":401,"src":"2543:24:1","stateVariable":false,"storageLocation":"memory","typeDescriptions":{"typeIdentifier":"t_struct$_Request_$25_memory_ptr","typeString":"struct Chainlink.Request"},"typeName":{"id":381,"nodeType":"UserDefinedTypeName","pathNode":{"id":380,"name":"Chainlink.Request","nodeType":"IdentifierPath","referencedDeclaration":25,"src":"2543:17:1"},"referencedDeclaration":25,"src":"2543:17:1","typeDescriptions":{"typeIdentifier":"t_struct$_Request_$25_storage_ptr","typeString":"struct Chainlink.Request"}},"visibility":"internal"}],"src":"2542:26:1"},"scope":861,"src":"2428:259:1","stateMutability":"view","virtual":false,"visibility":"internal"},{"body":{"id":421,"nodeType":"Block","src":"3096:73:1","statements":[{"expression":{"arguments":[{"arguments":[{"id":415,"name":"s_oracle","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":327,"src":"3140:8:1","typeDescriptions":{"typeIdentifier":"t_contract$_OperatorInterface_$1149","typeString":"contract OperatorInterface"}}],"expression":{"argumentTypes":[{"typeIdentifier":"t_contract$_OperatorInterface_$1149","typeString":"contract OperatorInterface"}],"id":414,"isConstant":false,"isLValue":false,"isPure":true,"lValueRequested":false,"nodeType":"ElementaryTypeNameExpression","src":"3132:7:1","typeDescriptions":{"typeIdentifier":"t_type$_t_address_$","typeString":"type(address)"},"typeName":{"id":413,"name":"address","nodeType":"ElementaryTypeName","src":"3132:7:1","typeDescriptions":{}}},"id":416,"isConstant":false,"isLValue":false,"isPure":false,"kind":"typeConversion","lValueRequested":false,"names":[],"nodeType":"FunctionCall","src":"3132:17:1","tryCall":false,"typeDescriptions":{"typeIdentifier":"t_address","typeString":"address"}},{"id":417,"name":"req","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":405,"src":"3151:3:1","typeDescriptions":{"typeIdentifier":"t_struct$_Request_$25_memory_ptr","typeString":"struct Chainlink.Request memory"}},{"id":418,"name":"payment","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":407,"src":"3156:7:1","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"}}],"expression":{"argumentTypes":[{"typeIdentifier":"t_address","typeString":"address"},{"typeIdentifier":"t_struct$_Request_$25_memory_ptr","typeString":"struct Chainlink.Request memory"},{"typeIdentifier":"t_uint256","typeString":"uint256"}],"id":412,"name":"sendChainlinkRequestTo","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":477,"src":"3109:22:1","typeDescriptions":{"typeIdentifier":"t_function_internal_nonpayable$_t_address_$_t_struct$_Request_$25_memory_ptr_$_t_uint256_$returns$_t_bytes32_$","typeString":"function (address,struct Chainlink.Request memory,uint256) returns (bytes32)"}},"id":419,"isConstant":false,"isLValue":false,"isPure":false,"kind":"functionCall","lValueRequested":false,"names":[],"nodeType":"FunctionCall","src":"3109:55:1","tryCall":false,"typeDescriptions":{"typeIdentifier":"t_bytes32","typeString":"bytes32"}},"functionReturnParameters":411,"id":420,"nodeType":"Return","src":"3102:62:1"}]},"documentation":{"id":402,"nodeType":"StructuredDocumentation","src":"2691:298:1","text":" @notice Creates a Chainlink request to the stored oracle address\n @dev Calls `chainlinkRequestTo` with the stored oracle address\n @param req The initialized Chainlink Request\n @param payment The amount of LINK to send for the request\n @return requestId The request ID"},"id":422,"implemented":true,"kind":"function","modifiers":[],"name":"sendChainlinkRequest","nameLocation":"3001:20:1","nodeType":"FunctionDefinition","parameters":{"id":408,"nodeType":"ParameterList","parameters":[{"constant":false,"id":405,"mutability":"mutable","name":"req","nameLocation":"3047:3:1","nodeType":"VariableDeclaration","scope":422,"src":"3022:28:1","stateVariable":false,"storageLocation":"memory","typeDescriptions":{"typeIdentifier":"t_struct$_Request_$25_memory_ptr","typeString":"struct Chainlink.Request"},"typeName":{"id":404,"nodeType":"UserDefinedTypeName","pathNode":{"id":403,"name":"Chainlink.Request","nodeType":"IdentifierPath","referencedDeclaration":25,"src":"3022:17:1"},"referencedDeclaration":25,"src":"3022:17:1","typeDescriptions":{"typeIdentifier":"t_struct$_Request_$25_storage_ptr","typeString":"struct Chainlink.Request"}},"visibility":"internal"},{"constant":false,"id":407,"mutability":"mutable","name":"payment","nameLocation":"3060:7:1","nodeType":"VariableDeclaration","scope":422,"src":"3052:15:1","stateVariable":false,"storageLocation":"default","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"},"typeName":{"id":406,"name":"uint256","nodeType":"ElementaryTypeName","src":"3052:7:1","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"}},"visibility":"internal"}],"src":"3021:47:1"},"returnParameters":{"id":411,"nodeType":"ParameterList","parameters":[{"constant":false,"id":410,"mutability":"mutable","name":"","nameLocation":"-1:-1:-1","nodeType":"VariableDeclaration","scope":422,"src":"3087:7:1","stateVariable":false,"storageLocation":"default","typeDescriptions":{"typeIdentifier":"t_bytes32","typeString":"bytes32"},"typeName":{"id":409,"name":"bytes32","nodeType":"ElementaryTypeName","src":"3087:7:1","typeDescriptions":{"typeIdentifier":"t_bytes32","typeString":"bytes32"}},"visibility":"internal"}],"src":"3086:9:1"},"scope":861,"src":"2992:177:1","stateMutability":"nonpayable","virtual":false,"visibility":"internal"},{"body":{"id":476,"nodeType":"Block","src":"3842:601:1","statements":[{"assignments":[436],"declarations":[{"constant":false,"id":436,"mutability":"mutable","name":"nonce","nameLocation":"3856:5:1","nodeType":"VariableDeclaration","scope":476,"src":"3848:13:1","stateVariable":false,"storageLocation":"default","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"},"typeName":{"id":435,"name":"uint256","nodeType":"ElementaryTypeName","src":"3848:7:1","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"}},"visibility":"internal"}],"id":438,"initialValue":{"id":437,"name":"s_requestCount","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":330,"src":"3864:14:1","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"}},"nodeType":"VariableDeclarationStatement","src":"3848:30:1"},{"expression":{"id":443,"isConstant":false,"isLValue":false,"isPure":false,"lValueRequested":false,"leftHandSide":{"id":439,"name":"s_requestCount","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":330,"src":"3884:14:1","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"}},"nodeType":"Assignment","operator":"=","rightHandSide":{"commonType":{"typeIdentifier":"t_uint256","typeString":"uint256"},"id":442,"isConstant":false,"isLValue":false,"isPure":false,"lValueRequested":false,"leftExpression":{"id":440,"name":"nonce","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":436,"src":"3901:5:1","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"}},"nodeType":"BinaryOperation","operator":"+","rightExpression":{"hexValue":"31","id":441,"isConstant":false,"isLValue":false,"isPure":true,"kind":"number","lValueRequested":false,"nodeType":"Literal","src":"3909:1:1","typeDescriptions":{"typeIdentifier":"t_rational_1_by_1","typeString":"int_const 1"},"value":"1"},"src":"3901:9:1","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"}},"src":"3884:26:1","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"}},"id":444,"nodeType":"ExpressionStatement","src":"3884:26:1"},{"assignments":[446],"declarations":[{"constant":false,"id":446,"mutability":"mutable","name":"encodedRequest","nameLocation":"3929:14:1","nodeType":"VariableDeclaration","scope":476,"src":"3916:27:1","stateVariable":false,"storageLocation":"memory","typeDescriptions":{"typeIdentifier":"t_bytes_memory_ptr","typeString":"bytes"},"typeName":{"id":445,"name":"bytes","nodeType":"ElementaryTypeName","src":"3916:5:1","typeDescriptions":{"typeIdentifier":"t_bytes_storage_ptr","typeString":"bytes"}},"visibility":"internal"}],"id":468,"initialValue":{"arguments":[{"expression":{"expression":{"id":449,"name":"ChainlinkRequestInterface","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":894,"src":"3976:25:1","typeDescriptions":{"typeIdentifier":"t_type$_t_contract$_ChainlinkRequestInterface_$894_$","typeString":"type(contract ChainlinkRequestInterface)"}},"id":450,"isConstant":false,"isLValue":false,"isPure":true,"lValueRequested":false,"memberName":"oracleRequest","nodeType":"MemberAccess","referencedDeclaration":882,"src":"3976:39:1","typeDescriptions":{"typeIdentifier":"t_function_declaration_nonpayable$_t_address_$_t_uint256_$_t_bytes32_$_t_address_$_t_bytes4_$_t_uint256_$_t_uint256_$_t_bytes_calldata_ptr_$returns$__$","typeString":"function ChainlinkRequestInterface.oracleRequest(address,uint256,bytes32,address,bytes4,uint256,uint256,bytes calldata)"}},"id":451,"isConstant":false,"isLValue":false,"isPure":true,"lValueRequested":false,"memberName":"selector","nodeType":"MemberAccess","src":"3976:48:1","typeDescriptions":{"typeIdentifier":"t_bytes4","typeString":"bytes4"}},{"id":452,"name":"SENDER_OVERRIDE","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":297,"src":"4032:15:1","typeDescriptions":{"typeIdentifier":"t_address","typeString":"address"}},{"id":453,"name":"AMOUNT_OVERRIDE","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":291,"src":"4140:15:1","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"}},{"expression":{"id":454,"name":"req","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":428,"src":"4245:3:1","typeDescriptions":{"typeIdentifier":"t_struct$_Request_$25_memory_ptr","typeString":"struct Chainlink.Request memory"}},"id":455,"isConstant":false,"isLValue":true,"isPure":false,"lValueRequested":false,"memberName":"id","nodeType":"MemberAccess","referencedDeclaration":15,"src":"4245:6:1","typeDescriptions":{"typeIdentifier":"t_bytes32","typeString":"bytes32"}},{"arguments":[{"id":458,"name":"this","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":-28,"src":"4267:4:1","typeDescriptions":{"typeIdentifier":"t_contract$_ChainlinkClient_$861","typeString":"contract ChainlinkClient"}}],"expression":{"argumentTypes":[{"typeIdentifier":"t_contract$_ChainlinkClient_$861","typeString":"contract ChainlinkClient"}],"id":457,"isConstant":false,"isLValue":false,"isPure":true,"lValueRequested":false,"nodeType":"ElementaryTypeNameExpression","src":"4259:7:1","typeDescriptions":{"typeIdentifier":"t_type$_t_address_$","typeString":"type(address)"},"typeName":{"id":456,"name":"address","nodeType":"ElementaryTypeName","src":"4259:7:1","typeDescriptions":{}}},"id":459,"isConstant":false,"isLValue":false,"isPure":false,"kind":"typeConversion","lValueRequested":false,"names":[],"nodeType":"FunctionCall","src":"4259:13:1","tryCall":false,"typeDescriptions":{"typeIdentifier":"t_address","typeString":"address"}},{"expression":{"id":460,"name":"req","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":428,"src":"4280:3:1","typeDescriptions":{"typeIdentifier":"t_struct$_Request_$25_memory_ptr","typeString":"struct Chainlink.Request memory"}},"id":461,"isConstant":false,"isLValue":true,"isPure":false,"lValueRequested":false,"memberName":"callbackFunctionId","nodeType":"MemberAccess","referencedDeclaration":19,"src":"4280:22:1","typeDescriptions":{"typeIdentifier":"t_bytes4","typeString":"bytes4"}},{"id":462,"name":"nonce","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":436,"src":"4310:5:1","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"}},{"id":463,"name":"ORACLE_ARGS_VERSION","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":300,"src":"4323:19:1","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"}},{"expression":{"expression":{"id":464,"name":"req","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":428,"src":"4350:3:1","typeDescriptions":{"typeIdentifier":"t_struct$_Request_$25_memory_ptr","typeString":"struct Chainlink.Request memory"}},"id":465,"isConstant":false,"isLValue":true,"isPure":false,"lValueRequested":false,"memberName":"buf","nodeType":"MemberAccess","referencedDeclaration":24,"src":"4350:7:1","typeDescriptions":{"typeIdentifier":"t_struct$_buffer_$1204_memory_ptr","typeString":"struct BufferChainlink.buffer memory"}},"id":466,"isConstant":false,"isLValue":true,"isPure":false,"lValueRequested":false,"memberName":"buf","nodeType":"MemberAccess","referencedDeclaration":1201,"src":"4350:11:1","typeDescriptions":{"typeIdentifier":"t_bytes_memory_ptr","typeString":"bytes memory"}}],"expression":{"argumentTypes":[{"typeIdentifier":"t_bytes4","typeString":"bytes4"},{"typeIdentifier":"t_address","typeString":"address"},{"typeIdentifier":"t_uint256","typeString":"uint256"},{"typeIdentifier":"t_bytes32","typeString":"bytes32"},{"typeIdentifier":"t_address","typeString":"address"},{"typeIdentifier":"t_bytes4","typeString":"bytes4"},{"typeIdentifier":"t_uint256","typeString":"uint256"},{"typeIdentifier":"t_uint256","typeString":"uint256"},{"typeIdentifier":"t_bytes_memory_ptr","typeString":"bytes memory"}],"expression":{"id":447,"name":"abi","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":-1,"src":"3946:3:1","typeDescriptions":{"typeIdentifier":"t_magic_abi","typeString":"abi"}},"id":448,"isConstant":false,"isLValue":false,"isPure":true,"lValueRequested":false,"memberName":"encodeWithSelector","nodeType":"MemberAccess","src":"3946:22:1","typeDescriptions":{"typeIdentifier":"t_function_abiencodewithselector_pure$_t_bytes4_$returns$_t_bytes_memory_ptr_$","typeString":"function (bytes4) pure returns (bytes memory)"}},"id":467,"isConstant":false,"isLValue":false,"isPure":false,"kind":"functionCall","lValueRequested":false,"names":[],"nodeType":"FunctionCall","src":"3946:421:1","tryCall":false,"typeDescriptions":{"typeIdentifier":"t_bytes_memory_ptr","typeString":"bytes memory"}},"nodeType":"VariableDeclarationStatement","src":"3916:451:1"},{"expression":{"arguments":[{"id":470,"name":"oracleAddress","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":425,"src":"4392:13:1","typeDescriptions":{"typeIdentifier":"t_address","typeString":"address"}},{"id":471,"name":"nonce","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":436,"src":"4407:5:1","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"}},{"id":472,"name":"payment","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":430,"src":"4414:7:1","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"}},{"id":473,"name":"encodedRequest","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":446,"src":"4423:14:1","typeDescriptions":{"typeIdentifier":"t_bytes_memory_ptr","typeString":"bytes memory"}}],"expression":{"argumentTypes":[{"typeIdentifier":"t_address","typeString":"address"},{"typeIdentifier":"t_uint256","typeString":"uint256"},{"typeIdentifier":"t_uint256","typeString":"uint256"},{"typeIdentifier":"t_bytes_memory_ptr","typeString":"bytes memory"}],"id":469,"name":"_rawRequest","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":594,"src":"4380:11:1","typeDescriptions":{"typeIdentifier":"t_function_internal_nonpayable$_t_address_$_t_uint256_$_t_uint256_$_t_bytes_memory_ptr_$returns$_t_bytes32_$","typeString":"function (address,uint256,uint256,bytes memory) returns (bytes32)"}},"id":474,"isConstant":false,"isLValue":false,"isPure":false,"kind":"functionCall","lValueRequested":false,"names":[],"nodeType":"FunctionCall","src":"4380:58:1","tryCall":false,"typeDescriptions":{"typeIdentifier":"t_bytes32","typeString":"bytes32"}},"functionReturnParameters":434,"id":475,"nodeType":"Return","src":"4373:65:1"}]},"documentation":{"id":423,"nodeType":"StructuredDocumentation","src":"3173:511:1","text":" @notice Creates a Chainlink request to the specified oracle address\n @dev Generates and stores a request ID, increments the local nonce, and uses `transferAndCall` to\n send LINK which creates a request on the target oracle contract.\n Emits ChainlinkRequested event.\n @param oracleAddress The address of the oracle for the request\n @param req The initialized Chainlink Request\n @param payment The amount of LINK to send for the request\n @return requestId The request ID"},"id":477,"implemented":true,"kind":"function","modifiers":[],"name":"sendChainlinkRequestTo","nameLocation":"3696:22:1","nodeType":"FunctionDefinition","parameters":{"id":431,"nodeType":"ParameterList","parameters":[{"constant":false,"id":425,"mutability":"mutable","name":"oracleAddress","nameLocation":"3732:13:1","nodeType":"VariableDeclaration","scope":477,"src":"3724:21:1","stateVariable":false,"storageLocation":"default","typeDescriptions":{"typeIdentifier":"t_address","typeString":"address"},"typeName":{"id":424,"name":"address","nodeType":"ElementaryTypeName","src":"3724:7:1","stateMutability":"nonpayable","typeDescriptions":{"typeIdentifier":"t_address","typeString":"address"}},"visibility":"internal"},{"constant":false,"id":428,"mutability":"mutable","name":"req","nameLocation":"3776:3:1","nodeType":"VariableDeclaration","scope":477,"src":"3751:28:1","stateVariable":false,"storageLocation":"memory","typeDescriptions":{"typeIdentifier":"t_struct$_Request_$25_memory_ptr","typeString":"struct Chainlink.Request"},"typeName":{"id":427,"nodeType":"UserDefinedTypeName","pathNode":{"id":426,"name":"Chainlink.Request","nodeType":"IdentifierPath","referencedDeclaration":25,"src":"3751:17:1"},"referencedDeclaration":25,"src":"3751:17:1","typeDescriptions":{"typeIdentifier":"t_struct$_Request_$25_storage_ptr","typeString":"struct Chainlink.Request"}},"visibility":"internal"},{"constant":false,"id":430,"mutability":"mutable","name":"payment","nameLocation":"3793:7:1","nodeType":"VariableDeclaration","scope":477,"src":"3785:15:1","stateVariable":false,"storageLocation":"default","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"},"typeName":{"id":429,"name":"uint256","nodeType":"ElementaryTypeName","src":"3785:7:1","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"}},"visibility":"internal"}],"src":"3718:86:1"},"returnParameters":{"id":434,"nodeType":"ParameterList","parameters":[{"constant":false,"id":433,"mutability":"mutable","name":"requestId","nameLocation":"3831:9:1","nodeType":"VariableDeclaration","scope":477,"src":"3823:17:1","stateVariable":false,"storageLocation":"default","typeDescriptions":{"typeIdentifier":"t_bytes32","typeString":"bytes32"},"typeName":{"id":432,"name":"bytes32","nodeType":"ElementaryTypeName","src":"3823:7:1","typeDescriptions":{"typeIdentifier":"t_bytes32","typeString":"bytes32"}},"visibility":"internal"}],"src":"3822:19:1"},"scope":861,"src":"3687:756:1","stateMutability":"nonpayable","virtual":false,"visibility":"internal"},{"body":{"id":497,"nodeType":"Block","src":"4907:72:1","statements":[{"expression":{"arguments":[{"arguments":[{"id":491,"name":"s_oracle","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":327,"src":"4950:8:1","typeDescriptions":{"typeIdentifier":"t_contract$_OperatorInterface_$1149","typeString":"contract OperatorInterface"}}],"expression":{"argumentTypes":[{"typeIdentifier":"t_contract$_OperatorInterface_$1149","typeString":"contract OperatorInterface"}],"id":490,"isConstant":false,"isLValue":false,"isPure":true,"lValueRequested":false,"nodeType":"ElementaryTypeNameExpression","src":"4942:7:1","typeDescriptions":{"typeIdentifier":"t_type$_t_address_$","typeString":"type(address)"},"typeName":{"id":489,"name":"address","nodeType":"ElementaryTypeName","src":"4942:7:1","typeDescriptions":{}}},"id":492,"isConstant":false,"isLValue":false,"isPure":false,"kind":"typeConversion","lValueRequested":false,"names":[],"nodeType":"FunctionCall","src":"4942:17:1","tryCall":false,"typeDescriptions":{"typeIdentifier":"t_address","typeString":"address"}},{"id":493,"name":"req","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":481,"src":"4961:3:1","typeDescriptions":{"typeIdentifier":"t_struct$_Request_$25_memory_ptr","typeString":"struct Chainlink.Request memory"}},{"id":494,"name":"payment","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":483,"src":"4966:7:1","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"}}],"expression":{"argumentTypes":[{"typeIdentifier":"t_address","typeString":"address"},{"typeIdentifier":"t_struct$_Request_$25_memory_ptr","typeString":"struct Chainlink.Request memory"},{"typeIdentifier":"t_uint256","typeString":"uint256"}],"id":488,"name":"sendOperatorRequestTo","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":549,"src":"4920:21:1","typeDescriptions":{"typeIdentifier":"t_function_internal_nonpayable$_t_address_$_t_struct$_Request_$25_memory_ptr_$_t_uint256_$returns$_t_bytes32_$","typeString":"function (address,struct Chainlink.Request memory,uint256) returns (bytes32)"}},"id":495,"isConstant":false,"isLValue":false,"isPure":false,"kind":"functionCall","lValueRequested":false,"names":[],"nodeType":"FunctionCall","src":"4920:54:1","tryCall":false,"typeDescriptions":{"typeIdentifier":"t_bytes32","typeString":"bytes32"}},"functionReturnParameters":487,"id":496,"nodeType":"Return","src":"4913:61:1"}]},"documentation":{"id":478,"nodeType":"StructuredDocumentation","src":"4447:354:1","text":" @notice Creates a Chainlink request to the stored oracle address\n @dev This function supports multi-word response\n @dev Calls `sendOperatorRequestTo` with the stored oracle address\n @param req The initialized Chainlink Request\n @param payment The amount of LINK to send for the request\n @return requestId The request ID"},"id":498,"implemented":true,"kind":"function","modifiers":[],"name":"sendOperatorRequest","nameLocation":"4813:19:1","nodeType":"FunctionDefinition","parameters":{"id":484,"nodeType":"ParameterList","parameters":[{"constant":false,"id":481,"mutability":"mutable","name":"req","nameLocation":"4858:3:1","nodeType":"VariableDeclaration","scope":498,"src":"4833:28:1","stateVariable":false,"storageLocation":"memory","typeDescriptions":{"typeIdentifier":"t_struct$_Request_$25_memory_ptr","typeString":"struct Chainlink.Request"},"typeName":{"id":480,"nodeType":"UserDefinedTypeName","pathNode":{"id":479,"name":"Chainlink.Request","nodeType":"IdentifierPath","referencedDeclaration":25,"src":"4833:17:1"},"referencedDeclaration":25,"src":"4833:17:1","typeDescriptions":{"typeIdentifier":"t_struct$_Request_$25_storage_ptr","typeString":"struct Chainlink.Request"}},"visibility":"internal"},{"constant":false,"id":483,"mutability":"mutable","name":"payment","nameLocation":"4871:7:1","nodeType":"VariableDeclaration","scope":498,"src":"4863:15:1","stateVariable":false,"storageLocation":"default","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"},"typeName":{"id":482,"name":"uint256","nodeType":"ElementaryTypeName","src":"4863:7:1","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"}},"visibility":"internal"}],"src":"4832:47:1"},"returnParameters":{"id":487,"nodeType":"ParameterList","parameters":[{"constant":false,"id":486,"mutability":"mutable","name":"","nameLocation":"-1:-1:-1","nodeType":"VariableDeclaration","scope":498,"src":"4898:7:1","stateVariable":false,"storageLocation":"default","typeDescriptions":{"typeIdentifier":"t_bytes32","typeString":"bytes32"},"typeName":{"id":485,"name":"bytes32","nodeType":"ElementaryTypeName","src":"4898:7:1","typeDescriptions":{"typeIdentifier":"t_bytes32","typeString":"bytes32"}},"visibility":"internal"}],"src":"4897:9:1"},"scope":861,"src":"4804:175:1","stateMutability":"nonpayable","virtual":false,"visibility":"internal"},{"body":{"id":548,"nodeType":"Block","src":"5704:576:1","statements":[{"assignments":[512],"declarations":[{"constant":false,"id":512,"mutability":"mutable","name":"nonce","nameLocation":"5718:5:1","nodeType":"VariableDeclaration","scope":548,"src":"5710:13:1","stateVariable":false,"storageLocation":"default","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"},"typeName":{"id":511,"name":"uint256","nodeType":"ElementaryTypeName","src":"5710:7:1","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"}},"visibility":"internal"}],"id":514,"initialValue":{"id":513,"name":"s_requestCount","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":330,"src":"5726:14:1","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"}},"nodeType":"VariableDeclarationStatement","src":"5710:30:1"},{"expression":{"id":519,"isConstant":false,"isLValue":false,"isPure":false,"lValueRequested":false,"leftHandSide":{"id":515,"name":"s_requestCount","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":330,"src":"5746:14:1","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"}},"nodeType":"Assignment","operator":"=","rightHandSide":{"commonType":{"typeIdentifier":"t_uint256","typeString":"uint256"},"id":518,"isConstant":false,"isLValue":false,"isPure":false,"lValueRequested":false,"leftExpression":{"id":516,"name":"nonce","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":512,"src":"5763:5:1","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"}},"nodeType":"BinaryOperation","operator":"+","rightExpression":{"hexValue":"31","id":517,"isConstant":false,"isLValue":false,"isPure":true,"kind":"number","lValueRequested":false,"nodeType":"Literal","src":"5771:1:1","typeDescriptions":{"typeIdentifier":"t_rational_1_by_1","typeString":"int_const 1"},"value":"1"},"src":"5763:9:1","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"}},"src":"5746:26:1","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"}},"id":520,"nodeType":"ExpressionStatement","src":"5746:26:1"},{"assignments":[522],"declarations":[{"constant":false,"id":522,"mutability":"mutable","name":"encodedRequest","nameLocation":"5791:14:1","nodeType":"VariableDeclaration","scope":548,"src":"5778:27:1","stateVariable":false,"storageLocation":"memory","typeDescriptions":{"typeIdentifier":"t_bytes_memory_ptr","typeString":"bytes"},"typeName":{"id":521,"name":"bytes","nodeType":"ElementaryTypeName","src":"5778:5:1","typeDescriptions":{"typeIdentifier":"t_bytes_storage_ptr","typeString":"bytes"}},"visibility":"internal"}],"id":540,"initialValue":{"arguments":[{"expression":{"expression":{"id":525,"name":"OperatorInterface","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":1149,"src":"5838:17:1","typeDescriptions":{"typeIdentifier":"t_type$_t_contract$_OperatorInterface_$1149_$","typeString":"type(contract OperatorInterface)"}},"id":526,"isConstant":false,"isLValue":false,"isPure":true,"lValueRequested":false,"memberName":"operatorRequest","nodeType":"MemberAccess","referencedDeclaration":1094,"src":"5838:33:1","typeDescriptions":{"typeIdentifier":"t_function_declaration_nonpayable$_t_address_$_t_uint256_$_t_bytes32_$_t_bytes4_$_t_uint256_$_t_uint256_$_t_bytes_calldata_ptr_$returns$__$","typeString":"function OperatorInterface.operatorRequest(address,uint256,bytes32,bytes4,uint256,uint256,bytes calldata)"}},"id":527,"isConstant":false,"isLValue":false,"isPure":true,"lValueRequested":false,"memberName":"selector","nodeType":"MemberAccess","src":"5838:42:1","typeDescriptions":{"typeIdentifier":"t_bytes4","typeString":"bytes4"}},{"id":528,"name":"SENDER_OVERRIDE","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":297,"src":"5888:15:1","typeDescriptions":{"typeIdentifier":"t_address","typeString":"address"}},{"id":529,"name":"AMOUNT_OVERRIDE","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":291,"src":"5996:15:1","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"}},{"expression":{"id":530,"name":"req","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":504,"src":"6101:3:1","typeDescriptions":{"typeIdentifier":"t_struct$_Request_$25_memory_ptr","typeString":"struct Chainlink.Request memory"}},"id":531,"isConstant":false,"isLValue":true,"isPure":false,"lValueRequested":false,"memberName":"id","nodeType":"MemberAccess","referencedDeclaration":15,"src":"6101:6:1","typeDescriptions":{"typeIdentifier":"t_bytes32","typeString":"bytes32"}},{"expression":{"id":532,"name":"req","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":504,"src":"6115:3:1","typeDescriptions":{"typeIdentifier":"t_struct$_Request_$25_memory_ptr","typeString":"struct Chainlink.Request memory"}},"id":533,"isConstant":false,"isLValue":true,"isPure":false,"lValueRequested":false,"memberName":"callbackFunctionId","nodeType":"MemberAccess","referencedDeclaration":19,"src":"6115:22:1","typeDescriptions":{"typeIdentifier":"t_bytes4","typeString":"bytes4"}},{"id":534,"name":"nonce","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":512,"src":"6145:5:1","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"}},{"id":535,"name":"OPERATOR_ARGS_VERSION","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":303,"src":"6158:21:1","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"}},{"expression":{"expression":{"id":536,"name":"req","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":504,"src":"6187:3:1","typeDescriptions":{"typeIdentifier":"t_struct$_Request_$25_memory_ptr","typeString":"struct Chainlink.Request memory"}},"id":537,"isConstant":false,"isLValue":true,"isPure":false,"lValueRequested":false,"memberName":"buf","nodeType":"MemberAccess","referencedDeclaration":24,"src":"6187:7:1","typeDescriptions":{"typeIdentifier":"t_struct$_buffer_$1204_memory_ptr","typeString":"struct BufferChainlink.buffer memory"}},"id":538,"isConstant":false,"isLValue":true,"isPure":false,"lValueRequested":false,"memberName":"buf","nodeType":"MemberAccess","referencedDeclaration":1201,"src":"6187:11:1","typeDescriptions":{"typeIdentifier":"t_bytes_memory_ptr","typeString":"bytes memory"}}],"expression":{"argumentTypes":[{"typeIdentifier":"t_bytes4","typeString":"bytes4"},{"typeIdentifier":"t_address","typeString":"address"},{"typeIdentifier":"t_uint256","typeString":"uint256"},{"typeIdentifier":"t_bytes32","typeString":"bytes32"},{"typeIdentifier":"t_bytes4","typeString":"bytes4"},{"typeIdentifier":"t_uint256","typeString":"uint256"},{"typeIdentifier":"t_uint256","typeString":"uint256"},{"typeIdentifier":"t_bytes_memory_ptr","typeString":"bytes memory"}],"expression":{"id":523,"name":"abi","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":-1,"src":"5808:3:1","typeDescriptions":{"typeIdentifier":"t_magic_abi","typeString":"abi"}},"id":524,"isConstant":false,"isLValue":false,"isPure":true,"lValueRequested":false,"memberName":"encodeWithSelector","nodeType":"MemberAccess","src":"5808:22:1","typeDescriptions":{"typeIdentifier":"t_function_abiencodewithselector_pure$_t_bytes4_$returns$_t_bytes_memory_ptr_$","typeString":"function (bytes4) pure returns (bytes memory)"}},"id":539,"isConstant":false,"isLValue":false,"isPure":false,"kind":"functionCall","lValueRequested":false,"names":[],"nodeType":"FunctionCall","src":"5808:396:1","tryCall":false,"typeDescriptions":{"typeIdentifier":"t_bytes_memory_ptr","typeString":"bytes memory"}},"nodeType":"VariableDeclarationStatement","src":"5778:426:1"},{"expression":{"arguments":[{"id":542,"name":"oracleAddress","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":501,"src":"6229:13:1","typeDescriptions":{"typeIdentifier":"t_address","typeString":"address"}},{"id":543,"name":"nonce","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":512,"src":"6244:5:1","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"}},{"id":544,"name":"payment","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":506,"src":"6251:7:1","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"}},{"id":545,"name":"encodedRequest","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":522,"src":"6260:14:1","typeDescriptions":{"typeIdentifier":"t_bytes_memory_ptr","typeString":"bytes memory"}}],"expression":{"argumentTypes":[{"typeIdentifier":"t_address","typeString":"address"},{"typeIdentifier":"t_uint256","typeString":"uint256"},{"typeIdentifier":"t_uint256","typeString":"uint256"},{"typeIdentifier":"t_bytes_memory_ptr","typeString":"bytes memory"}],"id":541,"name":"_rawRequest","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":594,"src":"6217:11:1","typeDescriptions":{"typeIdentifier":"t_function_internal_nonpayable$_t_address_$_t_uint256_$_t_uint256_$_t_bytes_memory_ptr_$returns$_t_bytes32_$","typeString":"function (address,uint256,uint256,bytes memory) returns (bytes32)"}},"id":546,"isConstant":false,"isLValue":false,"isPure":false,"kind":"functionCall","lValueRequested":false,"names":[],"nodeType":"FunctionCall","src":"6217:58:1","tryCall":false,"typeDescriptions":{"typeIdentifier":"t_bytes32","typeString":"bytes32"}},"functionReturnParameters":510,"id":547,"nodeType":"Return","src":"6210:65:1"}]},"documentation":{"id":499,"nodeType":"StructuredDocumentation","src":"4983:564:1","text":" @notice Creates a Chainlink request to the specified oracle address\n @dev This function supports multi-word response\n @dev Generates and stores a request ID, increments the local nonce, and uses `transferAndCall` to\n send LINK which creates a request on the target oracle contract.\n Emits ChainlinkRequested event.\n @param oracleAddress The address of the oracle for the request\n @param req The initialized Chainlink Request\n @param payment The amount of LINK to send for the request\n @return requestId The request ID"},"id":549,"implemented":true,"kind":"function","modifiers":[],"name":"sendOperatorRequestTo","nameLocation":"5559:21:1","nodeType":"FunctionDefinition","parameters":{"id":507,"nodeType":"ParameterList","parameters":[{"constant":false,"id":501,"mutability":"mutable","name":"oracleAddress","nameLocation":"5594:13:1","nodeType":"VariableDeclaration","scope":549,"src":"5586:21:1","stateVariable":false,"storageLocation":"default","typeDescriptions":{"typeIdentifier":"t_address","typeString":"address"},"typeName":{"id":500,"name":"address","nodeType":"ElementaryTypeName","src":"5586:7:1","stateMutability":"nonpayable","typeDescriptions":{"typeIdentifier":"t_address","typeString":"address"}},"visibility":"internal"},{"constant":false,"id":504,"mutability":"mutable","name":"req","nameLocation":"5638:3:1","nodeType":"VariableDeclaration","scope":549,"src":"5613:28:1","stateVariable":false,"storageLocation":"memory","typeDescriptions":{"typeIdentifier":"t_struct$_Request_$25_memory_ptr","typeString":"struct Chainlink.Request"},"typeName":{"id":503,"nodeType":"UserDefinedTypeName","pathNode":{"id":502,"name":"Chainlink.Request","nodeType":"IdentifierPath","referencedDeclaration":25,"src":"5613:17:1"},"referencedDeclaration":25,"src":"5613:17:1","typeDescriptions":{"typeIdentifier":"t_struct$_Request_$25_storage_ptr","typeString":"struct Chainlink.Request"}},"visibility":"internal"},{"constant":false,"id":506,"mutability":"mutable","name":"payment","nameLocation":"5655:7:1","nodeType":"VariableDeclaration","scope":549,"src":"5647:15:1","stateVariable":false,"storageLocation":"default","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"},"typeName":{"id":505,"name":"uint256","nodeType":"ElementaryTypeName","src":"5647:7:1","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"}},"visibility":"internal"}],"src":"5580:86:1"},"returnParameters":{"id":510,"nodeType":"ParameterList","parameters":[{"constant":false,"id":509,"mutability":"mutable","name":"requestId","nameLocation":"5693:9:1","nodeType":"VariableDeclaration","scope":549,"src":"5685:17:1","stateVariable":false,"storageLocation":"default","typeDescriptions":{"typeIdentifier":"t_bytes32","typeString":"bytes32"},"typeName":{"id":508,"name":"bytes32","nodeType":"ElementaryTypeName","src":"5685:7:1","typeDescriptions":{"typeIdentifier":"t_bytes32","typeString":"bytes32"}},"visibility":"internal"}],"src":"5684:19:1"},"scope":861,"src":"5550:730:1","stateMutability":"nonpayable","virtual":false,"visibility":"internal"},{"body":{"id":593,"nodeType":"Block","src":"6790:269:1","statements":[{"expression":{"id":571,"isConstant":false,"isLValue":false,"isPure":false,"lValueRequested":false,"leftHandSide":{"id":563,"name":"requestId","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":561,"src":"6796:9:1","typeDescriptions":{"typeIdentifier":"t_bytes32","typeString":"bytes32"}},"nodeType":"Assignment","operator":"=","rightHandSide":{"arguments":[{"arguments":[{"id":567,"name":"this","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":-28,"src":"6835:4:1","typeDescriptions":{"typeIdentifier":"t_contract$_ChainlinkClient_$861","typeString":"contract ChainlinkClient"}},{"id":568,"name":"nonce","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":554,"src":"6841:5:1","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"}}],"expression":{"argumentTypes":[{"typeIdentifier":"t_contract$_ChainlinkClient_$861","typeString":"contract ChainlinkClient"},{"typeIdentifier":"t_uint256","typeString":"uint256"}],"expression":{"id":565,"name":"abi","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":-1,"src":"6818:3:1","typeDescriptions":{"typeIdentifier":"t_magic_abi","typeString":"abi"}},"id":566,"isConstant":false,"isLValue":false,"isPure":true,"lValueRequested":false,"memberName":"encodePacked","nodeType":"MemberAccess","src":"6818:16:1","typeDescriptions":{"typeIdentifier":"t_function_abiencodepacked_pure$__$returns$_t_bytes_memory_ptr_$","typeString":"function () pure returns (bytes memory)"}},"id":569,"isConstant":false,"isLValue":false,"isPure":false,"kind":"functionCall","lValueRequested":false,"names":[],"nodeType":"FunctionCall","src":"6818:29:1","tryCall":false,"typeDescriptions":{"typeIdentifier":"t_bytes_memory_ptr","typeString":"bytes memory"}}],"expression":{"argumentTypes":[{"typeIdentifier":"t_bytes_memory_ptr","typeString":"bytes memory"}],"id":564,"name":"keccak256","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":-8,"src":"6808:9:1","typeDescriptions":{"typeIdentifier":"t_function_keccak256_pure$_t_bytes_memory_ptr_$returns$_t_bytes32_$","typeString":"function (bytes memory) pure returns (bytes32)"}},"id":570,"isConstant":false,"isLValue":false,"isPure":false,"kind":"functionCall","lValueRequested":false,"names":[],"nodeType":"FunctionCall","src":"6808:40:1","tryCall":false,"typeDescriptions":{"typeIdentifier":"t_bytes32","typeString":"bytes32"}},"src":"6796:52:1","typeDescriptions":{"typeIdentifier":"t_bytes32","typeString":"bytes32"}},"id":572,"nodeType":"ExpressionStatement","src":"6796:52:1"},{"expression":{"id":577,"isConstant":false,"isLValue":false,"isPure":false,"lValueRequested":false,"leftHandSide":{"baseExpression":{"id":573,"name":"s_pendingRequests","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":334,"src":"6854:17:1","typeDescriptions":{"typeIdentifier":"t_mapping$_t_bytes32_$_t_address_$","typeString":"mapping(bytes32 => address)"}},"id":575,"indexExpression":{"id":574,"name":"requestId","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":561,"src":"6872:9:1","typeDescriptions":{"typeIdentifier":"t_bytes32","typeString":"bytes32"}},"isConstant":false,"isLValue":true,"isPure":false,"lValueRequested":true,"nodeType":"IndexAccess","src":"6854:28:1","typeDescriptions":{"typeIdentifier":"t_address","typeString":"address"}},"nodeType":"Assignment","operator":"=","rightHandSide":{"id":576,"name":"oracleAddress","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":552,"src":"6885:13:1","typeDescriptions":{"typeIdentifier":"t_address","typeString":"address"}},"src":"6854:44:1","typeDescriptions":{"typeIdentifier":"t_address","typeString":"address"}},"id":578,"nodeType":"ExpressionStatement","src":"6854:44:1"},{"eventCall":{"arguments":[{"id":580,"name":"requestId","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":561,"src":"6928:9:1","typeDescriptions":{"typeIdentifier":"t_bytes32","typeString":"bytes32"}}],"expression":{"argumentTypes":[{"typeIdentifier":"t_bytes32","typeString":"bytes32"}],"id":579,"name":"ChainlinkRequested","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":338,"src":"6909:18:1","typeDescriptions":{"typeIdentifier":"t_function_event_nonpayable$_t_bytes32_$returns$__$","typeString":"function (bytes32)"}},"id":581,"isConstant":false,"isLValue":false,"isPure":false,"kind":"functionCall","lValueRequested":false,"names":[],"nodeType":"FunctionCall","src":"6909:29:1","tryCall":false,"typeDescriptions":{"typeIdentifier":"t_tuple$__$","typeString":"tuple()"}},"id":582,"nodeType":"EmitStatement","src":"6904:34:1"},{"expression":{"arguments":[{"arguments":[{"id":586,"name":"oracleAddress","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":552,"src":"6975:13:1","typeDescriptions":{"typeIdentifier":"t_address","typeString":"address"}},{"id":587,"name":"payment","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":556,"src":"6990:7:1","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"}},{"id":588,"name":"encodedRequest","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":558,"src":"6999:14:1","typeDescriptions":{"typeIdentifier":"t_bytes_memory_ptr","typeString":"bytes memory"}}],"expression":{"argumentTypes":[{"typeIdentifier":"t_address","typeString":"address"},{"typeIdentifier":"t_uint256","typeString":"uint256"},{"typeIdentifier":"t_bytes_memory_ptr","typeString":"bytes memory"}],"expression":{"id":584,"name":"s_link","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":324,"src":"6952:6:1","typeDescriptions":{"typeIdentifier":"t_contract$_LinkTokenInterface_$1069","typeString":"contract LinkTokenInterface"}},"id":585,"isConstant":false,"isLValue":false,"isPure":false,"lValueRequested":false,"memberName":"transferAndCall","nodeType":"MemberAccess","referencedDeclaration":1057,"src":"6952:22:1","typeDescriptions":{"typeIdentifier":"t_function_external_nonpayable$_t_address_$_t_uint256_$_t_bytes_memory_ptr_$returns$_t_bool_$","typeString":"function (address,uint256,bytes memory) external returns (bool)"}},"id":589,"isConstant":false,"isLValue":false,"isPure":false,"kind":"functionCall","lValueRequested":false,"names":[],"nodeType":"FunctionCall","src":"6952:62:1","tryCall":false,"typeDescriptions":{"typeIdentifier":"t_bool","typeString":"bool"}},{"hexValue":"756e61626c6520746f207472616e73666572416e6443616c6c20746f206f7261636c65","id":590,"isConstant":false,"isLValue":false,"isPure":true,"kind":"string","lValueRequested":false,"nodeType":"Literal","src":"7016:37:1","typeDescriptions":{"typeIdentifier":"t_stringliteral_3b3efd608222b424e5ed8427d7f6a272069793e6a1f5930c93db5c7960c3ce96","typeString":"literal_string \"unable to transferAndCall to oracle\""},"value":"unable to transferAndCall to oracle"}],"expression":{"argumentTypes":[{"typeIdentifier":"t_bool","typeString":"bool"},{"typeIdentifier":"t_stringliteral_3b3efd608222b424e5ed8427d7f6a272069793e6a1f5930c93db5c7960c3ce96","typeString":"literal_string \"unable to transferAndCall to oracle\""}],"id":583,"name":"require","nodeType":"Identifier","overloadedDeclarations":[-18,-18],"referencedDeclaration":-18,"src":"6944:7:1","typeDescriptions":{"typeIdentifier":"t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$","typeString":"function (bool,string memory) pure"}},"id":591,"isConstant":false,"isLValue":false,"isPure":false,"kind":"functionCall","lValueRequested":false,"names":[],"nodeType":"FunctionCall","src":"6944:110:1","tryCall":false,"typeDescriptions":{"typeIdentifier":"t_tuple$__$","typeString":"tuple()"}},"id":592,"nodeType":"ExpressionStatement","src":"6944:110:1"}]},"documentation":{"id":550,"nodeType":"StructuredDocumentation","src":"6284:342:1","text":" @notice Make a request to an oracle\n @param oracleAddress The address of the oracle for the request\n @param nonce used to generate the request ID\n @param payment The amount of LINK to send for the request\n @param encodedRequest data encoded for request type specific format\n @return requestId The request ID"},"id":594,"implemented":true,"kind":"function","modifiers":[],"name":"_rawRequest","nameLocation":"6638:11:1","nodeType":"FunctionDefinition","parameters":{"id":559,"nodeType":"ParameterList","parameters":[{"constant":false,"id":552,"mutability":"mutable","name":"oracleAddress","nameLocation":"6663:13:1","nodeType":"VariableDeclaration","scope":594,"src":"6655:21:1","stateVariable":false,"storageLocation":"default","typeDescriptions":{"typeIdentifier":"t_address","typeString":"address"},"typeName":{"id":551,"name":"address","nodeType":"ElementaryTypeName","src":"6655:7:1","stateMutability":"nonpayable","typeDescriptions":{"typeIdentifier":"t_address","typeString":"address"}},"visibility":"internal"},{"constant":false,"id":554,"mutability":"mutable","name":"nonce","nameLocation":"6690:5:1","nodeType":"VariableDeclaration","scope":594,"src":"6682:13:1","stateVariable":false,"storageLocation":"default","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"},"typeName":{"id":553,"name":"uint256","nodeType":"ElementaryTypeName","src":"6682:7:1","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"}},"visibility":"internal"},{"constant":false,"id":556,"mutability":"mutable","name":"payment","nameLocation":"6709:7:1","nodeType":"VariableDeclaration","scope":594,"src":"6701:15:1","stateVariable":false,"storageLocation":"default","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"},"typeName":{"id":555,"name":"uint256","nodeType":"ElementaryTypeName","src":"6701:7:1","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"}},"visibility":"internal"},{"constant":false,"id":558,"mutability":"mutable","name":"encodedRequest","nameLocation":"6735:14:1","nodeType":"VariableDeclaration","scope":594,"src":"6722:27:1","stateVariable":false,"storageLocation":"memory","typeDescriptions":{"typeIdentifier":"t_bytes_memory_ptr","typeString":"bytes"},"typeName":{"id":557,"name":"bytes","nodeType":"ElementaryTypeName","src":"6722:5:1","typeDescriptions":{"typeIdentifier":"t_bytes_storage_ptr","typeString":"bytes"}},"visibility":"internal"}],"src":"6649:104:1"},"returnParameters":{"id":562,"nodeType":"ParameterList","parameters":[{"constant":false,"id":561,"mutability":"mutable","name":"requestId","nameLocation":"6779:9:1","nodeType":"VariableDeclaration","scope":594,"src":"6771:17:1","stateVariable":false,"storageLocation":"default","typeDescriptions":{"typeIdentifier":"t_bytes32","typeString":"bytes32"},"typeName":{"id":560,"name":"bytes32","nodeType":"ElementaryTypeName","src":"6771:7:1","typeDescriptions":{"typeIdentifier":"t_bytes32","typeString":"bytes32"}},"visibility":"internal"}],"src":"6770:19:1"},"scope":861,"src":"6629:430:1","stateMutability":"nonpayable","virtual":false,"visibility":"private"},{"body":{"id":633,"nodeType":"Block","src":"7713:250:1","statements":[{"assignments":[608],"declarations":[{"constant":false,"id":608,"mutability":"mutable","name":"requested","nameLocation":"7737:9:1","nodeType":"VariableDeclaration","scope":633,"src":"7719:27:1","stateVariable":false,"storageLocation":"default","typeDescriptions":{"typeIdentifier":"t_contract$_OperatorInterface_$1149","typeString":"contract OperatorInterface"},"typeName":{"id":607,"nodeType":"UserDefinedTypeName","pathNode":{"id":606,"name":"OperatorInterface","nodeType":"IdentifierPath","referencedDeclaration":1149,"src":"7719:17:1"},"referencedDeclaration":1149,"src":"7719:17:1","typeDescriptions":{"typeIdentifier":"t_contract$_OperatorInterface_$1149","typeString":"contract OperatorInterface"}},"visibility":"internal"}],"id":614,"initialValue":{"arguments":[{"baseExpression":{"id":610,"name":"s_pendingRequests","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":334,"src":"7767:17:1","typeDescriptions":{"typeIdentifier":"t_mapping$_t_bytes32_$_t_address_$","typeString":"mapping(bytes32 => address)"}},"id":612,"indexExpression":{"id":611,"name":"requestId","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":597,"src":"7785:9:1","typeDescriptions":{"typeIdentifier":"t_bytes32","typeString":"bytes32"}},"isConstant":false,"isLValue":true,"isPure":false,"lValueRequested":false,"nodeType":"IndexAccess","src":"7767:28:1","typeDescriptions":{"typeIdentifier":"t_address","typeString":"address"}}],"expression":{"argumentTypes":[{"typeIdentifier":"t_address","typeString":"address"}],"id":609,"name":"OperatorInterface","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":1149,"src":"7749:17:1","typeDescriptions":{"typeIdentifier":"t_type$_t_contract$_OperatorInterface_$1149_$","typeString":"type(contract OperatorInterface)"}},"id":613,"isConstant":false,"isLValue":false,"isPure":false,"kind":"typeConversion","lValueRequested":false,"names":[],"nodeType":"FunctionCall","src":"7749:47:1","tryCall":false,"typeDescriptions":{"typeIdentifier":"t_contract$_OperatorInterface_$1149","typeString":"contract OperatorInterface"}},"nodeType":"VariableDeclarationStatement","src":"7719:77:1"},{"expression":{"id":618,"isConstant":false,"isLValue":false,"isPure":false,"lValueRequested":false,"nodeType":"UnaryOperation","operator":"delete","prefix":true,"src":"7802:35:1","subExpression":{"baseExpression":{"id":615,"name":"s_pendingRequests","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":334,"src":"7809:17:1","typeDescriptions":{"typeIdentifier":"t_mapping$_t_bytes32_$_t_address_$","typeString":"mapping(bytes32 => address)"}},"id":617,"indexExpression":{"id":616,"name":"requestId","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":597,"src":"7827:9:1","typeDescriptions":{"typeIdentifier":"t_bytes32","typeString":"bytes32"}},"isConstant":false,"isLValue":true,"isPure":false,"lValueRequested":true,"nodeType":"IndexAccess","src":"7809:28:1","typeDescriptions":{"typeIdentifier":"t_address","typeString":"address"}},"typeDescriptions":{"typeIdentifier":"t_tuple$__$","typeString":"tuple()"}},"id":619,"nodeType":"ExpressionStatement","src":"7802:35:1"},{"eventCall":{"arguments":[{"id":621,"name":"requestId","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":597,"src":"7867:9:1","typeDescriptions":{"typeIdentifier":"t_bytes32","typeString":"bytes32"}}],"expression":{"argumentTypes":[{"typeIdentifier":"t_bytes32","typeString":"bytes32"}],"id":620,"name":"ChainlinkCancelled","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":346,"src":"7848:18:1","typeDescriptions":{"typeIdentifier":"t_function_event_nonpayable$_t_bytes32_$returns$__$","typeString":"function (bytes32)"}},"id":622,"isConstant":false,"isLValue":false,"isPure":false,"kind":"functionCall","lValueRequested":false,"names":[],"nodeType":"FunctionCall","src":"7848:29:1","tryCall":false,"typeDescriptions":{"typeIdentifier":"t_tuple$__$","typeString":"tuple()"}},"id":623,"nodeType":"EmitStatement","src":"7843:34:1"},{"expression":{"arguments":[{"id":627,"name":"requestId","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":597,"src":"7913:9:1","typeDescriptions":{"typeIdentifier":"t_bytes32","typeString":"bytes32"}},{"id":628,"name":"payment","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":599,"src":"7924:7:1","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"}},{"id":629,"name":"callbackFunc","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":601,"src":"7933:12:1","typeDescriptions":{"typeIdentifier":"t_bytes4","typeString":"bytes4"}},{"id":630,"name":"expiration","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":603,"src":"7947:10:1","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"}}],"expression":{"argumentTypes":[{"typeIdentifier":"t_bytes32","typeString":"bytes32"},{"typeIdentifier":"t_uint256","typeString":"uint256"},{"typeIdentifier":"t_bytes4","typeString":"bytes4"},{"typeIdentifier":"t_uint256","typeString":"uint256"}],"expression":{"id":624,"name":"requested","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":608,"src":"7883:9:1","typeDescriptions":{"typeIdentifier":"t_contract$_OperatorInterface_$1149","typeString":"contract OperatorInterface"}},"id":626,"isConstant":false,"isLValue":false,"isPure":false,"lValueRequested":false,"memberName":"cancelOracleRequest","nodeType":"MemberAccess","referencedDeclaration":893,"src":"7883:29:1","typeDescriptions":{"typeIdentifier":"t_function_external_nonpayable$_t_bytes32_$_t_uint256_$_t_bytes4_$_t_uint256_$returns$__$","typeString":"function (bytes32,uint256,bytes4,uint256) external"}},"id":631,"isConstant":false,"isLValue":false,"isPure":false,"kind":"functionCall","lValueRequested":false,"names":[],"nodeType":"FunctionCall","src":"7883:75:1","tryCall":false,"typeDescriptions":{"typeIdentifier":"t_tuple$__$","typeString":"tuple()"}},"id":632,"nodeType":"ExpressionStatement","src":"7883:75:1"}]},"documentation":{"id":595,"nodeType":"StructuredDocumentation","src":"7063:509:1","text":" @notice Allows a request to be cancelled if it has not been fulfilled\n @dev Requires keeping track of the expiration value emitted from the oracle contract.\n Deletes the request from the `pendingRequests` mapping.\n Emits ChainlinkCancelled event.\n @param requestId The request ID\n @param payment The amount of LINK sent for the request\n @param callbackFunc The callback function specified for the request\n @param expiration The time of the expiration for the request"},"id":634,"implemented":true,"kind":"function","modifiers":[],"name":"cancelChainlinkRequest","nameLocation":"7584:22:1","nodeType":"FunctionDefinition","parameters":{"id":604,"nodeType":"ParameterList","parameters":[{"constant":false,"id":597,"mutability":"mutable","name":"requestId","nameLocation":"7620:9:1","nodeType":"VariableDeclaration","scope":634,"src":"7612:17:1","stateVariable":false,"storageLocation":"default","typeDescriptions":{"typeIdentifier":"t_bytes32","typeString":"bytes32"},"typeName":{"id":596,"name":"bytes32","nodeType":"ElementaryTypeName","src":"7612:7:1","typeDescriptions":{"typeIdentifier":"t_bytes32","typeString":"bytes32"}},"visibility":"internal"},{"constant":false,"id":599,"mutability":"mutable","name":"payment","nameLocation":"7643:7:1","nodeType":"VariableDeclaration","scope":634,"src":"7635:15:1","stateVariable":false,"storageLocation":"default","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"},"typeName":{"id":598,"name":"uint256","nodeType":"ElementaryTypeName","src":"7635:7:1","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"}},"visibility":"internal"},{"constant":false,"id":601,"mutability":"mutable","name":"callbackFunc","nameLocation":"7663:12:1","nodeType":"VariableDeclaration","scope":634,"src":"7656:19:1","stateVariable":false,"storageLocation":"default","typeDescriptions":{"typeIdentifier":"t_bytes4","typeString":"bytes4"},"typeName":{"id":600,"name":"bytes4","nodeType":"ElementaryTypeName","src":"7656:6:1","typeDescriptions":{"typeIdentifier":"t_bytes4","typeString":"bytes4"}},"visibility":"internal"},{"constant":false,"id":603,"mutability":"mutable","name":"expiration","nameLocation":"7689:10:1","nodeType":"VariableDeclaration","scope":634,"src":"7681:18:1","stateVariable":false,"storageLocation":"default","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"},"typeName":{"id":602,"name":"uint256","nodeType":"ElementaryTypeName","src":"7681:7:1","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"}},"visibility":"internal"}],"src":"7606:97:1"},"returnParameters":{"id":605,"nodeType":"ParameterList","parameters":[],"src":"7713:0:1"},"scope":861,"src":"7575:388:1","stateMutability":"nonpayable","virtual":false,"visibility":"internal"},{"body":{"id":642,"nodeType":"Block","src":"8238:32:1","statements":[{"expression":{"id":640,"name":"s_requestCount","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":330,"src":"8251:14:1","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"}},"functionReturnParameters":639,"id":641,"nodeType":"Return","src":"8244:21:1"}]},"documentation":{"id":635,"nodeType":"StructuredDocumentation","src":"7967:205:1","text":" @notice the next request count to be used in generating a nonce\n @dev starts at 1 in order to ensure consistent gas cost\n @return returns the next request count to be used in a nonce"},"id":643,"implemented":true,"kind":"function","modifiers":[],"name":"getNextRequestCount","nameLocation":"8184:19:1","nodeType":"FunctionDefinition","parameters":{"id":636,"nodeType":"ParameterList","parameters":[],"src":"8203:2:1"},"returnParameters":{"id":639,"nodeType":"ParameterList","parameters":[{"constant":false,"id":638,"mutability":"mutable","name":"","nameLocation":"-1:-1:-1","nodeType":"VariableDeclaration","scope":643,"src":"8229:7:1","stateVariable":false,"storageLocation":"default","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"},"typeName":{"id":637,"name":"uint256","nodeType":"ElementaryTypeName","src":"8229:7:1","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"}},"visibility":"internal"}],"src":"8228:9:1"},"scope":861,"src":"8175:95:1","stateMutability":"view","virtual":false,"visibility":"internal"},{"body":{"id":655,"nodeType":"Block","src":"8451:54:1","statements":[{"expression":{"id":653,"isConstant":false,"isLValue":false,"isPure":false,"lValueRequested":false,"leftHandSide":{"id":649,"name":"s_oracle","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":327,"src":"8457:8:1","typeDescriptions":{"typeIdentifier":"t_contract$_OperatorInterface_$1149","typeString":"contract OperatorInterface"}},"nodeType":"Assignment","operator":"=","rightHandSide":{"arguments":[{"id":651,"name":"oracleAddress","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":646,"src":"8486:13:1","typeDescriptions":{"typeIdentifier":"t_address","typeString":"address"}}],"expression":{"argumentTypes":[{"typeIdentifier":"t_address","typeString":"address"}],"id":650,"name":"OperatorInterface","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":1149,"src":"8468:17:1","typeDescriptions":{"typeIdentifier":"t_type$_t_contract$_OperatorInterface_$1149_$","typeString":"type(contract OperatorInterface)"}},"id":652,"isConstant":false,"isLValue":false,"isPure":false,"kind":"typeConversion","lValueRequested":false,"names":[],"nodeType":"FunctionCall","src":"8468:32:1","tryCall":false,"typeDescriptions":{"typeIdentifier":"t_contract$_OperatorInterface_$1149","typeString":"contract OperatorInterface"}},"src":"8457:43:1","typeDescriptions":{"typeIdentifier":"t_contract$_OperatorInterface_$1149","typeString":"contract OperatorInterface"}},"id":654,"nodeType":"ExpressionStatement","src":"8457:43:1"}]},"documentation":{"id":644,"nodeType":"StructuredDocumentation","src":"8274:114:1","text":" @notice Sets the stored oracle address\n @param oracleAddress The address of the oracle contract"},"id":656,"implemented":true,"kind":"function","modifiers":[],"name":"setChainlinkOracle","nameLocation":"8400:18:1","nodeType":"FunctionDefinition","parameters":{"id":647,"nodeType":"ParameterList","parameters":[{"constant":false,"id":646,"mutability":"mutable","name":"oracleAddress","nameLocation":"8427:13:1","nodeType":"VariableDeclaration","scope":656,"src":"8419:21:1","stateVariable":false,"storageLocation":"default","typeDescriptions":{"typeIdentifier":"t_address","typeString":"address"},"typeName":{"id":645,"name":"address","nodeType":"ElementaryTypeName","src":"8419:7:1","stateMutability":"nonpayable","typeDescriptions":{"typeIdentifier":"t_address","typeString":"address"}},"visibility":"internal"}],"src":"8418:23:1"},"returnParameters":{"id":648,"nodeType":"ParameterList","parameters":[],"src":"8451:0:1"},"scope":861,"src":"8391:114:1","stateMutability":"nonpayable","virtual":false,"visibility":"internal"},{"body":{"id":668,"nodeType":"Block","src":"8682:51:1","statements":[{"expression":{"id":666,"isConstant":false,"isLValue":false,"isPure":false,"lValueRequested":false,"leftHandSide":{"id":662,"name":"s_link","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":324,"src":"8688:6:1","typeDescriptions":{"typeIdentifier":"t_contract$_LinkTokenInterface_$1069","typeString":"contract LinkTokenInterface"}},"nodeType":"Assignment","operator":"=","rightHandSide":{"arguments":[{"id":664,"name":"linkAddress","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":659,"src":"8716:11:1","typeDescriptions":{"typeIdentifier":"t_address","typeString":"address"}}],"expression":{"argumentTypes":[{"typeIdentifier":"t_address","typeString":"address"}],"id":663,"name":"LinkTokenInterface","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":1069,"src":"8697:18:1","typeDescriptions":{"typeIdentifier":"t_type$_t_contract$_LinkTokenInterface_$1069_$","typeString":"type(contract LinkTokenInterface)"}},"id":665,"isConstant":false,"isLValue":false,"isPure":false,"kind":"typeConversion","lValueRequested":false,"names":[],"nodeType":"FunctionCall","src":"8697:31:1","tryCall":false,"typeDescriptions":{"typeIdentifier":"t_contract$_LinkTokenInterface_$1069","typeString":"contract LinkTokenInterface"}},"src":"8688:40:1","typeDescriptions":{"typeIdentifier":"t_contract$_LinkTokenInterface_$1069","typeString":"contract LinkTokenInterface"}},"id":667,"nodeType":"ExpressionStatement","src":"8688:40:1"}]},"documentation":{"id":657,"nodeType":"StructuredDocumentation","src":"8509:113:1","text":" @notice Sets the LINK token address\n @param linkAddress The address of the LINK token contract"},"id":669,"implemented":true,"kind":"function","modifiers":[],"name":"setChainlinkToken","nameLocation":"8634:17:1","nodeType":"FunctionDefinition","parameters":{"id":660,"nodeType":"ParameterList","parameters":[{"constant":false,"id":659,"mutability":"mutable","name":"linkAddress","nameLocation":"8660:11:1","nodeType":"VariableDeclaration","scope":669,"src":"8652:19:1","stateVariable":false,"storageLocation":"default","typeDescriptions":{"typeIdentifier":"t_address","typeString":"address"},"typeName":{"id":658,"name":"address","nodeType":"ElementaryTypeName","src":"8652:7:1","stateMutability":"nonpayable","typeDescriptions":{"typeIdentifier":"t_address","typeString":"address"}},"visibility":"internal"}],"src":"8651:21:1"},"returnParameters":{"id":661,"nodeType":"ParameterList","parameters":[],"src":"8682:0:1"},"scope":861,"src":"8625:108:1","stateMutability":"nonpayable","virtual":false,"visibility":"internal"},{"body":{"id":681,"nodeType":"Block","src":"8900:79:1","statements":[{"expression":{"arguments":[{"arguments":[],"expression":{"argumentTypes":[],"expression":{"arguments":[{"id":675,"name":"LINK_TOKEN_POINTER","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":316,"src":"8941:18:1","typeDescriptions":{"typeIdentifier":"t_address","typeString":"address"}}],"expression":{"argumentTypes":[{"typeIdentifier":"t_address","typeString":"address"}],"id":674,"name":"PointerInterface","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":1196,"src":"8924:16:1","typeDescriptions":{"typeIdentifier":"t_type$_t_contract$_PointerInterface_$1196_$","typeString":"type(contract PointerInterface)"}},"id":676,"isConstant":false,"isLValue":false,"isPure":true,"kind":"typeConversion","lValueRequested":false,"names":[],"nodeType":"FunctionCall","src":"8924:36:1","tryCall":false,"typeDescriptions":{"typeIdentifier":"t_contract$_PointerInterface_$1196","typeString":"contract PointerInterface"}},"id":677,"isConstant":false,"isLValue":false,"isPure":false,"lValueRequested":false,"memberName":"getAddress","nodeType":"MemberAccess","referencedDeclaration":1195,"src":"8924:47:1","typeDescriptions":{"typeIdentifier":"t_function_external_view$__$returns$_t_address_$","typeString":"function () view external returns (address)"}},"id":678,"isConstant":false,"isLValue":false,"isPure":false,"kind":"functionCall","lValueRequested":false,"names":[],"nodeType":"FunctionCall","src":"8924:49:1","tryCall":false,"typeDescriptions":{"typeIdentifier":"t_address","typeString":"address"}}],"expression":{"argumentTypes":[{"typeIdentifier":"t_address","typeString":"address"}],"id":673,"name":"setChainlinkToken","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":669,"src":"8906:17:1","typeDescriptions":{"typeIdentifier":"t_function_internal_nonpayable$_t_address_$returns$__$","typeString":"function (address)"}},"id":679,"isConstant":false,"isLValue":false,"isPure":false,"kind":"functionCall","lValueRequested":false,"names":[],"nodeType":"FunctionCall","src":"8906:68:1","tryCall":false,"typeDescriptions":{"typeIdentifier":"t_tuple$__$","typeString":"tuple()"}},"id":680,"nodeType":"ExpressionStatement","src":"8906:68:1"}]},"documentation":{"id":670,"nodeType":"StructuredDocumentation","src":"8737:116:1","text":" @notice Sets the Chainlink token address for the public\n network as given by the Pointer contract"},"id":682,"implemented":true,"kind":"function","modifiers":[],"name":"setPublicChainlinkToken","nameLocation":"8865:23:1","nodeType":"FunctionDefinition","parameters":{"id":671,"nodeType":"ParameterList","parameters":[],"src":"8888:2:1"},"returnParameters":{"id":672,"nodeType":"ParameterList","parameters":[],"src":"8900:0:1"},"scope":861,"src":"8856:123:1","stateMutability":"nonpayable","virtual":false,"visibility":"internal"},{"body":{"id":693,"nodeType":"Block","src":"9163:33:1","statements":[{"expression":{"arguments":[{"id":690,"name":"s_link","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":324,"src":"9184:6:1","typeDescriptions":{"typeIdentifier":"t_contract$_LinkTokenInterface_$1069","typeString":"contract LinkTokenInterface"}}],"expression":{"argumentTypes":[{"typeIdentifier":"t_contract$_LinkTokenInterface_$1069","typeString":"contract LinkTokenInterface"}],"id":689,"isConstant":false,"isLValue":false,"isPure":true,"lValueRequested":false,"nodeType":"ElementaryTypeNameExpression","src":"9176:7:1","typeDescriptions":{"typeIdentifier":"t_type$_t_address_$","typeString":"type(address)"},"typeName":{"id":688,"name":"address","nodeType":"ElementaryTypeName","src":"9176:7:1","typeDescriptions":{}}},"id":691,"isConstant":false,"isLValue":false,"isPure":false,"kind":"typeConversion","lValueRequested":false,"names":[],"nodeType":"FunctionCall","src":"9176:15:1","tryCall":false,"typeDescriptions":{"typeIdentifier":"t_address","typeString":"address"}},"functionReturnParameters":687,"id":692,"nodeType":"Return","src":"9169:22:1"}]},"documentation":{"id":683,"nodeType":"StructuredDocumentation","src":"8983:112:1","text":" @notice Retrieves the stored address of the LINK token\n @return The address of the LINK token"},"id":694,"implemented":true,"kind":"function","modifiers":[],"name":"chainlinkTokenAddress","nameLocation":"9107:21:1","nodeType":"FunctionDefinition","parameters":{"id":684,"nodeType":"ParameterList","parameters":[],"src":"9128:2:1"},"returnParameters":{"id":687,"nodeType":"ParameterList","parameters":[{"constant":false,"id":686,"mutability":"mutable","name":"","nameLocation":"-1:-1:-1","nodeType":"VariableDeclaration","scope":694,"src":"9154:7:1","stateVariable":false,"storageLocation":"default","typeDescriptions":{"typeIdentifier":"t_address","typeString":"address"},"typeName":{"id":685,"name":"address","nodeType":"ElementaryTypeName","src":"9154:7:1","stateMutability":"nonpayable","typeDescriptions":{"typeIdentifier":"t_address","typeString":"address"}},"visibility":"internal"}],"src":"9153:9:1"},"scope":861,"src":"9098:98:1","stateMutability":"view","virtual":false,"visibility":"internal"},{"body":{"id":705,"nodeType":"Block","src":"9391:35:1","statements":[{"expression":{"arguments":[{"id":702,"name":"s_oracle","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":327,"src":"9412:8:1","typeDescriptions":{"typeIdentifier":"t_contract$_OperatorInterface_$1149","typeString":"contract OperatorInterface"}}],"expression":{"argumentTypes":[{"typeIdentifier":"t_contract$_OperatorInterface_$1149","typeString":"contract OperatorInterface"}],"id":701,"isConstant":false,"isLValue":false,"isPure":true,"lValueRequested":false,"nodeType":"ElementaryTypeNameExpression","src":"9404:7:1","typeDescriptions":{"typeIdentifier":"t_type$_t_address_$","typeString":"type(address)"},"typeName":{"id":700,"name":"address","nodeType":"ElementaryTypeName","src":"9404:7:1","typeDescriptions":{}}},"id":703,"isConstant":false,"isLValue":false,"isPure":false,"kind":"typeConversion","lValueRequested":false,"names":[],"nodeType":"FunctionCall","src":"9404:17:1","tryCall":false,"typeDescriptions":{"typeIdentifier":"t_address","typeString":"address"}},"functionReturnParameters":699,"id":704,"nodeType":"Return","src":"9397:24:1"}]},"documentation":{"id":695,"nodeType":"StructuredDocumentation","src":"9200:122:1","text":" @notice Retrieves the stored address of the oracle contract\n @return The address of the oracle contract"},"id":706,"implemented":true,"kind":"function","modifiers":[],"name":"chainlinkOracleAddress","nameLocation":"9334:22:1","nodeType":"FunctionDefinition","parameters":{"id":696,"nodeType":"ParameterList","parameters":[],"src":"9356:2:1"},"returnParameters":{"id":699,"nodeType":"ParameterList","parameters":[{"constant":false,"id":698,"mutability":"mutable","name":"","nameLocation":"-1:-1:-1","nodeType":"VariableDeclaration","scope":706,"src":"9382:7:1","stateVariable":false,"storageLocation":"default","typeDescriptions":{"typeIdentifier":"t_address","typeString":"address"},"typeName":{"id":697,"name":"address","nodeType":"ElementaryTypeName","src":"9382:7:1","stateMutability":"nonpayable","typeDescriptions":{"typeIdentifier":"t_address","typeString":"address"}},"visibility":"internal"}],"src":"9381:9:1"},"scope":861,"src":"9325:101:1","stateMutability":"view","virtual":false,"visibility":"internal"},{"body":{"id":723,"nodeType":"Block","src":"9819:55:1","statements":[{"expression":{"id":721,"isConstant":false,"isLValue":false,"isPure":false,"lValueRequested":false,"leftHandSide":{"baseExpression":{"id":717,"name":"s_pendingRequests","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":334,"src":"9825:17:1","typeDescriptions":{"typeIdentifier":"t_mapping$_t_bytes32_$_t_address_$","typeString":"mapping(bytes32 => address)"}},"id":719,"indexExpression":{"id":718,"name":"requestId","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":711,"src":"9843:9:1","typeDescriptions":{"typeIdentifier":"t_bytes32","typeString":"bytes32"}},"isConstant":false,"isLValue":true,"isPure":false,"lValueRequested":true,"nodeType":"IndexAccess","src":"9825:28:1","typeDescriptions":{"typeIdentifier":"t_address","typeString":"address"}},"nodeType":"Assignment","operator":"=","rightHandSide":{"id":720,"name":"oracleAddress","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":709,"src":"9856:13:1","typeDescriptions":{"typeIdentifier":"t_address","typeString":"address"}},"src":"9825:44:1","typeDescriptions":{"typeIdentifier":"t_address","typeString":"address"}},"id":722,"nodeType":"ExpressionStatement","src":"9825:44:1"}]},"documentation":{"id":707,"nodeType":"StructuredDocumentation","src":"9430:269:1","text":" @notice Allows for a request which was created on another contract to be fulfilled\n on this contract\n @param oracleAddress The address of the oracle contract that will fulfill the request\n @param requestId The request ID used for the response"},"id":724,"implemented":true,"kind":"function","modifiers":[{"arguments":[{"id":714,"name":"requestId","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":711,"src":"9808:9:1","typeDescriptions":{"typeIdentifier":"t_bytes32","typeString":"bytes32"}}],"id":715,"kind":"modifierInvocation","modifierName":{"id":713,"name":"notPendingRequest","nodeType":"IdentifierPath","referencedDeclaration":860,"src":"9790:17:1"},"nodeType":"ModifierInvocation","src":"9790:28:1"}],"name":"addChainlinkExternalRequest","nameLocation":"9711:27:1","nodeType":"FunctionDefinition","parameters":{"id":712,"nodeType":"ParameterList","parameters":[{"constant":false,"id":709,"mutability":"mutable","name":"oracleAddress","nameLocation":"9747:13:1","nodeType":"VariableDeclaration","scope":724,"src":"9739:21:1","stateVariable":false,"storageLocation":"default","typeDescriptions":{"typeIdentifier":"t_address","typeString":"address"},"typeName":{"id":708,"name":"address","nodeType":"ElementaryTypeName","src":"9739:7:1","stateMutability":"nonpayable","typeDescriptions":{"typeIdentifier":"t_address","typeString":"address"}},"visibility":"internal"},{"constant":false,"id":711,"mutability":"mutable","name":"requestId","nameLocation":"9770:9:1","nodeType":"VariableDeclaration","scope":724,"src":"9762:17:1","stateVariable":false,"storageLocation":"default","typeDescriptions":{"typeIdentifier":"t_bytes32","typeString":"bytes32"},"typeName":{"id":710,"name":"bytes32","nodeType":"ElementaryTypeName","src":"9762:7:1","typeDescriptions":{"typeIdentifier":"t_bytes32","typeString":"bytes32"}},"visibility":"internal"}],"src":"9738:42:1"},"returnParameters":{"id":716,"nodeType":"ParameterList","parameters":[],"src":"9819:0:1"},"scope":861,"src":"9702:172:1","stateMutability":"nonpayable","virtual":false,"visibility":"internal"},{"body":{"id":772,"nodeType":"Block","src":"10207:326:1","statements":[{"expression":{"id":736,"isConstant":false,"isLValue":false,"isPure":false,"lValueRequested":false,"leftHandSide":{"id":732,"name":"s_ens","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":319,"src":"10213:5:1","typeDescriptions":{"typeIdentifier":"t_contract$_ENSInterface_$974","typeString":"contract ENSInterface"}},"nodeType":"Assignment","operator":"=","rightHandSide":{"arguments":[{"id":734,"name":"ensAddress","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":727,"src":"10234:10:1","typeDescriptions":{"typeIdentifier":"t_address","typeString":"address"}}],"expression":{"argumentTypes":[{"typeIdentifier":"t_address","typeString":"address"}],"id":733,"name":"ENSInterface","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":974,"src":"10221:12:1","typeDescriptions":{"typeIdentifier":"t_type$_t_contract$_ENSInterface_$974_$","typeString":"type(contract ENSInterface)"}},"id":735,"isConstant":false,"isLValue":false,"isPure":false,"kind":"typeConversion","lValueRequested":false,"names":[],"nodeType":"FunctionCall","src":"10221:24:1","tryCall":false,"typeDescriptions":{"typeIdentifier":"t_contract$_ENSInterface_$974","typeString":"contract ENSInterface"}},"src":"10213:32:1","typeDescriptions":{"typeIdentifier":"t_contract$_ENSInterface_$974","typeString":"contract ENSInterface"}},"id":737,"nodeType":"ExpressionStatement","src":"10213:32:1"},{"expression":{"id":740,"isConstant":false,"isLValue":false,"isPure":false,"lValueRequested":false,"leftHandSide":{"id":738,"name":"s_ensNode","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":321,"src":"10251:9:1","typeDescriptions":{"typeIdentifier":"t_bytes32","typeString":"bytes32"}},"nodeType":"Assignment","operator":"=","rightHandSide":{"id":739,"name":"node","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":729,"src":"10263:4:1","typeDescriptions":{"typeIdentifier":"t_bytes32","typeString":"bytes32"}},"src":"10251:16:1","typeDescriptions":{"typeIdentifier":"t_bytes32","typeString":"bytes32"}},"id":741,"nodeType":"ExpressionStatement","src":"10251:16:1"},{"assignments":[743],"declarations":[{"constant":false,"id":743,"mutability":"mutable","name":"linkSubnode","nameLocation":"10281:11:1","nodeType":"VariableDeclaration","scope":772,"src":"10273:19:1","stateVariable":false,"storageLocation":"default","typeDescriptions":{"typeIdentifier":"t_bytes32","typeString":"bytes32"},"typeName":{"id":742,"name":"bytes32","nodeType":"ElementaryTypeName","src":"10273:7:1","typeDescriptions":{"typeIdentifier":"t_bytes32","typeString":"bytes32"}},"visibility":"internal"}],"id":751,"initialValue":{"arguments":[{"arguments":[{"id":747,"name":"s_ensNode","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":321,"src":"10322:9:1","typeDescriptions":{"typeIdentifier":"t_bytes32","typeString":"bytes32"}},{"id":748,"name":"ENS_TOKEN_SUBNAME","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":308,"src":"10333:17:1","typeDescriptions":{"typeIdentifier":"t_bytes32","typeString":"bytes32"}}],"expression":{"argumentTypes":[{"typeIdentifier":"t_bytes32","typeString":"bytes32"},{"typeIdentifier":"t_bytes32","typeString":"bytes32"}],"expression":{"id":745,"name":"abi","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":-1,"src":"10305:3:1","typeDescriptions":{"typeIdentifier":"t_magic_abi","typeString":"abi"}},"id":746,"isConstant":false,"isLValue":false,"isPure":true,"lValueRequested":false,"memberName":"encodePacked","nodeType":"MemberAccess","src":"10305:16:1","typeDescriptions":{"typeIdentifier":"t_function_abiencodepacked_pure$__$returns$_t_bytes_memory_ptr_$","typeString":"function () pure returns (bytes memory)"}},"id":749,"isConstant":false,"isLValue":false,"isPure":false,"kind":"functionCall","lValueRequested":false,"names":[],"nodeType":"FunctionCall","src":"10305:46:1","tryCall":false,"typeDescriptions":{"typeIdentifier":"t_bytes_memory_ptr","typeString":"bytes memory"}}],"expression":{"argumentTypes":[{"typeIdentifier":"t_bytes_memory_ptr","typeString":"bytes memory"}],"id":744,"name":"keccak256","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":-8,"src":"10295:9:1","typeDescriptions":{"typeIdentifier":"t_function_keccak256_pure$_t_bytes_memory_ptr_$returns$_t_bytes32_$","typeString":"function (bytes memory) pure returns (bytes32)"}},"id":750,"isConstant":false,"isLValue":false,"isPure":false,"kind":"functionCall","lValueRequested":false,"names":[],"nodeType":"FunctionCall","src":"10295:57:1","tryCall":false,"typeDescriptions":{"typeIdentifier":"t_bytes32","typeString":"bytes32"}},"nodeType":"VariableDeclarationStatement","src":"10273:79:1"},{"assignments":[754],"declarations":[{"constant":false,"id":754,"mutability":"mutable","name":"resolver","nameLocation":"10380:8:1","nodeType":"VariableDeclaration","scope":772,"src":"10358:30:1","stateVariable":false,"storageLocation":"default","typeDescriptions":{"typeIdentifier":"t_contract$_ENSResolver_$2175","typeString":"contract ENSResolver"},"typeName":{"id":753,"nodeType":"UserDefinedTypeName","pathNode":{"id":752,"name":"ENSResolver_Chainlink","nodeType":"IdentifierPath","referencedDeclaration":2175,"src":"10358:21:1"},"referencedDeclaration":2175,"src":"10358:21:1","typeDescriptions":{"typeIdentifier":"t_contract$_ENSResolver_$2175","typeString":"contract ENSResolver"}},"visibility":"internal"}],"id":761,"initialValue":{"arguments":[{"arguments":[{"id":758,"name":"linkSubnode","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":743,"src":"10428:11:1","typeDescriptions":{"typeIdentifier":"t_bytes32","typeString":"bytes32"}}],"expression":{"argumentTypes":[{"typeIdentifier":"t_bytes32","typeString":"bytes32"}],"expression":{"id":756,"name":"s_ens","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":319,"src":"10413:5:1","typeDescriptions":{"typeIdentifier":"t_contract$_ENSInterface_$974","typeString":"contract ENSInterface"}},"id":757,"isConstant":false,"isLValue":false,"isPure":false,"lValueRequested":false,"memberName":"resolver","nodeType":"MemberAccess","referencedDeclaration":966,"src":"10413:14:1","typeDescriptions":{"typeIdentifier":"t_function_external_view$_t_bytes32_$returns$_t_address_$","typeString":"function (bytes32) view external returns (address)"}},"id":759,"isConstant":false,"isLValue":false,"isPure":false,"kind":"functionCall","lValueRequested":false,"names":[],"nodeType":"FunctionCall","src":"10413:27:1","tryCall":false,"typeDescriptions":{"typeIdentifier":"t_address","typeString":"address"}}],"expression":{"argumentTypes":[{"typeIdentifier":"t_address","typeString":"address"}],"id":755,"name":"ENSResolver_Chainlink","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":2175,"src":"10391:21:1","typeDescriptions":{"typeIdentifier":"t_type$_t_contract$_ENSResolver_$2175_$","typeString":"type(contract ENSResolver)"}},"id":760,"isConstant":false,"isLValue":false,"isPure":false,"kind":"typeConversion","lValueRequested":false,"names":[],"nodeType":"FunctionCall","src":"10391:50:1","tryCall":false,"typeDescriptions":{"typeIdentifier":"t_contract$_ENSResolver_$2175","typeString":"contract ENSResolver"}},"nodeType":"VariableDeclarationStatement","src":"10358:83:1"},{"expression":{"arguments":[{"arguments":[{"id":765,"name":"linkSubnode","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":743,"src":"10479:11:1","typeDescriptions":{"typeIdentifier":"t_bytes32","typeString":"bytes32"}}],"expression":{"argumentTypes":[{"typeIdentifier":"t_bytes32","typeString":"bytes32"}],"expression":{"id":763,"name":"resolver","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":754,"src":"10465:8:1","typeDescriptions":{"typeIdentifier":"t_contract$_ENSResolver_$2175","typeString":"contract ENSResolver"}},"id":764,"isConstant":false,"isLValue":false,"isPure":false,"lValueRequested":false,"memberName":"addr","nodeType":"MemberAccess","referencedDeclaration":2174,"src":"10465:13:1","typeDescriptions":{"typeIdentifier":"t_function_external_view$_t_bytes32_$returns$_t_address_$","typeString":"function (bytes32) view external returns (address)"}},"id":766,"isConstant":false,"isLValue":false,"isPure":false,"kind":"functionCall","lValueRequested":false,"names":[],"nodeType":"FunctionCall","src":"10465:26:1","tryCall":false,"typeDescriptions":{"typeIdentifier":"t_address","typeString":"address"}}],"expression":{"argumentTypes":[{"typeIdentifier":"t_address","typeString":"address"}],"id":762,"name":"setChainlinkToken","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":669,"src":"10447:17:1","typeDescriptions":{"typeIdentifier":"t_function_internal_nonpayable$_t_address_$returns$__$","typeString":"function (address)"}},"id":767,"isConstant":false,"isLValue":false,"isPure":false,"kind":"functionCall","lValueRequested":false,"names":[],"nodeType":"FunctionCall","src":"10447:45:1","tryCall":false,"typeDescriptions":{"typeIdentifier":"t_tuple$__$","typeString":"tuple()"}},"id":768,"nodeType":"ExpressionStatement","src":"10447:45:1"},{"expression":{"arguments":[],"expression":{"argumentTypes":[],"id":769,"name":"updateChainlinkOracleWithENS","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":805,"src":"10498:28:1","typeDescriptions":{"typeIdentifier":"t_function_internal_nonpayable$__$returns$__$","typeString":"function ()"}},"id":770,"isConstant":false,"isLValue":false,"isPure":false,"kind":"functionCall","lValueRequested":false,"names":[],"nodeType":"FunctionCall","src":"10498:30:1","tryCall":false,"typeDescriptions":{"typeIdentifier":"t_tuple$__$","typeString":"tuple()"}},"id":771,"nodeType":"ExpressionStatement","src":"10498:30:1"}]},"documentation":{"id":725,"nodeType":"StructuredDocumentation","src":"9878:254:1","text":" @notice Sets the stored oracle and LINK token contracts with the addresses resolved by ENS\n @dev Accounts for subnodes having different resolvers\n @param ensAddress The address of the ENS contract\n @param node The ENS node hash"},"id":773,"implemented":true,"kind":"function","modifiers":[],"name":"useChainlinkWithENS","nameLocation":"10144:19:1","nodeType":"FunctionDefinition","parameters":{"id":730,"nodeType":"ParameterList","parameters":[{"constant":false,"id":727,"mutability":"mutable","name":"ensAddress","nameLocation":"10172:10:1","nodeType":"VariableDeclaration","scope":773,"src":"10164:18:1","stateVariable":false,"storageLocation":"default","typeDescriptions":{"typeIdentifier":"t_address","typeString":"address"},"typeName":{"id":726,"name":"address","nodeType":"ElementaryTypeName","src":"10164:7:1","stateMutability":"nonpayable","typeDescriptions":{"typeIdentifier":"t_address","typeString":"address"}},"visibility":"internal"},{"constant":false,"id":729,"mutability":"mutable","name":"node","nameLocation":"10192:4:1","nodeType":"VariableDeclaration","scope":773,"src":"10184:12:1","stateVariable":false,"storageLocation":"default","typeDescriptions":{"typeIdentifier":"t_bytes32","typeString":"bytes32"},"typeName":{"id":728,"name":"bytes32","nodeType":"ElementaryTypeName","src":"10184:7:1","typeDescriptions":{"typeIdentifier":"t_bytes32","typeString":"bytes32"}},"visibility":"internal"}],"src":"10163:34:1"},"returnParameters":{"id":731,"nodeType":"ParameterList","parameters":[],"src":"10207:0:1"},"scope":861,"src":"10135:398:1","stateMutability":"nonpayable","virtual":false,"visibility":"internal"},{"body":{"id":804,"nodeType":"Block","src":"10776:238:1","statements":[{"assignments":[778],"declarations":[{"constant":false,"id":778,"mutability":"mutable","name":"oracleSubnode","nameLocation":"10790:13:1","nodeType":"VariableDeclaration","scope":804,"src":"10782:21:1","stateVariable":false,"storageLocation":"default","typeDescriptions":{"typeIdentifier":"t_bytes32","typeString":"bytes32"},"typeName":{"id":777,"name":"bytes32","nodeType":"ElementaryTypeName","src":"10782:7:1","typeDescriptions":{"typeIdentifier":"t_bytes32","typeString":"bytes32"}},"visibility":"internal"}],"id":786,"initialValue":{"arguments":[{"arguments":[{"id":782,"name":"s_ensNode","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":321,"src":"10833:9:1","typeDescriptions":{"typeIdentifier":"t_bytes32","typeString":"bytes32"}},{"id":783,"name":"ENS_ORACLE_SUBNAME","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":313,"src":"10844:18:1","typeDescriptions":{"typeIdentifier":"t_bytes32","typeString":"bytes32"}}],"expression":{"argumentTypes":[{"typeIdentifier":"t_bytes32","typeString":"bytes32"},{"typeIdentifier":"t_bytes32","typeString":"bytes32"}],"expression":{"id":780,"name":"abi","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":-1,"src":"10816:3:1","typeDescriptions":{"typeIdentifier":"t_magic_abi","typeString":"abi"}},"id":781,"isConstant":false,"isLValue":false,"isPure":true,"lValueRequested":false,"memberName":"encodePacked","nodeType":"MemberAccess","src":"10816:16:1","typeDescriptions":{"typeIdentifier":"t_function_abiencodepacked_pure$__$returns$_t_bytes_memory_ptr_$","typeString":"function () pure returns (bytes memory)"}},"id":784,"isConstant":false,"isLValue":false,"isPure":false,"kind":"functionCall","lValueRequested":false,"names":[],"nodeType":"FunctionCall","src":"10816:47:1","tryCall":false,"typeDescriptions":{"typeIdentifier":"t_bytes_memory_ptr","typeString":"bytes memory"}}],"expression":{"argumentTypes":[{"typeIdentifier":"t_bytes_memory_ptr","typeString":"bytes memory"}],"id":779,"name":"keccak256","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":-8,"src":"10806:9:1","typeDescriptions":{"typeIdentifier":"t_function_keccak256_pure$_t_bytes_memory_ptr_$returns$_t_bytes32_$","typeString":"function (bytes memory) pure returns (bytes32)"}},"id":785,"isConstant":false,"isLValue":false,"isPure":false,"kind":"functionCall","lValueRequested":false,"names":[],"nodeType":"FunctionCall","src":"10806:58:1","tryCall":false,"typeDescriptions":{"typeIdentifier":"t_bytes32","typeString":"bytes32"}},"nodeType":"VariableDeclarationStatement","src":"10782:82:1"},{"assignments":[789],"declarations":[{"constant":false,"id":789,"mutability":"mutable","name":"resolver","nameLocation":"10892:8:1","nodeType":"VariableDeclaration","scope":804,"src":"10870:30:1","stateVariable":false,"storageLocation":"default","typeDescriptions":{"typeIdentifier":"t_contract$_ENSResolver_$2175","typeString":"contract ENSResolver"},"typeName":{"id":788,"nodeType":"UserDefinedTypeName","pathNode":{"id":787,"name":"ENSResolver_Chainlink","nodeType":"IdentifierPath","referencedDeclaration":2175,"src":"10870:21:1"},"referencedDeclaration":2175,"src":"10870:21:1","typeDescriptions":{"typeIdentifier":"t_contract$_ENSResolver_$2175","typeString":"contract ENSResolver"}},"visibility":"internal"}],"id":796,"initialValue":{"arguments":[{"arguments":[{"id":793,"name":"oracleSubnode","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":778,"src":"10940:13:1","typeDescriptions":{"typeIdentifier":"t_bytes32","typeString":"bytes32"}}],"expression":{"argumentTypes":[{"typeIdentifier":"t_bytes32","typeString":"bytes32"}],"expression":{"id":791,"name":"s_ens","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":319,"src":"10925:5:1","typeDescriptions":{"typeIdentifier":"t_contract$_ENSInterface_$974","typeString":"contract ENSInterface"}},"id":792,"isConstant":false,"isLValue":false,"isPure":false,"lValueRequested":false,"memberName":"resolver","nodeType":"MemberAccess","referencedDeclaration":966,"src":"10925:14:1","typeDescriptions":{"typeIdentifier":"t_function_external_view$_t_bytes32_$returns$_t_address_$","typeString":"function (bytes32) view external returns (address)"}},"id":794,"isConstant":false,"isLValue":false,"isPure":false,"kind":"functionCall","lValueRequested":false,"names":[],"nodeType":"FunctionCall","src":"10925:29:1","tryCall":false,"typeDescriptions":{"typeIdentifier":"t_address","typeString":"address"}}],"expression":{"argumentTypes":[{"typeIdentifier":"t_address","typeString":"address"}],"id":790,"name":"ENSResolver_Chainlink","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":2175,"src":"10903:21:1","typeDescriptions":{"typeIdentifier":"t_type$_t_contract$_ENSResolver_$2175_$","typeString":"type(contract ENSResolver)"}},"id":795,"isConstant":false,"isLValue":false,"isPure":false,"kind":"typeConversion","lValueRequested":false,"names":[],"nodeType":"FunctionCall","src":"10903:52:1","tryCall":false,"typeDescriptions":{"typeIdentifier":"t_contract$_ENSResolver_$2175","typeString":"contract ENSResolver"}},"nodeType":"VariableDeclarationStatement","src":"10870:85:1"},{"expression":{"arguments":[{"arguments":[{"id":800,"name":"oracleSubnode","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":778,"src":"10994:13:1","typeDescriptions":{"typeIdentifier":"t_bytes32","typeString":"bytes32"}}],"expression":{"argumentTypes":[{"typeIdentifier":"t_bytes32","typeString":"bytes32"}],"expression":{"id":798,"name":"resolver","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":789,"src":"10980:8:1","typeDescriptions":{"typeIdentifier":"t_contract$_ENSResolver_$2175","typeString":"contract ENSResolver"}},"id":799,"isConstant":false,"isLValue":false,"isPure":false,"lValueRequested":false,"memberName":"addr","nodeType":"MemberAccess","referencedDeclaration":2174,"src":"10980:13:1","typeDescriptions":{"typeIdentifier":"t_function_external_view$_t_bytes32_$returns$_t_address_$","typeString":"function (bytes32) view external returns (address)"}},"id":801,"isConstant":false,"isLValue":false,"isPure":false,"kind":"functionCall","lValueRequested":false,"names":[],"nodeType":"FunctionCall","src":"10980:28:1","tryCall":false,"typeDescriptions":{"typeIdentifier":"t_address","typeString":"address"}}],"expression":{"argumentTypes":[{"typeIdentifier":"t_address","typeString":"address"}],"id":797,"name":"setChainlinkOracle","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":656,"src":"10961:18:1","typeDescriptions":{"typeIdentifier":"t_function_internal_nonpayable$_t_address_$returns$__$","typeString":"function (address)"}},"id":802,"isConstant":false,"isLValue":false,"isPure":false,"kind":"functionCall","lValueRequested":false,"names":[],"nodeType":"FunctionCall","src":"10961:48:1","tryCall":false,"typeDescriptions":{"typeIdentifier":"t_tuple$__$","typeString":"tuple()"}},"id":803,"nodeType":"ExpressionStatement","src":"10961:48:1"}]},"documentation":{"id":774,"nodeType":"StructuredDocumentation","src":"10537:187:1","text":" @notice Sets the stored oracle contract with the address resolved by ENS\n @dev This may be called on its own as long as `useChainlinkWithENS` has been called previously"},"id":805,"implemented":true,"kind":"function","modifiers":[],"name":"updateChainlinkOracleWithENS","nameLocation":"10736:28:1","nodeType":"FunctionDefinition","parameters":{"id":775,"nodeType":"ParameterList","parameters":[],"src":"10764:2:1"},"returnParameters":{"id":776,"nodeType":"ParameterList","parameters":[],"src":"10776:0:1"},"scope":861,"src":"10727:287:1","stateMutability":"nonpayable","virtual":false,"visibility":"internal"},{"body":{"id":814,"nodeType":"Block","src":"11402:6:1","statements":[]},"documentation":{"id":806,"nodeType":"StructuredDocumentation","src":"11018:223:1","text":" @notice Ensures that the fulfillment is valid for this contract\n @dev Use if the contract developer prefers methods instead of modifiers for validation\n @param requestId The request ID for fulfillment"},"id":815,"implemented":true,"kind":"function","modifiers":[{"arguments":[{"id":811,"name":"requestId","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":808,"src":"11342:9:1","typeDescriptions":{"typeIdentifier":"t_bytes32","typeString":"bytes32"}}],"id":812,"kind":"modifierInvocation","modifierName":{"id":810,"name":"recordChainlinkFulfillment","nodeType":"IdentifierPath","referencedDeclaration":841,"src":"11315:26:1"},"nodeType":"ModifierInvocation","src":"11315:37:1"}],"name":"validateChainlinkCallback","nameLocation":"11253:25:1","nodeType":"FunctionDefinition","parameters":{"id":809,"nodeType":"ParameterList","parameters":[{"constant":false,"id":808,"mutability":"mutable","name":"requestId","nameLocation":"11287:9:1","nodeType":"VariableDeclaration","scope":815,"src":"11279:17:1","stateVariable":false,"storageLocation":"default","typeDescriptions":{"typeIdentifier":"t_bytes32","typeString":"bytes32"},"typeName":{"id":807,"name":"bytes32","nodeType":"ElementaryTypeName","src":"11279:7:1","typeDescriptions":{"typeIdentifier":"t_bytes32","typeString":"bytes32"}},"visibility":"internal"}],"src":"11278:19:1"},"returnParameters":{"id":813,"nodeType":"ParameterList","parameters":[],"src":"11402:0:1"},"scope":861,"src":"11244:164:1","stateMutability":"nonpayable","virtual":false,"visibility":"internal"},{"body":{"id":840,"nodeType":"Block","src":"11635:194:1","statements":[{"expression":{"arguments":[{"commonType":{"typeIdentifier":"t_address","typeString":"address"},"id":826,"isConstant":false,"isLValue":false,"isPure":false,"lValueRequested":false,"leftExpression":{"expression":{"id":821,"name":"msg","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":-15,"src":"11649:3:1","typeDescriptions":{"typeIdentifier":"t_magic_message","typeString":"msg"}},"id":822,"isConstant":false,"isLValue":false,"isPure":false,"lValueRequested":false,"memberName":"sender","nodeType":"MemberAccess","src":"11649:10:1","typeDescriptions":{"typeIdentifier":"t_address","typeString":"address"}},"nodeType":"BinaryOperation","operator":"==","rightExpression":{"baseExpression":{"id":823,"name":"s_pendingRequests","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":334,"src":"11663:17:1","typeDescriptions":{"typeIdentifier":"t_mapping$_t_bytes32_$_t_address_$","typeString":"mapping(bytes32 => address)"}},"id":825,"indexExpression":{"id":824,"name":"requestId","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":818,"src":"11681:9:1","typeDescriptions":{"typeIdentifier":"t_bytes32","typeString":"bytes32"}},"isConstant":false,"isLValue":true,"isPure":false,"lValueRequested":false,"nodeType":"IndexAccess","src":"11663:28:1","typeDescriptions":{"typeIdentifier":"t_address","typeString":"address"}},"src":"11649:42:1","typeDescriptions":{"typeIdentifier":"t_bool","typeString":"bool"}},{"hexValue":"536f75726365206d75737420626520746865206f7261636c65206f66207468652072657175657374","id":827,"isConstant":false,"isLValue":false,"isPure":true,"kind":"string","lValueRequested":false,"nodeType":"Literal","src":"11693:42:1","typeDescriptions":{"typeIdentifier":"t_stringliteral_d5cafe2745dab6273b51cca76f8727c7664db74ede49af049a5b5ca6a3b184e4","typeString":"literal_string \"Source must be the oracle of the request\""},"value":"Source must be the oracle of the request"}],"expression":{"argumentTypes":[{"typeIdentifier":"t_bool","typeString":"bool"},{"typeIdentifier":"t_stringliteral_d5cafe2745dab6273b51cca76f8727c7664db74ede49af049a5b5ca6a3b184e4","typeString":"literal_string \"Source must be the oracle of the request\""}],"id":820,"name":"require","nodeType":"Identifier","overloadedDeclarations":[-18,-18],"referencedDeclaration":-18,"src":"11641:7:1","typeDescriptions":{"typeIdentifier":"t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$","typeString":"function (bool,string memory) pure"}},"id":828,"isConstant":false,"isLValue":false,"isPure":false,"kind":"functionCall","lValueRequested":false,"names":[],"nodeType":"FunctionCall","src":"11641:95:1","tryCall":false,"typeDescriptions":{"typeIdentifier":"t_tuple$__$","typeString":"tuple()"}},"id":829,"nodeType":"ExpressionStatement","src":"11641:95:1"},{"expression":{"id":833,"isConstant":false,"isLValue":false,"isPure":false,"lValueRequested":false,"nodeType":"UnaryOperation","operator":"delete","prefix":true,"src":"11742:35:1","subExpression":{"baseExpression":{"id":830,"name":"s_pendingRequests","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":334,"src":"11749:17:1","typeDescriptions":{"typeIdentifier":"t_mapping$_t_bytes32_$_t_address_$","typeString":"mapping(bytes32 => address)"}},"id":832,"indexExpression":{"id":831,"name":"requestId","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":818,"src":"11767:9:1","typeDescriptions":{"typeIdentifier":"t_bytes32","typeString":"bytes32"}},"isConstant":false,"isLValue":true,"isPure":false,"lValueRequested":true,"nodeType":"IndexAccess","src":"11749:28:1","typeDescriptions":{"typeIdentifier":"t_address","typeString":"address"}},"typeDescriptions":{"typeIdentifier":"t_tuple$__$","typeString":"tuple()"}},"id":834,"nodeType":"ExpressionStatement","src":"11742:35:1"},{"eventCall":{"arguments":[{"id":836,"name":"requestId","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":818,"src":"11807:9:1","typeDescriptions":{"typeIdentifier":"t_bytes32","typeString":"bytes32"}}],"expression":{"argumentTypes":[{"typeIdentifier":"t_bytes32","typeString":"bytes32"}],"id":835,"name":"ChainlinkFulfilled","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":342,"src":"11788:18:1","typeDescriptions":{"typeIdentifier":"t_function_event_nonpayable$_t_bytes32_$returns$__$","typeString":"function (bytes32)"}},"id":837,"isConstant":false,"isLValue":false,"isPure":false,"kind":"functionCall","lValueRequested":false,"names":[],"nodeType":"FunctionCall","src":"11788:29:1","tryCall":false,"typeDescriptions":{"typeIdentifier":"t_tuple$__$","typeString":"tuple()"}},"id":838,"nodeType":"EmitStatement","src":"11783:34:1"},{"id":839,"nodeType":"PlaceholderStatement","src":"11823:1:1"}]},"documentation":{"id":816,"nodeType":"StructuredDocumentation","src":"11412:165:1","text":" @dev Reverts if the sender is not the oracle of the request.\n Emits ChainlinkFulfilled event.\n @param requestId The request ID for fulfillment"},"id":841,"name":"recordChainlinkFulfillment","nameLocation":"11589:26:1","nodeType":"ModifierDefinition","parameters":{"id":819,"nodeType":"ParameterList","parameters":[{"constant":false,"id":818,"mutability":"mutable","name":"requestId","nameLocation":"11624:9:1","nodeType":"VariableDeclaration","scope":841,"src":"11616:17:1","stateVariable":false,"storageLocation":"default","typeDescriptions":{"typeIdentifier":"t_bytes32","typeString":"bytes32"},"typeName":{"id":817,"name":"bytes32","nodeType":"ElementaryTypeName","src":"11616:7:1","typeDescriptions":{"typeIdentifier":"t_bytes32","typeString":"bytes32"}},"visibility":"internal"}],"src":"11615:19:1"},"src":"11580:249:1","virtual":false,"visibility":"internal"},{"body":{"id":859,"nodeType":"Block","src":"11996:99:1","statements":[{"expression":{"arguments":[{"commonType":{"typeIdentifier":"t_address","typeString":"address"},"id":854,"isConstant":false,"isLValue":false,"isPure":false,"lValueRequested":false,"leftExpression":{"baseExpression":{"id":847,"name":"s_pendingRequests","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":334,"src":"12010:17:1","typeDescriptions":{"typeIdentifier":"t_mapping$_t_bytes32_$_t_address_$","typeString":"mapping(bytes32 => address)"}},"id":849,"indexExpression":{"id":848,"name":"requestId","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":844,"src":"12028:9:1","typeDescriptions":{"typeIdentifier":"t_bytes32","typeString":"bytes32"}},"isConstant":false,"isLValue":true,"isPure":false,"lValueRequested":false,"nodeType":"IndexAccess","src":"12010:28:1","typeDescriptions":{"typeIdentifier":"t_address","typeString":"address"}},"nodeType":"BinaryOperation","operator":"==","rightExpression":{"arguments":[{"hexValue":"30","id":852,"isConstant":false,"isLValue":false,"isPure":true,"kind":"number","lValueRequested":false,"nodeType":"Literal","src":"12050:1:1","typeDescriptions":{"typeIdentifier":"t_rational_0_by_1","typeString":"int_const 0"},"value":"0"}],"expression":{"argumentTypes":[{"typeIdentifier":"t_rational_0_by_1","typeString":"int_const 0"}],"id":851,"isConstant":false,"isLValue":false,"isPure":true,"lValueRequested":false,"nodeType":"ElementaryTypeNameExpression","src":"12042:7:1","typeDescriptions":{"typeIdentifier":"t_type$_t_address_$","typeString":"type(address)"},"typeName":{"id":850,"name":"address","nodeType":"ElementaryTypeName","src":"12042:7:1","typeDescriptions":{}}},"id":853,"isConstant":false,"isLValue":false,"isPure":true,"kind":"typeConversion","lValueRequested":false,"names":[],"nodeType":"FunctionCall","src":"12042:10:1","tryCall":false,"typeDescriptions":{"typeIdentifier":"t_address","typeString":"address"}},"src":"12010:42:1","typeDescriptions":{"typeIdentifier":"t_bool","typeString":"bool"}},{"hexValue":"5265717565737420697320616c72656164792070656e64696e67","id":855,"isConstant":false,"isLValue":false,"isPure":true,"kind":"string","lValueRequested":false,"nodeType":"Literal","src":"12054:28:1","typeDescriptions":{"typeIdentifier":"t_stringliteral_efa688de2ca2442cd2f76ca864c7a15bdcb24ac77ed3de01d4cf9f6afd58c7aa","typeString":"literal_string \"Request is already pending\""},"value":"Request is already pending"}],"expression":{"argumentTypes":[{"typeIdentifier":"t_bool","typeString":"bool"},{"typeIdentifier":"t_stringliteral_efa688de2ca2442cd2f76ca864c7a15bdcb24ac77ed3de01d4cf9f6afd58c7aa","typeString":"literal_string \"Request is already pending\""}],"id":846,"name":"require","nodeType":"Identifier","overloadedDeclarations":[-18,-18],"referencedDeclaration":-18,"src":"12002:7:1","typeDescriptions":{"typeIdentifier":"t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$","typeString":"function (bool,string memory) pure"}},"id":856,"isConstant":false,"isLValue":false,"isPure":false,"kind":"functionCall","lValueRequested":false,"names":[],"nodeType":"FunctionCall","src":"12002:81:1","tryCall":false,"typeDescriptions":{"typeIdentifier":"t_tuple$__$","typeString":"tuple()"}},"id":857,"nodeType":"ExpressionStatement","src":"12002:81:1"},{"id":858,"nodeType":"PlaceholderStatement","src":"12089:1:1"}]},"documentation":{"id":842,"nodeType":"StructuredDocumentation","src":"11833:114:1","text":" @dev Reverts if the request is already pending\n @param requestId The request ID for fulfillment"},"id":860,"name":"notPendingRequest","nameLocation":"11959:17:1","nodeType":"ModifierDefinition","parameters":{"id":845,"nodeType":"ParameterList","parameters":[{"constant":false,"id":844,"mutability":"mutable","name":"requestId","nameLocation":"11985:9:1","nodeType":"VariableDeclaration","scope":860,"src":"11977:17:1","stateVariable":false,"storageLocation":"default","typeDescriptions":{"typeIdentifier":"t_bytes32","typeString":"bytes32"},"typeName":{"id":843,"name":"bytes32","nodeType":"ElementaryTypeName","src":"11977:7:1","typeDescriptions":{"typeIdentifier":"t_bytes32","typeString":"bytes32"}},"visibility":"internal"}],"src":"11976:19:1"},"src":"11950:145:1","virtual":false,"visibility":"internal"}],"scope":862,"src":"549:11548:1","usedErrors":[]}],"src":"32:12066:1"},"id":1},"@chainlink/contracts/src/v0.8/interfaces/ChainlinkRequestInterface.sol":{"ast":{"absolutePath":"@chainlink/contracts/src/v0.8/interfaces/ChainlinkRequestInterface.sol","exportedSymbols":{"ChainlinkRequestInterface":[894]},"id":895,"license":"MIT","nodeType":"SourceUnit","nodes":[{"id":863,"literals":["solidity","^","0.8",".0"],"nodeType":"PragmaDirective","src":"32:23:2"},{"abstract":false,"baseContracts":[],"canonicalName":"ChainlinkRequestInterface","contractDependencies":[],"contractKind":"interface","fullyImplemented":false,"id":894,"linearizedBaseContracts":[894],"name":"ChainlinkRequestInterface","nameLocation":"67:25:2","nodeType":"ContractDefinition","nodes":[{"functionSelector":"40429946","id":882,"implemented":false,"kind":"function","modifiers":[],"name":"oracleRequest","nameLocation":"106:13:2","nodeType":"FunctionDefinition","parameters":{"id":880,"nodeType":"ParameterList","parameters":[{"constant":false,"id":865,"mutability":"mutable","name":"sender","nameLocation":"133:6:2","nodeType":"VariableDeclaration","scope":882,"src":"125:14:2","stateVariable":false,"storageLocation":"default","typeDescriptions":{"typeIdentifier":"t_address","typeString":"address"},"typeName":{"id":864,"name":"address","nodeType":"ElementaryTypeName","src":"125:7:2","stateMutability":"nonpayable","typeDescriptions":{"typeIdentifier":"t_address","typeString":"address"}},"visibility":"internal"},{"constant":false,"id":867,"mutability":"mutable","name":"requestPrice","nameLocation":"153:12:2","nodeType":"VariableDeclaration","scope":882,"src":"145:20:2","stateVariable":false,"storageLocation":"default","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"},"typeName":{"id":866,"name":"uint256","nodeType":"ElementaryTypeName","src":"145:7:2","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"}},"visibility":"internal"},{"constant":false,"id":869,"mutability":"mutable","name":"serviceAgreementID","nameLocation":"179:18:2","nodeType":"VariableDeclaration","scope":882,"src":"171:26:2","stateVariable":false,"storageLocation":"default","typeDescriptions":{"typeIdentifier":"t_bytes32","typeString":"bytes32"},"typeName":{"id":868,"name":"bytes32","nodeType":"ElementaryTypeName","src":"171:7:2","typeDescriptions":{"typeIdentifier":"t_bytes32","typeString":"bytes32"}},"visibility":"internal"},{"constant":false,"id":871,"mutability":"mutable","name":"callbackAddress","nameLocation":"211:15:2","nodeType":"VariableDeclaration","scope":882,"src":"203:23:2","stateVariable":false,"storageLocation":"default","typeDescriptions":{"typeIdentifier":"t_address","typeString":"address"},"typeName":{"id":870,"name":"address","nodeType":"ElementaryTypeName","src":"203:7:2","stateMutability":"nonpayable","typeDescriptions":{"typeIdentifier":"t_address","typeString":"address"}},"visibility":"internal"},{"constant":false,"id":873,"mutability":"mutable","name":"callbackFunctionId","nameLocation":"239:18:2","nodeType":"VariableDeclaration","scope":882,"src":"232:25:2","stateVariable":false,"storageLocation":"default","typeDescriptions":{"typeIdentifier":"t_bytes4","typeString":"bytes4"},"typeName":{"id":872,"name":"bytes4","nodeType":"ElementaryTypeName","src":"232:6:2","typeDescriptions":{"typeIdentifier":"t_bytes4","typeString":"bytes4"}},"visibility":"internal"},{"constant":false,"id":875,"mutability":"mutable","name":"nonce","nameLocation":"271:5:2","nodeType":"VariableDeclaration","scope":882,"src":"263:13:2","stateVariable":false,"storageLocation":"default","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"},"typeName":{"id":874,"name":"uint256","nodeType":"ElementaryTypeName","src":"263:7:2","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"}},"visibility":"internal"},{"constant":false,"id":877,"mutability":"mutable","name":"dataVersion","nameLocation":"290:11:2","nodeType":"VariableDeclaration","scope":882,"src":"282:19:2","stateVariable":false,"storageLocation":"default","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"},"typeName":{"id":876,"name":"uint256","nodeType":"ElementaryTypeName","src":"282:7:2","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"}},"visibility":"internal"},{"constant":false,"id":879,"mutability":"mutable","name":"data","nameLocation":"322:4:2","nodeType":"VariableDeclaration","scope":882,"src":"307:19:2","stateVariable":false,"storageLocation":"calldata","typeDescriptions":{"typeIdentifier":"t_bytes_calldata_ptr","typeString":"bytes"},"typeName":{"id":878,"name":"bytes","nodeType":"ElementaryTypeName","src":"307:5:2","typeDescriptions":{"typeIdentifier":"t_bytes_storage_ptr","typeString":"bytes"}},"visibility":"internal"}],"src":"119:211:2"},"returnParameters":{"id":881,"nodeType":"ParameterList","parameters":[],"src":"339:0:2"},"scope":894,"src":"97:243:2","stateMutability":"nonpayable","virtual":false,"visibility":"external"},{"functionSelector":"6ee4d553","id":893,"implemented":false,"kind":"function","modifiers":[],"name":"cancelOracleRequest","nameLocation":"353:19:2","nodeType":"FunctionDefinition","parameters":{"id":891,"nodeType":"ParameterList","parameters":[{"constant":false,"id":884,"mutability":"mutable","name":"requestId","nameLocation":"386:9:2","nodeType":"VariableDeclaration","scope":893,"src":"378:17:2","stateVariable":false,"storageLocation":"default","typeDescriptions":{"typeIdentifier":"t_bytes32","typeString":"bytes32"},"typeName":{"id":883,"name":"bytes32","nodeType":"ElementaryTypeName","src":"378:7:2","typeDescriptions":{"typeIdentifier":"t_bytes32","typeString":"bytes32"}},"visibility":"internal"},{"constant":false,"id":886,"mutability":"mutable","name":"payment","nameLocation":"409:7:2","nodeType":"VariableDeclaration","scope":893,"src":"401:15:2","stateVariable":false,"storageLocation":"default","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"},"typeName":{"id":885,"name":"uint256","nodeType":"ElementaryTypeName","src":"401:7:2","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"}},"visibility":"internal"},{"constant":false,"id":888,"mutability":"mutable","name":"callbackFunctionId","nameLocation":"429:18:2","nodeType":"VariableDeclaration","scope":893,"src":"422:25:2","stateVariable":false,"storageLocation":"default","typeDescriptions":{"typeIdentifier":"t_bytes4","typeString":"bytes4"},"typeName":{"id":887,"name":"bytes4","nodeType":"ElementaryTypeName","src":"422:6:2","typeDescriptions":{"typeIdentifier":"t_bytes4","typeString":"bytes4"}},"visibility":"internal"},{"constant":false,"id":890,"mutability":"mutable","name":"expiration","nameLocation":"461:10:2","nodeType":"VariableDeclaration","scope":893,"src":"453:18:2","stateVariable":false,"storageLocation":"default","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"},"typeName":{"id":889,"name":"uint256","nodeType":"ElementaryTypeName","src":"453:7:2","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"}},"visibility":"internal"}],"src":"372:103:2"},"returnParameters":{"id":892,"nodeType":"ParameterList","parameters":[],"src":"484:0:2"},"scope":894,"src":"344:141:2","stateMutability":"nonpayable","virtual":false,"visibility":"external"}],"scope":895,"src":"57:430:2","usedErrors":[]}],"src":"32:456:2"},"id":2},"@chainlink/contracts/src/v0.8/interfaces/ENSInterface.sol":{"ast":{"absolutePath":"@chainlink/contracts/src/v0.8/interfaces/ENSInterface.sol","exportedSymbols":{"ENSInterface":[974]},"id":975,"license":"MIT","nodeType":"SourceUnit","nodes":[{"id":896,"literals":["solidity","^","0.8",".0"],"nodeType":"PragmaDirective","src":"32:23:3"},{"abstract":false,"baseContracts":[],"canonicalName":"ENSInterface","contractDependencies":[],"contractKind":"interface","fullyImplemented":false,"id":974,"linearizedBaseContracts":[974],"name":"ENSInterface","nameLocation":"67:12:3","nodeType":"ContractDefinition","nodes":[{"anonymous":false,"id":904,"name":"NewOwner","nameLocation":"161:8:3","nodeType":"EventDefinition","parameters":{"id":903,"nodeType":"ParameterList","parameters":[{"constant":false,"id":898,"indexed":true,"mutability":"mutable","name":"node","nameLocation":"186:4:3","nodeType":"VariableDeclaration","scope":904,"src":"170:20:3","stateVariable":false,"storageLocation":"default","typeDescriptions":{"typeIdentifier":"t_bytes32","typeString":"bytes32"},"typeName":{"id":897,"name":"bytes32","nodeType":"ElementaryTypeName","src":"170:7:3","typeDescriptions":{"typeIdentifier":"t_bytes32","typeString":"bytes32"}},"visibility":"internal"},{"constant":false,"id":900,"indexed":true,"mutability":"mutable","name":"label","nameLocation":"208:5:3","nodeType":"VariableDeclaration","scope":904,"src":"192:21:3","stateVariable":false,"storageLocation":"default","typeDescriptions":{"typeIdentifier":"t_bytes32","typeString":"bytes32"},"typeName":{"id":899,"name":"bytes32","nodeType":"ElementaryTypeName","src":"192:7:3","typeDescriptions":{"typeIdentifier":"t_bytes32","typeString":"bytes32"}},"visibility":"internal"},{"constant":false,"id":902,"indexed":false,"mutability":"mutable","name":"owner","nameLocation":"223:5:3","nodeType":"VariableDeclaration","scope":904,"src":"215:13:3","stateVariable":false,"storageLocation":"default","typeDescriptions":{"typeIdentifier":"t_address","typeString":"address"},"typeName":{"id":901,"name":"address","nodeType":"ElementaryTypeName","src":"215:7:3","stateMutability":"nonpayable","typeDescriptions":{"typeIdentifier":"t_address","typeString":"address"}},"visibility":"internal"}],"src":"169:60:3"},"src":"155:75:3"},{"anonymous":false,"id":910,"name":"Transfer","nameLocation":"315:8:3","nodeType":"EventDefinition","parameters":{"id":909,"nodeType":"ParameterList","parameters":[{"constant":false,"id":906,"indexed":true,"mutability":"mutable","name":"node","nameLocation":"340:4:3","nodeType":"VariableDeclaration","scope":910,"src":"324:20:3","stateVariable":false,"storageLocation":"default","typeDescriptions":{"typeIdentifier":"t_bytes32","typeString":"bytes32"},"typeName":{"id":905,"name":"bytes32","nodeType":"ElementaryTypeName","src":"324:7:3","typeDescriptions":{"typeIdentifier":"t_bytes32","typeString":"bytes32"}},"visibility":"internal"},{"constant":false,"id":908,"indexed":false,"mutability":"mutable","name":"owner","nameLocation":"354:5:3","nodeType":"VariableDeclaration","scope":910,"src":"346:13:3","stateVariable":false,"storageLocation":"default","typeDescriptions":{"typeIdentifier":"t_address","typeString":"address"},"typeName":{"id":907,"name":"address","nodeType":"ElementaryTypeName","src":"346:7:3","stateMutability":"nonpayable","typeDescriptions":{"typeIdentifier":"t_address","typeString":"address"}},"visibility":"internal"}],"src":"323:37:3"},"src":"309:52:3"},{"anonymous":false,"id":916,"name":"NewResolver","nameLocation":"421:11:3","nodeType":"EventDefinition","parameters":{"id":915,"nodeType":"ParameterList","parameters":[{"constant":false,"id":912,"indexed":true,"mutability":"mutable","name":"node","nameLocation":"449:4:3","nodeType":"VariableDeclaration","scope":916,"src":"433:20:3","stateVariable":false,"storageLocation":"default","typeDescriptions":{"typeIdentifier":"t_bytes32","typeString":"bytes32"},"typeName":{"id":911,"name":"bytes32","nodeType":"ElementaryTypeName","src":"433:7:3","typeDescriptions":{"typeIdentifier":"t_bytes32","typeString":"bytes32"}},"visibility":"internal"},{"constant":false,"id":914,"indexed":false,"mutability":"mutable","name":"resolver","nameLocation":"463:8:3","nodeType":"VariableDeclaration","scope":916,"src":"455:16:3","stateVariable":false,"storageLocation":"default","typeDescriptions":{"typeIdentifier":"t_address","typeString":"address"},"typeName":{"id":913,"name":"address","nodeType":"ElementaryTypeName","src":"455:7:3","stateMutability":"nonpayable","typeDescriptions":{"typeIdentifier":"t_address","typeString":"address"}},"visibility":"internal"}],"src":"432:40:3"},"src":"415:58:3"},{"anonymous":false,"id":922,"name":"NewTTL","nameLocation":"526:6:3","nodeType":"EventDefinition","parameters":{"id":921,"nodeType":"ParameterList","parameters":[{"constant":false,"id":918,"indexed":true,"mutability":"mutable","name":"node","nameLocation":"549:4:3","nodeType":"VariableDeclaration","scope":922,"src":"533:20:3","stateVariable":false,"storageLocation":"default","typeDescriptions":{"typeIdentifier":"t_bytes32","typeString":"bytes32"},"typeName":{"id":917,"name":"bytes32","nodeType":"ElementaryTypeName","src":"533:7:3","typeDescriptions":{"typeIdentifier":"t_bytes32","typeString":"bytes32"}},"visibility":"internal"},{"constant":false,"id":920,"indexed":false,"mutability":"mutable","name":"ttl","nameLocation":"562:3:3","nodeType":"VariableDeclaration","scope":922,"src":"555:10:3","stateVariable":false,"storageLocation":"default","typeDescriptions":{"typeIdentifier":"t_uint64","typeString":"uint64"},"typeName":{"id":919,"name":"uint64","nodeType":"ElementaryTypeName","src":"555:6:3","typeDescriptions":{"typeIdentifier":"t_uint64","typeString":"uint64"}},"visibility":"internal"}],"src":"532:34:3"},"src":"520:47:3"},{"functionSelector":"06ab5923","id":931,"implemented":false,"kind":"function","modifiers":[],"name":"setSubnodeOwner","nameLocation":"580:15:3","nodeType":"FunctionDefinition","parameters":{"id":929,"nodeType":"ParameterList","parameters":[{"constant":false,"id":924,"mutability":"mutable","name":"node","nameLocation":"609:4:3","nodeType":"VariableDeclaration","scope":931,"src":"601:12:3","stateVariable":false,"storageLocation":"default","typeDescriptions":{"typeIdentifier":"t_bytes32","typeString":"bytes32"},"typeName":{"id":923,"name":"bytes32","nodeType":"ElementaryTypeName","src":"601:7:3","typeDescriptions":{"typeIdentifier":"t_bytes32","typeString":"bytes32"}},"visibility":"internal"},{"constant":false,"id":926,"mutability":"mutable","name":"label","nameLocation":"627:5:3","nodeType":"VariableDeclaration","scope":931,"src":"619:13:3","stateVariable":false,"storageLocation":"default","typeDescriptions":{"typeIdentifier":"t_bytes32","typeString":"bytes32"},"typeName":{"id":925,"name":"bytes32","nodeType":"ElementaryTypeName","src":"619:7:3","typeDescriptions":{"typeIdentifier":"t_bytes32","typeString":"bytes32"}},"visibility":"internal"},{"constant":false,"id":928,"mutability":"mutable","name":"owner","nameLocation":"646:5:3","nodeType":"VariableDeclaration","scope":931,"src":"638:13:3","stateVariable":false,"storageLocation":"default","typeDescriptions":{"typeIdentifier":"t_address","typeString":"address"},"typeName":{"id":927,"name":"address","nodeType":"ElementaryTypeName","src":"638:7:3","stateMutability":"nonpayable","typeDescriptions":{"typeIdentifier":"t_address","typeString":"address"}},"visibility":"internal"}],"src":"595:60:3"},"returnParameters":{"id":930,"nodeType":"ParameterList","parameters":[],"src":"664:0:3"},"scope":974,"src":"571:94:3","stateMutability":"nonpayable","virtual":false,"visibility":"external"},{"functionSelector":"1896f70a","id":938,"implemented":false,"kind":"function","modifiers":[],"name":"setResolver","nameLocation":"678:11:3","nodeType":"FunctionDefinition","parameters":{"id":936,"nodeType":"ParameterList","parameters":[{"constant":false,"id":933,"mutability":"mutable","name":"node","nameLocation":"698:4:3","nodeType":"VariableDeclaration","scope":938,"src":"690:12:3","stateVariable":false,"storageLocation":"default","typeDescriptions":{"typeIdentifier":"t_bytes32","typeString":"bytes32"},"typeName":{"id":932,"name":"bytes32","nodeType":"ElementaryTypeName","src":"690:7:3","typeDescriptions":{"typeIdentifier":"t_bytes32","typeString":"bytes32"}},"visibility":"internal"},{"constant":false,"id":935,"mutability":"mutable","name":"resolver","nameLocation":"712:8:3","nodeType":"VariableDeclaration","scope":938,"src":"704:16:3","stateVariable":false,"storageLocation":"default","typeDescriptions":{"typeIdentifier":"t_address","typeString":"address"},"typeName":{"id":934,"name":"address","nodeType":"ElementaryTypeName","src":"704:7:3","stateMutability":"nonpayable","typeDescriptions":{"typeIdentifier":"t_address","typeString":"address"}},"visibility":"internal"}],"src":"689:32:3"},"returnParameters":{"id":937,"nodeType":"ParameterList","parameters":[],"src":"730:0:3"},"scope":974,"src":"669:62:3","stateMutability":"nonpayable","virtual":false,"visibility":"external"},{"functionSelector":"5b0fc9c3","id":945,"implemented":false,"kind":"function","modifiers":[],"name":"setOwner","nameLocation":"744:8:3","nodeType":"FunctionDefinition","parameters":{"id":943,"nodeType":"ParameterList","parameters":[{"constant":false,"id":940,"mutability":"mutable","name":"node","nameLocation":"761:4:3","nodeType":"VariableDeclaration","scope":945,"src":"753:12:3","stateVariable":false,"storageLocation":"default","typeDescriptions":{"typeIdentifier":"t_bytes32","typeString":"bytes32"},"typeName":{"id":939,"name":"bytes32","nodeType":"ElementaryTypeName","src":"753:7:3","typeDescriptions":{"typeIdentifier":"t_bytes32","typeString":"bytes32"}},"visibility":"internal"},{"constant":false,"id":942,"mutability":"mutable","name":"owner","nameLocation":"775:5:3","nodeType":"VariableDeclaration","scope":945,"src":"767:13:3","stateVariable":false,"storageLocation":"default","typeDescriptions":{"typeIdentifier":"t_address","typeString":"address"},"typeName":{"id":941,"name":"address","nodeType":"ElementaryTypeName","src":"767:7:3","stateMutability":"nonpayable","typeDescriptions":{"typeIdentifier":"t_address","typeString":"address"}},"visibility":"internal"}],"src":"752:29:3"},"returnParameters":{"id":944,"nodeType":"ParameterList","parameters":[],"src":"790:0:3"},"scope":974,"src":"735:56:3","stateMutability":"nonpayable","virtual":false,"visibility":"external"},{"functionSelector":"14ab9038","id":952,"implemented":false,"kind":"function","modifiers":[],"name":"setTTL","nameLocation":"804:6:3","nodeType":"FunctionDefinition","parameters":{"id":950,"nodeType":"ParameterList","parameters":[{"constant":false,"id":947,"mutability":"mutable","name":"node","nameLocation":"819:4:3","nodeType":"VariableDeclaration","scope":952,"src":"811:12:3","stateVariable":false,"storageLocation":"default","typeDescriptions":{"typeIdentifier":"t_bytes32","typeString":"bytes32"},"typeName":{"id":946,"name":"bytes32","nodeType":"ElementaryTypeName","src":"811:7:3","typeDescriptions":{"typeIdentifier":"t_bytes32","typeString":"bytes32"}},"visibility":"internal"},{"constant":false,"id":949,"mutability":"mutable","name":"ttl","nameLocation":"832:3:3","nodeType":"VariableDeclaration","scope":952,"src":"825:10:3","stateVariable":false,"storageLocation":"default","typeDescriptions":{"typeIdentifier":"t_uint64","typeString":"uint64"},"typeName":{"id":948,"name":"uint64","nodeType":"ElementaryTypeName","src":"825:6:3","typeDescriptions":{"typeIdentifier":"t_uint64","typeString":"uint64"}},"visibility":"internal"}],"src":"810:26:3"},"returnParameters":{"id":951,"nodeType":"ParameterList","parameters":[],"src":"845:0:3"},"scope":974,"src":"795:51:3","stateMutability":"nonpayable","virtual":false,"visibility":"external"},{"functionSelector":"02571be3","id":959,"implemented":false,"kind":"function","modifiers":[],"name":"owner","nameLocation":"859:5:3","nodeType":"FunctionDefinition","parameters":{"id":955,"nodeType":"ParameterList","parameters":[{"constant":false,"id":954,"mutability":"mutable","name":"node","nameLocation":"873:4:3","nodeType":"VariableDeclaration","scope":959,"src":"865:12:3","stateVariable":false,"storageLocation":"default","typeDescriptions":{"typeIdentifier":"t_bytes32","typeString":"bytes32"},"typeName":{"id":953,"name":"bytes32","nodeType":"ElementaryTypeName","src":"865:7:3","typeDescriptions":{"typeIdentifier":"t_bytes32","typeString":"bytes32"}},"visibility":"internal"}],"src":"864:14:3"},"returnParameters":{"id":958,"nodeType":"ParameterList","parameters":[{"constant":false,"id":957,"mutability":"mutable","name":"","nameLocation":"-1:-1:-1","nodeType":"VariableDeclaration","scope":959,"src":"902:7:3","stateVariable":false,"storageLocation":"default","typeDescriptions":{"typeIdentifier":"t_address","typeString":"address"},"typeName":{"id":956,"name":"address","nodeType":"ElementaryTypeName","src":"902:7:3","stateMutability":"nonpayable","typeDescriptions":{"typeIdentifier":"t_address","typeString":"address"}},"visibility":"internal"}],"src":"901:9:3"},"scope":974,"src":"850:61:3","stateMutability":"view","virtual":false,"visibility":"external"},{"functionSelector":"0178b8bf","id":966,"implemented":false,"kind":"function","modifiers":[],"name":"resolver","nameLocation":"924:8:3","nodeType":"FunctionDefinition","parameters":{"id":962,"nodeType":"ParameterList","parameters":[{"constant":false,"id":961,"mutability":"mutable","name":"node","nameLocation":"941:4:3","nodeType":"VariableDeclaration","scope":966,"src":"933:12:3","stateVariable":false,"storageLocation":"default","typeDescriptions":{"typeIdentifier":"t_bytes32","typeString":"bytes32"},"typeName":{"id":960,"name":"bytes32","nodeType":"ElementaryTypeName","src":"933:7:3","typeDescriptions":{"typeIdentifier":"t_bytes32","typeString":"bytes32"}},"visibility":"internal"}],"src":"932:14:3"},"returnParameters":{"id":965,"nodeType":"ParameterList","parameters":[{"constant":false,"id":964,"mutability":"mutable","name":"","nameLocation":"-1:-1:-1","nodeType":"VariableDeclaration","scope":966,"src":"970:7:3","stateVariable":false,"storageLocation":"default","typeDescriptions":{"typeIdentifier":"t_address","typeString":"address"},"typeName":{"id":963,"name":"address","nodeType":"ElementaryTypeName","src":"970:7:3","stateMutability":"nonpayable","typeDescriptions":{"typeIdentifier":"t_address","typeString":"address"}},"visibility":"internal"}],"src":"969:9:3"},"scope":974,"src":"915:64:3","stateMutability":"view","virtual":false,"visibility":"external"},{"functionSelector":"16a25cbd","id":973,"implemented":false,"kind":"function","modifiers":[],"name":"ttl","nameLocation":"992:3:3","nodeType":"FunctionDefinition","parameters":{"id":969,"nodeType":"ParameterList","parameters":[{"constant":false,"id":968,"mutability":"mutable","name":"node","nameLocation":"1004:4:3","nodeType":"VariableDeclaration","scope":973,"src":"996:12:3","stateVariable":false,"storageLocation":"default","typeDescriptions":{"typeIdentifier":"t_bytes32","typeString":"bytes32"},"typeName":{"id":967,"name":"bytes32","nodeType":"ElementaryTypeName","src":"996:7:3","typeDescriptions":{"typeIdentifier":"t_bytes32","typeString":"bytes32"}},"visibility":"internal"}],"src":"995:14:3"},"returnParameters":{"id":972,"nodeType":"ParameterList","parameters":[{"constant":false,"id":971,"mutability":"mutable","name":"","nameLocation":"-1:-1:-1","nodeType":"VariableDeclaration","scope":973,"src":"1033:6:3","stateVariable":false,"storageLocation":"default","typeDescriptions":{"typeIdentifier":"t_uint64","typeString":"uint64"},"typeName":{"id":970,"name":"uint64","nodeType":"ElementaryTypeName","src":"1033:6:3","typeDescriptions":{"typeIdentifier":"t_uint64","typeString":"uint64"}},"visibility":"internal"}],"src":"1032:8:3"},"scope":974,"src":"983:58:3","stateMutability":"view","virtual":false,"visibility":"external"}],"scope":975,"src":"57:986:3","usedErrors":[]}],"src":"32:1012:3"},"id":3},"@chainlink/contracts/src/v0.8/interfaces/LinkTokenInterface.sol":{"ast":{"absolutePath":"@chainlink/contracts/src/v0.8/interfaces/LinkTokenInterface.sol","exportedSymbols":{"LinkTokenInterface":[1069]},"id":1070,"license":"MIT","nodeType":"SourceUnit","nodes":[{"id":976,"literals":["solidity","^","0.8",".0"],"nodeType":"PragmaDirective","src":"32:23:4"},{"abstract":false,"baseContracts":[],"canonicalName":"LinkTokenInterface","contractDependencies":[],"contractKind":"interface","fullyImplemented":false,"id":1069,"linearizedBaseContracts":[1069],"name":"LinkTokenInterface","nameLocation":"67:18:4","nodeType":"ContractDefinition","nodes":[{"functionSelector":"dd62ed3e","id":985,"implemented":false,"kind":"function","modifiers":[],"name":"allowance","nameLocation":"99:9:4","nodeType":"FunctionDefinition","parameters":{"id":981,"nodeType":"ParameterList","parameters":[{"constant":false,"id":978,"mutability":"mutable","name":"owner","nameLocation":"117:5:4","nodeType":"VariableDeclaration","scope":985,"src":"109:13:4","stateVariable":false,"storageLocation":"default","typeDescriptions":{"typeIdentifier":"t_address","typeString":"address"},"typeName":{"id":977,"name":"address","nodeType":"ElementaryTypeName","src":"109:7:4","stateMutability":"nonpayable","typeDescriptions":{"typeIdentifier":"t_address","typeString":"address"}},"visibility":"internal"},{"constant":false,"id":980,"mutability":"mutable","name":"spender","nameLocation":"132:7:4","nodeType":"VariableDeclaration","scope":985,"src":"124:15:4","stateVariable":false,"storageLocation":"default","typeDescriptions":{"typeIdentifier":"t_address","typeString":"address"},"typeName":{"id":979,"name":"address","nodeType":"ElementaryTypeName","src":"124:7:4","stateMutability":"nonpayable","typeDescriptions":{"typeIdentifier":"t_address","typeString":"address"}},"visibility":"internal"}],"src":"108:32:4"},"returnParameters":{"id":984,"nodeType":"ParameterList","parameters":[{"constant":false,"id":983,"mutability":"mutable","name":"remaining","nameLocation":"172:9:4","nodeType":"VariableDeclaration","scope":985,"src":"164:17:4","stateVariable":false,"storageLocation":"default","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"},"typeName":{"id":982,"name":"uint256","nodeType":"ElementaryTypeName","src":"164:7:4","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"}},"visibility":"internal"}],"src":"163:19:4"},"scope":1069,"src":"90:93:4","stateMutability":"view","virtual":false,"visibility":"external"},{"functionSelector":"095ea7b3","id":994,"implemented":false,"kind":"function","modifiers":[],"name":"approve","nameLocation":"196:7:4","nodeType":"FunctionDefinition","parameters":{"id":990,"nodeType":"ParameterList","parameters":[{"constant":false,"id":987,"mutability":"mutable","name":"spender","nameLocation":"212:7:4","nodeType":"VariableDeclaration","scope":994,"src":"204:15:4","stateVariable":false,"storageLocation":"default","typeDescriptions":{"typeIdentifier":"t_address","typeString":"address"},"typeName":{"id":986,"name":"address","nodeType":"ElementaryTypeName","src":"204:7:4","stateMutability":"nonpayable","typeDescriptions":{"typeIdentifier":"t_address","typeString":"address"}},"visibility":"internal"},{"constant":false,"id":989,"mutability":"mutable","name":"value","nameLocation":"229:5:4","nodeType":"VariableDeclaration","scope":994,"src":"221:13:4","stateVariable":false,"storageLocation":"default","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"},"typeName":{"id":988,"name":"uint256","nodeType":"ElementaryTypeName","src":"221:7:4","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"}},"visibility":"internal"}],"src":"203:32:4"},"returnParameters":{"id":993,"nodeType":"ParameterList","parameters":[{"constant":false,"id":992,"mutability":"mutable","name":"success","nameLocation":"259:7:4","nodeType":"VariableDeclaration","scope":994,"src":"254:12:4","stateVariable":false,"storageLocation":"default","typeDescriptions":{"typeIdentifier":"t_bool","typeString":"bool"},"typeName":{"id":991,"name":"bool","nodeType":"ElementaryTypeName","src":"254:4:4","typeDescriptions":{"typeIdentifier":"t_bool","typeString":"bool"}},"visibility":"internal"}],"src":"253:14:4"},"scope":1069,"src":"187:81:4","stateMutability":"nonpayable","virtual":false,"visibility":"external"},{"functionSelector":"70a08231","id":1001,"implemented":false,"kind":"function","modifiers":[],"name":"balanceOf","nameLocation":"281:9:4","nodeType":"FunctionDefinition","parameters":{"id":997,"nodeType":"ParameterList","parameters":[{"constant":false,"id":996,"mutability":"mutable","name":"owner","nameLocation":"299:5:4","nodeType":"VariableDeclaration","scope":1001,"src":"291:13:4","stateVariable":false,"storageLocation":"default","typeDescriptions":{"typeIdentifier":"t_address","typeString":"address"},"typeName":{"id":995,"name":"address","nodeType":"ElementaryTypeName","src":"291:7:4","stateMutability":"nonpayable","typeDescriptions":{"typeIdentifier":"t_address","typeString":"address"}},"visibility":"internal"}],"src":"290:15:4"},"returnParameters":{"id":1000,"nodeType":"ParameterList","parameters":[{"constant":false,"id":999,"mutability":"mutable","name":"balance","nameLocation":"337:7:4","nodeType":"VariableDeclaration","scope":1001,"src":"329:15:4","stateVariable":false,"storageLocation":"default","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"},"typeName":{"id":998,"name":"uint256","nodeType":"ElementaryTypeName","src":"329:7:4","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"}},"visibility":"internal"}],"src":"328:17:4"},"scope":1069,"src":"272:74:4","stateMutability":"view","virtual":false,"visibility":"external"},{"functionSelector":"313ce567","id":1006,"implemented":false,"kind":"function","modifiers":[],"name":"decimals","nameLocation":"359:8:4","nodeType":"FunctionDefinition","parameters":{"id":1002,"nodeType":"ParameterList","parameters":[],"src":"367:2:4"},"returnParameters":{"id":1005,"nodeType":"ParameterList","parameters":[{"constant":false,"id":1004,"mutability":"mutable","name":"decimalPlaces","nameLocation":"399:13:4","nodeType":"VariableDeclaration","scope":1006,"src":"393:19:4","stateVariable":false,"storageLocation":"default","typeDescriptions":{"typeIdentifier":"t_uint8","typeString":"uint8"},"typeName":{"id":1003,"name":"uint8","nodeType":"ElementaryTypeName","src":"393:5:4","typeDescriptions":{"typeIdentifier":"t_uint8","typeString":"uint8"}},"visibility":"internal"}],"src":"392:21:4"},"scope":1069,"src":"350:64:4","stateMutability":"view","virtual":false,"visibility":"external"},{"functionSelector":"66188463","id":1015,"implemented":false,"kind":"function","modifiers":[],"name":"decreaseApproval","nameLocation":"427:16:4","nodeType":"FunctionDefinition","parameters":{"id":1011,"nodeType":"ParameterList","parameters":[{"constant":false,"id":1008,"mutability":"mutable","name":"spender","nameLocation":"452:7:4","nodeType":"VariableDeclaration","scope":1015,"src":"444:15:4","stateVariable":false,"storageLocation":"default","typeDescriptions":{"typeIdentifier":"t_address","typeString":"address"},"typeName":{"id":1007,"name":"address","nodeType":"ElementaryTypeName","src":"444:7:4","stateMutability":"nonpayable","typeDescriptions":{"typeIdentifier":"t_address","typeString":"address"}},"visibility":"internal"},{"constant":false,"id":1010,"mutability":"mutable","name":"addedValue","nameLocation":"469:10:4","nodeType":"VariableDeclaration","scope":1015,"src":"461:18:4","stateVariable":false,"storageLocation":"default","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"},"typeName":{"id":1009,"name":"uint256","nodeType":"ElementaryTypeName","src":"461:7:4","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"}},"visibility":"internal"}],"src":"443:37:4"},"returnParameters":{"id":1014,"nodeType":"ParameterList","parameters":[{"constant":false,"id":1013,"mutability":"mutable","name":"success","nameLocation":"504:7:4","nodeType":"VariableDeclaration","scope":1015,"src":"499:12:4","stateVariable":false,"storageLocation":"default","typeDescriptions":{"typeIdentifier":"t_bool","typeString":"bool"},"typeName":{"id":1012,"name":"bool","nodeType":"ElementaryTypeName","src":"499:4:4","typeDescriptions":{"typeIdentifier":"t_bool","typeString":"bool"}},"visibility":"internal"}],"src":"498:14:4"},"scope":1069,"src":"418:95:4","stateMutability":"nonpayable","virtual":false,"visibility":"external"},{"functionSelector":"d73dd623","id":1022,"implemented":false,"kind":"function","modifiers":[],"name":"increaseApproval","nameLocation":"526:16:4","nodeType":"FunctionDefinition","parameters":{"id":1020,"nodeType":"ParameterList","parameters":[{"constant":false,"id":1017,"mutability":"mutable","name":"spender","nameLocation":"551:7:4","nodeType":"VariableDeclaration","scope":1022,"src":"543:15:4","stateVariable":false,"storageLocation":"default","typeDescriptions":{"typeIdentifier":"t_address","typeString":"address"},"typeName":{"id":1016,"name":"address","nodeType":"ElementaryTypeName","src":"543:7:4","stateMutability":"nonpayable","typeDescriptions":{"typeIdentifier":"t_address","typeString":"address"}},"visibility":"internal"},{"constant":false,"id":1019,"mutability":"mutable","name":"subtractedValue","nameLocation":"568:15:4","nodeType":"VariableDeclaration","scope":1022,"src":"560:23:4","stateVariable":false,"storageLocation":"default","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"},"typeName":{"id":1018,"name":"uint256","nodeType":"ElementaryTypeName","src":"560:7:4","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"}},"visibility":"internal"}],"src":"542:42:4"},"returnParameters":{"id":1021,"nodeType":"ParameterList","parameters":[],"src":"593:0:4"},"scope":1069,"src":"517:77:4","stateMutability":"nonpayable","virtual":false,"visibility":"external"},{"functionSelector":"06fdde03","id":1027,"implemented":false,"kind":"function","modifiers":[],"name":"name","nameLocation":"607:4:4","nodeType":"FunctionDefinition","parameters":{"id":1023,"nodeType":"ParameterList","parameters":[],"src":"611:2:4"},"returnParameters":{"id":1026,"nodeType":"ParameterList","parameters":[{"constant":false,"id":1025,"mutability":"mutable","name":"tokenName","nameLocation":"651:9:4","nodeType":"VariableDeclaration","scope":1027,"src":"637:23:4","stateVariable":false,"storageLocation":"memory","typeDescriptions":{"typeIdentifier":"t_string_memory_ptr","typeString":"string"},"typeName":{"id":1024,"name":"string","nodeType":"ElementaryTypeName","src":"637:6:4","typeDescriptions":{"typeIdentifier":"t_string_storage_ptr","typeString":"string"}},"visibility":"internal"}],"src":"636:25:4"},"scope":1069,"src":"598:64:4","stateMutability":"view","virtual":false,"visibility":"external"},{"functionSelector":"95d89b41","id":1032,"implemented":false,"kind":"function","modifiers":[],"name":"symbol","nameLocation":"675:6:4","nodeType":"FunctionDefinition","parameters":{"id":1028,"nodeType":"ParameterList","parameters":[],"src":"681:2:4"},"returnParameters":{"id":1031,"nodeType":"ParameterList","parameters":[{"constant":false,"id":1030,"mutability":"mutable","name":"tokenSymbol","nameLocation":"721:11:4","nodeType":"VariableDeclaration","scope":1032,"src":"707:25:4","stateVariable":false,"storageLocation":"memory","typeDescriptions":{"typeIdentifier":"t_string_memory_ptr","typeString":"string"},"typeName":{"id":1029,"name":"string","nodeType":"ElementaryTypeName","src":"707:6:4","typeDescriptions":{"typeIdentifier":"t_string_storage_ptr","typeString":"string"}},"visibility":"internal"}],"src":"706:27:4"},"scope":1069,"src":"666:68:4","stateMutability":"view","virtual":false,"visibility":"external"},{"functionSelector":"18160ddd","id":1037,"implemented":false,"kind":"function","modifiers":[],"name":"totalSupply","nameLocation":"747:11:4","nodeType":"FunctionDefinition","parameters":{"id":1033,"nodeType":"ParameterList","parameters":[],"src":"758:2:4"},"returnParameters":{"id":1036,"nodeType":"ParameterList","parameters":[{"constant":false,"id":1035,"mutability":"mutable","name":"totalTokensIssued","nameLocation":"792:17:4","nodeType":"VariableDeclaration","scope":1037,"src":"784:25:4","stateVariable":false,"storageLocation":"default","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"},"typeName":{"id":1034,"name":"uint256","nodeType":"ElementaryTypeName","src":"784:7:4","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"}},"visibility":"internal"}],"src":"783:27:4"},"scope":1069,"src":"738:73:4","stateMutability":"view","virtual":false,"visibility":"external"},{"functionSelector":"a9059cbb","id":1046,"implemented":false,"kind":"function","modifiers":[],"name":"transfer","nameLocation":"824:8:4","nodeType":"FunctionDefinition","parameters":{"id":1042,"nodeType":"ParameterList","parameters":[{"constant":false,"id":1039,"mutability":"mutable","name":"to","nameLocation":"841:2:4","nodeType":"VariableDeclaration","scope":1046,"src":"833:10:4","stateVariable":false,"storageLocation":"default","typeDescriptions":{"typeIdentifier":"t_address","typeString":"address"},"typeName":{"id":1038,"name":"address","nodeType":"ElementaryTypeName","src":"833:7:4","stateMutability":"nonpayable","typeDescriptions":{"typeIdentifier":"t_address","typeString":"address"}},"visibility":"internal"},{"constant":false,"id":1041,"mutability":"mutable","name":"value","nameLocation":"853:5:4","nodeType":"VariableDeclaration","scope":1046,"src":"845:13:4","stateVariable":false,"storageLocation":"default","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"},"typeName":{"id":1040,"name":"uint256","nodeType":"ElementaryTypeName","src":"845:7:4","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"}},"visibility":"internal"}],"src":"832:27:4"},"returnParameters":{"id":1045,"nodeType":"ParameterList","parameters":[{"constant":false,"id":1044,"mutability":"mutable","name":"success","nameLocation":"883:7:4","nodeType":"VariableDeclaration","scope":1046,"src":"878:12:4","stateVariable":false,"storageLocation":"default","typeDescriptions":{"typeIdentifier":"t_bool","typeString":"bool"},"typeName":{"id":1043,"name":"bool","nodeType":"ElementaryTypeName","src":"878:4:4","typeDescriptions":{"typeIdentifier":"t_bool","typeString":"bool"}},"visibility":"internal"}],"src":"877:14:4"},"scope":1069,"src":"815:77:4","stateMutability":"nonpayable","virtual":false,"visibility":"external"},{"functionSelector":"4000aea0","id":1057,"implemented":false,"kind":"function","modifiers":[],"name":"transferAndCall","nameLocation":"905:15:4","nodeType":"FunctionDefinition","parameters":{"id":1053,"nodeType":"ParameterList","parameters":[{"constant":false,"id":1048,"mutability":"mutable","name":"to","nameLocation":"934:2:4","nodeType":"VariableDeclaration","scope":1057,"src":"926:10:4","stateVariable":false,"storageLocation":"default","typeDescriptions":{"typeIdentifier":"t_address","typeString":"address"},"typeName":{"id":1047,"name":"address","nodeType":"ElementaryTypeName","src":"926:7:4","stateMutability":"nonpayable","typeDescriptions":{"typeIdentifier":"t_address","typeString":"address"}},"visibility":"internal"},{"constant":false,"id":1050,"mutability":"mutable","name":"value","nameLocation":"950:5:4","nodeType":"VariableDeclaration","scope":1057,"src":"942:13:4","stateVariable":false,"storageLocation":"default","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"},"typeName":{"id":1049,"name":"uint256","nodeType":"ElementaryTypeName","src":"942:7:4","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"}},"visibility":"internal"},{"constant":false,"id":1052,"mutability":"mutable","name":"data","nameLocation":"976:4:4","nodeType":"VariableDeclaration","scope":1057,"src":"961:19:4","stateVariable":false,"storageLocation":"calldata","typeDescriptions":{"typeIdentifier":"t_bytes_calldata_ptr","typeString":"bytes"},"typeName":{"id":1051,"name":"bytes","nodeType":"ElementaryTypeName","src":"961:5:4","typeDescriptions":{"typeIdentifier":"t_bytes_storage_ptr","typeString":"bytes"}},"visibility":"internal"}],"src":"920:64:4"},"returnParameters":{"id":1056,"nodeType":"ParameterList","parameters":[{"constant":false,"id":1055,"mutability":"mutable","name":"success","nameLocation":"1008:7:4","nodeType":"VariableDeclaration","scope":1057,"src":"1003:12:4","stateVariable":false,"storageLocation":"default","typeDescriptions":{"typeIdentifier":"t_bool","typeString":"bool"},"typeName":{"id":1054,"name":"bool","nodeType":"ElementaryTypeName","src":"1003:4:4","typeDescriptions":{"typeIdentifier":"t_bool","typeString":"bool"}},"visibility":"internal"}],"src":"1002:14:4"},"scope":1069,"src":"896:121:4","stateMutability":"nonpayable","virtual":false,"visibility":"external"},{"functionSelector":"23b872dd","id":1068,"implemented":false,"kind":"function","modifiers":[],"name":"transferFrom","nameLocation":"1030:12:4","nodeType":"FunctionDefinition","parameters":{"id":1064,"nodeType":"ParameterList","parameters":[{"constant":false,"id":1059,"mutability":"mutable","name":"from","nameLocation":"1056:4:4","nodeType":"VariableDeclaration","scope":1068,"src":"1048:12:4","stateVariable":false,"storageLocation":"default","typeDescriptions":{"typeIdentifier":"t_address","typeString":"address"},"typeName":{"id":1058,"name":"address","nodeType":"ElementaryTypeName","src":"1048:7:4","stateMutability":"nonpayable","typeDescriptions":{"typeIdentifier":"t_address","typeString":"address"}},"visibility":"internal"},{"constant":false,"id":1061,"mutability":"mutable","name":"to","nameLocation":"1074:2:4","nodeType":"VariableDeclaration","scope":1068,"src":"1066:10:4","stateVariable":false,"storageLocation":"default","typeDescriptions":{"typeIdentifier":"t_address","typeString":"address"},"typeName":{"id":1060,"name":"address","nodeType":"ElementaryTypeName","src":"1066:7:4","stateMutability":"nonpayable","typeDescriptions":{"typeIdentifier":"t_address","typeString":"address"}},"visibility":"internal"},{"constant":false,"id":1063,"mutability":"mutable","name":"value","nameLocation":"1090:5:4","nodeType":"VariableDeclaration","scope":1068,"src":"1082:13:4","stateVariable":false,"storageLocation":"default","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"},"typeName":{"id":1062,"name":"uint256","nodeType":"ElementaryTypeName","src":"1082:7:4","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"}},"visibility":"internal"}],"src":"1042:57:4"},"returnParameters":{"id":1067,"nodeType":"ParameterList","parameters":[{"constant":false,"id":1066,"mutability":"mutable","name":"success","nameLocation":"1123:7:4","nodeType":"VariableDeclaration","scope":1068,"src":"1118:12:4","stateVariable":false,"storageLocation":"default","typeDescriptions":{"typeIdentifier":"t_bool","typeString":"bool"},"typeName":{"id":1065,"name":"bool","nodeType":"ElementaryTypeName","src":"1118:4:4","typeDescriptions":{"typeIdentifier":"t_bool","typeString":"bool"}},"visibility":"internal"}],"src":"1117:14:4"},"scope":1069,"src":"1021:111:4","stateMutability":"nonpayable","virtual":false,"visibility":"external"}],"scope":1070,"src":"57:1077:4","usedErrors":[]}],"src":"32:1103:4"},"id":4},"@chainlink/contracts/src/v0.8/interfaces/OperatorInterface.sol":{"ast":{"absolutePath":"@chainlink/contracts/src/v0.8/interfaces/OperatorInterface.sol","exportedSymbols":{"ChainlinkRequestInterface":[894],"OperatorInterface":[1149],"OracleInterface":[1188]},"id":1150,"license":"MIT","nodeType":"SourceUnit","nodes":[{"id":1071,"literals":["solidity","^","0.8",".0"],"nodeType":"PragmaDirective","src":"32:23:5"},{"absolutePath":"@chainlink/contracts/src/v0.8/interfaces/OracleInterface.sol","file":"./OracleInterface.sol","id":1072,"nameLocation":"-1:-1:-1","nodeType":"ImportDirective","scope":1150,"sourceUnit":1189,"src":"57:31:5","symbolAliases":[],"unitAlias":""},{"absolutePath":"@chainlink/contracts/src/v0.8/interfaces/ChainlinkRequestInterface.sol","file":"./ChainlinkRequestInterface.sol","id":1073,"nameLocation":"-1:-1:-1","nodeType":"ImportDirective","scope":1150,"sourceUnit":895,"src":"89:41:5","symbolAliases":[],"unitAlias":""},{"abstract":false,"baseContracts":[{"baseName":{"id":1074,"name":"OracleInterface","nodeType":"IdentifierPath","referencedDeclaration":1188,"src":"163:15:5"},"id":1075,"nodeType":"InheritanceSpecifier","src":"163:15:5"},{"baseName":{"id":1076,"name":"ChainlinkRequestInterface","nodeType":"IdentifierPath","referencedDeclaration":894,"src":"180:25:5"},"id":1077,"nodeType":"InheritanceSpecifier","src":"180:25:5"}],"canonicalName":"OperatorInterface","contractDependencies":[],"contractKind":"interface","fullyImplemented":false,"id":1149,"linearizedBaseContracts":[1149,894,1188],"name":"OperatorInterface","nameLocation":"142:17:5","nodeType":"ContractDefinition","nodes":[{"functionSelector":"3c6d41b9","id":1094,"implemented":false,"kind":"function","modifiers":[],"name":"operatorRequest","nameLocation":"219:15:5","nodeType":"FunctionDefinition","parameters":{"id":1092,"nodeType":"ParameterList","parameters":[{"constant":false,"id":1079,"mutability":"mutable","name":"sender","nameLocation":"248:6:5","nodeType":"VariableDeclaration","scope":1094,"src":"240:14:5","stateVariable":false,"storageLocation":"default","typeDescriptions":{"typeIdentifier":"t_address","typeString":"address"},"typeName":{"id":1078,"name":"address","nodeType":"ElementaryTypeName","src":"240:7:5","stateMutability":"nonpayable","typeDescriptions":{"typeIdentifier":"t_address","typeString":"address"}},"visibility":"internal"},{"constant":false,"id":1081,"mutability":"mutable","name":"payment","nameLocation":"268:7:5","nodeType":"VariableDeclaration","scope":1094,"src":"260:15:5","stateVariable":false,"storageLocation":"default","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"},"typeName":{"id":1080,"name":"uint256","nodeType":"ElementaryTypeName","src":"260:7:5","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"}},"visibility":"internal"},{"constant":false,"id":1083,"mutability":"mutable","name":"specId","nameLocation":"289:6:5","nodeType":"VariableDeclaration","scope":1094,"src":"281:14:5","stateVariable":false,"storageLocation":"default","typeDescriptions":{"typeIdentifier":"t_bytes32","typeString":"bytes32"},"typeName":{"id":1082,"name":"bytes32","nodeType":"ElementaryTypeName","src":"281:7:5","typeDescriptions":{"typeIdentifier":"t_bytes32","typeString":"bytes32"}},"visibility":"internal"},{"constant":false,"id":1085,"mutability":"mutable","name":"callbackFunctionId","nameLocation":"308:18:5","nodeType":"VariableDeclaration","scope":1094,"src":"301:25:5","stateVariable":false,"storageLocation":"default","typeDescriptions":{"typeIdentifier":"t_bytes4","typeString":"bytes4"},"typeName":{"id":1084,"name":"bytes4","nodeType":"ElementaryTypeName","src":"301:6:5","typeDescriptions":{"typeIdentifier":"t_bytes4","typeString":"bytes4"}},"visibility":"internal"},{"constant":false,"id":1087,"mutability":"mutable","name":"nonce","nameLocation":"340:5:5","nodeType":"VariableDeclaration","scope":1094,"src":"332:13:5","stateVariable":false,"storageLocation":"default","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"},"typeName":{"id":1086,"name":"uint256","nodeType":"ElementaryTypeName","src":"332:7:5","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"}},"visibility":"internal"},{"constant":false,"id":1089,"mutability":"mutable","name":"dataVersion","nameLocation":"359:11:5","nodeType":"VariableDeclaration","scope":1094,"src":"351:19:5","stateVariable":false,"storageLocation":"default","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"},"typeName":{"id":1088,"name":"uint256","nodeType":"ElementaryTypeName","src":"351:7:5","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"}},"visibility":"internal"},{"constant":false,"id":1091,"mutability":"mutable","name":"data","nameLocation":"391:4:5","nodeType":"VariableDeclaration","scope":1094,"src":"376:19:5","stateVariable":false,"storageLocation":"calldata","typeDescriptions":{"typeIdentifier":"t_bytes_calldata_ptr","typeString":"bytes"},"typeName":{"id":1090,"name":"bytes","nodeType":"ElementaryTypeName","src":"376:5:5","typeDescriptions":{"typeIdentifier":"t_bytes_storage_ptr","typeString":"bytes"}},"visibility":"internal"}],"src":"234:165:5"},"returnParameters":{"id":1093,"nodeType":"ParameterList","parameters":[],"src":"408:0:5"},"scope":1149,"src":"210:199:5","stateMutability":"nonpayable","virtual":false,"visibility":"external"},{"functionSelector":"6ae0bc76","id":1111,"implemented":false,"kind":"function","modifiers":[],"name":"fulfillOracleRequest2","nameLocation":"422:21:5","nodeType":"FunctionDefinition","parameters":{"id":1107,"nodeType":"ParameterList","parameters":[{"constant":false,"id":1096,"mutability":"mutable","name":"requestId","nameLocation":"457:9:5","nodeType":"VariableDeclaration","scope":1111,"src":"449:17:5","stateVariable":false,"storageLocation":"default","typeDescriptions":{"typeIdentifier":"t_bytes32","typeString":"bytes32"},"typeName":{"id":1095,"name":"bytes32","nodeType":"ElementaryTypeName","src":"449:7:5","typeDescriptions":{"typeIdentifier":"t_bytes32","typeString":"bytes32"}},"visibility":"internal"},{"constant":false,"id":1098,"mutability":"mutable","name":"payment","nameLocation":"480:7:5","nodeType":"VariableDeclaration","scope":1111,"src":"472:15:5","stateVariable":false,"storageLocation":"default","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"},"typeName":{"id":1097,"name":"uint256","nodeType":"ElementaryTypeName","src":"472:7:5","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"}},"visibility":"internal"},{"constant":false,"id":1100,"mutability":"mutable","name":"callbackAddress","nameLocation":"501:15:5","nodeType":"VariableDeclaration","scope":1111,"src":"493:23:5","stateVariable":false,"storageLocation":"default","typeDescriptions":{"typeIdentifier":"t_address","typeString":"address"},"typeName":{"id":1099,"name":"address","nodeType":"ElementaryTypeName","src":"493:7:5","stateMutability":"nonpayable","typeDescriptions":{"typeIdentifier":"t_address","typeString":"address"}},"visibility":"internal"},{"constant":false,"id":1102,"mutability":"mutable","name":"callbackFunctionId","nameLocation":"529:18:5","nodeType":"VariableDeclaration","scope":1111,"src":"522:25:5","stateVariable":false,"storageLocation":"default","typeDescriptions":{"typeIdentifier":"t_bytes4","typeString":"bytes4"},"typeName":{"id":1101,"name":"bytes4","nodeType":"ElementaryTypeName","src":"522:6:5","typeDescriptions":{"typeIdentifier":"t_bytes4","typeString":"bytes4"}},"visibility":"internal"},{"constant":false,"id":1104,"mutability":"mutable","name":"expiration","nameLocation":"561:10:5","nodeType":"VariableDeclaration","scope":1111,"src":"553:18:5","stateVariable":false,"storageLocation":"default","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"},"typeName":{"id":1103,"name":"uint256","nodeType":"ElementaryTypeName","src":"553:7:5","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"}},"visibility":"internal"},{"constant":false,"id":1106,"mutability":"mutable","name":"data","nameLocation":"592:4:5","nodeType":"VariableDeclaration","scope":1111,"src":"577:19:5","stateVariable":false,"storageLocation":"calldata","typeDescriptions":{"typeIdentifier":"t_bytes_calldata_ptr","typeString":"bytes"},"typeName":{"id":1105,"name":"bytes","nodeType":"ElementaryTypeName","src":"577:5:5","typeDescriptions":{"typeIdentifier":"t_bytes_storage_ptr","typeString":"bytes"}},"visibility":"internal"}],"src":"443:157:5"},"returnParameters":{"id":1110,"nodeType":"ParameterList","parameters":[{"constant":false,"id":1109,"mutability":"mutable","name":"","nameLocation":"-1:-1:-1","nodeType":"VariableDeclaration","scope":1111,"src":"619:4:5","stateVariable":false,"storageLocation":"default","typeDescriptions":{"typeIdentifier":"t_bool","typeString":"bool"},"typeName":{"id":1108,"name":"bool","nodeType":"ElementaryTypeName","src":"619:4:5","typeDescriptions":{"typeIdentifier":"t_bool","typeString":"bool"}},"visibility":"internal"}],"src":"618:6:5"},"scope":1149,"src":"413:212:5","stateMutability":"nonpayable","virtual":false,"visibility":"external"},{"functionSelector":"902fc370","id":1122,"implemented":false,"kind":"function","modifiers":[],"name":"ownerTransferAndCall","nameLocation":"638:20:5","nodeType":"FunctionDefinition","parameters":{"id":1118,"nodeType":"ParameterList","parameters":[{"constant":false,"id":1113,"mutability":"mutable","name":"to","nameLocation":"672:2:5","nodeType":"VariableDeclaration","scope":1122,"src":"664:10:5","stateVariable":false,"storageLocation":"default","typeDescriptions":{"typeIdentifier":"t_address","typeString":"address"},"typeName":{"id":1112,"name":"address","nodeType":"ElementaryTypeName","src":"664:7:5","stateMutability":"nonpayable","typeDescriptions":{"typeIdentifier":"t_address","typeString":"address"}},"visibility":"internal"},{"constant":false,"id":1115,"mutability":"mutable","name":"value","nameLocation":"688:5:5","nodeType":"VariableDeclaration","scope":1122,"src":"680:13:5","stateVariable":false,"storageLocation":"default","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"},"typeName":{"id":1114,"name":"uint256","nodeType":"ElementaryTypeName","src":"680:7:5","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"}},"visibility":"internal"},{"constant":false,"id":1117,"mutability":"mutable","name":"data","nameLocation":"714:4:5","nodeType":"VariableDeclaration","scope":1122,"src":"699:19:5","stateVariable":false,"storageLocation":"calldata","typeDescriptions":{"typeIdentifier":"t_bytes_calldata_ptr","typeString":"bytes"},"typeName":{"id":1116,"name":"bytes","nodeType":"ElementaryTypeName","src":"699:5:5","typeDescriptions":{"typeIdentifier":"t_bytes_storage_ptr","typeString":"bytes"}},"visibility":"internal"}],"src":"658:64:5"},"returnParameters":{"id":1121,"nodeType":"ParameterList","parameters":[{"constant":false,"id":1120,"mutability":"mutable","name":"success","nameLocation":"746:7:5","nodeType":"VariableDeclaration","scope":1122,"src":"741:12:5","stateVariable":false,"storageLocation":"default","typeDescriptions":{"typeIdentifier":"t_bool","typeString":"bool"},"typeName":{"id":1119,"name":"bool","nodeType":"ElementaryTypeName","src":"741:4:5","typeDescriptions":{"typeIdentifier":"t_bool","typeString":"bool"}},"visibility":"internal"}],"src":"740:14:5"},"scope":1149,"src":"629:126:5","stateMutability":"nonpayable","virtual":false,"visibility":"external"},{"functionSelector":"6bd59ec0","id":1131,"implemented":false,"kind":"function","modifiers":[],"name":"distributeFunds","nameLocation":"768:15:5","nodeType":"FunctionDefinition","parameters":{"id":1129,"nodeType":"ParameterList","parameters":[{"constant":false,"id":1125,"mutability":"mutable","name":"receivers","nameLocation":"811:9:5","nodeType":"VariableDeclaration","scope":1131,"src":"784:36:5","stateVariable":false,"storageLocation":"calldata","typeDescriptions":{"typeIdentifier":"t_array$_t_address_payable_$dyn_calldata_ptr","typeString":"address payable[]"},"typeName":{"baseType":{"id":1123,"name":"address","nodeType":"ElementaryTypeName","src":"784:15:5","stateMutability":"payable","typeDescriptions":{"typeIdentifier":"t_address_payable","typeString":"address payable"}},"id":1124,"nodeType":"ArrayTypeName","src":"784:17:5","typeDescriptions":{"typeIdentifier":"t_array$_t_address_payable_$dyn_storage_ptr","typeString":"address payable[]"}},"visibility":"internal"},{"constant":false,"id":1128,"mutability":"mutable","name":"amounts","nameLocation":"841:7:5","nodeType":"VariableDeclaration","scope":1131,"src":"822:26:5","stateVariable":false,"storageLocation":"calldata","typeDescriptions":{"typeIdentifier":"t_array$_t_uint256_$dyn_calldata_ptr","typeString":"uint256[]"},"typeName":{"baseType":{"id":1126,"name":"uint256","nodeType":"ElementaryTypeName","src":"822:7:5","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"}},"id":1127,"nodeType":"ArrayTypeName","src":"822:9:5","typeDescriptions":{"typeIdentifier":"t_array$_t_uint256_$dyn_storage_ptr","typeString":"uint256[]"}},"visibility":"internal"}],"src":"783:66:5"},"returnParameters":{"id":1130,"nodeType":"ParameterList","parameters":[],"src":"866:0:5"},"scope":1149,"src":"759:108:5","stateMutability":"payable","virtual":false,"visibility":"external"},{"functionSelector":"2408afaa","id":1137,"implemented":false,"kind":"function","modifiers":[],"name":"getAuthorizedSenders","nameLocation":"880:20:5","nodeType":"FunctionDefinition","parameters":{"id":1132,"nodeType":"ParameterList","parameters":[],"src":"900:2:5"},"returnParameters":{"id":1136,"nodeType":"ParameterList","parameters":[{"constant":false,"id":1135,"mutability":"mutable","name":"","nameLocation":"-1:-1:-1","nodeType":"VariableDeclaration","scope":1137,"src":"921:16:5","stateVariable":false,"storageLocation":"memory","typeDescriptions":{"typeIdentifier":"t_array$_t_address_$dyn_memory_ptr","typeString":"address[]"},"typeName":{"baseType":{"id":1133,"name":"address","nodeType":"ElementaryTypeName","src":"921:7:5","stateMutability":"nonpayable","typeDescriptions":{"typeIdentifier":"t_address","typeString":"address"}},"id":1134,"nodeType":"ArrayTypeName","src":"921:9:5","typeDescriptions":{"typeIdentifier":"t_array$_t_address_$dyn_storage_ptr","typeString":"address[]"}},"visibility":"internal"}],"src":"920:18:5"},"scope":1149,"src":"871:68:5","stateMutability":"nonpayable","virtual":false,"visibility":"external"},{"functionSelector":"ee56997b","id":1143,"implemented":false,"kind":"function","modifiers":[],"name":"setAuthorizedSenders","nameLocation":"952:20:5","nodeType":"FunctionDefinition","parameters":{"id":1141,"nodeType":"ParameterList","parameters":[{"constant":false,"id":1140,"mutability":"mutable","name":"senders","nameLocation":"992:7:5","nodeType":"VariableDeclaration","scope":1143,"src":"973:26:5","stateVariable":false,"storageLocation":"calldata","typeDescriptions":{"typeIdentifier":"t_array$_t_address_$dyn_calldata_ptr","typeString":"address[]"},"typeName":{"baseType":{"id":1138,"name":"address","nodeType":"ElementaryTypeName","src":"973:7:5","stateMutability":"nonpayable","typeDescriptions":{"typeIdentifier":"t_address","typeString":"address"}},"id":1139,"nodeType":"ArrayTypeName","src":"973:9:5","typeDescriptions":{"typeIdentifier":"t_array$_t_address_$dyn_storage_ptr","typeString":"address[]"}},"visibility":"internal"}],"src":"972:28:5"},"returnParameters":{"id":1142,"nodeType":"ParameterList","parameters":[],"src":"1009:0:5"},"scope":1149,"src":"943:67:5","stateMutability":"nonpayable","virtual":false,"visibility":"external"},{"functionSelector":"a0042526","id":1148,"implemented":false,"kind":"function","modifiers":[],"name":"getForwarder","nameLocation":"1023:12:5","nodeType":"FunctionDefinition","parameters":{"id":1144,"nodeType":"ParameterList","parameters":[],"src":"1035:2:5"},"returnParameters":{"id":1147,"nodeType":"ParameterList","parameters":[{"constant":false,"id":1146,"mutability":"mutable","name":"","nameLocation":"-1:-1:-1","nodeType":"VariableDeclaration","scope":1148,"src":"1056:7:5","stateVariable":false,"storageLocation":"default","typeDescriptions":{"typeIdentifier":"t_address","typeString":"address"},"typeName":{"id":1145,"name":"address","nodeType":"ElementaryTypeName","src":"1056:7:5","stateMutability":"nonpayable","typeDescriptions":{"typeIdentifier":"t_address","typeString":"address"}},"visibility":"internal"}],"src":"1055:9:5"},"scope":1149,"src":"1014:51:5","stateMutability":"nonpayable","virtual":false,"visibility":"external"}],"scope":1150,"src":"132:935:5","usedErrors":[]}],"src":"32:1036:5"},"id":5},"@chainlink/contracts/src/v0.8/interfaces/OracleInterface.sol":{"ast":{"absolutePath":"@chainlink/contracts/src/v0.8/interfaces/OracleInterface.sol","exportedSymbols":{"OracleInterface":[1188]},"id":1189,"license":"MIT","nodeType":"SourceUnit","nodes":[{"id":1151,"literals":["solidity","^","0.8",".0"],"nodeType":"PragmaDirective","src":"32:23:6"},{"abstract":false,"baseContracts":[],"canonicalName":"OracleInterface","contractDependencies":[],"contractKind":"interface","fullyImplemented":false,"id":1188,"linearizedBaseContracts":[1188],"name":"OracleInterface","nameLocation":"67:15:6","nodeType":"ContractDefinition","nodes":[{"functionSelector":"4ab0d190","id":1168,"implemented":false,"kind":"function","modifiers":[],"name":"fulfillOracleRequest","nameLocation":"96:20:6","nodeType":"FunctionDefinition","parameters":{"id":1164,"nodeType":"ParameterList","parameters":[{"constant":false,"id":1153,"mutability":"mutable","name":"requestId","nameLocation":"130:9:6","nodeType":"VariableDeclaration","scope":1168,"src":"122:17:6","stateVariable":false,"storageLocation":"default","typeDescriptions":{"typeIdentifier":"t_bytes32","typeString":"bytes32"},"typeName":{"id":1152,"name":"bytes32","nodeType":"ElementaryTypeName","src":"122:7:6","typeDescriptions":{"typeIdentifier":"t_bytes32","typeString":"bytes32"}},"visibility":"internal"},{"constant":false,"id":1155,"mutability":"mutable","name":"payment","nameLocation":"153:7:6","nodeType":"VariableDeclaration","scope":1168,"src":"145:15:6","stateVariable":false,"storageLocation":"default","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"},"typeName":{"id":1154,"name":"uint256","nodeType":"ElementaryTypeName","src":"145:7:6","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"}},"visibility":"internal"},{"constant":false,"id":1157,"mutability":"mutable","name":"callbackAddress","nameLocation":"174:15:6","nodeType":"VariableDeclaration","scope":1168,"src":"166:23:6","stateVariable":false,"storageLocation":"default","typeDescriptions":{"typeIdentifier":"t_address","typeString":"address"},"typeName":{"id":1156,"name":"address","nodeType":"ElementaryTypeName","src":"166:7:6","stateMutability":"nonpayable","typeDescriptions":{"typeIdentifier":"t_address","typeString":"address"}},"visibility":"internal"},{"constant":false,"id":1159,"mutability":"mutable","name":"callbackFunctionId","nameLocation":"202:18:6","nodeType":"VariableDeclaration","scope":1168,"src":"195:25:6","stateVariable":false,"storageLocation":"default","typeDescriptions":{"typeIdentifier":"t_bytes4","typeString":"bytes4"},"typeName":{"id":1158,"name":"bytes4","nodeType":"ElementaryTypeName","src":"195:6:6","typeDescriptions":{"typeIdentifier":"t_bytes4","typeString":"bytes4"}},"visibility":"internal"},{"constant":false,"id":1161,"mutability":"mutable","name":"expiration","nameLocation":"234:10:6","nodeType":"VariableDeclaration","scope":1168,"src":"226:18:6","stateVariable":false,"storageLocation":"default","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"},"typeName":{"id":1160,"name":"uint256","nodeType":"ElementaryTypeName","src":"226:7:6","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"}},"visibility":"internal"},{"constant":false,"id":1163,"mutability":"mutable","name":"data","nameLocation":"258:4:6","nodeType":"VariableDeclaration","scope":1168,"src":"250:12:6","stateVariable":false,"storageLocation":"default","typeDescriptions":{"typeIdentifier":"t_bytes32","typeString":"bytes32"},"typeName":{"id":1162,"name":"bytes32","nodeType":"ElementaryTypeName","src":"250:7:6","typeDescriptions":{"typeIdentifier":"t_bytes32","typeString":"bytes32"}},"visibility":"internal"}],"src":"116:150:6"},"returnParameters":{"id":1167,"nodeType":"ParameterList","parameters":[{"constant":false,"id":1166,"mutability":"mutable","name":"","nameLocation":"-1:-1:-1","nodeType":"VariableDeclaration","scope":1168,"src":"285:4:6","stateVariable":false,"storageLocation":"default","typeDescriptions":{"typeIdentifier":"t_bool","typeString":"bool"},"typeName":{"id":1165,"name":"bool","nodeType":"ElementaryTypeName","src":"285:4:6","typeDescriptions":{"typeIdentifier":"t_bool","typeString":"bool"}},"visibility":"internal"}],"src":"284:6:6"},"scope":1188,"src":"87:204:6","stateMutability":"nonpayable","virtual":false,"visibility":"external"},{"functionSelector":"fa00763a","id":1175,"implemented":false,"kind":"function","modifiers":[],"name":"isAuthorizedSender","nameLocation":"304:18:6","nodeType":"FunctionDefinition","parameters":{"id":1171,"nodeType":"ParameterList","parameters":[{"constant":false,"id":1170,"mutability":"mutable","name":"node","nameLocation":"331:4:6","nodeType":"VariableDeclaration","scope":1175,"src":"323:12:6","stateVariable":false,"storageLocation":"default","typeDescriptions":{"typeIdentifier":"t_address","typeString":"address"},"typeName":{"id":1169,"name":"address","nodeType":"ElementaryTypeName","src":"323:7:6","stateMutability":"nonpayable","typeDescriptions":{"typeIdentifier":"t_address","typeString":"address"}},"visibility":"internal"}],"src":"322:14:6"},"returnParameters":{"id":1174,"nodeType":"ParameterList","parameters":[{"constant":false,"id":1173,"mutability":"mutable","name":"","nameLocation":"-1:-1:-1","nodeType":"VariableDeclaration","scope":1175,"src":"360:4:6","stateVariable":false,"storageLocation":"default","typeDescriptions":{"typeIdentifier":"t_bool","typeString":"bool"},"typeName":{"id":1172,"name":"bool","nodeType":"ElementaryTypeName","src":"360:4:6","typeDescriptions":{"typeIdentifier":"t_bool","typeString":"bool"}},"visibility":"internal"}],"src":"359:6:6"},"scope":1188,"src":"295:71:6","stateMutability":"view","virtual":false,"visibility":"external"},{"functionSelector":"f3fef3a3","id":1182,"implemented":false,"kind":"function","modifiers":[],"name":"withdraw","nameLocation":"379:8:6","nodeType":"FunctionDefinition","parameters":{"id":1180,"nodeType":"ParameterList","parameters":[{"constant":false,"id":1177,"mutability":"mutable","name":"recipient","nameLocation":"396:9:6","nodeType":"VariableDeclaration","scope":1182,"src":"388:17:6","stateVariable":false,"storageLocation":"default","typeDescriptions":{"typeIdentifier":"t_address","typeString":"address"},"typeName":{"id":1176,"name":"address","nodeType":"ElementaryTypeName","src":"388:7:6","stateMutability":"nonpayable","typeDescriptions":{"typeIdentifier":"t_address","typeString":"address"}},"visibility":"internal"},{"constant":false,"id":1179,"mutability":"mutable","name":"amount","nameLocation":"415:6:6","nodeType":"VariableDeclaration","scope":1182,"src":"407:14:6","stateVariable":false,"storageLocation":"default","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"},"typeName":{"id":1178,"name":"uint256","nodeType":"ElementaryTypeName","src":"407:7:6","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"}},"visibility":"internal"}],"src":"387:35:6"},"returnParameters":{"id":1181,"nodeType":"ParameterList","parameters":[],"src":"431:0:6"},"scope":1188,"src":"370:62:6","stateMutability":"nonpayable","virtual":false,"visibility":"external"},{"functionSelector":"50188301","id":1187,"implemented":false,"kind":"function","modifiers":[],"name":"withdrawable","nameLocation":"445:12:6","nodeType":"FunctionDefinition","parameters":{"id":1183,"nodeType":"ParameterList","parameters":[],"src":"457:2:6"},"returnParameters":{"id":1186,"nodeType":"ParameterList","parameters":[{"constant":false,"id":1185,"mutability":"mutable","name":"","nameLocation":"-1:-1:-1","nodeType":"VariableDeclaration","scope":1187,"src":"483:7:6","stateVariable":false,"storageLocation":"default","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"},"typeName":{"id":1184,"name":"uint256","nodeType":"ElementaryTypeName","src":"483:7:6","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"}},"visibility":"internal"}],"src":"482:9:6"},"scope":1188,"src":"436:56:6","stateMutability":"view","virtual":false,"visibility":"external"}],"scope":1189,"src":"57:437:6","usedErrors":[]}],"src":"32:463:6"},"id":6},"@chainlink/contracts/src/v0.8/interfaces/PointerInterface.sol":{"ast":{"absolutePath":"@chainlink/contracts/src/v0.8/interfaces/PointerInterface.sol","exportedSymbols":{"PointerInterface":[1196]},"id":1197,"license":"MIT","nodeType":"SourceUnit","nodes":[{"id":1190,"literals":["solidity","^","0.8",".0"],"nodeType":"PragmaDirective","src":"32:23:7"},{"abstract":false,"baseContracts":[],"canonicalName":"PointerInterface","contractDependencies":[],"contractKind":"interface","fullyImplemented":false,"id":1196,"linearizedBaseContracts":[1196],"name":"PointerInterface","nameLocation":"67:16:7","nodeType":"ContractDefinition","nodes":[{"functionSelector":"38cc4831","id":1195,"implemented":false,"kind":"function","modifiers":[],"name":"getAddress","nameLocation":"97:10:7","nodeType":"FunctionDefinition","parameters":{"id":1191,"nodeType":"ParameterList","parameters":[],"src":"107:2:7"},"returnParameters":{"id":1194,"nodeType":"ParameterList","parameters":[{"constant":false,"id":1193,"mutability":"mutable","name":"","nameLocation":"-1:-1:-1","nodeType":"VariableDeclaration","scope":1195,"src":"133:7:7","stateVariable":false,"storageLocation":"default","typeDescriptions":{"typeIdentifier":"t_address","typeString":"address"},"typeName":{"id":1192,"name":"address","nodeType":"ElementaryTypeName","src":"133:7:7","stateMutability":"nonpayable","typeDescriptions":{"typeIdentifier":"t_address","typeString":"address"}},"visibility":"internal"}],"src":"132:9:7"},"scope":1196,"src":"88:54:7","stateMutability":"view","virtual":false,"visibility":"external"}],"scope":1197,"src":"57:87:7","usedErrors":[]}],"src":"32:113:7"},"id":7},"@chainlink/contracts/src/v0.8/vendor/BufferChainlink.sol":{"ast":{"absolutePath":"@chainlink/contracts/src/v0.8/vendor/BufferChainlink.sol","exportedSymbols":{"BufferChainlink":[1718]},"id":1719,"license":"MIT","nodeType":"SourceUnit","nodes":[{"id":1198,"literals":["solidity","^","0.8",".0"],"nodeType":"PragmaDirective","src":"32:23:8"},{"abstract":false,"baseContracts":[],"canonicalName":"BufferChainlink","contractDependencies":[],"contractKind":"library","documentation":{"id":1199,"nodeType":"StructuredDocumentation","src":"57:383:8","text":" @dev A library for working with mutable byte buffers in Solidity.\n Byte buffers are mutable and expandable, and provide a variety of primitives\n for writing to them. At any time you can fetch a bytes object containing the\n current contents of the buffer. The bytes object should not be stored between\n operations, as it may change due to resizing of the buffer."},"fullyImplemented":true,"id":1718,"linearizedBaseContracts":[1718],"name":"BufferChainlink","nameLocation":"449:15:8","nodeType":"ContractDefinition","nodes":[{"canonicalName":"BufferChainlink.buffer","id":1204,"members":[{"constant":false,"id":1201,"mutability":"mutable","name":"buf","nameLocation":"743:3:8","nodeType":"VariableDeclaration","scope":1204,"src":"737:9:8","stateVariable":false,"storageLocation":"default","typeDescriptions":{"typeIdentifier":"t_bytes_storage_ptr","typeString":"bytes"},"typeName":{"id":1200,"name":"bytes","nodeType":"ElementaryTypeName","src":"737:5:8","typeDescriptions":{"typeIdentifier":"t_bytes_storage_ptr","typeString":"bytes"}},"visibility":"internal"},{"constant":false,"id":1203,"mutability":"mutable","name":"capacity","nameLocation":"760:8:8","nodeType":"VariableDeclaration","scope":1204,"src":"752:16:8","stateVariable":false,"storageLocation":"default","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"},"typeName":{"id":1202,"name":"uint256","nodeType":"ElementaryTypeName","src":"752:7:8","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"}},"visibility":"internal"}],"name":"buffer","nameLocation":"724:6:8","nodeType":"StructDefinition","scope":1718,"src":"717:56:8","visibility":"public"},{"body":{"id":1241,"nodeType":"Block","src":"1090:310:8","statements":[{"condition":{"commonType":{"typeIdentifier":"t_uint256","typeString":"uint256"},"id":1220,"isConstant":false,"isLValue":false,"isPure":false,"lValueRequested":false,"leftExpression":{"commonType":{"typeIdentifier":"t_uint256","typeString":"uint256"},"id":1218,"isConstant":false,"isLValue":false,"isPure":false,"lValueRequested":false,"leftExpression":{"id":1216,"name":"capacity","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":1210,"src":"1100:8:8","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"}},"nodeType":"BinaryOperation","operator":"%","rightExpression":{"hexValue":"3332","id":1217,"isConstant":false,"isLValue":false,"isPure":true,"kind":"number","lValueRequested":false,"nodeType":"Literal","src":"1111:2:8","typeDescriptions":{"typeIdentifier":"t_rational_32_by_1","typeString":"int_const 32"},"value":"32"},"src":"1100:13:8","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"}},"nodeType":"BinaryOperation","operator":"!=","rightExpression":{"hexValue":"30","id":1219,"isConstant":false,"isLValue":false,"isPure":true,"kind":"number","lValueRequested":false,"nodeType":"Literal","src":"1117:1:8","typeDescriptions":{"typeIdentifier":"t_rational_0_by_1","typeString":"int_const 0"},"value":"0"},"src":"1100:18:8","typeDescriptions":{"typeIdentifier":"t_bool","typeString":"bool"}},"id":1231,"nodeType":"IfStatement","src":"1096:71:8","trueBody":{"id":1230,"nodeType":"Block","src":"1120:47:8","statements":[{"expression":{"id":1228,"isConstant":false,"isLValue":false,"isPure":false,"lValueRequested":false,"leftHandSide":{"id":1221,"name":"capacity","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":1210,"src":"1128:8:8","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"}},"nodeType":"Assignment","operator":"+=","rightHandSide":{"commonType":{"typeIdentifier":"t_uint256","typeString":"uint256"},"id":1227,"isConstant":false,"isLValue":false,"isPure":false,"lValueRequested":false,"leftExpression":{"hexValue":"3332","id":1222,"isConstant":false,"isLValue":false,"isPure":true,"kind":"number","lValueRequested":false,"nodeType":"Literal","src":"1140:2:8","typeDescriptions":{"typeIdentifier":"t_rational_32_by_1","typeString":"int_const 32"},"value":"32"},"nodeType":"BinaryOperation","operator":"-","rightExpression":{"components":[{"commonType":{"typeIdentifier":"t_uint256","typeString":"uint256"},"id":1225,"isConstant":false,"isLValue":false,"isPure":false,"lValueRequested":false,"leftExpression":{"id":1223,"name":"capacity","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":1210,"src":"1146:8:8","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"}},"nodeType":"BinaryOperation","operator":"%","rightExpression":{"hexValue":"3332","id":1224,"isConstant":false,"isLValue":false,"isPure":true,"kind":"number","lValueRequested":false,"nodeType":"Literal","src":"1157:2:8","typeDescriptions":{"typeIdentifier":"t_rational_32_by_1","typeString":"int_const 32"},"value":"32"},"src":"1146:13:8","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"}}],"id":1226,"isConstant":false,"isInlineArray":false,"isLValue":false,"isPure":false,"lValueRequested":false,"nodeType":"TupleExpression","src":"1145:15:8","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"}},"src":"1140:20:8","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"}},"src":"1128:32:8","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"}},"id":1229,"nodeType":"ExpressionStatement","src":"1128:32:8"}]}},{"expression":{"id":1236,"isConstant":false,"isLValue":false,"isPure":false,"lValueRequested":false,"leftHandSide":{"expression":{"id":1232,"name":"buf","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":1208,"src":"1214:3:8","typeDescriptions":{"typeIdentifier":"t_struct$_buffer_$1204_memory_ptr","typeString":"struct BufferChainlink.buffer memory"}},"id":1234,"isConstant":false,"isLValue":true,"isPure":false,"lValueRequested":true,"memberName":"capacity","nodeType":"MemberAccess","referencedDeclaration":1203,"src":"1214:12:8","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"}},"nodeType":"Assignment","operator":"=","rightHandSide":{"id":1235,"name":"capacity","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":1210,"src":"1229:8:8","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"}},"src":"1214:23:8","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"}},"id":1237,"nodeType":"ExpressionStatement","src":"1214:23:8"},{"AST":{"nodeType":"YulBlock","src":"1252:128:8","statements":[{"nodeType":"YulVariableDeclaration","src":"1260:22:8","value":{"arguments":[{"kind":"number","nodeType":"YulLiteral","src":"1277:4:8","type":"","value":"0x40"}],"functionName":{"name":"mload","nodeType":"YulIdentifier","src":"1271:5:8"},"nodeType":"YulFunctionCall","src":"1271:11:8"},"variables":[{"name":"ptr","nodeType":"YulTypedName","src":"1264:3:8","type":""}]},{"expression":{"arguments":[{"name":"buf","nodeType":"YulIdentifier","src":"1296:3:8"},{"name":"ptr","nodeType":"YulIdentifier","src":"1301:3:8"}],"functionName":{"name":"mstore","nodeType":"YulIdentifier","src":"1289:6:8"},"nodeType":"YulFunctionCall","src":"1289:16:8"},"nodeType":"YulExpressionStatement","src":"1289:16:8"},{"expression":{"arguments":[{"name":"ptr","nodeType":"YulIdentifier","src":"1319:3:8"},{"kind":"number","nodeType":"YulLiteral","src":"1324:1:8","type":"","value":"0"}],"functionName":{"name":"mstore","nodeType":"YulIdentifier","src":"1312:6:8"},"nodeType":"YulFunctionCall","src":"1312:14:8"},"nodeType":"YulExpressionStatement","src":"1312:14:8"},{"expression":{"arguments":[{"kind":"number","nodeType":"YulLiteral","src":"1340:4:8","type":"","value":"0x40"},{"arguments":[{"kind":"number","nodeType":"YulLiteral","src":"1350:2:8","type":"","value":"32"},{"arguments":[{"name":"ptr","nodeType":"YulIdentifier","src":"1358:3:8"},{"name":"capacity","nodeType":"YulIdentifier","src":"1363:8:8"}],"functionName":{"name":"add","nodeType":"YulIdentifier","src":"1354:3:8"},"nodeType":"YulFunctionCall","src":"1354:18:8"}],"functionName":{"name":"add","nodeType":"YulIdentifier","src":"1346:3:8"},"nodeType":"YulFunctionCall","src":"1346:27:8"}],"functionName":{"name":"mstore","nodeType":"YulIdentifier","src":"1333:6:8"},"nodeType":"YulFunctionCall","src":"1333:41:8"},"nodeType":"YulExpressionStatement","src":"1333:41:8"}]},"evmVersion":"london","externalReferences":[{"declaration":1208,"isOffset":false,"isSlot":false,"src":"1296:3:8","valueSize":1},{"declaration":1210,"isOffset":false,"isSlot":false,"src":"1363:8:8","valueSize":1}],"id":1238,"nodeType":"InlineAssembly","src":"1243:137:8"},{"expression":{"id":1239,"name":"buf","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":1208,"src":"1392:3:8","typeDescriptions":{"typeIdentifier":"t_struct$_buffer_$1204_memory_ptr","typeString":"struct BufferChainlink.buffer memory"}},"functionReturnParameters":1215,"id":1240,"nodeType":"Return","src":"1385:10:8"}]},"documentation":{"id":1205,"nodeType":"StructuredDocumentation","src":"777:221:8","text":" @dev Initializes a buffer with an initial capacity.\n @param buf The buffer to initialize.\n @param capacity The number of bytes of space to allocate the buffer.\n @return The buffer, for chaining."},"id":1242,"implemented":true,"kind":"function","modifiers":[],"name":"init","nameLocation":"1010:4:8","nodeType":"FunctionDefinition","parameters":{"id":1211,"nodeType":"ParameterList","parameters":[{"constant":false,"id":1208,"mutability":"mutable","name":"buf","nameLocation":"1029:3:8","nodeType":"VariableDeclaration","scope":1242,"src":"1015:17:8","stateVariable":false,"storageLocation":"memory","typeDescriptions":{"typeIdentifier":"t_struct$_buffer_$1204_memory_ptr","typeString":"struct BufferChainlink.buffer"},"typeName":{"id":1207,"nodeType":"UserDefinedTypeName","pathNode":{"id":1206,"name":"buffer","nodeType":"IdentifierPath","referencedDeclaration":1204,"src":"1015:6:8"},"referencedDeclaration":1204,"src":"1015:6:8","typeDescriptions":{"typeIdentifier":"t_struct$_buffer_$1204_storage_ptr","typeString":"struct BufferChainlink.buffer"}},"visibility":"internal"},{"constant":false,"id":1210,"mutability":"mutable","name":"capacity","nameLocation":"1042:8:8","nodeType":"VariableDeclaration","scope":1242,"src":"1034:16:8","stateVariable":false,"storageLocation":"default","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"},"typeName":{"id":1209,"name":"uint256","nodeType":"ElementaryTypeName","src":"1034:7:8","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"}},"visibility":"internal"}],"src":"1014:37:8"},"returnParameters":{"id":1215,"nodeType":"ParameterList","parameters":[{"constant":false,"id":1214,"mutability":"mutable","name":"","nameLocation":"-1:-1:-1","nodeType":"VariableDeclaration","scope":1242,"src":"1075:13:8","stateVariable":false,"storageLocation":"memory","typeDescriptions":{"typeIdentifier":"t_struct$_buffer_$1204_memory_ptr","typeString":"struct BufferChainlink.buffer"},"typeName":{"id":1213,"nodeType":"UserDefinedTypeName","pathNode":{"id":1212,"name":"buffer","nodeType":"IdentifierPath","referencedDeclaration":1204,"src":"1075:6:8"},"referencedDeclaration":1204,"src":"1075:6:8","typeDescriptions":{"typeIdentifier":"t_struct$_buffer_$1204_storage_ptr","typeString":"struct BufferChainlink.buffer"}},"visibility":"internal"}],"src":"1074:15:8"},"scope":1718,"src":"1001:399:8","stateMutability":"pure","virtual":false,"visibility":"internal"},{"body":{"id":1270,"nodeType":"Block","src":"1707:90:8","statements":[{"assignments":[1253],"declarations":[{"constant":false,"id":1253,"mutability":"mutable","name":"buf","nameLocation":"1727:3:8","nodeType":"VariableDeclaration","scope":1270,"src":"1713:17:8","stateVariable":false,"storageLocation":"memory","typeDescriptions":{"typeIdentifier":"t_struct$_buffer_$1204_memory_ptr","typeString":"struct BufferChainlink.buffer"},"typeName":{"id":1252,"nodeType":"UserDefinedTypeName","pathNode":{"id":1251,"name":"buffer","nodeType":"IdentifierPath","referencedDeclaration":1204,"src":"1713:6:8"},"referencedDeclaration":1204,"src":"1713:6:8","typeDescriptions":{"typeIdentifier":"t_struct$_buffer_$1204_storage_ptr","typeString":"struct BufferChainlink.buffer"}},"visibility":"internal"}],"id":1254,"nodeType":"VariableDeclarationStatement","src":"1713:17:8"},{"expression":{"id":1259,"isConstant":false,"isLValue":false,"isPure":false,"lValueRequested":false,"leftHandSide":{"expression":{"id":1255,"name":"buf","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":1253,"src":"1736:3:8","typeDescriptions":{"typeIdentifier":"t_struct$_buffer_$1204_memory_ptr","typeString":"struct BufferChainlink.buffer memory"}},"id":1257,"isConstant":false,"isLValue":true,"isPure":false,"lValueRequested":true,"memberName":"buf","nodeType":"MemberAccess","referencedDeclaration":1201,"src":"1736:7:8","typeDescriptions":{"typeIdentifier":"t_bytes_memory_ptr","typeString":"bytes memory"}},"nodeType":"Assignment","operator":"=","rightHandSide":{"id":1258,"name":"b","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":1245,"src":"1746:1:8","typeDescriptions":{"typeIdentifier":"t_bytes_memory_ptr","typeString":"bytes memory"}},"src":"1736:11:8","typeDescriptions":{"typeIdentifier":"t_bytes_memory_ptr","typeString":"bytes memory"}},"id":1260,"nodeType":"ExpressionStatement","src":"1736:11:8"},{"expression":{"id":1266,"isConstant":false,"isLValue":false,"isPure":false,"lValueRequested":false,"leftHandSide":{"expression":{"id":1261,"name":"buf","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":1253,"src":"1753:3:8","typeDescriptions":{"typeIdentifier":"t_struct$_buffer_$1204_memory_ptr","typeString":"struct BufferChainlink.buffer memory"}},"id":1263,"isConstant":false,"isLValue":true,"isPure":false,"lValueRequested":true,"memberName":"capacity","nodeType":"MemberAccess","referencedDeclaration":1203,"src":"1753:12:8","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"}},"nodeType":"Assignment","operator":"=","rightHandSide":{"expression":{"id":1264,"name":"b","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":1245,"src":"1768:1:8","typeDescriptions":{"typeIdentifier":"t_bytes_memory_ptr","typeString":"bytes memory"}},"id":1265,"isConstant":false,"isLValue":false,"isPure":false,"lValueRequested":false,"memberName":"length","nodeType":"MemberAccess","src":"1768:8:8","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"}},"src":"1753:23:8","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"}},"id":1267,"nodeType":"ExpressionStatement","src":"1753:23:8"},{"expression":{"id":1268,"name":"buf","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":1253,"src":"1789:3:8","typeDescriptions":{"typeIdentifier":"t_struct$_buffer_$1204_memory_ptr","typeString":"struct BufferChainlink.buffer memory"}},"functionReturnParameters":1250,"id":1269,"nodeType":"Return","src":"1782:10:8"}]},"documentation":{"id":1243,"nodeType":"StructuredDocumentation","src":"1404:227:8","text":" @dev Initializes a new buffer from an existing bytes object.\n Changes to the buffer may mutate the original value.\n @param b The bytes object to initialize the buffer with.\n @return A new buffer."},"id":1271,"implemented":true,"kind":"function","modifiers":[],"name":"fromBytes","nameLocation":"1643:9:8","nodeType":"FunctionDefinition","parameters":{"id":1246,"nodeType":"ParameterList","parameters":[{"constant":false,"id":1245,"mutability":"mutable","name":"b","nameLocation":"1666:1:8","nodeType":"VariableDeclaration","scope":1271,"src":"1653:14:8","stateVariable":false,"storageLocation":"memory","typeDescriptions":{"typeIdentifier":"t_bytes_memory_ptr","typeString":"bytes"},"typeName":{"id":1244,"name":"bytes","nodeType":"ElementaryTypeName","src":"1653:5:8","typeDescriptions":{"typeIdentifier":"t_bytes_storage_ptr","typeString":"bytes"}},"visibility":"internal"}],"src":"1652:16:8"},"returnParameters":{"id":1250,"nodeType":"ParameterList","parameters":[{"constant":false,"id":1249,"mutability":"mutable","name":"","nameLocation":"-1:-1:-1","nodeType":"VariableDeclaration","scope":1271,"src":"1692:13:8","stateVariable":false,"storageLocation":"memory","typeDescriptions":{"typeIdentifier":"t_struct$_buffer_$1204_memory_ptr","typeString":"struct BufferChainlink.buffer"},"typeName":{"id":1248,"nodeType":"UserDefinedTypeName","pathNode":{"id":1247,"name":"buffer","nodeType":"IdentifierPath","referencedDeclaration":1204,"src":"1692:6:8"},"referencedDeclaration":1204,"src":"1692:6:8","typeDescriptions":{"typeIdentifier":"t_struct$_buffer_$1204_storage_ptr","typeString":"struct BufferChainlink.buffer"}},"visibility":"internal"}],"src":"1691:15:8"},"scope":1718,"src":"1634:163:8","stateMutability":"pure","virtual":false,"visibility":"internal"},{"body":{"id":1294,"nodeType":"Block","src":"1867:90:8","statements":[{"assignments":[1280],"declarations":[{"constant":false,"id":1280,"mutability":"mutable","name":"oldbuf","nameLocation":"1886:6:8","nodeType":"VariableDeclaration","scope":1294,"src":"1873:19:8","stateVariable":false,"storageLocation":"memory","typeDescriptions":{"typeIdentifier":"t_bytes_memory_ptr","typeString":"bytes"},"typeName":{"id":1279,"name":"bytes","nodeType":"ElementaryTypeName","src":"1873:5:8","typeDescriptions":{"typeIdentifier":"t_bytes_storage_ptr","typeString":"bytes"}},"visibility":"internal"}],"id":1283,"initialValue":{"expression":{"id":1281,"name":"buf","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":1274,"src":"1895:3:8","typeDescriptions":{"typeIdentifier":"t_struct$_buffer_$1204_memory_ptr","typeString":"struct BufferChainlink.buffer memory"}},"id":1282,"isConstant":false,"isLValue":true,"isPure":false,"lValueRequested":false,"memberName":"buf","nodeType":"MemberAccess","referencedDeclaration":1201,"src":"1895:7:8","typeDescriptions":{"typeIdentifier":"t_bytes_memory_ptr","typeString":"bytes memory"}},"nodeType":"VariableDeclarationStatement","src":"1873:29:8"},{"expression":{"arguments":[{"id":1285,"name":"buf","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":1274,"src":"1913:3:8","typeDescriptions":{"typeIdentifier":"t_struct$_buffer_$1204_memory_ptr","typeString":"struct BufferChainlink.buffer memory"}},{"id":1286,"name":"capacity","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":1276,"src":"1918:8:8","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"}}],"expression":{"argumentTypes":[{"typeIdentifier":"t_struct$_buffer_$1204_memory_ptr","typeString":"struct BufferChainlink.buffer memory"},{"typeIdentifier":"t_uint256","typeString":"uint256"}],"id":1284,"name":"init","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":1242,"src":"1908:4:8","typeDescriptions":{"typeIdentifier":"t_function_internal_pure$_t_struct$_buffer_$1204_memory_ptr_$_t_uint256_$returns$_t_struct$_buffer_$1204_memory_ptr_$","typeString":"function (struct BufferChainlink.buffer memory,uint256) pure returns (struct BufferChainlink.buffer memory)"}},"id":1287,"isConstant":false,"isLValue":false,"isPure":false,"kind":"functionCall","lValueRequested":false,"names":[],"nodeType":"FunctionCall","src":"1908:19:8","tryCall":false,"typeDescriptions":{"typeIdentifier":"t_struct$_buffer_$1204_memory_ptr","typeString":"struct BufferChainlink.buffer memory"}},"id":1288,"nodeType":"ExpressionStatement","src":"1908:19:8"},{"expression":{"arguments":[{"id":1290,"name":"buf","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":1274,"src":"1940:3:8","typeDescriptions":{"typeIdentifier":"t_struct$_buffer_$1204_memory_ptr","typeString":"struct BufferChainlink.buffer memory"}},{"id":1291,"name":"oldbuf","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":1280,"src":"1945:6:8","typeDescriptions":{"typeIdentifier":"t_bytes_memory_ptr","typeString":"bytes memory"}}],"expression":{"argumentTypes":[{"typeIdentifier":"t_struct$_buffer_$1204_memory_ptr","typeString":"struct BufferChainlink.buffer memory"},{"typeIdentifier":"t_bytes_memory_ptr","typeString":"bytes memory"}],"id":1289,"name":"append","nodeType":"Identifier","overloadedDeclarations":[1438,1461],"referencedDeclaration":1461,"src":"1933:6:8","typeDescriptions":{"typeIdentifier":"t_function_internal_pure$_t_struct$_buffer_$1204_memory_ptr_$_t_bytes_memory_ptr_$returns$_t_struct$_buffer_$1204_memory_ptr_$","typeString":"function (struct BufferChainlink.buffer memory,bytes memory) pure returns (struct BufferChainlink.buffer memory)"}},"id":1292,"isConstant":false,"isLValue":false,"isPure":false,"kind":"functionCall","lValueRequested":false,"names":[],"nodeType":"FunctionCall","src":"1933:19:8","tryCall":false,"typeDescriptions":{"typeIdentifier":"t_struct$_buffer_$1204_memory_ptr","typeString":"struct BufferChainlink.buffer memory"}},"id":1293,"nodeType":"ExpressionStatement","src":"1933:19:8"}]},"id":1295,"implemented":true,"kind":"function","modifiers":[],"name":"resize","nameLocation":"1810:6:8","nodeType":"FunctionDefinition","parameters":{"id":1277,"nodeType":"ParameterList","parameters":[{"constant":false,"id":1274,"mutability":"mutable","name":"buf","nameLocation":"1831:3:8","nodeType":"VariableDeclaration","scope":1295,"src":"1817:17:8","stateVariable":false,"storageLocation":"memory","typeDescriptions":{"typeIdentifier":"t_struct$_buffer_$1204_memory_ptr","typeString":"struct BufferChainlink.buffer"},"typeName":{"id":1273,"nodeType":"UserDefinedTypeName","pathNode":{"id":1272,"name":"buffer","nodeType":"IdentifierPath","referencedDeclaration":1204,"src":"1817:6:8"},"referencedDeclaration":1204,"src":"1817:6:8","typeDescriptions":{"typeIdentifier":"t_struct$_buffer_$1204_storage_ptr","typeString":"struct BufferChainlink.buffer"}},"visibility":"internal"},{"constant":false,"id":1276,"mutability":"mutable","name":"capacity","nameLocation":"1844:8:8","nodeType":"VariableDeclaration","scope":1295,"src":"1836:16:8","stateVariable":false,"storageLocation":"default","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"},"typeName":{"id":1275,"name":"uint256","nodeType":"ElementaryTypeName","src":"1836:7:8","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"}},"visibility":"internal"}],"src":"1816:37:8"},"returnParameters":{"id":1278,"nodeType":"ParameterList","parameters":[],"src":"1867:0:8"},"scope":1718,"src":"1801:156:8","stateMutability":"pure","virtual":false,"visibility":"private"},{"body":{"id":1313,"nodeType":"Block","src":"2027:58:8","statements":[{"condition":{"commonType":{"typeIdentifier":"t_uint256","typeString":"uint256"},"id":1306,"isConstant":false,"isLValue":false,"isPure":false,"lValueRequested":false,"leftExpression":{"id":1304,"name":"a","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":1297,"src":"2037:1:8","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"}},"nodeType":"BinaryOperation","operator":">","rightExpression":{"id":1305,"name":"b","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":1299,"src":"2041:1:8","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"}},"src":"2037:5:8","typeDescriptions":{"typeIdentifier":"t_bool","typeString":"bool"}},"id":1310,"nodeType":"IfStatement","src":"2033:34:8","trueBody":{"id":1309,"nodeType":"Block","src":"2044:23:8","statements":[{"expression":{"id":1307,"name":"a","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":1297,"src":"2059:1:8","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"}},"functionReturnParameters":1303,"id":1308,"nodeType":"Return","src":"2052:8:8"}]}},{"expression":{"id":1311,"name":"b","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":1299,"src":"2079:1:8","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"}},"functionReturnParameters":1303,"id":1312,"nodeType":"Return","src":"2072:8:8"}]},"id":1314,"implemented":true,"kind":"function","modifiers":[],"name":"max","nameLocation":"1970:3:8","nodeType":"FunctionDefinition","parameters":{"id":1300,"nodeType":"ParameterList","parameters":[{"constant":false,"id":1297,"mutability":"mutable","name":"a","nameLocation":"1982:1:8","nodeType":"VariableDeclaration","scope":1314,"src":"1974:9:8","stateVariable":false,"storageLocation":"default","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"},"typeName":{"id":1296,"name":"uint256","nodeType":"ElementaryTypeName","src":"1974:7:8","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"}},"visibility":"internal"},{"constant":false,"id":1299,"mutability":"mutable","name":"b","nameLocation":"1993:1:8","nodeType":"VariableDeclaration","scope":1314,"src":"1985:9:8","stateVariable":false,"storageLocation":"default","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"},"typeName":{"id":1298,"name":"uint256","nodeType":"ElementaryTypeName","src":"1985:7:8","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"}},"visibility":"internal"}],"src":"1973:22:8"},"returnParameters":{"id":1303,"nodeType":"ParameterList","parameters":[{"constant":false,"id":1302,"mutability":"mutable","name":"","nameLocation":"-1:-1:-1","nodeType":"VariableDeclaration","scope":1314,"src":"2018:7:8","stateVariable":false,"storageLocation":"default","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"},"typeName":{"id":1301,"name":"uint256","nodeType":"ElementaryTypeName","src":"2018:7:8","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"}},"visibility":"internal"}],"src":"2017:9:8"},"scope":1718,"src":"1961:124:8","stateMutability":"pure","virtual":false,"visibility":"private"},{"body":{"id":1327,"nodeType":"Block","src":"2300:97:8","statements":[{"AST":{"nodeType":"YulBlock","src":"2315:62:8","statements":[{"nodeType":"YulVariableDeclaration","src":"2323:24:8","value":{"arguments":[{"name":"buf","nodeType":"YulIdentifier","src":"2343:3:8"}],"functionName":{"name":"mload","nodeType":"YulIdentifier","src":"2337:5:8"},"nodeType":"YulFunctionCall","src":"2337:10:8"},"variables":[{"name":"bufptr","nodeType":"YulTypedName","src":"2327:6:8","type":""}]},{"expression":{"arguments":[{"name":"bufptr","nodeType":"YulIdentifier","src":"2361:6:8"},{"kind":"number","nodeType":"YulLiteral","src":"2369:1:8","type":"","value":"0"}],"functionName":{"name":"mstore","nodeType":"YulIdentifier","src":"2354:6:8"},"nodeType":"YulFunctionCall","src":"2354:17:8"},"nodeType":"YulExpressionStatement","src":"2354:17:8"}]},"evmVersion":"london","externalReferences":[{"declaration":1318,"isOffset":false,"isSlot":false,"src":"2343:3:8","valueSize":1}],"id":1324,"nodeType":"InlineAssembly","src":"2306:71:8"},{"expression":{"id":1325,"name":"buf","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":1318,"src":"2389:3:8","typeDescriptions":{"typeIdentifier":"t_struct$_buffer_$1204_memory_ptr","typeString":"struct BufferChainlink.buffer memory"}},"functionReturnParameters":1323,"id":1326,"nodeType":"Return","src":"2382:10:8"}]},"documentation":{"id":1315,"nodeType":"StructuredDocumentation","src":"2089:133:8","text":" @dev Sets buffer length to 0.\n @param buf The buffer to truncate.\n @return The original buffer, for chaining.."},"id":1328,"implemented":true,"kind":"function","modifiers":[],"name":"truncate","nameLocation":"2234:8:8","nodeType":"FunctionDefinition","parameters":{"id":1319,"nodeType":"ParameterList","parameters":[{"constant":false,"id":1318,"mutability":"mutable","name":"buf","nameLocation":"2257:3:8","nodeType":"VariableDeclaration","scope":1328,"src":"2243:17:8","stateVariable":false,"storageLocation":"memory","typeDescriptions":{"typeIdentifier":"t_struct$_buffer_$1204_memory_ptr","typeString":"struct BufferChainlink.buffer"},"typeName":{"id":1317,"nodeType":"UserDefinedTypeName","pathNode":{"id":1316,"name":"buffer","nodeType":"IdentifierPath","referencedDeclaration":1204,"src":"2243:6:8"},"referencedDeclaration":1204,"src":"2243:6:8","typeDescriptions":{"typeIdentifier":"t_struct$_buffer_$1204_storage_ptr","typeString":"struct BufferChainlink.buffer"}},"visibility":"internal"}],"src":"2242:19:8"},"returnParameters":{"id":1323,"nodeType":"ParameterList","parameters":[{"constant":false,"id":1322,"mutability":"mutable","name":"","nameLocation":"-1:-1:-1","nodeType":"VariableDeclaration","scope":1328,"src":"2285:13:8","stateVariable":false,"storageLocation":"memory","typeDescriptions":{"typeIdentifier":"t_struct$_buffer_$1204_memory_ptr","typeString":"struct BufferChainlink.buffer"},"typeName":{"id":1321,"nodeType":"UserDefinedTypeName","pathNode":{"id":1320,"name":"buffer","nodeType":"IdentifierPath","referencedDeclaration":1204,"src":"2285:6:8"},"referencedDeclaration":1204,"src":"2285:6:8","typeDescriptions":{"typeIdentifier":"t_struct$_buffer_$1204_storage_ptr","typeString":"struct BufferChainlink.buffer"}},"visibility":"internal"}],"src":"2284:15:8"},"scope":1718,"src":"2225:172:8","stateMutability":"pure","virtual":false,"visibility":"internal"},{"body":{"id":1413,"nodeType":"Block","src":"2882:1073:8","statements":[{"expression":{"arguments":[{"commonType":{"typeIdentifier":"t_uint256","typeString":"uint256"},"id":1348,"isConstant":false,"isLValue":false,"isPure":false,"lValueRequested":false,"leftExpression":{"id":1345,"name":"len","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":1338,"src":"2896:3:8","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"}},"nodeType":"BinaryOperation","operator":"<=","rightExpression":{"expression":{"id":1346,"name":"data","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":1336,"src":"2903:4:8","typeDescriptions":{"typeIdentifier":"t_bytes_memory_ptr","typeString":"bytes memory"}},"id":1347,"isConstant":false,"isLValue":false,"isPure":false,"lValueRequested":false,"memberName":"length","nodeType":"MemberAccess","src":"2903:11:8","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"}},"src":"2896:18:8","typeDescriptions":{"typeIdentifier":"t_bool","typeString":"bool"}}],"expression":{"argumentTypes":[{"typeIdentifier":"t_bool","typeString":"bool"}],"id":1344,"name":"require","nodeType":"Identifier","overloadedDeclarations":[-18,-18],"referencedDeclaration":-18,"src":"2888:7:8","typeDescriptions":{"typeIdentifier":"t_function_require_pure$_t_bool_$returns$__$","typeString":"function (bool) pure"}},"id":1349,"isConstant":false,"isLValue":false,"isPure":false,"kind":"functionCall","lValueRequested":false,"names":[],"nodeType":"FunctionCall","src":"2888:27:8","tryCall":false,"typeDescriptions":{"typeIdentifier":"t_tuple$__$","typeString":"tuple()"}},"id":1350,"nodeType":"ExpressionStatement","src":"2888:27:8"},{"condition":{"commonType":{"typeIdentifier":"t_uint256","typeString":"uint256"},"id":1356,"isConstant":false,"isLValue":false,"isPure":false,"lValueRequested":false,"leftExpression":{"commonType":{"typeIdentifier":"t_uint256","typeString":"uint256"},"id":1353,"isConstant":false,"isLValue":false,"isPure":false,"lValueRequested":false,"leftExpression":{"id":1351,"name":"off","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":1334,"src":"2926:3:8","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"}},"nodeType":"BinaryOperation","operator":"+","rightExpression":{"id":1352,"name":"len","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":1338,"src":"2932:3:8","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"}},"src":"2926:9:8","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"}},"nodeType":"BinaryOperation","operator":">","rightExpression":{"expression":{"id":1354,"name":"buf","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":1332,"src":"2938:3:8","typeDescriptions":{"typeIdentifier":"t_struct$_buffer_$1204_memory_ptr","typeString":"struct BufferChainlink.buffer memory"}},"id":1355,"isConstant":false,"isLValue":true,"isPure":false,"lValueRequested":false,"memberName":"capacity","nodeType":"MemberAccess","referencedDeclaration":1203,"src":"2938:12:8","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"}},"src":"2926:24:8","typeDescriptions":{"typeIdentifier":"t_bool","typeString":"bool"}},"id":1371,"nodeType":"IfStatement","src":"2922:90:8","trueBody":{"id":1370,"nodeType":"Block","src":"2952:60:8","statements":[{"expression":{"arguments":[{"id":1358,"name":"buf","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":1332,"src":"2967:3:8","typeDescriptions":{"typeIdentifier":"t_struct$_buffer_$1204_memory_ptr","typeString":"struct BufferChainlink.buffer memory"}},{"commonType":{"typeIdentifier":"t_uint256","typeString":"uint256"},"id":1367,"isConstant":false,"isLValue":false,"isPure":false,"lValueRequested":false,"leftExpression":{"arguments":[{"expression":{"id":1360,"name":"buf","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":1332,"src":"2976:3:8","typeDescriptions":{"typeIdentifier":"t_struct$_buffer_$1204_memory_ptr","typeString":"struct BufferChainlink.buffer memory"}},"id":1361,"isConstant":false,"isLValue":true,"isPure":false,"lValueRequested":false,"memberName":"capacity","nodeType":"MemberAccess","referencedDeclaration":1203,"src":"2976:12:8","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"}},{"commonType":{"typeIdentifier":"t_uint256","typeString":"uint256"},"id":1364,"isConstant":false,"isLValue":false,"isPure":false,"lValueRequested":false,"leftExpression":{"id":1362,"name":"len","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":1338,"src":"2990:3:8","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"}},"nodeType":"BinaryOperation","operator":"+","rightExpression":{"id":1363,"name":"off","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":1334,"src":"2996:3:8","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"}},"src":"2990:9:8","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"}}],"expression":{"argumentTypes":[{"typeIdentifier":"t_uint256","typeString":"uint256"},{"typeIdentifier":"t_uint256","typeString":"uint256"}],"id":1359,"name":"max","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":1314,"src":"2972:3:8","typeDescriptions":{"typeIdentifier":"t_function_internal_pure$_t_uint256_$_t_uint256_$returns$_t_uint256_$","typeString":"function (uint256,uint256) pure returns (uint256)"}},"id":1365,"isConstant":false,"isLValue":false,"isPure":false,"kind":"functionCall","lValueRequested":false,"names":[],"nodeType":"FunctionCall","src":"2972:28:8","tryCall":false,"typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"}},"nodeType":"BinaryOperation","operator":"*","rightExpression":{"hexValue":"32","id":1366,"isConstant":false,"isLValue":false,"isPure":true,"kind":"number","lValueRequested":false,"nodeType":"Literal","src":"3003:1:8","typeDescriptions":{"typeIdentifier":"t_rational_2_by_1","typeString":"int_const 2"},"value":"2"},"src":"2972:32:8","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"}}],"expression":{"argumentTypes":[{"typeIdentifier":"t_struct$_buffer_$1204_memory_ptr","typeString":"struct BufferChainlink.buffer memory"},{"typeIdentifier":"t_uint256","typeString":"uint256"}],"id":1357,"name":"resize","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":1295,"src":"2960:6:8","typeDescriptions":{"typeIdentifier":"t_function_internal_pure$_t_struct$_buffer_$1204_memory_ptr_$_t_uint256_$returns$__$","typeString":"function (struct BufferChainlink.buffer memory,uint256) pure"}},"id":1368,"isConstant":false,"isLValue":false,"isPure":false,"kind":"functionCall","lValueRequested":false,"names":[],"nodeType":"FunctionCall","src":"2960:45:8","tryCall":false,"typeDescriptions":{"typeIdentifier":"t_tuple$__$","typeString":"tuple()"}},"id":1369,"nodeType":"ExpressionStatement","src":"2960:45:8"}]}},{"assignments":[1373],"declarations":[{"constant":false,"id":1373,"mutability":"mutable","name":"dest","nameLocation":"3026:4:8","nodeType":"VariableDeclaration","scope":1413,"src":"3018:12:8","stateVariable":false,"storageLocation":"default","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"},"typeName":{"id":1372,"name":"uint256","nodeType":"ElementaryTypeName","src":"3018:7:8","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"}},"visibility":"internal"}],"id":1374,"nodeType":"VariableDeclarationStatement","src":"3018:12:8"},{"assignments":[1376],"declarations":[{"constant":false,"id":1376,"mutability":"mutable","name":"src","nameLocation":"3044:3:8","nodeType":"VariableDeclaration","scope":1413,"src":"3036:11:8","stateVariable":false,"storageLocation":"default","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"},"typeName":{"id":1375,"name":"uint256","nodeType":"ElementaryTypeName","src":"3036:7:8","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"}},"visibility":"internal"}],"id":1377,"nodeType":"VariableDeclarationStatement","src":"3036:11:8"},{"AST":{"nodeType":"YulBlock","src":"3062:430:8","statements":[{"nodeType":"YulVariableDeclaration","src":"3113:24:8","value":{"arguments":[{"name":"buf","nodeType":"YulIdentifier","src":"3133:3:8"}],"functionName":{"name":"mload","nodeType":"YulIdentifier","src":"3127:5:8"},"nodeType":"YulFunctionCall","src":"3127:10:8"},"variables":[{"name":"bufptr","nodeType":"YulTypedName","src":"3117:6:8","type":""}]},{"nodeType":"YulVariableDeclaration","src":"3184:27:8","value":{"arguments":[{"name":"bufptr","nodeType":"YulIdentifier","src":"3204:6:8"}],"functionName":{"name":"mload","nodeType":"YulIdentifier","src":"3198:5:8"},"nodeType":"YulFunctionCall","src":"3198:13:8"},"variables":[{"name":"buflen","nodeType":"YulTypedName","src":"3188:6:8","type":""}]},{"nodeType":"YulAssignment","src":"3291:33:8","value":{"arguments":[{"arguments":[{"name":"bufptr","nodeType":"YulIdentifier","src":"3307:6:8"},{"kind":"number","nodeType":"YulLiteral","src":"3315:2:8","type":"","value":"32"}],"functionName":{"name":"add","nodeType":"YulIdentifier","src":"3303:3:8"},"nodeType":"YulFunctionCall","src":"3303:15:8"},{"name":"off","nodeType":"YulIdentifier","src":"3320:3:8"}],"functionName":{"name":"add","nodeType":"YulIdentifier","src":"3299:3:8"},"nodeType":"YulFunctionCall","src":"3299:25:8"},"variableNames":[{"name":"dest","nodeType":"YulIdentifier","src":"3291:4:8"}]},{"body":{"nodeType":"YulBlock","src":"3412:47:8","statements":[{"expression":{"arguments":[{"name":"bufptr","nodeType":"YulIdentifier","src":"3429:6:8"},{"arguments":[{"name":"len","nodeType":"YulIdentifier","src":"3441:3:8"},{"name":"off","nodeType":"YulIdentifier","src":"3446:3:8"}],"functionName":{"name":"add","nodeType":"YulIdentifier","src":"3437:3:8"},"nodeType":"YulFunctionCall","src":"3437:13:8"}],"functionName":{"name":"mstore","nodeType":"YulIdentifier","src":"3422:6:8"},"nodeType":"YulFunctionCall","src":"3422:29:8"},"nodeType":"YulExpressionStatement","src":"3422:29:8"}]},"condition":{"arguments":[{"arguments":[{"name":"len","nodeType":"YulIdentifier","src":"3393:3:8"},{"name":"off","nodeType":"YulIdentifier","src":"3398:3:8"}],"functionName":{"name":"add","nodeType":"YulIdentifier","src":"3389:3:8"},"nodeType":"YulFunctionCall","src":"3389:13:8"},{"name":"buflen","nodeType":"YulIdentifier","src":"3404:6:8"}],"functionName":{"name":"gt","nodeType":"YulIdentifier","src":"3386:2:8"},"nodeType":"YulFunctionCall","src":"3386:25:8"},"nodeType":"YulIf","src":"3383:76:8"},{"nodeType":"YulAssignment","src":"3466:20:8","value":{"arguments":[{"name":"data","nodeType":"YulIdentifier","src":"3477:4:8"},{"kind":"number","nodeType":"YulLiteral","src":"3483:2:8","type":"","value":"32"}],"functionName":{"name":"add","nodeType":"YulIdentifier","src":"3473:3:8"},"nodeType":"YulFunctionCall","src":"3473:13:8"},"variableNames":[{"name":"src","nodeType":"YulIdentifier","src":"3466:3:8"}]}]},"evmVersion":"london","externalReferences":[{"declaration":1332,"isOffset":false,"isSlot":false,"src":"3133:3:8","valueSize":1},{"declaration":1336,"isOffset":false,"isSlot":false,"src":"3477:4:8","valueSize":1},{"declaration":1373,"isOffset":false,"isSlot":false,"src":"3291:4:8","valueSize":1},{"declaration":1338,"isOffset":false,"isSlot":false,"src":"3393:3:8","valueSize":1},{"declaration":1338,"isOffset":false,"isSlot":false,"src":"3441:3:8","valueSize":1},{"declaration":1334,"isOffset":false,"isSlot":false,"src":"3320:3:8","valueSize":1},{"declaration":1334,"isOffset":false,"isSlot":false,"src":"3398:3:8","valueSize":1},{"declaration":1334,"isOffset":false,"isSlot":false,"src":"3446:3:8","valueSize":1},{"declaration":1376,"isOffset":false,"isSlot":false,"src":"3466:3:8","valueSize":1}],"id":1378,"nodeType":"InlineAssembly","src":"3053:439:8"},{"body":{"id":1395,"nodeType":"Block","src":"3573:100:8","statements":[{"AST":{"nodeType":"YulBlock","src":"3590:42:8","statements":[{"expression":{"arguments":[{"name":"dest","nodeType":"YulIdentifier","src":"3607:4:8"},{"arguments":[{"name":"src","nodeType":"YulIdentifier","src":"3619:3:8"}],"functionName":{"name":"mload","nodeType":"YulIdentifier","src":"3613:5:8"},"nodeType":"YulFunctionCall","src":"3613:10:8"}],"functionName":{"name":"mstore","nodeType":"YulIdentifier","src":"3600:6:8"},"nodeType":"YulFunctionCall","src":"3600:24:8"},"nodeType":"YulExpressionStatement","src":"3600:24:8"}]},"evmVersion":"london","externalReferences":[{"declaration":1373,"isOffset":false,"isSlot":false,"src":"3607:4:8","valueSize":1},{"declaration":1376,"isOffset":false,"isSlot":false,"src":"3619:3:8","valueSize":1}],"id":1386,"nodeType":"InlineAssembly","src":"3581:51:8"},{"expression":{"id":1389,"isConstant":false,"isLValue":false,"isPure":false,"lValueRequested":false,"leftHandSide":{"id":1387,"name":"dest","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":1373,"src":"3639:4:8","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"}},"nodeType":"Assignment","operator":"+=","rightHandSide":{"hexValue":"3332","id":1388,"isConstant":false,"isLValue":false,"isPure":true,"kind":"number","lValueRequested":false,"nodeType":"Literal","src":"3647:2:8","typeDescriptions":{"typeIdentifier":"t_rational_32_by_1","typeString":"int_const 32"},"value":"32"},"src":"3639:10:8","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"}},"id":1390,"nodeType":"ExpressionStatement","src":"3639:10:8"},{"expression":{"id":1393,"isConstant":false,"isLValue":false,"isPure":false,"lValueRequested":false,"leftHandSide":{"id":1391,"name":"src","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":1376,"src":"3657:3:8","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"}},"nodeType":"Assignment","operator":"+=","rightHandSide":{"hexValue":"3332","id":1392,"isConstant":false,"isLValue":false,"isPure":true,"kind":"number","lValueRequested":false,"nodeType":"Literal","src":"3664:2:8","typeDescriptions":{"typeIdentifier":"t_rational_32_by_1","typeString":"int_const 32"},"value":"32"},"src":"3657:9:8","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"}},"id":1394,"nodeType":"ExpressionStatement","src":"3657:9:8"}]},"condition":{"commonType":{"typeIdentifier":"t_uint256","typeString":"uint256"},"id":1381,"isConstant":false,"isLValue":false,"isPure":false,"lValueRequested":false,"leftExpression":{"id":1379,"name":"len","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":1338,"src":"3551:3:8","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"}},"nodeType":"BinaryOperation","operator":">=","rightExpression":{"hexValue":"3332","id":1380,"isConstant":false,"isLValue":false,"isPure":true,"kind":"number","lValueRequested":false,"nodeType":"Literal","src":"3558:2:8","typeDescriptions":{"typeIdentifier":"t_rational_32_by_1","typeString":"int_const 32"},"value":"32"},"src":"3551:9:8","typeDescriptions":{"typeIdentifier":"t_bool","typeString":"bool"}},"id":1396,"loopExpression":{"expression":{"id":1384,"isConstant":false,"isLValue":false,"isPure":false,"lValueRequested":false,"leftHandSide":{"id":1382,"name":"len","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":1338,"src":"3562:3:8","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"}},"nodeType":"Assignment","operator":"-=","rightHandSide":{"hexValue":"3332","id":1383,"isConstant":false,"isLValue":false,"isPure":true,"kind":"number","lValueRequested":false,"nodeType":"Literal","src":"3569:2:8","typeDescriptions":{"typeIdentifier":"t_rational_32_by_1","typeString":"int_const 32"},"value":"32"},"src":"3562:9:8","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"}},"id":1385,"nodeType":"ExpressionStatement","src":"3562:9:8"},"nodeType":"ForStatement","src":"3544:129:8"},{"id":1410,"nodeType":"UncheckedBlock","src":"3707:227:8","statements":[{"assignments":[1398],"declarations":[{"constant":false,"id":1398,"mutability":"mutable","name":"mask","nameLocation":"3733:4:8","nodeType":"VariableDeclaration","scope":1410,"src":"3725:12:8","stateVariable":false,"storageLocation":"default","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"},"typeName":{"id":1397,"name":"uint256","nodeType":"ElementaryTypeName","src":"3725:7:8","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"}},"visibility":"internal"}],"id":1408,"initialValue":{"commonType":{"typeIdentifier":"t_uint256","typeString":"uint256"},"id":1407,"isConstant":false,"isLValue":false,"isPure":false,"lValueRequested":false,"leftExpression":{"components":[{"commonType":{"typeIdentifier":"t_uint256","typeString":"uint256"},"id":1404,"isConstant":false,"isLValue":false,"isPure":false,"lValueRequested":false,"leftExpression":{"hexValue":"323536","id":1399,"isConstant":false,"isLValue":false,"isPure":true,"kind":"number","lValueRequested":false,"nodeType":"Literal","src":"3741:3:8","typeDescriptions":{"typeIdentifier":"t_rational_256_by_1","typeString":"int_const 256"},"value":"256"},"nodeType":"BinaryOperation","operator":"**","rightExpression":{"components":[{"commonType":{"typeIdentifier":"t_uint256","typeString":"uint256"},"id":1402,"isConstant":false,"isLValue":false,"isPure":false,"lValueRequested":false,"leftExpression":{"hexValue":"3332","id":1400,"isConstant":false,"isLValue":false,"isPure":true,"kind":"number","lValueRequested":false,"nodeType":"Literal","src":"3747:2:8","typeDescriptions":{"typeIdentifier":"t_rational_32_by_1","typeString":"int_const 32"},"value":"32"},"nodeType":"BinaryOperation","operator":"-","rightExpression":{"id":1401,"name":"len","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":1338,"src":"3752:3:8","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"}},"src":"3747:8:8","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"}}],"id":1403,"isConstant":false,"isInlineArray":false,"isLValue":false,"isPure":false,"lValueRequested":false,"nodeType":"TupleExpression","src":"3746:10:8","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"}},"src":"3741:15:8","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"}}],"id":1405,"isConstant":false,"isInlineArray":false,"isLValue":false,"isPure":false,"lValueRequested":false,"nodeType":"TupleExpression","src":"3740:17:8","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"}},"nodeType":"BinaryOperation","operator":"-","rightExpression":{"hexValue":"31","id":1406,"isConstant":false,"isLValue":false,"isPure":true,"kind":"number","lValueRequested":false,"nodeType":"Literal","src":"3760:1:8","typeDescriptions":{"typeIdentifier":"t_rational_1_by_1","typeString":"int_const 1"},"value":"1"},"src":"3740:21:8","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"}},"nodeType":"VariableDeclarationStatement","src":"3725:36:8"},{"AST":{"nodeType":"YulBlock","src":"3778:150:8","statements":[{"nodeType":"YulVariableDeclaration","src":"3788:41:8","value":{"arguments":[{"arguments":[{"name":"src","nodeType":"YulIdentifier","src":"3813:3:8"}],"functionName":{"name":"mload","nodeType":"YulIdentifier","src":"3807:5:8"},"nodeType":"YulFunctionCall","src":"3807:10:8"},{"arguments":[{"name":"mask","nodeType":"YulIdentifier","src":"3823:4:8"}],"functionName":{"name":"not","nodeType":"YulIdentifier","src":"3819:3:8"},"nodeType":"YulFunctionCall","src":"3819:9:8"}],"functionName":{"name":"and","nodeType":"YulIdentifier","src":"3803:3:8"},"nodeType":"YulFunctionCall","src":"3803:26:8"},"variables":[{"name":"srcpart","nodeType":"YulTypedName","src":"3792:7:8","type":""}]},{"nodeType":"YulVariableDeclaration","src":"3838:38:8","value":{"arguments":[{"arguments":[{"name":"dest","nodeType":"YulIdentifier","src":"3864:4:8"}],"functionName":{"name":"mload","nodeType":"YulIdentifier","src":"3858:5:8"},"nodeType":"YulFunctionCall","src":"3858:11:8"},{"name":"mask","nodeType":"YulIdentifier","src":"3871:4:8"}],"functionName":{"name":"and","nodeType":"YulIdentifier","src":"3854:3:8"},"nodeType":"YulFunctionCall","src":"3854:22:8"},"variables":[{"name":"destpart","nodeType":"YulTypedName","src":"3842:8:8","type":""}]},{"expression":{"arguments":[{"name":"dest","nodeType":"YulIdentifier","src":"3892:4:8"},{"arguments":[{"name":"destpart","nodeType":"YulIdentifier","src":"3901:8:8"},{"name":"srcpart","nodeType":"YulIdentifier","src":"3911:7:8"}],"functionName":{"name":"or","nodeType":"YulIdentifier","src":"3898:2:8"},"nodeType":"YulFunctionCall","src":"3898:21:8"}],"functionName":{"name":"mstore","nodeType":"YulIdentifier","src":"3885:6:8"},"nodeType":"YulFunctionCall","src":"3885:35:8"},"nodeType":"YulExpressionStatement","src":"3885:35:8"}]},"evmVersion":"london","externalReferences":[{"declaration":1373,"isOffset":false,"isSlot":false,"src":"3864:4:8","valueSize":1},{"declaration":1373,"isOffset":false,"isSlot":false,"src":"3892:4:8","valueSize":1},{"declaration":1398,"isOffset":false,"isSlot":false,"src":"3823:4:8","valueSize":1},{"declaration":1398,"isOffset":false,"isSlot":false,"src":"3871:4:8","valueSize":1},{"declaration":1376,"isOffset":false,"isSlot":false,"src":"3813:3:8","valueSize":1}],"id":1409,"nodeType":"InlineAssembly","src":"3769:159:8"}]},{"expression":{"id":1411,"name":"buf","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":1332,"src":"3947:3:8","typeDescriptions":{"typeIdentifier":"t_struct$_buffer_$1204_memory_ptr","typeString":"struct BufferChainlink.buffer memory"}},"functionReturnParameters":1343,"id":1412,"nodeType":"Return","src":"3940:10:8"}]},"documentation":{"id":1329,"nodeType":"StructuredDocumentation","src":"2401:341:8","text":" @dev Writes a byte string to a buffer. Resizes if doing so would exceed\n the capacity of the buffer.\n @param buf The buffer to append to.\n @param off The start offset to write to.\n @param data The data to append.\n @param len The number of bytes to copy.\n @return The original buffer, for chaining."},"id":1414,"implemented":true,"kind":"function","modifiers":[],"name":"write","nameLocation":"2754:5:8","nodeType":"FunctionDefinition","parameters":{"id":1339,"nodeType":"ParameterList","parameters":[{"constant":false,"id":1332,"mutability":"mutable","name":"buf","nameLocation":"2779:3:8","nodeType":"VariableDeclaration","scope":1414,"src":"2765:17:8","stateVariable":false,"storageLocation":"memory","typeDescriptions":{"typeIdentifier":"t_struct$_buffer_$1204_memory_ptr","typeString":"struct BufferChainlink.buffer"},"typeName":{"id":1331,"nodeType":"UserDefinedTypeName","pathNode":{"id":1330,"name":"buffer","nodeType":"IdentifierPath","referencedDeclaration":1204,"src":"2765:6:8"},"referencedDeclaration":1204,"src":"2765:6:8","typeDescriptions":{"typeIdentifier":"t_struct$_buffer_$1204_storage_ptr","typeString":"struct BufferChainlink.buffer"}},"visibility":"internal"},{"constant":false,"id":1334,"mutability":"mutable","name":"off","nameLocation":"2796:3:8","nodeType":"VariableDeclaration","scope":1414,"src":"2788:11:8","stateVariable":false,"storageLocation":"default","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"},"typeName":{"id":1333,"name":"uint256","nodeType":"ElementaryTypeName","src":"2788:7:8","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"}},"visibility":"internal"},{"constant":false,"id":1336,"mutability":"mutable","name":"data","nameLocation":"2818:4:8","nodeType":"VariableDeclaration","scope":1414,"src":"2805:17:8","stateVariable":false,"storageLocation":"memory","typeDescriptions":{"typeIdentifier":"t_bytes_memory_ptr","typeString":"bytes"},"typeName":{"id":1335,"name":"bytes","nodeType":"ElementaryTypeName","src":"2805:5:8","typeDescriptions":{"typeIdentifier":"t_bytes_storage_ptr","typeString":"bytes"}},"visibility":"internal"},{"constant":false,"id":1338,"mutability":"mutable","name":"len","nameLocation":"2836:3:8","nodeType":"VariableDeclaration","scope":1414,"src":"2828:11:8","stateVariable":false,"storageLocation":"default","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"},"typeName":{"id":1337,"name":"uint256","nodeType":"ElementaryTypeName","src":"2828:7:8","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"}},"visibility":"internal"}],"src":"2759:84:8"},"returnParameters":{"id":1343,"nodeType":"ParameterList","parameters":[{"constant":false,"id":1342,"mutability":"mutable","name":"","nameLocation":"-1:-1:-1","nodeType":"VariableDeclaration","scope":1414,"src":"2867:13:8","stateVariable":false,"storageLocation":"memory","typeDescriptions":{"typeIdentifier":"t_struct$_buffer_$1204_memory_ptr","typeString":"struct BufferChainlink.buffer"},"typeName":{"id":1341,"nodeType":"UserDefinedTypeName","pathNode":{"id":1340,"name":"buffer","nodeType":"IdentifierPath","referencedDeclaration":1204,"src":"2867:6:8"},"referencedDeclaration":1204,"src":"2867:6:8","typeDescriptions":{"typeIdentifier":"t_struct$_buffer_$1204_storage_ptr","typeString":"struct BufferChainlink.buffer"}},"visibility":"internal"}],"src":"2866:15:8"},"scope":1718,"src":"2745:1210:8","stateMutability":"pure","virtual":false,"visibility":"internal"},{"body":{"id":1437,"nodeType":"Block","src":"4379:55:8","statements":[{"expression":{"arguments":[{"id":1429,"name":"buf","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":1418,"src":"4398:3:8","typeDescriptions":{"typeIdentifier":"t_struct$_buffer_$1204_memory_ptr","typeString":"struct BufferChainlink.buffer memory"}},{"expression":{"expression":{"id":1430,"name":"buf","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":1418,"src":"4403:3:8","typeDescriptions":{"typeIdentifier":"t_struct$_buffer_$1204_memory_ptr","typeString":"struct BufferChainlink.buffer memory"}},"id":1431,"isConstant":false,"isLValue":true,"isPure":false,"lValueRequested":false,"memberName":"buf","nodeType":"MemberAccess","referencedDeclaration":1201,"src":"4403:7:8","typeDescriptions":{"typeIdentifier":"t_bytes_memory_ptr","typeString":"bytes memory"}},"id":1432,"isConstant":false,"isLValue":false,"isPure":false,"lValueRequested":false,"memberName":"length","nodeType":"MemberAccess","src":"4403:14:8","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"}},{"id":1433,"name":"data","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":1420,"src":"4419:4:8","typeDescriptions":{"typeIdentifier":"t_bytes_memory_ptr","typeString":"bytes memory"}},{"id":1434,"name":"len","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":1422,"src":"4425:3:8","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"}}],"expression":{"argumentTypes":[{"typeIdentifier":"t_struct$_buffer_$1204_memory_ptr","typeString":"struct BufferChainlink.buffer memory"},{"typeIdentifier":"t_uint256","typeString":"uint256"},{"typeIdentifier":"t_bytes_memory_ptr","typeString":"bytes memory"},{"typeIdentifier":"t_uint256","typeString":"uint256"}],"id":1428,"name":"write","nodeType":"Identifier","overloadedDeclarations":[1414,1574],"referencedDeclaration":1414,"src":"4392:5:8","typeDescriptions":{"typeIdentifier":"t_function_internal_pure$_t_struct$_buffer_$1204_memory_ptr_$_t_uint256_$_t_bytes_memory_ptr_$_t_uint256_$returns$_t_struct$_buffer_$1204_memory_ptr_$","typeString":"function (struct BufferChainlink.buffer memory,uint256,bytes memory,uint256) pure returns (struct BufferChainlink.buffer memory)"}},"id":1435,"isConstant":false,"isLValue":false,"isPure":false,"kind":"functionCall","lValueRequested":false,"names":[],"nodeType":"FunctionCall","src":"4392:37:8","tryCall":false,"typeDescriptions":{"typeIdentifier":"t_struct$_buffer_$1204_memory_ptr","typeString":"struct BufferChainlink.buffer memory"}},"functionReturnParameters":1427,"id":1436,"nodeType":"Return","src":"4385:44:8"}]},"documentation":{"id":1415,"nodeType":"StructuredDocumentation","src":"3959:296:8","text":" @dev Appends a byte string to a buffer. Resizes if doing so would exceed\n the capacity of the buffer.\n @param buf The buffer to append to.\n @param data The data to append.\n @param len The number of bytes to copy.\n @return The original buffer, for chaining."},"id":1438,"implemented":true,"kind":"function","modifiers":[],"name":"append","nameLocation":"4267:6:8","nodeType":"FunctionDefinition","parameters":{"id":1423,"nodeType":"ParameterList","parameters":[{"constant":false,"id":1418,"mutability":"mutable","name":"buf","nameLocation":"4293:3:8","nodeType":"VariableDeclaration","scope":1438,"src":"4279:17:8","stateVariable":false,"storageLocation":"memory","typeDescriptions":{"typeIdentifier":"t_struct$_buffer_$1204_memory_ptr","typeString":"struct BufferChainlink.buffer"},"typeName":{"id":1417,"nodeType":"UserDefinedTypeName","pathNode":{"id":1416,"name":"buffer","nodeType":"IdentifierPath","referencedDeclaration":1204,"src":"4279:6:8"},"referencedDeclaration":1204,"src":"4279:6:8","typeDescriptions":{"typeIdentifier":"t_struct$_buffer_$1204_storage_ptr","typeString":"struct BufferChainlink.buffer"}},"visibility":"internal"},{"constant":false,"id":1420,"mutability":"mutable","name":"data","nameLocation":"4315:4:8","nodeType":"VariableDeclaration","scope":1438,"src":"4302:17:8","stateVariable":false,"storageLocation":"memory","typeDescriptions":{"typeIdentifier":"t_bytes_memory_ptr","typeString":"bytes"},"typeName":{"id":1419,"name":"bytes","nodeType":"ElementaryTypeName","src":"4302:5:8","typeDescriptions":{"typeIdentifier":"t_bytes_storage_ptr","typeString":"bytes"}},"visibility":"internal"},{"constant":false,"id":1422,"mutability":"mutable","name":"len","nameLocation":"4333:3:8","nodeType":"VariableDeclaration","scope":1438,"src":"4325:11:8","stateVariable":false,"storageLocation":"default","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"},"typeName":{"id":1421,"name":"uint256","nodeType":"ElementaryTypeName","src":"4325:7:8","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"}},"visibility":"internal"}],"src":"4273:67:8"},"returnParameters":{"id":1427,"nodeType":"ParameterList","parameters":[{"constant":false,"id":1426,"mutability":"mutable","name":"","nameLocation":"-1:-1:-1","nodeType":"VariableDeclaration","scope":1438,"src":"4364:13:8","stateVariable":false,"storageLocation":"memory","typeDescriptions":{"typeIdentifier":"t_struct$_buffer_$1204_memory_ptr","typeString":"struct BufferChainlink.buffer"},"typeName":{"id":1425,"nodeType":"UserDefinedTypeName","pathNode":{"id":1424,"name":"buffer","nodeType":"IdentifierPath","referencedDeclaration":1204,"src":"4364:6:8"},"referencedDeclaration":1204,"src":"4364:6:8","typeDescriptions":{"typeIdentifier":"t_struct$_buffer_$1204_storage_ptr","typeString":"struct BufferChainlink.buffer"}},"visibility":"internal"}],"src":"4363:15:8"},"scope":1718,"src":"4258:176:8","stateMutability":"pure","virtual":false,"visibility":"internal"},{"body":{"id":1460,"nodeType":"Block","src":"4784:63:8","statements":[{"expression":{"arguments":[{"id":1451,"name":"buf","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":1442,"src":"4803:3:8","typeDescriptions":{"typeIdentifier":"t_struct$_buffer_$1204_memory_ptr","typeString":"struct BufferChainlink.buffer memory"}},{"expression":{"expression":{"id":1452,"name":"buf","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":1442,"src":"4808:3:8","typeDescriptions":{"typeIdentifier":"t_struct$_buffer_$1204_memory_ptr","typeString":"struct BufferChainlink.buffer memory"}},"id":1453,"isConstant":false,"isLValue":true,"isPure":false,"lValueRequested":false,"memberName":"buf","nodeType":"MemberAccess","referencedDeclaration":1201,"src":"4808:7:8","typeDescriptions":{"typeIdentifier":"t_bytes_memory_ptr","typeString":"bytes memory"}},"id":1454,"isConstant":false,"isLValue":false,"isPure":false,"lValueRequested":false,"memberName":"length","nodeType":"MemberAccess","src":"4808:14:8","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"}},{"id":1455,"name":"data","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":1444,"src":"4824:4:8","typeDescriptions":{"typeIdentifier":"t_bytes_memory_ptr","typeString":"bytes memory"}},{"expression":{"id":1456,"name":"data","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":1444,"src":"4830:4:8","typeDescriptions":{"typeIdentifier":"t_bytes_memory_ptr","typeString":"bytes memory"}},"id":1457,"isConstant":false,"isLValue":false,"isPure":false,"lValueRequested":false,"memberName":"length","nodeType":"MemberAccess","src":"4830:11:8","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"}}],"expression":{"argumentTypes":[{"typeIdentifier":"t_struct$_buffer_$1204_memory_ptr","typeString":"struct BufferChainlink.buffer memory"},{"typeIdentifier":"t_uint256","typeString":"uint256"},{"typeIdentifier":"t_bytes_memory_ptr","typeString":"bytes memory"},{"typeIdentifier":"t_uint256","typeString":"uint256"}],"id":1450,"name":"write","nodeType":"Identifier","overloadedDeclarations":[1414,1574],"referencedDeclaration":1414,"src":"4797:5:8","typeDescriptions":{"typeIdentifier":"t_function_internal_pure$_t_struct$_buffer_$1204_memory_ptr_$_t_uint256_$_t_bytes_memory_ptr_$_t_uint256_$returns$_t_struct$_buffer_$1204_memory_ptr_$","typeString":"function (struct BufferChainlink.buffer memory,uint256,bytes memory,uint256) pure returns (struct BufferChainlink.buffer memory)"}},"id":1458,"isConstant":false,"isLValue":false,"isPure":false,"kind":"functionCall","lValueRequested":false,"names":[],"nodeType":"FunctionCall","src":"4797:45:8","tryCall":false,"typeDescriptions":{"typeIdentifier":"t_struct$_buffer_$1204_memory_ptr","typeString":"struct BufferChainlink.buffer memory"}},"functionReturnParameters":1449,"id":1459,"nodeType":"Return","src":"4790:52:8"}]},"documentation":{"id":1439,"nodeType":"StructuredDocumentation","src":"4438:251:8","text":" @dev Appends a byte string to a buffer. Resizes if doing so would exceed\n the capacity of the buffer.\n @param buf The buffer to append to.\n @param data The data to append.\n @return The original buffer, for chaining."},"id":1461,"implemented":true,"kind":"function","modifiers":[],"name":"append","nameLocation":"4701:6:8","nodeType":"FunctionDefinition","parameters":{"id":1445,"nodeType":"ParameterList","parameters":[{"constant":false,"id":1442,"mutability":"mutable","name":"buf","nameLocation":"4722:3:8","nodeType":"VariableDeclaration","scope":1461,"src":"4708:17:8","stateVariable":false,"storageLocation":"memory","typeDescriptions":{"typeIdentifier":"t_struct$_buffer_$1204_memory_ptr","typeString":"struct BufferChainlink.buffer"},"typeName":{"id":1441,"nodeType":"UserDefinedTypeName","pathNode":{"id":1440,"name":"buffer","nodeType":"IdentifierPath","referencedDeclaration":1204,"src":"4708:6:8"},"referencedDeclaration":1204,"src":"4708:6:8","typeDescriptions":{"typeIdentifier":"t_struct$_buffer_$1204_storage_ptr","typeString":"struct BufferChainlink.buffer"}},"visibility":"internal"},{"constant":false,"id":1444,"mutability":"mutable","name":"data","nameLocation":"4740:4:8","nodeType":"VariableDeclaration","scope":1461,"src":"4727:17:8","stateVariable":false,"storageLocation":"memory","typeDescriptions":{"typeIdentifier":"t_bytes_memory_ptr","typeString":"bytes"},"typeName":{"id":1443,"name":"bytes","nodeType":"ElementaryTypeName","src":"4727:5:8","typeDescriptions":{"typeIdentifier":"t_bytes_storage_ptr","typeString":"bytes"}},"visibility":"internal"}],"src":"4707:38:8"},"returnParameters":{"id":1449,"nodeType":"ParameterList","parameters":[{"constant":false,"id":1448,"mutability":"mutable","name":"","nameLocation":"-1:-1:-1","nodeType":"VariableDeclaration","scope":1461,"src":"4769:13:8","stateVariable":false,"storageLocation":"memory","typeDescriptions":{"typeIdentifier":"t_struct$_buffer_$1204_memory_ptr","typeString":"struct BufferChainlink.buffer"},"typeName":{"id":1447,"nodeType":"UserDefinedTypeName","pathNode":{"id":1446,"name":"buffer","nodeType":"IdentifierPath","referencedDeclaration":1204,"src":"4769:6:8"},"referencedDeclaration":1204,"src":"4769:6:8","typeDescriptions":{"typeIdentifier":"t_struct$_buffer_$1204_storage_ptr","typeString":"struct BufferChainlink.buffer"}},"visibility":"internal"}],"src":"4768:15:8"},"scope":1718,"src":"4692:155:8","stateMutability":"pure","virtual":false,"visibility":"internal"},{"body":{"id":1492,"nodeType":"Block","src":"5266:521:8","statements":[{"condition":{"commonType":{"typeIdentifier":"t_uint256","typeString":"uint256"},"id":1478,"isConstant":false,"isLValue":false,"isPure":false,"lValueRequested":false,"leftExpression":{"id":1475,"name":"off","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":1467,"src":"5276:3:8","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"}},"nodeType":"BinaryOperation","operator":">=","rightExpression":{"expression":{"id":1476,"name":"buf","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":1465,"src":"5283:3:8","typeDescriptions":{"typeIdentifier":"t_struct$_buffer_$1204_memory_ptr","typeString":"struct BufferChainlink.buffer memory"}},"id":1477,"isConstant":false,"isLValue":true,"isPure":false,"lValueRequested":false,"memberName":"capacity","nodeType":"MemberAccess","referencedDeclaration":1203,"src":"5283:12:8","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"}},"src":"5276:19:8","typeDescriptions":{"typeIdentifier":"t_bool","typeString":"bool"}},"id":1488,"nodeType":"IfStatement","src":"5272:69:8","trueBody":{"id":1487,"nodeType":"Block","src":"5297:44:8","statements":[{"expression":{"arguments":[{"id":1480,"name":"buf","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":1465,"src":"5312:3:8","typeDescriptions":{"typeIdentifier":"t_struct$_buffer_$1204_memory_ptr","typeString":"struct BufferChainlink.buffer memory"}},{"commonType":{"typeIdentifier":"t_uint256","typeString":"uint256"},"id":1484,"isConstant":false,"isLValue":false,"isPure":false,"lValueRequested":false,"leftExpression":{"expression":{"id":1481,"name":"buf","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":1465,"src":"5317:3:8","typeDescriptions":{"typeIdentifier":"t_struct$_buffer_$1204_memory_ptr","typeString":"struct BufferChainlink.buffer memory"}},"id":1482,"isConstant":false,"isLValue":true,"isPure":false,"lValueRequested":false,"memberName":"capacity","nodeType":"MemberAccess","referencedDeclaration":1203,"src":"5317:12:8","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"}},"nodeType":"BinaryOperation","operator":"*","rightExpression":{"hexValue":"32","id":1483,"isConstant":false,"isLValue":false,"isPure":true,"kind":"number","lValueRequested":false,"nodeType":"Literal","src":"5332:1:8","typeDescriptions":{"typeIdentifier":"t_rational_2_by_1","typeString":"int_const 2"},"value":"2"},"src":"5317:16:8","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"}}],"expression":{"argumentTypes":[{"typeIdentifier":"t_struct$_buffer_$1204_memory_ptr","typeString":"struct BufferChainlink.buffer memory"},{"typeIdentifier":"t_uint256","typeString":"uint256"}],"id":1479,"name":"resize","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":1295,"src":"5305:6:8","typeDescriptions":{"typeIdentifier":"t_function_internal_pure$_t_struct$_buffer_$1204_memory_ptr_$_t_uint256_$returns$__$","typeString":"function (struct BufferChainlink.buffer memory,uint256) pure"}},"id":1485,"isConstant":false,"isLValue":false,"isPure":false,"kind":"functionCall","lValueRequested":false,"names":[],"nodeType":"FunctionCall","src":"5305:29:8","tryCall":false,"typeDescriptions":{"typeIdentifier":"t_tuple$__$","typeString":"tuple()"}},"id":1486,"nodeType":"ExpressionStatement","src":"5305:29:8"}]}},{"AST":{"nodeType":"YulBlock","src":"5356:411:8","statements":[{"nodeType":"YulVariableDeclaration","src":"5407:24:8","value":{"arguments":[{"name":"buf","nodeType":"YulIdentifier","src":"5427:3:8"}],"functionName":{"name":"mload","nodeType":"YulIdentifier","src":"5421:5:8"},"nodeType":"YulFunctionCall","src":"5421:10:8"},"variables":[{"name":"bufptr","nodeType":"YulTypedName","src":"5411:6:8","type":""}]},{"nodeType":"YulVariableDeclaration","src":"5478:27:8","value":{"arguments":[{"name":"bufptr","nodeType":"YulIdentifier","src":"5498:6:8"}],"functionName":{"name":"mload","nodeType":"YulIdentifier","src":"5492:5:8"},"nodeType":"YulFunctionCall","src":"5492:13:8"},"variables":[{"name":"buflen","nodeType":"YulTypedName","src":"5482:6:8","type":""}]},{"nodeType":"YulVariableDeclaration","src":"5576:37:8","value":{"arguments":[{"arguments":[{"name":"bufptr","nodeType":"YulIdentifier","src":"5596:6:8"},{"name":"off","nodeType":"YulIdentifier","src":"5604:3:8"}],"functionName":{"name":"add","nodeType":"YulIdentifier","src":"5592:3:8"},"nodeType":"YulFunctionCall","src":"5592:16:8"},{"kind":"number","nodeType":"YulLiteral","src":"5610:2:8","type":"","value":"32"}],"functionName":{"name":"add","nodeType":"YulIdentifier","src":"5588:3:8"},"nodeType":"YulFunctionCall","src":"5588:25:8"},"variables":[{"name":"dest","nodeType":"YulTypedName","src":"5580:4:8","type":""}]},{"expression":{"arguments":[{"name":"dest","nodeType":"YulIdentifier","src":"5628:4:8"},{"name":"data","nodeType":"YulIdentifier","src":"5634:4:8"}],"functionName":{"name":"mstore8","nodeType":"YulIdentifier","src":"5620:7:8"},"nodeType":"YulFunctionCall","src":"5620:19:8"},"nodeType":"YulExpressionStatement","src":"5620:19:8"},{"body":{"nodeType":"YulBlock","src":"5713:48:8","statements":[{"expression":{"arguments":[{"name":"bufptr","nodeType":"YulIdentifier","src":"5730:6:8"},{"arguments":[{"name":"buflen","nodeType":"YulIdentifier","src":"5742:6:8"},{"kind":"number","nodeType":"YulLiteral","src":"5750:1:8","type":"","value":"1"}],"functionName":{"name":"add","nodeType":"YulIdentifier","src":"5738:3:8"},"nodeType":"YulFunctionCall","src":"5738:14:8"}],"functionName":{"name":"mstore","nodeType":"YulIdentifier","src":"5723:6:8"},"nodeType":"YulFunctionCall","src":"5723:30:8"},"nodeType":"YulExpressionStatement","src":"5723:30:8"}]},"condition":{"arguments":[{"name":"off","nodeType":"YulIdentifier","src":"5700:3:8"},{"name":"buflen","nodeType":"YulIdentifier","src":"5705:6:8"}],"functionName":{"name":"eq","nodeType":"YulIdentifier","src":"5697:2:8"},"nodeType":"YulFunctionCall","src":"5697:15:8"},"nodeType":"YulIf","src":"5694:67:8"}]},"evmVersion":"london","externalReferences":[{"declaration":1465,"isOffset":false,"isSlot":false,"src":"5427:3:8","valueSize":1},{"declaration":1469,"isOffset":false,"isSlot":false,"src":"5634:4:8","valueSize":1},{"declaration":1467,"isOffset":false,"isSlot":false,"src":"5604:3:8","valueSize":1},{"declaration":1467,"isOffset":false,"isSlot":false,"src":"5700:3:8","valueSize":1}],"id":1489,"nodeType":"InlineAssembly","src":"5347:420:8"},{"expression":{"id":1490,"name":"buf","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":1465,"src":"5779:3:8","typeDescriptions":{"typeIdentifier":"t_struct$_buffer_$1204_memory_ptr","typeString":"struct BufferChainlink.buffer memory"}},"functionReturnParameters":1474,"id":1491,"nodeType":"Return","src":"5772:10:8"}]},"documentation":{"id":1462,"nodeType":"StructuredDocumentation","src":"4851:294:8","text":" @dev Writes a byte to the buffer. Resizes if doing so would exceed the\n capacity of the buffer.\n @param buf The buffer to append to.\n @param off The offset to write the byte at.\n @param data The data to append.\n @return The original buffer, for chaining."},"id":1493,"implemented":true,"kind":"function","modifiers":[],"name":"writeUint8","nameLocation":"5157:10:8","nodeType":"FunctionDefinition","parameters":{"id":1470,"nodeType":"ParameterList","parameters":[{"constant":false,"id":1465,"mutability":"mutable","name":"buf","nameLocation":"5187:3:8","nodeType":"VariableDeclaration","scope":1493,"src":"5173:17:8","stateVariable":false,"storageLocation":"memory","typeDescriptions":{"typeIdentifier":"t_struct$_buffer_$1204_memory_ptr","typeString":"struct BufferChainlink.buffer"},"typeName":{"id":1464,"nodeType":"UserDefinedTypeName","pathNode":{"id":1463,"name":"buffer","nodeType":"IdentifierPath","referencedDeclaration":1204,"src":"5173:6:8"},"referencedDeclaration":1204,"src":"5173:6:8","typeDescriptions":{"typeIdentifier":"t_struct$_buffer_$1204_storage_ptr","typeString":"struct BufferChainlink.buffer"}},"visibility":"internal"},{"constant":false,"id":1467,"mutability":"mutable","name":"off","nameLocation":"5204:3:8","nodeType":"VariableDeclaration","scope":1493,"src":"5196:11:8","stateVariable":false,"storageLocation":"default","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"},"typeName":{"id":1466,"name":"uint256","nodeType":"ElementaryTypeName","src":"5196:7:8","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"}},"visibility":"internal"},{"constant":false,"id":1469,"mutability":"mutable","name":"data","nameLocation":"5219:4:8","nodeType":"VariableDeclaration","scope":1493,"src":"5213:10:8","stateVariable":false,"storageLocation":"default","typeDescriptions":{"typeIdentifier":"t_uint8","typeString":"uint8"},"typeName":{"id":1468,"name":"uint8","nodeType":"ElementaryTypeName","src":"5213:5:8","typeDescriptions":{"typeIdentifier":"t_uint8","typeString":"uint8"}},"visibility":"internal"}],"src":"5167:60:8"},"returnParameters":{"id":1474,"nodeType":"ParameterList","parameters":[{"constant":false,"id":1473,"mutability":"mutable","name":"","nameLocation":"-1:-1:-1","nodeType":"VariableDeclaration","scope":1493,"src":"5251:13:8","stateVariable":false,"storageLocation":"memory","typeDescriptions":{"typeIdentifier":"t_struct$_buffer_$1204_memory_ptr","typeString":"struct BufferChainlink.buffer"},"typeName":{"id":1472,"nodeType":"UserDefinedTypeName","pathNode":{"id":1471,"name":"buffer","nodeType":"IdentifierPath","referencedDeclaration":1204,"src":"5251:6:8"},"referencedDeclaration":1204,"src":"5251:6:8","typeDescriptions":{"typeIdentifier":"t_struct$_buffer_$1204_storage_ptr","typeString":"struct BufferChainlink.buffer"}},"visibility":"internal"}],"src":"5250:15:8"},"scope":1718,"src":"5148:639:8","stateMutability":"pure","virtual":false,"visibility":"internal"},{"body":{"id":1513,"nodeType":"Block","src":"6130:55:8","statements":[{"expression":{"arguments":[{"id":1506,"name":"buf","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":1497,"src":"6154:3:8","typeDescriptions":{"typeIdentifier":"t_struct$_buffer_$1204_memory_ptr","typeString":"struct BufferChainlink.buffer memory"}},{"expression":{"expression":{"id":1507,"name":"buf","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":1497,"src":"6159:3:8","typeDescriptions":{"typeIdentifier":"t_struct$_buffer_$1204_memory_ptr","typeString":"struct BufferChainlink.buffer memory"}},"id":1508,"isConstant":false,"isLValue":true,"isPure":false,"lValueRequested":false,"memberName":"buf","nodeType":"MemberAccess","referencedDeclaration":1201,"src":"6159:7:8","typeDescriptions":{"typeIdentifier":"t_bytes_memory_ptr","typeString":"bytes memory"}},"id":1509,"isConstant":false,"isLValue":false,"isPure":false,"lValueRequested":false,"memberName":"length","nodeType":"MemberAccess","src":"6159:14:8","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"}},{"id":1510,"name":"data","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":1499,"src":"6175:4:8","typeDescriptions":{"typeIdentifier":"t_uint8","typeString":"uint8"}}],"expression":{"argumentTypes":[{"typeIdentifier":"t_struct$_buffer_$1204_memory_ptr","typeString":"struct BufferChainlink.buffer memory"},{"typeIdentifier":"t_uint256","typeString":"uint256"},{"typeIdentifier":"t_uint8","typeString":"uint8"}],"id":1505,"name":"writeUint8","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":1493,"src":"6143:10:8","typeDescriptions":{"typeIdentifier":"t_function_internal_pure$_t_struct$_buffer_$1204_memory_ptr_$_t_uint256_$_t_uint8_$returns$_t_struct$_buffer_$1204_memory_ptr_$","typeString":"function (struct BufferChainlink.buffer memory,uint256,uint8) pure returns (struct BufferChainlink.buffer memory)"}},"id":1511,"isConstant":false,"isLValue":false,"isPure":false,"kind":"functionCall","lValueRequested":false,"names":[],"nodeType":"FunctionCall","src":"6143:37:8","tryCall":false,"typeDescriptions":{"typeIdentifier":"t_struct$_buffer_$1204_memory_ptr","typeString":"struct BufferChainlink.buffer memory"}},"functionReturnParameters":1504,"id":1512,"nodeType":"Return","src":"6136:44:8"}]},"documentation":{"id":1494,"nodeType":"StructuredDocumentation","src":"5791:246:8","text":" @dev Appends a byte to the buffer. Resizes if doing so would exceed the\n capacity of the buffer.\n @param buf The buffer to append to.\n @param data The data to append.\n @return The original buffer, for chaining."},"id":1514,"implemented":true,"kind":"function","modifiers":[],"name":"appendUint8","nameLocation":"6049:11:8","nodeType":"FunctionDefinition","parameters":{"id":1500,"nodeType":"ParameterList","parameters":[{"constant":false,"id":1497,"mutability":"mutable","name":"buf","nameLocation":"6075:3:8","nodeType":"VariableDeclaration","scope":1514,"src":"6061:17:8","stateVariable":false,"storageLocation":"memory","typeDescriptions":{"typeIdentifier":"t_struct$_buffer_$1204_memory_ptr","typeString":"struct BufferChainlink.buffer"},"typeName":{"id":1496,"nodeType":"UserDefinedTypeName","pathNode":{"id":1495,"name":"buffer","nodeType":"IdentifierPath","referencedDeclaration":1204,"src":"6061:6:8"},"referencedDeclaration":1204,"src":"6061:6:8","typeDescriptions":{"typeIdentifier":"t_struct$_buffer_$1204_storage_ptr","typeString":"struct BufferChainlink.buffer"}},"visibility":"internal"},{"constant":false,"id":1499,"mutability":"mutable","name":"data","nameLocation":"6086:4:8","nodeType":"VariableDeclaration","scope":1514,"src":"6080:10:8","stateVariable":false,"storageLocation":"default","typeDescriptions":{"typeIdentifier":"t_uint8","typeString":"uint8"},"typeName":{"id":1498,"name":"uint8","nodeType":"ElementaryTypeName","src":"6080:5:8","typeDescriptions":{"typeIdentifier":"t_uint8","typeString":"uint8"}},"visibility":"internal"}],"src":"6060:31:8"},"returnParameters":{"id":1504,"nodeType":"ParameterList","parameters":[{"constant":false,"id":1503,"mutability":"mutable","name":"","nameLocation":"-1:-1:-1","nodeType":"VariableDeclaration","scope":1514,"src":"6115:13:8","stateVariable":false,"storageLocation":"memory","typeDescriptions":{"typeIdentifier":"t_struct$_buffer_$1204_memory_ptr","typeString":"struct BufferChainlink.buffer"},"typeName":{"id":1502,"nodeType":"UserDefinedTypeName","pathNode":{"id":1501,"name":"buffer","nodeType":"IdentifierPath","referencedDeclaration":1204,"src":"6115:6:8"},"referencedDeclaration":1204,"src":"6115:6:8","typeDescriptions":{"typeIdentifier":"t_struct$_buffer_$1204_storage_ptr","typeString":"struct BufferChainlink.buffer"}},"visibility":"internal"}],"src":"6114:15:8"},"scope":1718,"src":"6040:145:8","stateMutability":"pure","virtual":false,"visibility":"internal"},{"body":{"id":1573,"nodeType":"Block","src":"6677:652:8","statements":[{"condition":{"commonType":{"typeIdentifier":"t_uint256","typeString":"uint256"},"id":1535,"isConstant":false,"isLValue":false,"isPure":false,"lValueRequested":false,"leftExpression":{"commonType":{"typeIdentifier":"t_uint256","typeString":"uint256"},"id":1532,"isConstant":false,"isLValue":false,"isPure":false,"lValueRequested":false,"leftExpression":{"id":1530,"name":"len","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":1524,"src":"6687:3:8","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"}},"nodeType":"BinaryOperation","operator":"+","rightExpression":{"id":1531,"name":"off","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":1520,"src":"6693:3:8","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"}},"src":"6687:9:8","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"}},"nodeType":"BinaryOperation","operator":">","rightExpression":{"expression":{"id":1533,"name":"buf","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":1518,"src":"6699:3:8","typeDescriptions":{"typeIdentifier":"t_struct$_buffer_$1204_memory_ptr","typeString":"struct BufferChainlink.buffer memory"}},"id":1534,"isConstant":false,"isLValue":true,"isPure":false,"lValueRequested":false,"memberName":"capacity","nodeType":"MemberAccess","referencedDeclaration":1203,"src":"6699:12:8","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"}},"src":"6687:24:8","typeDescriptions":{"typeIdentifier":"t_bool","typeString":"bool"}},"id":1547,"nodeType":"IfStatement","src":"6683:73:8","trueBody":{"id":1546,"nodeType":"Block","src":"6713:43:8","statements":[{"expression":{"arguments":[{"id":1537,"name":"buf","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":1518,"src":"6728:3:8","typeDescriptions":{"typeIdentifier":"t_struct$_buffer_$1204_memory_ptr","typeString":"struct BufferChainlink.buffer memory"}},{"commonType":{"typeIdentifier":"t_uint256","typeString":"uint256"},"id":1543,"isConstant":false,"isLValue":false,"isPure":false,"lValueRequested":false,"leftExpression":{"components":[{"commonType":{"typeIdentifier":"t_uint256","typeString":"uint256"},"id":1540,"isConstant":false,"isLValue":false,"isPure":false,"lValueRequested":false,"leftExpression":{"id":1538,"name":"len","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":1524,"src":"6734:3:8","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"}},"nodeType":"BinaryOperation","operator":"+","rightExpression":{"id":1539,"name":"off","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":1520,"src":"6740:3:8","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"}},"src":"6734:9:8","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"}}],"id":1541,"isConstant":false,"isInlineArray":false,"isLValue":false,"isPure":false,"lValueRequested":false,"nodeType":"TupleExpression","src":"6733:11:8","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"}},"nodeType":"BinaryOperation","operator":"*","rightExpression":{"hexValue":"32","id":1542,"isConstant":false,"isLValue":false,"isPure":true,"kind":"number","lValueRequested":false,"nodeType":"Literal","src":"6747:1:8","typeDescriptions":{"typeIdentifier":"t_rational_2_by_1","typeString":"int_const 2"},"value":"2"},"src":"6733:15:8","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"}}],"expression":{"argumentTypes":[{"typeIdentifier":"t_struct$_buffer_$1204_memory_ptr","typeString":"struct BufferChainlink.buffer memory"},{"typeIdentifier":"t_uint256","typeString":"uint256"}],"id":1536,"name":"resize","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":1295,"src":"6721:6:8","typeDescriptions":{"typeIdentifier":"t_function_internal_pure$_t_struct$_buffer_$1204_memory_ptr_$_t_uint256_$returns$__$","typeString":"function (struct BufferChainlink.buffer memory,uint256) pure"}},"id":1544,"isConstant":false,"isLValue":false,"isPure":false,"kind":"functionCall","lValueRequested":false,"names":[],"nodeType":"FunctionCall","src":"6721:28:8","tryCall":false,"typeDescriptions":{"typeIdentifier":"t_tuple$__$","typeString":"tuple()"}},"id":1545,"nodeType":"ExpressionStatement","src":"6721:28:8"}]}},{"id":1570,"nodeType":"UncheckedBlock","src":"6762:547:8","statements":[{"assignments":[1549],"declarations":[{"constant":false,"id":1549,"mutability":"mutable","name":"mask","nameLocation":"6788:4:8","nodeType":"VariableDeclaration","scope":1570,"src":"6780:12:8","stateVariable":false,"storageLocation":"default","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"},"typeName":{"id":1548,"name":"uint256","nodeType":"ElementaryTypeName","src":"6780:7:8","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"}},"visibility":"internal"}],"id":1556,"initialValue":{"commonType":{"typeIdentifier":"t_uint256","typeString":"uint256"},"id":1555,"isConstant":false,"isLValue":false,"isPure":false,"lValueRequested":false,"leftExpression":{"components":[{"commonType":{"typeIdentifier":"t_uint256","typeString":"uint256"},"id":1552,"isConstant":false,"isLValue":false,"isPure":false,"lValueRequested":false,"leftExpression":{"hexValue":"323536","id":1550,"isConstant":false,"isLValue":false,"isPure":true,"kind":"number","lValueRequested":false,"nodeType":"Literal","src":"6796:3:8","typeDescriptions":{"typeIdentifier":"t_rational_256_by_1","typeString":"int_const 256"},"value":"256"},"nodeType":"BinaryOperation","operator":"**","rightExpression":{"id":1551,"name":"len","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":1524,"src":"6801:3:8","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"}},"src":"6796:8:8","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"}}],"id":1553,"isConstant":false,"isInlineArray":false,"isLValue":false,"isPure":false,"lValueRequested":false,"nodeType":"TupleExpression","src":"6795:10:8","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"}},"nodeType":"BinaryOperation","operator":"-","rightExpression":{"hexValue":"31","id":1554,"isConstant":false,"isLValue":false,"isPure":true,"kind":"number","lValueRequested":false,"nodeType":"Literal","src":"6808:1:8","typeDescriptions":{"typeIdentifier":"t_rational_1_by_1","typeString":"int_const 1"},"value":"1"},"src":"6795:14:8","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"}},"nodeType":"VariableDeclarationStatement","src":"6780:29:8"},{"expression":{"id":1567,"isConstant":false,"isLValue":false,"isPure":false,"lValueRequested":false,"leftHandSide":{"id":1557,"name":"data","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":1522,"src":"6843:4:8","typeDescriptions":{"typeIdentifier":"t_bytes32","typeString":"bytes32"}},"nodeType":"Assignment","operator":"=","rightHandSide":{"commonType":{"typeIdentifier":"t_bytes32","typeString":"bytes32"},"id":1566,"isConstant":false,"isLValue":false,"isPure":false,"lValueRequested":false,"leftExpression":{"id":1558,"name":"data","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":1522,"src":"6850:4:8","typeDescriptions":{"typeIdentifier":"t_bytes32","typeString":"bytes32"}},"nodeType":"BinaryOperation","operator":">>","rightExpression":{"components":[{"commonType":{"typeIdentifier":"t_uint256","typeString":"uint256"},"id":1564,"isConstant":false,"isLValue":false,"isPure":false,"lValueRequested":false,"leftExpression":{"hexValue":"38","id":1559,"isConstant":false,"isLValue":false,"isPure":true,"kind":"number","lValueRequested":false,"nodeType":"Literal","src":"6859:1:8","typeDescriptions":{"typeIdentifier":"t_rational_8_by_1","typeString":"int_const 8"},"value":"8"},"nodeType":"BinaryOperation","operator":"*","rightExpression":{"components":[{"commonType":{"typeIdentifier":"t_uint256","typeString":"uint256"},"id":1562,"isConstant":false,"isLValue":false,"isPure":false,"lValueRequested":false,"leftExpression":{"hexValue":"3332","id":1560,"isConstant":false,"isLValue":false,"isPure":true,"kind":"number","lValueRequested":false,"nodeType":"Literal","src":"6864:2:8","typeDescriptions":{"typeIdentifier":"t_rational_32_by_1","typeString":"int_const 32"},"value":"32"},"nodeType":"BinaryOperation","operator":"-","rightExpression":{"id":1561,"name":"len","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":1524,"src":"6869:3:8","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"}},"src":"6864:8:8","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"}}],"id":1563,"isConstant":false,"isInlineArray":false,"isLValue":false,"isPure":false,"lValueRequested":false,"nodeType":"TupleExpression","src":"6863:10:8","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"}},"src":"6859:14:8","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"}}],"id":1565,"isConstant":false,"isInlineArray":false,"isLValue":false,"isPure":false,"lValueRequested":false,"nodeType":"TupleExpression","src":"6858:16:8","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"}},"src":"6850:24:8","typeDescriptions":{"typeIdentifier":"t_bytes32","typeString":"bytes32"}},"src":"6843:31:8","typeDescriptions":{"typeIdentifier":"t_bytes32","typeString":"bytes32"}},"id":1568,"nodeType":"ExpressionStatement","src":"6843:31:8"},{"AST":{"nodeType":"YulBlock","src":"6891:412:8","statements":[{"nodeType":"YulVariableDeclaration","src":"6946:24:8","value":{"arguments":[{"name":"buf","nodeType":"YulIdentifier","src":"6966:3:8"}],"functionName":{"name":"mload","nodeType":"YulIdentifier","src":"6960:5:8"},"nodeType":"YulFunctionCall","src":"6960:10:8"},"variables":[{"name":"bufptr","nodeType":"YulTypedName","src":"6950:6:8","type":""}]},{"nodeType":"YulVariableDeclaration","src":"7051:38:8","value":{"arguments":[{"arguments":[{"name":"bufptr","nodeType":"YulIdentifier","src":"7071:6:8"},{"name":"off","nodeType":"YulIdentifier","src":"7079:3:8"}],"functionName":{"name":"add","nodeType":"YulIdentifier","src":"7067:3:8"},"nodeType":"YulFunctionCall","src":"7067:16:8"},{"name":"len","nodeType":"YulIdentifier","src":"7085:3:8"}],"functionName":{"name":"add","nodeType":"YulIdentifier","src":"7063:3:8"},"nodeType":"YulFunctionCall","src":"7063:26:8"},"variables":[{"name":"dest","nodeType":"YulTypedName","src":"7055:4:8","type":""}]},{"expression":{"arguments":[{"name":"dest","nodeType":"YulIdentifier","src":"7105:4:8"},{"arguments":[{"arguments":[{"arguments":[{"name":"dest","nodeType":"YulIdentifier","src":"7124:4:8"}],"functionName":{"name":"mload","nodeType":"YulIdentifier","src":"7118:5:8"},"nodeType":"YulFunctionCall","src":"7118:11:8"},{"arguments":[{"name":"mask","nodeType":"YulIdentifier","src":"7135:4:8"}],"functionName":{"name":"not","nodeType":"YulIdentifier","src":"7131:3:8"},"nodeType":"YulFunctionCall","src":"7131:9:8"}],"functionName":{"name":"and","nodeType":"YulIdentifier","src":"7114:3:8"},"nodeType":"YulFunctionCall","src":"7114:27:8"},{"name":"data","nodeType":"YulIdentifier","src":"7143:4:8"}],"functionName":{"name":"or","nodeType":"YulIdentifier","src":"7111:2:8"},"nodeType":"YulFunctionCall","src":"7111:37:8"}],"functionName":{"name":"mstore","nodeType":"YulIdentifier","src":"7098:6:8"},"nodeType":"YulFunctionCall","src":"7098:51:8"},"nodeType":"YulExpressionStatement","src":"7098:51:8"},{"body":{"nodeType":"YulBlock","src":"7244:51:8","statements":[{"expression":{"arguments":[{"name":"bufptr","nodeType":"YulIdentifier","src":"7263:6:8"},{"arguments":[{"name":"off","nodeType":"YulIdentifier","src":"7275:3:8"},{"name":"len","nodeType":"YulIdentifier","src":"7280:3:8"}],"functionName":{"name":"add","nodeType":"YulIdentifier","src":"7271:3:8"},"nodeType":"YulFunctionCall","src":"7271:13:8"}],"functionName":{"name":"mstore","nodeType":"YulIdentifier","src":"7256:6:8"},"nodeType":"YulFunctionCall","src":"7256:29:8"},"nodeType":"YulExpressionStatement","src":"7256:29:8"}]},"condition":{"arguments":[{"arguments":[{"name":"off","nodeType":"YulIdentifier","src":"7218:3:8"},{"name":"len","nodeType":"YulIdentifier","src":"7223:3:8"}],"functionName":{"name":"add","nodeType":"YulIdentifier","src":"7214:3:8"},"nodeType":"YulFunctionCall","src":"7214:13:8"},{"arguments":[{"name":"bufptr","nodeType":"YulIdentifier","src":"7235:6:8"}],"functionName":{"name":"mload","nodeType":"YulIdentifier","src":"7229:5:8"},"nodeType":"YulFunctionCall","src":"7229:13:8"}],"functionName":{"name":"gt","nodeType":"YulIdentifier","src":"7211:2:8"},"nodeType":"YulFunctionCall","src":"7211:32:8"},"nodeType":"YulIf","src":"7208:87:8"}]},"evmVersion":"london","externalReferences":[{"declaration":1518,"isOffset":false,"isSlot":false,"src":"6966:3:8","valueSize":1},{"declaration":1522,"isOffset":false,"isSlot":false,"src":"7143:4:8","valueSize":1},{"declaration":1524,"isOffset":false,"isSlot":false,"src":"7085:3:8","valueSize":1},{"declaration":1524,"isOffset":false,"isSlot":false,"src":"7223:3:8","valueSize":1},{"declaration":1524,"isOffset":false,"isSlot":false,"src":"7280:3:8","valueSize":1},{"declaration":1549,"isOffset":false,"isSlot":false,"src":"7135:4:8","valueSize":1},{"declaration":1520,"isOffset":false,"isSlot":false,"src":"7079:3:8","valueSize":1},{"declaration":1520,"isOffset":false,"isSlot":false,"src":"7218:3:8","valueSize":1},{"declaration":1520,"isOffset":false,"isSlot":false,"src":"7275:3:8","valueSize":1}],"id":1569,"nodeType":"InlineAssembly","src":"6882:421:8"}]},{"expression":{"id":1571,"name":"buf","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":1518,"src":"7321:3:8","typeDescriptions":{"typeIdentifier":"t_struct$_buffer_$1204_memory_ptr","typeString":"struct BufferChainlink.buffer memory"}},"functionReturnParameters":1529,"id":1572,"nodeType":"Return","src":"7314:10:8"}]},"documentation":{"id":1515,"nodeType":"StructuredDocumentation","src":"6189:354:8","text":" @dev Writes up to 32 bytes to the buffer. Resizes if doing so would\n exceed the capacity of the buffer.\n @param buf The buffer to append to.\n @param off The offset to write at.\n @param data The data to append.\n @param len The number of bytes to write (left-aligned).\n @return The original buffer, for chaining."},"id":1574,"implemented":true,"kind":"function","modifiers":[],"name":"write","nameLocation":"6555:5:8","nodeType":"FunctionDefinition","parameters":{"id":1525,"nodeType":"ParameterList","parameters":[{"constant":false,"id":1518,"mutability":"mutable","name":"buf","nameLocation":"6580:3:8","nodeType":"VariableDeclaration","scope":1574,"src":"6566:17:8","stateVariable":false,"storageLocation":"memory","typeDescriptions":{"typeIdentifier":"t_struct$_buffer_$1204_memory_ptr","typeString":"struct BufferChainlink.buffer"},"typeName":{"id":1517,"nodeType":"UserDefinedTypeName","pathNode":{"id":1516,"name":"buffer","nodeType":"IdentifierPath","referencedDeclaration":1204,"src":"6566:6:8"},"referencedDeclaration":1204,"src":"6566:6:8","typeDescriptions":{"typeIdentifier":"t_struct$_buffer_$1204_storage_ptr","typeString":"struct BufferChainlink.buffer"}},"visibility":"internal"},{"constant":false,"id":1520,"mutability":"mutable","name":"off","nameLocation":"6597:3:8","nodeType":"VariableDeclaration","scope":1574,"src":"6589:11:8","stateVariable":false,"storageLocation":"default","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"},"typeName":{"id":1519,"name":"uint256","nodeType":"ElementaryTypeName","src":"6589:7:8","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"}},"visibility":"internal"},{"constant":false,"id":1522,"mutability":"mutable","name":"data","nameLocation":"6614:4:8","nodeType":"VariableDeclaration","scope":1574,"src":"6606:12:8","stateVariable":false,"storageLocation":"default","typeDescriptions":{"typeIdentifier":"t_bytes32","typeString":"bytes32"},"typeName":{"id":1521,"name":"bytes32","nodeType":"ElementaryTypeName","src":"6606:7:8","typeDescriptions":{"typeIdentifier":"t_bytes32","typeString":"bytes32"}},"visibility":"internal"},{"constant":false,"id":1524,"mutability":"mutable","name":"len","nameLocation":"6632:3:8","nodeType":"VariableDeclaration","scope":1574,"src":"6624:11:8","stateVariable":false,"storageLocation":"default","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"},"typeName":{"id":1523,"name":"uint256","nodeType":"ElementaryTypeName","src":"6624:7:8","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"}},"visibility":"internal"}],"src":"6560:79:8"},"returnParameters":{"id":1529,"nodeType":"ParameterList","parameters":[{"constant":false,"id":1528,"mutability":"mutable","name":"","nameLocation":"-1:-1:-1","nodeType":"VariableDeclaration","scope":1574,"src":"6662:13:8","stateVariable":false,"storageLocation":"memory","typeDescriptions":{"typeIdentifier":"t_struct$_buffer_$1204_memory_ptr","typeString":"struct BufferChainlink.buffer"},"typeName":{"id":1527,"nodeType":"UserDefinedTypeName","pathNode":{"id":1526,"name":"buffer","nodeType":"IdentifierPath","referencedDeclaration":1204,"src":"6662:6:8"},"referencedDeclaration":1204,"src":"6662:6:8","typeDescriptions":{"typeIdentifier":"t_struct$_buffer_$1204_storage_ptr","typeString":"struct BufferChainlink.buffer"}},"visibility":"internal"}],"src":"6661:15:8"},"scope":1718,"src":"6546:783:8","stateMutability":"pure","virtual":false,"visibility":"private"},{"body":{"id":1598,"nodeType":"Block","src":"7746:52:8","statements":[{"expression":{"arguments":[{"id":1589,"name":"buf","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":1578,"src":"7765:3:8","typeDescriptions":{"typeIdentifier":"t_struct$_buffer_$1204_memory_ptr","typeString":"struct BufferChainlink.buffer memory"}},{"id":1590,"name":"off","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":1580,"src":"7770:3:8","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"}},{"arguments":[{"id":1593,"name":"data","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":1582,"src":"7783:4:8","typeDescriptions":{"typeIdentifier":"t_bytes20","typeString":"bytes20"}}],"expression":{"argumentTypes":[{"typeIdentifier":"t_bytes20","typeString":"bytes20"}],"id":1592,"isConstant":false,"isLValue":false,"isPure":true,"lValueRequested":false,"nodeType":"ElementaryTypeNameExpression","src":"7775:7:8","typeDescriptions":{"typeIdentifier":"t_type$_t_bytes32_$","typeString":"type(bytes32)"},"typeName":{"id":1591,"name":"bytes32","nodeType":"ElementaryTypeName","src":"7775:7:8","typeDescriptions":{}}},"id":1594,"isConstant":false,"isLValue":false,"isPure":false,"kind":"typeConversion","lValueRequested":false,"names":[],"nodeType":"FunctionCall","src":"7775:13:8","tryCall":false,"typeDescriptions":{"typeIdentifier":"t_bytes32","typeString":"bytes32"}},{"hexValue":"3230","id":1595,"isConstant":false,"isLValue":false,"isPure":true,"kind":"number","lValueRequested":false,"nodeType":"Literal","src":"7790:2:8","typeDescriptions":{"typeIdentifier":"t_rational_20_by_1","typeString":"int_const 20"},"value":"20"}],"expression":{"argumentTypes":[{"typeIdentifier":"t_struct$_buffer_$1204_memory_ptr","typeString":"struct BufferChainlink.buffer memory"},{"typeIdentifier":"t_uint256","typeString":"uint256"},{"typeIdentifier":"t_bytes32","typeString":"bytes32"},{"typeIdentifier":"t_rational_20_by_1","typeString":"int_const 20"}],"id":1588,"name":"write","nodeType":"Identifier","overloadedDeclarations":[1414,1574],"referencedDeclaration":1574,"src":"7759:5:8","typeDescriptions":{"typeIdentifier":"t_function_internal_pure$_t_struct$_buffer_$1204_memory_ptr_$_t_uint256_$_t_bytes32_$_t_uint256_$returns$_t_struct$_buffer_$1204_memory_ptr_$","typeString":"function (struct BufferChainlink.buffer memory,uint256,bytes32,uint256) pure returns (struct BufferChainlink.buffer memory)"}},"id":1596,"isConstant":false,"isLValue":false,"isPure":false,"kind":"functionCall","lValueRequested":false,"names":[],"nodeType":"FunctionCall","src":"7759:34:8","tryCall":false,"typeDescriptions":{"typeIdentifier":"t_struct$_buffer_$1204_memory_ptr","typeString":"struct BufferChainlink.buffer memory"}},"functionReturnParameters":1587,"id":1597,"nodeType":"Return","src":"7752:41:8"}]},"documentation":{"id":1575,"nodeType":"StructuredDocumentation","src":"7333:288:8","text":" @dev Writes a bytes20 to the buffer. Resizes if doing so would exceed the\n capacity of the buffer.\n @param buf The buffer to append to.\n @param off The offset to write at.\n @param data The data to append.\n @return The original buffer, for chaining."},"id":1599,"implemented":true,"kind":"function","modifiers":[],"name":"writeBytes20","nameLocation":"7633:12:8","nodeType":"FunctionDefinition","parameters":{"id":1583,"nodeType":"ParameterList","parameters":[{"constant":false,"id":1578,"mutability":"mutable","name":"buf","nameLocation":"7665:3:8","nodeType":"VariableDeclaration","scope":1599,"src":"7651:17:8","stateVariable":false,"storageLocation":"memory","typeDescriptions":{"typeIdentifier":"t_struct$_buffer_$1204_memory_ptr","typeString":"struct BufferChainlink.buffer"},"typeName":{"id":1577,"nodeType":"UserDefinedTypeName","pathNode":{"id":1576,"name":"buffer","nodeType":"IdentifierPath","referencedDeclaration":1204,"src":"7651:6:8"},"referencedDeclaration":1204,"src":"7651:6:8","typeDescriptions":{"typeIdentifier":"t_struct$_buffer_$1204_storage_ptr","typeString":"struct BufferChainlink.buffer"}},"visibility":"internal"},{"constant":false,"id":1580,"mutability":"mutable","name":"off","nameLocation":"7682:3:8","nodeType":"VariableDeclaration","scope":1599,"src":"7674:11:8","stateVariable":false,"storageLocation":"default","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"},"typeName":{"id":1579,"name":"uint256","nodeType":"ElementaryTypeName","src":"7674:7:8","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"}},"visibility":"internal"},{"constant":false,"id":1582,"mutability":"mutable","name":"data","nameLocation":"7699:4:8","nodeType":"VariableDeclaration","scope":1599,"src":"7691:12:8","stateVariable":false,"storageLocation":"default","typeDescriptions":{"typeIdentifier":"t_bytes20","typeString":"bytes20"},"typeName":{"id":1581,"name":"bytes20","nodeType":"ElementaryTypeName","src":"7691:7:8","typeDescriptions":{"typeIdentifier":"t_bytes20","typeString":"bytes20"}},"visibility":"internal"}],"src":"7645:62:8"},"returnParameters":{"id":1587,"nodeType":"ParameterList","parameters":[{"constant":false,"id":1586,"mutability":"mutable","name":"","nameLocation":"-1:-1:-1","nodeType":"VariableDeclaration","scope":1599,"src":"7731:13:8","stateVariable":false,"storageLocation":"memory","typeDescriptions":{"typeIdentifier":"t_struct$_buffer_$1204_memory_ptr","typeString":"struct BufferChainlink.buffer"},"typeName":{"id":1585,"nodeType":"UserDefinedTypeName","pathNode":{"id":1584,"name":"buffer","nodeType":"IdentifierPath","referencedDeclaration":1204,"src":"7731:6:8"},"referencedDeclaration":1204,"src":"7731:6:8","typeDescriptions":{"typeIdentifier":"t_struct$_buffer_$1204_storage_ptr","typeString":"struct BufferChainlink.buffer"}},"visibility":"internal"}],"src":"7730:15:8"},"scope":1718,"src":"7624:174:8","stateMutability":"pure","virtual":false,"visibility":"internal"},{"body":{"id":1623,"nodeType":"Block","src":"8149:63:8","statements":[{"expression":{"arguments":[{"id":1612,"name":"buf","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":1603,"src":"8168:3:8","typeDescriptions":{"typeIdentifier":"t_struct$_buffer_$1204_memory_ptr","typeString":"struct BufferChainlink.buffer memory"}},{"expression":{"expression":{"id":1613,"name":"buf","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":1603,"src":"8173:3:8","typeDescriptions":{"typeIdentifier":"t_struct$_buffer_$1204_memory_ptr","typeString":"struct BufferChainlink.buffer memory"}},"id":1614,"isConstant":false,"isLValue":true,"isPure":false,"lValueRequested":false,"memberName":"buf","nodeType":"MemberAccess","referencedDeclaration":1201,"src":"8173:7:8","typeDescriptions":{"typeIdentifier":"t_bytes_memory_ptr","typeString":"bytes memory"}},"id":1615,"isConstant":false,"isLValue":false,"isPure":false,"lValueRequested":false,"memberName":"length","nodeType":"MemberAccess","src":"8173:14:8","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"}},{"arguments":[{"id":1618,"name":"data","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":1605,"src":"8197:4:8","typeDescriptions":{"typeIdentifier":"t_bytes20","typeString":"bytes20"}}],"expression":{"argumentTypes":[{"typeIdentifier":"t_bytes20","typeString":"bytes20"}],"id":1617,"isConstant":false,"isLValue":false,"isPure":true,"lValueRequested":false,"nodeType":"ElementaryTypeNameExpression","src":"8189:7:8","typeDescriptions":{"typeIdentifier":"t_type$_t_bytes32_$","typeString":"type(bytes32)"},"typeName":{"id":1616,"name":"bytes32","nodeType":"ElementaryTypeName","src":"8189:7:8","typeDescriptions":{}}},"id":1619,"isConstant":false,"isLValue":false,"isPure":false,"kind":"typeConversion","lValueRequested":false,"names":[],"nodeType":"FunctionCall","src":"8189:13:8","tryCall":false,"typeDescriptions":{"typeIdentifier":"t_bytes32","typeString":"bytes32"}},{"hexValue":"3230","id":1620,"isConstant":false,"isLValue":false,"isPure":true,"kind":"number","lValueRequested":false,"nodeType":"Literal","src":"8204:2:8","typeDescriptions":{"typeIdentifier":"t_rational_20_by_1","typeString":"int_const 20"},"value":"20"}],"expression":{"argumentTypes":[{"typeIdentifier":"t_struct$_buffer_$1204_memory_ptr","typeString":"struct BufferChainlink.buffer memory"},{"typeIdentifier":"t_uint256","typeString":"uint256"},{"typeIdentifier":"t_bytes32","typeString":"bytes32"},{"typeIdentifier":"t_rational_20_by_1","typeString":"int_const 20"}],"id":1611,"name":"write","nodeType":"Identifier","overloadedDeclarations":[1414,1574],"referencedDeclaration":1574,"src":"8162:5:8","typeDescriptions":{"typeIdentifier":"t_function_internal_pure$_t_struct$_buffer_$1204_memory_ptr_$_t_uint256_$_t_bytes32_$_t_uint256_$returns$_t_struct$_buffer_$1204_memory_ptr_$","typeString":"function (struct BufferChainlink.buffer memory,uint256,bytes32,uint256) pure returns (struct BufferChainlink.buffer memory)"}},"id":1621,"isConstant":false,"isLValue":false,"isPure":false,"kind":"functionCall","lValueRequested":false,"names":[],"nodeType":"FunctionCall","src":"8162:45:8","tryCall":false,"typeDescriptions":{"typeIdentifier":"t_struct$_buffer_$1204_memory_ptr","typeString":"struct BufferChainlink.buffer memory"}},"functionReturnParameters":1610,"id":1622,"nodeType":"Return","src":"8155:52:8"}]},"documentation":{"id":1600,"nodeType":"StructuredDocumentation","src":"7802:250:8","text":" @dev Appends a bytes20 to the buffer. Resizes if doing so would exceed\n the capacity of the buffer.\n @param buf The buffer to append to.\n @param data The data to append.\n @return The original buffer, for chhaining."},"id":1624,"implemented":true,"kind":"function","modifiers":[],"name":"appendBytes20","nameLocation":"8064:13:8","nodeType":"FunctionDefinition","parameters":{"id":1606,"nodeType":"ParameterList","parameters":[{"constant":false,"id":1603,"mutability":"mutable","name":"buf","nameLocation":"8092:3:8","nodeType":"VariableDeclaration","scope":1624,"src":"8078:17:8","stateVariable":false,"storageLocation":"memory","typeDescriptions":{"typeIdentifier":"t_struct$_buffer_$1204_memory_ptr","typeString":"struct BufferChainlink.buffer"},"typeName":{"id":1602,"nodeType":"UserDefinedTypeName","pathNode":{"id":1601,"name":"buffer","nodeType":"IdentifierPath","referencedDeclaration":1204,"src":"8078:6:8"},"referencedDeclaration":1204,"src":"8078:6:8","typeDescriptions":{"typeIdentifier":"t_struct$_buffer_$1204_storage_ptr","typeString":"struct BufferChainlink.buffer"}},"visibility":"internal"},{"constant":false,"id":1605,"mutability":"mutable","name":"data","nameLocation":"8105:4:8","nodeType":"VariableDeclaration","scope":1624,"src":"8097:12:8","stateVariable":false,"storageLocation":"default","typeDescriptions":{"typeIdentifier":"t_bytes20","typeString":"bytes20"},"typeName":{"id":1604,"name":"bytes20","nodeType":"ElementaryTypeName","src":"8097:7:8","typeDescriptions":{"typeIdentifier":"t_bytes20","typeString":"bytes20"}},"visibility":"internal"}],"src":"8077:33:8"},"returnParameters":{"id":1610,"nodeType":"ParameterList","parameters":[{"constant":false,"id":1609,"mutability":"mutable","name":"","nameLocation":"-1:-1:-1","nodeType":"VariableDeclaration","scope":1624,"src":"8134:13:8","stateVariable":false,"storageLocation":"memory","typeDescriptions":{"typeIdentifier":"t_struct$_buffer_$1204_memory_ptr","typeString":"struct BufferChainlink.buffer"},"typeName":{"id":1608,"nodeType":"UserDefinedTypeName","pathNode":{"id":1607,"name":"buffer","nodeType":"IdentifierPath","referencedDeclaration":1204,"src":"8134:6:8"},"referencedDeclaration":1204,"src":"8134:6:8","typeDescriptions":{"typeIdentifier":"t_struct$_buffer_$1204_storage_ptr","typeString":"struct BufferChainlink.buffer"}},"visibility":"internal"}],"src":"8133:15:8"},"scope":1718,"src":"8055:157:8","stateMutability":"pure","virtual":false,"visibility":"internal"},{"body":{"id":1645,"nodeType":"Block","src":"8562:54:8","statements":[{"expression":{"arguments":[{"id":1637,"name":"buf","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":1628,"src":"8581:3:8","typeDescriptions":{"typeIdentifier":"t_struct$_buffer_$1204_memory_ptr","typeString":"struct BufferChainlink.buffer memory"}},{"expression":{"expression":{"id":1638,"name":"buf","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":1628,"src":"8586:3:8","typeDescriptions":{"typeIdentifier":"t_struct$_buffer_$1204_memory_ptr","typeString":"struct BufferChainlink.buffer memory"}},"id":1639,"isConstant":false,"isLValue":true,"isPure":false,"lValueRequested":false,"memberName":"buf","nodeType":"MemberAccess","referencedDeclaration":1201,"src":"8586:7:8","typeDescriptions":{"typeIdentifier":"t_bytes_memory_ptr","typeString":"bytes memory"}},"id":1640,"isConstant":false,"isLValue":false,"isPure":false,"lValueRequested":false,"memberName":"length","nodeType":"MemberAccess","src":"8586:14:8","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"}},{"id":1641,"name":"data","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":1630,"src":"8602:4:8","typeDescriptions":{"typeIdentifier":"t_bytes32","typeString":"bytes32"}},{"hexValue":"3332","id":1642,"isConstant":false,"isLValue":false,"isPure":true,"kind":"number","lValueRequested":false,"nodeType":"Literal","src":"8608:2:8","typeDescriptions":{"typeIdentifier":"t_rational_32_by_1","typeString":"int_const 32"},"value":"32"}],"expression":{"argumentTypes":[{"typeIdentifier":"t_struct$_buffer_$1204_memory_ptr","typeString":"struct BufferChainlink.buffer memory"},{"typeIdentifier":"t_uint256","typeString":"uint256"},{"typeIdentifier":"t_bytes32","typeString":"bytes32"},{"typeIdentifier":"t_rational_32_by_1","typeString":"int_const 32"}],"id":1636,"name":"write","nodeType":"Identifier","overloadedDeclarations":[1414,1574],"referencedDeclaration":1574,"src":"8575:5:8","typeDescriptions":{"typeIdentifier":"t_function_internal_pure$_t_struct$_buffer_$1204_memory_ptr_$_t_uint256_$_t_bytes32_$_t_uint256_$returns$_t_struct$_buffer_$1204_memory_ptr_$","typeString":"function (struct BufferChainlink.buffer memory,uint256,bytes32,uint256) pure returns (struct BufferChainlink.buffer memory)"}},"id":1643,"isConstant":false,"isLValue":false,"isPure":false,"kind":"functionCall","lValueRequested":false,"names":[],"nodeType":"FunctionCall","src":"8575:36:8","tryCall":false,"typeDescriptions":{"typeIdentifier":"t_struct$_buffer_$1204_memory_ptr","typeString":"struct BufferChainlink.buffer memory"}},"functionReturnParameters":1635,"id":1644,"nodeType":"Return","src":"8568:43:8"}]},"documentation":{"id":1625,"nodeType":"StructuredDocumentation","src":"8216:249:8","text":" @dev Appends a bytes32 to the buffer. Resizes if doing so would exceed\n the capacity of the buffer.\n @param buf The buffer to append to.\n @param data The data to append.\n @return The original buffer, for chaining."},"id":1646,"implemented":true,"kind":"function","modifiers":[],"name":"appendBytes32","nameLocation":"8477:13:8","nodeType":"FunctionDefinition","parameters":{"id":1631,"nodeType":"ParameterList","parameters":[{"constant":false,"id":1628,"mutability":"mutable","name":"buf","nameLocation":"8505:3:8","nodeType":"VariableDeclaration","scope":1646,"src":"8491:17:8","stateVariable":false,"storageLocation":"memory","typeDescriptions":{"typeIdentifier":"t_struct$_buffer_$1204_memory_ptr","typeString":"struct BufferChainlink.buffer"},"typeName":{"id":1627,"nodeType":"UserDefinedTypeName","pathNode":{"id":1626,"name":"buffer","nodeType":"IdentifierPath","referencedDeclaration":1204,"src":"8491:6:8"},"referencedDeclaration":1204,"src":"8491:6:8","typeDescriptions":{"typeIdentifier":"t_struct$_buffer_$1204_storage_ptr","typeString":"struct BufferChainlink.buffer"}},"visibility":"internal"},{"constant":false,"id":1630,"mutability":"mutable","name":"data","nameLocation":"8518:4:8","nodeType":"VariableDeclaration","scope":1646,"src":"8510:12:8","stateVariable":false,"storageLocation":"default","typeDescriptions":{"typeIdentifier":"t_bytes32","typeString":"bytes32"},"typeName":{"id":1629,"name":"bytes32","nodeType":"ElementaryTypeName","src":"8510:7:8","typeDescriptions":{"typeIdentifier":"t_bytes32","typeString":"bytes32"}},"visibility":"internal"}],"src":"8490:33:8"},"returnParameters":{"id":1635,"nodeType":"ParameterList","parameters":[{"constant":false,"id":1634,"mutability":"mutable","name":"","nameLocation":"-1:-1:-1","nodeType":"VariableDeclaration","scope":1646,"src":"8547:13:8","stateVariable":false,"storageLocation":"memory","typeDescriptions":{"typeIdentifier":"t_struct$_buffer_$1204_memory_ptr","typeString":"struct BufferChainlink.buffer"},"typeName":{"id":1633,"nodeType":"UserDefinedTypeName","pathNode":{"id":1632,"name":"buffer","nodeType":"IdentifierPath","referencedDeclaration":1204,"src":"8547:6:8"},"referencedDeclaration":1204,"src":"8547:6:8","typeDescriptions":{"typeIdentifier":"t_struct$_buffer_$1204_storage_ptr","typeString":"struct BufferChainlink.buffer"}},"visibility":"internal"}],"src":"8546:15:8"},"scope":1718,"src":"8468:148:8","stateMutability":"pure","virtual":false,"visibility":"internal"},{"body":{"id":1692,"nodeType":"Block","src":"9108:541:8","statements":[{"condition":{"commonType":{"typeIdentifier":"t_uint256","typeString":"uint256"},"id":1667,"isConstant":false,"isLValue":false,"isPure":false,"lValueRequested":false,"leftExpression":{"commonType":{"typeIdentifier":"t_uint256","typeString":"uint256"},"id":1664,"isConstant":false,"isLValue":false,"isPure":false,"lValueRequested":false,"leftExpression":{"id":1662,"name":"len","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":1656,"src":"9118:3:8","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"}},"nodeType":"BinaryOperation","operator":"+","rightExpression":{"id":1663,"name":"off","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":1652,"src":"9124:3:8","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"}},"src":"9118:9:8","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"}},"nodeType":"BinaryOperation","operator":">","rightExpression":{"expression":{"id":1665,"name":"buf","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":1650,"src":"9130:3:8","typeDescriptions":{"typeIdentifier":"t_struct$_buffer_$1204_memory_ptr","typeString":"struct BufferChainlink.buffer memory"}},"id":1666,"isConstant":false,"isLValue":true,"isPure":false,"lValueRequested":false,"memberName":"capacity","nodeType":"MemberAccess","referencedDeclaration":1203,"src":"9130:12:8","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"}},"src":"9118:24:8","typeDescriptions":{"typeIdentifier":"t_bool","typeString":"bool"}},"id":1679,"nodeType":"IfStatement","src":"9114:73:8","trueBody":{"id":1678,"nodeType":"Block","src":"9144:43:8","statements":[{"expression":{"arguments":[{"id":1669,"name":"buf","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":1650,"src":"9159:3:8","typeDescriptions":{"typeIdentifier":"t_struct$_buffer_$1204_memory_ptr","typeString":"struct BufferChainlink.buffer memory"}},{"commonType":{"typeIdentifier":"t_uint256","typeString":"uint256"},"id":1675,"isConstant":false,"isLValue":false,"isPure":false,"lValueRequested":false,"leftExpression":{"components":[{"commonType":{"typeIdentifier":"t_uint256","typeString":"uint256"},"id":1672,"isConstant":false,"isLValue":false,"isPure":false,"lValueRequested":false,"leftExpression":{"id":1670,"name":"len","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":1656,"src":"9165:3:8","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"}},"nodeType":"BinaryOperation","operator":"+","rightExpression":{"id":1671,"name":"off","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":1652,"src":"9171:3:8","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"}},"src":"9165:9:8","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"}}],"id":1673,"isConstant":false,"isInlineArray":false,"isLValue":false,"isPure":false,"lValueRequested":false,"nodeType":"TupleExpression","src":"9164:11:8","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"}},"nodeType":"BinaryOperation","operator":"*","rightExpression":{"hexValue":"32","id":1674,"isConstant":false,"isLValue":false,"isPure":true,"kind":"number","lValueRequested":false,"nodeType":"Literal","src":"9178:1:8","typeDescriptions":{"typeIdentifier":"t_rational_2_by_1","typeString":"int_const 2"},"value":"2"},"src":"9164:15:8","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"}}],"expression":{"argumentTypes":[{"typeIdentifier":"t_struct$_buffer_$1204_memory_ptr","typeString":"struct BufferChainlink.buffer memory"},{"typeIdentifier":"t_uint256","typeString":"uint256"}],"id":1668,"name":"resize","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":1295,"src":"9152:6:8","typeDescriptions":{"typeIdentifier":"t_function_internal_pure$_t_struct$_buffer_$1204_memory_ptr_$_t_uint256_$returns$__$","typeString":"function (struct BufferChainlink.buffer memory,uint256) pure"}},"id":1676,"isConstant":false,"isLValue":false,"isPure":false,"kind":"functionCall","lValueRequested":false,"names":[],"nodeType":"FunctionCall","src":"9152:28:8","tryCall":false,"typeDescriptions":{"typeIdentifier":"t_tuple$__$","typeString":"tuple()"}},"id":1677,"nodeType":"ExpressionStatement","src":"9152:28:8"}]}},{"assignments":[1681],"declarations":[{"constant":false,"id":1681,"mutability":"mutable","name":"mask","nameLocation":"9201:4:8","nodeType":"VariableDeclaration","scope":1692,"src":"9193:12:8","stateVariable":false,"storageLocation":"default","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"},"typeName":{"id":1680,"name":"uint256","nodeType":"ElementaryTypeName","src":"9193:7:8","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"}},"visibility":"internal"}],"id":1688,"initialValue":{"commonType":{"typeIdentifier":"t_uint256","typeString":"uint256"},"id":1687,"isConstant":false,"isLValue":false,"isPure":false,"lValueRequested":false,"leftExpression":{"components":[{"commonType":{"typeIdentifier":"t_uint256","typeString":"uint256"},"id":1684,"isConstant":false,"isLValue":false,"isPure":false,"lValueRequested":false,"leftExpression":{"hexValue":"323536","id":1682,"isConstant":false,"isLValue":false,"isPure":true,"kind":"number","lValueRequested":false,"nodeType":"Literal","src":"9209:3:8","typeDescriptions":{"typeIdentifier":"t_rational_256_by_1","typeString":"int_const 256"},"value":"256"},"nodeType":"BinaryOperation","operator":"**","rightExpression":{"id":1683,"name":"len","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":1656,"src":"9214:3:8","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"}},"src":"9209:8:8","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"}}],"id":1685,"isConstant":false,"isInlineArray":false,"isLValue":false,"isPure":false,"lValueRequested":false,"nodeType":"TupleExpression","src":"9208:10:8","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"}},"nodeType":"BinaryOperation","operator":"-","rightExpression":{"hexValue":"31","id":1686,"isConstant":false,"isLValue":false,"isPure":true,"kind":"number","lValueRequested":false,"nodeType":"Literal","src":"9221:1:8","typeDescriptions":{"typeIdentifier":"t_rational_1_by_1","typeString":"int_const 1"},"value":"1"},"src":"9208:14:8","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"}},"nodeType":"VariableDeclarationStatement","src":"9193:29:8"},{"AST":{"nodeType":"YulBlock","src":"9237:392:8","statements":[{"nodeType":"YulVariableDeclaration","src":"9288:24:8","value":{"arguments":[{"name":"buf","nodeType":"YulIdentifier","src":"9308:3:8"}],"functionName":{"name":"mload","nodeType":"YulIdentifier","src":"9302:5:8"},"nodeType":"YulFunctionCall","src":"9302:10:8"},"variables":[{"name":"bufptr","nodeType":"YulTypedName","src":"9292:6:8","type":""}]},{"nodeType":"YulVariableDeclaration","src":"9389:38:8","value":{"arguments":[{"arguments":[{"name":"bufptr","nodeType":"YulIdentifier","src":"9409:6:8"},{"name":"off","nodeType":"YulIdentifier","src":"9417:3:8"}],"functionName":{"name":"add","nodeType":"YulIdentifier","src":"9405:3:8"},"nodeType":"YulFunctionCall","src":"9405:16:8"},{"name":"len","nodeType":"YulIdentifier","src":"9423:3:8"}],"functionName":{"name":"add","nodeType":"YulIdentifier","src":"9401:3:8"},"nodeType":"YulFunctionCall","src":"9401:26:8"},"variables":[{"name":"dest","nodeType":"YulTypedName","src":"9393:4:8","type":""}]},{"expression":{"arguments":[{"name":"dest","nodeType":"YulIdentifier","src":"9441:4:8"},{"arguments":[{"arguments":[{"arguments":[{"name":"dest","nodeType":"YulIdentifier","src":"9460:4:8"}],"functionName":{"name":"mload","nodeType":"YulIdentifier","src":"9454:5:8"},"nodeType":"YulFunctionCall","src":"9454:11:8"},{"arguments":[{"name":"mask","nodeType":"YulIdentifier","src":"9471:4:8"}],"functionName":{"name":"not","nodeType":"YulIdentifier","src":"9467:3:8"},"nodeType":"YulFunctionCall","src":"9467:9:8"}],"functionName":{"name":"and","nodeType":"YulIdentifier","src":"9450:3:8"},"nodeType":"YulFunctionCall","src":"9450:27:8"},{"name":"data","nodeType":"YulIdentifier","src":"9479:4:8"}],"functionName":{"name":"or","nodeType":"YulIdentifier","src":"9447:2:8"},"nodeType":"YulFunctionCall","src":"9447:37:8"}],"functionName":{"name":"mstore","nodeType":"YulIdentifier","src":"9434:6:8"},"nodeType":"YulFunctionCall","src":"9434:51:8"},"nodeType":"YulExpressionStatement","src":"9434:51:8"},{"body":{"nodeType":"YulBlock","src":"9576:47:8","statements":[{"expression":{"arguments":[{"name":"bufptr","nodeType":"YulIdentifier","src":"9593:6:8"},{"arguments":[{"name":"off","nodeType":"YulIdentifier","src":"9605:3:8"},{"name":"len","nodeType":"YulIdentifier","src":"9610:3:8"}],"functionName":{"name":"add","nodeType":"YulIdentifier","src":"9601:3:8"},"nodeType":"YulFunctionCall","src":"9601:13:8"}],"functionName":{"name":"mstore","nodeType":"YulIdentifier","src":"9586:6:8"},"nodeType":"YulFunctionCall","src":"9586:29:8"},"nodeType":"YulExpressionStatement","src":"9586:29:8"}]},"condition":{"arguments":[{"arguments":[{"name":"off","nodeType":"YulIdentifier","src":"9550:3:8"},{"name":"len","nodeType":"YulIdentifier","src":"9555:3:8"}],"functionName":{"name":"add","nodeType":"YulIdentifier","src":"9546:3:8"},"nodeType":"YulFunctionCall","src":"9546:13:8"},{"arguments":[{"name":"bufptr","nodeType":"YulIdentifier","src":"9567:6:8"}],"functionName":{"name":"mload","nodeType":"YulIdentifier","src":"9561:5:8"},"nodeType":"YulFunctionCall","src":"9561:13:8"}],"functionName":{"name":"gt","nodeType":"YulIdentifier","src":"9543:2:8"},"nodeType":"YulFunctionCall","src":"9543:32:8"},"nodeType":"YulIf","src":"9540:83:8"}]},"evmVersion":"london","externalReferences":[{"declaration":1650,"isOffset":false,"isSlot":false,"src":"9308:3:8","valueSize":1},{"declaration":1654,"isOffset":false,"isSlot":false,"src":"9479:4:8","valueSize":1},{"declaration":1656,"isOffset":false,"isSlot":false,"src":"9423:3:8","valueSize":1},{"declaration":1656,"isOffset":false,"isSlot":false,"src":"9555:3:8","valueSize":1},{"declaration":1656,"isOffset":false,"isSlot":false,"src":"9610:3:8","valueSize":1},{"declaration":1681,"isOffset":false,"isSlot":false,"src":"9471:4:8","valueSize":1},{"declaration":1652,"isOffset":false,"isSlot":false,"src":"9417:3:8","valueSize":1},{"declaration":1652,"isOffset":false,"isSlot":false,"src":"9550:3:8","valueSize":1},{"declaration":1652,"isOffset":false,"isSlot":false,"src":"9605:3:8","valueSize":1}],"id":1689,"nodeType":"InlineAssembly","src":"9228:401:8"},{"expression":{"id":1690,"name":"buf","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":1650,"src":"9641:3:8","typeDescriptions":{"typeIdentifier":"t_struct$_buffer_$1204_memory_ptr","typeString":"struct BufferChainlink.buffer memory"}},"functionReturnParameters":1661,"id":1691,"nodeType":"Return","src":"9634:10:8"}]},"documentation":{"id":1647,"nodeType":"StructuredDocumentation","src":"8620:351:8","text":" @dev Writes an integer to the buffer. Resizes if doing so would exceed\n the capacity of the buffer.\n @param buf The buffer to append to.\n @param off The offset to write at.\n @param data The data to append.\n @param len The number of bytes to write (right-aligned).\n @return The original buffer, for chaining."},"id":1693,"implemented":true,"kind":"function","modifiers":[],"name":"writeInt","nameLocation":"8983:8:8","nodeType":"FunctionDefinition","parameters":{"id":1657,"nodeType":"ParameterList","parameters":[{"constant":false,"id":1650,"mutability":"mutable","name":"buf","nameLocation":"9011:3:8","nodeType":"VariableDeclaration","scope":1693,"src":"8997:17:8","stateVariable":false,"storageLocation":"memory","typeDescriptions":{"typeIdentifier":"t_struct$_buffer_$1204_memory_ptr","typeString":"struct BufferChainlink.buffer"},"typeName":{"id":1649,"nodeType":"UserDefinedTypeName","pathNode":{"id":1648,"name":"buffer","nodeType":"IdentifierPath","referencedDeclaration":1204,"src":"8997:6:8"},"referencedDeclaration":1204,"src":"8997:6:8","typeDescriptions":{"typeIdentifier":"t_struct$_buffer_$1204_storage_ptr","typeString":"struct BufferChainlink.buffer"}},"visibility":"internal"},{"constant":false,"id":1652,"mutability":"mutable","name":"off","nameLocation":"9028:3:8","nodeType":"VariableDeclaration","scope":1693,"src":"9020:11:8","stateVariable":false,"storageLocation":"default","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"},"typeName":{"id":1651,"name":"uint256","nodeType":"ElementaryTypeName","src":"9020:7:8","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"}},"visibility":"internal"},{"constant":false,"id":1654,"mutability":"mutable","name":"data","nameLocation":"9045:4:8","nodeType":"VariableDeclaration","scope":1693,"src":"9037:12:8","stateVariable":false,"storageLocation":"default","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"},"typeName":{"id":1653,"name":"uint256","nodeType":"ElementaryTypeName","src":"9037:7:8","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"}},"visibility":"internal"},{"constant":false,"id":1656,"mutability":"mutable","name":"len","nameLocation":"9063:3:8","nodeType":"VariableDeclaration","scope":1693,"src":"9055:11:8","stateVariable":false,"storageLocation":"default","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"},"typeName":{"id":1655,"name":"uint256","nodeType":"ElementaryTypeName","src":"9055:7:8","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"}},"visibility":"internal"}],"src":"8991:79:8"},"returnParameters":{"id":1661,"nodeType":"ParameterList","parameters":[{"constant":false,"id":1660,"mutability":"mutable","name":"","nameLocation":"-1:-1:-1","nodeType":"VariableDeclaration","scope":1693,"src":"9093:13:8","stateVariable":false,"storageLocation":"memory","typeDescriptions":{"typeIdentifier":"t_struct$_buffer_$1204_memory_ptr","typeString":"struct BufferChainlink.buffer"},"typeName":{"id":1659,"nodeType":"UserDefinedTypeName","pathNode":{"id":1658,"name":"buffer","nodeType":"IdentifierPath","referencedDeclaration":1204,"src":"9093:6:8"},"referencedDeclaration":1204,"src":"9093:6:8","typeDescriptions":{"typeIdentifier":"t_struct$_buffer_$1204_storage_ptr","typeString":"struct BufferChainlink.buffer"}},"visibility":"internal"}],"src":"9092:15:8"},"scope":1718,"src":"8974:675:8","stateMutability":"pure","virtual":false,"visibility":"private"},{"body":{"id":1716,"nodeType":"Block","src":"10013:58:8","statements":[{"expression":{"arguments":[{"id":1708,"name":"buf","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":1697,"src":"10035:3:8","typeDescriptions":{"typeIdentifier":"t_struct$_buffer_$1204_memory_ptr","typeString":"struct BufferChainlink.buffer memory"}},{"expression":{"expression":{"id":1709,"name":"buf","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":1697,"src":"10040:3:8","typeDescriptions":{"typeIdentifier":"t_struct$_buffer_$1204_memory_ptr","typeString":"struct BufferChainlink.buffer memory"}},"id":1710,"isConstant":false,"isLValue":true,"isPure":false,"lValueRequested":false,"memberName":"buf","nodeType":"MemberAccess","referencedDeclaration":1201,"src":"10040:7:8","typeDescriptions":{"typeIdentifier":"t_bytes_memory_ptr","typeString":"bytes memory"}},"id":1711,"isConstant":false,"isLValue":false,"isPure":false,"lValueRequested":false,"memberName":"length","nodeType":"MemberAccess","src":"10040:14:8","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"}},{"id":1712,"name":"data","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":1699,"src":"10056:4:8","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"}},{"id":1713,"name":"len","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":1701,"src":"10062:3:8","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"}}],"expression":{"argumentTypes":[{"typeIdentifier":"t_struct$_buffer_$1204_memory_ptr","typeString":"struct BufferChainlink.buffer memory"},{"typeIdentifier":"t_uint256","typeString":"uint256"},{"typeIdentifier":"t_uint256","typeString":"uint256"},{"typeIdentifier":"t_uint256","typeString":"uint256"}],"id":1707,"name":"writeInt","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":1693,"src":"10026:8:8","typeDescriptions":{"typeIdentifier":"t_function_internal_pure$_t_struct$_buffer_$1204_memory_ptr_$_t_uint256_$_t_uint256_$_t_uint256_$returns$_t_struct$_buffer_$1204_memory_ptr_$","typeString":"function (struct BufferChainlink.buffer memory,uint256,uint256,uint256) pure returns (struct BufferChainlink.buffer memory)"}},"id":1714,"isConstant":false,"isLValue":false,"isPure":false,"kind":"functionCall","lValueRequested":false,"names":[],"nodeType":"FunctionCall","src":"10026:40:8","tryCall":false,"typeDescriptions":{"typeIdentifier":"t_struct$_buffer_$1204_memory_ptr","typeString":"struct BufferChainlink.buffer memory"}},"functionReturnParameters":1706,"id":1715,"nodeType":"Return","src":"10019:47:8"}]},"documentation":{"id":1694,"nodeType":"StructuredDocumentation","src":"9653:238:8","text":" @dev Appends a byte to the end of the buffer. Resizes if doing so would\n exceed the capacity of the buffer.\n @param buf The buffer to append to.\n @param data The data to append.\n @return The original buffer."},"id":1717,"implemented":true,"kind":"function","modifiers":[],"name":"appendInt","nameLocation":"9903:9:8","nodeType":"FunctionDefinition","parameters":{"id":1702,"nodeType":"ParameterList","parameters":[{"constant":false,"id":1697,"mutability":"mutable","name":"buf","nameLocation":"9932:3:8","nodeType":"VariableDeclaration","scope":1717,"src":"9918:17:8","stateVariable":false,"storageLocation":"memory","typeDescriptions":{"typeIdentifier":"t_struct$_buffer_$1204_memory_ptr","typeString":"struct BufferChainlink.buffer"},"typeName":{"id":1696,"nodeType":"UserDefinedTypeName","pathNode":{"id":1695,"name":"buffer","nodeType":"IdentifierPath","referencedDeclaration":1204,"src":"9918:6:8"},"referencedDeclaration":1204,"src":"9918:6:8","typeDescriptions":{"typeIdentifier":"t_struct$_buffer_$1204_storage_ptr","typeString":"struct BufferChainlink.buffer"}},"visibility":"internal"},{"constant":false,"id":1699,"mutability":"mutable","name":"data","nameLocation":"9949:4:8","nodeType":"VariableDeclaration","scope":1717,"src":"9941:12:8","stateVariable":false,"storageLocation":"default","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"},"typeName":{"id":1698,"name":"uint256","nodeType":"ElementaryTypeName","src":"9941:7:8","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"}},"visibility":"internal"},{"constant":false,"id":1701,"mutability":"mutable","name":"len","nameLocation":"9967:3:8","nodeType":"VariableDeclaration","scope":1717,"src":"9959:11:8","stateVariable":false,"storageLocation":"default","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"},"typeName":{"id":1700,"name":"uint256","nodeType":"ElementaryTypeName","src":"9959:7:8","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"}},"visibility":"internal"}],"src":"9912:62:8"},"returnParameters":{"id":1706,"nodeType":"ParameterList","parameters":[{"constant":false,"id":1705,"mutability":"mutable","name":"","nameLocation":"-1:-1:-1","nodeType":"VariableDeclaration","scope":1717,"src":"9998:13:8","stateVariable":false,"storageLocation":"memory","typeDescriptions":{"typeIdentifier":"t_struct$_buffer_$1204_memory_ptr","typeString":"struct BufferChainlink.buffer"},"typeName":{"id":1704,"nodeType":"UserDefinedTypeName","pathNode":{"id":1703,"name":"buffer","nodeType":"IdentifierPath","referencedDeclaration":1204,"src":"9998:6:8"},"referencedDeclaration":1204,"src":"9998:6:8","typeDescriptions":{"typeIdentifier":"t_struct$_buffer_$1204_storage_ptr","typeString":"struct BufferChainlink.buffer"}},"visibility":"internal"}],"src":"9997:15:8"},"scope":1718,"src":"9894:177:8","stateMutability":"pure","virtual":false,"visibility":"internal"}],"scope":1719,"src":"441:9632:8","usedErrors":[]}],"src":"32:10042:8"},"id":8},"@chainlink/contracts/src/v0.8/vendor/CBORChainlink.sol":{"ast":{"absolutePath":"@chainlink/contracts/src/v0.8/vendor/CBORChainlink.sol","exportedSymbols":{"BufferChainlink":[1718],"CBORChainlink":[2165]},"id":2166,"license":"MIT","nodeType":"SourceUnit","nodes":[{"id":1720,"literals":["solidity",">=","0.4",".19"],"nodeType":"PragmaDirective","src":"32:25:9"},{"absolutePath":"@chainlink/contracts/src/v0.8/vendor/BufferChainlink.sol","file":"./BufferChainlink.sol","id":1722,"nameLocation":"-1:-1:-1","nodeType":"ImportDirective","scope":2166,"sourceUnit":1719,"src":"59:54:9","symbolAliases":[{"foreign":{"id":1721,"name":"BufferChainlink","nodeType":"Identifier","overloadedDeclarations":[],"src":"67:15:9","typeDescriptions":{}},"nameLocation":"-1:-1:-1"}],"unitAlias":""},{"abstract":false,"baseContracts":[],"canonicalName":"CBORChainlink","contractDependencies":[],"contractKind":"library","fullyImplemented":true,"id":2165,"linearizedBaseContracts":[2165],"name":"CBORChainlink","nameLocation":"123:13:9","nodeType":"ContractDefinition","nodes":[{"id":1726,"libraryName":{"id":1723,"name":"BufferChainlink","nodeType":"IdentifierPath","referencedDeclaration":1718,"src":"147:15:9"},"nodeType":"UsingForDirective","src":"141:49:9","typeName":{"id":1725,"nodeType":"UserDefinedTypeName","pathNode":{"id":1724,"name":"BufferChainlink.buffer","nodeType":"IdentifierPath","referencedDeclaration":1204,"src":"167:22:9"},"referencedDeclaration":1204,"src":"167:22:9","typeDescriptions":{"typeIdentifier":"t_struct$_buffer_$1204_storage_ptr","typeString":"struct BufferChainlink.buffer"}}},{"constant":true,"id":1729,"mutability":"constant","name":"MAJOR_TYPE_INT","nameLocation":"217:14:9","nodeType":"VariableDeclaration","scope":2165,"src":"194:41:9","stateVariable":true,"storageLocation":"default","typeDescriptions":{"typeIdentifier":"t_uint8","typeString":"uint8"},"typeName":{"id":1727,"name":"uint8","nodeType":"ElementaryTypeName","src":"194:5:9","typeDescriptions":{"typeIdentifier":"t_uint8","typeString":"uint8"}},"value":{"hexValue":"30","id":1728,"isConstant":false,"isLValue":false,"isPure":true,"kind":"number","lValueRequested":false,"nodeType":"Literal","src":"234:1:9","typeDescriptions":{"typeIdentifier":"t_rational_0_by_1","typeString":"int_const 0"},"value":"0"},"visibility":"private"},{"constant":true,"id":1732,"mutability":"constant","name":"MAJOR_TYPE_NEGATIVE_INT","nameLocation":"262:23:9","nodeType":"VariableDeclaration","scope":2165,"src":"239:50:9","stateVariable":true,"storageLocation":"default","typeDescriptions":{"typeIdentifier":"t_uint8","typeString":"uint8"},"typeName":{"id":1730,"name":"uint8","nodeType":"ElementaryTypeName","src":"239:5:9","typeDescriptions":{"typeIdentifier":"t_uint8","typeString":"uint8"}},"value":{"hexValue":"31","id":1731,"isConstant":false,"isLValue":false,"isPure":true,"kind":"number","lValueRequested":false,"nodeType":"Literal","src":"288:1:9","typeDescriptions":{"typeIdentifier":"t_rational_1_by_1","typeString":"int_const 1"},"value":"1"},"visibility":"private"},{"constant":true,"id":1735,"mutability":"constant","name":"MAJOR_TYPE_BYTES","nameLocation":"316:16:9","nodeType":"VariableDeclaration","scope":2165,"src":"293:43:9","stateVariable":true,"storageLocation":"default","typeDescriptions":{"typeIdentifier":"t_uint8","typeString":"uint8"},"typeName":{"id":1733,"name":"uint8","nodeType":"ElementaryTypeName","src":"293:5:9","typeDescriptions":{"typeIdentifier":"t_uint8","typeString":"uint8"}},"value":{"hexValue":"32","id":1734,"isConstant":false,"isLValue":false,"isPure":true,"kind":"number","lValueRequested":false,"nodeType":"Literal","src":"335:1:9","typeDescriptions":{"typeIdentifier":"t_rational_2_by_1","typeString":"int_const 2"},"value":"2"},"visibility":"private"},{"constant":true,"id":1738,"mutability":"constant","name":"MAJOR_TYPE_STRING","nameLocation":"363:17:9","nodeType":"VariableDeclaration","scope":2165,"src":"340:44:9","stateVariable":true,"storageLocation":"default","typeDescriptions":{"typeIdentifier":"t_uint8","typeString":"uint8"},"typeName":{"id":1736,"name":"uint8","nodeType":"ElementaryTypeName","src":"340:5:9","typeDescriptions":{"typeIdentifier":"t_uint8","typeString":"uint8"}},"value":{"hexValue":"33","id":1737,"isConstant":false,"isLValue":false,"isPure":true,"kind":"number","lValueRequested":false,"nodeType":"Literal","src":"383:1:9","typeDescriptions":{"typeIdentifier":"t_rational_3_by_1","typeString":"int_const 3"},"value":"3"},"visibility":"private"},{"constant":true,"id":1741,"mutability":"constant","name":"MAJOR_TYPE_ARRAY","nameLocation":"411:16:9","nodeType":"VariableDeclaration","scope":2165,"src":"388:43:9","stateVariable":true,"storageLocation":"default","typeDescriptions":{"typeIdentifier":"t_uint8","typeString":"uint8"},"typeName":{"id":1739,"name":"uint8","nodeType":"ElementaryTypeName","src":"388:5:9","typeDescriptions":{"typeIdentifier":"t_uint8","typeString":"uint8"}},"value":{"hexValue":"34","id":1740,"isConstant":false,"isLValue":false,"isPure":true,"kind":"number","lValueRequested":false,"nodeType":"Literal","src":"430:1:9","typeDescriptions":{"typeIdentifier":"t_rational_4_by_1","typeString":"int_const 4"},"value":"4"},"visibility":"private"},{"constant":true,"id":1744,"mutability":"constant","name":"MAJOR_TYPE_MAP","nameLocation":"458:14:9","nodeType":"VariableDeclaration","scope":2165,"src":"435:41:9","stateVariable":true,"storageLocation":"default","typeDescriptions":{"typeIdentifier":"t_uint8","typeString":"uint8"},"typeName":{"id":1742,"name":"uint8","nodeType":"ElementaryTypeName","src":"435:5:9","typeDescriptions":{"typeIdentifier":"t_uint8","typeString":"uint8"}},"value":{"hexValue":"35","id":1743,"isConstant":false,"isLValue":false,"isPure":true,"kind":"number","lValueRequested":false,"nodeType":"Literal","src":"475:1:9","typeDescriptions":{"typeIdentifier":"t_rational_5_by_1","typeString":"int_const 5"},"value":"5"},"visibility":"private"},{"constant":true,"id":1747,"mutability":"constant","name":"MAJOR_TYPE_TAG","nameLocation":"503:14:9","nodeType":"VariableDeclaration","scope":2165,"src":"480:41:9","stateVariable":true,"storageLocation":"default","typeDescriptions":{"typeIdentifier":"t_uint8","typeString":"uint8"},"typeName":{"id":1745,"name":"uint8","nodeType":"ElementaryTypeName","src":"480:5:9","typeDescriptions":{"typeIdentifier":"t_uint8","typeString":"uint8"}},"value":{"hexValue":"36","id":1746,"isConstant":false,"isLValue":false,"isPure":true,"kind":"number","lValueRequested":false,"nodeType":"Literal","src":"520:1:9","typeDescriptions":{"typeIdentifier":"t_rational_6_by_1","typeString":"int_const 6"},"value":"6"},"visibility":"private"},{"constant":true,"id":1750,"mutability":"constant","name":"MAJOR_TYPE_CONTENT_FREE","nameLocation":"548:23:9","nodeType":"VariableDeclaration","scope":2165,"src":"525:50:9","stateVariable":true,"storageLocation":"default","typeDescriptions":{"typeIdentifier":"t_uint8","typeString":"uint8"},"typeName":{"id":1748,"name":"uint8","nodeType":"ElementaryTypeName","src":"525:5:9","typeDescriptions":{"typeIdentifier":"t_uint8","typeString":"uint8"}},"value":{"hexValue":"37","id":1749,"isConstant":false,"isLValue":false,"isPure":true,"kind":"number","lValueRequested":false,"nodeType":"Literal","src":"574:1:9","typeDescriptions":{"typeIdentifier":"t_rational_7_by_1","typeString":"int_const 7"},"value":"7"},"visibility":"private"},{"constant":true,"id":1753,"mutability":"constant","name":"TAG_TYPE_BIGNUM","nameLocation":"603:15:9","nodeType":"VariableDeclaration","scope":2165,"src":"580:42:9","stateVariable":true,"storageLocation":"default","typeDescriptions":{"typeIdentifier":"t_uint8","typeString":"uint8"},"typeName":{"id":1751,"name":"uint8","nodeType":"ElementaryTypeName","src":"580:5:9","typeDescriptions":{"typeIdentifier":"t_uint8","typeString":"uint8"}},"value":{"hexValue":"32","id":1752,"isConstant":false,"isLValue":false,"isPure":true,"kind":"number","lValueRequested":false,"nodeType":"Literal","src":"621:1:9","typeDescriptions":{"typeIdentifier":"t_rational_2_by_1","typeString":"int_const 2"},"value":"2"},"visibility":"private"},{"constant":true,"id":1756,"mutability":"constant","name":"TAG_TYPE_NEGATIVE_BIGNUM","nameLocation":"649:24:9","nodeType":"VariableDeclaration","scope":2165,"src":"626:51:9","stateVariable":true,"storageLocation":"default","typeDescriptions":{"typeIdentifier":"t_uint8","typeString":"uint8"},"typeName":{"id":1754,"name":"uint8","nodeType":"ElementaryTypeName","src":"626:5:9","typeDescriptions":{"typeIdentifier":"t_uint8","typeString":"uint8"}},"value":{"hexValue":"33","id":1755,"isConstant":false,"isLValue":false,"isPure":true,"kind":"number","lValueRequested":false,"nodeType":"Literal","src":"676:1:9","typeDescriptions":{"typeIdentifier":"t_rational_3_by_1","typeString":"int_const 3"},"value":"3"},"visibility":"private"},{"body":{"id":1885,"nodeType":"Block","src":"785:522:9","statements":[{"condition":{"commonType":{"typeIdentifier":"t_uint64","typeString":"uint64"},"id":1768,"isConstant":false,"isLValue":false,"isPure":false,"lValueRequested":false,"leftExpression":{"id":1766,"name":"value","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":1763,"src":"794:5:9","typeDescriptions":{"typeIdentifier":"t_uint64","typeString":"uint64"}},"nodeType":"BinaryOperation","operator":"<=","rightExpression":{"hexValue":"3233","id":1767,"isConstant":false,"isLValue":false,"isPure":true,"kind":"number","lValueRequested":false,"nodeType":"Literal","src":"803:2:9","typeDescriptions":{"typeIdentifier":"t_rational_23_by_1","typeString":"int_const 23"},"value":"23"},"src":"794:11:9","typeDescriptions":{"typeIdentifier":"t_bool","typeString":"bool"}},"falseBody":{"condition":{"commonType":{"typeIdentifier":"t_uint64","typeString":"uint64"},"id":1786,"isConstant":false,"isLValue":false,"isPure":false,"lValueRequested":false,"leftExpression":{"id":1784,"name":"value","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":1763,"src":"876:5:9","typeDescriptions":{"typeIdentifier":"t_uint64","typeString":"uint64"}},"nodeType":"BinaryOperation","operator":"<=","rightExpression":{"hexValue":"30784646","id":1785,"isConstant":false,"isLValue":false,"isPure":true,"kind":"number","lValueRequested":false,"nodeType":"Literal","src":"885:4:9","typeDescriptions":{"typeIdentifier":"t_rational_255_by_1","typeString":"int_const 255"},"value":"0xFF"},"src":"876:13:9","typeDescriptions":{"typeIdentifier":"t_bool","typeString":"bool"}},"falseBody":{"condition":{"commonType":{"typeIdentifier":"t_uint64","typeString":"uint64"},"id":1811,"isConstant":false,"isLValue":false,"isPure":false,"lValueRequested":false,"leftExpression":{"id":1809,"name":"value","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":1763,"src":"988:5:9","typeDescriptions":{"typeIdentifier":"t_uint64","typeString":"uint64"}},"nodeType":"BinaryOperation","operator":"<=","rightExpression":{"hexValue":"307846464646","id":1810,"isConstant":false,"isLValue":false,"isPure":true,"kind":"number","lValueRequested":false,"nodeType":"Literal","src":"997:6:9","typeDescriptions":{"typeIdentifier":"t_rational_65535_by_1","typeString":"int_const 65535"},"value":"0xFFFF"},"src":"988:15:9","typeDescriptions":{"typeIdentifier":"t_bool","typeString":"bool"}},"falseBody":{"condition":{"commonType":{"typeIdentifier":"t_uint64","typeString":"uint64"},"id":1836,"isConstant":false,"isLValue":false,"isPure":false,"lValueRequested":false,"leftExpression":{"id":1834,"name":"value","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":1763,"src":"1102:5:9","typeDescriptions":{"typeIdentifier":"t_uint64","typeString":"uint64"}},"nodeType":"BinaryOperation","operator":"<=","rightExpression":{"hexValue":"30784646464646464646","id":1835,"isConstant":false,"isLValue":false,"isPure":true,"kind":"number","lValueRequested":false,"nodeType":"Literal","src":"1111:10:9","typeDescriptions":{"typeIdentifier":"t_rational_4294967295_by_1","typeString":"int_const 4294967295"},"value":"0xFFFFFFFF"},"src":"1102:19:9","typeDescriptions":{"typeIdentifier":"t_bool","typeString":"bool"}},"falseBody":{"id":1880,"nodeType":"Block","src":"1216:87:9","statements":[{"expression":{"arguments":[{"arguments":[{"commonType":{"typeIdentifier":"t_uint8","typeString":"uint8"},"id":1869,"isConstant":false,"isLValue":false,"isPure":false,"lValueRequested":false,"leftExpression":{"components":[{"commonType":{"typeIdentifier":"t_uint8","typeString":"uint8"},"id":1866,"isConstant":false,"isLValue":false,"isPure":false,"lValueRequested":false,"leftExpression":{"id":1864,"name":"major","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":1761,"src":"1247:5:9","typeDescriptions":{"typeIdentifier":"t_uint8","typeString":"uint8"}},"nodeType":"BinaryOperation","operator":"<<","rightExpression":{"hexValue":"35","id":1865,"isConstant":false,"isLValue":false,"isPure":true,"kind":"number","lValueRequested":false,"nodeType":"Literal","src":"1256:1:9","typeDescriptions":{"typeIdentifier":"t_rational_5_by_1","typeString":"int_const 5"},"value":"5"},"src":"1247:10:9","typeDescriptions":{"typeIdentifier":"t_uint8","typeString":"uint8"}}],"id":1867,"isConstant":false,"isInlineArray":false,"isLValue":false,"isPure":false,"lValueRequested":false,"nodeType":"TupleExpression","src":"1246:12:9","typeDescriptions":{"typeIdentifier":"t_uint8","typeString":"uint8"}},"nodeType":"BinaryOperation","operator":"|","rightExpression":{"hexValue":"3237","id":1868,"isConstant":false,"isLValue":false,"isPure":true,"kind":"number","lValueRequested":false,"nodeType":"Literal","src":"1261:2:9","typeDescriptions":{"typeIdentifier":"t_rational_27_by_1","typeString":"int_const 27"},"value":"27"},"src":"1246:17:9","typeDescriptions":{"typeIdentifier":"t_uint8","typeString":"uint8"}}],"expression":{"argumentTypes":[{"typeIdentifier":"t_uint8","typeString":"uint8"}],"id":1863,"isConstant":false,"isLValue":false,"isPure":true,"lValueRequested":false,"nodeType":"ElementaryTypeNameExpression","src":"1240:5:9","typeDescriptions":{"typeIdentifier":"t_type$_t_uint8_$","typeString":"type(uint8)"},"typeName":{"id":1862,"name":"uint8","nodeType":"ElementaryTypeName","src":"1240:5:9","typeDescriptions":{}}},"id":1870,"isConstant":false,"isLValue":false,"isPure":false,"kind":"typeConversion","lValueRequested":false,"names":[],"nodeType":"FunctionCall","src":"1240:24:9","tryCall":false,"typeDescriptions":{"typeIdentifier":"t_uint8","typeString":"uint8"}}],"expression":{"argumentTypes":[{"typeIdentifier":"t_uint8","typeString":"uint8"}],"expression":{"id":1859,"name":"buf","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":1759,"src":"1224:3:9","typeDescriptions":{"typeIdentifier":"t_struct$_buffer_$1204_memory_ptr","typeString":"struct BufferChainlink.buffer memory"}},"id":1861,"isConstant":false,"isLValue":true,"isPure":false,"lValueRequested":false,"memberName":"appendUint8","nodeType":"MemberAccess","referencedDeclaration":1514,"src":"1224:15:9","typeDescriptions":{"typeIdentifier":"t_function_internal_pure$_t_struct$_buffer_$1204_memory_ptr_$_t_uint8_$returns$_t_struct$_buffer_$1204_memory_ptr_$bound_to$_t_struct$_buffer_$1204_memory_ptr_$","typeString":"function (struct BufferChainlink.buffer memory,uint8) pure returns (struct BufferChainlink.buffer memory)"}},"id":1871,"isConstant":false,"isLValue":false,"isPure":false,"kind":"functionCall","lValueRequested":false,"names":[],"nodeType":"FunctionCall","src":"1224:41:9","tryCall":false,"typeDescriptions":{"typeIdentifier":"t_struct$_buffer_$1204_memory_ptr","typeString":"struct BufferChainlink.buffer memory"}},"id":1872,"nodeType":"ExpressionStatement","src":"1224:41:9"},{"expression":{"arguments":[{"id":1876,"name":"value","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":1763,"src":"1287:5:9","typeDescriptions":{"typeIdentifier":"t_uint64","typeString":"uint64"}},{"hexValue":"38","id":1877,"isConstant":false,"isLValue":false,"isPure":true,"kind":"number","lValueRequested":false,"nodeType":"Literal","src":"1294:1:9","typeDescriptions":{"typeIdentifier":"t_rational_8_by_1","typeString":"int_const 8"},"value":"8"}],"expression":{"argumentTypes":[{"typeIdentifier":"t_uint64","typeString":"uint64"},{"typeIdentifier":"t_rational_8_by_1","typeString":"int_const 8"}],"expression":{"id":1873,"name":"buf","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":1759,"src":"1273:3:9","typeDescriptions":{"typeIdentifier":"t_struct$_buffer_$1204_memory_ptr","typeString":"struct BufferChainlink.buffer memory"}},"id":1875,"isConstant":false,"isLValue":true,"isPure":false,"lValueRequested":false,"memberName":"appendInt","nodeType":"MemberAccess","referencedDeclaration":1717,"src":"1273:13:9","typeDescriptions":{"typeIdentifier":"t_function_internal_pure$_t_struct$_buffer_$1204_memory_ptr_$_t_uint256_$_t_uint256_$returns$_t_struct$_buffer_$1204_memory_ptr_$bound_to$_t_struct$_buffer_$1204_memory_ptr_$","typeString":"function (struct BufferChainlink.buffer memory,uint256,uint256) pure returns (struct BufferChainlink.buffer memory)"}},"id":1878,"isConstant":false,"isLValue":false,"isPure":false,"kind":"functionCall","lValueRequested":false,"names":[],"nodeType":"FunctionCall","src":"1273:23:9","tryCall":false,"typeDescriptions":{"typeIdentifier":"t_struct$_buffer_$1204_memory_ptr","typeString":"struct BufferChainlink.buffer memory"}},"id":1879,"nodeType":"ExpressionStatement","src":"1273:23:9"}]},"id":1881,"nodeType":"IfStatement","src":"1098:205:9","trueBody":{"id":1858,"nodeType":"Block","src":"1123:87:9","statements":[{"expression":{"arguments":[{"arguments":[{"commonType":{"typeIdentifier":"t_uint8","typeString":"uint8"},"id":1847,"isConstant":false,"isLValue":false,"isPure":false,"lValueRequested":false,"leftExpression":{"components":[{"commonType":{"typeIdentifier":"t_uint8","typeString":"uint8"},"id":1844,"isConstant":false,"isLValue":false,"isPure":false,"lValueRequested":false,"leftExpression":{"id":1842,"name":"major","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":1761,"src":"1154:5:9","typeDescriptions":{"typeIdentifier":"t_uint8","typeString":"uint8"}},"nodeType":"BinaryOperation","operator":"<<","rightExpression":{"hexValue":"35","id":1843,"isConstant":false,"isLValue":false,"isPure":true,"kind":"number","lValueRequested":false,"nodeType":"Literal","src":"1163:1:9","typeDescriptions":{"typeIdentifier":"t_rational_5_by_1","typeString":"int_const 5"},"value":"5"},"src":"1154:10:9","typeDescriptions":{"typeIdentifier":"t_uint8","typeString":"uint8"}}],"id":1845,"isConstant":false,"isInlineArray":false,"isLValue":false,"isPure":false,"lValueRequested":false,"nodeType":"TupleExpression","src":"1153:12:9","typeDescriptions":{"typeIdentifier":"t_uint8","typeString":"uint8"}},"nodeType":"BinaryOperation","operator":"|","rightExpression":{"hexValue":"3236","id":1846,"isConstant":false,"isLValue":false,"isPure":true,"kind":"number","lValueRequested":false,"nodeType":"Literal","src":"1168:2:9","typeDescriptions":{"typeIdentifier":"t_rational_26_by_1","typeString":"int_const 26"},"value":"26"},"src":"1153:17:9","typeDescriptions":{"typeIdentifier":"t_uint8","typeString":"uint8"}}],"expression":{"argumentTypes":[{"typeIdentifier":"t_uint8","typeString":"uint8"}],"id":1841,"isConstant":false,"isLValue":false,"isPure":true,"lValueRequested":false,"nodeType":"ElementaryTypeNameExpression","src":"1147:5:9","typeDescriptions":{"typeIdentifier":"t_type$_t_uint8_$","typeString":"type(uint8)"},"typeName":{"id":1840,"name":"uint8","nodeType":"ElementaryTypeName","src":"1147:5:9","typeDescriptions":{}}},"id":1848,"isConstant":false,"isLValue":false,"isPure":false,"kind":"typeConversion","lValueRequested":false,"names":[],"nodeType":"FunctionCall","src":"1147:24:9","tryCall":false,"typeDescriptions":{"typeIdentifier":"t_uint8","typeString":"uint8"}}],"expression":{"argumentTypes":[{"typeIdentifier":"t_uint8","typeString":"uint8"}],"expression":{"id":1837,"name":"buf","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":1759,"src":"1131:3:9","typeDescriptions":{"typeIdentifier":"t_struct$_buffer_$1204_memory_ptr","typeString":"struct BufferChainlink.buffer memory"}},"id":1839,"isConstant":false,"isLValue":true,"isPure":false,"lValueRequested":false,"memberName":"appendUint8","nodeType":"MemberAccess","referencedDeclaration":1514,"src":"1131:15:9","typeDescriptions":{"typeIdentifier":"t_function_internal_pure$_t_struct$_buffer_$1204_memory_ptr_$_t_uint8_$returns$_t_struct$_buffer_$1204_memory_ptr_$bound_to$_t_struct$_buffer_$1204_memory_ptr_$","typeString":"function (struct BufferChainlink.buffer memory,uint8) pure returns (struct BufferChainlink.buffer memory)"}},"id":1849,"isConstant":false,"isLValue":false,"isPure":false,"kind":"functionCall","lValueRequested":false,"names":[],"nodeType":"FunctionCall","src":"1131:41:9","tryCall":false,"typeDescriptions":{"typeIdentifier":"t_struct$_buffer_$1204_memory_ptr","typeString":"struct BufferChainlink.buffer memory"}},"id":1850,"nodeType":"ExpressionStatement","src":"1131:41:9"},{"expression":{"arguments":[{"id":1854,"name":"value","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":1763,"src":"1194:5:9","typeDescriptions":{"typeIdentifier":"t_uint64","typeString":"uint64"}},{"hexValue":"34","id":1855,"isConstant":false,"isLValue":false,"isPure":true,"kind":"number","lValueRequested":false,"nodeType":"Literal","src":"1201:1:9","typeDescriptions":{"typeIdentifier":"t_rational_4_by_1","typeString":"int_const 4"},"value":"4"}],"expression":{"argumentTypes":[{"typeIdentifier":"t_uint64","typeString":"uint64"},{"typeIdentifier":"t_rational_4_by_1","typeString":"int_const 4"}],"expression":{"id":1851,"name":"buf","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":1759,"src":"1180:3:9","typeDescriptions":{"typeIdentifier":"t_struct$_buffer_$1204_memory_ptr","typeString":"struct BufferChainlink.buffer memory"}},"id":1853,"isConstant":false,"isLValue":true,"isPure":false,"lValueRequested":false,"memberName":"appendInt","nodeType":"MemberAccess","referencedDeclaration":1717,"src":"1180:13:9","typeDescriptions":{"typeIdentifier":"t_function_internal_pure$_t_struct$_buffer_$1204_memory_ptr_$_t_uint256_$_t_uint256_$returns$_t_struct$_buffer_$1204_memory_ptr_$bound_to$_t_struct$_buffer_$1204_memory_ptr_$","typeString":"function (struct BufferChainlink.buffer memory,uint256,uint256) pure returns (struct BufferChainlink.buffer memory)"}},"id":1856,"isConstant":false,"isLValue":false,"isPure":false,"kind":"functionCall","lValueRequested":false,"names":[],"nodeType":"FunctionCall","src":"1180:23:9","tryCall":false,"typeDescriptions":{"typeIdentifier":"t_struct$_buffer_$1204_memory_ptr","typeString":"struct BufferChainlink.buffer memory"}},"id":1857,"nodeType":"ExpressionStatement","src":"1180:23:9"}]}},"id":1882,"nodeType":"IfStatement","src":"984:319:9","trueBody":{"id":1833,"nodeType":"Block","src":"1005:87:9","statements":[{"expression":{"arguments":[{"arguments":[{"commonType":{"typeIdentifier":"t_uint8","typeString":"uint8"},"id":1822,"isConstant":false,"isLValue":false,"isPure":false,"lValueRequested":false,"leftExpression":{"components":[{"commonType":{"typeIdentifier":"t_uint8","typeString":"uint8"},"id":1819,"isConstant":false,"isLValue":false,"isPure":false,"lValueRequested":false,"leftExpression":{"id":1817,"name":"major","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":1761,"src":"1036:5:9","typeDescriptions":{"typeIdentifier":"t_uint8","typeString":"uint8"}},"nodeType":"BinaryOperation","operator":"<<","rightExpression":{"hexValue":"35","id":1818,"isConstant":false,"isLValue":false,"isPure":true,"kind":"number","lValueRequested":false,"nodeType":"Literal","src":"1045:1:9","typeDescriptions":{"typeIdentifier":"t_rational_5_by_1","typeString":"int_const 5"},"value":"5"},"src":"1036:10:9","typeDescriptions":{"typeIdentifier":"t_uint8","typeString":"uint8"}}],"id":1820,"isConstant":false,"isInlineArray":false,"isLValue":false,"isPure":false,"lValueRequested":false,"nodeType":"TupleExpression","src":"1035:12:9","typeDescriptions":{"typeIdentifier":"t_uint8","typeString":"uint8"}},"nodeType":"BinaryOperation","operator":"|","rightExpression":{"hexValue":"3235","id":1821,"isConstant":false,"isLValue":false,"isPure":true,"kind":"number","lValueRequested":false,"nodeType":"Literal","src":"1050:2:9","typeDescriptions":{"typeIdentifier":"t_rational_25_by_1","typeString":"int_const 25"},"value":"25"},"src":"1035:17:9","typeDescriptions":{"typeIdentifier":"t_uint8","typeString":"uint8"}}],"expression":{"argumentTypes":[{"typeIdentifier":"t_uint8","typeString":"uint8"}],"id":1816,"isConstant":false,"isLValue":false,"isPure":true,"lValueRequested":false,"nodeType":"ElementaryTypeNameExpression","src":"1029:5:9","typeDescriptions":{"typeIdentifier":"t_type$_t_uint8_$","typeString":"type(uint8)"},"typeName":{"id":1815,"name":"uint8","nodeType":"ElementaryTypeName","src":"1029:5:9","typeDescriptions":{}}},"id":1823,"isConstant":false,"isLValue":false,"isPure":false,"kind":"typeConversion","lValueRequested":false,"names":[],"nodeType":"FunctionCall","src":"1029:24:9","tryCall":false,"typeDescriptions":{"typeIdentifier":"t_uint8","typeString":"uint8"}}],"expression":{"argumentTypes":[{"typeIdentifier":"t_uint8","typeString":"uint8"}],"expression":{"id":1812,"name":"buf","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":1759,"src":"1013:3:9","typeDescriptions":{"typeIdentifier":"t_struct$_buffer_$1204_memory_ptr","typeString":"struct BufferChainlink.buffer memory"}},"id":1814,"isConstant":false,"isLValue":true,"isPure":false,"lValueRequested":false,"memberName":"appendUint8","nodeType":"MemberAccess","referencedDeclaration":1514,"src":"1013:15:9","typeDescriptions":{"typeIdentifier":"t_function_internal_pure$_t_struct$_buffer_$1204_memory_ptr_$_t_uint8_$returns$_t_struct$_buffer_$1204_memory_ptr_$bound_to$_t_struct$_buffer_$1204_memory_ptr_$","typeString":"function (struct BufferChainlink.buffer memory,uint8) pure returns (struct BufferChainlink.buffer memory)"}},"id":1824,"isConstant":false,"isLValue":false,"isPure":false,"kind":"functionCall","lValueRequested":false,"names":[],"nodeType":"FunctionCall","src":"1013:41:9","tryCall":false,"typeDescriptions":{"typeIdentifier":"t_struct$_buffer_$1204_memory_ptr","typeString":"struct BufferChainlink.buffer memory"}},"id":1825,"nodeType":"ExpressionStatement","src":"1013:41:9"},{"expression":{"arguments":[{"id":1829,"name":"value","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":1763,"src":"1076:5:9","typeDescriptions":{"typeIdentifier":"t_uint64","typeString":"uint64"}},{"hexValue":"32","id":1830,"isConstant":false,"isLValue":false,"isPure":true,"kind":"number","lValueRequested":false,"nodeType":"Literal","src":"1083:1:9","typeDescriptions":{"typeIdentifier":"t_rational_2_by_1","typeString":"int_const 2"},"value":"2"}],"expression":{"argumentTypes":[{"typeIdentifier":"t_uint64","typeString":"uint64"},{"typeIdentifier":"t_rational_2_by_1","typeString":"int_const 2"}],"expression":{"id":1826,"name":"buf","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":1759,"src":"1062:3:9","typeDescriptions":{"typeIdentifier":"t_struct$_buffer_$1204_memory_ptr","typeString":"struct BufferChainlink.buffer memory"}},"id":1828,"isConstant":false,"isLValue":true,"isPure":false,"lValueRequested":false,"memberName":"appendInt","nodeType":"MemberAccess","referencedDeclaration":1717,"src":"1062:13:9","typeDescriptions":{"typeIdentifier":"t_function_internal_pure$_t_struct$_buffer_$1204_memory_ptr_$_t_uint256_$_t_uint256_$returns$_t_struct$_buffer_$1204_memory_ptr_$bound_to$_t_struct$_buffer_$1204_memory_ptr_$","typeString":"function (struct BufferChainlink.buffer memory,uint256,uint256) pure returns (struct BufferChainlink.buffer memory)"}},"id":1831,"isConstant":false,"isLValue":false,"isPure":false,"kind":"functionCall","lValueRequested":false,"names":[],"nodeType":"FunctionCall","src":"1062:23:9","tryCall":false,"typeDescriptions":{"typeIdentifier":"t_struct$_buffer_$1204_memory_ptr","typeString":"struct BufferChainlink.buffer memory"}},"id":1832,"nodeType":"ExpressionStatement","src":"1062:23:9"}]}},"id":1883,"nodeType":"IfStatement","src":"872:431:9","trueBody":{"id":1808,"nodeType":"Block","src":"891:87:9","statements":[{"expression":{"arguments":[{"arguments":[{"commonType":{"typeIdentifier":"t_uint8","typeString":"uint8"},"id":1797,"isConstant":false,"isLValue":false,"isPure":false,"lValueRequested":false,"leftExpression":{"components":[{"commonType":{"typeIdentifier":"t_uint8","typeString":"uint8"},"id":1794,"isConstant":false,"isLValue":false,"isPure":false,"lValueRequested":false,"leftExpression":{"id":1792,"name":"major","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":1761,"src":"922:5:9","typeDescriptions":{"typeIdentifier":"t_uint8","typeString":"uint8"}},"nodeType":"BinaryOperation","operator":"<<","rightExpression":{"hexValue":"35","id":1793,"isConstant":false,"isLValue":false,"isPure":true,"kind":"number","lValueRequested":false,"nodeType":"Literal","src":"931:1:9","typeDescriptions":{"typeIdentifier":"t_rational_5_by_1","typeString":"int_const 5"},"value":"5"},"src":"922:10:9","typeDescriptions":{"typeIdentifier":"t_uint8","typeString":"uint8"}}],"id":1795,"isConstant":false,"isInlineArray":false,"isLValue":false,"isPure":false,"lValueRequested":false,"nodeType":"TupleExpression","src":"921:12:9","typeDescriptions":{"typeIdentifier":"t_uint8","typeString":"uint8"}},"nodeType":"BinaryOperation","operator":"|","rightExpression":{"hexValue":"3234","id":1796,"isConstant":false,"isLValue":false,"isPure":true,"kind":"number","lValueRequested":false,"nodeType":"Literal","src":"936:2:9","typeDescriptions":{"typeIdentifier":"t_rational_24_by_1","typeString":"int_const 24"},"value":"24"},"src":"921:17:9","typeDescriptions":{"typeIdentifier":"t_uint8","typeString":"uint8"}}],"expression":{"argumentTypes":[{"typeIdentifier":"t_uint8","typeString":"uint8"}],"id":1791,"isConstant":false,"isLValue":false,"isPure":true,"lValueRequested":false,"nodeType":"ElementaryTypeNameExpression","src":"915:5:9","typeDescriptions":{"typeIdentifier":"t_type$_t_uint8_$","typeString":"type(uint8)"},"typeName":{"id":1790,"name":"uint8","nodeType":"ElementaryTypeName","src":"915:5:9","typeDescriptions":{}}},"id":1798,"isConstant":false,"isLValue":false,"isPure":false,"kind":"typeConversion","lValueRequested":false,"names":[],"nodeType":"FunctionCall","src":"915:24:9","tryCall":false,"typeDescriptions":{"typeIdentifier":"t_uint8","typeString":"uint8"}}],"expression":{"argumentTypes":[{"typeIdentifier":"t_uint8","typeString":"uint8"}],"expression":{"id":1787,"name":"buf","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":1759,"src":"899:3:9","typeDescriptions":{"typeIdentifier":"t_struct$_buffer_$1204_memory_ptr","typeString":"struct BufferChainlink.buffer memory"}},"id":1789,"isConstant":false,"isLValue":true,"isPure":false,"lValueRequested":false,"memberName":"appendUint8","nodeType":"MemberAccess","referencedDeclaration":1514,"src":"899:15:9","typeDescriptions":{"typeIdentifier":"t_function_internal_pure$_t_struct$_buffer_$1204_memory_ptr_$_t_uint8_$returns$_t_struct$_buffer_$1204_memory_ptr_$bound_to$_t_struct$_buffer_$1204_memory_ptr_$","typeString":"function (struct BufferChainlink.buffer memory,uint8) pure returns (struct BufferChainlink.buffer memory)"}},"id":1799,"isConstant":false,"isLValue":false,"isPure":false,"kind":"functionCall","lValueRequested":false,"names":[],"nodeType":"FunctionCall","src":"899:41:9","tryCall":false,"typeDescriptions":{"typeIdentifier":"t_struct$_buffer_$1204_memory_ptr","typeString":"struct BufferChainlink.buffer memory"}},"id":1800,"nodeType":"ExpressionStatement","src":"899:41:9"},{"expression":{"arguments":[{"id":1804,"name":"value","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":1763,"src":"962:5:9","typeDescriptions":{"typeIdentifier":"t_uint64","typeString":"uint64"}},{"hexValue":"31","id":1805,"isConstant":false,"isLValue":false,"isPure":true,"kind":"number","lValueRequested":false,"nodeType":"Literal","src":"969:1:9","typeDescriptions":{"typeIdentifier":"t_rational_1_by_1","typeString":"int_const 1"},"value":"1"}],"expression":{"argumentTypes":[{"typeIdentifier":"t_uint64","typeString":"uint64"},{"typeIdentifier":"t_rational_1_by_1","typeString":"int_const 1"}],"expression":{"id":1801,"name":"buf","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":1759,"src":"948:3:9","typeDescriptions":{"typeIdentifier":"t_struct$_buffer_$1204_memory_ptr","typeString":"struct BufferChainlink.buffer memory"}},"id":1803,"isConstant":false,"isLValue":true,"isPure":false,"lValueRequested":false,"memberName":"appendInt","nodeType":"MemberAccess","referencedDeclaration":1717,"src":"948:13:9","typeDescriptions":{"typeIdentifier":"t_function_internal_pure$_t_struct$_buffer_$1204_memory_ptr_$_t_uint256_$_t_uint256_$returns$_t_struct$_buffer_$1204_memory_ptr_$bound_to$_t_struct$_buffer_$1204_memory_ptr_$","typeString":"function (struct BufferChainlink.buffer memory,uint256,uint256) pure returns (struct BufferChainlink.buffer memory)"}},"id":1806,"isConstant":false,"isLValue":false,"isPure":false,"kind":"functionCall","lValueRequested":false,"names":[],"nodeType":"FunctionCall","src":"948:23:9","tryCall":false,"typeDescriptions":{"typeIdentifier":"t_struct$_buffer_$1204_memory_ptr","typeString":"struct BufferChainlink.buffer memory"}},"id":1807,"nodeType":"ExpressionStatement","src":"948:23:9"}]}},"id":1884,"nodeType":"IfStatement","src":"791:512:9","trueBody":{"id":1783,"nodeType":"Block","src":"807:59:9","statements":[{"expression":{"arguments":[{"arguments":[{"commonType":{"typeIdentifier":"t_uint64","typeString":"uint64"},"id":1779,"isConstant":false,"isLValue":false,"isPure":false,"lValueRequested":false,"leftExpression":{"components":[{"commonType":{"typeIdentifier":"t_uint8","typeString":"uint8"},"id":1776,"isConstant":false,"isLValue":false,"isPure":false,"lValueRequested":false,"leftExpression":{"id":1774,"name":"major","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":1761,"src":"838:5:9","typeDescriptions":{"typeIdentifier":"t_uint8","typeString":"uint8"}},"nodeType":"BinaryOperation","operator":"<<","rightExpression":{"hexValue":"35","id":1775,"isConstant":false,"isLValue":false,"isPure":true,"kind":"number","lValueRequested":false,"nodeType":"Literal","src":"847:1:9","typeDescriptions":{"typeIdentifier":"t_rational_5_by_1","typeString":"int_const 5"},"value":"5"},"src":"838:10:9","typeDescriptions":{"typeIdentifier":"t_uint8","typeString":"uint8"}}],"id":1777,"isConstant":false,"isInlineArray":false,"isLValue":false,"isPure":false,"lValueRequested":false,"nodeType":"TupleExpression","src":"837:12:9","typeDescriptions":{"typeIdentifier":"t_uint8","typeString":"uint8"}},"nodeType":"BinaryOperation","operator":"|","rightExpression":{"id":1778,"name":"value","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":1763,"src":"852:5:9","typeDescriptions":{"typeIdentifier":"t_uint64","typeString":"uint64"}},"src":"837:20:9","typeDescriptions":{"typeIdentifier":"t_uint64","typeString":"uint64"}}],"expression":{"argumentTypes":[{"typeIdentifier":"t_uint64","typeString":"uint64"}],"id":1773,"isConstant":false,"isLValue":false,"isPure":true,"lValueRequested":false,"nodeType":"ElementaryTypeNameExpression","src":"831:5:9","typeDescriptions":{"typeIdentifier":"t_type$_t_uint8_$","typeString":"type(uint8)"},"typeName":{"id":1772,"name":"uint8","nodeType":"ElementaryTypeName","src":"831:5:9","typeDescriptions":{}}},"id":1780,"isConstant":false,"isLValue":false,"isPure":false,"kind":"typeConversion","lValueRequested":false,"names":[],"nodeType":"FunctionCall","src":"831:27:9","tryCall":false,"typeDescriptions":{"typeIdentifier":"t_uint8","typeString":"uint8"}}],"expression":{"argumentTypes":[{"typeIdentifier":"t_uint8","typeString":"uint8"}],"expression":{"id":1769,"name":"buf","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":1759,"src":"815:3:9","typeDescriptions":{"typeIdentifier":"t_struct$_buffer_$1204_memory_ptr","typeString":"struct BufferChainlink.buffer memory"}},"id":1771,"isConstant":false,"isLValue":true,"isPure":false,"lValueRequested":false,"memberName":"appendUint8","nodeType":"MemberAccess","referencedDeclaration":1514,"src":"815:15:9","typeDescriptions":{"typeIdentifier":"t_function_internal_pure$_t_struct$_buffer_$1204_memory_ptr_$_t_uint8_$returns$_t_struct$_buffer_$1204_memory_ptr_$bound_to$_t_struct$_buffer_$1204_memory_ptr_$","typeString":"function (struct BufferChainlink.buffer memory,uint8) pure returns (struct BufferChainlink.buffer memory)"}},"id":1781,"isConstant":false,"isLValue":false,"isPure":false,"kind":"functionCall","lValueRequested":false,"names":[],"nodeType":"FunctionCall","src":"815:44:9","tryCall":false,"typeDescriptions":{"typeIdentifier":"t_struct$_buffer_$1204_memory_ptr","typeString":"struct BufferChainlink.buffer memory"}},"id":1782,"nodeType":"ExpressionStatement","src":"815:44:9"}]}}]},"id":1886,"implemented":true,"kind":"function","modifiers":[],"name":"encodeFixedNumeric","nameLocation":"691:18:9","nodeType":"FunctionDefinition","parameters":{"id":1764,"nodeType":"ParameterList","parameters":[{"constant":false,"id":1759,"mutability":"mutable","name":"buf","nameLocation":"740:3:9","nodeType":"VariableDeclaration","scope":1886,"src":"710:33:9","stateVariable":false,"storageLocation":"memory","typeDescriptions":{"typeIdentifier":"t_struct$_buffer_$1204_memory_ptr","typeString":"struct BufferChainlink.buffer"},"typeName":{"id":1758,"nodeType":"UserDefinedTypeName","pathNode":{"id":1757,"name":"BufferChainlink.buffer","nodeType":"IdentifierPath","referencedDeclaration":1204,"src":"710:22:9"},"referencedDeclaration":1204,"src":"710:22:9","typeDescriptions":{"typeIdentifier":"t_struct$_buffer_$1204_storage_ptr","typeString":"struct BufferChainlink.buffer"}},"visibility":"internal"},{"constant":false,"id":1761,"mutability":"mutable","name":"major","nameLocation":"751:5:9","nodeType":"VariableDeclaration","scope":1886,"src":"745:11:9","stateVariable":false,"storageLocation":"default","typeDescriptions":{"typeIdentifier":"t_uint8","typeString":"uint8"},"typeName":{"id":1760,"name":"uint8","nodeType":"ElementaryTypeName","src":"745:5:9","typeDescriptions":{"typeIdentifier":"t_uint8","typeString":"uint8"}},"visibility":"internal"},{"constant":false,"id":1763,"mutability":"mutable","name":"value","nameLocation":"765:5:9","nodeType":"VariableDeclaration","scope":1886,"src":"758:12:9","stateVariable":false,"storageLocation":"default","typeDescriptions":{"typeIdentifier":"t_uint64","typeString":"uint64"},"typeName":{"id":1762,"name":"uint64","nodeType":"ElementaryTypeName","src":"758:6:9","typeDescriptions":{"typeIdentifier":"t_uint64","typeString":"uint64"}},"visibility":"internal"}],"src":"709:62:9"},"returnParameters":{"id":1765,"nodeType":"ParameterList","parameters":[],"src":"785:0:9"},"scope":2165,"src":"682:625:9","stateMutability":"pure","virtual":false,"visibility":"private"},{"body":{"id":1908,"nodeType":"Block","src":"1408:52:9","statements":[{"expression":{"arguments":[{"arguments":[{"commonType":{"typeIdentifier":"t_uint8","typeString":"uint8"},"id":1904,"isConstant":false,"isLValue":false,"isPure":false,"lValueRequested":false,"leftExpression":{"components":[{"commonType":{"typeIdentifier":"t_uint8","typeString":"uint8"},"id":1901,"isConstant":false,"isLValue":false,"isPure":false,"lValueRequested":false,"leftExpression":{"id":1899,"name":"major","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":1891,"src":"1437:5:9","typeDescriptions":{"typeIdentifier":"t_uint8","typeString":"uint8"}},"nodeType":"BinaryOperation","operator":"<<","rightExpression":{"hexValue":"35","id":1900,"isConstant":false,"isLValue":false,"isPure":true,"kind":"number","lValueRequested":false,"nodeType":"Literal","src":"1446:1:9","typeDescriptions":{"typeIdentifier":"t_rational_5_by_1","typeString":"int_const 5"},"value":"5"},"src":"1437:10:9","typeDescriptions":{"typeIdentifier":"t_uint8","typeString":"uint8"}}],"id":1902,"isConstant":false,"isInlineArray":false,"isLValue":false,"isPure":false,"lValueRequested":false,"nodeType":"TupleExpression","src":"1436:12:9","typeDescriptions":{"typeIdentifier":"t_uint8","typeString":"uint8"}},"nodeType":"BinaryOperation","operator":"|","rightExpression":{"hexValue":"3331","id":1903,"isConstant":false,"isLValue":false,"isPure":true,"kind":"number","lValueRequested":false,"nodeType":"Literal","src":"1451:2:9","typeDescriptions":{"typeIdentifier":"t_rational_31_by_1","typeString":"int_const 31"},"value":"31"},"src":"1436:17:9","typeDescriptions":{"typeIdentifier":"t_uint8","typeString":"uint8"}}],"expression":{"argumentTypes":[{"typeIdentifier":"t_uint8","typeString":"uint8"}],"id":1898,"isConstant":false,"isLValue":false,"isPure":true,"lValueRequested":false,"nodeType":"ElementaryTypeNameExpression","src":"1430:5:9","typeDescriptions":{"typeIdentifier":"t_type$_t_uint8_$","typeString":"type(uint8)"},"typeName":{"id":1897,"name":"uint8","nodeType":"ElementaryTypeName","src":"1430:5:9","typeDescriptions":{}}},"id":1905,"isConstant":false,"isLValue":false,"isPure":false,"kind":"typeConversion","lValueRequested":false,"names":[],"nodeType":"FunctionCall","src":"1430:24:9","tryCall":false,"typeDescriptions":{"typeIdentifier":"t_uint8","typeString":"uint8"}}],"expression":{"argumentTypes":[{"typeIdentifier":"t_uint8","typeString":"uint8"}],"expression":{"id":1894,"name":"buf","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":1889,"src":"1414:3:9","typeDescriptions":{"typeIdentifier":"t_struct$_buffer_$1204_memory_ptr","typeString":"struct BufferChainlink.buffer memory"}},"id":1896,"isConstant":false,"isLValue":true,"isPure":false,"lValueRequested":false,"memberName":"appendUint8","nodeType":"MemberAccess","referencedDeclaration":1514,"src":"1414:15:9","typeDescriptions":{"typeIdentifier":"t_function_internal_pure$_t_struct$_buffer_$1204_memory_ptr_$_t_uint8_$returns$_t_struct$_buffer_$1204_memory_ptr_$bound_to$_t_struct$_buffer_$1204_memory_ptr_$","typeString":"function (struct BufferChainlink.buffer memory,uint8) pure returns (struct BufferChainlink.buffer memory)"}},"id":1906,"isConstant":false,"isLValue":false,"isPure":false,"kind":"functionCall","lValueRequested":false,"names":[],"nodeType":"FunctionCall","src":"1414:41:9","tryCall":false,"typeDescriptions":{"typeIdentifier":"t_struct$_buffer_$1204_memory_ptr","typeString":"struct BufferChainlink.buffer memory"}},"id":1907,"nodeType":"ExpressionStatement","src":"1414:41:9"}]},"id":1909,"implemented":true,"kind":"function","modifiers":[],"name":"encodeIndefiniteLengthType","nameLocation":"1320:26:9","nodeType":"FunctionDefinition","parameters":{"id":1892,"nodeType":"ParameterList","parameters":[{"constant":false,"id":1889,"mutability":"mutable","name":"buf","nameLocation":"1377:3:9","nodeType":"VariableDeclaration","scope":1909,"src":"1347:33:9","stateVariable":false,"storageLocation":"memory","typeDescriptions":{"typeIdentifier":"t_struct$_buffer_$1204_memory_ptr","typeString":"struct BufferChainlink.buffer"},"typeName":{"id":1888,"nodeType":"UserDefinedTypeName","pathNode":{"id":1887,"name":"BufferChainlink.buffer","nodeType":"IdentifierPath","referencedDeclaration":1204,"src":"1347:22:9"},"referencedDeclaration":1204,"src":"1347:22:9","typeDescriptions":{"typeIdentifier":"t_struct$_buffer_$1204_storage_ptr","typeString":"struct BufferChainlink.buffer"}},"visibility":"internal"},{"constant":false,"id":1891,"mutability":"mutable","name":"major","nameLocation":"1388:5:9","nodeType":"VariableDeclaration","scope":1909,"src":"1382:11:9","stateVariable":false,"storageLocation":"default","typeDescriptions":{"typeIdentifier":"t_uint8","typeString":"uint8"},"typeName":{"id":1890,"name":"uint8","nodeType":"ElementaryTypeName","src":"1382:5:9","typeDescriptions":{"typeIdentifier":"t_uint8","typeString":"uint8"}},"visibility":"internal"}],"src":"1346:48:9"},"returnParameters":{"id":1893,"nodeType":"ParameterList","parameters":[],"src":"1408:0:9"},"scope":2165,"src":"1311:149:9","stateMutability":"pure","virtual":false,"visibility":"private"},{"body":{"id":1937,"nodeType":"Block","src":"1545:155:9","statements":[{"condition":{"commonType":{"typeIdentifier":"t_uint256","typeString":"uint256"},"id":1919,"isConstant":false,"isLValue":false,"isPure":false,"lValueRequested":false,"leftExpression":{"id":1917,"name":"value","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":1914,"src":"1554:5:9","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"}},"nodeType":"BinaryOperation","operator":">","rightExpression":{"hexValue":"307846464646464646464646464646464646","id":1918,"isConstant":false,"isLValue":false,"isPure":true,"kind":"number","lValueRequested":false,"nodeType":"Literal","src":"1562:18:9","typeDescriptions":{"typeIdentifier":"t_rational_18446744073709551615_by_1","typeString":"int_const 18446744073709551615"},"value":"0xFFFFFFFFFFFFFFFF"},"src":"1554:26:9","typeDescriptions":{"typeIdentifier":"t_bool","typeString":"bool"}},"falseBody":{"id":1935,"nodeType":"Block","src":"1627:69:9","statements":[{"expression":{"arguments":[{"id":1927,"name":"buf","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":1912,"src":"1654:3:9","typeDescriptions":{"typeIdentifier":"t_struct$_buffer_$1204_memory_ptr","typeString":"struct BufferChainlink.buffer memory"}},{"id":1928,"name":"MAJOR_TYPE_INT","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":1729,"src":"1659:14:9","typeDescriptions":{"typeIdentifier":"t_uint8","typeString":"uint8"}},{"arguments":[{"id":1931,"name":"value","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":1914,"src":"1682:5:9","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"}}],"expression":{"argumentTypes":[{"typeIdentifier":"t_uint256","typeString":"uint256"}],"id":1930,"isConstant":false,"isLValue":false,"isPure":true,"lValueRequested":false,"nodeType":"ElementaryTypeNameExpression","src":"1675:6:9","typeDescriptions":{"typeIdentifier":"t_type$_t_uint64_$","typeString":"type(uint64)"},"typeName":{"id":1929,"name":"uint64","nodeType":"ElementaryTypeName","src":"1675:6:9","typeDescriptions":{}}},"id":1932,"isConstant":false,"isLValue":false,"isPure":false,"kind":"typeConversion","lValueRequested":false,"names":[],"nodeType":"FunctionCall","src":"1675:13:9","tryCall":false,"typeDescriptions":{"typeIdentifier":"t_uint64","typeString":"uint64"}}],"expression":{"argumentTypes":[{"typeIdentifier":"t_struct$_buffer_$1204_memory_ptr","typeString":"struct BufferChainlink.buffer memory"},{"typeIdentifier":"t_uint8","typeString":"uint8"},{"typeIdentifier":"t_uint64","typeString":"uint64"}],"id":1926,"name":"encodeFixedNumeric","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":1886,"src":"1635:18:9","typeDescriptions":{"typeIdentifier":"t_function_internal_pure$_t_struct$_buffer_$1204_memory_ptr_$_t_uint8_$_t_uint64_$returns$__$","typeString":"function (struct BufferChainlink.buffer memory,uint8,uint64) pure"}},"id":1933,"isConstant":false,"isLValue":false,"isPure":false,"kind":"functionCall","lValueRequested":false,"names":[],"nodeType":"FunctionCall","src":"1635:54:9","tryCall":false,"typeDescriptions":{"typeIdentifier":"t_tuple$__$","typeString":"tuple()"}},"id":1934,"nodeType":"ExpressionStatement","src":"1635:54:9"}]},"id":1936,"nodeType":"IfStatement","src":"1551:145:9","trueBody":{"id":1925,"nodeType":"Block","src":"1582:39:9","statements":[{"expression":{"arguments":[{"id":1921,"name":"buf","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":1912,"src":"1603:3:9","typeDescriptions":{"typeIdentifier":"t_struct$_buffer_$1204_memory_ptr","typeString":"struct BufferChainlink.buffer memory"}},{"id":1922,"name":"value","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":1914,"src":"1608:5:9","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"}}],"expression":{"argumentTypes":[{"typeIdentifier":"t_struct$_buffer_$1204_memory_ptr","typeString":"struct BufferChainlink.buffer memory"},{"typeIdentifier":"t_uint256","typeString":"uint256"}],"id":1920,"name":"encodeBigNum","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":2060,"src":"1590:12:9","typeDescriptions":{"typeIdentifier":"t_function_internal_pure$_t_struct$_buffer_$1204_memory_ptr_$_t_uint256_$returns$__$","typeString":"function (struct BufferChainlink.buffer memory,uint256) pure"}},"id":1923,"isConstant":false,"isLValue":false,"isPure":false,"kind":"functionCall","lValueRequested":false,"names":[],"nodeType":"FunctionCall","src":"1590:24:9","tryCall":false,"typeDescriptions":{"typeIdentifier":"t_tuple$__$","typeString":"tuple()"}},"id":1924,"nodeType":"ExpressionStatement","src":"1590:24:9"}]}}]},"id":1938,"implemented":true,"kind":"function","modifiers":[],"name":"encodeUInt","nameLocation":"1473:10:9","nodeType":"FunctionDefinition","parameters":{"id":1915,"nodeType":"ParameterList","parameters":[{"constant":false,"id":1912,"mutability":"mutable","name":"buf","nameLocation":"1514:3:9","nodeType":"VariableDeclaration","scope":1938,"src":"1484:33:9","stateVariable":false,"storageLocation":"memory","typeDescriptions":{"typeIdentifier":"t_struct$_buffer_$1204_memory_ptr","typeString":"struct BufferChainlink.buffer"},"typeName":{"id":1911,"nodeType":"UserDefinedTypeName","pathNode":{"id":1910,"name":"BufferChainlink.buffer","nodeType":"IdentifierPath","referencedDeclaration":1204,"src":"1484:22:9"},"referencedDeclaration":1204,"src":"1484:22:9","typeDescriptions":{"typeIdentifier":"t_struct$_buffer_$1204_storage_ptr","typeString":"struct BufferChainlink.buffer"}},"visibility":"internal"},{"constant":false,"id":1914,"mutability":"mutable","name":"value","nameLocation":"1524:5:9","nodeType":"VariableDeclaration","scope":1938,"src":"1519:10:9","stateVariable":false,"storageLocation":"default","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"},"typeName":{"id":1913,"name":"uint","nodeType":"ElementaryTypeName","src":"1519:4:9","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"}},"visibility":"internal"}],"src":"1483:47:9"},"returnParameters":{"id":1916,"nodeType":"ParameterList","parameters":[],"src":"1545:0:9"},"scope":2165,"src":"1464:236:9","stateMutability":"pure","virtual":false,"visibility":"internal"},{"body":{"id":2003,"nodeType":"Block","src":"1783:367:9","statements":[{"condition":{"commonType":{"typeIdentifier":"t_int256","typeString":"int256"},"id":1949,"isConstant":false,"isLValue":false,"isPure":false,"lValueRequested":false,"leftExpression":{"id":1946,"name":"value","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":1943,"src":"1792:5:9","typeDescriptions":{"typeIdentifier":"t_int256","typeString":"int256"}},"nodeType":"BinaryOperation","operator":"<","rightExpression":{"id":1948,"isConstant":false,"isLValue":false,"isPure":true,"lValueRequested":false,"nodeType":"UnaryOperation","operator":"-","prefix":true,"src":"1800:20:9","subExpression":{"hexValue":"30783130303030303030303030303030303030","id":1947,"isConstant":false,"isLValue":false,"isPure":true,"kind":"number","lValueRequested":false,"nodeType":"Literal","src":"1801:19:9","typeDescriptions":{"typeIdentifier":"t_rational_18446744073709551616_by_1","typeString":"int_const 18446744073709551616"},"value":"0x10000000000000000"},"typeDescriptions":{"typeIdentifier":"t_rational_minus_18446744073709551616_by_1","typeString":"int_const -18446744073709551616"}},"src":"1792:28:9","typeDescriptions":{"typeIdentifier":"t_bool","typeString":"bool"}},"falseBody":{"condition":{"commonType":{"typeIdentifier":"t_int256","typeString":"int256"},"id":1958,"isConstant":false,"isLValue":false,"isPure":false,"lValueRequested":false,"leftExpression":{"id":1956,"name":"value","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":1943,"src":"1876:5:9","typeDescriptions":{"typeIdentifier":"t_int256","typeString":"int256"}},"nodeType":"BinaryOperation","operator":">","rightExpression":{"hexValue":"307846464646464646464646464646464646","id":1957,"isConstant":false,"isLValue":false,"isPure":true,"kind":"number","lValueRequested":false,"nodeType":"Literal","src":"1884:18:9","typeDescriptions":{"typeIdentifier":"t_rational_18446744073709551615_by_1","typeString":"int_const 18446744073709551615"},"value":"0xFFFFFFFFFFFFFFFF"},"src":"1876:26:9","typeDescriptions":{"typeIdentifier":"t_bool","typeString":"bool"}},"falseBody":{"condition":{"commonType":{"typeIdentifier":"t_int256","typeString":"int256"},"id":1970,"isConstant":false,"isLValue":false,"isPure":false,"lValueRequested":false,"leftExpression":{"id":1968,"name":"value","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":1943,"src":"1958:5:9","typeDescriptions":{"typeIdentifier":"t_int256","typeString":"int256"}},"nodeType":"BinaryOperation","operator":">=","rightExpression":{"hexValue":"30","id":1969,"isConstant":false,"isLValue":false,"isPure":true,"kind":"number","lValueRequested":false,"nodeType":"Literal","src":"1967:1:9","typeDescriptions":{"typeIdentifier":"t_rational_0_by_1","typeString":"int_const 0"},"value":"0"},"src":"1958:10:9","typeDescriptions":{"typeIdentifier":"t_bool","typeString":"bool"}},"falseBody":{"id":1999,"nodeType":"Block","src":"2054:92:9","statements":[{"expression":{"arguments":[{"id":1985,"name":"buf","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":1941,"src":"2081:3:9","typeDescriptions":{"typeIdentifier":"t_struct$_buffer_$1204_memory_ptr","typeString":"struct BufferChainlink.buffer memory"}},{"id":1986,"name":"MAJOR_TYPE_NEGATIVE_INT","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":1732,"src":"2086:23:9","typeDescriptions":{"typeIdentifier":"t_uint8","typeString":"uint8"}},{"arguments":[{"arguments":[{"commonType":{"typeIdentifier":"t_int256","typeString":"int256"},"id":1994,"isConstant":false,"isLValue":false,"isPure":false,"lValueRequested":false,"leftExpression":{"id":1992,"isConstant":false,"isLValue":false,"isPure":true,"lValueRequested":false,"nodeType":"UnaryOperation","operator":"-","prefix":true,"src":"2126:2:9","subExpression":{"hexValue":"31","id":1991,"isConstant":false,"isLValue":false,"isPure":true,"kind":"number","lValueRequested":false,"nodeType":"Literal","src":"2127:1:9","typeDescriptions":{"typeIdentifier":"t_rational_1_by_1","typeString":"int_const 1"},"value":"1"},"typeDescriptions":{"typeIdentifier":"t_rational_minus_1_by_1","typeString":"int_const -1"}},"nodeType":"BinaryOperation","operator":"-","rightExpression":{"id":1993,"name":"value","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":1943,"src":"2131:5:9","typeDescriptions":{"typeIdentifier":"t_int256","typeString":"int256"}},"src":"2126:10:9","typeDescriptions":{"typeIdentifier":"t_int256","typeString":"int256"}}],"expression":{"argumentTypes":[{"typeIdentifier":"t_int256","typeString":"int256"}],"id":1990,"isConstant":false,"isLValue":false,"isPure":true,"lValueRequested":false,"nodeType":"ElementaryTypeNameExpression","src":"2118:7:9","typeDescriptions":{"typeIdentifier":"t_type$_t_uint256_$","typeString":"type(uint256)"},"typeName":{"id":1989,"name":"uint256","nodeType":"ElementaryTypeName","src":"2118:7:9","typeDescriptions":{}}},"id":1995,"isConstant":false,"isLValue":false,"isPure":false,"kind":"typeConversion","lValueRequested":false,"names":[],"nodeType":"FunctionCall","src":"2118:19:9","tryCall":false,"typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"}}],"expression":{"argumentTypes":[{"typeIdentifier":"t_uint256","typeString":"uint256"}],"id":1988,"isConstant":false,"isLValue":false,"isPure":true,"lValueRequested":false,"nodeType":"ElementaryTypeNameExpression","src":"2111:6:9","typeDescriptions":{"typeIdentifier":"t_type$_t_uint64_$","typeString":"type(uint64)"},"typeName":{"id":1987,"name":"uint64","nodeType":"ElementaryTypeName","src":"2111:6:9","typeDescriptions":{}}},"id":1996,"isConstant":false,"isLValue":false,"isPure":false,"kind":"typeConversion","lValueRequested":false,"names":[],"nodeType":"FunctionCall","src":"2111:27:9","tryCall":false,"typeDescriptions":{"typeIdentifier":"t_uint64","typeString":"uint64"}}],"expression":{"argumentTypes":[{"typeIdentifier":"t_struct$_buffer_$1204_memory_ptr","typeString":"struct BufferChainlink.buffer memory"},{"typeIdentifier":"t_uint8","typeString":"uint8"},{"typeIdentifier":"t_uint64","typeString":"uint64"}],"id":1984,"name":"encodeFixedNumeric","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":1886,"src":"2062:18:9","typeDescriptions":{"typeIdentifier":"t_function_internal_pure$_t_struct$_buffer_$1204_memory_ptr_$_t_uint8_$_t_uint64_$returns$__$","typeString":"function (struct BufferChainlink.buffer memory,uint8,uint64) pure"}},"id":1997,"isConstant":false,"isLValue":false,"isPure":false,"kind":"functionCall","lValueRequested":false,"names":[],"nodeType":"FunctionCall","src":"2062:77:9","tryCall":false,"typeDescriptions":{"typeIdentifier":"t_tuple$__$","typeString":"tuple()"}},"id":1998,"nodeType":"ExpressionStatement","src":"2062:77:9"}]},"id":2000,"nodeType":"IfStatement","src":"1955:191:9","trueBody":{"id":1983,"nodeType":"Block","src":"1970:78:9","statements":[{"expression":{"arguments":[{"id":1972,"name":"buf","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":1941,"src":"1997:3:9","typeDescriptions":{"typeIdentifier":"t_struct$_buffer_$1204_memory_ptr","typeString":"struct BufferChainlink.buffer memory"}},{"id":1973,"name":"MAJOR_TYPE_INT","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":1729,"src":"2002:14:9","typeDescriptions":{"typeIdentifier":"t_uint8","typeString":"uint8"}},{"arguments":[{"arguments":[{"id":1978,"name":"value","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":1943,"src":"2033:5:9","typeDescriptions":{"typeIdentifier":"t_int256","typeString":"int256"}}],"expression":{"argumentTypes":[{"typeIdentifier":"t_int256","typeString":"int256"}],"id":1977,"isConstant":false,"isLValue":false,"isPure":true,"lValueRequested":false,"nodeType":"ElementaryTypeNameExpression","src":"2025:7:9","typeDescriptions":{"typeIdentifier":"t_type$_t_uint256_$","typeString":"type(uint256)"},"typeName":{"id":1976,"name":"uint256","nodeType":"ElementaryTypeName","src":"2025:7:9","typeDescriptions":{}}},"id":1979,"isConstant":false,"isLValue":false,"isPure":false,"kind":"typeConversion","lValueRequested":false,"names":[],"nodeType":"FunctionCall","src":"2025:14:9","tryCall":false,"typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"}}],"expression":{"argumentTypes":[{"typeIdentifier":"t_uint256","typeString":"uint256"}],"id":1975,"isConstant":false,"isLValue":false,"isPure":true,"lValueRequested":false,"nodeType":"ElementaryTypeNameExpression","src":"2018:6:9","typeDescriptions":{"typeIdentifier":"t_type$_t_uint64_$","typeString":"type(uint64)"},"typeName":{"id":1974,"name":"uint64","nodeType":"ElementaryTypeName","src":"2018:6:9","typeDescriptions":{}}},"id":1980,"isConstant":false,"isLValue":false,"isPure":false,"kind":"typeConversion","lValueRequested":false,"names":[],"nodeType":"FunctionCall","src":"2018:22:9","tryCall":false,"typeDescriptions":{"typeIdentifier":"t_uint64","typeString":"uint64"}}],"expression":{"argumentTypes":[{"typeIdentifier":"t_struct$_buffer_$1204_memory_ptr","typeString":"struct BufferChainlink.buffer memory"},{"typeIdentifier":"t_uint8","typeString":"uint8"},{"typeIdentifier":"t_uint64","typeString":"uint64"}],"id":1971,"name":"encodeFixedNumeric","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":1886,"src":"1978:18:9","typeDescriptions":{"typeIdentifier":"t_function_internal_pure$_t_struct$_buffer_$1204_memory_ptr_$_t_uint8_$_t_uint64_$returns$__$","typeString":"function (struct BufferChainlink.buffer memory,uint8,uint64) pure"}},"id":1981,"isConstant":false,"isLValue":false,"isPure":false,"kind":"functionCall","lValueRequested":false,"names":[],"nodeType":"FunctionCall","src":"1978:63:9","tryCall":false,"typeDescriptions":{"typeIdentifier":"t_tuple$__$","typeString":"tuple()"}},"id":1982,"nodeType":"ExpressionStatement","src":"1978:63:9"}]}},"id":2001,"nodeType":"IfStatement","src":"1873:273:9","trueBody":{"id":1967,"nodeType":"Block","src":"1904:45:9","statements":[{"expression":{"arguments":[{"id":1960,"name":"buf","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":1941,"src":"1925:3:9","typeDescriptions":{"typeIdentifier":"t_struct$_buffer_$1204_memory_ptr","typeString":"struct BufferChainlink.buffer memory"}},{"arguments":[{"id":1963,"name":"value","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":1943,"src":"1935:5:9","typeDescriptions":{"typeIdentifier":"t_int256","typeString":"int256"}}],"expression":{"argumentTypes":[{"typeIdentifier":"t_int256","typeString":"int256"}],"id":1962,"isConstant":false,"isLValue":false,"isPure":true,"lValueRequested":false,"nodeType":"ElementaryTypeNameExpression","src":"1930:4:9","typeDescriptions":{"typeIdentifier":"t_type$_t_uint256_$","typeString":"type(uint256)"},"typeName":{"id":1961,"name":"uint","nodeType":"ElementaryTypeName","src":"1930:4:9","typeDescriptions":{}}},"id":1964,"isConstant":false,"isLValue":false,"isPure":false,"kind":"typeConversion","lValueRequested":false,"names":[],"nodeType":"FunctionCall","src":"1930:11:9","tryCall":false,"typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"}}],"expression":{"argumentTypes":[{"typeIdentifier":"t_struct$_buffer_$1204_memory_ptr","typeString":"struct BufferChainlink.buffer memory"},{"typeIdentifier":"t_uint256","typeString":"uint256"}],"id":1959,"name":"encodeBigNum","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":2060,"src":"1912:12:9","typeDescriptions":{"typeIdentifier":"t_function_internal_pure$_t_struct$_buffer_$1204_memory_ptr_$_t_uint256_$returns$__$","typeString":"function (struct BufferChainlink.buffer memory,uint256) pure"}},"id":1965,"isConstant":false,"isLValue":false,"isPure":false,"kind":"functionCall","lValueRequested":false,"names":[],"nodeType":"FunctionCall","src":"1912:30:9","tryCall":false,"typeDescriptions":{"typeIdentifier":"t_tuple$__$","typeString":"tuple()"}},"id":1966,"nodeType":"ExpressionStatement","src":"1912:30:9"}]}},"id":2002,"nodeType":"IfStatement","src":"1789:357:9","trueBody":{"id":1955,"nodeType":"Block","src":"1822:45:9","statements":[{"expression":{"arguments":[{"id":1951,"name":"buf","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":1941,"src":"1849:3:9","typeDescriptions":{"typeIdentifier":"t_struct$_buffer_$1204_memory_ptr","typeString":"struct BufferChainlink.buffer memory"}},{"id":1952,"name":"value","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":1943,"src":"1854:5:9","typeDescriptions":{"typeIdentifier":"t_int256","typeString":"int256"}}],"expression":{"argumentTypes":[{"typeIdentifier":"t_struct$_buffer_$1204_memory_ptr","typeString":"struct BufferChainlink.buffer memory"},{"typeIdentifier":"t_int256","typeString":"int256"}],"id":1950,"name":"encodeSignedBigNum","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":2097,"src":"1830:18:9","typeDescriptions":{"typeIdentifier":"t_function_internal_pure$_t_struct$_buffer_$1204_memory_ptr_$_t_int256_$returns$__$","typeString":"function (struct BufferChainlink.buffer memory,int256) pure"}},"id":1953,"isConstant":false,"isLValue":false,"isPure":false,"kind":"functionCall","lValueRequested":false,"names":[],"nodeType":"FunctionCall","src":"1830:30:9","tryCall":false,"typeDescriptions":{"typeIdentifier":"t_tuple$__$","typeString":"tuple()"}},"id":1954,"nodeType":"ExpressionStatement","src":"1830:30:9"}]}}]},"id":2004,"implemented":true,"kind":"function","modifiers":[],"name":"encodeInt","nameLocation":"1713:9:9","nodeType":"FunctionDefinition","parameters":{"id":1944,"nodeType":"ParameterList","parameters":[{"constant":false,"id":1941,"mutability":"mutable","name":"buf","nameLocation":"1753:3:9","nodeType":"VariableDeclaration","scope":2004,"src":"1723:33:9","stateVariable":false,"storageLocation":"memory","typeDescriptions":{"typeIdentifier":"t_struct$_buffer_$1204_memory_ptr","typeString":"struct BufferChainlink.buffer"},"typeName":{"id":1940,"nodeType":"UserDefinedTypeName","pathNode":{"id":1939,"name":"BufferChainlink.buffer","nodeType":"IdentifierPath","referencedDeclaration":1204,"src":"1723:22:9"},"referencedDeclaration":1204,"src":"1723:22:9","typeDescriptions":{"typeIdentifier":"t_struct$_buffer_$1204_storage_ptr","typeString":"struct BufferChainlink.buffer"}},"visibility":"internal"},{"constant":false,"id":1943,"mutability":"mutable","name":"value","nameLocation":"1762:5:9","nodeType":"VariableDeclaration","scope":2004,"src":"1758:9:9","stateVariable":false,"storageLocation":"default","typeDescriptions":{"typeIdentifier":"t_int256","typeString":"int256"},"typeName":{"id":1942,"name":"int","nodeType":"ElementaryTypeName","src":"1758:3:9","typeDescriptions":{"typeIdentifier":"t_int256","typeString":"int256"}},"visibility":"internal"}],"src":"1722:46:9"},"returnParameters":{"id":1945,"nodeType":"ParameterList","parameters":[],"src":"1783:0:9"},"scope":2165,"src":"1704:446:9","stateMutability":"pure","virtual":false,"visibility":"internal"},{"body":{"id":2028,"nodeType":"Block","src":"2244:97:9","statements":[{"expression":{"arguments":[{"id":2013,"name":"buf","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":2007,"src":"2269:3:9","typeDescriptions":{"typeIdentifier":"t_struct$_buffer_$1204_memory_ptr","typeString":"struct BufferChainlink.buffer memory"}},{"id":2014,"name":"MAJOR_TYPE_BYTES","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":1735,"src":"2274:16:9","typeDescriptions":{"typeIdentifier":"t_uint8","typeString":"uint8"}},{"arguments":[{"expression":{"id":2017,"name":"value","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":2009,"src":"2299:5:9","typeDescriptions":{"typeIdentifier":"t_bytes_memory_ptr","typeString":"bytes memory"}},"id":2018,"isConstant":false,"isLValue":false,"isPure":false,"lValueRequested":false,"memberName":"length","nodeType":"MemberAccess","src":"2299:12:9","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"}}],"expression":{"argumentTypes":[{"typeIdentifier":"t_uint256","typeString":"uint256"}],"id":2016,"isConstant":false,"isLValue":false,"isPure":true,"lValueRequested":false,"nodeType":"ElementaryTypeNameExpression","src":"2292:6:9","typeDescriptions":{"typeIdentifier":"t_type$_t_uint64_$","typeString":"type(uint64)"},"typeName":{"id":2015,"name":"uint64","nodeType":"ElementaryTypeName","src":"2292:6:9","typeDescriptions":{}}},"id":2019,"isConstant":false,"isLValue":false,"isPure":false,"kind":"typeConversion","lValueRequested":false,"names":[],"nodeType":"FunctionCall","src":"2292:20:9","tryCall":false,"typeDescriptions":{"typeIdentifier":"t_uint64","typeString":"uint64"}}],"expression":{"argumentTypes":[{"typeIdentifier":"t_struct$_buffer_$1204_memory_ptr","typeString":"struct BufferChainlink.buffer memory"},{"typeIdentifier":"t_uint8","typeString":"uint8"},{"typeIdentifier":"t_uint64","typeString":"uint64"}],"id":2012,"name":"encodeFixedNumeric","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":1886,"src":"2250:18:9","typeDescriptions":{"typeIdentifier":"t_function_internal_pure$_t_struct$_buffer_$1204_memory_ptr_$_t_uint8_$_t_uint64_$returns$__$","typeString":"function (struct BufferChainlink.buffer memory,uint8,uint64) pure"}},"id":2020,"isConstant":false,"isLValue":false,"isPure":false,"kind":"functionCall","lValueRequested":false,"names":[],"nodeType":"FunctionCall","src":"2250:63:9","tryCall":false,"typeDescriptions":{"typeIdentifier":"t_tuple$__$","typeString":"tuple()"}},"id":2021,"nodeType":"ExpressionStatement","src":"2250:63:9"},{"expression":{"arguments":[{"id":2025,"name":"value","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":2009,"src":"2330:5:9","typeDescriptions":{"typeIdentifier":"t_bytes_memory_ptr","typeString":"bytes memory"}}],"expression":{"argumentTypes":[{"typeIdentifier":"t_bytes_memory_ptr","typeString":"bytes memory"}],"expression":{"id":2022,"name":"buf","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":2007,"src":"2319:3:9","typeDescriptions":{"typeIdentifier":"t_struct$_buffer_$1204_memory_ptr","typeString":"struct BufferChainlink.buffer memory"}},"id":2024,"isConstant":false,"isLValue":true,"isPure":false,"lValueRequested":false,"memberName":"append","nodeType":"MemberAccess","referencedDeclaration":1461,"src":"2319:10:9","typeDescriptions":{"typeIdentifier":"t_function_internal_pure$_t_struct$_buffer_$1204_memory_ptr_$_t_bytes_memory_ptr_$returns$_t_struct$_buffer_$1204_memory_ptr_$bound_to$_t_struct$_buffer_$1204_memory_ptr_$","typeString":"function (struct BufferChainlink.buffer memory,bytes memory) pure returns (struct BufferChainlink.buffer memory)"}},"id":2026,"isConstant":false,"isLValue":false,"isPure":false,"kind":"functionCall","lValueRequested":false,"names":[],"nodeType":"FunctionCall","src":"2319:17:9","tryCall":false,"typeDescriptions":{"typeIdentifier":"t_struct$_buffer_$1204_memory_ptr","typeString":"struct BufferChainlink.buffer memory"}},"id":2027,"nodeType":"ExpressionStatement","src":"2319:17:9"}]},"id":2029,"implemented":true,"kind":"function","modifiers":[],"name":"encodeBytes","nameLocation":"2163:11:9","nodeType":"FunctionDefinition","parameters":{"id":2010,"nodeType":"ParameterList","parameters":[{"constant":false,"id":2007,"mutability":"mutable","name":"buf","nameLocation":"2205:3:9","nodeType":"VariableDeclaration","scope":2029,"src":"2175:33:9","stateVariable":false,"storageLocation":"memory","typeDescriptions":{"typeIdentifier":"t_struct$_buffer_$1204_memory_ptr","typeString":"struct BufferChainlink.buffer"},"typeName":{"id":2006,"nodeType":"UserDefinedTypeName","pathNode":{"id":2005,"name":"BufferChainlink.buffer","nodeType":"IdentifierPath","referencedDeclaration":1204,"src":"2175:22:9"},"referencedDeclaration":1204,"src":"2175:22:9","typeDescriptions":{"typeIdentifier":"t_struct$_buffer_$1204_storage_ptr","typeString":"struct BufferChainlink.buffer"}},"visibility":"internal"},{"constant":false,"id":2009,"mutability":"mutable","name":"value","nameLocation":"2223:5:9","nodeType":"VariableDeclaration","scope":2029,"src":"2210:18:9","stateVariable":false,"storageLocation":"memory","typeDescriptions":{"typeIdentifier":"t_bytes_memory_ptr","typeString":"bytes"},"typeName":{"id":2008,"name":"bytes","nodeType":"ElementaryTypeName","src":"2210:5:9","typeDescriptions":{"typeIdentifier":"t_bytes_storage_ptr","typeString":"bytes"}},"visibility":"internal"}],"src":"2174:55:9"},"returnParameters":{"id":2011,"nodeType":"ParameterList","parameters":[],"src":"2244:0:9"},"scope":2165,"src":"2154:187:9","stateMutability":"pure","virtual":false,"visibility":"internal"},{"body":{"id":2059,"nodeType":"Block","src":"2428:115:9","statements":[{"expression":{"arguments":[{"arguments":[{"commonType":{"typeIdentifier":"t_uint8","typeString":"uint8"},"id":2047,"isConstant":false,"isLValue":false,"isPure":true,"lValueRequested":false,"leftExpression":{"components":[{"commonType":{"typeIdentifier":"t_uint8","typeString":"uint8"},"id":2044,"isConstant":false,"isLValue":false,"isPure":true,"lValueRequested":false,"leftExpression":{"id":2042,"name":"MAJOR_TYPE_TAG","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":1747,"src":"2457:14:9","typeDescriptions":{"typeIdentifier":"t_uint8","typeString":"uint8"}},"nodeType":"BinaryOperation","operator":"<<","rightExpression":{"hexValue":"35","id":2043,"isConstant":false,"isLValue":false,"isPure":true,"kind":"number","lValueRequested":false,"nodeType":"Literal","src":"2475:1:9","typeDescriptions":{"typeIdentifier":"t_rational_5_by_1","typeString":"int_const 5"},"value":"5"},"src":"2457:19:9","typeDescriptions":{"typeIdentifier":"t_uint8","typeString":"uint8"}}],"id":2045,"isConstant":false,"isInlineArray":false,"isLValue":false,"isPure":true,"lValueRequested":false,"nodeType":"TupleExpression","src":"2456:21:9","typeDescriptions":{"typeIdentifier":"t_uint8","typeString":"uint8"}},"nodeType":"BinaryOperation","operator":"|","rightExpression":{"id":2046,"name":"TAG_TYPE_BIGNUM","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":1753,"src":"2480:15:9","typeDescriptions":{"typeIdentifier":"t_uint8","typeString":"uint8"}},"src":"2456:39:9","typeDescriptions":{"typeIdentifier":"t_uint8","typeString":"uint8"}}],"expression":{"argumentTypes":[{"typeIdentifier":"t_uint8","typeString":"uint8"}],"id":2041,"isConstant":false,"isLValue":false,"isPure":true,"lValueRequested":false,"nodeType":"ElementaryTypeNameExpression","src":"2450:5:9","typeDescriptions":{"typeIdentifier":"t_type$_t_uint8_$","typeString":"type(uint8)"},"typeName":{"id":2040,"name":"uint8","nodeType":"ElementaryTypeName","src":"2450:5:9","typeDescriptions":{}}},"id":2048,"isConstant":false,"isLValue":false,"isPure":true,"kind":"typeConversion","lValueRequested":false,"names":[],"nodeType":"FunctionCall","src":"2450:46:9","tryCall":false,"typeDescriptions":{"typeIdentifier":"t_uint8","typeString":"uint8"}}],"expression":{"argumentTypes":[{"typeIdentifier":"t_uint8","typeString":"uint8"}],"expression":{"id":2037,"name":"buf","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":2032,"src":"2434:3:9","typeDescriptions":{"typeIdentifier":"t_struct$_buffer_$1204_memory_ptr","typeString":"struct BufferChainlink.buffer memory"}},"id":2039,"isConstant":false,"isLValue":true,"isPure":false,"lValueRequested":false,"memberName":"appendUint8","nodeType":"MemberAccess","referencedDeclaration":1514,"src":"2434:15:9","typeDescriptions":{"typeIdentifier":"t_function_internal_pure$_t_struct$_buffer_$1204_memory_ptr_$_t_uint8_$returns$_t_struct$_buffer_$1204_memory_ptr_$bound_to$_t_struct$_buffer_$1204_memory_ptr_$","typeString":"function (struct BufferChainlink.buffer memory,uint8) pure returns (struct BufferChainlink.buffer memory)"}},"id":2049,"isConstant":false,"isLValue":false,"isPure":false,"kind":"functionCall","lValueRequested":false,"names":[],"nodeType":"FunctionCall","src":"2434:63:9","tryCall":false,"typeDescriptions":{"typeIdentifier":"t_struct$_buffer_$1204_memory_ptr","typeString":"struct BufferChainlink.buffer memory"}},"id":2050,"nodeType":"ExpressionStatement","src":"2434:63:9"},{"expression":{"arguments":[{"id":2052,"name":"buf","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":2032,"src":"2515:3:9","typeDescriptions":{"typeIdentifier":"t_struct$_buffer_$1204_memory_ptr","typeString":"struct BufferChainlink.buffer memory"}},{"arguments":[{"id":2055,"name":"value","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":2034,"src":"2531:5:9","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"}}],"expression":{"argumentTypes":[{"typeIdentifier":"t_uint256","typeString":"uint256"}],"expression":{"id":2053,"name":"abi","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":-1,"src":"2520:3:9","typeDescriptions":{"typeIdentifier":"t_magic_abi","typeString":"abi"}},"id":2054,"isConstant":false,"isLValue":false,"isPure":true,"lValueRequested":false,"memberName":"encode","nodeType":"MemberAccess","src":"2520:10:9","typeDescriptions":{"typeIdentifier":"t_function_abiencode_pure$__$returns$_t_bytes_memory_ptr_$","typeString":"function () pure returns (bytes memory)"}},"id":2056,"isConstant":false,"isLValue":false,"isPure":false,"kind":"functionCall","lValueRequested":false,"names":[],"nodeType":"FunctionCall","src":"2520:17:9","tryCall":false,"typeDescriptions":{"typeIdentifier":"t_bytes_memory_ptr","typeString":"bytes memory"}}],"expression":{"argumentTypes":[{"typeIdentifier":"t_struct$_buffer_$1204_memory_ptr","typeString":"struct BufferChainlink.buffer memory"},{"typeIdentifier":"t_bytes_memory_ptr","typeString":"bytes memory"}],"id":2051,"name":"encodeBytes","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":2029,"src":"2503:11:9","typeDescriptions":{"typeIdentifier":"t_function_internal_pure$_t_struct$_buffer_$1204_memory_ptr_$_t_bytes_memory_ptr_$returns$__$","typeString":"function (struct BufferChainlink.buffer memory,bytes memory) pure"}},"id":2057,"isConstant":false,"isLValue":false,"isPure":false,"kind":"functionCall","lValueRequested":false,"names":[],"nodeType":"FunctionCall","src":"2503:35:9","tryCall":false,"typeDescriptions":{"typeIdentifier":"t_tuple$__$","typeString":"tuple()"}},"id":2058,"nodeType":"ExpressionStatement","src":"2503:35:9"}]},"id":2060,"implemented":true,"kind":"function","modifiers":[],"name":"encodeBigNum","nameLocation":"2354:12:9","nodeType":"FunctionDefinition","parameters":{"id":2035,"nodeType":"ParameterList","parameters":[{"constant":false,"id":2032,"mutability":"mutable","name":"buf","nameLocation":"2397:3:9","nodeType":"VariableDeclaration","scope":2060,"src":"2367:33:9","stateVariable":false,"storageLocation":"memory","typeDescriptions":{"typeIdentifier":"t_struct$_buffer_$1204_memory_ptr","typeString":"struct BufferChainlink.buffer"},"typeName":{"id":2031,"nodeType":"UserDefinedTypeName","pathNode":{"id":2030,"name":"BufferChainlink.buffer","nodeType":"IdentifierPath","referencedDeclaration":1204,"src":"2367:22:9"},"referencedDeclaration":1204,"src":"2367:22:9","typeDescriptions":{"typeIdentifier":"t_struct$_buffer_$1204_storage_ptr","typeString":"struct BufferChainlink.buffer"}},"visibility":"internal"},{"constant":false,"id":2034,"mutability":"mutable","name":"value","nameLocation":"2407:5:9","nodeType":"VariableDeclaration","scope":2060,"src":"2402:10:9","stateVariable":false,"storageLocation":"default","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"},"typeName":{"id":2033,"name":"uint","nodeType":"ElementaryTypeName","src":"2402:4:9","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"}},"visibility":"internal"}],"src":"2366:47:9"},"returnParameters":{"id":2036,"nodeType":"ParameterList","parameters":[],"src":"2428:0:9"},"scope":2165,"src":"2345:198:9","stateMutability":"pure","virtual":false,"visibility":"internal"},{"body":{"id":2096,"nodeType":"Block","src":"2635:138:9","statements":[{"expression":{"arguments":[{"arguments":[{"commonType":{"typeIdentifier":"t_uint8","typeString":"uint8"},"id":2078,"isConstant":false,"isLValue":false,"isPure":true,"lValueRequested":false,"leftExpression":{"components":[{"commonType":{"typeIdentifier":"t_uint8","typeString":"uint8"},"id":2075,"isConstant":false,"isLValue":false,"isPure":true,"lValueRequested":false,"leftExpression":{"id":2073,"name":"MAJOR_TYPE_TAG","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":1747,"src":"2664:14:9","typeDescriptions":{"typeIdentifier":"t_uint8","typeString":"uint8"}},"nodeType":"BinaryOperation","operator":"<<","rightExpression":{"hexValue":"35","id":2074,"isConstant":false,"isLValue":false,"isPure":true,"kind":"number","lValueRequested":false,"nodeType":"Literal","src":"2682:1:9","typeDescriptions":{"typeIdentifier":"t_rational_5_by_1","typeString":"int_const 5"},"value":"5"},"src":"2664:19:9","typeDescriptions":{"typeIdentifier":"t_uint8","typeString":"uint8"}}],"id":2076,"isConstant":false,"isInlineArray":false,"isLValue":false,"isPure":true,"lValueRequested":false,"nodeType":"TupleExpression","src":"2663:21:9","typeDescriptions":{"typeIdentifier":"t_uint8","typeString":"uint8"}},"nodeType":"BinaryOperation","operator":"|","rightExpression":{"id":2077,"name":"TAG_TYPE_NEGATIVE_BIGNUM","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":1756,"src":"2687:24:9","typeDescriptions":{"typeIdentifier":"t_uint8","typeString":"uint8"}},"src":"2663:48:9","typeDescriptions":{"typeIdentifier":"t_uint8","typeString":"uint8"}}],"expression":{"argumentTypes":[{"typeIdentifier":"t_uint8","typeString":"uint8"}],"id":2072,"isConstant":false,"isLValue":false,"isPure":true,"lValueRequested":false,"nodeType":"ElementaryTypeNameExpression","src":"2657:5:9","typeDescriptions":{"typeIdentifier":"t_type$_t_uint8_$","typeString":"type(uint8)"},"typeName":{"id":2071,"name":"uint8","nodeType":"ElementaryTypeName","src":"2657:5:9","typeDescriptions":{}}},"id":2079,"isConstant":false,"isLValue":false,"isPure":true,"kind":"typeConversion","lValueRequested":false,"names":[],"nodeType":"FunctionCall","src":"2657:55:9","tryCall":false,"typeDescriptions":{"typeIdentifier":"t_uint8","typeString":"uint8"}}],"expression":{"argumentTypes":[{"typeIdentifier":"t_uint8","typeString":"uint8"}],"expression":{"id":2068,"name":"buf","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":2063,"src":"2641:3:9","typeDescriptions":{"typeIdentifier":"t_struct$_buffer_$1204_memory_ptr","typeString":"struct BufferChainlink.buffer memory"}},"id":2070,"isConstant":false,"isLValue":true,"isPure":false,"lValueRequested":false,"memberName":"appendUint8","nodeType":"MemberAccess","referencedDeclaration":1514,"src":"2641:15:9","typeDescriptions":{"typeIdentifier":"t_function_internal_pure$_t_struct$_buffer_$1204_memory_ptr_$_t_uint8_$returns$_t_struct$_buffer_$1204_memory_ptr_$bound_to$_t_struct$_buffer_$1204_memory_ptr_$","typeString":"function (struct BufferChainlink.buffer memory,uint8) pure returns (struct BufferChainlink.buffer memory)"}},"id":2080,"isConstant":false,"isLValue":false,"isPure":false,"kind":"functionCall","lValueRequested":false,"names":[],"nodeType":"FunctionCall","src":"2641:72:9","tryCall":false,"typeDescriptions":{"typeIdentifier":"t_struct$_buffer_$1204_memory_ptr","typeString":"struct BufferChainlink.buffer memory"}},"id":2081,"nodeType":"ExpressionStatement","src":"2641:72:9"},{"expression":{"arguments":[{"id":2083,"name":"buf","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":2063,"src":"2731:3:9","typeDescriptions":{"typeIdentifier":"t_struct$_buffer_$1204_memory_ptr","typeString":"struct BufferChainlink.buffer memory"}},{"arguments":[{"arguments":[{"commonType":{"typeIdentifier":"t_int256","typeString":"int256"},"id":2091,"isConstant":false,"isLValue":false,"isPure":false,"lValueRequested":false,"leftExpression":{"id":2089,"isConstant":false,"isLValue":false,"isPure":true,"lValueRequested":false,"nodeType":"UnaryOperation","operator":"-","prefix":true,"src":"2755:2:9","subExpression":{"hexValue":"31","id":2088,"isConstant":false,"isLValue":false,"isPure":true,"kind":"number","lValueRequested":false,"nodeType":"Literal","src":"2756:1:9","typeDescriptions":{"typeIdentifier":"t_rational_1_by_1","typeString":"int_const 1"},"value":"1"},"typeDescriptions":{"typeIdentifier":"t_rational_minus_1_by_1","typeString":"int_const -1"}},"nodeType":"BinaryOperation","operator":"-","rightExpression":{"id":2090,"name":"input","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":2065,"src":"2760:5:9","typeDescriptions":{"typeIdentifier":"t_int256","typeString":"int256"}},"src":"2755:10:9","typeDescriptions":{"typeIdentifier":"t_int256","typeString":"int256"}}],"expression":{"argumentTypes":[{"typeIdentifier":"t_int256","typeString":"int256"}],"id":2087,"isConstant":false,"isLValue":false,"isPure":true,"lValueRequested":false,"nodeType":"ElementaryTypeNameExpression","src":"2747:7:9","typeDescriptions":{"typeIdentifier":"t_type$_t_uint256_$","typeString":"type(uint256)"},"typeName":{"id":2086,"name":"uint256","nodeType":"ElementaryTypeName","src":"2747:7:9","typeDescriptions":{}}},"id":2092,"isConstant":false,"isLValue":false,"isPure":false,"kind":"typeConversion","lValueRequested":false,"names":[],"nodeType":"FunctionCall","src":"2747:19:9","tryCall":false,"typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"}}],"expression":{"argumentTypes":[{"typeIdentifier":"t_uint256","typeString":"uint256"}],"expression":{"id":2084,"name":"abi","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":-1,"src":"2736:3:9","typeDescriptions":{"typeIdentifier":"t_magic_abi","typeString":"abi"}},"id":2085,"isConstant":false,"isLValue":false,"isPure":true,"lValueRequested":false,"memberName":"encode","nodeType":"MemberAccess","src":"2736:10:9","typeDescriptions":{"typeIdentifier":"t_function_abiencode_pure$__$returns$_t_bytes_memory_ptr_$","typeString":"function () pure returns (bytes memory)"}},"id":2093,"isConstant":false,"isLValue":false,"isPure":false,"kind":"functionCall","lValueRequested":false,"names":[],"nodeType":"FunctionCall","src":"2736:31:9","tryCall":false,"typeDescriptions":{"typeIdentifier":"t_bytes_memory_ptr","typeString":"bytes memory"}}],"expression":{"argumentTypes":[{"typeIdentifier":"t_struct$_buffer_$1204_memory_ptr","typeString":"struct BufferChainlink.buffer memory"},{"typeIdentifier":"t_bytes_memory_ptr","typeString":"bytes memory"}],"id":2082,"name":"encodeBytes","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":2029,"src":"2719:11:9","typeDescriptions":{"typeIdentifier":"t_function_internal_pure$_t_struct$_buffer_$1204_memory_ptr_$_t_bytes_memory_ptr_$returns$__$","typeString":"function (struct BufferChainlink.buffer memory,bytes memory) pure"}},"id":2094,"isConstant":false,"isLValue":false,"isPure":false,"kind":"functionCall","lValueRequested":false,"names":[],"nodeType":"FunctionCall","src":"2719:49:9","tryCall":false,"typeDescriptions":{"typeIdentifier":"t_tuple$__$","typeString":"tuple()"}},"id":2095,"nodeType":"ExpressionStatement","src":"2719:49:9"}]},"id":2097,"implemented":true,"kind":"function","modifiers":[],"name":"encodeSignedBigNum","nameLocation":"2556:18:9","nodeType":"FunctionDefinition","parameters":{"id":2066,"nodeType":"ParameterList","parameters":[{"constant":false,"id":2063,"mutability":"mutable","name":"buf","nameLocation":"2605:3:9","nodeType":"VariableDeclaration","scope":2097,"src":"2575:33:9","stateVariable":false,"storageLocation":"memory","typeDescriptions":{"typeIdentifier":"t_struct$_buffer_$1204_memory_ptr","typeString":"struct BufferChainlink.buffer"},"typeName":{"id":2062,"nodeType":"UserDefinedTypeName","pathNode":{"id":2061,"name":"BufferChainlink.buffer","nodeType":"IdentifierPath","referencedDeclaration":1204,"src":"2575:22:9"},"referencedDeclaration":1204,"src":"2575:22:9","typeDescriptions":{"typeIdentifier":"t_struct$_buffer_$1204_storage_ptr","typeString":"struct BufferChainlink.buffer"}},"visibility":"internal"},{"constant":false,"id":2065,"mutability":"mutable","name":"input","nameLocation":"2614:5:9","nodeType":"VariableDeclaration","scope":2097,"src":"2610:9:9","stateVariable":false,"storageLocation":"default","typeDescriptions":{"typeIdentifier":"t_int256","typeString":"int256"},"typeName":{"id":2064,"name":"int","nodeType":"ElementaryTypeName","src":"2610:3:9","typeDescriptions":{"typeIdentifier":"t_int256","typeString":"int256"}},"visibility":"internal"}],"src":"2574:46:9"},"returnParameters":{"id":2067,"nodeType":"ParameterList","parameters":[],"src":"2635:0:9"},"scope":2165,"src":"2547:226:9","stateMutability":"pure","virtual":false,"visibility":"internal"},{"body":{"id":2127,"nodeType":"Block","src":"2869:112:9","statements":[{"expression":{"arguments":[{"id":2106,"name":"buf","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":2100,"src":"2894:3:9","typeDescriptions":{"typeIdentifier":"t_struct$_buffer_$1204_memory_ptr","typeString":"struct BufferChainlink.buffer memory"}},{"id":2107,"name":"MAJOR_TYPE_STRING","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":1738,"src":"2899:17:9","typeDescriptions":{"typeIdentifier":"t_uint8","typeString":"uint8"}},{"arguments":[{"expression":{"arguments":[{"id":2112,"name":"value","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":2102,"src":"2931:5:9","typeDescriptions":{"typeIdentifier":"t_string_memory_ptr","typeString":"string memory"}}],"expression":{"argumentTypes":[{"typeIdentifier":"t_string_memory_ptr","typeString":"string memory"}],"id":2111,"isConstant":false,"isLValue":false,"isPure":true,"lValueRequested":false,"nodeType":"ElementaryTypeNameExpression","src":"2925:5:9","typeDescriptions":{"typeIdentifier":"t_type$_t_bytes_storage_ptr_$","typeString":"type(bytes storage pointer)"},"typeName":{"id":2110,"name":"bytes","nodeType":"ElementaryTypeName","src":"2925:5:9","typeDescriptions":{}}},"id":2113,"isConstant":false,"isLValue":false,"isPure":false,"kind":"typeConversion","lValueRequested":false,"names":[],"nodeType":"FunctionCall","src":"2925:12:9","tryCall":false,"typeDescriptions":{"typeIdentifier":"t_bytes_memory_ptr","typeString":"bytes memory"}},"id":2114,"isConstant":false,"isLValue":false,"isPure":false,"lValueRequested":false,"memberName":"length","nodeType":"MemberAccess","src":"2925:19:9","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"}}],"expression":{"argumentTypes":[{"typeIdentifier":"t_uint256","typeString":"uint256"}],"id":2109,"isConstant":false,"isLValue":false,"isPure":true,"lValueRequested":false,"nodeType":"ElementaryTypeNameExpression","src":"2918:6:9","typeDescriptions":{"typeIdentifier":"t_type$_t_uint64_$","typeString":"type(uint64)"},"typeName":{"id":2108,"name":"uint64","nodeType":"ElementaryTypeName","src":"2918:6:9","typeDescriptions":{}}},"id":2115,"isConstant":false,"isLValue":false,"isPure":false,"kind":"typeConversion","lValueRequested":false,"names":[],"nodeType":"FunctionCall","src":"2918:27:9","tryCall":false,"typeDescriptions":{"typeIdentifier":"t_uint64","typeString":"uint64"}}],"expression":{"argumentTypes":[{"typeIdentifier":"t_struct$_buffer_$1204_memory_ptr","typeString":"struct BufferChainlink.buffer memory"},{"typeIdentifier":"t_uint8","typeString":"uint8"},{"typeIdentifier":"t_uint64","typeString":"uint64"}],"id":2105,"name":"encodeFixedNumeric","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":1886,"src":"2875:18:9","typeDescriptions":{"typeIdentifier":"t_function_internal_pure$_t_struct$_buffer_$1204_memory_ptr_$_t_uint8_$_t_uint64_$returns$__$","typeString":"function (struct BufferChainlink.buffer memory,uint8,uint64) pure"}},"id":2116,"isConstant":false,"isLValue":false,"isPure":false,"kind":"functionCall","lValueRequested":false,"names":[],"nodeType":"FunctionCall","src":"2875:71:9","tryCall":false,"typeDescriptions":{"typeIdentifier":"t_tuple$__$","typeString":"tuple()"}},"id":2117,"nodeType":"ExpressionStatement","src":"2875:71:9"},{"expression":{"arguments":[{"arguments":[{"id":2123,"name":"value","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":2102,"src":"2969:5:9","typeDescriptions":{"typeIdentifier":"t_string_memory_ptr","typeString":"string memory"}}],"expression":{"argumentTypes":[{"typeIdentifier":"t_string_memory_ptr","typeString":"string memory"}],"id":2122,"isConstant":false,"isLValue":false,"isPure":true,"lValueRequested":false,"nodeType":"ElementaryTypeNameExpression","src":"2963:5:9","typeDescriptions":{"typeIdentifier":"t_type$_t_bytes_storage_ptr_$","typeString":"type(bytes storage pointer)"},"typeName":{"id":2121,"name":"bytes","nodeType":"ElementaryTypeName","src":"2963:5:9","typeDescriptions":{}}},"id":2124,"isConstant":false,"isLValue":false,"isPure":false,"kind":"typeConversion","lValueRequested":false,"names":[],"nodeType":"FunctionCall","src":"2963:12:9","tryCall":false,"typeDescriptions":{"typeIdentifier":"t_bytes_memory_ptr","typeString":"bytes memory"}}],"expression":{"argumentTypes":[{"typeIdentifier":"t_bytes_memory_ptr","typeString":"bytes memory"}],"expression":{"id":2118,"name":"buf","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":2100,"src":"2952:3:9","typeDescriptions":{"typeIdentifier":"t_struct$_buffer_$1204_memory_ptr","typeString":"struct BufferChainlink.buffer memory"}},"id":2120,"isConstant":false,"isLValue":true,"isPure":false,"lValueRequested":false,"memberName":"append","nodeType":"MemberAccess","referencedDeclaration":1461,"src":"2952:10:9","typeDescriptions":{"typeIdentifier":"t_function_internal_pure$_t_struct$_buffer_$1204_memory_ptr_$_t_bytes_memory_ptr_$returns$_t_struct$_buffer_$1204_memory_ptr_$bound_to$_t_struct$_buffer_$1204_memory_ptr_$","typeString":"function (struct BufferChainlink.buffer memory,bytes memory) pure returns (struct BufferChainlink.buffer memory)"}},"id":2125,"isConstant":false,"isLValue":false,"isPure":false,"kind":"functionCall","lValueRequested":false,"names":[],"nodeType":"FunctionCall","src":"2952:24:9","tryCall":false,"typeDescriptions":{"typeIdentifier":"t_struct$_buffer_$1204_memory_ptr","typeString":"struct BufferChainlink.buffer memory"}},"id":2126,"nodeType":"ExpressionStatement","src":"2952:24:9"}]},"id":2128,"implemented":true,"kind":"function","modifiers":[],"name":"encodeString","nameLocation":"2786:12:9","nodeType":"FunctionDefinition","parameters":{"id":2103,"nodeType":"ParameterList","parameters":[{"constant":false,"id":2100,"mutability":"mutable","name":"buf","nameLocation":"2829:3:9","nodeType":"VariableDeclaration","scope":2128,"src":"2799:33:9","stateVariable":false,"storageLocation":"memory","typeDescriptions":{"typeIdentifier":"t_struct$_buffer_$1204_memory_ptr","typeString":"struct BufferChainlink.buffer"},"typeName":{"id":2099,"nodeType":"UserDefinedTypeName","pathNode":{"id":2098,"name":"BufferChainlink.buffer","nodeType":"IdentifierPath","referencedDeclaration":1204,"src":"2799:22:9"},"referencedDeclaration":1204,"src":"2799:22:9","typeDescriptions":{"typeIdentifier":"t_struct$_buffer_$1204_storage_ptr","typeString":"struct BufferChainlink.buffer"}},"visibility":"internal"},{"constant":false,"id":2102,"mutability":"mutable","name":"value","nameLocation":"2848:5:9","nodeType":"VariableDeclaration","scope":2128,"src":"2834:19:9","stateVariable":false,"storageLocation":"memory","typeDescriptions":{"typeIdentifier":"t_string_memory_ptr","typeString":"string"},"typeName":{"id":2101,"name":"string","nodeType":"ElementaryTypeName","src":"2834:6:9","typeDescriptions":{"typeIdentifier":"t_string_storage_ptr","typeString":"string"}},"visibility":"internal"}],"src":"2798:56:9"},"returnParameters":{"id":2104,"nodeType":"ParameterList","parameters":[],"src":"2869:0:9"},"scope":2165,"src":"2777:204:9","stateMutability":"pure","virtual":false,"visibility":"internal"},{"body":{"id":2139,"nodeType":"Block","src":"3054:60:9","statements":[{"expression":{"arguments":[{"id":2135,"name":"buf","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":2131,"src":"3087:3:9","typeDescriptions":{"typeIdentifier":"t_struct$_buffer_$1204_memory_ptr","typeString":"struct BufferChainlink.buffer memory"}},{"id":2136,"name":"MAJOR_TYPE_ARRAY","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":1741,"src":"3092:16:9","typeDescriptions":{"typeIdentifier":"t_uint8","typeString":"uint8"}}],"expression":{"argumentTypes":[{"typeIdentifier":"t_struct$_buffer_$1204_memory_ptr","typeString":"struct BufferChainlink.buffer memory"},{"typeIdentifier":"t_uint8","typeString":"uint8"}],"id":2134,"name":"encodeIndefiniteLengthType","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":1909,"src":"3060:26:9","typeDescriptions":{"typeIdentifier":"t_function_internal_pure$_t_struct$_buffer_$1204_memory_ptr_$_t_uint8_$returns$__$","typeString":"function (struct BufferChainlink.buffer memory,uint8) pure"}},"id":2137,"isConstant":false,"isLValue":false,"isPure":false,"kind":"functionCall","lValueRequested":false,"names":[],"nodeType":"FunctionCall","src":"3060:49:9","tryCall":false,"typeDescriptions":{"typeIdentifier":"t_tuple$__$","typeString":"tuple()"}},"id":2138,"nodeType":"ExpressionStatement","src":"3060:49:9"}]},"id":2140,"implemented":true,"kind":"function","modifiers":[],"name":"startArray","nameLocation":"2994:10:9","nodeType":"FunctionDefinition","parameters":{"id":2132,"nodeType":"ParameterList","parameters":[{"constant":false,"id":2131,"mutability":"mutable","name":"buf","nameLocation":"3035:3:9","nodeType":"VariableDeclaration","scope":2140,"src":"3005:33:9","stateVariable":false,"storageLocation":"memory","typeDescriptions":{"typeIdentifier":"t_struct$_buffer_$1204_memory_ptr","typeString":"struct BufferChainlink.buffer"},"typeName":{"id":2130,"nodeType":"UserDefinedTypeName","pathNode":{"id":2129,"name":"BufferChainlink.buffer","nodeType":"IdentifierPath","referencedDeclaration":1204,"src":"3005:22:9"},"referencedDeclaration":1204,"src":"3005:22:9","typeDescriptions":{"typeIdentifier":"t_struct$_buffer_$1204_storage_ptr","typeString":"struct BufferChainlink.buffer"}},"visibility":"internal"}],"src":"3004:35:9"},"returnParameters":{"id":2133,"nodeType":"ParameterList","parameters":[],"src":"3054:0:9"},"scope":2165,"src":"2985:129:9","stateMutability":"pure","virtual":false,"visibility":"internal"},{"body":{"id":2151,"nodeType":"Block","src":"3185:58:9","statements":[{"expression":{"arguments":[{"id":2147,"name":"buf","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":2143,"src":"3218:3:9","typeDescriptions":{"typeIdentifier":"t_struct$_buffer_$1204_memory_ptr","typeString":"struct BufferChainlink.buffer memory"}},{"id":2148,"name":"MAJOR_TYPE_MAP","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":1744,"src":"3223:14:9","typeDescriptions":{"typeIdentifier":"t_uint8","typeString":"uint8"}}],"expression":{"argumentTypes":[{"typeIdentifier":"t_struct$_buffer_$1204_memory_ptr","typeString":"struct BufferChainlink.buffer memory"},{"typeIdentifier":"t_uint8","typeString":"uint8"}],"id":2146,"name":"encodeIndefiniteLengthType","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":1909,"src":"3191:26:9","typeDescriptions":{"typeIdentifier":"t_function_internal_pure$_t_struct$_buffer_$1204_memory_ptr_$_t_uint8_$returns$__$","typeString":"function (struct BufferChainlink.buffer memory,uint8) pure"}},"id":2149,"isConstant":false,"isLValue":false,"isPure":false,"kind":"functionCall","lValueRequested":false,"names":[],"nodeType":"FunctionCall","src":"3191:47:9","tryCall":false,"typeDescriptions":{"typeIdentifier":"t_tuple$__$","typeString":"tuple()"}},"id":2150,"nodeType":"ExpressionStatement","src":"3191:47:9"}]},"id":2152,"implemented":true,"kind":"function","modifiers":[],"name":"startMap","nameLocation":"3127:8:9","nodeType":"FunctionDefinition","parameters":{"id":2144,"nodeType":"ParameterList","parameters":[{"constant":false,"id":2143,"mutability":"mutable","name":"buf","nameLocation":"3166:3:9","nodeType":"VariableDeclaration","scope":2152,"src":"3136:33:9","stateVariable":false,"storageLocation":"memory","typeDescriptions":{"typeIdentifier":"t_struct$_buffer_$1204_memory_ptr","typeString":"struct BufferChainlink.buffer"},"typeName":{"id":2142,"nodeType":"UserDefinedTypeName","pathNode":{"id":2141,"name":"BufferChainlink.buffer","nodeType":"IdentifierPath","referencedDeclaration":1204,"src":"3136:22:9"},"referencedDeclaration":1204,"src":"3136:22:9","typeDescriptions":{"typeIdentifier":"t_struct$_buffer_$1204_storage_ptr","typeString":"struct BufferChainlink.buffer"}},"visibility":"internal"}],"src":"3135:35:9"},"returnParameters":{"id":2145,"nodeType":"ParameterList","parameters":[],"src":"3185:0:9"},"scope":2165,"src":"3118:125:9","stateMutability":"pure","virtual":false,"visibility":"internal"},{"body":{"id":2163,"nodeType":"Block","src":"3317:67:9","statements":[{"expression":{"arguments":[{"id":2159,"name":"buf","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":2155,"src":"3350:3:9","typeDescriptions":{"typeIdentifier":"t_struct$_buffer_$1204_memory_ptr","typeString":"struct BufferChainlink.buffer memory"}},{"id":2160,"name":"MAJOR_TYPE_CONTENT_FREE","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":1750,"src":"3355:23:9","typeDescriptions":{"typeIdentifier":"t_uint8","typeString":"uint8"}}],"expression":{"argumentTypes":[{"typeIdentifier":"t_struct$_buffer_$1204_memory_ptr","typeString":"struct BufferChainlink.buffer memory"},{"typeIdentifier":"t_uint8","typeString":"uint8"}],"id":2158,"name":"encodeIndefiniteLengthType","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":1909,"src":"3323:26:9","typeDescriptions":{"typeIdentifier":"t_function_internal_pure$_t_struct$_buffer_$1204_memory_ptr_$_t_uint8_$returns$__$","typeString":"function (struct BufferChainlink.buffer memory,uint8) pure"}},"id":2161,"isConstant":false,"isLValue":false,"isPure":false,"kind":"functionCall","lValueRequested":false,"names":[],"nodeType":"FunctionCall","src":"3323:56:9","tryCall":false,"typeDescriptions":{"typeIdentifier":"t_tuple$__$","typeString":"tuple()"}},"id":2162,"nodeType":"ExpressionStatement","src":"3323:56:9"}]},"id":2164,"implemented":true,"kind":"function","modifiers":[],"name":"endSequence","nameLocation":"3256:11:9","nodeType":"FunctionDefinition","parameters":{"id":2156,"nodeType":"ParameterList","parameters":[{"constant":false,"id":2155,"mutability":"mutable","name":"buf","nameLocation":"3298:3:9","nodeType":"VariableDeclaration","scope":2164,"src":"3268:33:9","stateVariable":false,"storageLocation":"memory","typeDescriptions":{"typeIdentifier":"t_struct$_buffer_$1204_memory_ptr","typeString":"struct BufferChainlink.buffer"},"typeName":{"id":2154,"nodeType":"UserDefinedTypeName","pathNode":{"id":2153,"name":"BufferChainlink.buffer","nodeType":"IdentifierPath","referencedDeclaration":1204,"src":"3268:22:9"},"referencedDeclaration":1204,"src":"3268:22:9","typeDescriptions":{"typeIdentifier":"t_struct$_buffer_$1204_storage_ptr","typeString":"struct BufferChainlink.buffer"}},"visibility":"internal"}],"src":"3267:35:9"},"returnParameters":{"id":2157,"nodeType":"ParameterList","parameters":[],"src":"3317:0:9"},"scope":2165,"src":"3247:137:9","stateMutability":"pure","virtual":false,"visibility":"internal"}],"scope":2166,"src":"115:3271:9","usedErrors":[]}],"src":"32:3355:9"},"id":9},"@chainlink/contracts/src/v0.8/vendor/ENSResolver.sol":{"ast":{"absolutePath":"@chainlink/contracts/src/v0.8/vendor/ENSResolver.sol","exportedSymbols":{"ENSResolver":[2175]},"id":2176,"license":"MIT","nodeType":"SourceUnit","nodes":[{"id":2167,"literals":["solidity","^","0.8",".0"],"nodeType":"PragmaDirective","src":"32:23:10"},{"abstract":true,"baseContracts":[],"canonicalName":"ENSResolver","contractDependencies":[],"contractKind":"contract","fullyImplemented":false,"id":2175,"linearizedBaseContracts":[2175],"name":"ENSResolver","nameLocation":"75:11:10","nodeType":"ContractDefinition","nodes":[{"functionSelector":"3b3b57de","id":2174,"implemented":false,"kind":"function","modifiers":[],"name":"addr","nameLocation":"100:4:10","nodeType":"FunctionDefinition","parameters":{"id":2170,"nodeType":"ParameterList","parameters":[{"constant":false,"id":2169,"mutability":"mutable","name":"node","nameLocation":"113:4:10","nodeType":"VariableDeclaration","scope":2174,"src":"105:12:10","stateVariable":false,"storageLocation":"default","typeDescriptions":{"typeIdentifier":"t_bytes32","typeString":"bytes32"},"typeName":{"id":2168,"name":"bytes32","nodeType":"ElementaryTypeName","src":"105:7:10","typeDescriptions":{"typeIdentifier":"t_bytes32","typeString":"bytes32"}},"visibility":"internal"}],"src":"104:14:10"},"returnParameters":{"id":2173,"nodeType":"ParameterList","parameters":[{"constant":false,"id":2172,"mutability":"mutable","name":"","nameLocation":"-1:-1:-1","nodeType":"VariableDeclaration","scope":2174,"src":"148:7:10","stateVariable":false,"storageLocation":"default","typeDescriptions":{"typeIdentifier":"t_address","typeString":"address"},"typeName":{"id":2171,"name":"address","nodeType":"ElementaryTypeName","src":"148:7:10","stateMutability":"nonpayable","typeDescriptions":{"typeIdentifier":"t_address","typeString":"address"}},"visibility":"internal"}],"src":"147:9:10"},"scope":2175,"src":"91:66:10","stateMutability":"view","virtual":true,"visibility":"public"}],"scope":2176,"src":"57:102:10","usedErrors":[]}],"src":"32:128:10"},"id":10},"@openzeppelin/contracts-upgradeable-4.4.2/access/AccessControlUpgradeable.sol":{"ast":{"absolutePath":"@openzeppelin/contracts-upgradeable-4.4.2/access/AccessControlUpgradeable.sol","exportedSymbols":{"AccessControlUpgradeable":[2512],"AddressUpgradeable":[3650],"ContextUpgradeable":[3694],"ERC165Upgradeable":[4003],"IAccessControlUpgradeable":[2585],"IERC165Upgradeable":[4015],"Initializable":[3294],"StringsUpgradeable":[3957]},"id":2513,"license":"MIT","nodeType":"SourceUnit","nodes":[{"id":2177,"literals":["solidity","^","0.8",".0"],"nodeType":"PragmaDirective","src":"93:23:11"},{"absolutePath":"@openzeppelin/contracts-upgradeable-4.4.2/access/IAccessControlUpgradeable.sol","file":"./IAccessControlUpgradeable.sol","id":2178,"nameLocation":"-1:-1:-1","nodeType":"ImportDirective","scope":2513,"sourceUnit":2586,"src":"118:41:11","symbolAliases":[],"unitAlias":""},{"absolutePath":"@openzeppelin/contracts-upgradeable-4.4.2/utils/ContextUpgradeable.sol","file":"../utils/ContextUpgradeable.sol","id":2179,"nameLocation":"-1:-1:-1","nodeType":"ImportDirective","scope":2513,"sourceUnit":3695,"src":"160:41:11","symbolAliases":[],"unitAlias":""},{"absolutePath":"@openzeppelin/contracts-upgradeable-4.4.2/utils/StringsUpgradeable.sol","file":"../utils/StringsUpgradeable.sol","id":2180,"nameLocation":"-1:-1:-1","nodeType":"ImportDirective","scope":2513,"sourceUnit":3958,"src":"202:41:11","symbolAliases":[],"unitAlias":""},{"absolutePath":"@openzeppelin/contracts-upgradeable-4.4.2/utils/introspection/ERC165Upgradeable.sol","file":"../utils/introspection/ERC165Upgradeable.sol","id":2181,"nameLocation":"-1:-1:-1","nodeType":"ImportDirective","scope":2513,"sourceUnit":4004,"src":"244:54:11","symbolAliases":[],"unitAlias":""},{"absolutePath":"@openzeppelin/contracts-upgradeable-4.4.2/proxy/utils/Initializable.sol","file":"../proxy/utils/Initializable.sol","id":2182,"nameLocation":"-1:-1:-1","nodeType":"ImportDirective","scope":2513,"sourceUnit":3295,"src":"299:42:11","symbolAliases":[],"unitAlias":""},{"abstract":true,"baseContracts":[{"baseName":{"id":2184,"name":"Initializable","nodeType":"IdentifierPath","referencedDeclaration":3294,"src":"1924:13:11"},"id":2185,"nodeType":"InheritanceSpecifier","src":"1924:13:11"},{"baseName":{"id":2186,"name":"ContextUpgradeable","nodeType":"IdentifierPath","referencedDeclaration":3694,"src":"1939:18:11"},"id":2187,"nodeType":"InheritanceSpecifier","src":"1939:18:11"},{"baseName":{"id":2188,"name":"IAccessControlUpgradeable","nodeType":"IdentifierPath","referencedDeclaration":2585,"src":"1959:25:11"},"id":2189,"nodeType":"InheritanceSpecifier","src":"1959:25:11"},{"baseName":{"id":2190,"name":"ERC165Upgradeable","nodeType":"IdentifierPath","referencedDeclaration":4003,"src":"1986:17:11"},"id":2191,"nodeType":"InheritanceSpecifier","src":"1986:17:11"}],"canonicalName":"AccessControlUpgradeable","contractDependencies":[],"contractKind":"contract","documentation":{"id":2183,"nodeType":"StructuredDocumentation","src":"343:1534:11","text":" @dev Contract module that allows children to implement role-based access\n control mechanisms. This is a lightweight version that doesn't allow enumerating role\n members except through off-chain means by accessing the contract event logs. Some\n applications may benefit from on-chain enumerability, for those cases see\n {AccessControlEnumerable}.\n Roles are referred to by their `bytes32` identifier. These should be exposed\n in the external API and be unique. The best way to achieve this is by\n using `public constant` hash digests:\n ```\n bytes32 public constant MY_ROLE = keccak256(\"MY_ROLE\");\n ```\n Roles can be used to represent a set of permissions. To restrict access to a\n function call, use {hasRole}:\n ```\n function foo() public {\n require(hasRole(MY_ROLE, msg.sender));\n ...\n }\n ```\n Roles can be granted and revoked dynamically via the {grantRole} and\n {revokeRole} functions. Each role has an associated admin role, and only\n accounts that have a role's admin role can call {grantRole} and {revokeRole}.\n By default, the admin role for all roles is `DEFAULT_ADMIN_ROLE`, which means\n that only accounts with this role will be able to grant or revoke other\n roles. More complex role relationships can be created by using\n {_setRoleAdmin}.\n WARNING: The `DEFAULT_ADMIN_ROLE` is also its own admin: it has permission to\n grant and revoke this role. Extra precautions should be taken to secure\n accounts that have been granted it."},"fullyImplemented":true,"id":2512,"linearizedBaseContracts":[2512,4003,4015,2585,3694,3294],"name":"AccessControlUpgradeable","nameLocation":"1896:24:11","nodeType":"ContractDefinition","nodes":[{"body":{"id":2205,"nodeType":"Block","src":"2068:120:11","statements":[{"expression":{"arguments":[],"expression":{"argumentTypes":[],"id":2196,"name":"__Context_init_unchained","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":3671,"src":"2078:24:11","typeDescriptions":{"typeIdentifier":"t_function_internal_nonpayable$__$returns$__$","typeString":"function ()"}},"id":2197,"isConstant":false,"isLValue":false,"isPure":false,"kind":"functionCall","lValueRequested":false,"names":[],"nodeType":"FunctionCall","src":"2078:26:11","tryCall":false,"typeDescriptions":{"typeIdentifier":"t_tuple$__$","typeString":"tuple()"}},"id":2198,"nodeType":"ExpressionStatement","src":"2078:26:11"},{"expression":{"arguments":[],"expression":{"argumentTypes":[],"id":2199,"name":"__ERC165_init_unchained","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":3981,"src":"2114:23:11","typeDescriptions":{"typeIdentifier":"t_function_internal_nonpayable$__$returns$__$","typeString":"function ()"}},"id":2200,"isConstant":false,"isLValue":false,"isPure":false,"kind":"functionCall","lValueRequested":false,"names":[],"nodeType":"FunctionCall","src":"2114:25:11","tryCall":false,"typeDescriptions":{"typeIdentifier":"t_tuple$__$","typeString":"tuple()"}},"id":2201,"nodeType":"ExpressionStatement","src":"2114:25:11"},{"expression":{"arguments":[],"expression":{"argumentTypes":[],"id":2202,"name":"__AccessControl_init_unchained","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":2212,"src":"2149:30:11","typeDescriptions":{"typeIdentifier":"t_function_internal_nonpayable$__$returns$__$","typeString":"function ()"}},"id":2203,"isConstant":false,"isLValue":false,"isPure":false,"kind":"functionCall","lValueRequested":false,"names":[],"nodeType":"FunctionCall","src":"2149:32:11","tryCall":false,"typeDescriptions":{"typeIdentifier":"t_tuple$__$","typeString":"tuple()"}},"id":2204,"nodeType":"ExpressionStatement","src":"2149:32:11"}]},"id":2206,"implemented":true,"kind":"function","modifiers":[{"id":2194,"kind":"modifierInvocation","modifierName":{"id":2193,"name":"onlyInitializing","nodeType":"IdentifierPath","referencedDeclaration":3278,"src":"2051:16:11"},"nodeType":"ModifierInvocation","src":"2051:16:11"}],"name":"__AccessControl_init","nameLocation":"2019:20:11","nodeType":"FunctionDefinition","parameters":{"id":2192,"nodeType":"ParameterList","parameters":[],"src":"2039:2:11"},"returnParameters":{"id":2195,"nodeType":"ParameterList","parameters":[],"src":"2068:0:11"},"scope":2512,"src":"2010:178:11","stateMutability":"nonpayable","virtual":false,"visibility":"internal"},{"body":{"id":2211,"nodeType":"Block","src":"2262:7:11","statements":[]},"id":2212,"implemented":true,"kind":"function","modifiers":[{"id":2209,"kind":"modifierInvocation","modifierName":{"id":2208,"name":"onlyInitializing","nodeType":"IdentifierPath","referencedDeclaration":3278,"src":"2245:16:11"},"nodeType":"ModifierInvocation","src":"2245:16:11"}],"name":"__AccessControl_init_unchained","nameLocation":"2203:30:11","nodeType":"FunctionDefinition","parameters":{"id":2207,"nodeType":"ParameterList","parameters":[],"src":"2233:2:11"},"returnParameters":{"id":2210,"nodeType":"ParameterList","parameters":[],"src":"2262:0:11"},"scope":2512,"src":"2194:75:11","stateMutability":"nonpayable","virtual":false,"visibility":"internal"},{"canonicalName":"AccessControlUpgradeable.RoleData","id":2219,"members":[{"constant":false,"id":2216,"mutability":"mutable","name":"members","nameLocation":"2325:7:11","nodeType":"VariableDeclaration","scope":2219,"src":"2300:32:11","stateVariable":false,"storageLocation":"default","typeDescriptions":{"typeIdentifier":"t_mapping$_t_address_$_t_bool_$","typeString":"mapping(address => bool)"},"typeName":{"id":2215,"keyType":{"id":2213,"name":"address","nodeType":"ElementaryTypeName","src":"2308:7:11","typeDescriptions":{"typeIdentifier":"t_address","typeString":"address"}},"nodeType":"Mapping","src":"2300:24:11","typeDescriptions":{"typeIdentifier":"t_mapping$_t_address_$_t_bool_$","typeString":"mapping(address => bool)"},"valueType":{"id":2214,"name":"bool","nodeType":"ElementaryTypeName","src":"2319:4:11","typeDescriptions":{"typeIdentifier":"t_bool","typeString":"bool"}}},"visibility":"internal"},{"constant":false,"id":2218,"mutability":"mutable","name":"adminRole","nameLocation":"2350:9:11","nodeType":"VariableDeclaration","scope":2219,"src":"2342:17:11","stateVariable":false,"storageLocation":"default","typeDescriptions":{"typeIdentifier":"t_bytes32","typeString":"bytes32"},"typeName":{"id":2217,"name":"bytes32","nodeType":"ElementaryTypeName","src":"2342:7:11","typeDescriptions":{"typeIdentifier":"t_bytes32","typeString":"bytes32"}},"visibility":"internal"}],"name":"RoleData","nameLocation":"2281:8:11","nodeType":"StructDefinition","scope":2512,"src":"2274:92:11","visibility":"public"},{"constant":false,"id":2224,"mutability":"mutable","name":"_roles","nameLocation":"2409:6:11","nodeType":"VariableDeclaration","scope":2512,"src":"2372:43:11","stateVariable":true,"storageLocation":"default","typeDescriptions":{"typeIdentifier":"t_mapping$_t_bytes32_$_t_struct$_RoleData_$2219_storage_$","typeString":"mapping(bytes32 => struct AccessControlUpgradeable.RoleData)"},"typeName":{"id":2223,"keyType":{"id":2220,"name":"bytes32","nodeType":"ElementaryTypeName","src":"2380:7:11","typeDescriptions":{"typeIdentifier":"t_bytes32","typeString":"bytes32"}},"nodeType":"Mapping","src":"2372:28:11","typeDescriptions":{"typeIdentifier":"t_mapping$_t_bytes32_$_t_struct$_RoleData_$2219_storage_$","typeString":"mapping(bytes32 => struct AccessControlUpgradeable.RoleData)"},"valueType":{"id":2222,"nodeType":"UserDefinedTypeName","pathNode":{"id":2221,"name":"RoleData","nodeType":"IdentifierPath","referencedDeclaration":2219,"src":"2391:8:11"},"referencedDeclaration":2219,"src":"2391:8:11","typeDescriptions":{"typeIdentifier":"t_struct$_RoleData_$2219_storage_ptr","typeString":"struct AccessControlUpgradeable.RoleData"}}},"visibility":"private"},{"constant":true,"functionSelector":"a217fddf","id":2227,"mutability":"constant","name":"DEFAULT_ADMIN_ROLE","nameLocation":"2446:18:11","nodeType":"VariableDeclaration","scope":2512,"src":"2422:49:11","stateVariable":true,"storageLocation":"default","typeDescriptions":{"typeIdentifier":"t_bytes32","typeString":"bytes32"},"typeName":{"id":2225,"name":"bytes32","nodeType":"ElementaryTypeName","src":"2422:7:11","typeDescriptions":{"typeIdentifier":"t_bytes32","typeString":"bytes32"}},"value":{"hexValue":"30783030","id":2226,"isConstant":false,"isLValue":false,"isPure":true,"kind":"number","lValueRequested":false,"nodeType":"Literal","src":"2467:4:11","typeDescriptions":{"typeIdentifier":"t_rational_0_by_1","typeString":"int_const 0"},"value":"0x00"},"visibility":"public"},{"body":{"id":2239,"nodeType":"Block","src":"2890:58:11","statements":[{"expression":{"arguments":[{"id":2233,"name":"role","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":2230,"src":"2911:4:11","typeDescriptions":{"typeIdentifier":"t_bytes32","typeString":"bytes32"}},{"arguments":[],"expression":{"argumentTypes":[],"id":2234,"name":"_msgSender","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":3680,"src":"2917:10:11","typeDescriptions":{"typeIdentifier":"t_function_internal_view$__$returns$_t_address_$","typeString":"function () view returns (address)"}},"id":2235,"isConstant":false,"isLValue":false,"isPure":false,"kind":"functionCall","lValueRequested":false,"names":[],"nodeType":"FunctionCall","src":"2917:12:11","tryCall":false,"typeDescriptions":{"typeIdentifier":"t_address","typeString":"address"}}],"expression":{"argumentTypes":[{"typeIdentifier":"t_bytes32","typeString":"bytes32"},{"typeIdentifier":"t_address","typeString":"address"}],"id":2232,"name":"_checkRole","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":2324,"src":"2900:10:11","typeDescriptions":{"typeIdentifier":"t_function_internal_view$_t_bytes32_$_t_address_$returns$__$","typeString":"function (bytes32,address) view"}},"id":2236,"isConstant":false,"isLValue":false,"isPure":false,"kind":"functionCall","lValueRequested":false,"names":[],"nodeType":"FunctionCall","src":"2900:30:11","tryCall":false,"typeDescriptions":{"typeIdentifier":"t_tuple$__$","typeString":"tuple()"}},"id":2237,"nodeType":"ExpressionStatement","src":"2900:30:11"},{"id":2238,"nodeType":"PlaceholderStatement","src":"2940:1:11"}]},"documentation":{"id":2228,"nodeType":"StructuredDocumentation","src":"2478:375:11","text":" @dev Modifier that checks that an account has a specific role. Reverts\n with a standardized message including the required role.\n The format of the revert reason is given by the following regular expression:\n /^AccessControl: account (0x[0-9a-f]{40}) is missing role (0x[0-9a-f]{64})$/\n _Available since v4.1._"},"id":2240,"name":"onlyRole","nameLocation":"2867:8:11","nodeType":"ModifierDefinition","parameters":{"id":2231,"nodeType":"ParameterList","parameters":[{"constant":false,"id":2230,"mutability":"mutable","name":"role","nameLocation":"2884:4:11","nodeType":"VariableDeclaration","scope":2240,"src":"2876:12:11","stateVariable":false,"storageLocation":"default","typeDescriptions":{"typeIdentifier":"t_bytes32","typeString":"bytes32"},"typeName":{"id":2229,"name":"bytes32","nodeType":"ElementaryTypeName","src":"2876:7:11","typeDescriptions":{"typeIdentifier":"t_bytes32","typeString":"bytes32"}},"visibility":"internal"}],"src":"2875:14:11"},"src":"2858:90:11","virtual":false,"visibility":"internal"},{"baseFunctions":[3998],"body":{"id":2261,"nodeType":"Block","src":"3106:122:11","statements":[{"expression":{"commonType":{"typeIdentifier":"t_bool","typeString":"bool"},"id":2259,"isConstant":false,"isLValue":false,"isPure":false,"lValueRequested":false,"leftExpression":{"commonType":{"typeIdentifier":"t_bytes4","typeString":"bytes4"},"id":2254,"isConstant":false,"isLValue":false,"isPure":false,"lValueRequested":false,"leftExpression":{"id":2249,"name":"interfaceId","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":2243,"src":"3123:11:11","typeDescriptions":{"typeIdentifier":"t_bytes4","typeString":"bytes4"}},"nodeType":"BinaryOperation","operator":"==","rightExpression":{"expression":{"arguments":[{"id":2251,"name":"IAccessControlUpgradeable","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":2585,"src":"3143:25:11","typeDescriptions":{"typeIdentifier":"t_type$_t_contract$_IAccessControlUpgradeable_$2585_$","typeString":"type(contract IAccessControlUpgradeable)"}}],"expression":{"argumentTypes":[{"typeIdentifier":"t_type$_t_contract$_IAccessControlUpgradeable_$2585_$","typeString":"type(contract IAccessControlUpgradeable)"}],"id":2250,"name":"type","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":-27,"src":"3138:4:11","typeDescriptions":{"typeIdentifier":"t_function_metatype_pure$__$returns$__$","typeString":"function () pure"}},"id":2252,"isConstant":false,"isLValue":false,"isPure":true,"kind":"functionCall","lValueRequested":false,"names":[],"nodeType":"FunctionCall","src":"3138:31:11","tryCall":false,"typeDescriptions":{"typeIdentifier":"t_magic_meta_type_t_contract$_IAccessControlUpgradeable_$2585","typeString":"type(contract IAccessControlUpgradeable)"}},"id":2253,"isConstant":false,"isLValue":false,"isPure":true,"lValueRequested":false,"memberName":"interfaceId","nodeType":"MemberAccess","src":"3138:43:11","typeDescriptions":{"typeIdentifier":"t_bytes4","typeString":"bytes4"}},"src":"3123:58:11","typeDescriptions":{"typeIdentifier":"t_bool","typeString":"bool"}},"nodeType":"BinaryOperation","operator":"||","rightExpression":{"arguments":[{"id":2257,"name":"interfaceId","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":2243,"src":"3209:11:11","typeDescriptions":{"typeIdentifier":"t_bytes4","typeString":"bytes4"}}],"expression":{"argumentTypes":[{"typeIdentifier":"t_bytes4","typeString":"bytes4"}],"expression":{"id":2255,"name":"super","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":-25,"src":"3185:5:11","typeDescriptions":{"typeIdentifier":"t_type$_t_super$_AccessControlUpgradeable_$2512_$","typeString":"type(contract super AccessControlUpgradeable)"}},"id":2256,"isConstant":false,"isLValue":false,"isPure":false,"lValueRequested":false,"memberName":"supportsInterface","nodeType":"MemberAccess","referencedDeclaration":3998,"src":"3185:23:11","typeDescriptions":{"typeIdentifier":"t_function_internal_view$_t_bytes4_$returns$_t_bool_$","typeString":"function (bytes4) view returns (bool)"}},"id":2258,"isConstant":false,"isLValue":false,"isPure":false,"kind":"functionCall","lValueRequested":false,"names":[],"nodeType":"FunctionCall","src":"3185:36:11","tryCall":false,"typeDescriptions":{"typeIdentifier":"t_bool","typeString":"bool"}},"src":"3123:98:11","typeDescriptions":{"typeIdentifier":"t_bool","typeString":"bool"}},"functionReturnParameters":2248,"id":2260,"nodeType":"Return","src":"3116:105:11"}]},"documentation":{"id":2241,"nodeType":"StructuredDocumentation","src":"2954:56:11","text":" @dev See {IERC165-supportsInterface}."},"functionSelector":"01ffc9a7","id":2262,"implemented":true,"kind":"function","modifiers":[],"name":"supportsInterface","nameLocation":"3024:17:11","nodeType":"FunctionDefinition","overrides":{"id":2245,"nodeType":"OverrideSpecifier","overrides":[],"src":"3082:8:11"},"parameters":{"id":2244,"nodeType":"ParameterList","parameters":[{"constant":false,"id":2243,"mutability":"mutable","name":"interfaceId","nameLocation":"3049:11:11","nodeType":"VariableDeclaration","scope":2262,"src":"3042:18:11","stateVariable":false,"storageLocation":"default","typeDescriptions":{"typeIdentifier":"t_bytes4","typeString":"bytes4"},"typeName":{"id":2242,"name":"bytes4","nodeType":"ElementaryTypeName","src":"3042:6:11","typeDescriptions":{"typeIdentifier":"t_bytes4","typeString":"bytes4"}},"visibility":"internal"}],"src":"3041:20:11"},"returnParameters":{"id":2248,"nodeType":"ParameterList","parameters":[{"constant":false,"id":2247,"mutability":"mutable","name":"","nameLocation":"-1:-1:-1","nodeType":"VariableDeclaration","scope":2262,"src":"3100:4:11","stateVariable":false,"storageLocation":"default","typeDescriptions":{"typeIdentifier":"t_bool","typeString":"bool"},"typeName":{"id":2246,"name":"bool","nodeType":"ElementaryTypeName","src":"3100:4:11","typeDescriptions":{"typeIdentifier":"t_bool","typeString":"bool"}},"visibility":"internal"}],"src":"3099:6:11"},"scope":2512,"src":"3015:213:11","stateMutability":"view","virtual":true,"visibility":"public"},{"baseFunctions":[2552],"body":{"id":2280,"nodeType":"Block","src":"3399:53:11","statements":[{"expression":{"baseExpression":{"expression":{"baseExpression":{"id":2273,"name":"_roles","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":2224,"src":"3416:6:11","typeDescriptions":{"typeIdentifier":"t_mapping$_t_bytes32_$_t_struct$_RoleData_$2219_storage_$","typeString":"mapping(bytes32 => struct AccessControlUpgradeable.RoleData storage ref)"}},"id":2275,"indexExpression":{"id":2274,"name":"role","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":2265,"src":"3423:4:11","typeDescriptions":{"typeIdentifier":"t_bytes32","typeString":"bytes32"}},"isConstant":false,"isLValue":true,"isPure":false,"lValueRequested":false,"nodeType":"IndexAccess","src":"3416:12:11","typeDescriptions":{"typeIdentifier":"t_struct$_RoleData_$2219_storage","typeString":"struct AccessControlUpgradeable.RoleData storage ref"}},"id":2276,"isConstant":false,"isLValue":true,"isPure":false,"lValueRequested":false,"memberName":"members","nodeType":"MemberAccess","referencedDeclaration":2216,"src":"3416:20:11","typeDescriptions":{"typeIdentifier":"t_mapping$_t_address_$_t_bool_$","typeString":"mapping(address => bool)"}},"id":2278,"indexExpression":{"id":2277,"name":"account","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":2267,"src":"3437:7:11","typeDescriptions":{"typeIdentifier":"t_address","typeString":"address"}},"isConstant":false,"isLValue":true,"isPure":false,"lValueRequested":false,"nodeType":"IndexAccess","src":"3416:29:11","typeDescriptions":{"typeIdentifier":"t_bool","typeString":"bool"}},"functionReturnParameters":2272,"id":2279,"nodeType":"Return","src":"3409:36:11"}]},"documentation":{"id":2263,"nodeType":"StructuredDocumentation","src":"3234:76:11","text":" @dev Returns `true` if `account` has been granted `role`."},"functionSelector":"91d14854","id":2281,"implemented":true,"kind":"function","modifiers":[],"name":"hasRole","nameLocation":"3324:7:11","nodeType":"FunctionDefinition","overrides":{"id":2269,"nodeType":"OverrideSpecifier","overrides":[],"src":"3375:8:11"},"parameters":{"id":2268,"nodeType":"ParameterList","parameters":[{"constant":false,"id":2265,"mutability":"mutable","name":"role","nameLocation":"3340:4:11","nodeType":"VariableDeclaration","scope":2281,"src":"3332:12:11","stateVariable":false,"storageLocation":"default","typeDescriptions":{"typeIdentifier":"t_bytes32","typeString":"bytes32"},"typeName":{"id":2264,"name":"bytes32","nodeType":"ElementaryTypeName","src":"3332:7:11","typeDescriptions":{"typeIdentifier":"t_bytes32","typeString":"bytes32"}},"visibility":"internal"},{"constant":false,"id":2267,"mutability":"mutable","name":"account","nameLocation":"3354:7:11","nodeType":"VariableDeclaration","scope":2281,"src":"3346:15:11","stateVariable":false,"storageLocation":"default","typeDescriptions":{"typeIdentifier":"t_address","typeString":"address"},"typeName":{"id":2266,"name":"address","nodeType":"ElementaryTypeName","src":"3346:7:11","stateMutability":"nonpayable","typeDescriptions":{"typeIdentifier":"t_address","typeString":"address"}},"visibility":"internal"}],"src":"3331:31:11"},"returnParameters":{"id":2272,"nodeType":"ParameterList","parameters":[{"constant":false,"id":2271,"mutability":"mutable","name":"","nameLocation":"-1:-1:-1","nodeType":"VariableDeclaration","scope":2281,"src":"3393:4:11","stateVariable":false,"storageLocation":"default","typeDescriptions":{"typeIdentifier":"t_bool","typeString":"bool"},"typeName":{"id":2270,"name":"bool","nodeType":"ElementaryTypeName","src":"3393:4:11","typeDescriptions":{"typeIdentifier":"t_bool","typeString":"bool"}},"visibility":"internal"}],"src":"3392:6:11"},"scope":2512,"src":"3315:137:11","stateMutability":"view","virtual":false,"visibility":"public"},{"body":{"id":2323,"nodeType":"Block","src":"3798:441:11","statements":[{"condition":{"id":2293,"isConstant":false,"isLValue":false,"isPure":false,"lValueRequested":false,"nodeType":"UnaryOperation","operator":"!","prefix":true,"src":"3812:23:11","subExpression":{"arguments":[{"id":2290,"name":"role","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":2284,"src":"3821:4:11","typeDescriptions":{"typeIdentifier":"t_bytes32","typeString":"bytes32"}},{"id":2291,"name":"account","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":2286,"src":"3827:7:11","typeDescriptions":{"typeIdentifier":"t_address","typeString":"address"}}],"expression":{"argumentTypes":[{"typeIdentifier":"t_bytes32","typeString":"bytes32"},{"typeIdentifier":"t_address","typeString":"address"}],"id":2289,"name":"hasRole","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":2281,"src":"3813:7:11","typeDescriptions":{"typeIdentifier":"t_function_internal_view$_t_bytes32_$_t_address_$returns$_t_bool_$","typeString":"function (bytes32,address) view returns (bool)"}},"id":2292,"isConstant":false,"isLValue":false,"isPure":false,"kind":"functionCall","lValueRequested":false,"names":[],"nodeType":"FunctionCall","src":"3813:22:11","tryCall":false,"typeDescriptions":{"typeIdentifier":"t_bool","typeString":"bool"}},"typeDescriptions":{"typeIdentifier":"t_bool","typeString":"bool"}},"id":2322,"nodeType":"IfStatement","src":"3808:425:11","trueBody":{"id":2321,"nodeType":"Block","src":"3837:396:11","statements":[{"expression":{"arguments":[{"arguments":[{"arguments":[{"hexValue":"416363657373436f6e74726f6c3a206163636f756e7420","id":2299,"isConstant":false,"isLValue":false,"isPure":true,"kind":"string","lValueRequested":false,"nodeType":"Literal","src":"3945:25:11","typeDescriptions":{"typeIdentifier":"t_stringliteral_da0d07ce4a2849fbfc4cb9d6f939e9bd93016c372ca4a5ff14fe06caf3d67874","typeString":"literal_string \"AccessControl: account \""},"value":"AccessControl: account "},{"arguments":[{"arguments":[{"id":2304,"name":"account","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":2286,"src":"4035:7:11","typeDescriptions":{"typeIdentifier":"t_address","typeString":"address"}}],"expression":{"argumentTypes":[{"typeIdentifier":"t_address","typeString":"address"}],"id":2303,"isConstant":false,"isLValue":false,"isPure":true,"lValueRequested":false,"nodeType":"ElementaryTypeNameExpression","src":"4027:7:11","typeDescriptions":{"typeIdentifier":"t_type$_t_uint160_$","typeString":"type(uint160)"},"typeName":{"id":2302,"name":"uint160","nodeType":"ElementaryTypeName","src":"4027:7:11","typeDescriptions":{}}},"id":2305,"isConstant":false,"isLValue":false,"isPure":false,"kind":"typeConversion","lValueRequested":false,"names":[],"nodeType":"FunctionCall","src":"4027:16:11","tryCall":false,"typeDescriptions":{"typeIdentifier":"t_uint160","typeString":"uint160"}},{"hexValue":"3230","id":2306,"isConstant":false,"isLValue":false,"isPure":true,"kind":"number","lValueRequested":false,"nodeType":"Literal","src":"4045:2:11","typeDescriptions":{"typeIdentifier":"t_rational_20_by_1","typeString":"int_const 20"},"value":"20"}],"expression":{"argumentTypes":[{"typeIdentifier":"t_uint160","typeString":"uint160"},{"typeIdentifier":"t_rational_20_by_1","typeString":"int_const 20"}],"expression":{"id":2300,"name":"StringsUpgradeable","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":3957,"src":"3996:18:11","typeDescriptions":{"typeIdentifier":"t_type$_t_contract$_StringsUpgradeable_$3957_$","typeString":"type(library StringsUpgradeable)"}},"id":2301,"isConstant":false,"isLValue":false,"isPure":false,"lValueRequested":false,"memberName":"toHexString","nodeType":"MemberAccess","referencedDeclaration":3956,"src":"3996:30:11","typeDescriptions":{"typeIdentifier":"t_function_internal_pure$_t_uint256_$_t_uint256_$returns$_t_string_memory_ptr_$","typeString":"function (uint256,uint256) pure returns (string memory)"}},"id":2307,"isConstant":false,"isLValue":false,"isPure":false,"kind":"functionCall","lValueRequested":false,"names":[],"nodeType":"FunctionCall","src":"3996:52:11","tryCall":false,"typeDescriptions":{"typeIdentifier":"t_string_memory_ptr","typeString":"string memory"}},{"hexValue":"206973206d697373696e6720726f6c6520","id":2308,"isConstant":false,"isLValue":false,"isPure":true,"kind":"string","lValueRequested":false,"nodeType":"Literal","src":"4074:19:11","typeDescriptions":{"typeIdentifier":"t_stringliteral_f986ce851518a691bccd44ea42a5a185d1b866ef6cb07984a09b81694d20ab69","typeString":"literal_string \" is missing role \""},"value":" is missing role "},{"arguments":[{"arguments":[{"id":2313,"name":"role","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":2284,"src":"4158:4:11","typeDescriptions":{"typeIdentifier":"t_bytes32","typeString":"bytes32"}}],"expression":{"argumentTypes":[{"typeIdentifier":"t_bytes32","typeString":"bytes32"}],"id":2312,"isConstant":false,"isLValue":false,"isPure":true,"lValueRequested":false,"nodeType":"ElementaryTypeNameExpression","src":"4150:7:11","typeDescriptions":{"typeIdentifier":"t_type$_t_uint256_$","typeString":"type(uint256)"},"typeName":{"id":2311,"name":"uint256","nodeType":"ElementaryTypeName","src":"4150:7:11","typeDescriptions":{}}},"id":2314,"isConstant":false,"isLValue":false,"isPure":false,"kind":"typeConversion","lValueRequested":false,"names":[],"nodeType":"FunctionCall","src":"4150:13:11","tryCall":false,"typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"}},{"hexValue":"3332","id":2315,"isConstant":false,"isLValue":false,"isPure":true,"kind":"number","lValueRequested":false,"nodeType":"Literal","src":"4165:2:11","typeDescriptions":{"typeIdentifier":"t_rational_32_by_1","typeString":"int_const 32"},"value":"32"}],"expression":{"argumentTypes":[{"typeIdentifier":"t_uint256","typeString":"uint256"},{"typeIdentifier":"t_rational_32_by_1","typeString":"int_const 32"}],"expression":{"id":2309,"name":"StringsUpgradeable","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":3957,"src":"4119:18:11","typeDescriptions":{"typeIdentifier":"t_type$_t_contract$_StringsUpgradeable_$3957_$","typeString":"type(library StringsUpgradeable)"}},"id":2310,"isConstant":false,"isLValue":false,"isPure":false,"lValueRequested":false,"memberName":"toHexString","nodeType":"MemberAccess","referencedDeclaration":3956,"src":"4119:30:11","typeDescriptions":{"typeIdentifier":"t_function_internal_pure$_t_uint256_$_t_uint256_$returns$_t_string_memory_ptr_$","typeString":"function (uint256,uint256) pure returns (string memory)"}},"id":2316,"isConstant":false,"isLValue":false,"isPure":false,"kind":"functionCall","lValueRequested":false,"names":[],"nodeType":"FunctionCall","src":"4119:49:11","tryCall":false,"typeDescriptions":{"typeIdentifier":"t_string_memory_ptr","typeString":"string memory"}}],"expression":{"argumentTypes":[{"typeIdentifier":"t_stringliteral_da0d07ce4a2849fbfc4cb9d6f939e9bd93016c372ca4a5ff14fe06caf3d67874","typeString":"literal_string \"AccessControl: account \""},{"typeIdentifier":"t_string_memory_ptr","typeString":"string memory"},{"typeIdentifier":"t_stringliteral_f986ce851518a691bccd44ea42a5a185d1b866ef6cb07984a09b81694d20ab69","typeString":"literal_string \" is missing role \""},{"typeIdentifier":"t_string_memory_ptr","typeString":"string memory"}],"expression":{"id":2297,"name":"abi","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":-1,"src":"3903:3:11","typeDescriptions":{"typeIdentifier":"t_magic_abi","typeString":"abi"}},"id":2298,"isConstant":false,"isLValue":false,"isPure":true,"lValueRequested":false,"memberName":"encodePacked","nodeType":"MemberAccess","src":"3903:16:11","typeDescriptions":{"typeIdentifier":"t_function_abiencodepacked_pure$__$returns$_t_bytes_memory_ptr_$","typeString":"function () pure returns (bytes memory)"}},"id":2317,"isConstant":false,"isLValue":false,"isPure":false,"kind":"functionCall","lValueRequested":false,"names":[],"nodeType":"FunctionCall","src":"3903:287:11","tryCall":false,"typeDescriptions":{"typeIdentifier":"t_bytes_memory_ptr","typeString":"bytes memory"}}],"expression":{"argumentTypes":[{"typeIdentifier":"t_bytes_memory_ptr","typeString":"bytes memory"}],"id":2296,"isConstant":false,"isLValue":false,"isPure":true,"lValueRequested":false,"nodeType":"ElementaryTypeNameExpression","src":"3875:6:11","typeDescriptions":{"typeIdentifier":"t_type$_t_string_storage_ptr_$","typeString":"type(string storage pointer)"},"typeName":{"id":2295,"name":"string","nodeType":"ElementaryTypeName","src":"3875:6:11","typeDescriptions":{}}},"id":2318,"isConstant":false,"isLValue":false,"isPure":false,"kind":"typeConversion","lValueRequested":false,"names":[],"nodeType":"FunctionCall","src":"3875:333:11","tryCall":false,"typeDescriptions":{"typeIdentifier":"t_string_memory_ptr","typeString":"string memory"}}],"expression":{"argumentTypes":[{"typeIdentifier":"t_string_memory_ptr","typeString":"string memory"}],"id":2294,"name":"revert","nodeType":"Identifier","overloadedDeclarations":[-19,-19],"referencedDeclaration":-19,"src":"3851:6:11","typeDescriptions":{"typeIdentifier":"t_function_revert_pure$_t_string_memory_ptr_$returns$__$","typeString":"function (string memory) pure"}},"id":2319,"isConstant":false,"isLValue":false,"isPure":false,"kind":"functionCall","lValueRequested":false,"names":[],"nodeType":"FunctionCall","src":"3851:371:11","tryCall":false,"typeDescriptions":{"typeIdentifier":"t_tuple$__$","typeString":"tuple()"}},"id":2320,"nodeType":"ExpressionStatement","src":"3851:371:11"}]}}]},"documentation":{"id":2282,"nodeType":"StructuredDocumentation","src":"3458:270:11","text":" @dev Revert with a standard message if `account` is missing `role`.\n The format of the revert reason is given by the following regular expression:\n /^AccessControl: account (0x[0-9a-f]{40}) is missing role (0x[0-9a-f]{64})$/"},"id":2324,"implemented":true,"kind":"function","modifiers":[],"name":"_checkRole","nameLocation":"3742:10:11","nodeType":"FunctionDefinition","parameters":{"id":2287,"nodeType":"ParameterList","parameters":[{"constant":false,"id":2284,"mutability":"mutable","name":"role","nameLocation":"3761:4:11","nodeType":"VariableDeclaration","scope":2324,"src":"3753:12:11","stateVariable":false,"storageLocation":"default","typeDescriptions":{"typeIdentifier":"t_bytes32","typeString":"bytes32"},"typeName":{"id":2283,"name":"bytes32","nodeType":"ElementaryTypeName","src":"3753:7:11","typeDescriptions":{"typeIdentifier":"t_bytes32","typeString":"bytes32"}},"visibility":"internal"},{"constant":false,"id":2286,"mutability":"mutable","name":"account","nameLocation":"3775:7:11","nodeType":"VariableDeclaration","scope":2324,"src":"3767:15:11","stateVariable":false,"storageLocation":"default","typeDescriptions":{"typeIdentifier":"t_address","typeString":"address"},"typeName":{"id":2285,"name":"address","nodeType":"ElementaryTypeName","src":"3767:7:11","stateMutability":"nonpayable","typeDescriptions":{"typeIdentifier":"t_address","typeString":"address"}},"visibility":"internal"}],"src":"3752:31:11"},"returnParameters":{"id":2288,"nodeType":"ParameterList","parameters":[],"src":"3798:0:11"},"scope":2512,"src":"3733:506:11","stateMutability":"view","virtual":false,"visibility":"internal"},{"baseFunctions":[2560],"body":{"id":2338,"nodeType":"Block","src":"4495:46:11","statements":[{"expression":{"expression":{"baseExpression":{"id":2333,"name":"_roles","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":2224,"src":"4512:6:11","typeDescriptions":{"typeIdentifier":"t_mapping$_t_bytes32_$_t_struct$_RoleData_$2219_storage_$","typeString":"mapping(bytes32 => struct AccessControlUpgradeable.RoleData storage ref)"}},"id":2335,"indexExpression":{"id":2334,"name":"role","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":2327,"src":"4519:4:11","typeDescriptions":{"typeIdentifier":"t_bytes32","typeString":"bytes32"}},"isConstant":false,"isLValue":true,"isPure":false,"lValueRequested":false,"nodeType":"IndexAccess","src":"4512:12:11","typeDescriptions":{"typeIdentifier":"t_struct$_RoleData_$2219_storage","typeString":"struct AccessControlUpgradeable.RoleData storage ref"}},"id":2336,"isConstant":false,"isLValue":true,"isPure":false,"lValueRequested":false,"memberName":"adminRole","nodeType":"MemberAccess","referencedDeclaration":2218,"src":"4512:22:11","typeDescriptions":{"typeIdentifier":"t_bytes32","typeString":"bytes32"}},"functionReturnParameters":2332,"id":2337,"nodeType":"Return","src":"4505:29:11"}]},"documentation":{"id":2325,"nodeType":"StructuredDocumentation","src":"4245:170:11","text":" @dev Returns the admin role that controls `role`. See {grantRole} and\n {revokeRole}.\n To change a role's admin, use {_setRoleAdmin}."},"functionSelector":"248a9ca3","id":2339,"implemented":true,"kind":"function","modifiers":[],"name":"getRoleAdmin","nameLocation":"4429:12:11","nodeType":"FunctionDefinition","overrides":{"id":2329,"nodeType":"OverrideSpecifier","overrides":[],"src":"4468:8:11"},"parameters":{"id":2328,"nodeType":"ParameterList","parameters":[{"constant":false,"id":2327,"mutability":"mutable","name":"role","nameLocation":"4450:4:11","nodeType":"VariableDeclaration","scope":2339,"src":"4442:12:11","stateVariable":false,"storageLocation":"default","typeDescriptions":{"typeIdentifier":"t_bytes32","typeString":"bytes32"},"typeName":{"id":2326,"name":"bytes32","nodeType":"ElementaryTypeName","src":"4442:7:11","typeDescriptions":{"typeIdentifier":"t_bytes32","typeString":"bytes32"}},"visibility":"internal"}],"src":"4441:14:11"},"returnParameters":{"id":2332,"nodeType":"ParameterList","parameters":[{"constant":false,"id":2331,"mutability":"mutable","name":"","nameLocation":"-1:-1:-1","nodeType":"VariableDeclaration","scope":2339,"src":"4486:7:11","stateVariable":false,"storageLocation":"default","typeDescriptions":{"typeIdentifier":"t_bytes32","typeString":"bytes32"},"typeName":{"id":2330,"name":"bytes32","nodeType":"ElementaryTypeName","src":"4486:7:11","typeDescriptions":{"typeIdentifier":"t_bytes32","typeString":"bytes32"}},"visibility":"internal"}],"src":"4485:9:11"},"scope":2512,"src":"4420:121:11","stateMutability":"view","virtual":false,"visibility":"public"},{"baseFunctions":[2568],"body":{"id":2358,"nodeType":"Block","src":"4894:42:11","statements":[{"expression":{"arguments":[{"id":2354,"name":"role","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":2342,"src":"4915:4:11","typeDescriptions":{"typeIdentifier":"t_bytes32","typeString":"bytes32"}},{"id":2355,"name":"account","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":2344,"src":"4921:7:11","typeDescriptions":{"typeIdentifier":"t_address","typeString":"address"}}],"expression":{"argumentTypes":[{"typeIdentifier":"t_bytes32","typeString":"bytes32"},{"typeIdentifier":"t_address","typeString":"address"}],"id":2353,"name":"_grantRole","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":2476,"src":"4904:10:11","typeDescriptions":{"typeIdentifier":"t_function_internal_nonpayable$_t_bytes32_$_t_address_$returns$__$","typeString":"function (bytes32,address)"}},"id":2356,"isConstant":false,"isLValue":false,"isPure":false,"kind":"functionCall","lValueRequested":false,"names":[],"nodeType":"FunctionCall","src":"4904:25:11","tryCall":false,"typeDescriptions":{"typeIdentifier":"t_tuple$__$","typeString":"tuple()"}},"id":2357,"nodeType":"ExpressionStatement","src":"4904:25:11"}]},"documentation":{"id":2340,"nodeType":"StructuredDocumentation","src":"4547:239:11","text":" @dev Grants `role` to `account`.\n If `account` had not been already granted `role`, emits a {RoleGranted}\n event.\n Requirements:\n - the caller must have ``role``'s admin role."},"functionSelector":"2f2ff15d","id":2359,"implemented":true,"kind":"function","modifiers":[{"arguments":[{"arguments":[{"id":2349,"name":"role","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":2342,"src":"4887:4:11","typeDescriptions":{"typeIdentifier":"t_bytes32","typeString":"bytes32"}}],"expression":{"argumentTypes":[{"typeIdentifier":"t_bytes32","typeString":"bytes32"}],"id":2348,"name":"getRoleAdmin","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":2339,"src":"4874:12:11","typeDescriptions":{"typeIdentifier":"t_function_internal_view$_t_bytes32_$returns$_t_bytes32_$","typeString":"function (bytes32) view returns (bytes32)"}},"id":2350,"isConstant":false,"isLValue":false,"isPure":false,"kind":"functionCall","lValueRequested":false,"names":[],"nodeType":"FunctionCall","src":"4874:18:11","tryCall":false,"typeDescriptions":{"typeIdentifier":"t_bytes32","typeString":"bytes32"}}],"id":2351,"kind":"modifierInvocation","modifierName":{"id":2347,"name":"onlyRole","nodeType":"IdentifierPath","referencedDeclaration":2240,"src":"4865:8:11"},"nodeType":"ModifierInvocation","src":"4865:28:11"}],"name":"grantRole","nameLocation":"4800:9:11","nodeType":"FunctionDefinition","overrides":{"id":2346,"nodeType":"OverrideSpecifier","overrides":[],"src":"4856:8:11"},"parameters":{"id":2345,"nodeType":"ParameterList","parameters":[{"constant":false,"id":2342,"mutability":"mutable","name":"role","nameLocation":"4818:4:11","nodeType":"VariableDeclaration","scope":2359,"src":"4810:12:11","stateVariable":false,"storageLocation":"default","typeDescriptions":{"typeIdentifier":"t_bytes32","typeString":"bytes32"},"typeName":{"id":2341,"name":"bytes32","nodeType":"ElementaryTypeName","src":"4810:7:11","typeDescriptions":{"typeIdentifier":"t_bytes32","typeString":"bytes32"}},"visibility":"internal"},{"constant":false,"id":2344,"mutability":"mutable","name":"account","nameLocation":"4832:7:11","nodeType":"VariableDeclaration","scope":2359,"src":"4824:15:11","stateVariable":false,"storageLocation":"default","typeDescriptions":{"typeIdentifier":"t_address","typeString":"address"},"typeName":{"id":2343,"name":"address","nodeType":"ElementaryTypeName","src":"4824:7:11","stateMutability":"nonpayable","typeDescriptions":{"typeIdentifier":"t_address","typeString":"address"}},"visibility":"internal"}],"src":"4809:31:11"},"returnParameters":{"id":2352,"nodeType":"ParameterList","parameters":[],"src":"4894:0:11"},"scope":2512,"src":"4791:145:11","stateMutability":"nonpayable","virtual":true,"visibility":"public"},{"baseFunctions":[2576],"body":{"id":2378,"nodeType":"Block","src":"5274:43:11","statements":[{"expression":{"arguments":[{"id":2374,"name":"role","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":2362,"src":"5296:4:11","typeDescriptions":{"typeIdentifier":"t_bytes32","typeString":"bytes32"}},{"id":2375,"name":"account","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":2364,"src":"5302:7:11","typeDescriptions":{"typeIdentifier":"t_address","typeString":"address"}}],"expression":{"argumentTypes":[{"typeIdentifier":"t_bytes32","typeString":"bytes32"},{"typeIdentifier":"t_address","typeString":"address"}],"id":2373,"name":"_revokeRole","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":2507,"src":"5284:11:11","typeDescriptions":{"typeIdentifier":"t_function_internal_nonpayable$_t_bytes32_$_t_address_$returns$__$","typeString":"function (bytes32,address)"}},"id":2376,"isConstant":false,"isLValue":false,"isPure":false,"kind":"functionCall","lValueRequested":false,"names":[],"nodeType":"FunctionCall","src":"5284:26:11","tryCall":false,"typeDescriptions":{"typeIdentifier":"t_tuple$__$","typeString":"tuple()"}},"id":2377,"nodeType":"ExpressionStatement","src":"5284:26:11"}]},"documentation":{"id":2360,"nodeType":"StructuredDocumentation","src":"4942:223:11","text":" @dev Revokes `role` from `account`.\n If `account` had been granted `role`, emits a {RoleRevoked} event.\n Requirements:\n - the caller must have ``role``'s admin role."},"functionSelector":"d547741f","id":2379,"implemented":true,"kind":"function","modifiers":[{"arguments":[{"arguments":[{"id":2369,"name":"role","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":2362,"src":"5267:4:11","typeDescriptions":{"typeIdentifier":"t_bytes32","typeString":"bytes32"}}],"expression":{"argumentTypes":[{"typeIdentifier":"t_bytes32","typeString":"bytes32"}],"id":2368,"name":"getRoleAdmin","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":2339,"src":"5254:12:11","typeDescriptions":{"typeIdentifier":"t_function_internal_view$_t_bytes32_$returns$_t_bytes32_$","typeString":"function (bytes32) view returns (bytes32)"}},"id":2370,"isConstant":false,"isLValue":false,"isPure":false,"kind":"functionCall","lValueRequested":false,"names":[],"nodeType":"FunctionCall","src":"5254:18:11","tryCall":false,"typeDescriptions":{"typeIdentifier":"t_bytes32","typeString":"bytes32"}}],"id":2371,"kind":"modifierInvocation","modifierName":{"id":2367,"name":"onlyRole","nodeType":"IdentifierPath","referencedDeclaration":2240,"src":"5245:8:11"},"nodeType":"ModifierInvocation","src":"5245:28:11"}],"name":"revokeRole","nameLocation":"5179:10:11","nodeType":"FunctionDefinition","overrides":{"id":2366,"nodeType":"OverrideSpecifier","overrides":[],"src":"5236:8:11"},"parameters":{"id":2365,"nodeType":"ParameterList","parameters":[{"constant":false,"id":2362,"mutability":"mutable","name":"role","nameLocation":"5198:4:11","nodeType":"VariableDeclaration","scope":2379,"src":"5190:12:11","stateVariable":false,"storageLocation":"default","typeDescriptions":{"typeIdentifier":"t_bytes32","typeString":"bytes32"},"typeName":{"id":2361,"name":"bytes32","nodeType":"ElementaryTypeName","src":"5190:7:11","typeDescriptions":{"typeIdentifier":"t_bytes32","typeString":"bytes32"}},"visibility":"internal"},{"constant":false,"id":2364,"mutability":"mutable","name":"account","nameLocation":"5212:7:11","nodeType":"VariableDeclaration","scope":2379,"src":"5204:15:11","stateVariable":false,"storageLocation":"default","typeDescriptions":{"typeIdentifier":"t_address","typeString":"address"},"typeName":{"id":2363,"name":"address","nodeType":"ElementaryTypeName","src":"5204:7:11","stateMutability":"nonpayable","typeDescriptions":{"typeIdentifier":"t_address","typeString":"address"}},"visibility":"internal"}],"src":"5189:31:11"},"returnParameters":{"id":2372,"nodeType":"ParameterList","parameters":[],"src":"5274:0:11"},"scope":2512,"src":"5170:147:11","stateMutability":"nonpayable","virtual":true,"visibility":"public"},{"baseFunctions":[2584],"body":{"id":2401,"nodeType":"Block","src":"5885:137:11","statements":[{"expression":{"arguments":[{"commonType":{"typeIdentifier":"t_address","typeString":"address"},"id":2392,"isConstant":false,"isLValue":false,"isPure":false,"lValueRequested":false,"leftExpression":{"id":2389,"name":"account","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":2384,"src":"5903:7:11","typeDescriptions":{"typeIdentifier":"t_address","typeString":"address"}},"nodeType":"BinaryOperation","operator":"==","rightExpression":{"arguments":[],"expression":{"argumentTypes":[],"id":2390,"name":"_msgSender","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":3680,"src":"5914:10:11","typeDescriptions":{"typeIdentifier":"t_function_internal_view$__$returns$_t_address_$","typeString":"function () view returns (address)"}},"id":2391,"isConstant":false,"isLValue":false,"isPure":false,"kind":"functionCall","lValueRequested":false,"names":[],"nodeType":"FunctionCall","src":"5914:12:11","tryCall":false,"typeDescriptions":{"typeIdentifier":"t_address","typeString":"address"}},"src":"5903:23:11","typeDescriptions":{"typeIdentifier":"t_bool","typeString":"bool"}},{"hexValue":"416363657373436f6e74726f6c3a2063616e206f6e6c792072656e6f756e636520726f6c657320666f722073656c66","id":2393,"isConstant":false,"isLValue":false,"isPure":true,"kind":"string","lValueRequested":false,"nodeType":"Literal","src":"5928:49:11","typeDescriptions":{"typeIdentifier":"t_stringliteral_fb06fa8ff2141e8ed74502f6792273793f25f0e9d3cf15344f3f5a0d4948fd4b","typeString":"literal_string \"AccessControl: can only renounce roles for self\""},"value":"AccessControl: can only renounce roles for self"}],"expression":{"argumentTypes":[{"typeIdentifier":"t_bool","typeString":"bool"},{"typeIdentifier":"t_stringliteral_fb06fa8ff2141e8ed74502f6792273793f25f0e9d3cf15344f3f5a0d4948fd4b","typeString":"literal_string \"AccessControl: can only renounce roles for self\""}],"id":2388,"name":"require","nodeType":"Identifier","overloadedDeclarations":[-18,-18],"referencedDeclaration":-18,"src":"5895:7:11","typeDescriptions":{"typeIdentifier":"t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$","typeString":"function (bool,string memory) pure"}},"id":2394,"isConstant":false,"isLValue":false,"isPure":false,"kind":"functionCall","lValueRequested":false,"names":[],"nodeType":"FunctionCall","src":"5895:83:11","tryCall":false,"typeDescriptions":{"typeIdentifier":"t_tuple$__$","typeString":"tuple()"}},"id":2395,"nodeType":"ExpressionStatement","src":"5895:83:11"},{"expression":{"arguments":[{"id":2397,"name":"role","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":2382,"src":"6001:4:11","typeDescriptions":{"typeIdentifier":"t_bytes32","typeString":"bytes32"}},{"id":2398,"name":"account","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":2384,"src":"6007:7:11","typeDescriptions":{"typeIdentifier":"t_address","typeString":"address"}}],"expression":{"argumentTypes":[{"typeIdentifier":"t_bytes32","typeString":"bytes32"},{"typeIdentifier":"t_address","typeString":"address"}],"id":2396,"name":"_revokeRole","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":2507,"src":"5989:11:11","typeDescriptions":{"typeIdentifier":"t_function_internal_nonpayable$_t_bytes32_$_t_address_$returns$__$","typeString":"function (bytes32,address)"}},"id":2399,"isConstant":false,"isLValue":false,"isPure":false,"kind":"functionCall","lValueRequested":false,"names":[],"nodeType":"FunctionCall","src":"5989:26:11","tryCall":false,"typeDescriptions":{"typeIdentifier":"t_tuple$__$","typeString":"tuple()"}},"id":2400,"nodeType":"ExpressionStatement","src":"5989:26:11"}]},"documentation":{"id":2380,"nodeType":"StructuredDocumentation","src":"5323:480:11","text":" @dev Revokes `role` from the calling account.\n Roles are often managed via {grantRole} and {revokeRole}: this function's\n purpose is to provide a mechanism for accounts to lose their privileges\n if they are compromised (such as when a trusted device is misplaced).\n If the calling account had been revoked `role`, emits a {RoleRevoked}\n event.\n Requirements:\n - the caller must be `account`."},"functionSelector":"36568abe","id":2402,"implemented":true,"kind":"function","modifiers":[],"name":"renounceRole","nameLocation":"5817:12:11","nodeType":"FunctionDefinition","overrides":{"id":2386,"nodeType":"OverrideSpecifier","overrides":[],"src":"5876:8:11"},"parameters":{"id":2385,"nodeType":"ParameterList","parameters":[{"constant":false,"id":2382,"mutability":"mutable","name":"role","nameLocation":"5838:4:11","nodeType":"VariableDeclaration","scope":2402,"src":"5830:12:11","stateVariable":false,"storageLocation":"default","typeDescriptions":{"typeIdentifier":"t_bytes32","typeString":"bytes32"},"typeName":{"id":2381,"name":"bytes32","nodeType":"ElementaryTypeName","src":"5830:7:11","typeDescriptions":{"typeIdentifier":"t_bytes32","typeString":"bytes32"}},"visibility":"internal"},{"constant":false,"id":2384,"mutability":"mutable","name":"account","nameLocation":"5852:7:11","nodeType":"VariableDeclaration","scope":2402,"src":"5844:15:11","stateVariable":false,"storageLocation":"default","typeDescriptions":{"typeIdentifier":"t_address","typeString":"address"},"typeName":{"id":2383,"name":"address","nodeType":"ElementaryTypeName","src":"5844:7:11","stateMutability":"nonpayable","typeDescriptions":{"typeIdentifier":"t_address","typeString":"address"}},"visibility":"internal"}],"src":"5829:31:11"},"returnParameters":{"id":2387,"nodeType":"ParameterList","parameters":[],"src":"5885:0:11"},"scope":2512,"src":"5808:214:11","stateMutability":"nonpayable","virtual":true,"visibility":"public"},{"body":{"id":2415,"nodeType":"Block","src":"6729:42:11","statements":[{"expression":{"arguments":[{"id":2411,"name":"role","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":2405,"src":"6750:4:11","typeDescriptions":{"typeIdentifier":"t_bytes32","typeString":"bytes32"}},{"id":2412,"name":"account","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":2407,"src":"6756:7:11","typeDescriptions":{"typeIdentifier":"t_address","typeString":"address"}}],"expression":{"argumentTypes":[{"typeIdentifier":"t_bytes32","typeString":"bytes32"},{"typeIdentifier":"t_address","typeString":"address"}],"id":2410,"name":"_grantRole","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":2476,"src":"6739:10:11","typeDescriptions":{"typeIdentifier":"t_function_internal_nonpayable$_t_bytes32_$_t_address_$returns$__$","typeString":"function (bytes32,address)"}},"id":2413,"isConstant":false,"isLValue":false,"isPure":false,"kind":"functionCall","lValueRequested":false,"names":[],"nodeType":"FunctionCall","src":"6739:25:11","tryCall":false,"typeDescriptions":{"typeIdentifier":"t_tuple$__$","typeString":"tuple()"}},"id":2414,"nodeType":"ExpressionStatement","src":"6739:25:11"}]},"documentation":{"id":2403,"nodeType":"StructuredDocumentation","src":"6028:628:11","text":" @dev Grants `role` to `account`.\n If `account` had not been already granted `role`, emits a {RoleGranted}\n event. Note that unlike {grantRole}, this function doesn't perform any\n checks on the calling account.\n [WARNING]\n ====\n This function should only be called from the constructor when setting\n up the initial roles for the system.\n Using this function in any other way is effectively circumventing the admin\n system imposed by {AccessControl}.\n ====\n NOTE: This function is deprecated in favor of {_grantRole}."},"id":2416,"implemented":true,"kind":"function","modifiers":[],"name":"_setupRole","nameLocation":"6670:10:11","nodeType":"FunctionDefinition","parameters":{"id":2408,"nodeType":"ParameterList","parameters":[{"constant":false,"id":2405,"mutability":"mutable","name":"role","nameLocation":"6689:4:11","nodeType":"VariableDeclaration","scope":2416,"src":"6681:12:11","stateVariable":false,"storageLocation":"default","typeDescriptions":{"typeIdentifier":"t_bytes32","typeString":"bytes32"},"typeName":{"id":2404,"name":"bytes32","nodeType":"ElementaryTypeName","src":"6681:7:11","typeDescriptions":{"typeIdentifier":"t_bytes32","typeString":"bytes32"}},"visibility":"internal"},{"constant":false,"id":2407,"mutability":"mutable","name":"account","nameLocation":"6703:7:11","nodeType":"VariableDeclaration","scope":2416,"src":"6695:15:11","stateVariable":false,"storageLocation":"default","typeDescriptions":{"typeIdentifier":"t_address","typeString":"address"},"typeName":{"id":2406,"name":"address","nodeType":"ElementaryTypeName","src":"6695:7:11","stateMutability":"nonpayable","typeDescriptions":{"typeIdentifier":"t_address","typeString":"address"}},"visibility":"internal"}],"src":"6680:31:11"},"returnParameters":{"id":2409,"nodeType":"ParameterList","parameters":[],"src":"6729:0:11"},"scope":2512,"src":"6661:110:11","stateMutability":"nonpayable","virtual":true,"visibility":"internal"},{"body":{"id":2443,"nodeType":"Block","src":"6969:174:11","statements":[{"assignments":[2425],"declarations":[{"constant":false,"id":2425,"mutability":"mutable","name":"previousAdminRole","nameLocation":"6987:17:11","nodeType":"VariableDeclaration","scope":2443,"src":"6979:25:11","stateVariable":false,"storageLocation":"default","typeDescriptions":{"typeIdentifier":"t_bytes32","typeString":"bytes32"},"typeName":{"id":2424,"name":"bytes32","nodeType":"ElementaryTypeName","src":"6979:7:11","typeDescriptions":{"typeIdentifier":"t_bytes32","typeString":"bytes32"}},"visibility":"internal"}],"id":2429,"initialValue":{"arguments":[{"id":2427,"name":"role","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":2419,"src":"7020:4:11","typeDescriptions":{"typeIdentifier":"t_bytes32","typeString":"bytes32"}}],"expression":{"argumentTypes":[{"typeIdentifier":"t_bytes32","typeString":"bytes32"}],"id":2426,"name":"getRoleAdmin","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":2339,"src":"7007:12:11","typeDescriptions":{"typeIdentifier":"t_function_internal_view$_t_bytes32_$returns$_t_bytes32_$","typeString":"function (bytes32) view returns (bytes32)"}},"id":2428,"isConstant":false,"isLValue":false,"isPure":false,"kind":"functionCall","lValueRequested":false,"names":[],"nodeType":"FunctionCall","src":"7007:18:11","tryCall":false,"typeDescriptions":{"typeIdentifier":"t_bytes32","typeString":"bytes32"}},"nodeType":"VariableDeclarationStatement","src":"6979:46:11"},{"expression":{"id":2435,"isConstant":false,"isLValue":false,"isPure":false,"lValueRequested":false,"leftHandSide":{"expression":{"baseExpression":{"id":2430,"name":"_roles","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":2224,"src":"7035:6:11","typeDescriptions":{"typeIdentifier":"t_mapping$_t_bytes32_$_t_struct$_RoleData_$2219_storage_$","typeString":"mapping(bytes32 => struct AccessControlUpgradeable.RoleData storage ref)"}},"id":2432,"indexExpression":{"id":2431,"name":"role","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":2419,"src":"7042:4:11","typeDescriptions":{"typeIdentifier":"t_bytes32","typeString":"bytes32"}},"isConstant":false,"isLValue":true,"isPure":false,"lValueRequested":false,"nodeType":"IndexAccess","src":"7035:12:11","typeDescriptions":{"typeIdentifier":"t_struct$_RoleData_$2219_storage","typeString":"struct AccessControlUpgradeable.RoleData storage ref"}},"id":2433,"isConstant":false,"isLValue":true,"isPure":false,"lValueRequested":true,"memberName":"adminRole","nodeType":"MemberAccess","referencedDeclaration":2218,"src":"7035:22:11","typeDescriptions":{"typeIdentifier":"t_bytes32","typeString":"bytes32"}},"nodeType":"Assignment","operator":"=","rightHandSide":{"id":2434,"name":"adminRole","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":2421,"src":"7060:9:11","typeDescriptions":{"typeIdentifier":"t_bytes32","typeString":"bytes32"}},"src":"7035:34:11","typeDescriptions":{"typeIdentifier":"t_bytes32","typeString":"bytes32"}},"id":2436,"nodeType":"ExpressionStatement","src":"7035:34:11"},{"eventCall":{"arguments":[{"id":2438,"name":"role","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":2419,"src":"7101:4:11","typeDescriptions":{"typeIdentifier":"t_bytes32","typeString":"bytes32"}},{"id":2439,"name":"previousAdminRole","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":2425,"src":"7107:17:11","typeDescriptions":{"typeIdentifier":"t_bytes32","typeString":"bytes32"}},{"id":2440,"name":"adminRole","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":2421,"src":"7126:9:11","typeDescriptions":{"typeIdentifier":"t_bytes32","typeString":"bytes32"}}],"expression":{"argumentTypes":[{"typeIdentifier":"t_bytes32","typeString":"bytes32"},{"typeIdentifier":"t_bytes32","typeString":"bytes32"},{"typeIdentifier":"t_bytes32","typeString":"bytes32"}],"id":2437,"name":"RoleAdminChanged","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":2524,"src":"7084:16:11","typeDescriptions":{"typeIdentifier":"t_function_event_nonpayable$_t_bytes32_$_t_bytes32_$_t_bytes32_$returns$__$","typeString":"function (bytes32,bytes32,bytes32)"}},"id":2441,"isConstant":false,"isLValue":false,"isPure":false,"kind":"functionCall","lValueRequested":false,"names":[],"nodeType":"FunctionCall","src":"7084:52:11","tryCall":false,"typeDescriptions":{"typeIdentifier":"t_tuple$__$","typeString":"tuple()"}},"id":2442,"nodeType":"EmitStatement","src":"7079:57:11"}]},"documentation":{"id":2417,"nodeType":"StructuredDocumentation","src":"6777:114:11","text":" @dev Sets `adminRole` as ``role``'s admin role.\n Emits a {RoleAdminChanged} event."},"id":2444,"implemented":true,"kind":"function","modifiers":[],"name":"_setRoleAdmin","nameLocation":"6905:13:11","nodeType":"FunctionDefinition","parameters":{"id":2422,"nodeType":"ParameterList","parameters":[{"constant":false,"id":2419,"mutability":"mutable","name":"role","nameLocation":"6927:4:11","nodeType":"VariableDeclaration","scope":2444,"src":"6919:12:11","stateVariable":false,"storageLocation":"default","typeDescriptions":{"typeIdentifier":"t_bytes32","typeString":"bytes32"},"typeName":{"id":2418,"name":"bytes32","nodeType":"ElementaryTypeName","src":"6919:7:11","typeDescriptions":{"typeIdentifier":"t_bytes32","typeString":"bytes32"}},"visibility":"internal"},{"constant":false,"id":2421,"mutability":"mutable","name":"adminRole","nameLocation":"6941:9:11","nodeType":"VariableDeclaration","scope":2444,"src":"6933:17:11","stateVariable":false,"storageLocation":"default","typeDescriptions":{"typeIdentifier":"t_bytes32","typeString":"bytes32"},"typeName":{"id":2420,"name":"bytes32","nodeType":"ElementaryTypeName","src":"6933:7:11","typeDescriptions":{"typeIdentifier":"t_bytes32","typeString":"bytes32"}},"visibility":"internal"}],"src":"6918:33:11"},"returnParameters":{"id":2423,"nodeType":"ParameterList","parameters":[],"src":"6969:0:11"},"scope":2512,"src":"6896:247:11","stateMutability":"nonpayable","virtual":true,"visibility":"internal"},{"body":{"id":2475,"nodeType":"Block","src":"7333:165:11","statements":[{"condition":{"id":2456,"isConstant":false,"isLValue":false,"isPure":false,"lValueRequested":false,"nodeType":"UnaryOperation","operator":"!","prefix":true,"src":"7347:23:11","subExpression":{"arguments":[{"id":2453,"name":"role","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":2447,"src":"7356:4:11","typeDescriptions":{"typeIdentifier":"t_bytes32","typeString":"bytes32"}},{"id":2454,"name":"account","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":2449,"src":"7362:7:11","typeDescriptions":{"typeIdentifier":"t_address","typeString":"address"}}],"expression":{"argumentTypes":[{"typeIdentifier":"t_bytes32","typeString":"bytes32"},{"typeIdentifier":"t_address","typeString":"address"}],"id":2452,"name":"hasRole","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":2281,"src":"7348:7:11","typeDescriptions":{"typeIdentifier":"t_function_internal_view$_t_bytes32_$_t_address_$returns$_t_bool_$","typeString":"function (bytes32,address) view returns (bool)"}},"id":2455,"isConstant":false,"isLValue":false,"isPure":false,"kind":"functionCall","lValueRequested":false,"names":[],"nodeType":"FunctionCall","src":"7348:22:11","tryCall":false,"typeDescriptions":{"typeIdentifier":"t_bool","typeString":"bool"}},"typeDescriptions":{"typeIdentifier":"t_bool","typeString":"bool"}},"id":2474,"nodeType":"IfStatement","src":"7343:149:11","trueBody":{"id":2473,"nodeType":"Block","src":"7372:120:11","statements":[{"expression":{"id":2464,"isConstant":false,"isLValue":false,"isPure":false,"lValueRequested":false,"leftHandSide":{"baseExpression":{"expression":{"baseExpression":{"id":2457,"name":"_roles","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":2224,"src":"7386:6:11","typeDescriptions":{"typeIdentifier":"t_mapping$_t_bytes32_$_t_struct$_RoleData_$2219_storage_$","typeString":"mapping(bytes32 => struct AccessControlUpgradeable.RoleData storage ref)"}},"id":2459,"indexExpression":{"id":2458,"name":"role","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":2447,"src":"7393:4:11","typeDescriptions":{"typeIdentifier":"t_bytes32","typeString":"bytes32"}},"isConstant":false,"isLValue":true,"isPure":false,"lValueRequested":false,"nodeType":"IndexAccess","src":"7386:12:11","typeDescriptions":{"typeIdentifier":"t_struct$_RoleData_$2219_storage","typeString":"struct AccessControlUpgradeable.RoleData storage ref"}},"id":2460,"isConstant":false,"isLValue":true,"isPure":false,"lValueRequested":false,"memberName":"members","nodeType":"MemberAccess","referencedDeclaration":2216,"src":"7386:20:11","typeDescriptions":{"typeIdentifier":"t_mapping$_t_address_$_t_bool_$","typeString":"mapping(address => bool)"}},"id":2462,"indexExpression":{"id":2461,"name":"account","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":2449,"src":"7407:7:11","typeDescriptions":{"typeIdentifier":"t_address","typeString":"address"}},"isConstant":false,"isLValue":true,"isPure":false,"lValueRequested":true,"nodeType":"IndexAccess","src":"7386:29:11","typeDescriptions":{"typeIdentifier":"t_bool","typeString":"bool"}},"nodeType":"Assignment","operator":"=","rightHandSide":{"hexValue":"74727565","id":2463,"isConstant":false,"isLValue":false,"isPure":true,"kind":"bool","lValueRequested":false,"nodeType":"Literal","src":"7418:4:11","typeDescriptions":{"typeIdentifier":"t_bool","typeString":"bool"},"value":"true"},"src":"7386:36:11","typeDescriptions":{"typeIdentifier":"t_bool","typeString":"bool"}},"id":2465,"nodeType":"ExpressionStatement","src":"7386:36:11"},{"eventCall":{"arguments":[{"id":2467,"name":"role","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":2447,"src":"7453:4:11","typeDescriptions":{"typeIdentifier":"t_bytes32","typeString":"bytes32"}},{"id":2468,"name":"account","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":2449,"src":"7459:7:11","typeDescriptions":{"typeIdentifier":"t_address","typeString":"address"}},{"arguments":[],"expression":{"argumentTypes":[],"id":2469,"name":"_msgSender","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":3680,"src":"7468:10:11","typeDescriptions":{"typeIdentifier":"t_function_internal_view$__$returns$_t_address_$","typeString":"function () view returns (address)"}},"id":2470,"isConstant":false,"isLValue":false,"isPure":false,"kind":"functionCall","lValueRequested":false,"names":[],"nodeType":"FunctionCall","src":"7468:12:11","tryCall":false,"typeDescriptions":{"typeIdentifier":"t_address","typeString":"address"}}],"expression":{"argumentTypes":[{"typeIdentifier":"t_bytes32","typeString":"bytes32"},{"typeIdentifier":"t_address","typeString":"address"},{"typeIdentifier":"t_address","typeString":"address"}],"id":2466,"name":"RoleGranted","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":2533,"src":"7441:11:11","typeDescriptions":{"typeIdentifier":"t_function_event_nonpayable$_t_bytes32_$_t_address_$_t_address_$returns$__$","typeString":"function (bytes32,address,address)"}},"id":2471,"isConstant":false,"isLValue":false,"isPure":false,"kind":"functionCall","lValueRequested":false,"names":[],"nodeType":"FunctionCall","src":"7441:40:11","tryCall":false,"typeDescriptions":{"typeIdentifier":"t_tuple$__$","typeString":"tuple()"}},"id":2472,"nodeType":"EmitStatement","src":"7436:45:11"}]}}]},"documentation":{"id":2445,"nodeType":"StructuredDocumentation","src":"7149:111:11","text":" @dev Grants `role` to `account`.\n Internal function without access restriction."},"id":2476,"implemented":true,"kind":"function","modifiers":[],"name":"_grantRole","nameLocation":"7274:10:11","nodeType":"FunctionDefinition","parameters":{"id":2450,"nodeType":"ParameterList","parameters":[{"constant":false,"id":2447,"mutability":"mutable","name":"role","nameLocation":"7293:4:11","nodeType":"VariableDeclaration","scope":2476,"src":"7285:12:11","stateVariable":false,"storageLocation":"default","typeDescriptions":{"typeIdentifier":"t_bytes32","typeString":"bytes32"},"typeName":{"id":2446,"name":"bytes32","nodeType":"ElementaryTypeName","src":"7285:7:11","typeDescriptions":{"typeIdentifier":"t_bytes32","typeString":"bytes32"}},"visibility":"internal"},{"constant":false,"id":2449,"mutability":"mutable","name":"account","nameLocation":"7307:7:11","nodeType":"VariableDeclaration","scope":2476,"src":"7299:15:11","stateVariable":false,"storageLocation":"default","typeDescriptions":{"typeIdentifier":"t_address","typeString":"address"},"typeName":{"id":2448,"name":"address","nodeType":"ElementaryTypeName","src":"7299:7:11","stateMutability":"nonpayable","typeDescriptions":{"typeIdentifier":"t_address","typeString":"address"}},"visibility":"internal"}],"src":"7284:31:11"},"returnParameters":{"id":2451,"nodeType":"ParameterList","parameters":[],"src":"7333:0:11"},"scope":2512,"src":"7265:233:11","stateMutability":"nonpayable","virtual":true,"visibility":"internal"},{"body":{"id":2506,"nodeType":"Block","src":"7692:165:11","statements":[{"condition":{"arguments":[{"id":2485,"name":"role","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":2479,"src":"7714:4:11","typeDescriptions":{"typeIdentifier":"t_bytes32","typeString":"bytes32"}},{"id":2486,"name":"account","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":2481,"src":"7720:7:11","typeDescriptions":{"typeIdentifier":"t_address","typeString":"address"}}],"expression":{"argumentTypes":[{"typeIdentifier":"t_bytes32","typeString":"bytes32"},{"typeIdentifier":"t_address","typeString":"address"}],"id":2484,"name":"hasRole","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":2281,"src":"7706:7:11","typeDescriptions":{"typeIdentifier":"t_function_internal_view$_t_bytes32_$_t_address_$returns$_t_bool_$","typeString":"function (bytes32,address) view returns (bool)"}},"id":2487,"isConstant":false,"isLValue":false,"isPure":false,"kind":"functionCall","lValueRequested":false,"names":[],"nodeType":"FunctionCall","src":"7706:22:11","tryCall":false,"typeDescriptions":{"typeIdentifier":"t_bool","typeString":"bool"}},"id":2505,"nodeType":"IfStatement","src":"7702:149:11","trueBody":{"id":2504,"nodeType":"Block","src":"7730:121:11","statements":[{"expression":{"id":2495,"isConstant":false,"isLValue":false,"isPure":false,"lValueRequested":false,"leftHandSide":{"baseExpression":{"expression":{"baseExpression":{"id":2488,"name":"_roles","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":2224,"src":"7744:6:11","typeDescriptions":{"typeIdentifier":"t_mapping$_t_bytes32_$_t_struct$_RoleData_$2219_storage_$","typeString":"mapping(bytes32 => struct AccessControlUpgradeable.RoleData storage ref)"}},"id":2490,"indexExpression":{"id":2489,"name":"role","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":2479,"src":"7751:4:11","typeDescriptions":{"typeIdentifier":"t_bytes32","typeString":"bytes32"}},"isConstant":false,"isLValue":true,"isPure":false,"lValueRequested":false,"nodeType":"IndexAccess","src":"7744:12:11","typeDescriptions":{"typeIdentifier":"t_struct$_RoleData_$2219_storage","typeString":"struct AccessControlUpgradeable.RoleData storage ref"}},"id":2491,"isConstant":false,"isLValue":true,"isPure":false,"lValueRequested":false,"memberName":"members","nodeType":"MemberAccess","referencedDeclaration":2216,"src":"7744:20:11","typeDescriptions":{"typeIdentifier":"t_mapping$_t_address_$_t_bool_$","typeString":"mapping(address => bool)"}},"id":2493,"indexExpression":{"id":2492,"name":"account","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":2481,"src":"7765:7:11","typeDescriptions":{"typeIdentifier":"t_address","typeString":"address"}},"isConstant":false,"isLValue":true,"isPure":false,"lValueRequested":true,"nodeType":"IndexAccess","src":"7744:29:11","typeDescriptions":{"typeIdentifier":"t_bool","typeString":"bool"}},"nodeType":"Assignment","operator":"=","rightHandSide":{"hexValue":"66616c7365","id":2494,"isConstant":false,"isLValue":false,"isPure":true,"kind":"bool","lValueRequested":false,"nodeType":"Literal","src":"7776:5:11","typeDescriptions":{"typeIdentifier":"t_bool","typeString":"bool"},"value":"false"},"src":"7744:37:11","typeDescriptions":{"typeIdentifier":"t_bool","typeString":"bool"}},"id":2496,"nodeType":"ExpressionStatement","src":"7744:37:11"},{"eventCall":{"arguments":[{"id":2498,"name":"role","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":2479,"src":"7812:4:11","typeDescriptions":{"typeIdentifier":"t_bytes32","typeString":"bytes32"}},{"id":2499,"name":"account","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":2481,"src":"7818:7:11","typeDescriptions":{"typeIdentifier":"t_address","typeString":"address"}},{"arguments":[],"expression":{"argumentTypes":[],"id":2500,"name":"_msgSender","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":3680,"src":"7827:10:11","typeDescriptions":{"typeIdentifier":"t_function_internal_view$__$returns$_t_address_$","typeString":"function () view returns (address)"}},"id":2501,"isConstant":false,"isLValue":false,"isPure":false,"kind":"functionCall","lValueRequested":false,"names":[],"nodeType":"FunctionCall","src":"7827:12:11","tryCall":false,"typeDescriptions":{"typeIdentifier":"t_address","typeString":"address"}}],"expression":{"argumentTypes":[{"typeIdentifier":"t_bytes32","typeString":"bytes32"},{"typeIdentifier":"t_address","typeString":"address"},{"typeIdentifier":"t_address","typeString":"address"}],"id":2497,"name":"RoleRevoked","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":2542,"src":"7800:11:11","typeDescriptions":{"typeIdentifier":"t_function_event_nonpayable$_t_bytes32_$_t_address_$_t_address_$returns$__$","typeString":"function (bytes32,address,address)"}},"id":2502,"isConstant":false,"isLValue":false,"isPure":false,"kind":"functionCall","lValueRequested":false,"names":[],"nodeType":"FunctionCall","src":"7800:40:11","tryCall":false,"typeDescriptions":{"typeIdentifier":"t_tuple$__$","typeString":"tuple()"}},"id":2503,"nodeType":"EmitStatement","src":"7795:45:11"}]}}]},"documentation":{"id":2477,"nodeType":"StructuredDocumentation","src":"7504:114:11","text":" @dev Revokes `role` from `account`.\n Internal function without access restriction."},"id":2507,"implemented":true,"kind":"function","modifiers":[],"name":"_revokeRole","nameLocation":"7632:11:11","nodeType":"FunctionDefinition","parameters":{"id":2482,"nodeType":"ParameterList","parameters":[{"constant":false,"id":2479,"mutability":"mutable","name":"role","nameLocation":"7652:4:11","nodeType":"VariableDeclaration","scope":2507,"src":"7644:12:11","stateVariable":false,"storageLocation":"default","typeDescriptions":{"typeIdentifier":"t_bytes32","typeString":"bytes32"},"typeName":{"id":2478,"name":"bytes32","nodeType":"ElementaryTypeName","src":"7644:7:11","typeDescriptions":{"typeIdentifier":"t_bytes32","typeString":"bytes32"}},"visibility":"internal"},{"constant":false,"id":2481,"mutability":"mutable","name":"account","nameLocation":"7666:7:11","nodeType":"VariableDeclaration","scope":2507,"src":"7658:15:11","stateVariable":false,"storageLocation":"default","typeDescriptions":{"typeIdentifier":"t_address","typeString":"address"},"typeName":{"id":2480,"name":"address","nodeType":"ElementaryTypeName","src":"7658:7:11","stateMutability":"nonpayable","typeDescriptions":{"typeIdentifier":"t_address","typeString":"address"}},"visibility":"internal"}],"src":"7643:31:11"},"returnParameters":{"id":2483,"nodeType":"ParameterList","parameters":[],"src":"7692:0:11"},"scope":2512,"src":"7623:234:11","stateMutability":"nonpayable","virtual":true,"visibility":"internal"},{"constant":false,"id":2511,"mutability":"mutable","name":"__gap","nameLocation":"7882:5:11","nodeType":"VariableDeclaration","scope":2512,"src":"7862:25:11","stateVariable":true,"storageLocation":"default","typeDescriptions":{"typeIdentifier":"t_array$_t_uint256_$49_storage","typeString":"uint256[49]"},"typeName":{"baseType":{"id":2508,"name":"uint256","nodeType":"ElementaryTypeName","src":"7862:7:11","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"}},"id":2510,"length":{"hexValue":"3439","id":2509,"isConstant":false,"isLValue":false,"isPure":true,"kind":"number","lValueRequested":false,"nodeType":"Literal","src":"7870:2:11","typeDescriptions":{"typeIdentifier":"t_rational_49_by_1","typeString":"int_const 49"},"value":"49"},"nodeType":"ArrayTypeName","src":"7862:11:11","typeDescriptions":{"typeIdentifier":"t_array$_t_uint256_$49_storage_ptr","typeString":"uint256[49]"}},"visibility":"private"}],"scope":2513,"src":"1878:6012:11","usedErrors":[]}],"src":"93:7798:11"},"id":11},"@openzeppelin/contracts-upgradeable-4.4.2/access/IAccessControlUpgradeable.sol":{"ast":{"absolutePath":"@openzeppelin/contracts-upgradeable-4.4.2/access/IAccessControlUpgradeable.sol","exportedSymbols":{"IAccessControlUpgradeable":[2585]},"id":2586,"license":"MIT","nodeType":"SourceUnit","nodes":[{"id":2514,"literals":["solidity","^","0.8",".0"],"nodeType":"PragmaDirective","src":"94:23:12"},{"abstract":false,"baseContracts":[],"canonicalName":"IAccessControlUpgradeable","contractDependencies":[],"contractKind":"interface","documentation":{"id":2515,"nodeType":"StructuredDocumentation","src":"119:89:12","text":" @dev External interface of AccessControl declared to support ERC165 detection."},"fullyImplemented":false,"id":2585,"linearizedBaseContracts":[2585],"name":"IAccessControlUpgradeable","nameLocation":"219:25:12","nodeType":"ContractDefinition","nodes":[{"anonymous":false,"documentation":{"id":2516,"nodeType":"StructuredDocumentation","src":"251:292:12","text":" @dev Emitted when `newAdminRole` is set as ``role``'s admin role, replacing `previousAdminRole`\n `DEFAULT_ADMIN_ROLE` is the starting admin for all roles, despite\n {RoleAdminChanged} not being emitted signaling this.\n _Available since v3.1._"},"id":2524,"name":"RoleAdminChanged","nameLocation":"554:16:12","nodeType":"EventDefinition","parameters":{"id":2523,"nodeType":"ParameterList","parameters":[{"constant":false,"id":2518,"indexed":true,"mutability":"mutable","name":"role","nameLocation":"587:4:12","nodeType":"VariableDeclaration","scope":2524,"src":"571:20:12","stateVariable":false,"storageLocation":"default","typeDescriptions":{"typeIdentifier":"t_bytes32","typeString":"bytes32"},"typeName":{"id":2517,"name":"bytes32","nodeType":"ElementaryTypeName","src":"571:7:12","typeDescriptions":{"typeIdentifier":"t_bytes32","typeString":"bytes32"}},"visibility":"internal"},{"constant":false,"id":2520,"indexed":true,"mutability":"mutable","name":"previousAdminRole","nameLocation":"609:17:12","nodeType":"VariableDeclaration","scope":2524,"src":"593:33:12","stateVariable":false,"storageLocation":"default","typeDescriptions":{"typeIdentifier":"t_bytes32","typeString":"bytes32"},"typeName":{"id":2519,"name":"bytes32","nodeType":"ElementaryTypeName","src":"593:7:12","typeDescriptions":{"typeIdentifier":"t_bytes32","typeString":"bytes32"}},"visibility":"internal"},{"constant":false,"id":2522,"indexed":true,"mutability":"mutable","name":"newAdminRole","nameLocation":"644:12:12","nodeType":"VariableDeclaration","scope":2524,"src":"628:28:12","stateVariable":false,"storageLocation":"default","typeDescriptions":{"typeIdentifier":"t_bytes32","typeString":"bytes32"},"typeName":{"id":2521,"name":"bytes32","nodeType":"ElementaryTypeName","src":"628:7:12","typeDescriptions":{"typeIdentifier":"t_bytes32","typeString":"bytes32"}},"visibility":"internal"}],"src":"570:87:12"},"src":"548:110:12"},{"anonymous":false,"documentation":{"id":2525,"nodeType":"StructuredDocumentation","src":"664:212:12","text":" @dev Emitted when `account` is granted `role`.\n `sender` is the account that originated the contract call, an admin role\n bearer except when using {AccessControl-_setupRole}."},"id":2533,"name":"RoleGranted","nameLocation":"887:11:12","nodeType":"EventDefinition","parameters":{"id":2532,"nodeType":"ParameterList","parameters":[{"constant":false,"id":2527,"indexed":true,"mutability":"mutable","name":"role","nameLocation":"915:4:12","nodeType":"VariableDeclaration","scope":2533,"src":"899:20:12","stateVariable":false,"storageLocation":"default","typeDescriptions":{"typeIdentifier":"t_bytes32","typeString":"bytes32"},"typeName":{"id":2526,"name":"bytes32","nodeType":"ElementaryTypeName","src":"899:7:12","typeDescriptions":{"typeIdentifier":"t_bytes32","typeString":"bytes32"}},"visibility":"internal"},{"constant":false,"id":2529,"indexed":true,"mutability":"mutable","name":"account","nameLocation":"937:7:12","nodeType":"VariableDeclaration","scope":2533,"src":"921:23:12","stateVariable":false,"storageLocation":"default","typeDescriptions":{"typeIdentifier":"t_address","typeString":"address"},"typeName":{"id":2528,"name":"address","nodeType":"ElementaryTypeName","src":"921:7:12","stateMutability":"nonpayable","typeDescriptions":{"typeIdentifier":"t_address","typeString":"address"}},"visibility":"internal"},{"constant":false,"id":2531,"indexed":true,"mutability":"mutable","name":"sender","nameLocation":"962:6:12","nodeType":"VariableDeclaration","scope":2533,"src":"946:22:12","stateVariable":false,"storageLocation":"default","typeDescriptions":{"typeIdentifier":"t_address","typeString":"address"},"typeName":{"id":2530,"name":"address","nodeType":"ElementaryTypeName","src":"946:7:12","stateMutability":"nonpayable","typeDescriptions":{"typeIdentifier":"t_address","typeString":"address"}},"visibility":"internal"}],"src":"898:71:12"},"src":"881:89:12"},{"anonymous":false,"documentation":{"id":2534,"nodeType":"StructuredDocumentation","src":"976:275:12","text":" @dev Emitted when `account` is revoked `role`.\n `sender` is the account that originated the contract call:\n - if using `revokeRole`, it is the admin role bearer\n - if using `renounceRole`, it is the role bearer (i.e. `account`)"},"id":2542,"name":"RoleRevoked","nameLocation":"1262:11:12","nodeType":"EventDefinition","parameters":{"id":2541,"nodeType":"ParameterList","parameters":[{"constant":false,"id":2536,"indexed":true,"mutability":"mutable","name":"role","nameLocation":"1290:4:12","nodeType":"VariableDeclaration","scope":2542,"src":"1274:20:12","stateVariable":false,"storageLocation":"default","typeDescriptions":{"typeIdentifier":"t_bytes32","typeString":"bytes32"},"typeName":{"id":2535,"name":"bytes32","nodeType":"ElementaryTypeName","src":"1274:7:12","typeDescriptions":{"typeIdentifier":"t_bytes32","typeString":"bytes32"}},"visibility":"internal"},{"constant":false,"id":2538,"indexed":true,"mutability":"mutable","name":"account","nameLocation":"1312:7:12","nodeType":"VariableDeclaration","scope":2542,"src":"1296:23:12","stateVariable":false,"storageLocation":"default","typeDescriptions":{"typeIdentifier":"t_address","typeString":"address"},"typeName":{"id":2537,"name":"address","nodeType":"ElementaryTypeName","src":"1296:7:12","stateMutability":"nonpayable","typeDescriptions":{"typeIdentifier":"t_address","typeString":"address"}},"visibility":"internal"},{"constant":false,"id":2540,"indexed":true,"mutability":"mutable","name":"sender","nameLocation":"1337:6:12","nodeType":"VariableDeclaration","scope":2542,"src":"1321:22:12","stateVariable":false,"storageLocation":"default","typeDescriptions":{"typeIdentifier":"t_address","typeString":"address"},"typeName":{"id":2539,"name":"address","nodeType":"ElementaryTypeName","src":"1321:7:12","stateMutability":"nonpayable","typeDescriptions":{"typeIdentifier":"t_address","typeString":"address"}},"visibility":"internal"}],"src":"1273:71:12"},"src":"1256:89:12"},{"documentation":{"id":2543,"nodeType":"StructuredDocumentation","src":"1351:76:12","text":" @dev Returns `true` if `account` has been granted `role`."},"functionSelector":"91d14854","id":2552,"implemented":false,"kind":"function","modifiers":[],"name":"hasRole","nameLocation":"1441:7:12","nodeType":"FunctionDefinition","parameters":{"id":2548,"nodeType":"ParameterList","parameters":[{"constant":false,"id":2545,"mutability":"mutable","name":"role","nameLocation":"1457:4:12","nodeType":"VariableDeclaration","scope":2552,"src":"1449:12:12","stateVariable":false,"storageLocation":"default","typeDescriptions":{"typeIdentifier":"t_bytes32","typeString":"bytes32"},"typeName":{"id":2544,"name":"bytes32","nodeType":"ElementaryTypeName","src":"1449:7:12","typeDescriptions":{"typeIdentifier":"t_bytes32","typeString":"bytes32"}},"visibility":"internal"},{"constant":false,"id":2547,"mutability":"mutable","name":"account","nameLocation":"1471:7:12","nodeType":"VariableDeclaration","scope":2552,"src":"1463:15:12","stateVariable":false,"storageLocation":"default","typeDescriptions":{"typeIdentifier":"t_address","typeString":"address"},"typeName":{"id":2546,"name":"address","nodeType":"ElementaryTypeName","src":"1463:7:12","stateMutability":"nonpayable","typeDescriptions":{"typeIdentifier":"t_address","typeString":"address"}},"visibility":"internal"}],"src":"1448:31:12"},"returnParameters":{"id":2551,"nodeType":"ParameterList","parameters":[{"constant":false,"id":2550,"mutability":"mutable","name":"","nameLocation":"-1:-1:-1","nodeType":"VariableDeclaration","scope":2552,"src":"1503:4:12","stateVariable":false,"storageLocation":"default","typeDescriptions":{"typeIdentifier":"t_bool","typeString":"bool"},"typeName":{"id":2549,"name":"bool","nodeType":"ElementaryTypeName","src":"1503:4:12","typeDescriptions":{"typeIdentifier":"t_bool","typeString":"bool"}},"visibility":"internal"}],"src":"1502:6:12"},"scope":2585,"src":"1432:77:12","stateMutability":"view","virtual":false,"visibility":"external"},{"documentation":{"id":2553,"nodeType":"StructuredDocumentation","src":"1515:184:12","text":" @dev Returns the admin role that controls `role`. See {grantRole} and\n {revokeRole}.\n To change a role's admin, use {AccessControl-_setRoleAdmin}."},"functionSelector":"248a9ca3","id":2560,"implemented":false,"kind":"function","modifiers":[],"name":"getRoleAdmin","nameLocation":"1713:12:12","nodeType":"FunctionDefinition","parameters":{"id":2556,"nodeType":"ParameterList","parameters":[{"constant":false,"id":2555,"mutability":"mutable","name":"role","nameLocation":"1734:4:12","nodeType":"VariableDeclaration","scope":2560,"src":"1726:12:12","stateVariable":false,"storageLocation":"default","typeDescriptions":{"typeIdentifier":"t_bytes32","typeString":"bytes32"},"typeName":{"id":2554,"name":"bytes32","nodeType":"ElementaryTypeName","src":"1726:7:12","typeDescriptions":{"typeIdentifier":"t_bytes32","typeString":"bytes32"}},"visibility":"internal"}],"src":"1725:14:12"},"returnParameters":{"id":2559,"nodeType":"ParameterList","parameters":[{"constant":false,"id":2558,"mutability":"mutable","name":"","nameLocation":"-1:-1:-1","nodeType":"VariableDeclaration","scope":2560,"src":"1763:7:12","stateVariable":false,"storageLocation":"default","typeDescriptions":{"typeIdentifier":"t_bytes32","typeString":"bytes32"},"typeName":{"id":2557,"name":"bytes32","nodeType":"ElementaryTypeName","src":"1763:7:12","typeDescriptions":{"typeIdentifier":"t_bytes32","typeString":"bytes32"}},"visibility":"internal"}],"src":"1762:9:12"},"scope":2585,"src":"1704:68:12","stateMutability":"view","virtual":false,"visibility":"external"},{"documentation":{"id":2561,"nodeType":"StructuredDocumentation","src":"1778:239:12","text":" @dev Grants `role` to `account`.\n If `account` had not been already granted `role`, emits a {RoleGranted}\n event.\n Requirements:\n - the caller must have ``role``'s admin role."},"functionSelector":"2f2ff15d","id":2568,"implemented":false,"kind":"function","modifiers":[],"name":"grantRole","nameLocation":"2031:9:12","nodeType":"FunctionDefinition","parameters":{"id":2566,"nodeType":"ParameterList","parameters":[{"constant":false,"id":2563,"mutability":"mutable","name":"role","nameLocation":"2049:4:12","nodeType":"VariableDeclaration","scope":2568,"src":"2041:12:12","stateVariable":false,"storageLocation":"default","typeDescriptions":{"typeIdentifier":"t_bytes32","typeString":"bytes32"},"typeName":{"id":2562,"name":"bytes32","nodeType":"ElementaryTypeName","src":"2041:7:12","typeDescriptions":{"typeIdentifier":"t_bytes32","typeString":"bytes32"}},"visibility":"internal"},{"constant":false,"id":2565,"mutability":"mutable","name":"account","nameLocation":"2063:7:12","nodeType":"VariableDeclaration","scope":2568,"src":"2055:15:12","stateVariable":false,"storageLocation":"default","typeDescriptions":{"typeIdentifier":"t_address","typeString":"address"},"typeName":{"id":2564,"name":"address","nodeType":"ElementaryTypeName","src":"2055:7:12","stateMutability":"nonpayable","typeDescriptions":{"typeIdentifier":"t_address","typeString":"address"}},"visibility":"internal"}],"src":"2040:31:12"},"returnParameters":{"id":2567,"nodeType":"ParameterList","parameters":[],"src":"2080:0:12"},"scope":2585,"src":"2022:59:12","stateMutability":"nonpayable","virtual":false,"visibility":"external"},{"documentation":{"id":2569,"nodeType":"StructuredDocumentation","src":"2087:223:12","text":" @dev Revokes `role` from `account`.\n If `account` had been granted `role`, emits a {RoleRevoked} event.\n Requirements:\n - the caller must have ``role``'s admin role."},"functionSelector":"d547741f","id":2576,"implemented":false,"kind":"function","modifiers":[],"name":"revokeRole","nameLocation":"2324:10:12","nodeType":"FunctionDefinition","parameters":{"id":2574,"nodeType":"ParameterList","parameters":[{"constant":false,"id":2571,"mutability":"mutable","name":"role","nameLocation":"2343:4:12","nodeType":"VariableDeclaration","scope":2576,"src":"2335:12:12","stateVariable":false,"storageLocation":"default","typeDescriptions":{"typeIdentifier":"t_bytes32","typeString":"bytes32"},"typeName":{"id":2570,"name":"bytes32","nodeType":"ElementaryTypeName","src":"2335:7:12","typeDescriptions":{"typeIdentifier":"t_bytes32","typeString":"bytes32"}},"visibility":"internal"},{"constant":false,"id":2573,"mutability":"mutable","name":"account","nameLocation":"2357:7:12","nodeType":"VariableDeclaration","scope":2576,"src":"2349:15:12","stateVariable":false,"storageLocation":"default","typeDescriptions":{"typeIdentifier":"t_address","typeString":"address"},"typeName":{"id":2572,"name":"address","nodeType":"ElementaryTypeName","src":"2349:7:12","stateMutability":"nonpayable","typeDescriptions":{"typeIdentifier":"t_address","typeString":"address"}},"visibility":"internal"}],"src":"2334:31:12"},"returnParameters":{"id":2575,"nodeType":"ParameterList","parameters":[],"src":"2374:0:12"},"scope":2585,"src":"2315:60:12","stateMutability":"nonpayable","virtual":false,"visibility":"external"},{"documentation":{"id":2577,"nodeType":"StructuredDocumentation","src":"2381:480:12","text":" @dev Revokes `role` from the calling account.\n Roles are often managed via {grantRole} and {revokeRole}: this function's\n purpose is to provide a mechanism for accounts to lose their privileges\n if they are compromised (such as when a trusted device is misplaced).\n If the calling account had been granted `role`, emits a {RoleRevoked}\n event.\n Requirements:\n - the caller must be `account`."},"functionSelector":"36568abe","id":2584,"implemented":false,"kind":"function","modifiers":[],"name":"renounceRole","nameLocation":"2875:12:12","nodeType":"FunctionDefinition","parameters":{"id":2582,"nodeType":"ParameterList","parameters":[{"constant":false,"id":2579,"mutability":"mutable","name":"role","nameLocation":"2896:4:12","nodeType":"VariableDeclaration","scope":2584,
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment