@airdao/swap-router-contracts
Version:
Smart contracts for swapping on Astra Classic and CL
12,355 lines • 700 kB
JSON
{
"id": "628f32924b7b2c69c4cff1694f659510",
"_format": "hh-sol-build-info-1",
"solcVersion": "0.7.6",
"solcLongVersion": "0.7.6+commit.7338295f",
"input": {
"language": "Solidity",
"sources": {
"contracts/test/MockObservations.sol": {
"content": "// SPDX-License-Identifier: UNLICENSED\npragma solidity =0.7.6;\n\nimport '@airdao/astra-cl-core/contracts/libraries/Oracle.sol';\n\ncontract MockObservations {\n using Oracle for Oracle.Observation[65535];\n\n // slot0\n int24 private slot0Tick;\n uint16 private slot0ObservationCardinality;\n uint16 private slot0ObservationIndex;\n\n // observations\n Oracle.Observation[65535] public observations;\n\n // block timestamps always monotonic increasing from 0, cumulative ticks are calculated automatically\n constructor(\n uint32[3] memory blockTimestamps,\n int24[3] memory ticks,\n bool mockLowObservationCardinality\n ) {\n require(blockTimestamps[0] == 0, '0');\n require(blockTimestamps[1] > 0, '1');\n require(blockTimestamps[2] > blockTimestamps[1], '2');\n\n int56 tickCumulative = 0;\n for (uint256 i = 0; i < blockTimestamps.length; i++) {\n if (i != 0) {\n int24 tick = ticks[i - 1];\n uint32 delta = blockTimestamps[i] - blockTimestamps[i - 1];\n tickCumulative += int56(tick) * delta;\n }\n observations[i] = Oracle.Observation({\n blockTimestamp: blockTimestamps[i],\n tickCumulative: tickCumulative,\n secondsPerLiquidityCumulativeX128: uint160(i),\n initialized: true\n });\n }\n slot0Tick = ticks[2];\n slot0ObservationCardinality = mockLowObservationCardinality ? 1 : 3;\n slot0ObservationIndex = 2;\n }\n\n function slot0()\n external\n view\n returns (\n uint160,\n int24,\n uint16,\n uint16,\n uint16,\n uint8,\n bool\n )\n {\n return (0, slot0Tick, slot0ObservationIndex, slot0ObservationCardinality, 0, 0, false);\n }\n\n function observe(uint32[] calldata secondsAgos)\n external\n view\n returns (int56[] memory tickCumulatives, uint160[] memory secondsPerLiquidityCumulativeX128s)\n {\n return\n observations.observe(\n observations[2].blockTimestamp,\n secondsAgos,\n slot0Tick,\n slot0ObservationIndex,\n 0,\n slot0ObservationCardinality\n );\n }\n}\n"
},
"@airdao/astra-cl-core/contracts/libraries/Oracle.sol": {
"content": "// SPDX-License-Identifier: BUSL-1.1\npragma solidity >=0.5.0 <0.8.0;\n\n/// @title Oracle\n/// @notice Provides price and liquidity data useful for a wide variety of system designs\n/// @dev Instances of stored oracle data, \"observations\", are collected in the oracle array\n/// Every pool is initialized with an oracle array length of 1. Anyone can pay the SSTOREs to increase the\n/// maximum length of the oracle array. New slots will be added when the array is fully populated.\n/// Observations are overwritten when the full length of the oracle array is populated.\n/// The most recent observation is available, independent of the length of the oracle array, by passing 0 to observe()\nlibrary Oracle {\n struct Observation {\n // the block timestamp of the observation\n uint32 blockTimestamp;\n // the tick accumulator, i.e. tick * time elapsed since the pool was first initialized\n int56 tickCumulative;\n // the seconds per liquidity, i.e. seconds elapsed / max(1, liquidity) since the pool was first initialized\n uint160 secondsPerLiquidityCumulativeX128;\n // whether or not the observation is initialized\n bool initialized;\n }\n\n /// @notice Transforms a previous observation into a new observation, given the passage of time and the current tick and liquidity values\n /// @dev blockTimestamp _must_ be chronologically equal to or greater than last.blockTimestamp, safe for 0 or 1 overflows\n /// @param last The specified observation to be transformed\n /// @param blockTimestamp The timestamp of the new observation\n /// @param tick The active tick at the time of the new observation\n /// @param liquidity The total in-range liquidity at the time of the new observation\n /// @return Observation The newly populated observation\n function transform(\n Observation memory last,\n uint32 blockTimestamp,\n int24 tick,\n uint128 liquidity\n ) private pure returns (Observation memory) {\n uint32 delta = blockTimestamp - last.blockTimestamp;\n return\n Observation({\n blockTimestamp: blockTimestamp,\n tickCumulative: last.tickCumulative + int56(tick) * delta,\n secondsPerLiquidityCumulativeX128: last.secondsPerLiquidityCumulativeX128 +\n ((uint160(delta) << 128) / (liquidity > 0 ? liquidity : 1)),\n initialized: true\n });\n }\n\n /// @notice Initialize the oracle array by writing the first slot. Called once for the lifecycle of the observations array\n /// @param self The stored oracle array\n /// @param time The time of the oracle initialization, via block.timestamp truncated to uint32\n /// @return cardinality The number of populated elements in the oracle array\n /// @return cardinalityNext The new length of the oracle array, independent of population\n function initialize(\n Observation[65535] storage self,\n uint32 time\n ) internal returns (uint16 cardinality, uint16 cardinalityNext) {\n self[0] = Observation({\n blockTimestamp: time,\n tickCumulative: 0,\n secondsPerLiquidityCumulativeX128: 0,\n initialized: true\n });\n return (1, 1);\n }\n\n /// @notice Writes an oracle observation to the array\n /// @dev Writable at most once per block. Index represents the most recently written element. cardinality and index must be tracked externally.\n /// If the index is at the end of the allowable array length (according to cardinality), and the next cardinality\n /// is greater than the current one, cardinality may be increased. This restriction is created to preserve ordering.\n /// @param self The stored oracle array\n /// @param index The index of the observation that was most recently written to the observations array\n /// @param blockTimestamp The timestamp of the new observation\n /// @param tick The active tick at the time of the new observation\n /// @param liquidity The total in-range liquidity at the time of the new observation\n /// @param cardinality The number of populated elements in the oracle array\n /// @param cardinalityNext The new length of the oracle array, independent of population\n /// @return indexUpdated The new index of the most recently written element in the oracle array\n /// @return cardinalityUpdated The new cardinality of the oracle array\n function write(\n Observation[65535] storage self,\n uint16 index,\n uint32 blockTimestamp,\n int24 tick,\n uint128 liquidity,\n uint16 cardinality,\n uint16 cardinalityNext\n ) internal returns (uint16 indexUpdated, uint16 cardinalityUpdated) {\n Observation memory last = self[index];\n\n // early return if we've already written an observation this block\n if (last.blockTimestamp == blockTimestamp) return (index, cardinality);\n\n // if the conditions are right, we can bump the cardinality\n if (cardinalityNext > cardinality && index == (cardinality - 1)) {\n cardinalityUpdated = cardinalityNext;\n } else {\n cardinalityUpdated = cardinality;\n }\n\n indexUpdated = (index + 1) % cardinalityUpdated;\n self[indexUpdated] = transform(last, blockTimestamp, tick, liquidity);\n }\n\n /// @notice Prepares the oracle array to store up to `next` observations\n /// @param self The stored oracle array\n /// @param current The current next cardinality of the oracle array\n /// @param next The proposed next cardinality which will be populated in the oracle array\n /// @return next The next cardinality which will be populated in the oracle array\n function grow(Observation[65535] storage self, uint16 current, uint16 next) internal returns (uint16) {\n require(current > 0, 'I');\n // no-op if the passed next value isn't greater than the current next value\n if (next <= current) return current;\n // store in each slot to prevent fresh SSTOREs in swaps\n // this data will not be used because the initialized boolean is still false\n for (uint16 i = current; i < next; i++) self[i].blockTimestamp = 1;\n return next;\n }\n\n /// @notice comparator for 32-bit timestamps\n /// @dev safe for 0 or 1 overflows, a and b _must_ be chronologically before or equal to time\n /// @param time A timestamp truncated to 32 bits\n /// @param a A comparison timestamp from which to determine the relative position of `time`\n /// @param b From which to determine the relative position of `time`\n /// @return bool Whether `a` is chronologically <= `b`\n function lte(uint32 time, uint32 a, uint32 b) private pure returns (bool) {\n // if there hasn't been overflow, no need to adjust\n if (a <= time && b <= time) return a <= b;\n\n uint256 aAdjusted = a > time ? a : a + 2 ** 32;\n uint256 bAdjusted = b > time ? b : b + 2 ** 32;\n\n return aAdjusted <= bAdjusted;\n }\n\n /// @notice Fetches the observations beforeOrAt and atOrAfter a target, i.e. where [beforeOrAt, atOrAfter] is satisfied.\n /// The result may be the same observation, or adjacent observations.\n /// @dev The answer must be contained in the array, used when the target is located within the stored observation\n /// boundaries: older than the most recent observation and younger, or the same age as, the oldest observation\n /// @param self The stored oracle array\n /// @param time The current block.timestamp\n /// @param target The timestamp at which the reserved observation should be for\n /// @param index The index of the observation that was most recently written to the observations array\n /// @param cardinality The number of populated elements in the oracle array\n /// @return beforeOrAt The observation recorded before, or at, the target\n /// @return atOrAfter The observation recorded at, or after, the target\n function binarySearch(\n Observation[65535] storage self,\n uint32 time,\n uint32 target,\n uint16 index,\n uint16 cardinality\n ) private view returns (Observation memory beforeOrAt, Observation memory atOrAfter) {\n uint256 l = (index + 1) % cardinality; // oldest observation\n uint256 r = l + cardinality - 1; // newest observation\n uint256 i;\n while (true) {\n i = (l + r) / 2;\n\n beforeOrAt = self[i % cardinality];\n\n // we've landed on an uninitialized tick, keep searching higher (more recently)\n if (!beforeOrAt.initialized) {\n l = i + 1;\n continue;\n }\n\n atOrAfter = self[(i + 1) % cardinality];\n\n bool targetAtOrAfter = lte(time, beforeOrAt.blockTimestamp, target);\n\n // check if we've found the answer!\n if (targetAtOrAfter && lte(time, target, atOrAfter.blockTimestamp)) break;\n\n if (!targetAtOrAfter) r = i - 1;\n else l = i + 1;\n }\n }\n\n /// @notice Fetches the observations beforeOrAt and atOrAfter a given target, i.e. where [beforeOrAt, atOrAfter] is satisfied\n /// @dev Assumes there is at least 1 initialized observation.\n /// Used by observeSingle() to compute the counterfactual accumulator values as of a given block timestamp.\n /// @param self The stored oracle array\n /// @param time The current block.timestamp\n /// @param target The timestamp at which the reserved observation should be for\n /// @param tick The active tick at the time of the returned or simulated observation\n /// @param index The index of the observation that was most recently written to the observations array\n /// @param liquidity The total pool liquidity at the time of the call\n /// @param cardinality The number of populated elements in the oracle array\n /// @return beforeOrAt The observation which occurred at, or before, the given timestamp\n /// @return atOrAfter The observation which occurred at, or after, the given timestamp\n function getSurroundingObservations(\n Observation[65535] storage self,\n uint32 time,\n uint32 target,\n int24 tick,\n uint16 index,\n uint128 liquidity,\n uint16 cardinality\n ) private view returns (Observation memory beforeOrAt, Observation memory atOrAfter) {\n // optimistically set before to the newest observation\n beforeOrAt = self[index];\n\n // if the target is chronologically at or after the newest observation, we can early return\n if (lte(time, beforeOrAt.blockTimestamp, target)) {\n if (beforeOrAt.blockTimestamp == target) {\n // if newest observation equals target, we're in the same block, so we can ignore atOrAfter\n return (beforeOrAt, atOrAfter);\n } else {\n // otherwise, we need to transform\n return (beforeOrAt, transform(beforeOrAt, target, tick, liquidity));\n }\n }\n\n // now, set before to the oldest observation\n beforeOrAt = self[(index + 1) % cardinality];\n if (!beforeOrAt.initialized) beforeOrAt = self[0];\n\n // ensure that the target is chronologically at or after the oldest observation\n require(lte(time, beforeOrAt.blockTimestamp, target), 'OLD');\n\n // if we've reached this point, we have to binary search\n return binarySearch(self, time, target, index, cardinality);\n }\n\n /// @dev Reverts if an observation at or before the desired observation timestamp does not exist.\n /// 0 may be passed as `secondsAgo' to return the current cumulative values.\n /// If called with a timestamp falling between two observations, returns the counterfactual accumulator values\n /// at exactly the timestamp between the two observations.\n /// @param self The stored oracle array\n /// @param time The current block timestamp\n /// @param secondsAgo The amount of time to look back, in seconds, at which point to return an observation\n /// @param tick The current tick\n /// @param index The index of the observation that was most recently written to the observations array\n /// @param liquidity The current in-range pool liquidity\n /// @param cardinality The number of populated elements in the oracle array\n /// @return tickCumulative The tick * time elapsed since the pool was first initialized, as of `secondsAgo`\n /// @return secondsPerLiquidityCumulativeX128 The time elapsed / max(1, liquidity) since the pool was first initialized, as of `secondsAgo`\n function observeSingle(\n Observation[65535] storage self,\n uint32 time,\n uint32 secondsAgo,\n int24 tick,\n uint16 index,\n uint128 liquidity,\n uint16 cardinality\n ) internal view returns (int56 tickCumulative, uint160 secondsPerLiquidityCumulativeX128) {\n if (secondsAgo == 0) {\n Observation memory last = self[index];\n if (last.blockTimestamp != time) last = transform(last, time, tick, liquidity);\n return (last.tickCumulative, last.secondsPerLiquidityCumulativeX128);\n }\n\n uint32 target = time - secondsAgo;\n\n (Observation memory beforeOrAt, Observation memory atOrAfter) = getSurroundingObservations(\n self,\n time,\n target,\n tick,\n index,\n liquidity,\n cardinality\n );\n\n if (target == beforeOrAt.blockTimestamp) {\n // we're at the left boundary\n return (beforeOrAt.tickCumulative, beforeOrAt.secondsPerLiquidityCumulativeX128);\n } else if (target == atOrAfter.blockTimestamp) {\n // we're at the right boundary\n return (atOrAfter.tickCumulative, atOrAfter.secondsPerLiquidityCumulativeX128);\n } else {\n // we're in the middle\n uint32 observationTimeDelta = atOrAfter.blockTimestamp - beforeOrAt.blockTimestamp;\n uint32 targetDelta = target - beforeOrAt.blockTimestamp;\n return (\n beforeOrAt.tickCumulative +\n ((atOrAfter.tickCumulative - beforeOrAt.tickCumulative) / observationTimeDelta) *\n targetDelta,\n beforeOrAt.secondsPerLiquidityCumulativeX128 +\n uint160(\n (uint256(\n atOrAfter.secondsPerLiquidityCumulativeX128 - beforeOrAt.secondsPerLiquidityCumulativeX128\n ) * targetDelta) / observationTimeDelta\n )\n );\n }\n }\n\n /// @notice Returns the accumulator values as of each time seconds ago from the given time in the array of `secondsAgos`\n /// @dev Reverts if `secondsAgos` > oldest observation\n /// @param self The stored oracle array\n /// @param time The current block.timestamp\n /// @param secondsAgos Each amount of time to look back, in seconds, at which point to return an observation\n /// @param tick The current tick\n /// @param index The index of the observation that was most recently written to the observations array\n /// @param liquidity The current in-range pool liquidity\n /// @param cardinality The number of populated elements in the oracle array\n /// @return tickCumulatives The tick * time elapsed since the pool was first initialized, as of each `secondsAgo`\n /// @return secondsPerLiquidityCumulativeX128s The cumulative seconds / max(1, liquidity) since the pool was first initialized, as of each `secondsAgo`\n function observe(\n Observation[65535] storage self,\n uint32 time,\n uint32[] memory secondsAgos,\n int24 tick,\n uint16 index,\n uint128 liquidity,\n uint16 cardinality\n ) internal view returns (int56[] memory tickCumulatives, uint160[] memory secondsPerLiquidityCumulativeX128s) {\n require(cardinality > 0, 'I');\n\n tickCumulatives = new int56[](secondsAgos.length);\n secondsPerLiquidityCumulativeX128s = new uint160[](secondsAgos.length);\n for (uint256 i = 0; i < secondsAgos.length; i++) {\n (tickCumulatives[i], secondsPerLiquidityCumulativeX128s[i]) = observeSingle(\n self,\n time,\n secondsAgos[i],\n tick,\n index,\n liquidity,\n cardinality\n );\n }\n }\n}\n"
}
},
"settings": {
"evmVersion": "istanbul",
"optimizer": {
"enabled": true,
"runs": 1000000
},
"metadata": {
"bytecodeHash": "none"
},
"outputSelection": {
"*": {
"*": [
"abi",
"evm.bytecode",
"evm.deployedBytecode",
"evm.methodIdentifiers",
"metadata"
],
"": [
"ast"
]
}
}
}
},
"output": {
"contracts": {
"@airdao/astra-cl-core/contracts/libraries/Oracle.sol": {
"Oracle": {
"abi": [],
"evm": {
"bytecode": {
"generatedSources": [],
"linkReferences": {},
"object": "602d6023600b82828239805160001a607314601657fe5b30600052607381538281f3fe73000000000000000000000000000000000000000030146080604052600080fdfea164736f6c6343000706000a",
"opcodes": "PUSH1 0x2D PUSH1 0x23 PUSH1 0xB DUP3 DUP3 DUP3 CODECOPY DUP1 MLOAD PUSH1 0x0 BYTE PUSH1 0x73 EQ PUSH1 0x16 JUMPI INVALID JUMPDEST ADDRESS PUSH1 0x0 MSTORE PUSH1 0x73 DUP2 MSTORE8 DUP3 DUP2 RETURN INVALID PUSH20 0x0 ADDRESS EQ PUSH1 0x80 PUSH1 0x40 MSTORE PUSH1 0x0 DUP1 REVERT INVALID LOG1 PUSH5 0x736F6C6343 STOP SMOD MOD STOP EXP ",
"sourceMap": "683:15759:0:-:0;;;;;;;;;;;;;;;;;;;;;;;;;"
},
"deployedBytecode": {
"generatedSources": [],
"immutableReferences": {},
"linkReferences": {},
"object": "73000000000000000000000000000000000000000030146080604052600080fdfea164736f6c6343000706000a",
"opcodes": "PUSH20 0x0 ADDRESS EQ PUSH1 0x80 PUSH1 0x40 MSTORE PUSH1 0x0 DUP1 REVERT INVALID LOG1 PUSH5 0x736F6C6343 STOP SMOD MOD STOP EXP ",
"sourceMap": "683:15759:0:-:0;;;;;;;;"
},
"methodIdentifiers": {}
},
"metadata": "{\"compiler\":{\"version\":\"0.7.6+commit.7338295f\"},\"language\":\"Solidity\",\"output\":{\"abi\":[],\"devdoc\":{\"details\":\"Instances of stored oracle data, \\\"observations\\\", are collected in the oracle array Every pool is initialized with an oracle array length of 1. Anyone can pay the SSTOREs to increase the maximum length of the oracle array. New slots will be added when the array is fully populated. Observations are overwritten when the full length of the oracle array is populated. The most recent observation is available, independent of the length of the oracle array, by passing 0 to observe()\",\"kind\":\"dev\",\"methods\":{},\"title\":\"Oracle\",\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{},\"notice\":\"Provides price and liquidity data useful for a wide variety of system designs\",\"version\":1}},\"settings\":{\"compilationTarget\":{\"@airdao/astra-cl-core/contracts/libraries/Oracle.sol\":\"Oracle\"},\"evmVersion\":\"istanbul\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"none\"},\"optimizer\":{\"enabled\":true,\"runs\":1000000},\"remappings\":[]},\"sources\":{\"@airdao/astra-cl-core/contracts/libraries/Oracle.sol\":{\"keccak256\":\"0xf15b26d5b4229bee5de2462bb1a955e62275fe7739568aae392cbea910ce939c\",\"license\":\"BUSL-1.1\",\"urls\":[\"bzz-raw://aaea6a6dcf63e757263bf6f836671d928af7dae68251afab58380c4b8723949c\",\"dweb:/ipfs/QmSHnihjgUkmwKczcyuDNGjTzS65pmnQnjBjPXBXQpv6JF\"]}},\"version\":1}"
}
},
"contracts/test/MockObservations.sol": {
"MockObservations": {
"abi": [
{
"inputs": [
{
"internalType": "uint32[3]",
"name": "blockTimestamps",
"type": "uint32[3]"
},
{
"internalType": "int24[3]",
"name": "ticks",
"type": "int24[3]"
},
{
"internalType": "bool",
"name": "mockLowObservationCardinality",
"type": "bool"
}
],
"stateMutability": "nonpayable",
"type": "constructor"
},
{
"inputs": [
{
"internalType": "uint256",
"name": "",
"type": "uint256"
}
],
"name": "observations",
"outputs": [
{
"internalType": "uint32",
"name": "blockTimestamp",
"type": "uint32"
},
{
"internalType": "int56",
"name": "tickCumulative",
"type": "int56"
},
{
"internalType": "uint160",
"name": "secondsPerLiquidityCumulativeX128",
"type": "uint160"
},
{
"internalType": "bool",
"name": "initialized",
"type": "bool"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{
"internalType": "uint32[]",
"name": "secondsAgos",
"type": "uint32[]"
}
],
"name": "observe",
"outputs": [
{
"internalType": "int56[]",
"name": "tickCumulatives",
"type": "int56[]"
},
{
"internalType": "uint160[]",
"name": "secondsPerLiquidityCumulativeX128s",
"type": "uint160[]"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "slot0",
"outputs": [
{
"internalType": "uint160",
"name": "",
"type": "uint160"
},
{
"internalType": "int24",
"name": "",
"type": "int24"
},
{
"internalType": "uint16",
"name": "",
"type": "uint16"
},
{
"internalType": "uint16",
"name": "",
"type": "uint16"
},
{
"internalType": "uint16",
"name": "",
"type": "uint16"
},
{
"internalType": "uint8",
"name": "",
"type": "uint8"
},
{
"internalType": "bool",
"name": "",
"type": "bool"
}
],
"stateMutability": "view",
"type": "function"
}
],
"evm": {
"bytecode": {
"generatedSources": [],
"linkReferences": {},
"object": "608060405234801561001057600080fd5b50604051611015380380611015833981810160405260e081101561003357600080fd5b5060c0810151815160608301919063ffffffff161561007d576040805162461bcd60e51b81526020600482015260016024820152600360fc1b604482015290519081900360640190fd5b602083015163ffffffff166100bd576040805162461bcd60e51b81526020600482015260016024820152603160f81b604482015290519081900360640190fd5b6020830151604084015163ffffffff918216911611610107576040805162461bcd60e51b81526020600482015260016024820152601960f91b604482015290519081900360640190fd5b6000805b600381101561026157801561016f57600084600183036003811061012b57fe5b60200201519050600086600184036003811061014357fe5b602002015187846003811061015457fe5b60200201510390508063ffffffff168260020b028401935050505b604051806080016040528086836003811061018657fe5b602002015163ffffffff1681526020018360060b8152602001826001600160a01b031681526020016001151581525060018261ffff81106101c357fe5b825191018054602084015160408501516060909501511515600160f81b026001600160f81b036001600160a01b039096166b01000000000000000000000002600160581b600160f81b031960069390930b66ffffffffffffff166401000000000266ffffffffffffff60201b1963ffffffff90971663ffffffff1990951694909417959095169290921716929092179290921617905560010161010b565b5060408301516000805460029290920b62ffffff1662ffffff1990921691909117905581610290576003610293565b60015b6000805464ffff000000191660ff929092166301000000029190911761ffff60281b191665020000000000178155610d3f94508493506102d692509050396000f3fe608060405234801561001057600080fd5b50600436106100415760003560e01c8063252c09d7146100465780633850c7bd146100aa578063883bdbfd14610110575b600080fd5b6100636004803603602081101561005c57600080fd5b5035610219565b6040805163ffffffff909516855260069390930b602085015273ffffffffffffffffffffffffffffffffffffffff9091168383015215156060830152519081900360800190f35b6100b2610290565b6040805173ffffffffffffffffffffffffffffffffffffffff909816885260029690960b602088015261ffff9485168787015292841660608701529216608085015260ff90911660a0840152151560c0830152519081900360e00190f35b6101806004803603602081101561012657600080fd5b81019060208101813564010000000081111561014157600080fd5b82018360208201111561015357600080fd5b8035906020019184602083028401116401000000008311171561017557600080fd5b5090925090506102bc565b604051808060200180602001838103835285818151815260200191508051906020019060200280838360005b838110156101c45781810151838201526020016101ac565b50505050905001838103825284818151815260200191508051906020019060200280838360005b838110156102035781810151838201526020016101eb565b5050505090500194505050505060405180910390f35b60018161ffff811061022a57600080fd5b015463ffffffff81169150640100000000810460060b906b010000000000000000000000810473ffffffffffffffffffffffffffffffffffffffff16907f0100000000000000000000000000000000000000000000000000000000000000900460ff1684565b60008054600281900b9061ffff6501000000000082048116916301000000900416838080919293949596565b60608061032b600160020154604080516020808802828101820190935287825263ffffffff90931692909188918891829185019084908082843760009201829052508054600196959450600281900b935061ffff65010000000000820481169350630100000090910416610336565b915091509250929050565b60608060008361ffff16116103ac57604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600160248201527f4900000000000000000000000000000000000000000000000000000000000000604482015290519081900360640190fd5b865167ffffffffffffffff811180156103c457600080fd5b506040519080825280602002602001820160405280156103ee578160200160208202803683370190505b509150865167ffffffffffffffff8111801561040957600080fd5b50604051908082528060200260200182016040528015610433578160200160208202803683370190505b50905060005b87518110156104d3576104648a8a8a848151811061045357fe5b60200260200101518a8a8a8a6104e0565b84838151811061047057fe5b6020026020010184848151811061048357fe5b602002602001018273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152508260060b60060b81525050508080600101915050610439565b5097509795505050505050565b60008063ffffffff87166105b8576000898661ffff1661ffff811061050157fe5b60408051608081018252919092015463ffffffff8082168084526401000000008304600690810b810b900b60208501526b010000000000000000000000830473ffffffffffffffffffffffffffffffffffffffff16948401949094527f010000000000000000000000000000000000000000000000000000000000000090910460ff16151560608301529092508a16146105a4576105a1818a89886106b1565b90505b8060200151816040015192509250506106a5565b8688036000806105cd8c8c858c8c8c8c610780565b91509150816000015163ffffffff168363ffffffff1614156105ff5781602001518260400151945094505050506106a5565b805163ffffffff848116911614156106275780602001518160400151945094505050506106a5565b8151815160208085015190840151918390039286039163ffffffff80841692908516910360060b8161065557fe5b05028460200151018263ffffffff168263ffffffff16866040015186604001510373ffffffffffffffffffffffffffffffffffffffff16028161069457fe5b048560400151019650965050505050505b97509795505050505050565b6106b9610d0b565b600085600001518503905060405180608001604052808663ffffffff1681526020018263ffffffff168660020b0288602001510160060b81526020016000856fffffffffffffffffffffffffffffffff1611610716576001610718565b845b6fffffffffffffffffffffffffffffffff1673ffffffff00000000000000000000000000000000608085901b168161074c57fe5b0488604001510173ffffffffffffffffffffffffffffffffffffffff16815260200160011515815250915050949350505050565b610788610d0b565b610790610d0b565b888561ffff1661ffff81106107a157fe5b60408051608081018252919092015463ffffffff81168083526401000000008204600690810b810b900b60208401526b010000000000000000000000820473ffffffffffffffffffffffffffffffffffffffff16938301939093527f0100000000000000000000000000000000000000000000000000000000000000900460ff1615156060820152925061083790899089610a44565b1561086f578663ffffffff16826000015163ffffffff161415610859576106a5565b81610866838989886106b1565b915091506106a5565b888361ffff168660010161ffff168161088457fe5b0661ffff1661ffff811061089457fe5b60408051608081018252929091015463ffffffff811683526401000000008104600690810b810b900b602084015273ffffffffffffffffffffffffffffffffffffffff6b0100000000000000000000008204169183019190915260ff7f0100000000000000000000000000000000000000000000000000000000000000909104161515606082018190529092506109ad57604080516080810182528a5463ffffffff811682526401000000008104600690810b810b900b60208301526b010000000000000000000000810473ffffffffffffffffffffffffffffffffffffffff16928201929092527f010000000000000000000000000000000000000000000000000000000000000090910460ff161515606082015291505b6109bc88836000015189610a44565b610a2757604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600360248201527f4f4c440000000000000000000000000000000000000000000000000000000000604482015290519081900360640190fd5b610a348989898887610b09565b9150915097509795505050505050565b60008363ffffffff168363ffffffff1611158015610a6e57508363ffffffff168263ffffffff1611155b15610a8a578163ffffffff168363ffffffff1611159050610b02565b60008463ffffffff168463ffffffff1611610ab2578363ffffffff1664010000000001610aba565b8363ffffffff165b64ffffffffff16905060008563ffffffff168463ffffffff1611610aeb578363ffffffff1664010000000001610af3565b8363ffffffff165b64ffffffffff16909111159150505b9392505050565b610b11610d0b565b610b19610d0b565b60008361ffff168560010161ffff1681610b2f57fe5b0661ffff169050600060018561ffff16830103905060005b506002818301048961ffff87168281610b5c57fe5b0661ffff8110610b6857fe5b60408051608081018252929091015463ffffffff811683526401000000008104600690810b810b900b602084015273ffffffffffffffffffffffffffffffffffffffff6b0100000000000000000000008204169183019190915260ff7f010000000000000000000000000000000000000000000000000000000000000090910416151560608201819052909550610c0457806001019250610b47565b898661ffff168260010181610c1557fe5b0661ffff8110610c2157fe5b60408051608081018252929091015463ffffffff811683526401000000008104600690810b810b900b602084015273ffffffffffffffffffffffffffffffffffffffff6b0100000000000000000000008204169183019190915260ff7f010000000000000000000000000000000000000000000000000000000000000090910416151560608201528551909450600090610cbd908b908b610a44565b9050808015610cd65750610cd68a8a8760000151610a44565b15610ce15750610cfe565b80610cf157600182039250610cf8565b8160010193505b50610b47565b5050509550959350505050565b6040805160808101825260008082526020820181905291810182905260608101919091529056fea164736f6c6343000706000a",
"opcodes": "PUSH1 0x80 PUSH1 0x40 MSTORE CALLVALUE DUP1 ISZERO PUSH2 0x10 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH1 0x40 MLOAD PUSH2 0x1015 CODESIZE SUB DUP1 PUSH2 0x1015 DUP4 CODECOPY DUP2 DUP2 ADD PUSH1 0x40 MSTORE PUSH1 0xE0 DUP2 LT ISZERO PUSH2 0x33 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH1 0xC0 DUP2 ADD MLOAD DUP2 MLOAD PUSH1 0x60 DUP4 ADD SWAP2 SWAP1 PUSH4 0xFFFFFFFF AND ISZERO PUSH2 0x7D JUMPI PUSH1 0x40 DUP1 MLOAD PUSH3 0x461BCD PUSH1 0xE5 SHL DUP2 MSTORE PUSH1 0x20 PUSH1 0x4 DUP3 ADD MSTORE PUSH1 0x1 PUSH1 0x24 DUP3 ADD MSTORE PUSH1 0x3 PUSH1 0xFC SHL PUSH1 0x44 DUP3 ADD MSTORE SWAP1 MLOAD SWAP1 DUP2 SWAP1 SUB PUSH1 0x64 ADD SWAP1 REVERT JUMPDEST PUSH1 0x20 DUP4 ADD MLOAD PUSH4 0xFFFFFFFF AND PUSH2 0xBD JUMPI PUSH1 0x40 DUP1 MLOAD PUSH3 0x461BCD PUSH1 0xE5 SHL DUP2 MSTORE PUSH1 0x20 PUSH1 0x4 DUP3 ADD MSTORE PUSH1 0x1 PUSH1 0x24 DUP3 ADD MSTORE PUSH1 0x31 PUSH1 0xF8 SHL PUSH1 0x44 DUP3 ADD MSTORE SWAP1 MLOAD SWAP1 DUP2 SWAP1 SUB PUSH1 0x64 ADD SWAP1 REVERT JUMPDEST PUSH1 0x20 DUP4 ADD MLOAD PUSH1 0x40 DUP5 ADD MLOAD PUSH4 0xFFFFFFFF SWAP2 DUP3 AND SWAP2 AND GT PUSH2 0x107 JUMPI PUSH1 0x40 DUP1 MLOAD PUSH3 0x461BCD PUSH1 0xE5 SHL DUP2 MSTORE PUSH1 0x20 PUSH1 0x4 DUP3 ADD MSTORE PUSH1 0x1 PUSH1 0x24 DUP3 ADD MSTORE PUSH1 0x19 PUSH1 0xF9 SHL PUSH1 0x44 DUP3 ADD MSTORE SWAP1 MLOAD SWAP1 DUP2 SWAP1 SUB PUSH1 0x64 ADD SWAP1 REVERT JUMPDEST PUSH1 0x0 DUP1 JUMPDEST PUSH1 0x3 DUP2 LT ISZERO PUSH2 0x261 JUMPI DUP1 ISZERO PUSH2 0x16F JUMPI PUSH1 0x0 DUP5 PUSH1 0x1 DUP4 SUB PUSH1 0x3 DUP2 LT PUSH2 0x12B JUMPI INVALID JUMPDEST PUSH1 0x20 MUL ADD MLOAD SWAP1 POP PUSH1 0x0 DUP7 PUSH1 0x1 DUP5 SUB PUSH1 0x3 DUP2 LT PUSH2 0x143 JUMPI INVALID JUMPDEST PUSH1 0x20 MUL ADD MLOAD DUP8 DUP5 PUSH1 0x3 DUP2 LT PUSH2 0x154 JUMPI INVALID JUMPDEST PUSH1 0x20 MUL ADD MLOAD SUB SWAP1 POP DUP1 PUSH4 0xFFFFFFFF AND DUP3 PUSH1 0x2 SIGNEXTEND MUL DUP5 ADD SWAP4 POP POP POP JUMPDEST PUSH1 0x40 MLOAD DUP1 PUSH1 0x80 ADD PUSH1 0x40 MSTORE DUP1 DUP7 DUP4 PUSH1 0x3 DUP2 LT PUSH2 0x186 JUMPI INVALID JUMPDEST PUSH1 0x20 MUL ADD MLOAD PUSH4 0xFFFFFFFF AND DUP2 MSTORE PUSH1 0x20 ADD DUP4 PUSH1 0x6 SIGNEXTEND DUP2 MSTORE PUSH1 0x20 ADD DUP3 PUSH1 0x1 PUSH1 0x1 PUSH1 0xA0 SHL SUB AND DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x1 ISZERO ISZERO DUP2 MSTORE POP PUSH1 0x1 DUP3 PUSH2 0xFFFF DUP2 LT PUSH2 0x1C3 JUMPI INVALID JUMPDEST DUP3 MLOAD SWAP2 ADD DUP1 SLOAD PUSH1 0x20 DUP5 ADD MLOAD PUSH1 0x40 DUP6 ADD MLOAD PUSH1 0x60 SWAP1 SWAP6 ADD MLOAD ISZERO ISZERO PUSH1 0x1 PUSH1 0xF8 SHL MUL PUSH1 0x1 PUSH1 0x1 PUSH1 0xF8 SHL SUB PUSH1 0x1 PUSH1 0x1 PUSH1 0xA0 SHL SUB SWAP1 SWAP7 AND PUSH12 0x10000000000000000000000 MUL PUSH1 0x1 PUSH1 0x58 SHL PUSH1 0x1 PUSH1 0xF8 SHL SUB NOT PUSH1 0x6 SWAP4 SWAP1 SWAP4 SIGNEXTEND PUSH7 0xFFFFFFFFFFFFFF AND PUSH5 0x100000000 MUL PUSH7 0xFFFFFFFFFFFFFF PUSH1 0x20 SHL NOT PUSH4 0xFFFFFFFF SWAP1 SWAP8 AND PUSH4 0xFFFFFFFF NOT SWAP1 SWAP6 AND SWAP5 SWAP1 SWAP5 OR SWAP6 SWAP1 SWAP6 AND SWAP3 SWAP1 SWAP3 OR AND SWAP3 SWAP1 SWAP3 OR SWAP3 SWAP1 SWAP3 AND OR SWAP1 SSTORE PUSH1 0x1 ADD PUSH2 0x10B JUMP JUMPDEST POP PUSH1 0x40 DUP4 ADD MLOAD PUSH1 0x0 DUP1 SLOAD PUSH1 0x2 SWAP3 SWAP1 SWAP3 SIGNEXTEND PUSH3 0xFFFFFF AND PUSH3 0xFFFFFF NOT SWAP1 SWAP3 AND SWAP2 SWAP1 SWAP2 OR SWAP1 SSTORE DUP2 PUSH2 0x290 JUMPI PUSH1 0x3 PUSH2 0x293 JUMP JUMPDEST PUSH1 0x1 JUMPDEST PUSH1 0x0 DUP1 SLOAD PUSH5 0xFFFF000000 NOT AND PUSH1 0xFF SWAP3 SWAP1 SWAP3 AND PUSH4 0x1000000 MUL SWAP2 SWAP1 SWAP2 OR PUSH2 0xFFFF PUSH1 0x28 SHL NOT AND PUSH6 0x20000000000 OR DUP2 SSTORE PUSH2 0xD3F SWAP5 POP DUP5 SWAP4 POP PUSH2 0x2D6 SWAP3 POP SWAP1 POP CODECOPY PUSH1 0x0 RETURN INVALID PUSH1 0x80 PUSH1 0x40 MSTORE CALLVALUE DUP1 ISZERO PUSH2 0x10 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH1 0x4 CALLDATASIZE LT PUSH2 0x41 JUMPI PUSH1 0x0 CALLDATALOAD PUSH1 0xE0 SHR DUP1 PUSH4 0x252C09D7 EQ PUSH2 0x46 JUMPI DUP1 PUSH4 0x3850C7BD EQ PUSH2 0xAA JUMPI DUP1 PUSH4 0x883BDBFD EQ PUSH2 0x110 JUMPI JUMPDEST PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH2 0x63 PUSH1 0x4 DUP1 CALLDATASIZE SUB PUSH1 0x20 DUP2 LT ISZERO PUSH2 0x5C JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP CALLDATALOAD PUSH2 0x219 JUMP JUMPDEST PUSH1 0x40 DUP1 MLOAD PUSH4 0xFFFFFFFF SWAP1 SWAP6 AND DUP6 MSTORE PUSH1 0x6 SWAP4 SWAP1 SWAP4 SIGNEXTEND PUSH1 0x20 DUP6 ADD MSTORE PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF SWAP1 SWAP2 AND DUP4 DUP4 ADD MSTORE ISZERO ISZERO PUSH1 0x60 DUP4 ADD MSTORE MLOAD SWAP1 DUP2 SWAP1 SUB PUSH1 0x80 ADD SWAP1 RETURN JUMPDEST PUSH2 0xB2 PUSH2 0x290 JUMP JUMPDEST PUSH1 0x40 DUP1 MLOAD PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF SWAP1 SWAP9 AND DUP9 MSTORE PUSH1 0x2 SWAP7 SWAP1 SWAP7 SIGNEXTEND PUSH1 0x20 DUP9 ADD MSTORE PUSH2 0xFFFF SWAP5 DUP6 AND DUP8 DUP8 ADD MSTORE SWAP3 DUP5 AND PUSH1 0x60 DUP8 ADD MSTORE SWAP3 AND PUSH1 0x80 DUP6 ADD MSTORE PUSH1 0xFF SWAP1 SWAP2 AND PUSH1 0xA0 DUP5 ADD MSTORE ISZERO ISZERO PUSH1 0xC0 DUP4 ADD MSTORE MLOAD SWAP1 DUP2 SWAP1 SUB PUSH1 0xE0 ADD SWAP1 RETURN JUMPDEST PUSH2 0x180 PUSH1 0x4 DUP1 CALLDATASIZE SUB PUSH1 0x20 DUP2 LT ISZERO PUSH2 0x126 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST DUP2 ADD SWAP1 PUSH1 0x20 DUP2 ADD DUP2 CALLDATALOAD PUSH5 0x100000000 DUP2 GT ISZERO PUSH2 0x141 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST DUP3 ADD DUP4 PUSH1 0x20 DUP3 ADD GT ISZERO PUSH2 0x153 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST DUP1 CALLDATALOAD SWAP1 PUSH1 0x20 ADD SWAP2 DUP5 PUSH1 0x20 DUP4 MUL DUP5 ADD GT PUSH5 0x100000000 DUP4 GT OR ISZERO PUSH2 0x175 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP SWAP1 SWAP3 POP SWAP1 POP PUSH2 0x2BC JUMP JUMPDEST PUSH1 0x40 MLOAD DUP1 DUP1 PUSH1 0x20 ADD DUP1 PUSH1 0x20 ADD DUP4 DUP2 SUB DUP4 MSTORE DUP6 DUP2 DUP2 MLOAD DUP2 MSTORE PUSH1 0x20 ADD SWAP2 POP DUP1 MLOAD SWAP1 PUSH1 0x20 ADD SWAP1 PUSH1 0x20 MUL DUP1 DUP4 DUP4 PUSH1 0x0 JUMPDEST DUP4 DUP2 LT ISZERO PUSH2 0x1C4 JUMPI DUP2 DUP2 ADD MLOAD DUP4 DUP3 ADD MSTORE PUSH1 0x20 ADD PUSH2 0x1AC JUMP JUMPDEST POP POP POP POP SWAP1 POP ADD DUP4 DUP2 SUB DUP3 MSTORE DUP5 DUP2 DUP2 MLOAD DUP2 MSTORE PUSH1 0x20 ADD SWAP2 POP DUP1 MLOAD SWAP1 PUSH1 0x20 ADD SWAP1 PUSH1 0x20 MUL DUP1 DUP4 DUP4 PUSH1 0x0 JUMPDEST DUP4 DUP2 LT ISZERO PUSH2 0x203 JUMPI DUP2 DUP2 ADD MLOAD DUP4 DUP3 ADD MSTORE PUSH1 0x20 ADD PUSH2 0x1EB JUMP JUMPDEST POP POP POP POP SWAP1 POP ADD SWAP5 POP POP POP POP POP PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 RETURN JUMPDEST PUSH1 0x1 DUP2 PUSH2 0xFFFF DUP2 LT PUSH2 0x22A JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST ADD SLOAD PUSH4 0xFFFFFFFF DUP2 AND SWAP2 POP PUSH5 0x100000000 DUP2 DIV PUSH1 0x6 SIGNEXTEND SWAP1 PUSH12 0x10000000000000000000000 DUP2 DIV PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND SWAP1 PUSH32 0x100000000000000000000000000000000000000000000000000000000000000 SWAP1 DIV PUSH1 0xFF AND DUP5 JUMP JUMPDEST PUSH1 0x0 DUP1 SLOAD PUSH1 0x2 DUP2 SWAP1 SIGNEXTEND SWAP1 PUSH2 0xFFFF PUSH6 0x10000000000 DUP3 DIV DUP2 AND SWAP2 PUSH4 0x1000000 SWAP1 DIV AND DUP4 DUP1 DUP1 SWAP2 SWAP3 SWAP4 SWAP5 SWAP6 SWAP7 JUMP JUMPDEST PUSH1 0x60 DUP1 PUSH2 0x32B PUSH1 0x1 PUSH1 0x2 ADD SLOAD PUSH1 0x40 DUP1 MLOAD PUSH1 0x20 DUP1 DUP9 MUL DUP3 DUP2 ADD DUP3 ADD SWAP1 SWAP4 MSTORE DUP8 DUP3 MSTORE PUSH4 0xFFFFFFFF SWAP1 SWAP4 AND SWAP3 SWAP1 SWAP2 DUP9 SWAP2 DUP9 SWAP2 DUP3 SWAP2 DUP6 ADD SWAP1 DUP5 SWAP1 DUP1 DUP3 DUP5 CALLDATACOPY PUSH1 0x0 SWAP3 ADD DUP3 SWAP1 MSTORE POP DUP1 SLOAD PUSH1 0x1 SWAP7 SWAP6 SWAP5 POP PUSH1 0x2 DUP2 SWAP1 SIGNEXTEND SWAP4 POP PUSH2 0xFFFF PUSH6 0x10000000000 DUP3 DIV DUP2 AND SWAP4 POP PUSH4 0x1000000 SWAP1 SWAP2 DIV AND PUSH2 0x336 JUMP JUMPDEST SWAP2 POP SWAP2 POP SWAP3 POP SWAP3 SWAP1 POP JUMP JUMPDEST PUSH1 0x60 DUP1 PUSH1 0x0 DUP4 PUSH2 0xFFFF AND GT PUSH2 0x3AC JUMPI PUSH1 0x40 DUP1 MLOAD PUSH32 0x8C379A000000000000000000000000000000000000000000000000000000000 DUP2 MSTORE PUSH1 0x20 PUSH1 0x4 DUP3 ADD MSTORE PUSH1 0x1 PUSH1 0x24 DUP3 ADD MSTORE PUSH32 0x4900000000000000000000000000000000000000000000000000000000000000 PUSH1 0x44 DUP3 ADD MSTORE SWAP1 MLOAD SWAP1 DUP2 SWAP1 SUB PUSH1 0x64 ADD SWAP1 REVERT JUMPDEST DUP7 MLOAD PUSH8 0xFFFFFFFFFFFFFFFF DUP2 GT DUP1 ISZERO PUSH2 0x3C4 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH1 0x40 MLOAD SWAP1 DUP1 DUP3 MSTORE DUP1 PUSH1 0x20 MUL PUSH1 0x20 ADD DUP3 ADD PUSH1 0x40 MSTORE DUP1 ISZERO PUSH2 0x3EE JUMPI DUP2 PUSH1 0x20 ADD PUSH1 0x20 DUP3 MUL DUP1 CALLDATASIZE DUP4 CALLDATACOPY ADD SWAP1 POP JUMPDEST POP SWAP2 POP DUP7 MLOAD PUSH8 0xFFFFFFFFFFFFFFFF DUP2 GT DUP1 ISZERO PUSH2 0x409 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH1 0x40 MLOAD SWAP1 DUP1 DUP3 MSTORE DUP1 PUSH1 0x20 MUL PUSH1 0x20 ADD DUP3 ADD PUSH1 0x40 MSTORE DUP1 ISZERO PUSH2 0x433 JUMPI DUP2 PUSH1 0x20 ADD PUSH1 0x20 DUP3 MUL DUP1 CALLDATASIZE DUP4 CALLDATACOPY ADD SWAP1 POP JUMPDEST POP SWAP1 POP PUSH1 0x0 JUMPDEST DUP8 MLOAD DUP2 LT ISZERO PUSH2 0x4D3 JUMPI PUSH2 0x464 DUP11 DUP11 DUP11 DUP5 DUP2 MLOAD DUP2 LT PUSH2 0x453 JUMPI INVALID JUMPDEST PUSH1 0x20 MUL PUSH1 0x20 ADD ADD MLOAD DUP11 DUP11 DUP11 DUP11 PUSH2 0x4E0 JUMP JUMPDEST DUP5 DUP4 DUP2 MLOAD DUP2 LT PUSH2 0x470 JUMPI INVALID JUMPDEST PUSH1 0x20 MUL PUSH1 0x20 ADD ADD DUP5 DUP5 DUP2 MLOAD DUP2 LT PUSH2 0x483 JUMPI INVALID JUMPDEST PUSH1 0x20 MUL PUSH1 0x20 ADD ADD DUP3 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP2 MSTORE POP DUP3 PUSH1 0x6 SIGNEXTEND PUSH1 0x6 SIGNEXTEND DUP2 MSTORE POP POP POP DUP1 DUP1 PUSH1 0x1 ADD SWAP2 POP POP PUSH2 0x439 JUMP JUMPDEST POP SWAP8 POP SWAP8 SWAP6 POP POP POP POP POP POP JUMP JUMPDEST PUSH1 0x0 DUP1 PUSH4 0xFFFFFFFF DUP8 AND PUSH2 0x5B8 JUMPI PUSH1 0x0 DUP10 DUP7 PUSH2 0xFFFF AND PUSH2 0xFFFF DUP2 LT PUSH2 0x501 JUMPI INVALID JUMPDEST PUSH1 0x40 DUP1 MLOAD PUSH1 0x80 DUP2 ADD DUP3 MSTORE SWAP2 SWAP1 SWAP3 ADD SLOAD PUSH4 0xFFFFFFFF DUP1 DUP3 AND DUP1 DUP5 MSTORE PUSH5 0x100000000 DUP4 DIV PUSH1 0x6 SWAP1 DUP2 SIGNEXTEND DUP2 SIGNEXTEND SWAP1 SIGNEXTEND PUSH1 0x20 DUP6 ADD MSTORE PUSH12 0x10000000000000000000000 DUP4 DIV PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND SWAP5 DUP5 ADD SWAP5 SWAP1 SWAP5 MSTORE PUSH32 0x100000000000000000000000000000000000000000000000000000000000000 SWAP1 SWAP2 DIV PUSH1 0xFF AND ISZERO ISZERO PUSH1 0x60 DUP4 ADD MSTORE SWAP1 SWAP3 POP DUP11 AND EQ PUSH2 0x5A4 JUMPI PUSH2 0x5A1 DUP2 DUP11 DUP10 DUP9 PUSH2 0x6B1 JUMP JUMPDEST SWAP1 POP JUMPDEST DUP1 PUSH1 0x20 ADD MLOAD DUP2 PUSH1 0x40 ADD MLOAD SWAP3 POP SWAP3 POP POP PUSH2 0x6A5 JUMP JUMPDEST DUP7 DUP9 SUB PUSH1 0x0 DUP1 PUSH2 0x5CD DUP13 DUP13 DUP6 DUP13 DUP13 DUP13 DUP13 PUSH2 0x780 JUMP JUMPDEST SWAP2 POP SWAP2 POP DUP2 PUSH1 0x0 ADD MLOAD PUSH4 0xFFFFFFFF AND DUP4 PUSH4 0xFFFFFFFF AND EQ ISZERO PUSH2 0x5FF JUMPI DUP2 PUSH1 0x20 ADD MLOAD DUP3 PUSH1 0x40 ADD MLOAD SWAP5 POP SWAP5 POP POP POP POP PUSH2 0x6A5 JUMP JUMPDEST DUP1 MLOAD PUSH4 0xFFFFFFFF DUP5 DUP2 AND SWAP2 AND EQ ISZERO PUSH2 0x627 JUMPI DUP1 PUSH1 0x20 ADD MLOAD DUP2 PUSH1 0x40 ADD MLOAD SWAP5 POP SWAP5 POP POP POP POP PUSH2 0x6A5 JUMP JUMPDEST DUP2 MLOAD DUP2 MLOAD PUSH1 0x20 DUP1 DUP6 ADD MLOAD SWAP1 DUP5 ADD MLOAD SWAP2 DUP4 SWAP1 SUB SWAP3 DUP7 SUB SWAP2 PUSH4 0xFFFFFFFF DUP1 DUP5 AND SWAP3 SWAP1 DUP6 AND SWAP2 SUB PUSH1 0x6 SIGNEXTEND DUP2 PUSH2 0x655 JUMPI INVALID JUMPDEST SDIV MUL DUP5 PUSH1 0x20 ADD MLOAD ADD DUP3 PUSH4 0xFFFFFFFF AND DUP3 PUSH4 0xFFFFFFFF AND DUP7 PUSH1 0x40 ADD MLOAD DUP7 PUSH1 0x40 ADD MLOAD SUB PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND MUL DUP2 PUSH2 0x694 JUMPI INVALID JUMPDEST DIV DUP6 PUSH1 0x40 ADD MLOAD ADD SWAP7 POP SWAP7 POP POP POP POP POP POP JUMPDEST SWAP8 POP SWAP8 SWAP6 POP POP POP POP POP POP JUMP JUMPDEST PUSH2 0x6B9 PUSH2 0xD0B JUMP JUMPDEST PUSH1 0x0 DUP6 PUSH1 0x0 ADD MLOAD DUP6 SUB SWAP1 POP PUSH1 0x40 MLOAD DUP1 PUSH1 0x80 ADD PUSH1 0x40 MSTORE DUP1 DUP7 PUSH4 0xFFFFFFFF AND DUP2 MSTORE PUSH1 0x20 ADD DUP3 PUSH4 0xFFFFFFFF AND DUP7 PUSH1 0x2 SIGNEXTEND MUL DUP9 PUSH1 0x20 ADD MLOAD ADD PUSH1 0x6 SIGNEXTEND DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x0 DUP6 PUSH16 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND GT PUSH2 0x716 JUMPI PUSH1 0x1 PUSH2 0x718 JUMP JUMPDEST DUP5 JUMPDEST PUSH16 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH20 0xFFFFFFFF00000000000000000000000000000000 PUSH1 0x80 DUP6 SWAP1 SHL AND DUP2 PUSH2 0x74C JUMPI INVALID JUMPDEST DIV DUP9 PUSH1 0x40 ADD MLOAD ADD PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x1 ISZERO ISZERO DUP2 MSTORE POP SWAP2 POP POP SWAP5 SWAP4 POP POP POP POP JUMP JUMPDEST PUSH2 0x788 PUSH2 0xD0B JUMP JUMPDEST PUSH2 0x790 PUSH2 0xD0B JUMP JUMPDEST DUP9 DUP6 PUSH2 0xFFFF AND PUSH2 0xFFFF DUP2 LT PUSH2 0x7A1 JUMPI INVALID JUMPDEST PUSH1 0x40 DUP1 MLOAD PUSH1 0x80 DUP2 ADD DUP3 MSTORE SWAP2 SWAP1 SWAP3 ADD SLOAD PUSH4 0xFFFFFFFF DUP2 AND DUP1 DUP4 MSTORE PUSH5 0x100000000 DUP3 DIV PUSH1 0x6 SWAP1 DUP2 SIGNEXTEND DUP2 SIGNEXTEND SWAP1 SIGNEXTEND PUSH1 0x20 DUP5 ADD MSTORE PUSH12 0x10000000000000000000000 DUP3 DIV PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND SWAP4 DUP4 ADD SWAP4 SWAP1 SWAP4 MSTORE PUSH32 0x100000000000000000000000000000000000000000000000000000000000000 SWAP1 DIV PUSH1 0xFF AND ISZERO ISZERO PUSH1 0x60 DUP3 ADD MSTORE SWAP3 POP PUSH2 0x837 SWAP1 DUP10 SWAP1 DUP10 PUSH2 0xA44 JUMP JUMPDEST ISZERO PUSH2 0x86F JUMPI DUP7 PUSH4 0xFFFFFFFF AND DUP3 PUSH1 0x0 ADD MLOAD PUSH4 0xFFFFFFFF AND EQ ISZERO PUSH2 0x859 JUMPI PUSH2 0x6A5 JUMP JUMPDEST DUP2 PUSH2 0x866 DUP4 DUP10 DUP10 DUP9 PUSH2 0x6B1 JUMP JUMPDEST SWAP2 POP SWAP2 POP PUSH2 0x6A5 JUMP JUMPDEST DUP9 DUP4 PUSH2 0xFFFF AND DUP7 PUSH1 0x1 ADD PUSH2 0xFFFF AND DUP2 PUSH2 0x884 JUMPI INVALID JUMPDEST MOD PUSH2 0xFFFF AND PUSH2 0xFFFF DUP2 LT PUSH2 0x894 JUMPI INVALID JUMPDEST PUSH1 0x40 DUP1 MLOAD PUSH1 0x80 DUP2 ADD DUP3 MSTORE SWAP3 SWAP1 SWAP2 ADD SLOAD PUSH4 0xFFFFFFFF DUP2 AND DUP4 MSTORE PUSH5 0x100000000 DUP2 DIV PUSH1 0x6 SWAP1 DUP2 SIGNEXTEND DUP2 SIGNEXTEND SWAP1 SIGNEXTEND PUSH1 0x20 DUP5 ADD MSTORE PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF PUSH12 0x10000000000000000000000 DUP3 DIV AND SWAP2 DUP4 ADD SWAP2 SWAP1 SWAP2 MSTORE PUSH1 0xFF PUSH32 0x100000000000000000000000000000000000000000000000000000000000000 SWAP1 SWAP2 DIV AND ISZERO ISZERO PUSH1 0x60 DUP3 ADD DUP2 SWAP1 MSTORE SWAP1 SWAP3 POP PUSH2 0x9AD JUMPI PUSH1 0x40 DUP1 MLOAD PUSH1 0x80 DUP2 ADD DUP3 MSTORE DUP11 SLOAD PUSH4 0xFFFFFFFF DUP2 AND DUP3 MSTORE PUSH5 0x100000000 DUP2 DIV PUSH1 0x6 SWAP1 DUP2 SIGNEXTEND DUP2 SIGNEXTEND SWAP1 SIGNEXTEND PUSH1 0x20 DUP4 ADD MSTORE PUSH12 0x10000000000000000000000 DUP2 DIV PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND SWAP3 DUP3 ADD SWAP3 SWAP1 SWAP3 MSTORE PUSH32 0x100000000000000000000000000000000000000000000000000000000000000 SWAP1 SWAP2 DIV PUSH1 0xFF AND ISZERO ISZERO PUSH1 0x60 DUP3 ADD MSTORE SWAP2 POP JUMPDEST PUSH2 0x9BC DUP9 DUP4 PUSH1 0x0 ADD MLOAD DUP10 PUSH2 0xA44 JUMP JUMPDEST PUSH2 0xA27 JUMPI PUSH1 0x40 DUP1 MLOAD PUSH32 0x8C379A000000000000000000000000000000000000000000000000000000000 DUP2 MSTORE PUSH1 0x20 PUSH1 0x4 DUP3 ADD MSTORE PUSH1 0x3 PUSH1 0x24 DUP3 ADD MSTORE PUSH32 0x4F4C440000000000000000000000000000000000000000000000000000000000 PUSH1 0x44 DUP3 ADD MSTORE SWAP1 MLOAD SWAP1 DUP2 SWAP1 SUB PUSH1 0x64 ADD SWAP1 REVERT JUMPDEST PUSH2 0xA34 DUP10 DUP10 DUP10 DUP9 DUP8 PUSH2 0xB09 JUMP JUMPDEST SWAP2 POP SWAP2 POP SWAP8 POP SWAP8 SWAP6 POP POP POP POP POP POP JUMP JUMPDEST PUSH1 0x0 DUP4 PUSH4 0xFFFFFFFF AND DUP4 PUSH4 0xFFFFFFFF AND GT ISZERO DUP1 ISZERO PUSH2 0xA6E JUMPI POP DUP4 PUSH4 0xFFFFFFFF AND DUP3 PUSH4 0xFFFFFFFF AND GT ISZERO JUMPDEST ISZERO PUSH2 0xA8A JUMPI DUP2 PUSH4 0xFFFFFFFF AND DUP4 PUSH4 0xFFFFFFFF AND GT ISZERO SWAP1 POP PUSH2 0xB02 JUMP JUMPDEST PUSH1 0x0 DUP5 PUSH4 0xFFFFFFFF AND DUP5 PUSH4 0xFFFFFFFF AND GT PUSH2 0xAB2 JUMPI DUP4 PUSH4 0xFFFFFFFF AND PUSH5 0x100000000 ADD PUSH2 0xABA JUMP JUMPDEST DUP4 PUSH4 0xFFFFFFFF AND JUMPDEST PUSH5 0xFFFFFFFFFF AND SWAP1 POP PUSH1 0x0 DUP6 PUSH4 0xFFFFFFFF AND DUP5 PUSH4 0xFFFFFFFF AND GT PUSH2 0xAEB JUMPI DUP4 PUSH4 0xFFFFFFFF AND PUSH5 0x100000000 ADD PUSH2 0xAF3 JUMP JUMPDEST DUP4 PUSH4 0xFFFFFFFF AND JUMPDEST PUSH5 0xFFFFFFFFFF AND SWAP1 SWAP2 GT ISZERO SWAP2 POP POP JUMPDEST SWAP4 SWAP3 POP POP POP JUMP JUMPDEST PUSH2 0xB11 PUSH2 0xD0B JUMP JUMPDEST PUSH2 0xB19 PUSH2 0xD0B JUMP JUMPDEST PUSH1 0x0 DUP4 PUSH2 0xFFFF AND DUP6 PUSH1 0x1 ADD PUSH2 0xFFFF AND DUP2 PUSH2 0xB2F JUMPI INVALID JUMPDEST MOD PUSH2 0xFFFF AND SWAP1 POP PUSH1 0x0 PUSH1 0x1 DUP6 PUSH2 0xFFFF AND DUP4 ADD SUB SWAP1 POP PUSH1 0x0 JUMPDEST POP PUSH1 0x2 DUP2 DUP4 ADD DIV DUP10 PUSH2 0xFFFF DUP8 AND DUP3 DUP2 PUSH2 0xB5C JUMPI INVALID JUMPDEST MOD PUSH2 0xFFFF DUP2 LT PUSH2 0xB68 JUMPI INVALID JUMPDEST PUSH1 0x40 DUP1 MLOAD PUSH1 0x80 DUP2 ADD DUP3 MSTORE SWAP3 SWAP1 SWAP2 ADD SLOAD PUSH4 0xFFFFFFFF DUP2 AND DUP4 MSTORE PUSH5 0x100000000 DUP2 DIV PUSH1 0x6 SWAP1 DUP2 SIGNEXTEND DUP2 SIGNEXTEND SWAP1 SIGNEXTEND PUSH1 0x20 DUP5 ADD MSTORE PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF PUSH12 0x10000000000000000000000 DUP3 DIV AND SWAP2 DUP4 ADD SWAP2 SWAP1 SWAP2 MSTORE PUSH1 0xFF PUSH32 0x100000000000000000000000000000000000000000000000000000000000000 SWAP1 SWAP2 DIV AND ISZERO ISZERO PUSH1 0x60 DUP3 ADD DUP2 SWAP1 MSTORE SWAP1 SWAP6 POP PUSH2 0xC04 JUMPI DUP1 PUSH1 0x1 ADD SWAP3 POP PUSH2 0xB47 JUMP JUMPDEST DUP10 DUP7 PUSH2 0xFFFF AND DUP3 PUSH1 0x1 ADD DUP2 PUSH2 0xC15 JUMPI INVALID JUMPDEST MOD PUSH2 0xFFFF DUP2 LT PUSH2 0xC21 JUMPI INVALID JUMPDEST PUSH1 0x40 DUP1 MLOAD PUSH1 0x80 DUP2 ADD DUP3 MSTORE SWAP3 SWAP1 SWAP2 ADD SLOAD PUSH4 0xFFFFFFFF DUP2 AND DUP4 MSTORE PUSH5 0x100000000 DUP2 DIV PUSH1 0x6 SWAP1 DUP2 SIGNEXTEND DUP2 SIGNEXTEND SWAP1 SIGNEXTEND PUSH1 0x20 DUP5 ADD MSTORE PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF PUSH12 0x10000000000000000000000 DUP3 DIV AND SWAP2 DUP4 ADD SWAP2 SWAP1 SWAP2 MSTORE PUSH1 0xFF PUSH32 0x100000000000000000000000000000000000000000000000000000000000000 SWAP1 SWAP2 DIV AND ISZERO ISZERO PUSH1 0x60 DUP3 ADD MSTORE DUP6 MLOAD SWAP1 SWAP5 POP PUSH1 0x0 SWAP1 PUSH2 0xCBD SWAP1 DUP12 SWAP1 DUP12 PUSH2 0xA44 JUMP JUMPDEST SWAP1 POP DUP1 DUP1 ISZERO PUSH2 0xCD6 JUMPI POP PUSH2 0xCD6 DUP11 DUP11 DUP8 PUSH1 0x0 ADD MLOAD PUSH2 0xA44 JUMP JUMPDEST ISZERO PUSH2 0xCE1 JUMPI POP PUSH2 0xCFE JUMP JUMPDEST DUP1 PUSH2 0xCF1 JUMPI PUSH1 0x1 DUP3 SUB SWAP3 POP PUSH2 0xCF8 JUMP JUMPDEST DUP2 PUSH1 0x1 ADD SWAP4 POP JUMPDEST POP PUSH2 0xB47 JUMP JUMPDEST POP POP POP SWAP6 POP SWAP6 SWAP4 POP POP POP POP JUMP JUMPDEST PUSH1 0x40 DUP1 MLOAD PUSH1 0x80 DUP2 ADD DUP3 MSTORE PUSH1 0x0 DUP1 DUP3 MSTORE PUSH1 0x20 DUP3 ADD DUP2 SWAP1 MSTORE SWAP2 DUP2 ADD DUP3 SWAP1 MSTORE PUSH1 0x60 DUP2 ADD SWAP2 SWAP1 SWAP2 MSTORE SWAP1 JUMP INVALID LOG1 PUSH5 0x736F6C6343 STOP SMOD MOD STOP EXP ",
"sourceMap": "128:2211:1:-:0;;;520:1026;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;520:1026:1;;;;673:18;;520:1026;;;;;673:23;;;665:37;;;;;-1:-1:-1;;;665:37:1;;;;;;;;;;;;-1:-1:-1;;;665:37:1;;;;;;;;;;;;;;;720:18;;;;:22;;712:36;;;;;-1:-1:-1;;;712:36:1;;;;;;;;;;;;-1:-1:-1;;;712:36:1;;;;;;;;;;;;;;;787:18;;;;766;;;;:39;;;;;;;758:53;;;;;-1:-1:-1;;;758:53:1;;;;;;;;;;;;-1:-1:-1;;;758:53:1;;;;;;;;;;;;;;;822:20;861:9;856:542;880:22;876:1;:26;856:542;;;927:6;;923:201;;953:10;966:5;976:1;972;:5;966:12;;;;;;;;;;;953:25;;996:12;1032:15;1052:1;1048;:5;1032:22;;;;;;;;;;;1011:15;1027:1;1011:18;;;;;;;;;;;:43;996:58;;1104:5;1090:19;;1096:4;1090:11;;:19;1072:37;;;;923:201;;;1155:232;;;;;;;;1208:15;1224:1;1208:18;;;;;;;;;;;1155:232;;;;;;1260:14;1155:232;;;;;;1335:1;-1:-1:-1;;;;;1155:232:1;;;;;1368:4;1155:232;;;;;1137:12;1150:1;1137:15;;;;;;;:250;;:15;;:250;;;;;;;;;;;;;;;;;-1:-1:-1;;;1137:250:1;-1:-1:-1;;;;;;;;;;1137:250:1;;;;;-1:-1:-1;;;;;;;;1137:250:1;;;;;;;;;-1:-1:-1;;;;1137:250:1;;;;-1:-1:-1;;1137:250:1;;;;;;;;;;;;;;;;;;;;;;;;;;;;904:3;856:542;;;-1:-1:-1;1419:8:1;;;;1407:9;:20;;1425:1;1407:20;;;;;;-1:-1:-1;;1407:20:1;;;;;;;;;1467:29;:37;;1503:1;1467:37;;;1499:1;1467:37;1437:27;:67;;-1:-1:-1;;1437:67:1;;;;;;;;;;;;-1:-1:-1;;;;1514:25:1;;;;;128:2211;;-1:-1:-1;128:2211:1;;-1:-1:-1;128:2211:1;;-1:-1:-1;1437:27:1;-1:-1:-1;128:2211:1;;"
},
"deployedBytecode": {
"generatedSources": [],
"immutableReferences": {},
"linkReferences": {},
"object": "608060405234801561001057600080fd5b50600436106100415760003560e01c8063252c09d7146100465780633850c7bd146100aa578063883bdbfd14610110575b600080fd5b6100636004803603602081101561005c57600080fd5b5035610219565b6040805163ffffffff909516855260069390930b602085015273ffffffffffffffffffffffffffffffffffffffff9091168383015215156060830152519081900360800190f35b6100b2610290565b6040805173ffffffffffffffffffffffffffffffffffffffff909816885260029690960b602088015261ffff9485168787015292841660608701529216608085015260ff90911660a0840152151560c0830152519081900360e00190f35b6101806004803603602081101561012657600080fd5b81019060208101813564010000000081111561014157600080fd5b82018360208201111561015357600080fd5b8035906020019184602083028401116401000000008311171561017557600080fd5b5090925090506102bc565b604051808060200180602001838103835285818151815260200191508051906020019060200280838360005b838110156101c45781810151838201526020016101ac565b50505050905001838103825284818151815260200191508051906020019060200280838360005b838110156102035781810151838201526020016101eb565b5050505090500194505050505060405180910390f35b60018161ffff811061022a57600080fd5b015463ffffffff81169150640100000000810460060b906b010000000000000000000000810473ffffffffffffffffffffffffffffffffffffffff16907f0100000000000000000000000000000000000000000000000000000000000000900460ff1684565b60008054600281900b9061ffff6501000000000082048116916301000000900416838080919293949596565b60608061032b600160020154604080516020808802828101820190935287825263ffffffff90931692909188918891829185019084908082843760009201829052508054600196959450600281900b935061ffff65010000000000820481169350630100000090910416610336565b915091509250929050565b60608060008361ffff16116103ac57604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600160248201527f4900000000000000000000000000000000000000000000000000000000000000604482015290519081900360640190fd5b865167ffffffffffffffff811180156103c457600080fd5b506040519080825280602002602001820160405280156103ee578160200160208202803683370190505b509150865167ffffffffffffffff8111801561040957600080fd5b50604051908082528060200260200182016040528015610433578160200160208202803683370190505b50905060005b87518110156104d3576104648a8a8a848151811061045357fe5b60200260200101518a8a8a8a6104e0565b84838151811061047057fe5b6020026020010184848151811061048357fe5b602002602001018273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152508260060b60060b81525050508080600101915050610439565b5097509795505050505050565b60008063ffffffff87166105b8576000898661ffff1661ffff811061050157fe5b60408051608081018252919092015463ffffffff8082168084526401000000008304600690810b810b900b60208501526b010000000000000000000000830473ffffffffffffffffffffffffffffffffffffffff16948401949094527f010000000000000000000000000000000000000000000000000000000000000090910460ff16151560608301529092508a16146105a4576105a1818a89886106b1565b90505b8060200151816040015192509250506106a5565b8688036000806105cd8c8c858c8c8c8c610780565b91509150816000015163ffffffff168363ffffffff1614156105ff5781602001518260400151945094505050506106a5565b805163ffffffff848116911614156106275780602001518160400151945094505050506106a5565b8151815160208085015190840151918390039286039163ffffffff80841692908516910360060b8161065557fe5b05028460200151018263ffffffff168263ffffffff16866040015186604001510373ffffffffffffffffffffffffffffffffffffffff16028161069457fe5b048560400151019650965050505050505b97509795505050505050565b6106b9610d0b565b600085600001518503905060405180608001604052808663ffffffff1681526020018263ffffffff168660020b0288602001510160060b81526020016000856fffffffffffffffffffffffffffffffff1611610716576001610718565b845b6fffffffffffffffffffffffffffffffff1673ffffffff00000000000000000000000000000000608085901b168161074c57fe5b0488604001510173ffffffffffffffffffffffffffffffffffffffff16815260200160011515815250915050949350505050565b610788610d0b565b610790610d0b565b888561ffff1661ffff81106107a157fe5b60408051608081018252919092015463ffffffff81168083526401000000008204600690810b810b900b60208401526b010000000000000000000000820473ffffffffffffffffffffffffffffffffffffffff16938301939093527f0100000000000000000000000000000000000000000000000000000000000000900460ff1615156060820152925061083790899089610a44565b1561086f578663ffffffff16826000015163ffffffff161415610859576106a5565b81610866838989886106b1565b915091506106a5565b888361ffff168660010161ffff168161088457fe5b0661ffff1661ffff811061089457fe5b60408051608081018252929091015463ffffffff811683526401000000008104600690810b810b900b602084015273ffffffffffffffffffffffffffffffffffffffff6b0100000000000000000000008204169183019190915260ff7f0100000000000000000000000000000000000000000000000000000000000000909104161515606082018190529092506109ad57604080516080810182528a5463ffffffff811682526401000000008104600690810b810b900b60208301526b010000000000000000000000810473ffffffffffffffffffffffffffffffffffffffff16928201929092527f010000000000000000000000000000000000000000000000000000000000000090910460ff161515606082015291505b6109bc88836000015189610a44565b610a2757604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600360248201527f4f4c440000000000000000000000000000000000000000000000000000000000604482015290519081900360640190fd5b610a348989898887610b09565b9150915097509795505050505050565b60008363ffffffff168363ffffffff1611158015610a6e57508363ffffffff168263ffffffff1611155b15610a8a578163ffffffff168363ffffffff1611159050610b02565b60008463ffffffff168463ffffffff1611610ab2578363ffffffff1664010000000001610aba565b8363ffffffff165b64ffffffffff16905060008563ffffffff168463ffffffff1611610aeb578363ffffffff1664010000000001610af3565b8363ffffffff165b64ffffffffff16909111159150505b9392505050565b610b11610d0b565b610b19610d0b565b60008361ffff168560010161ffff1681610b2f57fe5b0661ffff169050600060018561ffff16830103905060005b506002818301048961ffff87168281610b5c57fe5b0661ffff8110610b6857fe5b60408051608081018252929091015463ffffffff811683526401000000008104600690810b810b900b602084015273ffffffffffffffffffffffffffffffffffffffff6b0100000000000000000000008204169183019190915260ff7f010000000000000000000000000000000000000000000000000000000000000090910416151560608201819052909550610c0457806001019250610b47565b898661ffff168260010181610c1557fe5b0661ffff8110610c2157fe5b60408051608081018252929091015463ffffffff811683526401000000008104600690810b810b900b602084015273ffffffffffffffffffffffffffffffffffffffff6b0100000000000000000000008204169183019190915260ff7f010000000000000000000000000000000000000000000000000000000000000090910416151560608201528551909450600090610cbd908b908b610a44565b9050808015610cd65750610cd68a8a8760000151610a44565b15610ce15750610cfe565b80610cf157600182039250610cf8565b8160010193505b50610b47565b5050509550959350505050565b6040805160808101825260008082526020820181905291810182905260608101919091529056fea164736f6c6343000706000a",
"opcodes": "PUSH1 0x80 PUSH1 0x40 MSTORE CALLVALUE DUP1 ISZERO PUSH2 0x10 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH1 0x4 CALLDATASIZE LT PUSH2 0x41 JUMPI PUSH1 0x0 CALLDATALOAD PUSH1 0xE0 SHR DUP1 PUSH4 0x252C09D7 EQ PUSH2 0x46 JUMPI DUP1 PUSH4 0x3850C7BD EQ PUSH2 0xAA JUMPI DUP1 PUSH4 0x883BDBFD EQ PUSH2 0x110 JUMPI JUMPDEST PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH2 0x63 PUSH1 0x4 DUP1 CALLDATASIZE SUB PUSH1 0x20 DUP2 LT ISZERO PUSH2 0x5C JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP CALLDATALOAD PUSH2 0x219 JUMP JUMPDEST PUSH1 0x40 DUP1 MLOAD PUSH4 0xFFFFFFFF SWAP1 SWAP6 AND DUP6 MSTORE PUSH1 0x6 SWAP4 SWAP1 SWAP4 SIGNEXTEND PUSH1 0x20 DUP6 ADD MSTORE PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF SWAP1 SWAP2 AND DUP4 DUP4 ADD MSTORE ISZERO ISZERO PUSH1 0x60 DUP4 ADD MSTORE MLOAD SWAP1 DUP2 SWAP1 SUB PUSH1 0x80 ADD SWAP1 RETURN JUMPDEST PUSH2 0xB2 PUSH2 0x290 JUMP JUMPDEST PUSH1 0x40 DUP1 MLOAD PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF SWAP1 SWAP9 AND DUP9 MSTORE PUSH1 0x2 SWAP7 SWAP1 SWAP7 SIGNEXTEND PUSH1 0x20 DUP9 ADD MSTORE PUSH2 0xFFFF SWAP5 DUP6 AND DUP8 DUP8 ADD MSTORE SWAP3 DUP5 AND PUSH1 0x60 DUP8 ADD MSTORE SWAP3 AND PUSH1 0x80 DUP6 ADD MSTORE PUSH1 0xFF SWAP1 SWAP2 AND PUSH1 0xA0 DUP5 ADD MSTORE ISZERO ISZERO PUSH1 0xC0 DUP4 ADD MSTORE MLOAD SWAP1 DUP2 SWAP1 SUB PUSH1 0xE0 ADD SWAP1 RETURN JUMPDEST PUSH2 0x180 PUSH1 0x4 DUP1 CALLDATASIZE SUB PUSH1 0x20 DUP2 LT ISZERO PUSH2 0x126 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST DUP2 ADD SWAP1 PUSH1 0x20 DUP2 ADD DUP2 CALLDATALOAD PUSH5 0x100000000 DUP2 GT ISZERO PUSH2 0x141 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST DUP3 ADD DUP4 PUSH1 0x20 DUP3 ADD GT ISZERO PUSH2 0x153 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST DUP1 CALLDATALOAD SWAP1 PUSH1 0x20 ADD SWAP2 DUP5 PUSH1 0x20 DUP4 MUL DUP5 ADD GT PUSH5 0x100000000 DUP4 GT OR ISZERO PUSH2 0x175 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP SWAP1 SWAP3 POP SWAP1 POP PUSH2 0x2BC JUMP JUMPDEST PUSH1 0x40 MLOAD DUP1 DUP1 PUSH1 0x20 ADD DUP1 PUSH1 0x20 ADD DUP4 DUP2 SUB DUP4 MSTORE DUP6 DUP2 DUP2 MLOAD DUP2 MSTORE PUSH1 0x20 ADD SWAP2 POP DUP1 MLOAD SWAP1 PUSH1 0x20 ADD SWAP1 PUSH1 0x20 MUL DUP1 DUP4 DUP4 PUSH1 0x0 JUMPDEST DUP4 DUP2 LT ISZERO PUSH2 0x1C4 JUMPI DUP2 DUP2 ADD MLOAD DUP4 DUP3 ADD MSTORE PUSH1 0x20 ADD PUSH2 0x1AC JUMP JUMPDEST POP POP POP POP SWAP1 POP ADD DUP4 DUP2 SUB DUP3 MSTORE DUP5 DUP2 DUP2 MLOAD DUP2 MSTORE PUSH1 0x20 ADD SWAP2 POP DUP1 MLOAD SWAP1 PUSH1 0x20 ADD SWAP1 PUSH1 0x20 MUL DUP1 DUP4 DUP4 PUSH1 0x0 JUMPDEST DUP4 DUP2 LT ISZERO PUSH2 0x203 JUMPI DUP2 DUP2 ADD MLOAD DUP4 DUP3 ADD MSTORE PUSH1 0x20 ADD PUSH2 0x1EB JUMP JUMPDEST POP POP POP POP SWAP1 POP ADD SWAP5 POP POP POP POP POP PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 RETURN JUMPDEST PUSH1 0x1 DUP2 PUSH2 0xFFFF DUP2 LT PUSH2 0x22A JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST ADD SLOAD PUSH4 0xFFFFFFFF DUP2 AND SWAP2 POP PUSH5 0x100000000 DUP2 DIV PUSH1 0x6 SIGNEXTEND SWAP1 PUSH12 0x10000000000000000000000 DUP2 DIV PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND SWAP1 PUSH32 0x100000000000000000000000000000000000000000000000000000000000000 SWAP1 DIV PUSH1 0xFF AND DUP5 JUMP JUMPDEST PUSH1 0x0 DUP1 SLOAD PUSH1 0x2 DUP2 SWAP1 SIGNEXTEND SWAP1 PUSH2 0xFFFF PUSH6 0x10000000000 DUP3 DIV DUP2 AND SWAP2 PUSH4 0x1000000 SWAP1 DIV AND DUP4 DUP1 DUP1 SWAP2 SWAP3 SWAP4 SWAP5 SWAP6 SWAP7 JUMP JUMPDEST PUSH1 0x60 DUP1 PUSH2 0x32B PUSH1 0x1 PUSH1 0x2 ADD SLOAD PUSH1 0x40 DUP1 MLOAD PUSH1 0x20 DUP1 DUP9 MUL DUP3 DUP2 ADD DUP3 ADD SWAP1 SWAP4 MSTORE DUP8 DUP3 MSTORE PUSH4 0xFFFFFFFF SWAP1 SWAP4 AND SWAP3 SWAP1 SWAP2 DUP9 SWAP2 DUP9 SWAP2 DUP3 SWAP2 DUP6 ADD SWAP1 DUP5 SWAP1 DUP1 DUP3 DUP5 CALLDATACOPY PUSH1 0x0 SWAP3 ADD DUP3 SWAP1 MSTORE POP DUP1 SLOAD PUSH1 0x1 SWAP7 SWAP6 SWAP5 POP PUSH1 0x2 DUP2 SWAP1 SIGNEXTEND SWAP4 POP PUSH2 0xFFFF PUSH6 0x10000000000 DUP3 DIV DUP2 AND SWAP4 POP PUSH4 0x1000000 SWAP1 SWAP2 DIV AND PUSH2 0x336 JUMP JUMPDEST SWAP2 POP SWAP2 POP SWAP3 POP SWAP3 SWAP1 POP JUMP JUMPDEST PUSH1 0x60 DUP1 PUSH1 0x0 DUP4 PUSH2 0xFFFF AND GT PUSH2 0x3AC JUMPI PUSH1 0x40 DUP1 MLOAD PUSH32 0x8C379A000000000000000000000000000000000000000000000000000000000 DUP2 MSTORE PUSH1 0x20 PUSH1 0x4 DUP3 ADD MSTORE PUSH1 0x1 PUSH1 0x24 DUP3 ADD MSTORE PUSH32 0x4900000000000000000000000000000000000000000000000000000000000000 PUSH1 0x44 DUP3 ADD MSTORE SWAP1 MLOAD SWAP1 DUP2 SWAP1 SUB PUSH1 0x64 ADD SWAP1 REVERT JUMPDEST DUP7 MLOAD PUSH8 0xFFFFFFFFFFFFFFFF DUP2 GT DUP1 ISZERO PUSH2 0x3C4 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH1 0x40 MLOAD SWAP1 DUP1 DUP3 MSTORE DUP1 PUSH1 0x20 MUL PUSH1 0x20 ADD DUP3 ADD PUSH1 0x40 MSTORE DUP1 ISZERO PUSH2 0x3EE JUMPI DUP2 PUSH1 0x20 ADD PUSH1 0x20 DUP3 MUL DUP1 CALLDATASIZE DUP4 CALLDATACOPY ADD SWAP1 POP JUMPDEST POP SWAP2 POP DUP7 MLOAD PUSH8 0xFFFFFFFFFFFFFFFF DUP2 GT DUP1 ISZERO PUSH2 0x409 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH1 0x40 MLOAD SWAP1 DUP1 DUP3 MSTORE DUP1 PUSH1 0x20 MUL PUSH1 0x20 ADD DUP3 ADD PUSH1 0x40 MSTORE DUP1 ISZERO PUSH2 0x433 JUMPI DUP2 PUSH1 0x20 ADD PUSH1 0x20 DUP3 MUL DUP1 CALLDATASIZE DUP4 CALLDATACOPY ADD SWAP1 POP JUMPDEST POP SWAP1 POP PUSH1 0x0 JUMPDEST DUP8 MLOAD DUP2 LT ISZERO PUSH2 0x4D3 JUMPI PUSH2 0x464 DUP11 DUP11 DUP11 DUP5 DUP2 MLOAD DUP2 LT PUSH2 0x453 JUMPI INVALID JUMPDEST PUSH1 0x20 MUL PUSH1 0x20 ADD ADD MLOAD DUP11 DUP11 DUP11 DUP11 PUSH2 0x4E0 JUMP JUMPDEST DUP5 DUP4 DUP2 MLOAD DUP2 LT PUSH2 0x470 JUMPI INVALID JUMPDEST PUSH1 0x20 MUL PUSH1 0x20 ADD ADD DUP5 DUP5 DUP2 MLOAD DUP2 LT PUSH2 0x483 JUMPI INVALID JUMPDEST PUSH1 0x20 MUL PUSH1 0x20 ADD ADD DUP3 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP2 MSTORE POP DUP3 PUSH1 0x6 SIGNEXTEND PUSH1 0x6 SIGNEXTEND DUP2 MSTORE POP POP POP DUP1 DUP1 PUSH1 0x1 ADD SWAP2 POP POP PUSH2 0x439 JUMP JUMPDEST POP SWAP8 POP SWAP8 SWAP6 POP POP POP POP POP POP JUMP JUMPDEST PUSH1 0x0 DUP1 PUSH4 0xFFFFFFFF DUP8 AND PUSH2 0x5B8 JUMPI PUSH1 0x0 DUP10 DUP7 PUSH2 0xFFFF AND PUSH2 0xFFFF DUP2 LT PUSH2 0x501 JUMPI INVALID JUMPDEST PUSH1 0x40 DUP1 MLOAD PUSH1 0x80 DUP2 ADD DUP3 MSTORE SWAP2 SWAP1 SWAP3 ADD SLOAD PUSH4 0xFFFFFFFF DUP1 DUP3 AND DUP1 DUP5 MSTORE PUSH5 0x100000000 DUP4 DIV PUSH1 0x6 SWAP1 DUP2 SIGNEXTEND DUP2 SIGNEXTEND SWAP1 SIGNEXTEND PUSH1 0x20 DUP6 ADD MSTORE PUSH12 0x10000000000000000000000 DUP4 DIV PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND SWAP5 DUP5 ADD SWAP5 SWAP1 SWAP5 MSTORE PUSH32 0x100000000000000000000000000000000000000000000000000000000000000 SWAP1 SWAP2 DIV PUSH1 0xFF AND ISZERO ISZERO PUSH1 0x60 DUP4 ADD MSTORE SWAP1 SWAP3 POP DUP11 AND EQ PUSH2 0x5A4 JUMPI PUSH2 0x5A1 DUP2 DUP11 DUP10 DUP9 PUSH2 0x6B1 JUMP JUMPDEST SWAP1 POP JUMPDEST DUP1 PUSH1 0x20 ADD MLOAD DUP2 PUSH1 0x40 ADD MLOAD SWAP3 POP SWAP3 POP POP PUSH2 0x6A5 JUMP JUMPDEST DUP7 DUP9 SUB PUSH1 0x0 DUP1 PUSH2 0x5CD DUP13 DUP13 DUP6 DUP13 DUP13 DUP13 DUP13 PUSH2 0x780 JUMP JUMPDEST SWAP2 POP SWAP2 POP DUP2 PUSH1 0x0 ADD MLOAD PUSH4 0xFFFFFFFF AND DUP4 PUSH4 0xFFFFFFFF AND EQ ISZERO PUSH2 0x5FF JUMPI DUP2 PUSH1 0x20 ADD MLOAD DUP3 PUSH1 0x40 ADD MLOAD SWAP5 POP SWAP5 POP POP POP POP PUSH2 0x6A5 JUMP JUMPDEST DUP1 MLOAD PUSH4 0xFFFFFFFF DUP5 DUP2 AND SWAP2 AND EQ ISZERO PUSH2 0x627 JUMPI DUP1 PUSH1 0x20 ADD MLOAD DUP2 PUSH1 0x40 ADD MLOAD SWAP5 POP SWAP5 POP POP POP POP PUSH2 0x6A5 JUMP JUMPDEST DUP2 MLOAD DUP2 MLOAD PUSH1 0x20 DUP1 DUP6 ADD MLOAD SWAP1 DUP5 ADD MLOAD SWAP2 DUP4 SWAP1 SUB SWAP3 DUP7 SUB SWAP2 PUSH4 0xFFFFFFFF DUP1 DUP5 AND SWAP3 SWAP1 DUP6 AND SWAP2 SUB PUSH1 0x6 SIGNEXTEND DUP2 PUSH2 0x655 JUMPI INVALID JUMPDEST SDIV MUL DUP5 PUSH1 0x20 ADD MLOAD ADD DUP3 PUSH4 0xFFFFFFFF AND DUP3 PUSH4 0xFFFFFFFF AND DUP7 PUSH1 0x40 ADD MLOAD DUP7 PUSH1 0x40 ADD MLOAD SUB PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND MUL DUP2 PUSH2 0x694 JUMPI INVALID JUMPDEST DIV DUP6 PUSH1 0x40 ADD MLOAD ADD SWAP7 POP SWAP7 POP POP POP POP POP POP JUMPDEST SWAP8 POP SWAP8 SWAP6 POP POP POP POP POP POP JUMP JUMPDEST PUSH2 0x6B9 PUSH2 0xD0B JUMP JUMPDEST PUSH1 0x0 DUP6 PUSH1 0x0 ADD MLOAD DUP6 SUB SWAP1 POP PUSH1 0x40 MLOAD DUP1 PUSH1 0x80 ADD PUSH1 0x40 MSTORE DUP1 DUP7 PUSH4 0xFFFFFFFF AND DUP2 MSTORE PUSH1 0x20 ADD DUP3 PUSH4 0xFFFFFFFF AND DUP7 PUSH1 0x2 SIGNEXTEND MUL DUP9 PUSH1 0x20 ADD MLOAD ADD PUSH1 0x6 SIGNEXTEND DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x0 DUP6 PUSH16 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND GT PUSH2 0x716 JUMPI PUSH1 0x1 PUSH2 0x718 JUMP JUMPDEST DUP5 JUMPDEST PUSH16 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH20 0xFFFFFFFF00000000000000000000000000000000 PUSH1 0x80 DUP6 SWAP1 SHL AND DUP2 PUSH2 0x74C JUMPI INVALID JUMPDEST DIV DUP9 PUSH1 0x40 ADD MLOAD ADD PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x1 ISZERO ISZERO DUP2 MSTORE POP SWAP2 POP POP SWAP5 SWAP4 POP POP POP POP JUMP JUMPDEST PUSH2 0x788 PUSH2 0xD0B JUMP JUMPDEST PUSH2 0x790 PUSH2 0xD0B JUMP JUMPDEST DUP9 DUP6 PUSH2 0xFFFF AND PUSH2 0xFFFF DUP2 LT PUSH2 0x7A1 JUMPI INVALID JUMPDEST PUSH1 0x40 DUP1 MLOAD PUSH1 0x80 DUP2 ADD DUP3 MSTORE SWAP2 SWAP1 SWAP3 ADD SLOAD PUSH4 0xFFFFFFFF DUP2 AND DUP1 DUP4 MSTORE PUSH5 0x100000000 DUP3 DIV PUSH1 0x6 SWAP1 DUP2 SIGNEXTEND DUP2 SIGNEXTEND SWAP1 SIGNEXTEND PUSH1 0x20 DUP5 ADD MSTORE PUSH12 0x10000000000000000000000 DUP3 DIV PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND SWAP4 DUP4 ADD SWAP4 SWAP1 SWAP4 MSTORE PUSH32 0x100000000000000000000000000000000000000000000000000000000000000 SWAP1 DIV PUSH1 0xFF AND ISZERO ISZERO PUSH1 0x60 DUP3 ADD MSTORE SWAP3 POP PUSH2 0x837 SWAP1 DUP10 SWAP1 DUP10 PUSH2 0xA44 JUMP JUMPDEST ISZERO PUSH2 0x86F JUMPI DUP7 PUSH4 0xFFFFFFFF AND DUP3 PUSH1 0x0 ADD MLOAD PUSH4 0xFFFFFFFF AND EQ ISZERO PUSH2 0x859 JUMPI PUSH2 0x6A5 JUMP JUMPDEST DUP2 PUSH2 0x866 DUP4 DUP10 DUP10 DUP9 PUSH2 0x6B1 JUMP JUMPDEST SWAP2 POP SWAP2 POP PUSH2 0x6A5 JUMP JUMPDEST DUP9 DUP4 PUSH2 0xFFFF AND DUP7 PUSH1 0x1 ADD PUSH2 0xFFFF AND DUP2 PUSH2 0x884 JUMPI INVALID JUMPDEST MOD PUSH2 0xFFFF AND PUSH2 0xFFFF DUP2 LT PUSH2 0x894 JUMPI INVALID JUMPDEST PUSH1 0x40 DUP1 MLOAD PUSH1 0x80 DUP2 ADD DUP3 MSTORE SWAP3 SWAP1 SWAP2 ADD SLOAD PUSH4 0xFFFFFFFF DUP2 AND DUP4 MSTORE PUSH5 0x100000000 DUP2 DIV PUSH1 0x6 SWAP1 DUP2 SIGNEXTEND DUP2 SIGNEXTEND SWAP1 SIGNEXTEND PUSH1 0x20 DUP5 ADD MSTORE PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF PUSH12 0x10000000000000000000000 DUP3 DIV AND SWAP2 DUP4 ADD SWAP2 SWAP1 SWAP2 MSTORE PUSH1 0xFF PUSH32 0x100000000000000000000000000000000000000000000000000000000000000 SWAP1 SWAP2 DIV AND ISZERO ISZERO PUSH1 0x60 DUP3 ADD DUP2 SWAP1 MSTORE SWAP1 SWAP3 POP PUSH2 0x9AD JUMPI PUSH1 0x40 DUP1 MLOAD PUSH1 0x80 DUP2 ADD DUP3 MSTORE DUP11 SLOAD PUSH4 0xFFFFFFFF DUP2 AND DUP3 MSTORE PUSH5 0x100000000 DUP2 DIV PUSH1 0x6 SWAP1 DUP2 SIGNEXTEND DUP2 SIGNEXTEND SWAP1 SIGNEXTEND PUSH1 0x20 DUP4 ADD MSTORE PUSH12 0x10000000000000000000000 DUP2 DIV PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND SWAP3 DUP3 ADD SWAP3 SWAP1 SWAP3 MSTORE PUSH32 0x100000000000000000000000000000000000000000000000000000000000000 SWAP1 SWAP2 DIV PUSH1 0xFF AND ISZERO ISZERO PUSH1 0x60 DUP3 ADD MSTORE SWAP2 POP JUMPDEST PUSH2 0x9BC DUP9 DUP4 PUSH1 0x0 ADD MLOAD DUP10 PUSH2 0xA44 JUMP JUMPDEST PUSH2 0xA27 JUMPI PUSH1 0x40 DUP1 MLOAD PUSH32 0x8C379A000000000000000000000000000000000000000000000000000000000 DUP2 MSTORE PUSH1 0x20 PUSH1 0x4 DUP3 ADD MSTORE PUSH1 0x3 PUSH1 0x24 DUP3 ADD MSTORE PUSH32 0x4F4C440000000000000000000000000000000000000000000000000000000000 PUSH1 0x44 DUP3 ADD MSTORE SWAP1 MLOAD SWAP1 DUP2 SWAP1 SUB PUSH1 0x64 ADD SWAP1 REVERT JUMPDEST PUSH2 0xA34 DUP10 DUP10 DUP10 DUP9 DUP8 PUSH2 0xB09 JUMP JUMPDEST SWAP2 POP SWAP2 POP SWAP8 POP SWAP8 SWAP6 POP POP POP POP POP POP JUMP JUMPDEST PUSH1 0x0 DUP4 PUSH4 0xFFFFFFFF AND DUP4 PUSH4 0xFFFFFFFF AND GT ISZERO DUP1 ISZERO PUSH2 0xA6E JUMPI POP DUP4 PUSH4 0xFFFFFFFF AND DUP3 PUSH4 0xFFFFFFFF AND GT ISZERO JUMPDEST ISZERO PUSH2 0xA8A JUMPI DUP2 PUSH4 0xFFFFFFFF AND DUP4 PUSH4 0xFFFFFFFF AND GT ISZERO SWAP1 POP PUSH2 0xB02 JUMP JUMPDEST PUSH1 0x0 DUP5 PUSH4 0xFFFFFFFF AND DUP5 PUSH4 0xFFFFFFFF AND GT PUSH2 0xAB2 JUMPI DUP4 PUSH4 0xFFFFFFFF AND PUSH5 0x100000000 ADD PUSH2 0xABA JUMP JUMPDEST DUP4 PUSH4 0xFFFFFFFF AND JUMPDEST PUSH5 0xFFFFFFFFFF AND SWAP1 POP PUSH1 0x0 DUP6 PUSH4 0xFFFFFFFF AND DUP5 PUSH4 0xFFFFFFFF AND GT PUSH2 0xAEB JUMPI DUP4 PUSH4 0xFFFFFFFF AND PUSH5 0x100000000 ADD PUSH2 0xAF3 JUMP JUMPDEST DUP4 PUSH4 0xFFFFFFFF AND JUMPDEST PUSH5 0xFFFFFFFFFF AND SWAP1 SWAP2 GT ISZERO SWAP2 POP POP JUMPDEST SWAP4 SWAP3 POP POP POP JUMP JUMPDEST PUSH2 0xB11 PUSH2 0xD0B JUMP JUMPDEST PUSH2 0xB19 PUSH2 0xD0B JUMP JUMPDEST PUSH1 0x0 DUP4 PUSH2 0xFFFF AND DUP6 PUSH1 0x1 ADD PUSH2 0xFFFF AND DUP2 PUSH2 0xB2F JUMPI INVALID JUMPDEST MOD PUSH2 0xFFFF AND SWAP1 POP PUSH1 0x0 PUSH1 0x1 DUP6 PUSH2 0xFFFF AND DUP4 ADD SUB SWAP1 POP PUSH1 0x0 JUMPDEST POP PUSH1 0x2 DUP2 DUP4 ADD DIV DUP10 PUSH2 0xFFFF DUP8 AND DUP3 DUP2 PUSH2 0xB5C JUMPI INVALID JUMPDEST MOD PUSH2 0xFFFF DUP2 LT PUSH2 0xB68 JUMPI INVALID JUMPDEST PUSH1 0x40 DUP1 MLOAD PUSH1 0x80 DUP2 ADD DUP3 MSTORE SWAP3 SWAP1 SWAP2 ADD SLOAD PUSH4 0xFFFFFFFF DUP2 AND DUP4 MSTORE PUSH5 0x100000000 DUP2 DIV PUSH1 0x6 SWAP1 DUP2 SIGNEXTEND DUP2 SIGNEXTEND SWAP1 SIGNEXTEND PUSH1 0x20 DUP5 ADD MSTORE PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF PUSH12 0x10000000000000000000000 DUP3 DIV AND SWAP2 DUP4 ADD SWAP2 SWAP1 SWAP2 MSTORE PUSH1 0xFF PUSH32 0x100000000000000000000000000000000000000000000000000000000000000 SWAP1 SWAP2 DIV AND ISZERO ISZERO PUSH1 0x60 DUP3 ADD DUP2 SWAP1 MSTORE SWAP1 SWAP6 POP PUSH2 0xC04 JUMPI DUP1 PUSH1 0x1 ADD SWAP3 POP PUSH2 0xB47 JUMP JUMPDEST DUP10 DUP7 PUSH2 0xFFFF AND DUP3 PUSH1 0x1 ADD DUP2 PUSH2 0xC15 JUMPI INVALID JUMPDEST MOD PUSH2 0xFFFF DUP2 LT PUSH2 0xC21 JUMPI INVALID JUMPDEST PUSH1 0x40 DUP1 MLOAD PUSH1 0x80 DUP2 ADD DUP3 MSTORE SWAP3 SWAP1 SWAP2 ADD SLOAD PUSH4 0xFFFFFFFF DUP2 AND DUP4 MSTORE PUSH5 0x100000000 DUP2 DIV PUSH1 0x6 SWAP1 DUP2 SIGNEXTEND DUP2 SIGNEXTEND SWAP1 SIGNEXTEND PUSH1 0x20 DUP5 ADD MSTORE PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF PUSH12 0x10000000000000000000000 DUP3 DIV AND SWAP2 DUP4 ADD SWAP2 SWAP1 SWAP2 MSTORE PUSH1 0xFF PUSH32 0x100000000000000000000000000000000000000000000000000000000000000 SWAP1 SWAP2 DIV AND ISZERO ISZERO PUSH1 0x60 DUP3 ADD MSTORE DUP6 MLOAD SWAP1 SWAP5 POP PUSH1 0x0 SWAP1 PUSH2 0xCBD SWAP1 DUP12 SWAP1 DUP12 PUSH2 0xA44 JUMP JUMPDEST SWAP1 POP DUP1 DUP1 ISZERO PUSH2 0xCD6 JUMPI POP PUSH2 0xCD6 DUP11 DUP11 DUP8 PUSH1 0x0 ADD MLOAD PUSH2 0xA44 JUMP JUMPDEST ISZERO PUSH2 0xCE1 JUMPI POP PUSH2 0xCFE JUMP JUMPDEST DUP1 PUSH2 0xCF1 JUMPI PUSH1 0x1 DUP3 SUB SWAP3 POP PUSH2 0xCF8 JUMP JUMPDEST DUP2 PUSH1 0x1 ADD SWAP4 POP JUMPDEST POP PUSH2 0xB47 JUMP JUMPDEST POP POP POP SWAP6 POP SWAP6 SWAP4 POP POP POP POP JUMP JUMPDEST PUSH1 0x40 DUP1 MLOAD PUSH1 0x80 DUP2 ADD DUP3 MSTORE PUSH1 0x0 DUP1 DUP3 MSTORE PUSH1 0x20 DUP3 ADD DUP2 SWAP1 MSTORE SWAP2 DUP2 ADD DUP3 SWAP1 MSTORE PUSH1 0x60 DUP2 ADD SWAP2 SWAP1 SWAP2 MSTORE SWAP1 JUMP INVALID LOG1 PUSH5 0x736F6C6343 STOP SMOD MOD STOP EXP ",
"sourceMap": "128:2211:1:-:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;362:45;;;;;;;;;;;;;;;;-1:-1:-1;362:45:1;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;1552:318;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;1876:461;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;1876:461:1;;-1:-1:-1;1876:461:1;-1:-1:-1;1876:461:1;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;362:45;;;;;;;;;;;;;;;;;;-1:-1:-1;362:45:1;;;;;;;;;;;;;;;;;;:::o;1552:318::-;1629:7;1788:9;;;;;;;1799:21;;;;;;;1822:27;;;;1629:7;;;1552:318;;;;;;:::o;1876:461::-;1971:30;;2089:241;2127:12;2140:1;2127:15;:30;2089:241;;;;;;;;;;;;;;;;;;2127:30;;;;;2089:241;;2175:11;;;;;;2089:241;;;2175:11;;2089:241;2175:11;2089:241;;;;;;;;-1:-1:-1;2204:9:1;;;;2089:241;;-1:-1:-1;2204:9:1;;;;;-1:-1:-1;2231:21:1;;;;;;;-1:-1:-1;2289:27:1;;;;;2089:20;:241::i;:::-;2070:260;;;;1876:461;;;;;:::o;15578:862:0:-;15820:30;15852:51;15937:1;15923:11;:15;;;15915:29;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;15985:11;:18;15973:31;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;15973:31:0;;15955:49;;16065:11;:18;16051:33;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;16051:33:0;;16014:70;;16099:9;16094:340;16118:11;:18;16114:1;:22;16094:340;;;16219:204;16250:4;16272;16294:11;16306:1;16294:14;;;;;;;;;;;;;;16326:4;16348:5;16371:9;16398:11;16219:13;:204::i;:::-;16158:15;16174:1;16158:18;;;;;;;;;;;;;16178:34;16213:1;16178:37;;;;;;;;;;;;;16157:266;;;;;;;;;;;;;;;;;;16138:3;;;;;;;16094:340;;;;15578:862;;;;;;;;;;:::o;12599:2025::-;12837:20;;12916:15;;;12912:257;;12947:23;12973:4;12978:5;12973:11;;;;;;;;;12947:37;;;;;;;;12973:11;;;;12947:37;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;13002:27:0;;;12998:78;;13038:38;13048:4;13054;13060;13066:9;13038;:38::i;:::-;13031:45;;12998:78;13098:4;:19;;;13119:4;:38;;;13090:68;;;;;;;12912:257;13195:17;;;13179:13;;13287:177;13327:4;13195;:17;13383:4;13401:5;13420:9;13443:11;13287:26;:177::i;:::-;13223:241;;;;13489:10;:25;;;13479:35;;:6;:35;;;13475:1143;;;13580:10;:25;;;13607:10;:44;;;13572:80;;;;;;;;;13475:1143;13683:24;;13673:34;;;;;;;13669:949;;;13774:9;:24;;;13800:9;:43;;;13766:78;;;;;;;;;13669:949;13967:25;;13940:24;;14177:25;;;;;14150:24;;;;13940:52;;;;;14027:34;;;14148:113;;;;;14149:77;;;;14150:52;14149:77;;;;;;;;14148:113;14100:10;:25;;;:161;14551:20;14379:192;;14536:11;14380:167;;14463:10;:44;;;14417:9;:43;;;:90;14380:153;;:167;14379:192;;;;;;14279:10;:44;;;:314;14075:532;;;;;;;;;12599:2025;;;;;;;;;;;:::o;1811:633::-;1969:18;;:::i;:::-;1999:12;2031:4;:19;;;2014:14;:36;1999:51;;2079:358;;;;;;;;2125:14;2079:358;;;;;;2209:5;2195:19;;2201:4;2195:11;;:19;2173:4;:19;;;:41;2079:358;;;;;;2368:1;2356:9;:13;;;:29;;2384:1;2356:29;;;2372:9;2356:29;2329:57;;2330:21;2348:3;2330:21;;;;2329:57;;;;;;2267:4;:38;;;:120;2079:358;;;;;;2418:4;2079:358;;;;;2060:377;;;1811:633;;;;;;:::o;10063:1425::-;10309:29;;:::i;:::-;10340:28;;:::i;:::-;10456:4;10461:5;10456:11;;;;;;;;;10443:24;;;;;;;;10456:11;;;;10443:24;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;10582:44:0;;10586:4;;10619:6;10582:3;:44::i;:::-;10578:443;;;10675:6;10646:35;;:10;:25;;;:35;;;10642:369;;;10809:30;;10642:369;10937:10;10949:46;10959:10;10971:6;10979:4;10985:9;10949;:46::i;:::-;10929:67;;;;;;10642:369;11097:4;11116:11;11102:25;;11103:5;11111:1;11103:9;11102:25;;;;;;;;11097:31;;;;;;;;;11084:44;;;;;;;;11097:31;;;;11084:44;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;11138:49:0;;11167:20;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;11138:49:0;11294:44;11298:4;11304:10;:25;;;11331:6;11294:3;:44::i;:::-;11286:60;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;11429:52;11442:4;11448;11454:6;11462:5;11469:11;11429:12;:52::i;:::-;11422:59;;;;10063:1425;;;;;;;;;;:::o;6675:345::-;6743:4;6828;6823:9;;:1;:9;;;;:22;;;;;6841:4;6836:9;;:1;:9;;;;6823:22;6819:41;;;6859:1;6854:6;;:1;:6;;;;6847:13;;;;6819:41;6871:17;6895:4;6891:8;;:1;:8;;;:26;;6906:1;:11;;6910:7;6906:11;6891:26;;;6902:1;6891:26;;;6871:46;;;;6927:17;6951:4;6947:8;;:1;:8;;;:26;;6962:1;:11;;6966:7;6962:11;6947:26;;;6958:1;6947:26;;;6927:46;;6991:22;;;;;-1:-1:-1;;6675:345:0;;;;;;:::o;7975:1064::-;8160:29;;:::i;:::-;8191:28;;:::i;:::-;8231:9;8257:11;8243:25;;8244:5;8252:1;8244:9;8243:25;;;;;;;;8231:37;;;;8300:9;8330:1;8316:11;8312:15;;:1;:15;:19;8300:31;;8363:9;8382:651;-1:-1:-1;8423:1:0;8414:5;;;8413:11;8452:4;8457:15;;;8413:11;8457:15;;;;;;8452:21;;;;;;;8439:34;;;;;;;;8452:21;;;;8439:34;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;8580:97:0;;8631:1;8635;8631:5;8627:9;;8654:8;;8580:97;8703:4;8718:11;8708:21;;8709:1;8713;8709:5;8708:21;;;;;;8703:27;;;;;;;8691:39;;;;;;;;8703:27;;;;8691:39;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;8778:25;;8691:39;;-1:-1:-1;;;8768:44:0;;8772:4;;8805:6;8768:3;:44::i;:::-;8745:67;;8879:15;:62;;;;;8898:43;8902:4;8908:6;8916:9;:24;;;8898:3;:43::i;:::-;8875:73;;;8943:5;;;8875:73;8968:15;8963:59;;8993:1;8989;:5;8985:9;;8963:59;;;9017:1;9021;9017:5;9013:9;;8963:59;8382:651;;;;7975:1064;;;;;;;;;;;:::o;-1:-1:-1:-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::o"
},
"methodIdentifiers": {
"observations(uint256)": "252c09d7",
"observe(uint32[])": "883bdbfd",
"slot0()": "3850c7bd"
}
},
"metadata": "{\"compiler\":{\"version\":\"0.7.6+commit.7338295f\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[{\"internalType\":\"uint32[3]\",\"name\":\"blockTimestamps\",\"type\":\"uint32[3]\"},{\"internalType\":\"int24[3]\",\"name\":\"ticks\",\"type\":\"int24[3]\"},{\"internalType\":\"bool\",\"name\":\"mockLowObservationCardinality\",\"type\":\"bool\"}],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"name\":\"observations\",\"outputs\":[{\"internalType\":\"uint32\",\"name\":\"blockTimestamp\",\"type\":\"uint32\"},{\"internalType\":\"int56\",\"name\":\"tickCumulative\",\"type\":\"int56\"},{\"internalType\":\"uint160\",\"name\":\"secondsPerLiquidityCumulativeX128\",\"type\":\"uint160\"},{\"internalType\":\"bool\",\"name\":\"initialized\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint32[]\",\"name\":\"secondsAgos\",\"type\":\"uint32[]\"}],\"name\":\"observe\",\"outputs\":[{\"internalType\":\"int56[]\",\"name\":\"tickCumulatives\",\"type\":\"int56[]\"},{\"internalType\":\"uint160[]\",\"name\":\"secondsPerLiquidityCumulativeX128s\",\"type\":\"uint160[]\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"slot0\",\"outputs\":[{\"internalType\":\"uint160\",\"name\":\"\",\"type\":\"uint160\"},{\"internalType\":\"int24\",\"name\":\"\",\"type\":\"int24\"},{\"internalType\":\"uint16\",\"name\":\"\",\"type\":\"uint16\"},{\"internalType\":\"uint16\",\"name\":\"\",\"type\":\"uint16\"},{\"internalType\":\"uint16\",\"name\":\"\",\"type\":\"uint16\"},{\"internalType\":\"uint8\",\"name\":\"\",\"type\":\"uint8\"},{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"}],\"devdoc\":{\"kind\":\"dev\",\"methods\":{},\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{},\"version\":1}},\"settings\":{\"compilationTarget\":{\"contracts/test/MockObservations.sol\":\"MockObservations\"},\"evmVersion\":\"istanbul\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"none\"},\"optimizer\":{\"enabled\":true,\"runs\":1000000},\"remappings\":[]},\"sources\":{\"@airdao/astra-cl-core/contracts/libraries/Oracle.sol\":{\"keccak256\":\"0xf15b26d5b4229bee5de2462bb1a955e62275fe7739568aae392cbea910ce939c\",\"license\":\"BUSL-1.1\",\"urls\":[\"bzz-raw://aaea6a6dcf63e757263bf6f836671d928af7dae68251afab58380c4b8723949c\",\"dweb:/ipfs/QmSHnihjgUkmwKczcyuDNGjTzS65pmnQnjBjPXBXQpv6JF\"]},\"contracts/test/MockObservations.sol\":{\"keccak256\":\"0x66cbca36c12142032ed0040303f7fa59fc64c18d3250cbbb01acfafe7ef6b11d\",\"license\":\"UNLICENSED\",\"urls\":[\"bzz-raw://a1624785eb95655ce0c5740d4d77aa84ebcdc606e4e9bed2f317b257e769a7de\",\"dweb:/ipfs/QmXeJaZVhMsPZMrtt3PeMkw5miAF5iKGUmpqYmLaXhR8fK\"]}},\"version\":1}"
}
}
},
"sources": {
"@airdao/astra-cl-core/contracts/libraries/Oracle.sol": {
"ast": {
"absolutePath": "@airdao/astra-cl-core/contracts/libraries/Oracle.sol",
"exportedSymbols": {
"Oracle": [
734
]
},
"id": 735,
"license": "BUSL-1.1",
"nodeType": "SourceUnit",
"nodes": [
{
"id": 1,
"literals": [
"solidity",
">=",
"0.5",
".0",
"<",
"0.8",
".0"
],
"nodeType": "PragmaDirective",
"src": "37:31:0"
},
{
"abstract": false,
"baseContracts": [],
"contractDependencies": [],
"contractKind": "library",
"documentation": {
"id": 2,
"nodeType": "StructuredDocumentation",
"src": "70:613:0",
"text": "@title Oracle\n @notice Provides price and liquidity data useful for a wide variety of system designs\n @dev Instances of stored oracle data, \"observations\", are collected in the oracle array\n Every pool is initialized with an oracle array length of 1. Anyone can pay the SSTOREs to increase the\n maximum length of the oracle array. New slots will be added when the array is fully populated.\n Observations are overwritten when the full length of the oracle array is populated.\n The most recent observation is available, independent of the length of the oracle array, by passing 0 to observe()"
},
"fullyImplemented": true,
"id": 734,
"linearizedBaseContracts": [
734
],
"name": "Oracle",
"nodeType": "ContractDefinition",
"nodes": [
{
"canonicalName": "Oracle.Observation",
"id": 11,
"members": [
{
"constant": false,
"id": 4,
"mutability": "mutable",
"name": "blockTimestamp",
"nodeType": "VariableDeclaration",
"scope": 11,
"src": "783:21:0",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint32",
"typeString": "uint32"
},
"typeName": {
"id": 3,
"name": "uint32",
"nodeType": "ElementaryTypeName",
"src": "783:6:0",
"typeDescriptions": {
"typeIdentifier": "t_uint32",
"typeString": "uint32"
}
},
"visibility": "internal"
},
{
"constant": false,
"id": 6,
"mutability": "mutable",
"name": "tickCumulative",
"nodeType": "VariableDeclaration",
"scope": 11,
"src": "909:20:0",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_int56",
"typeString": "int56"
},
"typeName": {
"id": 5,
"name": "int56",
"nodeType": "ElementaryTypeName",
"src": "909:5:0",
"typeDescriptions": {
"typeIdentifier": "t_int56",
"typeString": "int56"
}
},
"visibility": "internal"
},
{
"constant": false,
"id": 8,
"mutability": "mutable",
"name": "secondsPerLiquidityCumulativeX128",
"nodeType": "VariableDeclaration",
"scope": 11,
"src": "1055:41:0",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint160",
"typeString": "uint160"
},
"typeName": {
"id": 7,
"name": "uint160",
"nodeType": "ElementaryTypeName",
"src": "1055:7:0",
"typeDescriptions": {
"typeIdentifier": "t_uint160",
"typeString": "uint160"
}
},
"visibility": "internal"
},
{
"constant": false,
"id": 10,
"mutability": "mutable",
"name": "initialized",
"nodeType": "VariableDeclaration",
"scope": 11,
"src": "1163:16:0",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
},
"typeName": {
"id": 9,
"name": "bool",
"nodeType": "ElementaryTypeName",
"src": "1163:4:0",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"visibility": "internal"
}
],
"name": "Observation",
"nodeType": "StructDefinition",
"scope": 734,
"src": "704:482:0",
"visibility": "public"
},
{
"body": {
"id": 65,
"nodeType": "Block",
"src": "1989:455:0",
"statements": [
{
"assignments": [
26
],
"declarations": [
{
"constant": false,
"id": 26,
"mutability": "mutable",
"name": "delta",
"nodeType": "VariableDeclaration",
"scope": 65,
"src": "1999:12:0",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint32",
"typeString": "uint32"
},
"typeName": {
"id": 25,
"name": "uint32",
"nodeType": "ElementaryTypeName",
"src": "1999:6:0",
"typeDescriptions": {
"typeIdentifier": "t_uint32",
"typeString": "uint32"
}
},
"visibility": "internal"
}
],
"id": 31,
"initialValue": {
"commonType": {
"typeIdentifier": "t_uint32",
"typeString": "uint32"
},
"id": 30,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"id": 27,
"name": "blockTimestamp",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 16,
"src": "2014:14:0",
"typeDescriptions": {
"typeIdentifier": "t_uint32",
"typeString": "uint32"
}
},
"nodeType": "BinaryOperation",
"operator": "-",
"rightExpression": {
"expression": {
"id": 28,
"name": "last",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 14,
"src": "2031:4:0",
"typeDescriptions": {
"typeIdentifier": "t_struct$_Observation_$11_memory_ptr",
"typeString": "struct Oracle.Observation memory"
}
},
"id": 29,
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"memberName": "blockTimestamp",
"nodeType": "MemberAccess",
"referencedDeclaration": 4,
"src": "2031:19:0",
"typeDescriptions": {
"typeIdentifier": "t_uint32",
"typeString": "uint32"
}
},
"src": "2014:36:0",
"typeDescriptions": {
"typeIdentifier": "t_uint32",
"typeString": "uint32"
}
},
"nodeType": "VariableDeclarationStatement",
"src": "1999:51:0"
},
{
"expression": {
"arguments": [
{
"id": 33,
"name": "blockTimestamp",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 16,
"src": "2125:14:0",
"typeDescriptions": {
"typeIdentifier": "t_uint32",
"typeString": "uint32"
}
},
{
"commonType": {
"typeIdentifier": "t_int56",
"typeString": "int56"
},
"id": 42,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"expression": {
"id": 34,
"name": "last",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 14,
"src": "2173:4:0",
"typeDescriptions": {
"typeIdentifier": "t_struct$_Observation_$11_memory_ptr",
"typeString": "struct Oracle.Observation memory"
}
},
"id": 35,
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"memberName": "tickCumulative",
"nodeType": "MemberAccess",
"referencedDeclaration": 6,
"src": "2173:19:0",
"typeDescriptions": {
"typeIdentifier": "t_int56",
"typeString": "int56"
}
},
"nodeType": "BinaryOperation",
"operator": "+",
"rightExpression": {
"commonType": {
"typeIdentifier": "t_int56",
"typeString": "int56"
},
"id": 41,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"arguments": [
{
"id": 38,
"name": "tick",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 18,
"src": "2201:4:0",
"typeDescriptions": {
"typeIdentifier": "t_int24",
"typeString": "int24"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_int24",
"typeString": "int24"
}
],
"id": 37,
"isConstant": false,
"isLValue": false,
"isPure": true,
"lValueRequested": false,
"nodeType": "ElementaryTypeNameExpression",
"src": "2195:5:0",
"typeDescriptions": {
"typeIdentifier": "t_type$_t_int56_$",
"typeString": "type(int56)"
},
"typeName": {
"id": 36,
"name": "int56",
"nodeType": "ElementaryTypeName",
"src": "2195:5:0",
"typeDescriptions": {}
}
},
"id": 39,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "typeConversion",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "2195:11:0",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_int56",
"typeString": "int56"
}
},
"nodeType": "BinaryOperation",
"operator": "*",
"rightExpression": {
"id": 40,
"name": "delta",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 26,
"src": "2209:5:0",
"typeDescriptions": {
"typeIdentifier": "t_uint32",
"typeString": "uint32"
}
},
"src": "2195:19:0",
"typeDescriptions": {
"typeIdentifier": "t_int56",
"typeString": "int56"
}
},
"src": "2173:41:0",
"typeDescriptions": {
"typeIdentifier": "t_int56",
"typeString": "int56"
}
},
{
"commonType": {
"typeIdentifier": "t_uint160",
"typeString": "uint160"
},
"id": 61,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"expression": {
"id": 43,
"name": "last",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 14,
"src": "2267:4:0",
"typeDescriptions": {
"typeIdentifier": "t_struct$_Observation_$11_memory_ptr",
"typeString": "struct Oracle.Observation memory"
}
},
"id": 44,
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"memberName": "secondsPerLiquidityCumulativeX128",
"nodeType": "MemberAccess",
"referencedDeclaration": 8,
"src": "2267:38:0",
"typeDescriptions": {
"typeIdentifier": "t_uint160",
"typeString": "uint160"
}
},
"nodeType": "BinaryOperation",
"operator": "+",
"rightExpression": {
"components": [
{
"commonType": {
"typeIdentifier": "t_uint160",
"typeString": "uint160"
},
"id": 59,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"components": [
{
"commonType": {
"typeIdentifier": "t_uint160",
"typeString": "uint160"
},
"id": 50,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"arguments": [
{
"id": 47,
"name": "delta",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 26,
"src": "2338:5:0",
"typeDescriptions": {
"typeIdentifier": "t_uint32",
"typeString": "uint32"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_uint32",
"typeString": "uint32"
}
],
"id": 46,
"isConstant": false,
"isLValue": false,
"isPure": true,
"lValueRequested": false,
"nodeType": "ElementaryTypeNameExpression",
"src": "2330:7:0",
"typeDescriptions": {
"typeIdentifier": "t_type$_t_uint160_$",
"typeString": "type(uint160)"
},
"typeName": {
"id": 45,
"name": "uint160",
"nodeType": "ElementaryTypeName",
"src": "2330:7:0",
"typeDescriptions": {}
}
},
"id": 48,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "typeConversion",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "2330:14:0",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_uint160",
"typeString": "uint160"
}
},
"nodeType": "BinaryOperation",
"operator": "<<",
"rightExpression": {
"hexValue": "313238",
"id": 49,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "number",
"lValueRequested": false,
"nodeType": "Literal",
"src": "2348:3:0",
"typeDescriptions": {
"typeIdentifier": "t_rational_128_by_1",
"typeString": "int_const 128"
},
"value": "128"
},
"src": "2330:21:0",
"typeDescriptions": {
"typeIdentifier": "t_uint160",
"typeString": "uint160"
}
}
],
"id": 51,
"isConstant": false,
"isInlineArray": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"nodeType": "TupleExpression",
"src": "2329:23:0",
"typeDescriptions": {
"typeIdentifier": "t_uint160",
"typeString": "uint160"
}
},
"nodeType": "BinaryOperation",
"operator": "/",
"rightExpression": {
"components": [
{
"condition": {
"commonType": {
"typeIdentifier": "t_uint128",
"typeString": "uint128"
},
"id": 54,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"id": 52,
"name": "liquidity",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 20,
"src": "2356:9:0",
"typeDescriptions": {
"typeIdentifier": "t_uint128",
"typeString": "uint128"
}
},
"nodeType": "BinaryOperation",
"operator": ">",
"rightExpression": {
"hexValue": "30",
"id": 53,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "number",
"lValueRequested": false,
"nodeType": "Literal",
"src": "2368:1:0",
"typeDescriptions": {
"typeIdentifier": "t_rational_0_by_1",
"typeString": "int_const 0"
},
"value": "0"
},
"src": "2356:13:0",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"falseExpression": {
"hexValue": "31",
"id": 56,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "number",
"lValueRequested": false,
"nodeType": "Literal",
"src": "2384:1:0",
"typeDescriptions": {
"typeIdentifier": "t_rational_1_by_1",
"typeString": "int_const 1"
},
"value": "1"
},
"id": 57,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"nodeType": "Conditional",
"src": "2356:29:0",
"trueExpression": {
"id": 55,
"name": "liquidity",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 20,
"src": "2372:9:0",
"typeDescriptions": {
"typeIdentifier": "t_uint128",
"typeString": "uint128"
}
},
"typeDescriptions": {
"typeIdentifier": "t_uint128",
"typeString": "uint128"
}
}
],
"id": 58,
"isConstant": false,
"isInlineArray": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"nodeType": "TupleExpression",
"src": "2355:31:0",
"typeDescriptions": {
"typeIdentifier": "t_uint128",
"typeString": "uint128"
}
},
"src": "2329:57:0",
"typeDescriptions": {
"typeIdentifier": "t_uint160",
"typeString": "uint160"
}
}
],
"id": 60,
"isConstant": false,
"isInlineArray": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"nodeType": "TupleExpression",
"src": "2328:59:0",
"typeDescriptions": {
"typeIdentifier": "t_uint160",
"typeString": "uint160"
}
},
"src": "2267:120:0",
"typeDescriptions": {
"typeIdentifier": "t_uint160",
"typeString": "uint160"
}
},
{
"hexValue": "74727565",
"id": 62,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "bool",
"lValueRequested": false,
"nodeType": "Literal",
"src": "2418:4:0",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
},
"value": "true"
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_uint32",
"typeString": "uint32"
},
{
"typeIdentifier": "t_int56",
"typeString": "int56"
},
{
"typeIdentifier": "t_uint160",
"typeString": "uint160"
},
{
"typeIdentifier": "t_bool",
"typeString": "bool"
}
],
"id": 32,
"name": "Observation",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 11,
"src": "2079:11:0",
"typeDescriptions": {
"typeIdentifier": "t_type$_t_struct$_Observation_$11_storage_ptr_$",
"typeString": "type(struct Oracle.Observation storage pointer)"
}
},
"id": 63,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "structConstructorCall",
"lValueRequested": false,
"names": [
"blockTimestamp",
"tickCumulative",
"secondsPerLiquidityCumulativeX128",
"initialized"
],
"nodeType": "FunctionCall",
"src": "2079:358:0",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_struct$_Observation_$11_memory_ptr",
"typeString": "struct Oracle.Observation memory"
}
},
"functionReturnParameters": 24,
"id": 64,
"nodeType": "Return",
"src": "2060:377:0"
}
]
},
"documentation": {
"id": 12,
"nodeType": "StructuredDocumentation",
"src": "1192:614:0",
"text": "@notice Transforms a previous observation into a new observation, given the passage of time and the current tick and liquidity values\n @dev blockTimestamp _must_ be chronologically equal to or greater than last.blockTimestamp, safe for 0 or 1 overflows\n @param last The specified observation to be transformed\n @param blockTimestamp The timestamp of the new observation\n @param tick The active tick at the time of the new observation\n @param liquidity The total in-range liquidity at the time of the new observation\n @return Observation The newly populated observation"
},
"id": 66,
"implemented": true,
"kind": "function",
"modifiers": [],
"name": "transform",
"nodeType": "FunctionDefinition",
"parameters": {
"id": 21,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 14,
"mutability": "mutable",
"name": "last",
"nodeType": "VariableDeclaration",
"scope": 66,
"src": "1839:23:0",
"stateVariable": false,
"storageLocation": "memory",
"typeDescriptions": {
"typeIdentifier": "t_struct$_Observation_$11_memory_ptr",
"typeString": "struct Oracle.Observation"
},
"typeName": {
"id": 13,
"name": "Observation",
"nodeType": "UserDefinedTypeName",
"referencedDeclaration": 11,
"src": "1839:11:0",
"typeDescriptions": {
"typeIdentifier": "t_struct$_Observation_$11_storage_ptr",
"typeString": "struct Oracle.Observation"
}
},
"visibility": "internal"
},
{
"constant": false,
"id": 16,
"mutability": "mutable",
"name": "blockTimestamp",
"nodeType": "VariableDeclaration",
"scope": 66,
"src": "1872:21:0",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint32",
"typeString": "uint32"
},
"typeName": {
"id": 15,
"name": "uint32",
"nodeType": "ElementaryTypeName",
"src": "1872:6:0",
"typeDescriptions": {
"typeIdentifier": "t_uint32",
"typeString": "uint32"
}
},
"visibility": "internal"
},
{
"constant": false,
"id": 18,
"mutability": "mutable",
"name": "tick",
"nodeType": "VariableDeclaration",
"scope": 66,
"src": "1903:10:0",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_int24",
"typeString": "int24"
},
"typeName": {
"id": 17,
"name": "int24",
"nodeType": "ElementaryTypeName",
"src": "1903:5:0",
"typeDescriptions": {
"typeIdentifier": "t_int24",
"typeString": "int24"
}
},
"visibility": "internal"
},
{
"constant": false,
"id": 20,
"mutability": "mutable",
"name": "liquidity",
"nodeType": "VariableDeclaration",
"scope": 66,
"src": "1923:17:0",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint128",
"typeString": "uint128"
},
"typeName": {
"id": 19,
"name": "uint128",
"nodeType": "ElementaryTypeName",
"src": "1923:7:0",
"typeDescriptions": {
"typeIdentifier": "t_uint128",
"typeString": "uint128"
}
},
"visibility": "internal"
}
],
"src": "1829:117:0"
},
"returnParameters": {
"id": 24,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 23,
"mutability": "mutable",
"name": "",
"nodeType": "VariableDeclaration",
"scope": 66,
"src": "1969:18:0",
"stateVariable": false,
"storageLocation": "memory",
"typeDescriptions": {
"typeIdentifier": "t_struct$_Observation_$11_memory_ptr",
"typeString": "struct Oracle.Observation"
},
"typeName": {
"id": 22,
"name": "Observation",
"nodeType": "UserDefinedTypeName",
"referencedDeclaration": 11,
"src": "1969:11:0",
"typeDescriptions": {
"typeIdentifier": "t_struct$_Observation_$11_storage_ptr",
"typeString": "struct Oracle.Observation"
}
},
"visibility": "internal"
}
],
"src": "1968:20:0"
},
"scope": 734,
"src": "1811:633:0",
"stateMutability": "pure",
"virtual": false,
"visibility": "private"
},
{
"body": {
"id": 95,
"nodeType": "Block",
"src": "3045:219:0",
"statements": [
{
"expression": {
"id": 89,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftHandSide": {
"baseExpression": {
"id": 80,
"name": "self",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 71,
"src": "3055:4:0",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_struct$_Observation_$11_storage_$65535_storage_ptr",
"typeString": "struct Oracle.Observation storage ref[65535] storage pointer"
}
},
"id": 82,
"indexExpression": {
"hexValue": "30",
"id": 81,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "number",
"lValueRequested": false,
"nodeType": "Literal",
"src": "3060:1:0",
"typeDescriptions": {
"typeIdentifier": "t_rational_0_by_1",
"typeString": "int_const 0"
},
"value": "0"
},
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": true,
"nodeType": "IndexAccess",
"src": "3055:7:0",
"typeDescriptions": {
"typeIdentifier": "t_struct$_Observation_$11_storage",
"typeString": "struct Oracle.Observation storage ref"
}
},
"nodeType": "Assignment",
"operator": "=",
"rightHandSide": {
"arguments": [
{
"id": 84,
"name": "time",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 73,
"src": "3107:4:0",
"typeDescriptions": {
"typeIdentifier": "t_uint32",
"typeString": "uint32"
}
},
{
"hexValue": "30",
"id": 85,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "number",
"lValueRequested": false,
"nodeType": "Literal",
"src": "3141:1:0",
"typeDescriptions": {
"typeIdentifier": "t_rational_0_by_1",
"typeString": "int_const 0"
},
"value": "0"
},
{
"hexValue": "30",
"id": 86,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "number",
"lValueRequested": false,
"nodeType": "Literal",
"src": "3191:1:0",
"typeDescriptions": {
"typeIdentifier": "t_rational_0_by_1",
"typeString": "int_const 0"
},
"value": "0"
},
{
"hexValue": "74727565",
"id": 87,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "bool",
"lValueRequested": false,
"nodeType": "Literal",
"src": "3219:4:0",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
},
"value": "true"
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_uint32",
"typeString": "uint32"
},
{
"typeIdentifier": "t_rational_0_by_1",
"typeString": "int_const 0"
},
{
"typeIdentifier": "t_rational_0_by_1",
"typeString": "int_const 0"
},
{
"typeIdentifier": "t_bool",
"typeString": "bool"
}
],
"id": 83,
"name": "Observation",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 11,
"src": "3065:11:0",
"typeDescriptions": {
"typeIdentifier": "t_type$_t_struct$_Observation_$11_storage_ptr_$",
"typeString": "type(struct Oracle.Observation storage pointer)"
}
},
"id": 88,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "structConstructorCall",
"lValueRequested": false,
"names": [
"blockTimestamp",
"tickCumulative",
"secondsPerLiquidityCumulativeX128",
"initialized"
],
"nodeType": "FunctionCall",
"src": "3065:169:0",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_struct$_Observation_$11_memory_ptr",
"typeString": "struct Oracle.Observation memory"
}
},
"src": "3055:179:0",
"typeDescriptions": {
"typeIdentifier": "t_struct$_Observation_$11_storage",
"typeString": "struct Oracle.Observation storage ref"
}
},
"id": 90,
"nodeType": "ExpressionStatement",
"src": "3055:179:0"
},
{
"expression": {
"components": [
{
"hexValue": "31",
"id": 91,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "number",
"lValueRequested": false,
"nodeType": "Literal",
"src": "3252:1:0",
"typeDescriptions": {
"typeIdentifier": "t_rational_1_by_1",
"typeString": "int_const 1"
},
"value": "1"
},
{
"hexValue": "31",
"id": 92,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "number",
"lValueRequested": false,
"nodeType": "Literal",
"src": "3255:1:0",
"typeDescriptions": {
"typeIdentifier": "t_rational_1_by_1",
"typeString": "int_const 1"
},
"value": "1"
}
],
"id": 93,
"isConstant": false,
"isInlineArray": false,
"isLValue": false,
"isPure": true,
"lValueRequested": false,
"nodeType": "TupleExpression",
"src": "3251:6:0",
"typeDescriptions": {
"typeIdentifier": "t_tuple$_t_rational_1_by_1_$_t_rational_1_by_1_$",
"typeString": "tuple(int_const 1,int_const 1)"
}
},
"functionReturnParameters": 79,
"id": 94,
"nodeType": "Return",
"src": "3244:13:0"
}
]
},
"documentation": {
"id": 67,
"nodeType": "StructuredDocumentation",
"src": "2450:440:0",
"text": "@notice Initialize the oracle array by writing the first slot. Called once for the lifecycle of the observations array\n @param self The stored oracle array\n @param time The time of the oracle initialization, via block.timestamp truncated to uint32\n @return cardinality The number of populated elements in the oracle array\n @return cardinalityNext The new length of the oracle array, independent of population"
},
"id": 96,
"implemented": true,
"kind": "function",
"modifiers": [],
"name": "initialize",
"nodeType": "FunctionDefinition",
"parameters": {
"id": 74,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 71,
"mutability": "mutable",
"name": "self",
"nodeType": "VariableDeclaration",
"scope": 96,
"src": "2924:31:0",
"stateVariable": false,
"storageLocation": "storage",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_struct$_Observation_$11_storage_$65535_storage_ptr",
"typeString": "struct Oracle.Observation[65535]"
},
"typeName": {
"baseType": {
"id": 68,
"name": "Observation",
"nodeType": "UserDefinedTypeName",
"referencedDeclaration": 11,
"src": "2924:11:0",
"typeDescriptions": {
"typeIdentifier": "t_struct$_Observation_$11_storage_ptr",
"typeString": "struct Oracle.Observation"
}
},
"id": 70,
"length": {
"hexValue": "3635353335",
"id": 69,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "number",
"lValueRequested": false,
"nodeType": "Literal",
"src": "2936:5:0",
"typeDescriptions": {
"typeIdentifier": "t_rational_65535_by_1",
"typeString": "int_const 65535"
},
"value": "65535"
},
"nodeType": "ArrayTypeName",
"src": "2924:18:0",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_struct$_Observation_$11_storage_$65535_storage_ptr",
"typeString": "struct Oracle.Observation[65535]"
}
},
"visibility": "internal"
},
{
"constant": false,
"id": 73,
"mutability": "mutable",
"name": "time",
"nodeType": "VariableDeclaration",
"scope": 96,
"src": "2965:11:0",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint32",
"typeString": "uint32"
},
"typeName": {
"id": 72,
"name": "uint32",
"nodeType": "ElementaryTypeName",
"src": "2965:6:0",
"typeDescriptions": {
"typeIdentifier": "t_uint32",
"typeString": "uint32"
}
},
"visibility": "internal"
}
],
"src": "2914:68:0"
},
"returnParameters": {
"id": 79,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 76,
"mutability": "mutable",
"name": "cardinality",
"nodeType": "VariableDeclaration",
"scope": 96,
"src": "3001:18:0",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint16",
"typeString": "uint16"
},
"typeName": {
"id": 75,
"name": "uint16",
"nodeType": "ElementaryTypeName",
"src": "3001:6:0",
"typeDescriptions": {
"typeIdentifier": "t_uint16",
"typeString": "uint16"
}
},
"visibility": "internal"
},
{
"constant": false,
"id": 78,
"mutability": "mutable",
"name": "cardinalityNext",
"nodeType": "VariableDeclaration",
"scope": 96,
"src": "3021:22:0",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint16",
"typeString": "uint16"
},
"typeName": {
"id": 77,
"name": "uint16",
"nodeType": "ElementaryTypeName",
"src": "3021:6:0",
"typeDescriptions": {
"typeIdentifier": "t_uint16",
"typeString": "uint16"
}
},
"visibility": "internal"
}
],
"src": "3000:44:0"
},
"scope": 734,
"src": "2895:369:0",
"stateMutability": "nonpayable",
"virtual": false,
"visibility": "internal"
},
{
"body": {
"id": 176,
"nodeType": "Block",
"src": "4729:614:0",
"statements": [
{
"assignments": [
121
],
"declarations": [
{
"constant": false,
"id": 121,
"mutability": "mutable",
"name": "last",
"nodeType": "VariableDeclaration",
"scope": 176,
"src": "4739:23:0",
"stateVariable": false,
"storageLocation": "memory",
"typeDescriptions": {
"typeIdentifier": "t_struct$_Observation_$11_memory_ptr",
"typeString": "struct Oracle.Observation"
},
"typeName": {
"id": 120,
"name": "Observation",
"nodeType": "UserDefinedTypeName",
"referencedDeclaration": 11,
"src": "4739:11:0",
"typeDescriptions": {
"typeIdentifier": "t_struct$_Observation_$11_storage_ptr",
"typeString": "struct Oracle.Observation"
}
},
"visibility": "internal"
}
],
"id": 125,
"initialValue": {
"baseExpression": {
"id": 122,
"name": "self",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 101,
"src": "4765:4:0",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_struct$_Observation_$11_storage_$65535_storage_ptr",
"typeString": "struct Oracle.Observation storage ref[65535] storage pointer"
}
},
"id": 124,
"indexExpression": {
"id": 123,
"name": "index",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 103,
"src": "4770:5:0",
"typeDescriptions": {
"typeIdentifier": "t_uint16",
"typeString": "uint16"
}
},
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"nodeType": "IndexAccess",
"src": "4765:11:0",
"typeDescriptions": {
"typeIdentifier": "t_struct$_Observation_$11_storage",
"typeString": "struct Oracle.Observation storage ref"
}
},
"nodeType": "VariableDeclarationStatement",
"src": "4739:37:0"
},
{
"condition": {
"commonType": {
"typeIdentifier": "t_uint32",
"typeString": "uint32"
},
"id": 129,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"expression": {
"id": 126,
"name": "last",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 121,
"src": "4866:4:0",
"typeDescriptions": {
"typeIdentifier": "t_struct$_Observation_$11_memory_ptr",
"typeString": "struct Oracle.Observation memory"
}
},
"id": 127,
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"memberName": "blockTimestamp",
"nodeType": "MemberAccess",
"referencedDeclaration": 4,
"src": "4866:19:0",
"typeDescriptions": {
"typeIdentifier": "t_uint32",
"typeString": "uint32"
}
},
"nodeType": "BinaryOperation",
"operator": "==",
"rightExpression": {
"id": 128,
"name": "blockTimestamp",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 105,
"src": "4889:14:0",
"typeDescriptions": {
"typeIdentifier": "t_uint32",
"typeString": "uint32"
}
},
"src": "4866:37:0",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"id": 134,
"nodeType": "IfStatement",
"src": "4862:70:0",
"trueBody": {
"expression": {
"components": [
{
"id": 130,
"name": "index",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 103,
"src": "4913:5:0",
"typeDescriptions": {
"typeIdentifier": "t_uint16",
"typeString": "uint16"
}
},
{
"id": 131,
"name": "cardinality",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 111,
"src": "4920:11:0",
"typeDescriptions": {
"typeIdentifier": "t_uint16",
"typeString": "uint16"
}
}
],
"id": 132,
"isConstant": false,
"isInlineArray": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"nodeType": "TupleExpression",
"src": "4912:20:0",
"typeDescriptions": {
"typeIdentifier": "t_tuple$_t_uint16_$_t_uint16_$",
"typeString": "tuple(uint16,uint16)"
}
},
"functionReturnParameters": 119,
"id": 133,
"nodeType": "Return",
"src": "4905:27:0"
}
},
{
"condition": {
"commonType": {
"typeIdentifier": "t_bool",
"typeString": "bool"
},
"id": 144,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"commonType": {
"typeIdentifier": "t_uint16",
"typeString": "uint16"
},
"id": 137,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"id": 135,
"name": "cardinalityNext",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 113,
"src": "5015:15:0",
"typeDescriptions": {
"typeIdentifier": "t_uint16",
"typeString": "uint16"
}
},
"nodeType": "BinaryOperation",
"operator": ">",
"rightExpression": {
"id": 136,
"name": "cardinality",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 111,
"src": "5033:11:0",
"typeDescriptions": {
"typeIdentifier": "t_uint16",
"typeString": "uint16"
}
},
"src": "5015:29:0",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"nodeType": "BinaryOperation",
"operator": "&&",
"rightExpression": {
"commonType": {
"typeIdentifier": "t_uint16",
"typeString": "uint16"
},
"id": 143,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"id": 138,
"name": "index",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 103,
"src": "5048:5:0",
"typeDescriptions": {
"typeIdentifier": "t_uint16",
"typeString": "uint16"
}
},
"nodeType": "BinaryOperation",
"operator": "==",
"rightExpression": {
"components": [
{
"commonType": {
"typeIdentifier": "t_uint16",
"typeString": "uint16"
},
"id": 141,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"id": 139,
"name": "cardinality",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 111,
"src": "5058:11:0",
"typeDescriptions": {
"typeIdentifier": "t_uint16",
"typeString": "uint16"
}
},
"nodeType": "BinaryOperation",
"operator": "-",
"rightExpression": {
"hexValue": "31",
"id": 140,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "number",
"lValueRequested": false,
"nodeType": "Literal",
"src": "5072:1:0",
"typeDescriptions": {
"typeIdentifier": "t_rational_1_by_1",
"typeString": "int_const 1"
},
"value": "1"
},
"src": "5058:15:0",
"typeDescriptions": {
"typeIdentifier": "t_uint16",
"typeString": "uint16"
}
}
],
"id": 142,
"isConstant": false,
"isInlineArray": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"nodeType": "TupleExpression",
"src": "5057:17:0",
"typeDescriptions": {
"typeIdentifier": "t_uint16",
"typeString": "uint16"
}
},
"src": "5048:26:0",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"src": "5015:59:0",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"falseBody": {
"id": 154,
"nodeType": "Block",
"src": "5143:57:0",
"statements": [
{
"expression": {
"id": 152,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftHandSide": {
"id": 150,
"name": "cardinalityUpdated",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 118,
"src": "5157:18:0",
"typeDescriptions": {
"typeIdentifier": "t_uint16",
"typeString": "uint16"
}
},
"nodeType": "Assignment",
"operator": "=",
"rightHandSide": {
"id": 151,
"name": "cardinality",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 111,
"src": "5178:11:0",
"typeDescriptions": {
"typeIdentifier": "t_uint16",
"typeString": "uint16"
}
},
"src": "5157:32:0",
"typeDescriptions": {
"typeIdentifier": "t_uint16",
"typeString": "uint16"
}
},
"id": 153,
"nodeType": "ExpressionStatement",
"src": "5157:32:0"
}
]
},
"id": 155,
"nodeType": "IfStatement",
"src": "5011:189:0",
"trueBody": {
"id": 149,
"nodeType": "Block",
"src": "5076:61:0",
"statements": [
{
"expression": {
"id": 147,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftHandSide": {
"id": 145,
"name": "cardinalityUpdated",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 118,
"src": "5090:18:0",
"typeDescriptions": {
"typeIdentifier": "t_uint16",
"typeString": "uint16"
}
},
"nodeType": "Assignment",
"operator": "=",
"rightHandSide": {
"id": 146,
"name": "cardinalityNext",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 113,
"src": "5111:15:0",
"typeDescriptions": {
"typeIdentifier": "t_uint16",
"typeString": "uint16"
}
},
"src": "5090:36:0",
"typeDescriptions": {
"typeIdentifier": "t_uint16",
"typeString": "uint16"
}
},
"id": 148,
"nodeType": "ExpressionStatement",
"src": "5090:36:0"
}
]
}
},
{
"expression": {
"id": 163,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftHandSide": {
"id": 156,
"name": "indexUpdated",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 116,
"src": "5210:12:0",
"typeDescriptions": {
"typeIdentifier": "t_uint16",
"typeString": "uint16"
}
},
"nodeType": "Assignment",
"operator": "=",
"rightHandSide": {
"commonType": {
"typeIdentifier": "t_uint16",
"typeString": "uint16"
},
"id": 162,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"components": [
{
"commonType": {
"typeIdentifier": "t_uint16",
"typeString": "uint16"
},
"id": 159,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"id": 157,
"name": "index",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 103,
"src": "5226:5:0",
"typeDescriptions": {
"typeIdentifier": "t_uint16",
"typeString": "uint16"
}
},
"nodeType": "BinaryOperation",
"operator": "+",
"rightExpression": {
"hexValue": "31",
"id": 158,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "number",
"lValueRequested": false,
"nodeType": "Literal",
"src": "5234:1:0",
"typeDescriptions": {
"typeIdentifier": "t_rational_1_by_1",
"typeString": "int_const 1"
},
"value": "1"
},
"src": "5226:9:0",
"typeDescriptions": {
"typeIdentifier": "t_uint16",
"typeString": "uint16"
}
}
],
"id": 160,
"isConstant": false,
"isInlineArray": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"nodeType": "TupleExpression",
"src": "5225:11:0",
"typeDescriptions": {
"typeIdentifier": "t_uint16",
"typeString": "uint16"
}
},
"nodeType": "BinaryOperation",
"operator": "%",
"rightExpression": {
"id": 161,
"name": "cardinalityUpdated",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 118,
"src": "5239:18:0",
"typeDescriptions": {
"typeIdentifier": "t_uint16",
"typeString": "uint16"
}
},
"src": "5225:32:0",
"typeDescriptions": {
"typeIdentifier": "t_uint16",
"typeString": "uint16"
}
},
"src": "5210:47:0",
"typeDescriptions": {
"typeIdentifier": "t_uint16",
"typeString": "uint16"
}
},
"id": 164,
"nodeType": "ExpressionStatement",
"src": "5210:47:0"
},
{
"expression": {
"id": 174,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftHandSide": {
"baseExpression": {
"id": 165,
"name": "self",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 101,
"src": "5267:4:0",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_struct$_Observation_$11_storage_$65535_storage_ptr",
"typeString": "struct Oracle.Observation storage ref[65535] storage pointer"
}
},
"id": 167,
"indexExpression": {
"id": 166,
"name": "indexUpdated",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 116,
"src": "5272:12:0",
"typeDescriptions": {
"typeIdentifier": "t_uint16",
"typeString": "uint16"
}
},
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": true,
"nodeType": "IndexAccess",
"src": "5267:18:0",
"typeDescriptions": {
"typeIdentifier": "t_struct$_Observation_$11_storage",
"typeString": "struct Oracle.Observation storage ref"
}
},
"nodeType": "Assignment",
"operator": "=",
"rightHandSide": {
"arguments": [
{
"id": 169,
"name": "last",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 121,
"src": "5298:4:0",
"typeDescriptions": {
"typeIdentifier": "t_struct$_Observation_$11_memory_ptr",
"typeString": "struct Oracle.Observation memory"
}
},
{
"id": 170,
"name": "blockTimestamp",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 105,
"src": "5304:14:0",
"typeDescriptions": {
"typeIdentifier": "t_uint32",
"typeString": "uint32"
}
},
{
"id": 171,
"name": "tick",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 107,
"src": "5320:4:0",
"typeDescriptions": {
"typeIdentifier": "t_int24",
"typeString": "int24"
}
},
{
"id": 172,
"name": "liquidity",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 109,
"src": "5326:9:0",
"typeDescriptions": {
"typeIdentifier": "t_uint128",
"typeString": "uint128"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_struct$_Observation_$11_memory_ptr",
"typeString": "struct Oracle.Observation memory"
},
{
"typeIdentifier": "t_uint32",
"typeString": "uint32"
},
{
"typeIdentifier": "t_int24",
"typeString": "int24"
},
{
"typeIdentifier": "t_uint128",
"typeString": "uint128"
}
],
"id": 168,
"name": "transform",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 66,
"src": "5288:9:0",
"typeDescriptions": {
"typeIdentifier": "t_function_internal_pure$_t_struct$_Observation_$11_memory_ptr_$_t_uint32_$_t_int24_$_t_uint128_$returns$_t_struct$_Observation_$11_memory_ptr_$",
"typeString": "function (struct Oracle.Observation memory,uint32,int24,uint128) pure returns (struct Oracle.Observation memory)"
}
},
"id": 173,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "5288:48:0",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_struct$_Observation_$11_memory_ptr",
"typeString": "struct Oracle.Observation memory"
}
},
"src": "5267:69:0",
"typeDescriptions": {
"typeIdentifier": "t_struct$_Observation_$11_storage",
"typeString": "struct Oracle.Observation storage ref"
}
},
"id": 175,
"nodeType": "ExpressionStatement",
"src": "5267:69:0"
}
]
},
"documentation": {
"id": 97,
"nodeType": "StructuredDocumentation",
"src": "3270:1166:0",
"text": "@notice Writes an oracle observation to the array\n @dev Writable at most once per block. Index represents the most recently written element. cardinality and index must be tracked externally.\n If the index is at the end of the allowable array length (according to cardinality), and the next cardinality\n is greater than the current one, cardinality may be increased. This restriction is created to preserve ordering.\n @param self The stored oracle array\n @param index The index of the observation that was most recently written to the observations array\n @param blockTimestamp The timestamp of the new observation\n @param tick The active tick at the time of the new observation\n @param liquidity The total in-range liquidity at the time of the new observation\n @param cardinality The number of populated elements in the oracle array\n @param cardinalityNext The new length of the oracle array, independent of population\n @return indexUpdated The new index of the most recently written element in the oracle array\n @return cardinalityUpdated The new cardinality of the oracle array"
},
"id": 177,
"implemented": true,
"kind": "function",
"modifiers": [],
"name": "write",
"nodeType": "FunctionDefinition",
"parameters": {
"id": 114,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 101,
"mutability": "mutable",
"name": "self",
"nodeType": "VariableDeclaration",
"scope": 177,
"src": "4465:31:0",
"stateVariable": false,
"storageLocation": "storage",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_struct$_Observation_$11_storage_$65535_storage_ptr",
"typeString": "struct Oracle.Observation[65535]"
},
"typeName": {
"baseType": {
"id": 98,
"name": "Observation",
"nodeType": "UserDefinedTypeName",
"referencedDeclaration": 11,
"src": "4465:11:0",
"typeDescriptions": {
"typeIdentifier": "t_struct$_Observation_$11_storage_ptr",
"typeString": "struct Oracle.Observation"
}
},
"id": 100,
"length": {
"hexValue": "3635353335",
"id": 99,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "number",
"lValueRequested": false,
"nodeType": "Literal",
"src": "4477:5:0",
"typeDescriptions": {
"typeIdentifier": "t_rational_65535_by_1",
"typeString": "int_const 65535"
},
"value": "65535"
},
"nodeType": "ArrayTypeName",
"src": "4465:18:0",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_struct$_Observation_$11_storage_$65535_storage_ptr",
"typeString": "struct Oracle.Observation[65535]"
}
},
"visibility": "internal"
},
{
"constant": false,
"id": 103,
"mutability": "mutable",
"name": "index",
"nodeType": "VariableDeclaration",
"scope": 177,
"src": "4506:12:0",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint16",
"typeString": "uint16"
},
"typeName": {
"id": 102,
"name": "uint16",
"nodeType": "ElementaryTypeName",
"src": "4506:6:0",
"typeDescriptions": {
"typeIdentifier": "t_uint16",
"typeString": "uint16"
}
},
"visibility": "internal"
},
{
"constant": false,
"id": 105,
"mutability": "mutable",
"name": "blockTimestamp",
"nodeType": "VariableDeclaration",
"scope": 177,
"src": "4528:21:0",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint32",
"typeString": "uint32"
},
"typeName": {
"id": 104,
"name": "uint32",
"nodeType": "ElementaryTypeName",
"src": "4528:6:0",
"typeDescriptions": {
"typeIdentifier": "t_uint32",
"typeString": "uint32"
}
},
"visibility": "internal"
},
{
"constant": false,
"id": 107,
"mutability": "mutable",
"name": "tick",
"nodeType": "VariableDeclaration",
"scope": 177,
"src": "4559:10:0",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_int24",
"typeString": "int24"
},
"typeName": {
"id": 106,
"name": "int24",
"nodeType": "ElementaryTypeName",
"src": "4559:5:0",
"typeDescriptions": {
"typeIdentifier": "t_int24",
"typeString": "int24"
}
},
"visibility": "internal"
},
{
"constant": false,
"id": 109,
"mutability": "mutable",
"name": "liquidity",
"nodeType": "VariableDeclaration",
"scope": 177,
"src": "4579:17:0",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint128",
"typeString": "uint128"
},
"typeName": {
"id": 108,
"name": "uint128",
"nodeType": "ElementaryTypeName",
"src": "4579:7:0",
"typeDescriptions": {
"typeIdentifier": "t_uint128",
"typeString": "uint128"
}
},
"visibility": "internal"
},
{
"constant": false,
"id": 111,
"mutability": "mutable",
"name": "cardinality",
"nodeType": "VariableDeclaration",
"scope": 177,
"src": "4606:18:0",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint16",
"typeString": "uint16"
},
"typeName": {
"id": 110,
"name": "uint16",
"nodeType": "ElementaryTypeName",
"src": "4606:6:0",
"typeDescriptions": {
"typeIdentifier": "t_uint16",
"typeString": "uint16"
}
},
"visibility": "internal"
},
{
"constant": false,
"id": 113,
"mutability": "mutable",
"name": "cardinalityNext",
"nodeType": "VariableDeclaration",
"scope": 177,
"src": "4634:22:0",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint16",
"typeString": "uint16"
},
"typeName": {
"id": 112,
"name": "uint16",
"nodeType": "ElementaryTypeName",
"src": "4634:6:0",
"typeDescriptions": {
"typeIdentifier": "t_uint16",
"typeString": "uint16"
}
},
"visibility": "internal"
}
],
"src": "4455:207:0"
},
"returnParameters": {
"id": 119,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 116,
"mutability": "mutable",
"name": "indexUpdated",
"nodeType": "VariableDeclaration",
"scope": 177,
"src": "4681:19:0",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint16",
"typeString": "uint16"
},
"typeName": {
"id": 115,
"name": "uint16",
"nodeType": "ElementaryTypeName",
"src": "4681:6:0",
"typeDescriptions": {
"typeIdentifier": "t_uint16",
"typeString": "uint16"
}
},
"visibility": "internal"
},
{
"constant": false,
"id": 118,
"mutability": "mutable",
"name": "cardinalityUpdated",
"nodeType": "VariableDeclaration",
"scope": 177,
"src": "4702:25:0",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint16",
"typeString": "uint16"
},
"typeName": {
"id": 117,
"name": "uint16",
"nodeType": "ElementaryTypeName",
"src": "4702:6:0",
"typeDescriptions": {
"typeIdentifier": "t_uint16",
"typeString": "uint16"
}
},
"visibility": "internal"
}
],
"src": "4680:48:0"
},
"scope": 734,
"src": "4441:902:0",
"stateMutability": "nonpayable",
"virtual": false,
"visibility": "internal"
},
{
"body": {
"id": 224,
"nodeType": "Block",
"src": "5824:417:0",
"statements": [
{
"expression": {
"arguments": [
{
"commonType": {
"typeIdentifier": "t_uint16",
"typeString": "uint16"
},
"id": 194,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"id": 192,
"name": "current",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 184,
"src": "5842:7:0",
"typeDescriptions": {
"typeIdentifier": "t_uint16",
"typeString": "uint16"
}
},
"nodeType": "BinaryOperation",
"operator": ">",
"rightExpression": {
"hexValue": "30",
"id": 193,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "number",
"lValueRequested": false,
"nodeType": "Literal",
"src": "5852:1:0",
"typeDescriptions": {
"typeIdentifier": "t_rational_0_by_1",
"typeString": "int_const 0"
},
"value": "0"
},
"src": "5842:11:0",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
{
"hexValue": "49",
"id": 195,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "string",
"lValueRequested": false,
"nodeType": "Literal",
"src": "5855:3:0",
"typeDescriptions": {
"typeIdentifier": "t_stringliteral_8d61ecf6e15472e15b1a0f63cd77f62aa57e6edcd3871d7a841f1056fb42b216",
"typeString": "literal_string \"I\""
},
"value": "I"
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_bool",
"typeString": "bool"
},
{
"typeIdentifier": "t_stringliteral_8d61ecf6e15472e15b1a0f63cd77f62aa57e6edcd3871d7a841f1056fb42b216",
"typeString": "literal_string \"I\""
}
],
"id": 191,
"name": "require",
"nodeType": "Identifier",
"overloadedDeclarations": [
-18,
-18
],
"referencedDeclaration": -18,
"src": "5834:7:0",
"typeDescriptions": {
"typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$",
"typeString": "function (bool,string memory) pure"
}
},
"id": 196,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "5834:25:0",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_tuple$__$",
"typeString": "tuple()"
}
},
"id": 197,
"nodeType": "ExpressionStatement",
"src": "5834:25:0"
},
{
"condition": {
"commonType": {
"typeIdentifier": "t_uint16",
"typeString": "uint16"
},
"id": 200,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"id": 198,
"name": "next",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 186,
"src": "5957:4:0",
"typeDescriptions": {
"typeIdentifier": "t_uint16",
"typeString": "uint16"
}
},
"nodeType": "BinaryOperation",
"operator": "<=",
"rightExpression": {
"id": 199,
"name": "current",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 184,
"src": "5965:7:0",
"typeDescriptions": {
"typeIdentifier": "t_uint16",
"typeString": "uint16"
}
},
"src": "5957:15:0",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"id": 203,
"nodeType": "IfStatement",
"src": "5953:35:0",
"trueBody": {
"expression": {
"id": 201,
"name": "current",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 184,
"src": "5981:7:0",
"typeDescriptions": {
"typeIdentifier": "t_uint16",
"typeString": "uint16"
}
},
"functionReturnParameters": 190,
"id": 202,
"nodeType": "Return",
"src": "5974:14:0"
}
},
{
"body": {
"expression": {
"id": 219,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftHandSide": {
"expression": {
"baseExpression": {
"id": 214,
"name": "self",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 182,
"src": "6187:4:0",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_struct$_Observation_$11_storage_$65535_storage_ptr",
"typeString": "struct Oracle.Observation storage ref[65535] storage pointer"
}
},
"id": 216,
"indexExpression": {
"id": 215,
"name": "i",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 205,
"src": "6192:1:0",
"typeDescriptions": {
"typeIdentifier": "t_uint16",
"typeString": "uint16"
}
},
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"nodeType": "IndexAccess",
"src": "6187:7:0",
"typeDescriptions": {
"typeIdentifier": "t_struct$_Observation_$11_storage",
"typeString": "struct Oracle.Observation storage ref"
}
},
"id": 217,
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": true,
"memberName": "blockTimestamp",
"nodeType": "MemberAccess",
"referencedDeclaration": 4,
"src": "6187:22:0",
"typeDescriptions": {
"typeIdentifier": "t_uint32",
"typeString": "uint32"
}
},
"nodeType": "Assignment",
"operator": "=",
"rightHandSide": {
"hexValue": "31",
"id": 218,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "number",
"lValueRequested": false,
"nodeType": "Literal",
"src": "6212:1:0",
"typeDescriptions": {
"typeIdentifier": "t_rational_1_by_1",
"typeString": "int_const 1"
},
"value": "1"
},
"src": "6187:26:0",
"typeDescriptions": {
"typeIdentifier": "t_uint32",
"typeString": "uint32"
}
},
"id": 220,
"nodeType": "ExpressionStatement",
"src": "6187:26:0"
},
"condition": {
"commonType": {
"typeIdentifier": "t_uint16",
"typeString": "uint16"
},
"id": 210,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"id": 208,
"name": "i",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 205,
"src": "6172:1:0",
"typeDescriptions": {
"typeIdentifier": "t_uint16",
"typeString": "uint16"
}
},
"nodeType": "BinaryOperation",
"operator": "<",
"rightExpression": {
"id": 209,
"name": "next",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 186,
"src": "6176:4:0",
"typeDescriptions": {
"typeIdentifier": "t_uint16",
"typeString": "uint16"
}
},
"src": "6172:8:0",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"id": 221,
"initializationExpression": {
"assignments": [
205
],
"declarations": [
{
"constant": false,
"id": 205,
"mutability": "mutable",
"name": "i",
"nodeType": "VariableDeclaration",
"scope": 221,
"src": "6152:8:0",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint16",
"typeString": "uint16"
},
"typeName": {
"id": 204,
"name": "uint16",
"nodeType": "ElementaryTypeName",
"src": "6152:6:0",
"typeDescriptions": {
"typeIdentifier": "t_uint16",
"typeString": "uint16"
}
},
"visibility": "internal"
}
],
"id": 207,
"initialValue": {
"id": 206,
"name": "current",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 184,
"src": "6163:7:0",
"typeDescriptions": {
"typeIdentifier": "t_uint16",
"typeString": "uint16"
}
},
"nodeType": "VariableDeclarationStatement",
"src": "6152:18:0"
},
"loopExpression": {
"expression": {
"id": 212,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"nodeType": "UnaryOperation",
"operator": "++",
"prefix": false,
"src": "6182:3:0",
"subExpression": {
"id": 211,
"name": "i",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 205,
"src": "6182:1:0",
"typeDescriptions": {
"typeIdentifier": "t_uint16",
"typeString": "uint16"
}
},
"typeDescriptions": {
"typeIdentifier": "t_uint16",
"typeString": "uint16"
}
},
"id": 213,
"nodeType": "ExpressionStatement",
"src": "6182:3:0"
},
"nodeType": "ForStatement",
"src": "6147:66:0"
},
{
"expression": {
"id": 222,
"name": "next",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 186,
"src": "6230:4:0",
"typeDescriptions": {
"typeIdentifier": "t_uint16",
"typeString": "uint16"
}
},
"functionReturnParameters": 190,
"id": 223,
"nodeType": "Return",
"src": "6223:11:0"
}
]
},
"documentation": {
"id": 178,
"nodeType": "StructuredDocumentation",
"src": "5349:368:0",
"text": "@notice Prepares the oracle array to store up to `next` observations\n @param self The stored oracle array\n @param current The current next cardinality of the oracle array\n @param next The proposed next cardinality which will be populated in the oracle array\n @return next The next cardinality which will be populated in the oracle array"
},
"id": 225,
"implemented": true,
"kind": "function",
"modifiers": [],
"name": "grow",
"nodeType": "FunctionDefinition",
"parameters": {
"id": 187,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 182,
"mutability": "mutable",
"name": "self",
"nodeType": "VariableDeclaration",
"scope": 225,
"src": "5736:31:0",
"stateVariable": false,
"storageLocation": "storage",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_struct$_Observation_$11_storage_$65535_storage_ptr",
"typeString": "struct Oracle.Observation[65535]"
},
"typeName": {
"baseType": {
"id": 179,
"name": "Observation",
"nodeType": "UserDefinedTypeName",
"referencedDeclaration": 11,
"src": "5736:11:0",
"typeDescriptions": {
"typeIdentifier": "t_struct$_Observation_$11_storage_ptr",
"typeString": "struct Oracle.Observation"
}
},
"id": 181,
"length": {
"hexValue": "3635353335",
"id": 180,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "number",
"lValueRequested": false,
"nodeType": "Literal",
"src": "5748:5:0",
"typeDescriptions": {
"typeIdentifier": "t_rational_65535_by_1",
"typeString": "int_const 65535"
},
"value": "65535"
},
"nodeType": "ArrayTypeName",
"src": "5736:18:0",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_struct$_Observation_$11_storage_$65535_storage_ptr",
"typeString": "struct Oracle.Observation[65535]"
}
},
"visibility": "internal"
},
{
"constant": false,
"id": 184,
"mutability": "mutable",
"name": "current",
"nodeType": "VariableDeclaration",
"scope": 225,
"src": "5769:14:0",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint16",
"typeString": "uint16"
},
"typeName": {
"id": 183,
"name": "uint16",
"nodeType": "ElementaryTypeName",
"src": "5769:6:0",
"typeDescriptions": {
"typeIdentifier": "t_uint16",
"typeString": "uint16"
}
},
"visibility": "internal"
},
{
"constant": false,
"id": 186,
"mutability": "mutable",
"name": "next",
"nodeType": "VariableDeclaration",
"scope": 225,
"src": "5785:11:0",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint16",
"typeString": "uint16"
},
"typeName": {
"id": 185,
"name": "uint16",
"nodeType": "ElementaryTypeName",
"src": "5785:6:0",
"typeDescriptions": {
"typeIdentifier": "t_uint16",
"typeString": "uint16"
}
},
"visibility": "internal"
}
],
"src": "5735:62:0"
},
"returnParameters": {
"id": 190,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 189,
"mutability": "mutable",
"name": "",
"nodeType": "VariableDeclaration",
"scope": 225,
"src": "5816:6:0",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint16",
"typeString": "uint16"
},
"typeName": {
"id": 188,
"name": "uint16",
"nodeType": "ElementaryTypeName",
"src": "5816:6:0",
"typeDescriptions": {
"typeIdentifier": "t_uint16",
"typeString": "uint16"
}
},
"visibility": "internal"
}
],
"src": "5815:8:0"
},
"scope": 734,
"src": "5722:519:0",
"stateMutability": "nonpayable",
"virtual": false,
"visibility": "internal"
},
{
"body": {
"id": 279,
"nodeType": "Block",
"src": "6749:271:0",
"statements": [
{
"condition": {
"commonType": {
"typeIdentifier": "t_bool",
"typeString": "bool"
},
"id": 243,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"commonType": {
"typeIdentifier": "t_uint32",
"typeString": "uint32"
},
"id": 239,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"id": 237,
"name": "a",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 230,
"src": "6823:1:0",
"typeDescriptions": {
"typeIdentifier": "t_uint32",
"typeString": "uint32"
}
},
"nodeType": "BinaryOperation",
"operator": "<=",
"rightExpression": {
"id": 238,
"name": "time",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 228,
"src": "6828:4:0",
"typeDescriptions": {
"typeIdentifier": "t_uint32",
"typeString": "uint32"
}
},
"src": "6823:9:0",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"nodeType": "BinaryOperation",
"operator": "&&",
"rightExpression": {
"commonType": {
"typeIdentifier": "t_uint32",
"typeString": "uint32"
},
"id": 242,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"id": 240,
"name": "b",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 232,
"src": "6836:1:0",
"typeDescriptions": {
"typeIdentifier": "t_uint32",
"typeString": "uint32"
}
},
"nodeType": "BinaryOperation",
"operator": "<=",
"rightExpression": {
"id": 241,
"name": "time",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 228,
"src": "6841:4:0",
"typeDescriptions": {
"typeIdentifier": "t_uint32",
"typeString": "uint32"
}
},
"src": "6836:9:0",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"src": "6823:22:0",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"id": 248,
"nodeType": "IfStatement",
"src": "6819:41:0",
"trueBody": {
"expression": {
"commonType": {
"typeIdentifier": "t_uint32",
"typeString": "uint32"
},
"id": 246,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"id": 244,
"name": "a",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 230,
"src": "6854:1:0",
"typeDescriptions": {
"typeIdentifier": "t_uint32",
"typeString": "uint32"
}
},
"nodeType": "BinaryOperation",
"operator": "<=",
"rightExpression": {
"id": 245,
"name": "b",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 232,
"src": "6859:1:0",
"typeDescriptions": {
"typeIdentifier": "t_uint32",
"typeString": "uint32"
}
},
"src": "6854:6:0",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"functionReturnParameters": 236,
"id": 247,
"nodeType": "Return",
"src": "6847:13:0"
}
},
{
"assignments": [
250
],
"declarations": [
{
"constant": false,
"id": 250,
"mutability": "mutable",
"name": "aAdjusted",
"nodeType": "VariableDeclaration",
"scope": 279,
"src": "6871:17:0",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 249,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "6871:7:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"visibility": "internal"
}
],
"id": 261,
"initialValue": {
"condition": {
"commonType": {
"typeIdentifier": "t_uint32",
"typeString": "uint32"
},
"id": 253,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"id": 251,
"name": "a",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 230,
"src": "6891:1:0",
"typeDescriptions": {
"typeIdentifier": "t_uint32",
"typeString": "uint32"
}
},
"nodeType": "BinaryOperation",
"operator": ">",
"rightExpression": {
"id": 252,
"name": "time",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 228,
"src": "6895:4:0",
"typeDescriptions": {
"typeIdentifier": "t_uint32",
"typeString": "uint32"
}
},
"src": "6891:8:0",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"falseExpression": {
"commonType": {
"typeIdentifier": "t_uint40",
"typeString": "uint40"
},
"id": 259,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"id": 255,
"name": "a",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 230,
"src": "6906:1:0",
"typeDescriptions": {
"typeIdentifier": "t_uint32",
"typeString": "uint32"
}
},
"nodeType": "BinaryOperation",
"operator": "+",
"rightExpression": {
"commonType": {
"typeIdentifier": "t_rational_4294967296_by_1",
"typeString": "int_const 4294967296"
},
"id": 258,
"isConstant": false,
"isLValue": false,
"isPure": true,
"lValueRequested": false,
"leftExpression": {
"hexValue": "32",
"id": 256,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "number",
"lValueRequested": false,
"nodeType": "Literal",
"src": "6910:1:0",
"typeDescriptions": {
"typeIdentifier": "t_rational_2_by_1",
"typeString": "int_const 2"
},
"value": "2"
},
"nodeType": "BinaryOperation",
"operator": "**",
"rightExpression": {
"hexValue": "3332",
"id": 257,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "number",
"lValueRequested": false,
"nodeType": "Literal",
"src": "6915:2:0",
"typeDescriptions": {
"typeIdentifier": "t_rational_32_by_1",
"typeString": "int_const 32"
},
"value": "32"
},
"src": "6910:7:0",
"typeDescriptions": {
"typeIdentifier": "t_rational_4294967296_by_1",
"typeString": "int_const 4294967296"
}
},
"src": "6906:11:0",
"typeDescriptions": {
"typeIdentifier": "t_uint40",
"typeString": "uint40"
}
},
"id": 260,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"nodeType": "Conditional",
"src": "6891:26:0",
"trueExpression": {
"id": 254,
"name": "a",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 230,
"src": "6902:1:0",
"typeDescriptions": {
"typeIdentifier": "t_uint32",
"typeString": "uint32"
}
},
"typeDescriptions": {
"typeIdentifier": "t_uint40",
"typeString": "uint40"
}
},
"nodeType": "VariableDeclarationStatement",
"src": "6871:46:0"
},
{
"assignments": [
263
],
"declarations": [
{
"constant": false,
"id": 263,
"mutability": "mutable",
"name": "bAdjusted",
"nodeType": "VariableDeclaration",
"scope": 279,
"src": "6927:17:0",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 262,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "6927:7:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"visibility": "internal"
}
],
"id": 274,
"initialValue": {
"condition": {
"commonType": {
"typeIdentifier": "t_uint32",
"typeString": "uint32"
},
"id": 266,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"id": 264,
"name": "b",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 232,
"src": "6947:1:0",
"typeDescriptions": {
"typeIdentifier": "t_uint32",
"typeString": "uint32"
}
},
"nodeType": "BinaryOperation",
"operator": ">",
"rightExpression": {
"id": 265,
"name": "time",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 228,
"src": "6951:4:0",
"typeDescriptions": {
"typeIdentifier": "t_uint32",
"typeString": "uint32"
}
},
"src": "6947:8:0",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"falseExpression": {
"commonType": {
"typeIdentifier": "t_uint40",
"typeString": "uint40"
},
"id": 272,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"id": 268,
"name": "b",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 232,
"src": "6962:1:0",
"typeDescriptions": {
"typeIdentifier": "t_uint32",
"typeString": "uint32"
}
},
"nodeType": "BinaryOperation",
"operator": "+",
"rightExpression": {
"commonType": {
"typeIdentifier": "t_rational_4294967296_by_1",
"typeString": "int_const 4294967296"
},
"id": 271,
"isConstant": false,
"isLValue": false,
"isPure": true,
"lValueRequested": false,
"leftExpression": {
"hexValue": "32",
"id": 269,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "number",
"lValueRequested": false,
"nodeType": "Literal",
"src": "6966:1:0",
"typeDescriptions": {
"typeIdentifier": "t_rational_2_by_1",
"typeString": "int_const 2"
},
"value": "2"
},
"nodeType": "BinaryOperation",
"operator": "**",
"rightExpression": {
"hexValue": "3332",
"id": 270,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "number",
"lValueRequested": false,
"nodeType": "Literal",
"src": "6971:2:0",
"typeDescriptions": {
"typeIdentifier": "t_rational_32_by_1",
"typeString": "int_const 32"
},
"value": "32"
},
"src": "6966:7:0",
"typeDescriptions": {
"typeIdentifier": "t_rational_4294967296_by_1",
"typeString": "int_const 4294967296"
}
},
"src": "6962:11:0",
"typeDescriptions": {
"typeIdentifier": "t_uint40",
"typeString": "uint40"
}
},
"id": 273,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"nodeType": "Conditional",
"src": "6947:26:0",
"trueExpression": {
"id": 267,
"name": "b",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 232,
"src": "6958:1:0",
"typeDescriptions": {
"typeIdentifier": "t_uint32",
"typeString": "uint32"
}
},
"typeDescriptions": {
"typeIdentifier": "t_uint40",
"typeString": "uint40"
}
},
"nodeType": "VariableDeclarationStatement",
"src": "6927:46:0"
},
{
"expression": {
"commonType": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"id": 277,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"id": 275,
"name": "aAdjusted",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 250,
"src": "6991:9:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "BinaryOperation",
"operator": "<=",
"rightExpression": {
"id": 276,
"name": "bAdjusted",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 263,
"src": "7004:9:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"src": "6991:22:0",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"functionReturnParameters": 236,
"id": 278,
"nodeType": "Return",
"src": "6984:29:0"
}
]
},
"documentation": {
"id": 226,
"nodeType": "StructuredDocumentation",
"src": "6247:423:0",
"text": "@notice comparator for 32-bit timestamps\n @dev safe for 0 or 1 overflows, a and b _must_ be chronologically before or equal to time\n @param time A timestamp truncated to 32 bits\n @param a A comparison timestamp from which to determine the relative position of `time`\n @param b From which to determine the relative position of `time`\n @return bool Whether `a` is chronologically <= `b`"
},
"id": 280,
"implemented": true,
"kind": "function",
"modifiers": [],
"name": "lte",
"nodeType": "FunctionDefinition",
"parameters": {
"id": 233,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 228,
"mutability": "mutable",
"name": "time",
"nodeType": "VariableDeclaration",
"scope": 280,
"src": "6688:11:0",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint32",
"typeString": "uint32"
},
"typeName": {
"id": 227,
"name": "uint32",
"nodeType": "ElementaryTypeName",
"src": "6688:6:0",
"typeDescriptions": {
"typeIdentifier": "t_uint32",
"typeString": "uint32"
}
},
"visibility": "internal"
},
{
"constant": false,
"id": 230,
"mutability": "mutable",
"name": "a",
"nodeType": "VariableDeclaration",
"scope": 280,
"src": "6701:8:0",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint32",
"typeString": "uint32"
},
"typeName": {
"id": 229,
"name": "uint32",
"nodeType": "ElementaryTypeName",
"src": "6701:6:0",
"typeDescriptions": {
"typeIdentifier": "t_uint32",
"typeString": "uint32"
}
},
"visibility": "internal"
},
{
"constant": false,
"id": 232,
"mutability": "mutable",
"name": "b",
"nodeType": "VariableDeclaration",
"scope": 280,
"src": "6711:8:0",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint32",
"typeString": "uint32"
},
"typeName": {
"id": 231,
"name": "uint32",
"nodeType": "ElementaryTypeName",
"src": "6711:6:0",
"typeDescriptions": {
"typeIdentifier": "t_uint32",
"typeString": "uint32"
}
},
"visibility": "internal"
}
],
"src": "6687:33:0"
},
"returnParameters": {
"id": 236,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 235,
"mutability": "mutable",
"name": "",
"nodeType": "VariableDeclaration",
"scope": 280,
"src": "6743:4:0",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
},
"typeName": {
"id": 234,
"name": "bool",
"nodeType": "ElementaryTypeName",
"src": "6743:4:0",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"visibility": "internal"
}
],
"src": "6742:6:0"
},
"scope": 734,
"src": "6675:345:0",
"stateMutability": "pure",
"virtual": false,
"visibility": "private"
},
{
"body": {
"id": 397,
"nodeType": "Block",
"src": "8221:818:0",
"statements": [
{
"assignments": [
301
],
"declarations": [
{
"constant": false,
"id": 301,
"mutability": "mutable",
"name": "l",
"nodeType": "VariableDeclaration",
"scope": 397,
"src": "8231:9:0",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 300,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "8231:7:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"visibility": "internal"
}
],
"id": 308,
"initialValue": {
"commonType": {
"typeIdentifier": "t_uint16",
"typeString": "uint16"
},
"id": 307,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"components": [
{
"commonType": {
"typeIdentifier": "t_uint16",
"typeString": "uint16"
},
"id": 304,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"id": 302,
"name": "index",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 291,
"src": "8244:5:0",
"typeDescriptions": {
"typeIdentifier": "t_uint16",
"typeString": "uint16"
}
},
"nodeType": "BinaryOperation",
"operator": "+",
"rightExpression": {
"hexValue": "31",
"id": 303,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "number",
"lValueRequested": false,
"nodeType": "Literal",
"src": "8252:1:0",
"typeDescriptions": {
"typeIdentifier": "t_rational_1_by_1",
"typeString": "int_const 1"
},
"value": "1"
},
"src": "8244:9:0",
"typeDescriptions": {
"typeIdentifier": "t_uint16",
"typeString": "uint16"
}
}
],
"id": 305,
"isConstant": false,
"isInlineArray": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"nodeType": "TupleExpression",
"src": "8243:11:0",
"typeDescriptions": {
"typeIdentifier": "t_uint16",
"typeString": "uint16"
}
},
"nodeType": "BinaryOperation",
"operator": "%",
"rightExpression": {
"id": 306,
"name": "cardinality",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 293,
"src": "8257:11:0",
"typeDescriptions": {
"typeIdentifier": "t_uint16",
"typeString": "uint16"
}
},
"src": "8243:25:0",
"typeDescriptions": {
"typeIdentifier": "t_uint16",
"typeString": "uint16"
}
},
"nodeType": "VariableDeclarationStatement",
"src": "8231:37:0"
},
{
"assignments": [
310
],
"declarations": [
{
"constant": false,
"id": 310,
"mutability": "mutable",
"name": "r",
"nodeType": "VariableDeclaration",
"scope": 397,
"src": "8300:9:0",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 309,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "8300:7:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"visibility": "internal"
}
],
"id": 316,
"initialValue": {
"commonType": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"id": 315,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"commonType": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"id": 313,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"id": 311,
"name": "l",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 301,
"src": "8312:1:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "BinaryOperation",
"operator": "+",
"rightExpression": {
"id": 312,
"name": "cardinality",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 293,
"src": "8316:11:0",
"typeDescriptions": {
"typeIdentifier": "t_uint16",
"typeString": "uint16"
}
},
"src": "8312:15:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "BinaryOperation",
"operator": "-",
"rightExpression": {
"hexValue": "31",
"id": 314,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "number",
"lValueRequested": false,
"nodeType": "Literal",
"src": "8330:1:0",
"typeDescriptions": {
"typeIdentifier": "t_rational_1_by_1",
"typeString": "int_const 1"
},
"value": "1"
},
"src": "8312:19:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "VariableDeclarationStatement",
"src": "8300:31:0"
},
{
"assignments": [
318
],
"declarations": [
{
"constant": false,
"id": 318,
"mutability": "mutable",
"name": "i",
"nodeType": "VariableDeclaration",
"scope": 397,
"src": "8363:9:0",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 317,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "8363:7:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"visibility": "internal"
}
],
"id": 319,
"nodeType": "VariableDeclarationStatement",
"src": "8363:9:0"
},
{
"body": {
"id": 395,
"nodeType": "Block",
"src": "8395:638:0",
"statements": [
{
"expression": {
"id": 328,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftHandSide": {
"id": 321,
"name": "i",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 318,
"src": "8409:1:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "Assignment",
"operator": "=",
"rightHandSide": {
"commonType": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"id": 327,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"components": [
{
"commonType": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"id": 324,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"id": 322,
"name": "l",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 301,
"src": "8414:1:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "BinaryOperation",
"operator": "+",
"rightExpression": {
"id": 323,
"name": "r",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 310,
"src": "8418:1:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"src": "8414:5:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
}
],
"id": 325,
"isConstant": false,
"isInlineArray": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"nodeType": "TupleExpression",
"src": "8413:7:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "BinaryOperation",
"operator": "/",
"rightExpression": {
"hexValue": "32",
"id": 326,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "number",
"lValueRequested": false,
"nodeType": "Literal",
"src": "8423:1:0",
"typeDescriptions": {
"typeIdentifier": "t_rational_2_by_1",
"typeString": "int_const 2"
},
"value": "2"
},
"src": "8413:11:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"src": "8409:15:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"id": 329,
"nodeType": "ExpressionStatement",
"src": "8409:15:0"
},
{
"expression": {
"id": 336,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftHandSide": {
"id": 330,
"name": "beforeOrAt",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 296,
"src": "8439:10:0",
"typeDescriptions": {
"typeIdentifier": "t_struct$_Observation_$11_memory_ptr",
"typeString": "struct Oracle.Observation memory"
}
},
"nodeType": "Assignment",
"operator": "=",
"rightHandSide": {
"baseExpression": {
"id": 331,
"name": "self",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 285,
"src": "8452:4:0",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_struct$_Observation_$11_storage_$65535_storage_ptr",
"typeString": "struct Oracle.Observation storage ref[65535] storage pointer"
}
},
"id": 335,
"indexExpression": {
"commonType": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"id": 334,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"id": 332,
"name": "i",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 318,
"src": "8457:1:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "BinaryOperation",
"operator": "%",
"rightExpression": {
"id": 333,
"name": "cardinality",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 293,
"src": "8461:11:0",
"typeDescriptions": {
"typeIdentifier": "t_uint16",
"typeString": "uint16"
}
},
"src": "8457:15:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"nodeType": "IndexAccess",
"src": "8452:21:0",
"typeDescriptions": {
"typeIdentifier": "t_struct$_Observation_$11_storage",
"typeString": "struct Oracle.Observation storage ref"
}
},
"src": "8439:34:0",
"typeDescriptions": {
"typeIdentifier": "t_struct$_Observation_$11_memory_ptr",
"typeString": "struct Oracle.Observation memory"
}
},
"id": 337,
"nodeType": "ExpressionStatement",
"src": "8439:34:0"
},
{
"condition": {
"id": 340,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"nodeType": "UnaryOperation",
"operator": "!",
"prefix": true,
"src": "8584:23:0",
"subExpression": {
"expression": {
"id": 338,
"name": "beforeOrAt",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 296,
"src": "8585:10:0",
"typeDescriptions": {
"typeIdentifier": "t_struct$_Observation_$11_memory_ptr",
"typeString": "struct Oracle.Observation memory"
}
},
"id": 339,
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"memberName": "initialized",
"nodeType": "MemberAccess",
"referencedDeclaration": 10,
"src": "8585:22:0",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"id": 349,
"nodeType": "IfStatement",
"src": "8580:97:0",
"trueBody": {
"id": 348,
"nodeType": "Block",
"src": "8609:68:0",
"statements": [
{
"expression": {
"id": 345,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftHandSide": {
"id": 341,
"name": "l",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 301,
"src": "8627:1:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "Assignment",
"operator": "=",
"rightHandSide": {
"commonType": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"id": 344,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"id": 342,
"name": "i",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 318,
"src": "8631:1:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "BinaryOperation",
"operator": "+",
"rightExpression": {
"hexValue": "31",
"id": 343,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "number",
"lValueRequested": false,
"nodeType": "Literal",
"src": "8635:1:0",
"typeDescriptions": {
"typeIdentifier": "t_rational_1_by_1",
"typeString": "int_const 1"
},
"value": "1"
},
"src": "8631:5:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"src": "8627:9:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"id": 346,
"nodeType": "ExpressionStatement",
"src": "8627:9:0"
},
{
"id": 347,
"nodeType": "Continue",
"src": "8654:8:0"
}
]
}
},
{
"expression": {
"id": 359,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftHandSide": {
"id": 350,
"name": "atOrAfter",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 298,
"src": "8691:9:0",
"typeDescriptions": {
"typeIdentifier": "t_struct$_Observation_$11_memory_ptr",
"typeString": "struct Oracle.Observation memory"
}
},
"nodeType": "Assignment",
"operator": "=",
"rightHandSide": {
"baseExpression": {
"id": 351,
"name": "self",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 285,
"src": "8703:4:0",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_struct$_Observation_$11_storage_$65535_storage_ptr",
"typeString": "struct Oracle.Observation storage ref[65535] storage pointer"
}
},
"id": 358,
"indexExpression": {
"commonType": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"id": 357,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"components": [
{
"commonType": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"id": 354,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"id": 352,
"name": "i",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 318,
"src": "8709:1:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "BinaryOperation",
"operator": "+",
"rightExpression": {
"hexValue": "31",
"id": 353,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "number",
"lValueRequested": false,
"nodeType": "Literal",
"src": "8713:1:0",
"typeDescriptions": {
"typeIdentifier": "t_rational_1_by_1",
"typeString": "int_const 1"
},
"value": "1"
},
"src": "8709:5:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
}
],
"id": 355,
"isConstant": false,
"isInlineArray": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"nodeType": "TupleExpression",
"src": "8708:7:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "BinaryOperation",
"operator": "%",
"rightExpression": {
"id": 356,
"name": "cardinality",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 293,
"src": "8718:11:0",
"typeDescriptions": {
"typeIdentifier": "t_uint16",
"typeString": "uint16"
}
},
"src": "8708:21:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"nodeType": "IndexAccess",
"src": "8703:27:0",
"typeDescriptions": {
"typeIdentifier": "t_struct$_Observation_$11_storage",
"typeString": "struct Oracle.Observation storage ref"
}
},
"src": "8691:39:0",
"typeDescriptions": {
"typeIdentifier": "t_struct$_Observation_$11_memory_ptr",
"typeString": "struct Oracle.Observation memory"
}
},
"id": 360,
"nodeType": "ExpressionStatement",
"src": "8691:39:0"
},
{
"assignments": [
362
],
"declarations": [
{
"constant": false,
"id": 362,
"mutability": "mutable",
"name": "targetAtOrAfter",
"nodeType": "VariableDeclaration",
"scope": 395,
"src": "8745:20:0",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
},
"typeName": {
"id": 361,
"name": "bool",
"nodeType": "ElementaryTypeName",
"src": "8745:4:0",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"visibility": "internal"
}
],
"id": 369,
"initialValue": {
"arguments": [
{
"id": 364,
"name": "time",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 287,
"src": "8772:4:0",
"typeDescriptions": {
"typeIdentifier": "t_uint32",
"typeString": "uint32"
}
},
{
"expression": {
"id": 365,
"name": "beforeOrAt",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 296,
"src": "8778:10:0",
"typeDescriptions": {
"typeIdentifier": "t_struct$_Observation_$11_memory_ptr",
"typeString": "struct Oracle.Observation memory"
}
},
"id": 366,
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"memberName": "blockTimestamp",
"nodeType": "MemberAccess",
"referencedDeclaration": 4,
"src": "8778:25:0",
"typeDescriptions": {
"typeIdentifier": "t_uint32",
"typeString": "uint32"
}
},
{
"id": 367,
"name": "target",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 289,
"src": "8805:6:0",
"typeDescriptions": {
"typeIdentifier": "t_uint32",
"typeString": "uint32"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_uint32",
"typeString": "uint32"
},
{
"typeIdentifier": "t_uint32",
"typeString": "uint32"
},
{
"typeIdentifier": "t_uint32",
"typeString": "uint32"
}
],
"id": 363,
"name": "lte",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 280,
"src": "8768:3:0",
"typeDescriptions": {
"typeIdentifier": "t_function_internal_pure$_t_uint32_$_t_uint32_$_t_uint32_$returns$_t_bool_$",
"typeString": "function (uint32,uint32,uint32) pure returns (bool)"
}
},
"id": 368,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "8768:44:0",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"nodeType": "VariableDeclarationStatement",
"src": "8745:67:0"
},
{
"condition": {
"commonType": {
"typeIdentifier": "t_bool",
"typeString": "bool"
},
"id": 377,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"id": 370,
"name": "targetAtOrAfter",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 362,
"src": "8879:15:0",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"nodeType": "BinaryOperation",
"operator": "&&",
"rightExpression": {
"arguments": [
{
"id": 372,
"name": "time",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 287,
"src": "8902:4:0",
"typeDescriptions": {
"typeIdentifier": "t_uint32",
"typeString": "uint32"
}
},
{
"id": 373,
"name": "target",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 289,
"src": "8908:6:0",
"typeDescriptions": {
"typeIdentifier": "t_uint32",
"typeString": "uint32"
}
},
{
"expression": {
"id": 374,
"name": "atOrAfter",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 298,
"src": "8916:9:0",
"typeDescriptions": {
"typeIdentifier": "t_struct$_Observation_$11_memory_ptr",
"typeString": "struct Oracle.Observation memory"
}
},
"id": 375,
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"memberName": "blockTimestamp",
"nodeType": "MemberAccess",
"referencedDeclaration": 4,
"src": "8916:24:0",
"typeDescriptions": {
"typeIdentifier": "t_uint32",
"typeString": "uint32"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_uint32",
"typeString": "uint32"
},
{
"typeIdentifier": "t_uint32",
"typeString": "uint32"
},
{
"typeIdentifier": "t_uint32",
"typeString": "uint32"
}
],
"id": 371,
"name": "lte",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 280,
"src": "8898:3:0",
"typeDescriptions": {
"typeIdentifier": "t_function_internal_pure$_t_uint32_$_t_uint32_$_t_uint32_$returns$_t_bool_$",
"typeString": "function (uint32,uint32,uint32) pure returns (bool)"
}
},
"id": 376,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "8898:43:0",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"src": "8879:62:0",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"id": 379,
"nodeType": "IfStatement",
"src": "8875:73:0",
"trueBody": {
"id": 378,
"nodeType": "Break",
"src": "8943:5:0"
}
},
{
"condition": {
"id": 381,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"nodeType": "UnaryOperation",
"operator": "!",
"prefix": true,
"src": "8967:16:0",
"subExpression": {
"id": 380,
"name": "targetAtOrAfter",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 362,
"src": "8968:15:0",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"falseBody": {
"expression": {
"id": 392,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftHandSide": {
"id": 388,
"name": "l",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 301,
"src": "9013:1:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "Assignment",
"operator": "=",
"rightHandSide": {
"commonType": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"id": 391,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"id": 389,
"name": "i",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 318,
"src": "9017:1:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "BinaryOperation",
"operator": "+",
"rightExpression": {
"hexValue": "31",
"id": 390,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "number",
"lValueRequested": false,
"nodeType": "Literal",
"src": "9021:1:0",
"typeDescriptions": {
"typeIdentifier": "t_rational_1_by_1",
"typeString": "int_const 1"
},
"value": "1"
},
"src": "9017:5:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"src": "9013:9:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"id": 393,
"nodeType": "ExpressionStatement",
"src": "9013:9:0"
},
"id": 394,
"nodeType": "IfStatement",
"src": "8963:59:0",
"trueBody": {
"expression": {
"id": 386,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftHandSide": {
"id": 382,
"name": "r",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 310,
"src": "8985:1:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "Assignment",
"operator": "=",
"rightHandSide": {
"commonType": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"id": 385,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"id": 383,
"name": "i",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 318,
"src": "8989:1:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "BinaryOperation",
"operator": "-",
"rightExpression": {
"hexValue": "31",
"id": 384,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "number",
"lValueRequested": false,
"nodeType": "Literal",
"src": "8993:1:0",
"typeDescriptions": {
"typeIdentifier": "t_rational_1_by_1",
"typeString": "int_const 1"
},
"value": "1"
},
"src": "8989:5:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"src": "8985:9:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"id": 387,
"nodeType": "ExpressionStatement",
"src": "8985:9:0"
}
}
]
},
"condition": {
"hexValue": "74727565",
"id": 320,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "bool",
"lValueRequested": false,
"nodeType": "Literal",
"src": "8389:4:0",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
},
"value": "true"
},
"id": 396,
"nodeType": "WhileStatement",
"src": "8382:651:0"
}
]
},
"documentation": {
"id": 281,
"nodeType": "StructuredDocumentation",
"src": "7026:944:0",
"text": "@notice Fetches the observations beforeOrAt and atOrAfter a target, i.e. where [beforeOrAt, atOrAfter] is satisfied.\n The result may be the same observation, or adjacent observations.\n @dev The answer must be contained in the array, used when the target is located within the stored observation\n boundaries: older than the most recent observation and younger, or the same age as, the oldest observation\n @param self The stored oracle array\n @param time The current block.timestamp\n @param target The timestamp at which the reserved observation should be for\n @param index The index of the observation that was most recently written to the observations array\n @param cardinality The number of populated elements in the oracle array\n @return beforeOrAt The observation recorded before, or at, the target\n @return atOrAfter The observation recorded at, or after, the target"
},
"id": 398,
"implemented": true,
"kind": "function",
"modifiers": [],
"name": "binarySearch",
"nodeType": "FunctionDefinition",
"parameters": {
"id": 294,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 285,
"mutability": "mutable",
"name": "self",
"nodeType": "VariableDeclaration",
"scope": 398,
"src": "8006:31:0",
"stateVariable": false,
"storageLocation": "storage",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_struct$_Observation_$11_storage_$65535_storage_ptr",
"typeString": "struct Oracle.Observation[65535]"
},
"typeName": {
"baseType": {
"id": 282,
"name": "Observation",
"nodeType": "UserDefinedTypeName",
"referencedDeclaration": 11,
"src": "8006:11:0",
"typeDescriptions": {
"typeIdentifier": "t_struct$_Observation_$11_storage_ptr",
"typeString": "struct Oracle.Observation"
}
},
"id": 284,
"length": {
"hexValue": "3635353335",
"id": 283,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "number",
"lValueRequested": false,
"nodeType": "Literal",
"src": "8018:5:0",
"typeDescriptions": {
"typeIdentifier": "t_rational_65535_by_1",
"typeString": "int_const 65535"
},
"value": "65535"
},
"nodeType": "ArrayTypeName",
"src": "8006:18:0",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_struct$_Observation_$11_storage_$65535_storage_ptr",
"typeString": "struct Oracle.Observation[65535]"
}
},
"visibility": "internal"
},
{
"constant": false,
"id": 287,
"mutability": "mutable",
"name": "time",
"nodeType": "VariableDeclaration",
"scope": 398,
"src": "8047:11:0",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint32",
"typeString": "uint32"
},
"typeName": {
"id": 286,
"name": "uint32",
"nodeType": "ElementaryTypeName",
"src": "8047:6:0",
"typeDescriptions": {
"typeIdentifier": "t_uint32",
"typeString": "uint32"
}
},
"visibility": "internal"
},
{
"constant": false,
"id": 289,
"mutability": "mutable",
"name": "target",
"nodeType": "VariableDeclaration",
"scope": 398,
"src": "8068:13:0",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint32",
"typeString": "uint32"
},
"typeName": {
"id": 288,
"name": "uint32",
"nodeType": "ElementaryTypeName",
"src": "8068:6:0",
"typeDescriptions": {
"typeIdentifier": "t_uint32",
"typeString": "uint32"
}
},
"visibility": "internal"
},
{
"constant": false,
"id": 291,
"mutability": "mutable",
"name": "index",
"nodeType": "VariableDeclaration",
"scope": 398,
"src": "8091:12:0",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint16",
"typeString": "uint16"
},
"typeName": {
"id": 290,
"name": "uint16",
"nodeType": "ElementaryTypeName",
"src": "8091:6:0",
"typeDescriptions": {
"typeIdentifier": "t_uint16",
"typeString": "uint16"
}
},
"visibility": "internal"
},
{
"constant": false,
"id": 293,
"mutability": "mutable",
"name": "cardinality",
"nodeType": "VariableDeclaration",
"scope": 398,
"src": "8113:18:0",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint16",
"typeString": "uint16"
},
"typeName": {
"id": 292,
"name": "uint16",
"nodeType": "ElementaryTypeName",
"src": "8113:6:0",
"typeDescriptions": {
"typeIdentifier": "t_uint16",
"typeString": "uint16"
}
},
"visibility": "internal"
}
],
"src": "7996:141:0"
},
"returnParameters": {
"id": 299,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 296,
"mutability": "mutable",
"name": "beforeOrAt",
"nodeType": "VariableDeclaration",
"scope": 398,
"src": "8160:29:0",
"stateVariable": false,
"storageLocation": "memory",
"typeDescriptions": {
"typeIdentifier": "t_struct$_Observation_$11_memory_ptr",
"typeString": "struct Oracle.Observation"
},
"typeName": {
"id": 295,
"name": "Observation",
"nodeType": "UserDefinedTypeName",
"referencedDeclaration": 11,
"src": "8160:11:0",
"typeDescriptions": {
"typeIdentifier": "t_struct$_Observation_$11_storage_ptr",
"typeString": "struct Oracle.Observation"
}
},
"visibility": "internal"
},
{
"constant": false,
"id": 298,
"mutability": "mutable",
"name": "atOrAfter",
"nodeType": "VariableDeclaration",
"scope": 398,
"src": "8191:28:0",
"stateVariable": false,
"storageLocation": "memory",
"typeDescriptions": {
"typeIdentifier": "t_struct$_Observation_$11_memory_ptr",
"typeString": "struct Oracle.Observation"
},
"typeName": {
"id": 297,
"name": "Observation",
"nodeType": "UserDefinedTypeName",
"referencedDeclaration": 11,
"src": "8191:11:0",
"typeDescriptions": {
"typeIdentifier": "t_struct$_Observation_$11_storage_ptr",
"typeString": "struct Oracle.Observation"
}
},
"visibility": "internal"
}
],
"src": "8159:61:0"
},
"scope": 734,
"src": "7975:1064:0",
"stateMutability": "view",
"virtual": false,
"visibility": "private"
},
{
"body": {
"id": 495,
"nodeType": "Block",
"src": "10370:1118:0",
"statements": [
{
"expression": {
"id": 426,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftHandSide": {
"id": 422,
"name": "beforeOrAt",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 418,
"src": "10443:10:0",
"typeDescriptions": {
"typeIdentifier": "t_struct$_Observation_$11_memory_ptr",
"typeString": "struct Oracle.Observation memory"
}
},
"nodeType": "Assignment",
"operator": "=",
"rightHandSide": {
"baseExpression": {
"id": 423,
"name": "self",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 403,
"src": "10456:4:0",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_struct$_Observation_$11_storage_$65535_storage_ptr",
"typeString": "struct Oracle.Observation storage ref[65535] storage pointer"
}
},
"id": 425,
"indexExpression": {
"id": 424,
"name": "index",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 411,
"src": "10461:5:0",
"typeDescriptions": {
"typeIdentifier": "t_uint16",
"typeString": "uint16"
}
},
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"nodeType": "IndexAccess",
"src": "10456:11:0",
"typeDescriptions": {
"typeIdentifier": "t_struct$_Observation_$11_storage",
"typeString": "struct Oracle.Observation storage ref"
}
},
"src": "10443:24:0",
"typeDescriptions": {
"typeIdentifier": "t_struct$_Observation_$11_memory_ptr",
"typeString": "struct Oracle.Observation memory"
}
},
"id": 427,
"nodeType": "ExpressionStatement",
"src": "10443:24:0"
},
{
"condition": {
"arguments": [
{
"id": 429,
"name": "time",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 405,
"src": "10586:4:0",
"typeDescriptions": {
"typeIdentifier": "t_uint32",
"typeString": "uint32"
}
},
{
"expression": {
"id": 430,
"name": "beforeOrAt",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 418,
"src": "10592:10:0",
"typeDescriptions": {
"typeIdentifier": "t_struct$_Observation_$11_memory_ptr",
"typeString": "struct Oracle.Observation memory"
}
},
"id": 431,
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"memberName": "blockTimestamp",
"nodeType": "MemberAccess",
"referencedDeclaration": 4,
"src": "10592:25:0",
"typeDescriptions": {
"typeIdentifier": "t_uint32",
"typeString": "uint32"
}
},
{
"id": 432,
"name": "target",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 407,
"src": "10619:6:0",
"typeDescriptions": {
"typeIdentifier": "t_uint32",
"typeString": "uint32"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_uint32",
"typeString": "uint32"
},
{
"typeIdentifier": "t_uint32",
"typeString": "uint32"
},
{
"typeIdentifier": "t_uint32",
"typeString": "uint32"
}
],
"id": 428,
"name": "lte",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 280,
"src": "10582:3:0",
"typeDescriptions": {
"typeIdentifier": "t_function_internal_pure$_t_uint32_$_t_uint32_$_t_uint32_$returns$_t_bool_$",
"typeString": "function (uint32,uint32,uint32) pure returns (bool)"
}
},
"id": 433,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "10582:44:0",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"id": 455,
"nodeType": "IfStatement",
"src": "10578:443:0",
"trueBody": {
"id": 454,
"nodeType": "Block",
"src": "10628:393:0",
"statements": [
{
"condition": {
"commonType": {
"typeIdentifier": "t_uint32",
"typeString": "uint32"
},
"id": 437,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"expression": {
"id": 434,
"name": "beforeOrAt",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 418,
"src": "10646:10:0",
"typeDescriptions": {
"typeIdentifier": "t_struct$_Observation_$11_memory_ptr",
"typeString": "struct Oracle.Observation memory"
}
},
"id": 435,
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"memberName": "blockTimestamp",
"nodeType": "MemberAccess",
"referencedDeclaration": 4,
"src": "10646:25:0",
"typeDescriptions": {
"typeIdentifier": "t_uint32",
"typeString": "uint32"
}
},
"nodeType": "BinaryOperation",
"operator": "==",
"rightExpression": {
"id": 436,
"name": "target",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 407,
"src": "10675:6:0",
"typeDescriptions": {
"typeIdentifier": "t_uint32",
"typeString": "uint32"
}
},
"src": "10646:35:0",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"falseBody": {
"id": 452,
"nodeType": "Block",
"src": "10860:151:0",
"statements": [
{
"expression": {
"components": [
{
"id": 443,
"name": "beforeOrAt",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 418,
"src": "10937:10:0",
"typeDescriptions": {
"typeIdentifier": "t_struct$_Observation_$11_memory_ptr",
"typeString": "struct Oracle.Observation memory"
}
},
{
"arguments": [
{
"id": 445,
"name": "beforeOrAt",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 418,
"src": "10959:10:0",
"typeDescriptions": {
"typeIdentifier": "t_struct$_Observation_$11_memory_ptr",
"typeString": "struct Oracle.Observation memory"
}
},
{
"id": 446,
"name": "target",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 407,
"src": "10971:6:0",
"typeDescriptions": {
"typeIdentifier": "t_uint32",
"typeString": "uint32"
}
},
{
"id": 447,
"name": "tick",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 409,
"src": "10979:4:0",
"typeDescriptions": {
"typeIdentifier": "t_int24",
"typeString": "int24"
}
},
{
"id": 448,
"name": "liquidity",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 413,
"src": "10985:9:0",
"typeDescriptions": {
"typeIdentifier": "t_uint128",
"typeString": "uint128"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_struct$_Observation_$11_memory_ptr",
"typeString": "struct Oracle.Observation memory"
},
{
"typeIdentifier": "t_uint32",
"typeString": "uint32"
},
{
"typeIdentifier": "t_int24",
"typeString": "int24"
},
{
"typeIdentifier": "t_uint128",
"typeString": "uint128"
}
],
"id": 444,
"name": "transform",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 66,
"src": "10949:9:0",
"typeDescriptions": {
"typeIdentifier": "t_function_internal_pure$_t_struct$_Observation_$11_memory_ptr_$_t_uint32_$_t_int24_$_t_uint128_$returns$_t_struct$_Observation_$11_memory_ptr_$",
"typeString": "function (struct Oracle.Observation memory,uint32,int24,uint128) pure returns (struct Oracle.Observation memory)"
}
},
"id": 449,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "10949:46:0",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_struct$_Observation_$11_memory_ptr",
"typeString": "struct Oracle.Observation memory"
}
}
],
"id": 450,
"isConstant": false,
"isInlineArray": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"nodeType": "TupleExpression",
"src": "10936:60:0",
"typeDescriptions": {
"typeIdentifier": "t_tuple$_t_struct$_Observation_$11_memory_ptr_$_t_struct$_Observation_$11_memory_ptr_$",
"typeString": "tuple(struct Oracle.Observation memory,struct Oracle.Observation memory)"
}
},
"functionReturnParameters": 421,
"id": 451,
"nodeType": "Return",
"src": "10929:67:0"
}
]
},
"id": 453,
"nodeType": "IfStatement",
"src": "10642:369:0",
"trueBody": {
"id": 442,
"nodeType": "Block",
"src": "10683:171:0",
"statements": [
{
"expression": {
"components": [
{
"id": 438,
"name": "beforeOrAt",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 418,
"src": "10817:10:0",
"typeDescriptions": {
"typeIdentifier": "t_struct$_Observation_$11_memory_ptr",
"typeString": "struct Oracle.Observation memory"
}
},
{
"id": 439,
"name": "atOrAfter",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 420,
"src": "10829:9:0",
"typeDescriptions": {
"typeIdentifier": "t_struct$_Observation_$11_memory_ptr",
"typeString": "struct Oracle.Observation memory"
}
}
],
"id": 440,
"isConstant": false,
"isInlineArray": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"nodeType": "TupleExpression",
"src": "10816:23:0",
"typeDescriptions": {
"typeIdentifier": "t_tuple$_t_struct$_Observation_$11_memory_ptr_$_t_struct$_Observation_$11_memory_ptr_$",
"typeString": "tuple(struct Oracle.Observation memory,struct Oracle.Observation memory)"
}
},
"functionReturnParameters": 421,
"id": 441,
"nodeType": "Return",
"src": "10809:30:0"
}
]
}
}
]
}
},
{
"expression": {
"id": 465,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftHandSide": {
"id": 456,
"name": "beforeOrAt",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 418,
"src": "11084:10:0",
"typeDescriptions": {
"typeIdentifier": "t_struct$_Observation_$11_memory_ptr",
"typeString": "struct Oracle.Observation memory"
}
},
"nodeType": "Assignment",
"operator": "=",
"rightHandSide": {
"baseExpression": {
"id": 457,
"name": "self",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 403,
"src": "11097:4:0",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_struct$_Observation_$11_storage_$65535_storage_ptr",
"typeString": "struct Oracle.Observation storage ref[65535] storage pointer"
}
},
"id": 464,
"indexExpression": {
"commonType": {
"typeIdentifier": "t_uint16",
"typeString": "uint16"
},
"id": 463,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"components": [
{
"commonType": {
"typeIdentifier": "t_uint16",
"typeString": "uint16"
},
"id": 460,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"id": 458,
"name": "index",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 411,
"src": "11103:5:0",
"typeDescriptions": {
"typeIdentifier": "t_uint16",
"typeString": "uint16"
}
},
"nodeType": "BinaryOperation",
"operator": "+",
"rightExpression": {
"hexValue": "31",
"id": 459,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "number",
"lValueRequested": false,
"nodeType": "Literal",
"src": "11111:1:0",
"typeDescriptions": {
"typeIdentifier": "t_rational_1_by_1",
"typeString": "int_const 1"
},
"value": "1"
},
"src": "11103:9:0",
"typeDescriptions": {
"typeIdentifier": "t_uint16",
"typeString": "uint16"
}
}
],
"id": 461,
"isConstant": false,
"isInlineArray": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"nodeType": "TupleExpression",
"src": "11102:11:0",
"typeDescriptions": {
"typeIdentifier": "t_uint16",
"typeString": "uint16"
}
},
"nodeType": "BinaryOperation",
"operator": "%",
"rightExpression": {
"id": 462,
"name": "cardinality",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 415,
"src": "11116:11:0",
"typeDescriptions": {
"typeIdentifier": "t_uint16",
"typeString": "uint16"
}
},
"src": "11102:25:0",
"typeDescriptions": {
"typeIdentifier": "t_uint16",
"typeString": "uint16"
}
},
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"nodeType": "IndexAccess",
"src": "11097:31:0",
"typeDescriptions": {
"typeIdentifier": "t_struct$_Observation_$11_storage",
"typeString": "struct Oracle.Observation storage ref"
}
},
"src": "11084:44:0",
"typeDescriptions": {
"typeIdentifier": "t_struct$_Observation_$11_memory_ptr",
"typeString": "struct Oracle.Observation memory"
}
},
"id": 466,
"nodeType": "ExpressionStatement",
"src": "11084:44:0"
},
{
"condition": {
"id": 469,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"nodeType": "UnaryOperation",
"operator": "!",
"prefix": true,
"src": "11142:23:0",
"subExpression": {
"expression": {
"id": 467,
"name": "beforeOrAt",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 418,
"src": "11143:10:0",
"typeDescriptions": {
"typeIdentifier": "t_struct$_Observation_$11_memory_ptr",
"typeString": "struct Oracle.Observation memory"
}
},
"id": 468,
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"memberName": "initialized",
"nodeType": "MemberAccess",
"referencedDeclaration": 10,
"src": "11143:22:0",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"id": 476,
"nodeType": "IfStatement",
"src": "11138:49:0",
"trueBody": {
"expression": {
"id": 474,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftHandSide": {
"id": 470,
"name": "beforeOrAt",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 418,
"src": "11167:10:0",
"typeDescriptions": {
"typeIdentifier": "t_struct$_Observation_$11_memory_ptr",
"typeString": "struct Oracle.Observation memory"
}
},
"nodeType": "Assignment",
"operator": "=",
"rightHandSide": {
"baseExpression": {
"id": 471,
"name": "self",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 403,
"src": "11180:4:0",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_struct$_Observation_$11_storage_$65535_storage_ptr",
"typeString": "struct Oracle.Observation storage ref[65535] storage pointer"
}
},
"id": 473,
"indexExpression": {
"hexValue": "30",
"id": 472,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "number",
"lValueRequested": false,
"nodeType": "Literal",
"src": "11185:1:0",
"typeDescriptions": {
"typeIdentifier": "t_rational_0_by_1",
"typeString": "int_const 0"
},
"value": "0"
},
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"nodeType": "IndexAccess",
"src": "11180:7:0",
"typeDescriptions": {
"typeIdentifier": "t_struct$_Observation_$11_storage",
"typeString": "struct Oracle.Observation storage ref"
}
},
"src": "11167:20:0",
"typeDescriptions": {
"typeIdentifier": "t_struct$_Observation_$11_memory_ptr",
"typeString": "struct Oracle.Observation memory"
}
},
"id": 475,
"nodeType": "ExpressionStatement",
"src": "11167:20:0"
}
},
{
"expression": {
"arguments": [
{
"arguments": [
{
"id": 479,
"name": "time",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 405,
"src": "11298:4:0",
"typeDescriptions": {
"typeIdentifier": "t_uint32",
"typeString": "uint32"
}
},
{
"expression": {
"id": 480,
"name": "beforeOrAt",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 418,
"src": "11304:10:0",
"typeDescriptions": {
"typeIdentifier": "t_struct$_Observation_$11_memory_ptr",
"typeString": "struct Oracle.Observation memory"
}
},
"id": 481,
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"memberName": "blockTimestamp",
"nodeType": "MemberAccess",
"referencedDeclaration": 4,
"src": "11304:25:0",
"typeDescriptions": {
"typeIdentifier": "t_uint32",
"typeString": "uint32"
}
},
{
"id": 482,
"name": "target",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 407,
"src": "11331:6:0",
"typeDescriptions": {
"typeIdentifier": "t_uint32",
"typeString": "uint32"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_uint32",
"typeString": "uint32"
},
{
"typeIdentifier": "t_uint32",
"typeString": "uint32"
},
{
"typeIdentifier": "t_uint32",
"typeString": "uint32"
}
],
"id": 478,
"name": "lte",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 280,
"src": "11294:3:0",
"typeDescriptions": {
"typeIdentifier": "t_function_internal_pure$_t_uint32_$_t_uint32_$_t_uint32_$returns$_t_bool_$",
"typeString": "function (uint32,uint32,uint32) pure returns (bool)"
}
},
"id": 483,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "11294:44:0",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
{
"hexValue": "4f4c44",
"id": 484,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "string",
"lValueRequested": false,
"nodeType": "Literal",
"src": "11340:5:0",
"typeDescriptions": {
"typeIdentifier": "t_stringliteral_d30c0d219016dd7e5cf2b2c30c4d7c091820fc329f335b57cab26b9ff3384a9e",
"typeString": "literal_string \"OLD\""
},
"value": "OLD"
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_bool",
"typeString": "bool"
},
{
"typeIdentifier": "t_stringliteral_d30c0d219016dd7e5cf2b2c30c4d7c091820fc329f335b57cab26b9ff3384a9e",
"typeString": "literal_string \"OLD\""
}
],
"id": 477,
"name": "require",
"nodeType": "Identifier",
"overloadedDeclarations": [
-18,
-18
],
"referencedDeclaration": -18,
"src": "11286:7:0",
"typeDescriptions": {
"typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$",
"typeString": "function (bool,string memory) pure"
}
},
"id": 485,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "11286:60:0",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_tuple$__$",
"typeString": "tuple()"
}
},
"id": 486,
"nodeType": "ExpressionStatement",
"src": "11286:60:0"
},
{
"expression": {
"arguments": [
{
"id": 488,
"name": "self",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 403,
"src": "11442:4:0",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_struct$_Observation_$11_storage_$65535_storage_ptr",
"typeString": "struct Oracle.Observation storage ref[65535] storage pointer"
}
},
{
"id": 489,
"name": "time",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 405,
"src": "11448:4:0",
"typeDescriptions": {
"typeIdentifier": "t_uint32",
"typeString": "uint32"
}
},
{
"id": 490,
"name": "target",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 407,
"src": "11454:6:0",
"typeDescriptions": {
"typeIdentifier": "t_uint32",
"typeString": "uint32"
}
},
{
"id": 491,
"name": "index",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 411,
"src": "11462:5:0",
"typeDescriptions": {
"typeIdentifier": "t_uint16",
"typeString": "uint16"
}
},
{
"id": 492,
"name": "cardinality",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 415,
"src": "11469:11:0",
"typeDescriptions": {
"typeIdentifier": "t_uint16",
"typeString": "uint16"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_array$_t_struct$_Observation_$11_storage_$65535_storage_ptr",
"typeString": "struct Oracle.Observation storage ref[65535] storage pointer"
},
{
"typeIdentifier": "t_uint32",
"typeString": "uint32"
},
{
"typeIdentifier": "t_uint32",
"typeString": "uint32"
},
{
"typeIdentifier": "t_uint16",
"typeString": "uint16"
},
{
"typeIdentifier": "t_uint16",
"typeString": "uint16"
}
],
"id": 487,
"name": "binarySearch",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 398,
"src": "11429:12:0",
"typeDescriptions": {
"typeIdentifier": "t_function_internal_view$_t_array$_t_struct$_Observation_$11_storage_$65535_storage_ptr_$_t_uint32_$_t_uint32_$_t_uint16_$_t_uint16_$returns$_t_struct$_Observation_$11_memory_ptr_$_t_struct$_Observation_$11_memory_ptr_$",
"typeString": "function (struct Oracle.Observation storage ref[65535] storage pointer,uint32,uint32,uint16,uint16) view returns (struct Oracle.Observation memory,struct Oracle.Observation memory)"
}
},
"id": 493,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "11429:52:0",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_tuple$_t_struct$_Observation_$11_memory_ptr_$_t_struct$_Observation_$11_memory_ptr_$",
"typeString": "tuple(struct Oracle.Observation memory,struct Oracle.Observation memory)"
}
},
"functionReturnParameters": 421,
"id": 494,
"nodeType": "Return",
"src": "11422:59:0"
}
]
},
"documentation": {
"id": 399,
"nodeType": "StructuredDocumentation",
"src": "9045:1013:0",
"text": "@notice Fetches the observations beforeOrAt and atOrAfter a given target, i.e. where [beforeOrAt, atOrAfter] is satisfied\n @dev Assumes there is at least 1 initialized observation.\n Used by observeSingle() to compute the counterfactual accumulator values as of a given block timestamp.\n @param self The stored oracle array\n @param time The current block.timestamp\n @param target The timestamp at which the reserved observation should be for\n @param tick The active tick at the time of the returned or simulated observation\n @param index The index of the observation that was most recently written to the observations array\n @param liquidity The total pool liquidity at the time of the call\n @param cardinality The number of populated elements in the oracle array\n @return beforeOrAt The observation which occurred at, or before, the given timestamp\n @return atOrAfter The observation which occurred at, or after, the given timestamp"
},
"id": 496,
"implemented": true,
"kind": "function",
"modifiers": [],
"name": "getSurroundingObservations",
"nodeType": "FunctionDefinition",
"parameters": {
"id": 416,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 403,
"mutability": "mutable",
"name": "self",
"nodeType": "VariableDeclaration",
"scope": 496,
"src": "10108:31:0",
"stateVariable": false,
"storageLocation": "storage",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_struct$_Observation_$11_storage_$65535_storage_ptr",
"typeString": "struct Oracle.Observation[65535]"
},
"typeName": {
"baseType": {
"id": 400,
"name": "Observation",
"nodeType": "UserDefinedTypeName",
"referencedDeclaration": 11,
"src": "10108:11:0",
"typeDescriptions": {
"typeIdentifier": "t_struct$_Observation_$11_storage_ptr",
"typeString": "struct Oracle.Observation"
}
},
"id": 402,
"length": {
"hexValue": "3635353335",
"id": 401,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "number",
"lValueRequested": false,
"nodeType": "Literal",
"src": "10120:5:0",
"typeDescriptions": {
"typeIdentifier": "t_rational_65535_by_1",
"typeString": "int_const 65535"
},
"value": "65535"
},
"nodeType": "ArrayTypeName",
"src": "10108:18:0",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_struct$_Observation_$11_storage_$65535_storage_ptr",
"typeString": "struct Oracle.Observation[65535]"
}
},
"visibility": "internal"
},
{
"constant": false,
"id": 405,
"mutability": "mutable",
"name": "time",
"nodeType": "VariableDeclaration",
"scope": 496,
"src": "10149:11:0",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint32",
"typeString": "uint32"
},
"typeName": {
"id": 404,
"name": "uint32",
"nodeType": "ElementaryTypeName",
"src": "10149:6:0",
"typeDescriptions": {
"typeIdentifier": "t_uint32",
"typeString": "uint32"
}
},
"visibility": "internal"
},
{
"constant": false,
"id": 407,
"mutability": "mutable",
"name": "target",
"nodeType": "VariableDeclaration",
"scope": 496,
"src": "10170:13:0",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint32",
"typeString": "uint32"
},
"typeName": {
"id": 406,
"name": "uint32",
"nodeType": "ElementaryTypeName",
"src": "10170:6:0",
"typeDescriptions": {
"typeIdentifier": "t_uint32",
"typeString": "uint32"
}
},
"visibility": "internal"
},
{
"constant": false,
"id": 409,
"mutability": "mutable",
"name": "tick",
"nodeType": "VariableDeclaration",
"scope": 496,
"src": "10193:10:0",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_int24",
"typeString": "int24"
},
"typeName": {
"id": 408,
"name": "int24",
"nodeType": "ElementaryTypeName",
"src": "10193:5:0",
"typeDescriptions": {
"typeIdentifier": "t_int24",
"typeString": "int24"
}
},
"visibility": "internal"
},
{
"constant": false,
"id": 411,
"mutability": "mutable",
"name": "index",
"nodeType": "VariableDeclaration",
"scope": 496,
"src": "10213:12:0",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint16",
"typeString": "uint16"
},
"typeName": {
"id": 410,
"name": "uint16",
"nodeType": "ElementaryTypeName",
"src": "10213:6:0",
"typeDescriptions": {
"typeIdentifier": "t_uint16",
"typeString": "uint16"
}
},
"visibility": "internal"
},
{
"constant": false,
"id": 413,
"mutability": "mutable",
"name": "liquidity",
"nodeType": "VariableDeclaration",
"scope": 496,
"src": "10235:17:0",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint128",
"typeString": "uint128"
},
"typeName": {
"id": 412,
"name": "uint128",
"nodeType": "ElementaryTypeName",
"src": "10235:7:0",
"typeDescriptions": {
"typeIdentifier": "t_uint128",
"typeString": "uint128"
}
},
"visibility": "internal"
},
{
"constant": false,
"id": 415,
"mutability": "mutable",
"name": "cardinality",
"nodeType": "VariableDeclaration",
"scope": 496,
"src": "10262:18:0",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint16",
"typeString": "uint16"
},
"typeName": {
"id": 414,
"name": "uint16",
"nodeType": "ElementaryTypeName",
"src": "10262:6:0",
"typeDescriptions": {
"typeIdentifier": "t_uint16",
"typeString": "uint16"
}
},
"visibility": "internal"
}
],
"src": "10098:188:0"
},
"returnParameters": {
"id": 421,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 418,
"mutability": "mutable",
"name": "beforeOrAt",
"nodeType": "VariableDeclaration",
"scope": 496,
"src": "10309:29:0",
"stateVariable": false,
"storageLocation": "memory",
"typeDescriptions": {
"typeIdentifier": "t_struct$_Observation_$11_memory_ptr",
"typeString": "struct Oracle.Observation"
},
"typeName": {
"id": 417,
"name": "Observation",
"nodeType": "UserDefinedTypeName",
"referencedDeclaration": 11,
"src": "10309:11:0",
"typeDescriptions": {
"typeIdentifier": "t_struct$_Observation_$11_storage_ptr",
"typeString": "struct Oracle.Observation"
}
},
"visibility": "internal"
},
{
"constant": false,
"id": 420,
"mutability": "mutable",
"name": "atOrAfter",
"nodeType": "VariableDeclaration",
"scope": 496,
"src": "10340:28:0",
"stateVariable": false,
"storageLocation": "memory",
"typeDescriptions": {
"typeIdentifier": "t_struct$_Observation_$11_memory_ptr",
"typeString": "struct Oracle.Observation"
},
"typeName": {
"id": 419,
"name": "Observation",
"nodeType": "UserDefinedTypeName",
"referencedDeclaration": 11,
"src": "10340:11:0",
"typeDescriptions": {
"typeIdentifier": "t_struct$_Observation_$11_storage_ptr",
"typeString": "struct Oracle.Observation"
}
},
"visibility": "internal"
}
],
"src": "10308:61:0"
},
"scope": 734,
"src": "10063:1425:0",
"stateMutability": "view",
"virtual": false,
"visibility": "private"
},
{
"body": {
"id": 646,
"nodeType": "Block",
"src": "12902:1722:0",
"statements": [
{
"condition": {
"commonType": {
"typeIdentifier": "t_uint32",
"typeString": "uint32"
},
"id": 522,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"id": 520,
"name": "secondsAgo",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 505,
"src": "12916:10:0",
"typeDescriptions": {
"typeIdentifier": "t_uint32",
"typeString": "uint32"
}
},
"nodeType": "BinaryOperation",
"operator": "==",
"rightExpression": {
"hexValue": "30",
"id": 521,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "number",
"lValueRequested": false,
"nodeType": "Literal",
"src": "12930:1:0",
"typeDescriptions": {
"typeIdentifier": "t_rational_0_by_1",
"typeString": "int_const 0"
},
"value": "0"
},
"src": "12916:15:0",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"id": 550,
"nodeType": "IfStatement",
"src": "12912:257:0",
"trueBody": {
"id": 549,
"nodeType": "Block",
"src": "12933:236:0",
"statements": [
{
"assignments": [
524
],
"declarations": [
{
"constant": false,
"id": 524,
"mutability": "mutable",
"name": "last",
"nodeType": "VariableDeclaration",
"scope": 549,
"src": "12947:23:0",
"stateVariable": false,
"storageLocation": "memory",
"typeDescriptions": {
"typeIdentifier": "t_struct$_Observation_$11_memory_ptr",
"typeString": "struct Oracle.Observation"
},
"typeName": {
"id": 523,
"name": "Observation",
"nodeType": "UserDefinedTypeName",
"referencedDeclaration": 11,
"src": "12947:11:0",
"typeDescriptions": {
"typeIdentifier": "t_struct$_Observation_$11_storage_ptr",
"typeString": "struct Oracle.Observation"
}
},
"visibility": "internal"
}
],
"id": 528,
"initialValue": {
"baseExpression": {
"id": 525,
"name": "self",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 501,
"src": "12973:4:0",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_struct$_Observation_$11_storage_$65535_storage_ptr",
"typeString": "struct Oracle.Observation storage ref[65535] storage pointer"
}
},
"id": 527,
"indexExpression": {
"id": 526,
"name": "index",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 509,
"src": "12978:5:0",
"typeDescriptions": {
"typeIdentifier": "t_uint16",
"typeString": "uint16"
}
},
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"nodeType": "IndexAccess",
"src": "12973:11:0",
"typeDescriptions": {
"typeIdentifier": "t_struct$_Observation_$11_storage",
"typeString": "struct Oracle.Observation storage ref"
}
},
"nodeType": "VariableDeclarationStatement",
"src": "12947:37:0"
},
{
"condition": {
"commonType": {
"typeIdentifier": "t_uint32",
"typeString": "uint32"
},
"id": 532,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"expression": {
"id": 529,
"name": "last",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 524,
"src": "13002:4:0",
"typeDescriptions": {
"typeIdentifier": "t_struct$_Observation_$11_memory_ptr",
"typeString": "struct Oracle.Observation memory"
}
},
"id": 530,
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"memberName": "blockTimestamp",
"nodeType": "MemberAccess",
"referencedDeclaration": 4,
"src": "13002:19:0",
"typeDescriptions": {
"typeIdentifier": "t_uint32",
"typeString": "uint32"
}
},
"nodeType": "BinaryOperation",
"operator": "!=",
"rightExpression": {
"id": 531,
"name": "time",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 503,
"src": "13025:4:0",
"typeDescriptions": {
"typeIdentifier": "t_uint32",
"typeString": "uint32"
}
},
"src": "13002:27:0",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"id": 542,
"nodeType": "IfStatement",
"src": "12998:78:0",
"trueBody": {
"expression": {
"id": 540,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftHandSide": {
"id": 533,
"name": "last",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 524,
"src": "13031:4:0",
"typeDescriptions": {
"typeIdentifier": "t_struct$_Observation_$11_memory_ptr",
"typeString": "struct Oracle.Observation memory"
}
},
"nodeType": "Assignment",
"operator": "=",
"rightHandSide": {
"arguments": [
{
"id": 535,
"name": "last",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 524,
"src": "13048:4:0",
"typeDescriptions": {
"typeIdentifier": "t_struct$_Observation_$11_memory_ptr",
"typeString": "struct Oracle.Observation memory"
}
},
{
"id": 536,
"name": "time",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 503,
"src": "13054:4:0",
"typeDescriptions": {
"typeIdentifier": "t_uint32",
"typeString": "uint32"
}
},
{
"id": 537,
"name": "tick",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 507,
"src": "13060:4:0",
"typeDescriptions": {
"typeIdentifier": "t_int24",
"typeString": "int24"
}
},
{
"id": 538,
"name": "liquidity",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 511,
"src": "13066:9:0",
"typeDescriptions": {
"typeIdentifier": "t_uint128",
"typeString": "uint128"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_struct$_Observation_$11_memory_ptr",
"typeString": "struct Oracle.Observation memory"
},
{
"typeIdentifier": "t_uint32",
"typeString": "uint32"
},
{
"typeIdentifier": "t_int24",
"typeString": "int24"
},
{
"typeIdentifier": "t_uint128",
"typeString": "uint128"
}
],
"id": 534,
"name": "transform",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 66,
"src": "13038:9:0",
"typeDescriptions": {
"typeIdentifier": "t_function_internal_pure$_t_struct$_Observation_$11_memory_ptr_$_t_uint32_$_t_int24_$_t_uint128_$returns$_t_struct$_Observation_$11_memory_ptr_$",
"typeString": "function (struct Oracle.Observation memory,uint32,int24,uint128) pure returns (struct Oracle.Observation memory)"
}
},
"id": 539,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "13038:38:0",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_struct$_Observation_$11_memory_ptr",
"typeString": "struct Oracle.Observation memory"
}
},
"src": "13031:45:0",
"typeDescriptions": {
"typeIdentifier": "t_struct$_Observation_$11_memory_ptr",
"typeString": "struct Oracle.Observation memory"
}
},
"id": 541,
"nodeType": "ExpressionStatement",
"src": "13031:45:0"
}
},
{
"expression": {
"components": [
{
"expression": {
"id": 543,
"name": "last",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 524,
"src": "13098:4:0",
"typeDescriptions": {
"typeIdentifier": "t_struct$_Observation_$11_memory_ptr",
"typeString": "struct Oracle.Observation memory"
}
},
"id": 544,
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"memberName": "tickCumulative",
"nodeType": "MemberAccess",
"referencedDeclaration": 6,
"src": "13098:19:0",
"typeDescriptions": {
"typeIdentifier": "t_int56",
"typeString": "int56"
}
},
{
"expression": {
"id": 545,
"name": "last",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 524,
"src": "13119:4:0",
"typeDescriptions": {
"typeIdentifier": "t_struct$_Observation_$11_memory_ptr",
"typeString": "struct Oracle.Observation memory"
}
},
"id": 546,
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"memberName": "secondsPerLiquidityCumulativeX128",
"nodeType": "MemberAccess",
"referencedDeclaration": 8,
"src": "13119:38:0",
"typeDescriptions": {
"typeIdentifier": "t_uint160",
"typeString": "uint160"
}
}
],
"id": 547,
"isConstant": false,
"isInlineArray": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"nodeType": "TupleExpression",
"src": "13097:61:0",
"typeDescriptions": {
"typeIdentifier": "t_tuple$_t_int56_$_t_uint160_$",
"typeString": "tuple(int56,uint160)"
}
},
"functionReturnParameters": 519,
"id": 548,
"nodeType": "Return",
"src": "13090:68:0"
}
]
}
},
{
"assignments": [
552
],
"declarations": [
{
"constant": false,
"id": 552,
"mutability": "mutable",
"name": "target",
"nodeType": "VariableDeclaration",
"scope": 646,
"src": "13179:13:0",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint32",
"typeString": "uint32"
},
"typeName": {
"id": 551,
"name": "uint32",
"nodeType": "ElementaryTypeName",
"src": "13179:6:0",
"typeDescriptions": {
"typeIdentifier": "t_uint32",
"typeString": "uint32"
}
},
"visibility": "internal"
}
],
"id": 556,
"initialValue": {
"commonType": {
"typeIdentifier": "t_uint32",
"typeString": "uint32"
},
"id": 555,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"id": 553,
"name": "time",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 503,
"src": "13195:4:0",
"typeDescriptions": {
"typeIdentifier": "t_uint32",
"typeString": "uint32"
}
},
"nodeType": "BinaryOperation",
"operator": "-",
"rightExpression": {
"id": 554,
"name": "secondsAgo",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 505,
"src": "13202:10:0",
"typeDescriptions": {
"typeIdentifier": "t_uint32",
"typeString": "uint32"
}
},
"src": "13195:17:0",
"typeDescriptions": {
"typeIdentifier": "t_uint32",
"typeString": "uint32"
}
},
"nodeType": "VariableDeclarationStatement",
"src": "13179:33:0"
},
{
"assignments": [
558,
560
],
"declarations": [
{
"constant": false,
"id": 558,
"mutability": "mutable",
"name": "beforeOrAt",
"nodeType": "VariableDeclaration",
"scope": 646,
"src": "13224:29:0",
"stateVariable": false,
"storageLocation": "memory",
"typeDescriptions": {
"typeIdentifier": "t_struct$_Observation_$11_memory_ptr",
"typeString": "struct Oracle.Observation"
},
"typeName": {
"id": 557,
"name": "Observation",
"nodeType": "UserDefinedTypeName",
"referencedDeclaration": 11,
"src": "13224:11:0",
"typeDescriptions": {
"typeIdentifier": "t_struct$_Observation_$11_storage_ptr",
"typeString": "struct Oracle.Observation"
}
},
"visibility": "internal"
},
{
"constant": false,
"id": 560,
"mutability": "mutable",
"name": "atOrAfter",
"nodeType": "VariableDeclaration",
"scope": 646,
"src": "13255:28:0",
"stateVariable": false,
"storageLocation": "memory",
"typeDescriptions": {
"typeIdentifier": "t_struct$_Observation_$11_memory_ptr",
"typeString": "struct Oracle.Observation"
},
"typeName": {
"id": 559,
"name": "Observation",
"nodeType": "UserDefinedTypeName",
"referencedDeclaration": 11,
"src": "13255:11:0",
"typeDescriptions": {
"typeIdentifier": "t_struct$_Observation_$11_storage_ptr",
"typeString": "struct Oracle.Observation"
}
},
"visibility": "internal"
}
],
"id": 570,
"initialValue": {
"arguments": [
{
"id": 562,
"name": "self",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 501,
"src": "13327:4:0",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_struct$_Observation_$11_storage_$65535_storage_ptr",
"typeString": "struct Oracle.Observation storage ref[65535] storage pointer"
}
},
{
"id": 563,
"name": "time",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 503,
"src": "13345:4:0",
"typeDescriptions": {
"typeIdentifier": "t_uint32",
"typeString": "uint32"
}
},
{
"id": 564,
"name": "target",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 552,
"src": "13363:6:0",
"typeDescriptions": {
"typeIdentifier": "t_uint32",
"typeString": "uint32"
}
},
{
"id": 565,
"name": "tick",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 507,
"src": "13383:4:0",
"typeDescriptions": {
"typeIdentifier": "t_int24",
"typeString": "int24"
}
},
{
"id": 566,
"name": "index",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 509,
"src": "13401:5:0",
"typeDescriptions": {
"typeIdentifier": "t_uint16",
"typeString": "uint16"
}
},
{
"id": 567,
"name": "liquidity",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 511,
"src": "13420:9:0",
"typeDescriptions": {
"typeIdentifier": "t_uint128",
"typeString": "uint128"
}
},
{
"id": 568,
"name": "cardinality",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 513,
"src": "13443:11:0",
"typeDescriptions": {
"typeIdentifier": "t_uint16",
"typeString": "uint16"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_array$_t_struct$_Observation_$11_storage_$65535_storage_ptr",
"typeString": "struct Oracle.Observation storage ref[65535] storage pointer"
},
{
"typeIdentifier": "t_uint32",
"typeString": "uint32"
},
{
"typeIdentifier": "t_uint32",
"typeString": "uint32"
},
{
"typeIdentifier": "t_int24",
"typeString": "int24"
},
{
"typeIdentifier": "t_uint16",
"typeString": "uint16"
},
{
"typeIdentifier": "t_uint128",
"typeString": "uint128"
},
{
"typeIdentifier": "t_uint16",
"typeString": "uint16"
}
],
"id": 561,
"name": "getSurroundingObservations",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 496,
"src": "13287:26:0",
"typeDescriptions": {
"typeIdentifier": "t_function_internal_view$_t_array$_t_struct$_Observation_$11_storage_$65535_storage_ptr_$_t_uint32_$_t_uint32_$_t_int24_$_t_uint16_$_t_uint128_$_t_uint16_$returns$_t_struct$_Observation_$11_memory_ptr_$_t_struct$_Observation_$11_memory_ptr_$",
"typeString": "function (struct Oracle.Observation storage ref[65535] storage pointer,uint32,uint32,int24,uint16,uint128,uint16) view returns (struct Oracle.Observation memory,struct Oracle.Observation memory)"
}
},
"id": 569,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "13287:177:0",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_tuple$_t_struct$_Observation_$11_memory_ptr_$_t_struct$_Observation_$11_memory_ptr_$",
"typeString": "tuple(struct Oracle.Observation memory,struct Oracle.Observation memory)"
}
},
"nodeType": "VariableDeclarationStatement",
"src": "13223:241:0"
},
{
"condition": {
"commonType": {
"typeIdentifier": "t_uint32",
"typeString": "uint32"
},
"id": 574,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"id": 571,
"name": "target",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 552,
"src": "13479:6:0",
"typeDescriptions": {
"typeIdentifier": "t_uint32",
"typeString": "uint32"
}
},
"nodeType": "BinaryOperation",
"operator": "==",
"rightExpression": {
"expression": {
"id": 572,
"name": "beforeOrAt",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 558,
"src": "13489:10:0",
"typeDescriptions": {
"typeIdentifier": "t_struct$_Observation_$11_memory_ptr",
"typeString": "struct Oracle.Observation memory"
}
},
"id": 573,
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"memberName": "blockTimestamp",
"nodeType": "MemberAccess",
"referencedDeclaration": 4,
"src": "13489:25:0",
"typeDescriptions": {
"typeIdentifier": "t_uint32",
"typeString": "uint32"
}
},
"src": "13479:35:0",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"falseBody": {
"condition": {
"commonType": {
"typeIdentifier": "t_uint32",
"typeString": "uint32"
},
"id": 585,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"id": 582,
"name": "target",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 552,
"src": "13673:6:0",
"typeDescriptions": {
"typeIdentifier": "t_uint32",
"typeString": "uint32"
}
},
"nodeType": "BinaryOperation",
"operator": "==",
"rightExpression": {
"expression": {
"id": 583,
"name": "atOrAfter",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 560,
"src": "13683:9:0",
"typeDescriptions": {
"typeIdentifier": "t_struct$_Observation_$11_memory_ptr",
"typeString": "struct Oracle.Observation memory"
}
},
"id": 584,
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"memberName": "blockTimestamp",
"nodeType": "MemberAccess",
"referencedDeclaration": 4,
"src": "13683:24:0",
"typeDescriptions": {
"typeIdentifier": "t_uint32",
"typeString": "uint32"
}
},
"src": "13673:34:0",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"falseBody": {
"id": 643,
"nodeType": "Block",
"src": "13861:757:0",
"statements": [
{
"assignments": [
594
],
"declarations": [
{
"constant": false,
"id": 594,
"mutability": "mutable",
"name": "observationTimeDelta",
"nodeType": "VariableDeclaration",
"scope": 643,
"src": "13910:27:0",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint32",
"typeString": "uint32"
},
"typeName": {
"id": 593,
"name": "uint32",
"nodeType": "ElementaryTypeName",
"src": "13910:6:0",
"typeDescriptions": {
"typeIdentifier": "t_uint32",
"typeString": "uint32"
}
},
"visibility": "internal"
}
],
"id": 600,
"initialValue": {
"commonType": {
"typeIdentifier": "t_uint32",
"typeString": "uint32"
},
"id": 599,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"expression": {
"id": 595,
"name": "atOrAfter",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 560,
"src": "13940:9:0",
"typeDescriptions": {
"typeIdentifier": "t_struct$_Observation_$11_memory_ptr",
"typeString": "struct Oracle.Observation memory"
}
},
"id": 596,
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"memberName": "blockTimestamp",
"nodeType": "MemberAccess",
"referencedDeclaration": 4,
"src": "13940:24:0",
"typeDescriptions": {
"typeIdentifier": "t_uint32",
"typeString": "uint32"
}
},
"nodeType": "BinaryOperation",
"operator": "-",
"rightExpression": {
"expression": {
"id": 597,
"name": "beforeOrAt",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 558,
"src": "13967:10:0",
"typeDescriptions": {
"typeIdentifier": "t_struct$_Observation_$11_memory_ptr",
"typeString": "struct Oracle.Observation memory"
}
},
"id": 598,
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"memberName": "blockTimestamp",
"nodeType": "MemberAccess",
"referencedDeclaration": 4,
"src": "13967:25:0",
"typeDescriptions": {
"typeIdentifier": "t_uint32",
"typeString": "uint32"
}
},
"src": "13940:52:0",
"typeDescriptions": {
"typeIdentifier": "t_uint32",
"typeString": "uint32"
}
},
"nodeType": "VariableDeclarationStatement",
"src": "13910:82:0"
},
{
"assignments": [
602
],
"declarations": [
{
"constant": false,
"id": 602,
"mutability": "mutable",
"name": "targetDelta",
"nodeType": "VariableDeclaration",
"scope": 643,
"src": "14006:18:0",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint32",
"typeString": "uint32"
},
"typeName": {
"id": 601,
"name": "uint32",
"nodeType": "ElementaryTypeName",
"src": "14006:6:0",
"typeDescriptions": {
"typeIdentifier": "t_uint32",
"typeString": "uint32"
}
},
"visibility": "internal"
}
],
"id": 607,
"initialValue": {
"commonType": {
"typeIdentifier": "t_uint32",
"typeString": "uint32"
},
"id": 606,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"id": 603,
"name": "target",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 552,
"src": "14027:6:0",
"typeDescriptions": {
"typeIdentifier": "t_uint32",
"typeString": "uint32"
}
},
"nodeType": "BinaryOperation",
"operator": "-",
"rightExpression": {
"expression": {
"id": 604,
"name": "beforeOrAt",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 558,
"src": "14036:10:0",
"typeDescriptions": {
"typeIdentifier": "t_struct$_Observation_$11_memory_ptr",
"typeString": "struct Oracle.Observation memory"
}
},
"id": 605,
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"memberName": "blockTimestamp",
"nodeType": "MemberAccess",
"referencedDeclaration": 4,
"src": "14036:25:0",
"typeDescriptions": {
"typeIdentifier": "t_uint32",
"typeString": "uint32"
}
},
"src": "14027:34:0",
"typeDescriptions": {
"typeIdentifier": "t_uint32",
"typeString": "uint32"
}
},
"nodeType": "VariableDeclarationStatement",
"src": "14006:55:0"
},
{
"expression": {
"components": [
{
"commonType": {
"typeIdentifier": "t_int56",
"typeString": "int56"
},
"id": 621,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"expression": {
"id": 608,
"name": "beforeOrAt",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 558,
"src": "14100:10:0",
"typeDescriptions": {
"typeIdentifier": "t_struct$_Observation_$11_memory_ptr",
"typeString": "struct Oracle.Observation memory"
}
},
"id": 609,
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"memberName": "tickCumulative",
"nodeType": "MemberAccess",
"referencedDeclaration": 6,
"src": "14100:25:0",
"typeDescriptions": {
"typeIdentifier": "t_int56",
"typeString": "int56"
}
},
"nodeType": "BinaryOperation",
"operator": "+",
"rightExpression": {
"commonType": {
"typeIdentifier": "t_int56",
"typeString": "int56"
},
"id": 620,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"components": [
{
"commonType": {
"typeIdentifier": "t_int56",
"typeString": "int56"
},
"id": 617,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"components": [
{
"commonType": {
"typeIdentifier": "t_int56",
"typeString": "int56"
},
"id": 614,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"expression": {
"id": 610,
"name": "atOrAfter",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 560,
"src": "14150:9:0",
"typeDescriptions": {
"typeIdentifier": "t_struct$_Observation_$11_memory_ptr",
"typeString": "struct Oracle.Observation memory"
}
},
"id": 611,
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"memberName": "tickCumulative",
"nodeType": "MemberAccess",
"referencedDeclaration": 6,
"src": "14150:24:0",
"typeDescriptions": {
"typeIdentifier": "t_int56",
"typeString": "int56"
}
},
"nodeType": "BinaryOperation",
"operator": "-",
"rightExpression": {
"expression": {
"id": 612,
"name": "beforeOrAt",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 558,
"src": "14177:10:0",
"typeDescriptions": {
"typeIdentifier": "t_struct$_Observation_$11_memory_ptr",
"typeString": "struct Oracle.Observation memory"
}
},
"id": 613,
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"memberName": "tickCumulative",
"nodeType": "MemberAccess",
"referencedDeclaration": 6,
"src": "14177:25:0",
"typeDescriptions": {
"typeIdentifier": "t_int56",
"typeString": "int56"
}
},
"src": "14150:52:0",
"typeDescriptions": {
"typeIdentifier": "t_int56",
"typeString": "int56"
}
}
],
"id": 615,
"isConstant": false,
"isInlineArray": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"nodeType": "TupleExpression",
"src": "14149:54:0",
"typeDescriptions": {
"typeIdentifier": "t_int56",
"typeString": "int56"
}
},
"nodeType": "BinaryOperation",
"operator": "/",
"rightExpression": {
"id": 616,
"name": "observationTimeDelta",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 594,
"src": "14206:20:0",
"typeDescriptions": {
"typeIdentifier": "t_uint32",
"typeString": "uint32"
}
},
"src": "14149:77:0",
"typeDescriptions": {
"typeIdentifier": "t_int56",
"typeString": "int56"
}
}
],
"id": 618,
"isConstant": false,
"isInlineArray": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"nodeType": "TupleExpression",
"src": "14148:79:0",
"typeDescriptions": {
"typeIdentifier": "t_int56",
"typeString": "int56"
}
},
"nodeType": "BinaryOperation",
"operator": "*",
"rightExpression": {
"id": 619,
"name": "targetDelta",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 602,
"src": "14250:11:0",
"typeDescriptions": {
"typeIdentifier": "t_uint32",
"typeString": "uint32"
}
},
"src": "14148:113:0",
"typeDescriptions": {
"typeIdentifier": "t_int56",
"typeString": "int56"
}
},
"src": "14100:161:0",
"typeDescriptions": {
"typeIdentifier": "t_int56",
"typeString": "int56"
}
},
{
"commonType": {
"typeIdentifier": "t_uint160",
"typeString": "uint160"
},
"id": 640,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"expression": {
"id": 622,
"name": "beforeOrAt",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 558,
"src": "14279:10:0",
"typeDescriptions": {
"typeIdentifier": "t_struct$_Observation_$11_memory_ptr",
"typeString": "struct Oracle.Observation memory"
}
},
"id": 623,
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"memberName": "secondsPerLiquidityCumulativeX128",
"nodeType": "MemberAccess",
"referencedDeclaration": 8,
"src": "14279:44:0",
"typeDescriptions": {
"typeIdentifier": "t_uint160",
"typeString": "uint160"
}
},
"nodeType": "BinaryOperation",
"operator": "+",
"rightExpression": {
"arguments": [
{
"commonType": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"id": 638,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"components": [
{
"commonType": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"id": 635,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"arguments": [
{
"commonType": {
"typeIdentifier": "t_uint160",
"typeString": "uint160"
},
"id": 632,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"expression": {
"id": 628,
"name": "atOrAfter",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 560,
"src": "14417:9:0",
"typeDescriptions": {
"typeIdentifier": "t_struct$_Observation_$11_memory_ptr",
"typeString": "struct Oracle.Observation memory"
}
},
"id": 629,
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"memberName": "secondsPerLiquidityCumulativeX128",
"nodeType": "MemberAccess",
"referencedDeclaration": 8,
"src": "14417:43:0",
"typeDescriptions": {
"typeIdentifier": "t_uint160",
"typeString": "uint160"
}
},
"nodeType": "BinaryOperation",
"operator": "-",
"rightExpression": {
"expression": {
"id": 630,
"name": "beforeOrAt",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 558,
"src": "14463:10:0",
"typeDescriptions": {
"typeIdentifier": "t_struct$_Observation_$11_memory_ptr",
"typeString": "struct Oracle.Observation memory"
}
},
"id": 631,
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"memberName": "secondsPerLiquidityCumulativeX128",
"nodeType": "MemberAccess",
"referencedDeclaration": 8,
"src": "14463:44:0",
"typeDescriptions": {
"typeIdentifier": "t_uint160",
"typeString": "uint160"
}
},
"src": "14417:90:0",
"typeDescriptions": {
"typeIdentifier": "t_uint160",
"typeString": "uint160"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_uint160",
"typeString": "uint160"
}
],
"id": 627,
"isConstant": false,
"isLValue": false,
"isPure": true,
"lValueRequested": false,
"nodeType": "ElementaryTypeNameExpression",
"src": "14380:7:0",
"typeDescriptions": {
"typeIdentifier": "t_type$_t_uint256_$",
"typeString": "type(uint256)"
},
"typeName": {
"id": 626,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "14380:7:0",
"typeDescriptions": {}
}
},
"id": 633,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "typeConversion",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "14380:153:0",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "BinaryOperation",
"operator": "*",
"rightExpression": {
"id": 634,
"name": "targetDelta",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 602,
"src": "14536:11:0",
"typeDescriptions": {
"typeIdentifier": "t_uint32",
"typeString": "uint32"
}
},
"src": "14380:167:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
}
],
"id": 636,
"isConstant": false,
"isInlineArray": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"nodeType": "TupleExpression",
"src": "14379:169:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "BinaryOperation",
"operator": "/",
"rightExpression": {
"id": 637,
"name": "observationTimeDelta",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 594,
"src": "14551:20:0",
"typeDescriptions": {
"typeIdentifier": "t_uint32",
"typeString": "uint32"
}
},
"src": "14379:192:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
],
"id": 625,
"isConstant": false,
"isLValue": false,
"isPure": true,
"lValueRequested": false,
"nodeType": "ElementaryTypeNameExpression",
"src": "14346:7:0",
"typeDescriptions": {
"typeIdentifier": "t_type$_t_uint160_$",
"typeString": "type(uint160)"
},
"typeName": {
"id": 624,
"name": "uint160",
"nodeType": "ElementaryTypeName",
"src": "14346:7:0",
"typeDescriptions": {}
}
},
"id": 639,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "typeConversion",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "14346:247:0",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_uint160",
"typeString": "uint160"
}
},
"src": "14279:314:0",
"typeDescriptions": {
"typeIdentifier": "t_uint160",
"typeString": "uint160"
}
}
],
"id": 641,
"isConstant": false,
"isInlineArray": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"nodeType": "TupleExpression",
"src": "14082:525:0",
"typeDescriptions": {
"typeIdentifier": "t_tuple$_t_int56_$_t_uint160_$",
"typeString": "tuple(int56,uint160)"
}
},
"functionReturnParameters": 519,
"id": 642,
"nodeType": "Return",
"src": "14075:532:0"
}
]
},
"id": 644,
"nodeType": "IfStatement",
"src": "13669:949:0",
"trueBody": {
"id": 592,
"nodeType": "Block",
"src": "13709:146:0",
"statements": [
{
"expression": {
"components": [
{
"expression": {
"id": 586,
"name": "atOrAfter",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 560,
"src": "13774:9:0",
"typeDescriptions": {
"typeIdentifier": "t_struct$_Observation_$11_memory_ptr",
"typeString": "struct Oracle.Observation memory"
}
},
"id": 587,
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"memberName": "tickCumulative",
"nodeType": "MemberAccess",
"referencedDeclaration": 6,
"src": "13774:24:0",
"typeDescriptions": {
"typeIdentifier": "t_int56",
"typeString": "int56"
}
},
{
"expression": {
"id": 588,
"name": "atOrAfter",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 560,
"src": "13800:9:0",
"typeDescriptions": {
"typeIdentifier": "t_struct$_Observation_$11_memory_ptr",
"typeString": "struct Oracle.Observation memory"
}
},
"id": 589,
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"memberName": "secondsPerLiquidityCumulativeX128",
"nodeType": "MemberAccess",
"referencedDeclaration": 8,
"src": "13800:43:0",
"typeDescriptions": {
"typeIdentifier": "t_uint160",
"typeString": "uint160"
}
}
],
"id": 590,
"isConstant": false,
"isInlineArray": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"nodeType": "TupleExpression",
"src": "13773:71:0",
"typeDescriptions": {
"typeIdentifier": "t_tuple$_t_int56_$_t_uint160_$",
"typeString": "tuple(int56,uint160)"
}
},
"functionReturnParameters": 519,
"id": 591,
"nodeType": "Return",
"src": "13766:78:0"
}
]
}
},
"id": 645,
"nodeType": "IfStatement",
"src": "13475:1143:0",
"trueBody": {
"id": 581,
"nodeType": "Block",
"src": "13516:147:0",
"statements": [
{
"expression": {
"components": [
{
"expression": {
"id": 575,
"name": "beforeOrAt",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 558,
"src": "13580:10:0",
"typeDescriptions": {
"typeIdentifier": "t_struct$_Observation_$11_memory_ptr",
"typeString": "struct Oracle.Observation memory"
}
},
"id": 576,
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"memberName": "tickCumulative",
"nodeType": "MemberAccess",
"referencedDeclaration": 6,
"src": "13580:25:0",
"typeDescriptions": {
"typeIdentifier": "t_int56",
"typeString": "int56"
}
},
{
"expression": {
"id": 577,
"name": "beforeOrAt",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 558,
"src": "13607:10:0",
"typeDescriptions": {
"typeIdentifier": "t_struct$_Observation_$11_memory_ptr",
"typeString": "struct Oracle.Observation memory"
}
},
"id": 578,
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"memberName": "secondsPerLiquidityCumulativeX128",
"nodeType": "MemberAccess",
"referencedDeclaration": 8,
"src": "13607:44:0",
"typeDescriptions": {
"typeIdentifier": "t_uint160",
"typeString": "uint160"
}
}
],
"id": 579,
"isConstant": false,
"isInlineArray": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"nodeType": "TupleExpression",
"src": "13579:73:0",
"typeDescriptions": {
"typeIdentifier": "t_tuple$_t_int56_$_t_uint160_$",
"typeString": "tuple(int56,uint160)"
}
},
"functionReturnParameters": 519,
"id": 580,
"nodeType": "Return",
"src": "13572:80:0"
}
]
}
}
]
},
"documentation": {
"id": 497,
"nodeType": "StructuredDocumentation",
"src": "11494:1100:0",
"text": "@dev Reverts if an observation at or before the desired observation timestamp does not exist.\n 0 may be passed as `secondsAgo' to return the current cumulative values.\n If called with a timestamp falling between two observations, returns the counterfactual accumulator values\n at exactly the timestamp between the two observations.\n @param self The stored oracle array\n @param time The current block timestamp\n @param secondsAgo The amount of time to look back, in seconds, at which point to return an observation\n @param tick The current tick\n @param index The index of the observation that was most recently written to the observations array\n @param liquidity The current in-range pool liquidity\n @param cardinality The number of populated elements in the oracle array\n @return tickCumulative The tick * time elapsed since the pool was first initialized, as of `secondsAgo`\n @return secondsPerLiquidityCumulativeX128 The time elapsed / max(1, liquidity) since the pool was first initialized, as of `secondsAgo`"
},
"id": 647,
"implemented": true,
"kind": "function",
"modifiers": [],
"name": "observeSingle",
"nodeType": "FunctionDefinition",
"parameters": {
"id": 514,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 501,
"mutability": "mutable",
"name": "self",
"nodeType": "VariableDeclaration",
"scope": 647,
"src": "12631:31:0",
"stateVariable": false,
"storageLocation": "storage",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_struct$_Observation_$11_storage_$65535_storage_ptr",
"typeString": "struct Oracle.Observation[65535]"
},
"typeName": {
"baseType": {
"id": 498,
"name": "Observation",
"nodeType": "UserDefinedTypeName",
"referencedDeclaration": 11,
"src": "12631:11:0",
"typeDescriptions": {
"typeIdentifier": "t_struct$_Observation_$11_storage_ptr",
"typeString": "struct Oracle.Observation"
}
},
"id": 500,
"length": {
"hexValue": "3635353335",
"id": 499,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "number",
"lValueRequested": false,
"nodeType": "Literal",
"src": "12643:5:0",
"typeDescriptions": {
"typeIdentifier": "t_rational_65535_by_1",
"typeString": "int_const 65535"
},
"value": "65535"
},
"nodeType": "ArrayTypeName",
"src": "12631:18:0",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_struct$_Observation_$11_storage_$65535_storage_ptr",
"typeString": "struct Oracle.Observation[65535]"
}
},
"visibility": "internal"
},
{
"constant": false,
"id": 503,
"mutability": "mutable",
"name": "time",
"nodeType": "VariableDeclaration",
"scope": 647,
"src": "12672:11:0",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint32",
"typeString": "uint32"
},
"typeName": {
"id": 502,
"name": "uint32",
"nodeType": "ElementaryTypeName",
"src": "12672:6:0",
"typeDescriptions": {
"typeIdentifier": "t_uint32",
"typeString": "uint32"
}
},
"visibility": "internal"
},
{
"constant": false,
"id": 505,
"mutability": "mutable",
"name": "secondsAgo",
"nodeType": "VariableDeclaration",
"scope": 647,
"src": "12693:17:0",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint32",
"typeString": "uint32"
},
"typeName": {
"id": 504,
"name": "uint32",
"nodeType": "ElementaryTypeName",
"src": "12693:6:0",
"typeDescriptions": {
"typeIdentifier": "t_uint32",
"typeString": "uint32"
}
},
"visibility": "internal"
},
{
"constant": false,
"id": 507,
"mutability": "mutable",
"name": "tick",
"nodeType": "VariableDeclaration",
"scope": 647,
"src": "12720:10:0",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_int24",
"typeString": "int24"
},
"typeName": {
"id": 506,
"name": "int24",
"nodeType": "ElementaryTypeName",
"src": "12720:5:0",
"typeDescriptions": {
"typeIdentifier": "t_int24",
"typeString": "int24"
}
},
"visibility": "internal"
},
{
"constant": false,
"id": 509,
"mutability": "mutable",
"name": "index",
"nodeType": "VariableDeclaration",
"scope": 647,
"src": "12740:12:0",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint16",
"typeString": "uint16"
},
"typeName": {
"id": 508,
"name": "uint16",
"nodeType": "ElementaryTypeName",
"src": "12740:6:0",
"typeDescriptions": {
"typeIdentifier": "t_uint16",
"typeString": "uint16"
}
},
"visibility": "internal"
},
{
"constant": false,
"id": 511,
"mutability": "mutable",
"name": "liquidity",
"nodeType": "VariableDeclaration",
"scope": 647,
"src": "12762:17:0",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint128",
"typeString": "uint128"
},
"typeName": {
"id": 510,
"name": "uint128",
"nodeType": "ElementaryTypeName",
"src": "12762:7:0",
"typeDescriptions": {
"typeIdentifier": "t_uint128",
"typeString": "uint128"
}
},
"visibility": "internal"
},
{
"constant": false,
"id": 513,
"mutability": "mutable",
"name": "cardinality",
"nodeType": "VariableDeclaration",
"scope": 647,
"src": "12789:18:0",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint16",
"typeString": "uint16"
},
"typeName": {
"id": 512,
"name": "uint16",
"nodeType": "ElementaryTypeName",
"src": "12789:6:0",
"typeDescriptions": {
"typeIdentifier": "t_uint16",
"typeString": "uint16"
}
},
"visibility": "internal"
}
],
"src": "12621:192:0"
},
"returnParameters": {
"id": 519,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 516,
"mutability": "mutable",
"name": "tickCumulative",
"nodeType": "VariableDeclaration",
"scope": 647,
"src": "12837:20:0",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_int56",
"typeString": "int56"
},
"typeName": {
"id": 515,
"name": "int56",
"nodeType": "ElementaryTypeName",
"src": "12837:5:0",
"typeDescriptions": {
"typeIdentifier": "t_int56",
"typeString": "int56"
}
},
"visibility": "internal"
},
{
"constant": false,
"id": 518,
"mutability": "mutable",
"name": "secondsPerLiquidityCumulativeX128",
"nodeType": "VariableDeclaration",
"scope": 647,
"src": "12859:41:0",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint160",
"typeString": "uint160"
},
"typeName": {
"id": 517,
"name": "uint160",
"nodeType": "ElementaryTypeName",
"src": "12859:7:0",
"typeDescriptions": {
"typeIdentifier": "t_uint160",
"typeString": "uint160"
}
},
"visibility": "internal"
}
],
"src": "12836:65:0"
},
"scope": 734,
"src": "12599:2025:0",
"stateMutability": "view",
"virtual": false,
"visibility": "internal"
},
{
"body": {
"id": 732,
"nodeType": "Block",
"src": "15905:535:0",
"statements": [
{
"expression": {
"arguments": [
{
"commonType": {
"typeIdentifier": "t_uint16",
"typeString": "uint16"
},
"id": 677,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"id": 675,
"name": "cardinality",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 665,
"src": "15923:11:0",
"typeDescriptions": {
"typeIdentifier": "t_uint16",
"typeString": "uint16"
}
},
"nodeType": "BinaryOperation",
"operator": ">",
"rightExpression": {
"hexValue": "30",
"id": 676,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "number",
"lValueRequested": false,
"nodeType": "Literal",
"src": "15937:1:0",
"typeDescriptions": {
"typeIdentifier": "t_rational_0_by_1",
"typeString": "int_const 0"
},
"value": "0"
},
"src": "15923:15:0",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
{
"hexValue": "49",
"id": 678,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "string",
"lValueRequested": false,
"nodeType": "Literal",
"src": "15940:3:0",
"typeDescriptions": {
"typeIdentifier": "t_stringliteral_8d61ecf6e15472e15b1a0f63cd77f62aa57e6edcd3871d7a841f1056fb42b216",
"typeString": "literal_string \"I\""
},
"value": "I"
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_bool",
"typeString": "bool"
},
{
"typeIdentifier": "t_stringliteral_8d61ecf6e15472e15b1a0f63cd77f62aa57e6edcd3871d7a841f1056fb42b216",
"typeString": "literal_string \"I\""
}
],
"id": 674,
"name": "require",
"nodeType": "Identifier",
"overloadedDeclarations": [
-18,
-18
],
"referencedDeclaration": -18,
"src": "15915:7:0",
"typeDescriptions": {
"typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$",
"typeString": "function (bool,string memory) pure"
}
},
"id": 679,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "15915:29:0",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_tuple$__$",
"typeString": "tuple()"
}
},
"id": 680,
"nodeType": "ExpressionStatement",
"src": "15915:29:0"
},
{
"expression": {
"id": 688,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftHandSide": {
"id": 681,
"name": "tickCumulatives",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 669,
"src": "15955:15:0",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_int56_$dyn_memory_ptr",
"typeString": "int56[] memory"
}
},
"nodeType": "Assignment",
"operator": "=",
"rightHandSide": {
"arguments": [
{
"expression": {
"id": 685,
"name": "secondsAgos",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 657,
"src": "15985:11:0",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_uint32_$dyn_memory_ptr",
"typeString": "uint32[] memory"
}
},
"id": 686,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"memberName": "length",
"nodeType": "MemberAccess",
"src": "15985:18:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
],
"id": 684,
"isConstant": false,
"isLValue": false,
"isPure": true,
"lValueRequested": false,
"nodeType": "NewExpression",
"src": "15973:11:0",
"typeDescriptions": {
"typeIdentifier": "t_function_objectcreation_pure$_t_uint256_$returns$_t_array$_t_int56_$dyn_memory_ptr_$",
"typeString": "function (uint256) pure returns (int56[] memory)"
},
"typeName": {
"baseType": {
"id": 682,
"name": "int56",
"nodeType": "ElementaryTypeName",
"src": "15977:5:0",
"typeDescriptions": {
"typeIdentifier": "t_int56",
"typeString": "int56"
}
},
"id": 683,
"nodeType": "ArrayTypeName",
"src": "15977:7:0",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_int56_$dyn_storage_ptr",
"typeString": "int56[]"
}
}
},
"id": 687,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "15973:31:0",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_array$_t_int56_$dyn_memory_ptr",
"typeString": "int56[] memory"
}
},
"src": "15955:49:0",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_int56_$dyn_memory_ptr",
"typeString": "int56[] memory"
}
},
"id": 689,
"nodeType": "ExpressionStatement",
"src": "15955:49:0"
},
{
"expression": {
"id": 697,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftHandSide": {
"id": 690,
"name": "secondsPerLiquidityCumulativeX128s",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 672,
"src": "16014:34:0",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_uint160_$dyn_memory_ptr",
"typeString": "uint160[] memory"
}
},
"nodeType": "Assignment",
"operator": "=",
"rightHandSide": {
"arguments": [
{
"expression": {
"id": 694,
"name": "secondsAgos",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 657,
"src": "16065:11:0",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_uint32_$dyn_memory_ptr",
"typeString": "uint32[] memory"
}
},
"id": 695,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"memberName": "length",
"nodeType": "MemberAccess",
"src": "16065:18:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
],
"id": 693,
"isConstant": false,
"isLValue": false,
"isPure": true,
"lValueRequested": false,
"nodeType": "NewExpression",
"src": "16051:13:0",
"typeDescriptions": {
"typeIdentifier": "t_function_objectcreation_pure$_t_uint256_$returns$_t_array$_t_uint160_$dyn_memory_ptr_$",
"typeString": "function (uint256) pure returns (uint160[] memory)"
},
"typeName": {
"baseType": {
"id": 691,
"name": "uint160",
"nodeType": "ElementaryTypeName",
"src": "16055:7:0",
"typeDescriptions": {
"typeIdentifier": "t_uint160",
"typeString": "uint160"
}
},
"id": 692,
"nodeType": "ArrayTypeName",
"src": "16055:9:0",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_uint160_$dyn_storage_ptr",
"typeString": "uint160[]"
}
}
},
"id": 696,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "16051:33:0",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_array$_t_uint160_$dyn_memory_ptr",
"typeString": "uint160[] memory"
}
},
"src": "16014:70:0",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_uint160_$dyn_memory_ptr",
"typeString": "uint160[] memory"
}
},
"id": 698,
"nodeType": "ExpressionStatement",
"src": "16014:70:0"
},
{
"body": {
"id": 730,
"nodeType": "Block",
"src": "16143:291:0",
"statements": [
{
"expression": {
"id": 728,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftHandSide": {
"components": [
{
"baseExpression": {
"id": 710,
"name": "tickCumulatives",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 669,
"src": "16158:15:0",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_int56_$dyn_memory_ptr",
"typeString": "int56[] memory"
}
},
"id": 712,
"indexExpression": {
"id": 711,
"name": "i",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 700,
"src": "16174:1:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": true,
"nodeType": "IndexAccess",
"src": "16158:18:0",
"typeDescriptions": {
"typeIdentifier": "t_int56",
"typeString": "int56"
}
},
{
"baseExpression": {
"id": 713,
"name": "secondsPerLiquidityCumulativeX128s",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 672,
"src": "16178:34:0",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_uint160_$dyn_memory_ptr",
"typeString": "uint160[] memory"
}
},
"id": 715,
"indexExpression": {
"id": 714,
"name": "i",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 700,
"src": "16213:1:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": true,
"nodeType": "IndexAccess",
"src": "16178:37:0",
"typeDescriptions": {
"typeIdentifier": "t_uint160",
"typeString": "uint160"
}
}
],
"id": 716,
"isConstant": false,
"isInlineArray": false,
"isLValue": true,
"isPure": false,
"lValueRequested": true,
"nodeType": "TupleExpression",
"src": "16157:59:0",
"typeDescriptions": {
"typeIdentifier": "t_tuple$_t_int56_$_t_uint160_$",
"typeString": "tuple(int56,uint160)"
}
},
"nodeType": "Assignment",
"operator": "=",
"rightHandSide": {
"arguments": [
{
"id": 718,
"name": "self",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 652,
"src": "16250:4:0",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_struct$_Observation_$11_storage_$65535_storage_ptr",
"typeString": "struct Oracle.Observation storage ref[65535] storage pointer"
}
},
{
"id": 719,
"name": "time",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 654,
"src": "16272:4:0",
"typeDescriptions": {
"typeIdentifier": "t_uint32",
"typeString": "uint32"
}
},
{
"baseExpression": {
"id": 720,
"name": "secondsAgos",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 657,
"src": "16294:11:0",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_uint32_$dyn_memory_ptr",
"typeString": "uint32[] memory"
}
},
"id": 722,
"indexExpression": {
"id": 721,
"name": "i",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 700,
"src": "16306:1:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"nodeType": "IndexAccess",
"src": "16294:14:0",
"typeDescriptions": {
"typeIdentifier": "t_uint32",
"typeString": "uint32"
}
},
{
"id": 723,
"name": "tick",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 659,
"src": "16326:4:0",
"typeDescriptions": {
"typeIdentifier": "t_int24",
"typeString": "int24"
}
},
{
"id": 724,
"name": "index",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 661,
"src": "16348:5:0",
"typeDescriptions": {
"typeIdentifier": "t_uint16",
"typeString": "uint16"
}
},
{
"id": 725,
"name": "liquidity",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 663,
"src": "16371:9:0",
"typeDescriptions": {
"typeIdentifier": "t_uint128",
"typeString": "uint128"
}
},
{
"id": 726,
"name": "cardinality",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 665,
"src": "16398:11:0",
"typeDescriptions": {
"typeIdentifier": "t_uint16",
"typeString": "uint16"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_array$_t_struct$_Observation_$11_storage_$65535_storage_ptr",
"typeString": "struct Oracle.Observation storage ref[65535] storage pointer"
},
{
"typeIdentifier": "t_uint32",
"typeString": "uint32"
},
{
"typeIdentifier": "t_uint32",
"typeString": "uint32"
},
{
"typeIdentifier": "t_int24",
"typeString": "int24"
},
{
"typeIdentifier": "t_uint16",
"typeString": "uint16"
},
{
"typeIdentifier": "t_uint128",
"typeString": "uint128"
},
{
"typeIdentifier": "t_uint16",
"typeString": "uint16"
}
],
"id": 717,
"name": "observeSingle",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 647,
"src": "16219:13:0",
"typeDescriptions": {
"typeIdentifier": "t_function_internal_view$_t_array$_t_struct$_Observation_$11_storage_$65535_storage_ptr_$_t_uint32_$_t_uint32_$_t_int24_$_t_uint16_$_t_uint128_$_t_uint16_$returns$_t_int56_$_t_uint160_$",
"typeString": "function (struct Oracle.Observation storage ref[65535] storage pointer,uint32,uint32,int24,uint16,uint128,uint16) view returns (int56,uint160)"
}
},
"id": 727,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "16219:204:0",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_tuple$_t_int56_$_t_uint160_$",
"typeString": "tuple(int56,uint160)"
}
},
"src": "16157:266:0",
"typeDescriptions": {
"typeIdentifier": "t_tuple$__$",
"typeString": "tuple()"
}
},
"id": 729,
"nodeType": "ExpressionStatement",
"src": "16157:266:0"
}
]
},
"condition": {
"commonType": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"id": 706,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"id": 703,
"name": "i",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 700,
"src": "16114:1:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "BinaryOperation",
"operator": "<",
"rightExpression": {
"expression": {
"id": 704,
"name": "secondsAgos",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 657,
"src": "16118:11:0",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_uint32_$dyn_memory_ptr",
"typeString": "uint32[] memory"
}
},
"id": 705,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"memberName": "length",
"nodeType": "MemberAccess",
"src": "16118:18:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"src": "16114:22:0",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"id": 731,
"initializationExpression": {
"assignments": [
700
],
"declarations": [
{
"constant": false,
"id": 700,
"mutability": "mutable",
"name": "i",
"nodeType": "VariableDeclaration",
"scope": 731,
"src": "16099:9:0",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 699,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "16099:7:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"visibility": "internal"
}
],
"id": 702,
"initialValue": {
"hexValue": "30",
"id": 701,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "number",
"lValueRequested": false,
"nodeType": "Literal",
"src": "16111:1:0",
"typeDescriptions": {
"typeIdentifier": "t_rational_0_by_1",
"typeString": "int_const 0"
},
"value": "0"
},
"nodeType": "VariableDeclarationStatement",
"src": "16099:13:0"
},
"loopExpression": {
"expression": {
"id": 708,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"nodeType": "UnaryOperation",
"operator": "++",
"prefix": false,
"src": "16138:3:0",
"subExpression": {
"id": 707,
"name": "i",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 700,
"src": "16138:1:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"id": 709,
"nodeType": "ExpressionStatement",
"src": "16138:3:0"
},
"nodeType": "ForStatement",
"src": "16094:340:0"
}
]
},
"documentation": {
"id": 648,
"nodeType": "StructuredDocumentation",
"src": "14630:943:0",
"text": "@notice Returns the accumulator values as of each time seconds ago from the given time in the array of `secondsAgos`\n @dev Reverts if `secondsAgos` > oldest observation\n @param self The stored oracle array\n @param time The current block.timestamp\n @param secondsAgos Each amount of time to look back, in seconds, at which point to return an observation\n @param tick The current tick\n @param index The index of the observation that was most recently written to the observations array\n @param liquidity The current in-range pool liquidity\n @param cardinality The number of populated elements in the oracle array\n @return tickCumulatives The tick * time elapsed since the pool was first initialized, as of each `secondsAgo`\n @return secondsPerLiquidityCumulativeX128s The cumulative seconds / max(1, liquidity) since the pool was first initialized, as of each `secondsAgo`"
},
"id": 733,
"implemented": true,
"kind": "function",
"modifiers": [],
"name": "observe",
"nodeType": "FunctionDefinition",
"parameters": {
"id": 666,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 652,
"mutability": "mutable",
"name": "self",
"nodeType": "VariableDeclaration",
"scope": 733,
"src": "15604:31:0",
"stateVariable": false,
"storageLocation": "storage",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_struct$_Observation_$11_storage_$65535_storage_ptr",
"typeString": "struct Oracle.Observation[65535]"
},
"typeName": {
"baseType": {
"id": 649,
"name": "Observation",
"nodeType": "UserDefinedTypeName",
"referencedDeclaration": 11,
"src": "15604:11:0",
"typeDescriptions": {
"typeIdentifier": "t_struct$_Observation_$11_storage_ptr",
"typeString": "struct Oracle.Observation"
}
},
"id": 651,
"length": {
"hexValue": "3635353335",
"id": 650,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "number",
"lValueRequested": false,
"nodeType": "Literal",
"src": "15616:5:0",
"typeDescriptions": {
"typeIdentifier": "t_rational_65535_by_1",
"typeString": "int_const 65535"
},
"value": "65535"
},
"nodeType": "ArrayTypeName",
"src": "15604:18:0",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_struct$_Observation_$11_storage_$65535_storage_ptr",
"typeString": "struct Oracle.Observation[65535]"
}
},
"visibility": "internal"
},
{
"constant": false,
"id": 654,
"mutability": "mutable",
"name": "time",
"nodeType": "VariableDeclaration",
"scope": 733,
"src": "15645:11:0",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint32",
"typeString": "uint32"
},
"typeName": {
"id": 653,
"name": "uint32",
"nodeType": "ElementaryTypeName",
"src": "15645:6:0",
"typeDescriptions": {
"typeIdentifier": "t_uint32",
"typeString": "uint32"
}
},
"visibility": "internal"
},
{
"constant": false,
"id": 657,
"mutability": "mutable",
"name": "secondsAgos",
"nodeType": "VariableDeclaration",
"scope": 733,
"src": "15666:27:0",
"stateVariable": false,
"storageLocation": "memory",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_uint32_$dyn_memory_ptr",
"typeString": "uint32[]"
},
"typeName": {
"baseType": {
"id": 655,
"name": "uint32",
"nodeType": "ElementaryTypeName",
"src": "15666:6:0",
"typeDescriptions": {
"typeIdentifier": "t_uint32",
"typeString": "uint32"
}
},
"id": 656,
"nodeType": "ArrayTypeName",
"src": "15666:8:0",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_uint32_$dyn_storage_ptr",
"typeString": "uint32[]"
}
},
"visibility": "internal"
},
{
"constant": false,
"id": 659,
"mutability": "mutable",
"name": "tick",
"nodeType": "VariableDeclaration",
"scope": 733,
"src": "15703:10:0",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_int24",
"typeString": "int24"
},
"typeName": {
"id": 658,
"name": "int24",
"nodeType": "ElementaryTypeName",
"src": "15703:5:0",
"typeDescriptions": {
"typeIdentifier": "t_int24",
"typeString": "int24"
}
},
"visibility": "internal"
},
{
"constant": false,
"id": 661,
"mutability": "mutable",
"name": "index",
"nodeType": "VariableDeclaration",
"scope": 733,
"src": "15723:12:0",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint16",
"typeString": "uint16"
},
"typeName": {
"id": 660,
"name": "uint16",
"nodeType": "ElementaryTypeName",
"src": "15723:6:0",
"typeDescriptions": {
"typeIdentifier": "t_uint16",
"typeString": "uint16"
}
},
"visibility": "internal"
},
{
"constant": false,
"id": 663,
"mutability": "mutable",
"name": "liquidity",
"nodeType": "VariableDeclaration",
"scope": 733,
"src": "15745:17:0",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint128",
"typeString": "uint128"
},
"typeName": {
"id": 662,
"name": "uint128",
"nodeType": "ElementaryTypeName",
"src": "15745:7:0",
"typeDescriptions": {
"typeIdentifier": "t_uint128",
"typeString": "uint128"
}
},
"visibility": "internal"
},
{
"constant": false,
"id": 665,
"mutability": "mutable",
"name": "cardinality",
"nodeType": "VariableDeclaration",
"scope": 733,
"src": "15772:18:0",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint16",
"typeString": "uint16"
},
"typeName": {
"id": 664,
"name": "uint16",
"nodeType": "ElementaryTypeName",
"src": "15772:6:0",
"typeDescriptions": {
"typeIdentifier": "t_uint16",
"typeString": "uint16"
}
},
"visibility": "internal"
}
],
"src": "15594:202:0"
},
"returnParameters": {
"id": 673,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 669,
"mutability": "mutable",
"name": "tickCumulatives",
"nodeType": "VariableDeclaration",
"scope": 733,
"src": "15820:30:0",
"stateVariable": false,
"storageLocation": "memory",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_int56_$dyn_memory_ptr",
"typeString": "int56[]"
},
"typeName": {
"baseType": {
"id": 667,
"name": "int56",
"nodeType": "ElementaryTypeName",
"src": "15820:5:0",
"typeDescriptions": {
"typeIdentifier": "t_int56",
"typeString": "int56"
}
},
"id": 668,
"nodeType": "ArrayTypeName",
"src": "15820:7:0",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_int56_$dyn_storage_ptr",
"typeString": "int56[]"
}
},
"visibility": "internal"
},
{
"constant": false,
"id": 672,
"mutability": "mutable",
"name": "secondsPerLiquidityCumulativeX128s",
"nodeType": "VariableDeclaration",
"scope": 733,
"src": "15852:51:0",
"stateVariable": false,
"storageLocation": "memory",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_uint160_$dyn_memory_ptr",
"typeString": "uint160[]"
},
"typeName": {
"baseType": {
"id": 670,
"name": "uint160",
"nodeType": "ElementaryTypeName",
"src": "15852:7:0",
"typeDescriptions": {
"typeIdentifier": "t_uint160",
"typeString": "uint160"
}
},
"id": 671,
"nodeType": "ArrayTypeName",
"src": "15852:9:0",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_uint160_$dyn_storage_ptr",
"typeString": "uint160[]"
}
},
"visibility": "internal"
}
],
"src": "15819:85:0"
},
"scope": 734,
"src": "15578:862:0",
"stateMutability": "view",
"virtual": false,
"visibility": "internal"
}
],
"scope": 735,
"src": "683:15759:0"
}
],
"src": "37:16406:0"
},
"id": 0
},
"contracts/test/MockObservations.sol": {
"ast": {
"absolutePath": "contracts/test/MockObservations.sol",
"exportedSymbols": {
"MockObservations": [
934
],
"Oracle": [
734
]
},
"id": 935,
"license": "UNLICENSED",
"nodeType": "SourceUnit",
"nodes": [
{
"id": 736,
"literals": [
"solidity",
"=",
"0.7",
".6"
],
"nodeType": "PragmaDirective",
"src": "39:23:1"
},
{
"absolutePath": "@airdao/astra-cl-core/contracts/libraries/Oracle.sol",
"file": "@airdao/astra-cl-core/contracts/libraries/Oracle.sol",
"id": 737,
"nodeType": "ImportDirective",
"scope": 935,
"sourceUnit": 735,
"src": "64:62:1",
"symbolAliases": [],
"unitAlias": ""
},
{
"abstract": false,
"baseContracts": [],
"contractDependencies": [],
"contractKind": "contract",
"fullyImplemented": true,
"id": 934,
"linearizedBaseContracts": [
934
],
"name": "MockObservations",
"nodeType": "ContractDefinition",
"nodes": [
{
"id": 742,
"libraryName": {
"id": 738,
"name": "Oracle",
"nodeType": "UserDefinedTypeName",
"referencedDeclaration": 734,
"src": "166:6:1",
"typeDescriptions": {
"typeIdentifier": "t_contract$_Oracle_$734",
"typeString": "library Oracle"
}
},
"nodeType": "UsingForDirective",
"src": "160:43:1",
"typeName": {
"baseType": {
"id": 739,
"name": "Oracle.Observation",
"nodeType": "UserDefinedTypeName",
"referencedDeclaration": 11,
"src": "177:18:1",
"typeDescriptions": {
"typeIdentifier": "t_struct$_Observation_$11_storage_ptr",
"typeString": "struct Oracle.Observation"
}
},
"id": 741,
"length": {
"hexValue": "3635353335",
"id": 740,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "number",
"lValueRequested": false,
"nodeType": "Literal",
"src": "196:5:1",
"typeDescriptions": {
"typeIdentifier": "t_rational_65535_by_1",
"typeString": "int_const 65535"
},
"value": "65535"
},
"nodeType": "ArrayTypeName",
"src": "177:25:1",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_struct$_Observation_$11_storage_$65535_storage_ptr",
"typeString": "struct Oracle.Observation[65535]"
}
}
},
{
"constant": false,
"id": 744,
"mutability": "mutable",
"name": "slot0Tick",
"nodeType": "VariableDeclaration",
"scope": 934,
"src": "222:23:1",
"stateVariable": true,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_int24",
"typeString": "int24"
},
"typeName": {
"id": 743,
"name": "int24",
"nodeType": "ElementaryTypeName",
"src": "222:5:1",
"typeDescriptions": {
"typeIdentifier": "t_int24",
"typeString": "int24"
}
},
"visibility": "private"
},
{
"constant": false,
"id": 746,
"mutability": "mutable",
"name": "slot0ObservationCardinality",
"nodeType": "VariableDeclaration",
"scope": 934,
"src": "251:42:1",
"stateVariable": true,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint16",
"typeString": "uint16"
},
"typeName": {
"id": 745,
"name": "uint16",
"nodeType": "ElementaryTypeName",
"src": "251:6:1",
"typeDescriptions": {
"typeIdentifier": "t_uint16",
"typeString": "uint16"
}
},
"visibility": "private"
},
{
"constant": false,
"id": 748,
"mutability": "mutable",
"name": "slot0ObservationIndex",
"nodeType": "VariableDeclaration",
"scope": 934,
"src": "299:36:1",
"stateVariable": true,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint16",
"typeString": "uint16"
},
"typeName": {
"id": 747,
"name": "uint16",
"nodeType": "ElementaryTypeName",
"src": "299:6:1",
"typeDescriptions": {
"typeIdentifier": "t_uint16",
"typeString": "uint16"
}
},
"visibility": "private"
},
{
"constant": false,
"functionSelector": "252c09d7",
"id": 752,
"mutability": "mutable",
"name": "observations",
"nodeType": "VariableDeclaration",
"scope": 934,
"src": "362:45:1",
"stateVariable": true,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_struct$_Observation_$11_storage_$65535_storage",
"typeString": "struct Oracle.Observation[65535]"
},
"typeName": {
"baseType": {
"id": 749,
"name": "Oracle.Observation",
"nodeType": "UserDefinedTypeName",
"referencedDeclaration": 11,
"src": "362:18:1",
"typeDescriptions": {
"typeIdentifier": "t_struct$_Observation_$11_storage_ptr",
"typeString": "struct Oracle.Observation"
}
},
"id": 751,
"length": {
"hexValue": "3635353335",
"id": 750,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "number",
"lValueRequested": false,
"nodeType": "Literal",
"src": "381:5:1",
"typeDescriptions": {
"typeIdentifier": "t_rational_65535_by_1",
"typeString": "int_const 65535"
},
"value": "65535"
},
"nodeType": "ArrayTypeName",
"src": "362:25:1",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_struct$_Observation_$11_storage_$65535_storage_ptr",
"typeString": "struct Oracle.Observation[65535]"
}
},
"visibility": "public"
},
{
"body": {
"id": 879,
"nodeType": "Block",
"src": "655:891:1",
"statements": [
{
"expression": {
"arguments": [
{
"commonType": {
"typeIdentifier": "t_uint32",
"typeString": "uint32"
},
"id": 770,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"baseExpression": {
"id": 766,
"name": "blockTimestamps",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 756,
"src": "673:15:1",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_uint32_$3_memory_ptr",
"typeString": "uint32[3] memory"
}
},
"id": 768,
"indexExpression": {
"hexValue": "30",
"id": 767,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "number",
"lValueRequested": false,
"nodeType": "Literal",
"src": "689:1:1",
"typeDescriptions": {
"typeIdentifier": "t_rational_0_by_1",
"typeString": "int_const 0"
},
"value": "0"
},
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"nodeType": "IndexAccess",
"src": "673:18:1",
"typeDescriptions": {
"typeIdentifier": "t_uint32",
"typeString": "uint32"
}
},
"nodeType": "BinaryOperation",
"operator": "==",
"rightExpression": {
"hexValue": "30",
"id": 769,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "number",
"lValueRequested": false,
"nodeType": "Literal",
"src": "695:1:1",
"typeDescriptions": {
"typeIdentifier": "t_rational_0_by_1",
"typeString": "int_const 0"
},
"value": "0"
},
"src": "673:23:1",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
{
"hexValue": "30",
"id": 771,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "string",
"lValueRequested": false,
"nodeType": "Literal",
"src": "698:3:1",
"typeDescriptions": {
"typeIdentifier": "t_stringliteral_044852b2a670ade5407e78fb2863c51de9fcb96542a07186fe3aeda6bb8a116d",
"typeString": "literal_string \"0\""
},
"value": "0"
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_bool",
"typeString": "bool"
},
{
"typeIdentifier": "t_stringliteral_044852b2a670ade5407e78fb2863c51de9fcb96542a07186fe3aeda6bb8a116d",
"typeString": "literal_string \"0\""
}
],
"id": 765,
"name": "require",
"nodeType": "Identifier",
"overloadedDeclarations": [
-18,
-18
],
"referencedDeclaration": -18,
"src": "665:7:1",
"typeDescriptions": {
"typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$",
"typeString": "function (bool,string memory) pure"
}
},
"id": 772,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "665:37:1",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_tuple$__$",
"typeString": "tuple()"
}
},
"id": 773,
"nodeType": "ExpressionStatement",
"src": "665:37:1"
},
{
"expression": {
"arguments": [
{
"commonType": {
"typeIdentifier": "t_uint32",
"typeString": "uint32"
},
"id": 779,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"baseExpression": {
"id": 775,
"name": "blockTimestamps",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 756,
"src": "720:15:1",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_uint32_$3_memory_ptr",
"typeString": "uint32[3] memory"
}
},
"id": 777,
"indexExpression": {
"hexValue": "31",
"id": 776,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "number",
"lValueRequested": false,
"nodeType": "Literal",
"src": "736:1:1",
"typeDescriptions": {
"typeIdentifier": "t_rational_1_by_1",
"typeString": "int_const 1"
},
"value": "1"
},
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"nodeType": "IndexAccess",
"src": "720:18:1",
"typeDescriptions": {
"typeIdentifier": "t_uint32",
"typeString": "uint32"
}
},
"nodeType": "BinaryOperation",
"operator": ">",
"rightExpression": {
"hexValue": "30",
"id": 778,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "number",
"lValueRequested": false,
"nodeType": "Literal",
"src": "741:1:1",
"typeDescriptions": {
"typeIdentifier": "t_rational_0_by_1",
"typeString": "int_const 0"
},
"value": "0"
},
"src": "720:22:1",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
{
"hexValue": "31",
"id": 780,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "string",
"lValueRequested": false,
"nodeType": "Literal",
"src": "744:3:1",
"typeDescriptions": {
"typeIdentifier": "t_stringliteral_c89efdaa54c0f20c7adf612882df0950f5a951637e0307cdcb4c672f298b8bc6",
"typeString": "literal_string \"1\""
},
"value": "1"
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_bool",
"typeString": "bool"
},
{
"typeIdentifier": "t_stringliteral_c89efdaa54c0f20c7adf612882df0950f5a951637e0307cdcb4c672f298b8bc6",
"typeString": "literal_string \"1\""
}
],
"id": 774,
"name": "require",
"nodeType": "Identifier",
"overloadedDeclarations": [
-18,
-18
],
"referencedDeclaration": -18,
"src": "712:7:1",
"typeDescriptions": {
"typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$",
"typeString": "function (bool,string memory) pure"
}
},
"id": 781,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "712:36:1",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_tuple$__$",
"typeString": "tuple()"
}
},
"id": 782,
"nodeType": "ExpressionStatement",
"src": "712:36:1"
},
{
"expression": {
"arguments": [
{
"commonType": {
"typeIdentifier": "t_uint32",
"typeString": "uint32"
},
"id": 790,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"baseExpression": {
"id": 784,
"name": "blockTimestamps",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 756,
"src": "766:15:1",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_uint32_$3_memory_ptr",
"typeString": "uint32[3] memory"
}
},
"id": 786,
"indexExpression": {
"hexValue": "32",
"id": 785,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "number",
"lValueRequested": false,
"nodeType": "Literal",
"src": "782:1:1",
"typeDescriptions": {
"typeIdentifier": "t_rational_2_by_1",
"typeString": "int_const 2"
},
"value": "2"
},
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"nodeType": "IndexAccess",
"src": "766:18:1",
"typeDescriptions": {
"typeIdentifier": "t_uint32",
"typeString": "uint32"
}
},
"nodeType": "BinaryOperation",
"operator": ">",
"rightExpression": {
"baseExpression": {
"id": 787,
"name": "blockTimestamps",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 756,
"src": "787:15:1",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_uint32_$3_memory_ptr",
"typeString": "uint32[3] memory"
}
},
"id": 789,
"indexExpression": {
"hexValue": "31",
"id": 788,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "number",
"lValueRequested": false,
"nodeType": "Literal",
"src": "803:1:1",
"typeDescriptions": {
"typeIdentifier": "t_rational_1_by_1",
"typeString": "int_const 1"
},
"value": "1"
},
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"nodeType": "IndexAccess",
"src": "787:18:1",
"typeDescriptions": {
"typeIdentifier": "t_uint32",
"typeString": "uint32"
}
},
"src": "766:39:1",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
{
"hexValue": "32",
"id": 791,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "string",
"lValueRequested": false,
"nodeType": "Literal",
"src": "807:3:1",
"typeDescriptions": {
"typeIdentifier": "t_stringliteral_ad7c5bef027816a800da1736444fb58a807ef4c9603b7848673f7e3a68eb14a5",
"typeString": "literal_string \"2\""
},
"value": "2"
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_bool",
"typeString": "bool"
},
{
"typeIdentifier": "t_stringliteral_ad7c5bef027816a800da1736444fb58a807ef4c9603b7848673f7e3a68eb14a5",
"typeString": "literal_string \"2\""
}
],
"id": 783,
"name": "require",
"nodeType": "Identifier",
"overloadedDeclarations": [
-18,
-18
],
"referencedDeclaration": -18,
"src": "758:7:1",
"typeDescriptions": {
"typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$",
"typeString": "function (bool,string memory) pure"
}
},
"id": 792,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "758:53:1",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_tuple$__$",
"typeString": "tuple()"
}
},
"id": 793,
"nodeType": "ExpressionStatement",
"src": "758:53:1"
},
{
"assignments": [
795
],
"declarations": [
{
"constant": false,
"id": 795,
"mutability": "mutable",
"name": "tickCumulative",
"nodeType": "VariableDeclaration",
"scope": 879,
"src": "822:20:1",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_int56",
"typeString": "int56"
},
"typeName": {
"id": 794,
"name": "int56",
"nodeType": "ElementaryTypeName",
"src": "822:5:1",
"typeDescriptions": {
"typeIdentifier": "t_int56",
"typeString": "int56"
}
},
"visibility": "internal"
}
],
"id": 797,
"initialValue": {
"hexValue": "30",
"id": 796,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "number",
"lValueRequested": false,
"nodeType": "Literal",
"src": "845:1:1",
"typeDescriptions": {
"typeIdentifier": "t_rational_0_by_1",
"typeString": "int_const 0"
},
"value": "0"
},
"nodeType": "VariableDeclarationStatement",
"src": "822:24:1"
},
{
"body": {
"id": 860,
"nodeType": "Block",
"src": "909:489:1",
"statements": [
{
"condition": {
"commonType": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"id": 811,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"id": 809,
"name": "i",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 799,
"src": "927:1:1",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "BinaryOperation",
"operator": "!=",
"rightExpression": {
"hexValue": "30",
"id": 810,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "number",
"lValueRequested": false,
"nodeType": "Literal",
"src": "932:1:1",
"typeDescriptions": {
"typeIdentifier": "t_rational_0_by_1",
"typeString": "int_const 0"
},
"value": "0"
},
"src": "927:6:1",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"id": 842,
"nodeType": "IfStatement",
"src": "923:201:1",
"trueBody": {
"id": 841,
"nodeType": "Block",
"src": "935:189:1",
"statements": [
{
"assignments": [
813
],
"declarations": [
{
"constant": false,
"id": 813,
"mutability": "mutable",
"name": "tick",
"nodeType": "VariableDeclaration",
"scope": 841,
"src": "953:10:1",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_int24",
"typeString": "int24"
},
"typeName": {
"id": 812,
"name": "int24",
"nodeType": "ElementaryTypeName",
"src": "953:5:1",
"typeDescriptions": {
"typeIdentifier": "t_int24",
"typeString": "int24"
}
},
"visibility": "internal"
}
],
"id": 819,
"initialValue": {
"baseExpression": {
"id": 814,
"name": "ticks",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 760,
"src": "966:5:1",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_int24_$3_memory_ptr",
"typeString": "int24[3] memory"
}
},
"id": 818,
"indexExpression": {
"commonType": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"id": 817,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"id": 815,
"name": "i",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 799,
"src": "972:1:1",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "BinaryOperation",
"operator": "-",
"rightExpression": {
"hexValue": "31",
"id": 816,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "number",
"lValueRequested": false,
"nodeType": "Literal",
"src": "976:1:1",
"typeDescriptions": {
"typeIdentifier": "t_rational_1_by_1",
"typeString": "int_const 1"
},
"value": "1"
},
"src": "972:5:1",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"nodeType": "IndexAccess",
"src": "966:12:1",
"typeDescriptions": {
"typeIdentifier": "t_int24",
"typeString": "int24"
}
},
"nodeType": "VariableDeclarationStatement",
"src": "953:25:1"
},
{
"assignments": [
821
],
"declarations": [
{
"constant": false,
"id": 821,
"mutability": "mutable",
"name": "delta",
"nodeType": "VariableDeclaration",
"scope": 841,
"src": "996:12:1",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint32",
"typeString": "uint32"
},
"typeName": {
"id": 820,
"name": "uint32",
"nodeType": "ElementaryTypeName",
"src": "996:6:1",
"typeDescriptions": {
"typeIdentifier": "t_uint32",
"typeString": "uint32"
}
},
"visibility": "internal"
}
],
"id": 831,
"initialValue": {
"commonType": {
"typeIdentifier": "t_uint32",
"typeString": "uint32"
},
"id": 830,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"baseExpression": {
"id": 822,
"name": "blockTimestamps",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 756,
"src": "1011:15:1",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_uint32_$3_memory_ptr",
"typeString": "uint32[3] memory"
}
},
"id": 824,
"indexExpression": {
"id": 823,
"name": "i",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 799,
"src": "1027:1:1",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"nodeType": "IndexAccess",
"src": "1011:18:1",
"typeDescriptions": {
"typeIdentifier": "t_uint32",
"typeString": "uint32"
}
},
"nodeType": "BinaryOperation",
"operator": "-",
"rightExpression": {
"baseExpression": {
"id": 825,
"name": "blockTimestamps",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 756,
"src": "1032:15:1",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_uint32_$3_memory_ptr",
"typeString": "uint32[3] memory"
}
},
"id": 829,
"indexExpression": {
"commonType": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"id": 828,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"id": 826,
"name": "i",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 799,
"src": "1048:1:1",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "BinaryOperation",
"operator": "-",
"rightExpression": {
"hexValue": "31",
"id": 827,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "number",
"lValueRequested": false,
"nodeType": "Literal",
"src": "1052:1:1",
"typeDescriptions": {
"typeIdentifier": "t_rational_1_by_1",
"typeString": "int_const 1"
},
"value": "1"
},
"src": "1048:5:1",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"nodeType": "IndexAccess",
"src": "1032:22:1",
"typeDescriptions": {
"typeIdentifier": "t_uint32",
"typeString": "uint32"
}
},
"src": "1011:43:1",
"typeDescriptions": {
"typeIdentifier": "t_uint32",
"typeString": "uint32"
}
},
"nodeType": "VariableDeclarationStatement",
"src": "996:58:1"
},
{
"expression": {
"id": 839,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftHandSide": {
"id": 832,
"name": "tickCumulative",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 795,
"src": "1072:14:1",
"typeDescriptions": {
"typeIdentifier": "t_int56",
"typeString": "int56"
}
},
"nodeType": "Assignment",
"operator": "+=",
"rightHandSide": {
"commonType": {
"typeIdentifier": "t_int56",
"typeString": "int56"
},
"id": 838,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"arguments": [
{
"id": 835,
"name": "tick",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 813,
"src": "1096:4:1",
"typeDescriptions": {
"typeIdentifier": "t_int24",
"typeString": "int24"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_int24",
"typeString": "int24"
}
],
"id": 834,
"isConstant": false,
"isLValue": false,
"isPure": true,
"lValueRequested": false,
"nodeType": "ElementaryTypeNameExpression",
"src": "1090:5:1",
"typeDescriptions": {
"typeIdentifier": "t_type$_t_int56_$",
"typeString": "type(int56)"
},
"typeName": {
"id": 833,
"name": "int56",
"nodeType": "ElementaryTypeName",
"src": "1090:5:1",
"typeDescriptions": {}
}
},
"id": 836,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "typeConversion",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "1090:11:1",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_int56",
"typeString": "int56"
}
},
"nodeType": "BinaryOperation",
"operator": "*",
"rightExpression": {
"id": 837,
"name": "delta",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 821,
"src": "1104:5:1",
"typeDescriptions": {
"typeIdentifier": "t_uint32",
"typeString": "uint32"
}
},
"src": "1090:19:1",
"typeDescriptions": {
"typeIdentifier": "t_int56",
"typeString": "int56"
}
},
"src": "1072:37:1",
"typeDescriptions": {
"typeIdentifier": "t_int56",
"typeString": "int56"
}
},
"id": 840,
"nodeType": "ExpressionStatement",
"src": "1072:37:1"
}
]
}
},
{
"expression": {
"id": 858,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftHandSide": {
"baseExpression": {
"id": 843,
"name": "observations",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 752,
"src": "1137:12:1",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_struct$_Observation_$11_storage_$65535_storage",
"typeString": "struct Oracle.Observation storage ref[65535] storage ref"
}
},
"id": 845,
"indexExpression": {
"id": 844,
"name": "i",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 799,
"src": "1150:1:1",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": true,
"nodeType": "IndexAccess",
"src": "1137:15:1",
"typeDescriptions": {
"typeIdentifier": "t_struct$_Observation_$11_storage",
"typeString": "struct Oracle.Observation storage ref"
}
},
"nodeType": "Assignment",
"operator": "=",
"rightHandSide": {
"arguments": [
{
"baseExpression": {
"id": 848,
"name": "blockTimestamps",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 756,
"src": "1208:15:1",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_uint32_$3_memory_ptr",
"typeString": "uint32[3] memory"
}
},
"id": 850,
"indexExpression": {
"id": 849,
"name": "i",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 799,
"src": "1224:1:1",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"nodeType": "IndexAccess",
"src": "1208:18:1",
"typeDescriptions": {
"typeIdentifier": "t_uint32",
"typeString": "uint32"
}
},
{
"id": 851,
"name": "tickCumulative",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 795,
"src": "1260:14:1",
"typeDescriptions": {
"typeIdentifier": "t_int56",
"typeString": "int56"
}
},
{
"arguments": [
{
"id": 854,
"name": "i",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 799,
"src": "1335:1:1",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
],
"id": 853,
"isConstant": false,
"isLValue": false,
"isPure": true,
"lValueRequested": false,
"nodeType": "ElementaryTypeNameExpression",
"src": "1327:7:1",
"typeDescriptions": {
"typeIdentifier": "t_type$_t_uint160_$",
"typeString": "type(uint160)"
},
"typeName": {
"id": 852,
"name": "uint160",
"nodeType": "ElementaryTypeName",
"src": "1327:7:1",
"typeDescriptions": {}
}
},
"id": 855,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "typeConversion",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "1327:10:1",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_uint160",
"typeString": "uint160"
}
},
{
"hexValue": "74727565",
"id": 856,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "bool",
"lValueRequested": false,
"nodeType": "Literal",
"src": "1368:4:1",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
},
"value": "true"
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_uint32",
"typeString": "uint32"
},
{
"typeIdentifier": "t_int56",
"typeString": "int56"
},
{
"typeIdentifier": "t_uint160",
"typeString": "uint160"
},
{
"typeIdentifier": "t_bool",
"typeString": "bool"
}
],
"expression": {
"id": 846,
"name": "Oracle",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 734,
"src": "1155:6:1",
"typeDescriptions": {
"typeIdentifier": "t_type$_t_contract$_Oracle_$734_$",
"typeString": "type(library Oracle)"
}
},
"id": 847,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"memberName": "Observation",
"nodeType": "MemberAccess",
"referencedDeclaration": 11,
"src": "1155:18:1",
"typeDescriptions": {
"typeIdentifier": "t_type$_t_struct$_Observation_$11_storage_ptr_$",
"typeString": "type(struct Oracle.Observation storage pointer)"
}
},
"id": 857,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "structConstructorCall",
"lValueRequested": false,
"names": [
"blockTimestamp",
"tickCumulative",
"secondsPerLiquidityCumulativeX128",
"initialized"
],
"nodeType": "FunctionCall",
"src": "1155:232:1",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_struct$_Observation_$11_memory_ptr",
"typeString": "struct Oracle.Observation memory"
}
},
"src": "1137:250:1",
"typeDescriptions": {
"typeIdentifier": "t_struct$_Observation_$11_storage",
"typeString": "struct Oracle.Observation storage ref"
}
},
"id": 859,
"nodeType": "ExpressionStatement",
"src": "1137:250:1"
}
]
},
"condition": {
"commonType": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"id": 805,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"id": 802,
"name": "i",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 799,
"src": "876:1:1",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "BinaryOperation",
"operator": "<",
"rightExpression": {
"expression": {
"id": 803,
"name": "blockTimestamps",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 756,
"src": "880:15:1",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_uint32_$3_memory_ptr",
"typeString": "uint32[3] memory"
}
},
"id": 804,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"memberName": "length",
"nodeType": "MemberAccess",
"src": "880:22:1",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"src": "876:26:1",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"id": 861,
"initializationExpression": {
"assignments": [
799
],
"declarations": [
{
"constant": false,
"id": 799,
"mutability": "mutable",
"name": "i",
"nodeType": "VariableDeclaration",
"scope": 861,
"src": "861:9:1",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 798,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "861:7:1",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"visibility": "internal"
}
],
"id": 801,
"initialValue": {
"hexValue": "30",
"id": 800,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "number",
"lValueRequested": false,
"nodeType": "Literal",
"src": "873:1:1",
"typeDescriptions": {
"typeIdentifier": "t_rational_0_by_1",
"typeString": "int_const 0"
},
"value": "0"
},
"nodeType": "VariableDeclarationStatement",
"src": "861:13:1"
},
"loopExpression": {
"expression": {
"id": 807,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"nodeType": "UnaryOperation",
"operator": "++",
"prefix": false,
"src": "904:3:1",
"subExpression": {
"id": 806,
"name": "i",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 799,
"src": "904:1:1",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"id": 808,
"nodeType": "ExpressionStatement",
"src": "904:3:1"
},
"nodeType": "ForStatement",
"src": "856:542:1"
},
{
"expression": {
"id": 866,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftHandSide": {
"id": 862,
"name": "slot0Tick",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 744,
"src": "1407:9:1",
"typeDescriptions": {
"typeIdentifier": "t_int24",
"typeString": "int24"
}
},
"nodeType": "Assignment",
"operator": "=",
"rightHandSide": {
"baseExpression": {
"id": 863,
"name": "ticks",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 760,
"src": "1419:5:1",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_int24_$3_memory_ptr",
"typeString": "int24[3] memory"
}
},
"id": 865,
"indexExpression": {
"hexValue": "32",
"id": 864,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "number",
"lValueRequested": false,
"nodeType": "Literal",
"src": "1425:1:1",
"typeDescriptions": {
"typeIdentifier": "t_rational_2_by_1",
"typeString": "int_const 2"
},
"value": "2"
},
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"nodeType": "IndexAccess",
"src": "1419:8:1",
"typeDescriptions": {
"typeIdentifier": "t_int24",
"typeString": "int24"
}
},
"src": "1407:20:1",
"typeDescriptions": {
"typeIdentifier": "t_int24",
"typeString": "int24"
}
},
"id": 867,
"nodeType": "ExpressionStatement",
"src": "1407:20:1"
},
{
"expression": {
"id": 873,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftHandSide": {
"id": 868,
"name": "slot0ObservationCardinality",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 746,
"src": "1437:27:1",
"typeDescriptions": {
"typeIdentifier": "t_uint16",
"typeString": "uint16"
}
},
"nodeType": "Assignment",
"operator": "=",
"rightHandSide": {
"condition": {
"id": 869,
"name": "mockLowObservationCardinality",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 762,
"src": "1467:29:1",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"falseExpression": {
"hexValue": "33",
"id": 871,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "number",
"lValueRequested": false,
"nodeType": "Literal",
"src": "1503:1:1",
"typeDescriptions": {
"typeIdentifier": "t_rational_3_by_1",
"typeString": "int_const 3"
},
"value": "3"
},
"id": 872,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"nodeType": "Conditional",
"src": "1467:37:1",
"trueExpression": {
"hexValue": "31",
"id": 870,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "number",
"lValueRequested": false,
"nodeType": "Literal",
"src": "1499:1:1",
"typeDescriptions": {
"typeIdentifier": "t_rational_1_by_1",
"typeString": "int_const 1"
},
"value": "1"
},
"typeDescriptions": {
"typeIdentifier": "t_uint8",
"typeString": "uint8"
}
},
"src": "1437:67:1",
"typeDescriptions": {
"typeIdentifier": "t_uint16",
"typeString": "uint16"
}
},
"id": 874,
"nodeType": "ExpressionStatement",
"src": "1437:67:1"
},
{
"expression": {
"id": 877,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftHandSide": {
"id": 875,
"name": "slot0ObservationIndex",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 748,
"src": "1514:21:1",
"typeDescriptions": {
"typeIdentifier": "t_uint16",
"typeString": "uint16"
}
},
"nodeType": "Assignment",
"operator": "=",
"rightHandSide": {
"hexValue": "32",
"id": 876,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "number",
"lValueRequested": false,
"nodeType": "Literal",
"src": "1538:1:1",
"typeDescriptions": {
"typeIdentifier": "t_rational_2_by_1",
"typeString": "int_const 2"
},
"value": "2"
},
"src": "1514:25:1",
"typeDescriptions": {
"typeIdentifier": "t_uint16",
"typeString": "uint16"
}
},
"id": 878,
"nodeType": "ExpressionStatement",
"src": "1514:25:1"
}
]
},
"id": 880,
"implemented": true,
"kind": "constructor",
"modifiers": [],
"name": "",
"nodeType": "FunctionDefinition",
"parameters": {
"id": 763,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 756,
"mutability": "mutable",
"name": "blockTimestamps",
"nodeType": "VariableDeclaration",
"scope": 880,
"src": "541:32:1",
"stateVariable": false,
"storageLocation": "memory",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_uint32_$3_memory_ptr",
"typeString": "uint32[3]"
},
"typeName": {
"baseType": {
"id": 753,
"name": "uint32",
"nodeType": "ElementaryTypeName",
"src": "541:6:1",
"typeDescriptions": {
"typeIdentifier": "t_uint32",
"typeString": "uint32"
}
},
"id": 755,
"length": {
"hexValue": "33",
"id": 754,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "number",
"lValueRequested": false,
"nodeType": "Literal",
"src": "548:1:1",
"typeDescriptions": {
"typeIdentifier": "t_rational_3_by_1",
"typeString": "int_const 3"
},
"value": "3"
},
"nodeType": "ArrayTypeName",
"src": "541:9:1",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_uint32_$3_storage_ptr",
"typeString": "uint32[3]"
}
},
"visibility": "internal"
},
{
"constant": false,
"id": 760,
"mutability": "mutable",
"name": "ticks",
"nodeType": "VariableDeclaration",
"scope": 880,
"src": "583:21:1",
"stateVariable": false,
"storageLocation": "memory",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_int24_$3_memory_ptr",
"typeString": "int24[3]"
},
"typeName": {
"baseType": {
"id": 757,
"name": "int24",
"nodeType": "ElementaryTypeName",
"src": "583:5:1",
"typeDescriptions": {
"typeIdentifier": "t_int24",
"typeString": "int24"
}
},
"id": 759,
"length": {
"hexValue": "33",
"id": 758,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "number",
"lValueRequested": false,
"nodeType": "Literal",
"src": "589:1:1",
"typeDescriptions": {
"typeIdentifier": "t_rational_3_by_1",
"typeString": "int_const 3"
},
"value": "3"
},
"nodeType": "ArrayTypeName",
"src": "583:8:1",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_int24_$3_storage_ptr",
"typeString": "int24[3]"
}
},
"visibility": "internal"
},
{
"constant": false,
"id": 762,
"mutability": "mutable",
"name": "mockLowObservationCardinality",
"nodeType": "VariableDeclaration",
"scope": 880,
"src": "614:34:1",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
},
"typeName": {
"id": 761,
"name": "bool",
"nodeType": "ElementaryTypeName",
"src": "614:4:1",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"visibility": "internal"
}
],
"src": "531:123:1"
},
"returnParameters": {
"id": 764,
"nodeType": "ParameterList",
"parameters": [],
"src": "655:0:1"
},
"scope": 934,
"src": "520:1026:1",
"stateMutability": "nonpayable",
"virtual": false,
"visibility": "public"
},
{
"body": {
"id": 906,
"nodeType": "Block",
"src": "1767:103:1",
"statements": [
{
"expression": {
"components": [
{
"hexValue": "30",
"id": 897,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "number",
"lValueRequested": false,
"nodeType": "Literal",
"src": "1785:1:1",
"typeDescriptions": {
"typeIdentifier": "t_rational_0_by_1",
"typeString": "int_const 0"
},
"value": "0"
},
{
"id": 898,
"name": "slot0Tick",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 744,
"src": "1788:9:1",
"typeDescriptions": {
"typeIdentifier": "t_int24",
"typeString": "int24"
}
},
{
"id": 899,
"name": "slot0ObservationIndex",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 748,
"src": "1799:21:1",
"typeDescriptions": {
"typeIdentifier": "t_uint16",
"typeString": "uint16"
}
},
{
"id": 900,
"name": "slot0ObservationCardinality",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 746,
"src": "1822:27:1",
"typeDescriptions": {
"typeIdentifier": "t_uint16",
"typeString": "uint16"
}
},
{
"hexValue": "30",
"id": 901,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "number",
"lValueRequested": false,
"nodeType": "Literal",
"src": "1851:1:1",
"typeDescriptions": {
"typeIdentifier": "t_rational_0_by_1",
"typeString": "int_const 0"
},
"value": "0"
},
{
"hexValue": "30",
"id": 902,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "number",
"lValueRequested": false,
"nodeType": "Literal",
"src": "1854:1:1",
"typeDescriptions": {
"typeIdentifier": "t_rational_0_by_1",
"typeString": "int_const 0"
},
"value": "0"
},
{
"hexValue": "66616c7365",
"id": 903,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "bool",
"lValueRequested": false,
"nodeType": "Literal",
"src": "1857:5:1",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
},
"value": "false"
}
],
"id": 904,
"isConstant": false,
"isInlineArray": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"nodeType": "TupleExpression",
"src": "1784:79:1",
"typeDescriptions": {
"typeIdentifier": "t_tuple$_t_rational_0_by_1_$_t_int24_$_t_uint16_$_t_uint16_$_t_rational_0_by_1_$_t_rational_0_by_1_$_t_bool_$",
"typeString": "tuple(int_const 0,int24,uint16,uint16,int_const 0,int_const 0,bool)"
}
},
"functionReturnParameters": 896,
"id": 905,
"nodeType": "Return",
"src": "1777:86:1"
}
]
},
"functionSelector": "3850c7bd",
"id": 907,
"implemented": true,
"kind": "function",
"modifiers": [],
"name": "slot0",
"nodeType": "FunctionDefinition",
"parameters": {
"id": 881,
"nodeType": "ParameterList",
"parameters": [],
"src": "1566:2:1"
},
"returnParameters": {
"id": 896,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 883,
"mutability": "mutable",
"name": "",
"nodeType": "VariableDeclaration",
"scope": 907,
"src": "1629:7:1",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint160",
"typeString": "uint160"
},
"typeName": {
"id": 882,
"name": "uint160",
"nodeType": "ElementaryTypeName",
"src": "1629:7:1",
"typeDescriptions": {
"typeIdentifier": "t_uint160",
"typeString": "uint160"
}
},
"visibility": "internal"
},
{
"constant": false,
"id": 885,
"mutability": "mutable",
"name": "",
"nodeType": "VariableDeclaration",
"scope": 907,
"src": "1650:5:1",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_int24",
"typeString": "int24"
},
"typeName": {
"id": 884,
"name": "int24",
"nodeType": "ElementaryTypeName",
"src": "1650:5:1",
"typeDescriptions": {
"typeIdentifier": "t_int24",
"typeString": "int24"
}
},
"visibility": "internal"
},
{
"constant": false,
"id": 887,
"mutability": "mutable",
"name": "",
"nodeType": "VariableDeclaration",
"scope": 907,
"src": "1669:6:1",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint16",
"typeString": "uint16"
},
"typeName": {
"id": 886,
"name": "uint16",
"nodeType": "ElementaryTypeName",
"src": "1669:6:1",
"typeDescriptions": {
"typeIdentifier": "t_uint16",
"typeString": "uint16"
}
},
"visibility": "internal"
},
{
"constant": false,
"id": 889,
"mutability": "mutable",
"name": "",
"nodeType": "VariableDeclaration",
"scope": 907,
"src": "1689:6:1",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint16",
"typeString": "uint16"
},
"typeName": {
"id": 888,
"name": "uint16",
"nodeType": "ElementaryTypeName",
"src": "1689:6:1",
"typeDescriptions": {
"typeIdentifier": "t_uint16",
"typeString": "uint16"
}
},
"visibility": "internal"
},
{
"constant": false,
"id": 891,
"mutability": "mutable",
"name": "",
"nodeType": "VariableDeclaration",
"scope": 907,
"src": "1709:6:1",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint16",
"typeString": "uint16"
},
"typeName": {
"id": 890,
"name": "uint16",
"nodeType": "ElementaryTypeName",
"src": "1709:6:1",
"typeDescriptions": {
"typeIdentifier": "t_uint16",
"typeString": "uint16"
}
},
"visibility": "internal"
},
{
"constant": false,
"id": 893,
"mutability": "mutable",
"name": "",
"nodeType": "VariableDeclaration",
"scope": 907,
"src": "1729:5:1",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint8",
"typeString": "uint8"
},
"typeName": {
"id": 892,
"name": "uint8",
"nodeType": "ElementaryTypeName",
"src": "1729:5:1",
"typeDescriptions": {
"typeIdentifier": "t_uint8",
"typeString": "uint8"
}
},
"visibility": "internal"
},
{
"constant": false,
"id": 895,
"mutability": "mutable",
"name": "",
"nodeType": "VariableDeclaration",
"scope": 907,
"src": "1748:4:1",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
},
"typeName": {
"id": 894,
"name": "bool",
"nodeType": "ElementaryTypeName",
"src": "1748:4:1",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"visibility": "internal"
}
],
"src": "1615:147:1"
},
"scope": 934,
"src": "1552:318:1",
"stateMutability": "view",
"virtual": false,
"visibility": "external"
},
{
"body": {
"id": 932,
"nodeType": "Block",
"src": "2060:277:1",
"statements": [
{
"expression": {
"arguments": [
{
"expression": {
"baseExpression": {
"id": 921,
"name": "observations",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 752,
"src": "2127:12:1",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_struct$_Observation_$11_storage_$65535_storage",
"typeString": "struct Oracle.Observation storage ref[65535] storage ref"
}
},
"id": 923,
"indexExpression": {
"hexValue": "32",
"id": 922,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "number",
"lValueRequested": false,
"nodeType": "Literal",
"src": "2140:1:1",
"typeDescriptions": {
"typeIdentifier": "t_rational_2_by_1",
"typeString": "int_const 2"
},
"value": "2"
},
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"nodeType": "IndexAccess",
"src": "2127:15:1",
"typeDescriptions": {
"typeIdentifier": "t_struct$_Observation_$11_storage",
"typeString": "struct Oracle.Observation storage ref"
}
},
"id": 924,
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"memberName": "blockTimestamp",
"nodeType": "MemberAccess",
"referencedDeclaration": 4,
"src": "2127:30:1",
"typeDescriptions": {
"typeIdentifier": "t_uint32",
"typeString": "uint32"
}
},
{
"id": 925,
"name": "secondsAgos",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 910,
"src": "2175:11:1",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_uint32_$dyn_calldata_ptr",
"typeString": "uint32[] calldata"
}
},
{
"id": 926,
"name": "slot0Tick",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 744,
"src": "2204:9:1",
"typeDescriptions": {
"typeIdentifier": "t_int24",
"typeString": "int24"
}
},
{
"id": 927,
"name": "slot0ObservationIndex",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 748,
"src": "2231:21:1",
"typeDescriptions": {
"typeIdentifier": "t_uint16",
"typeString": "uint16"
}
},
{
"hexValue": "30",
"id": 928,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "number",
"lValueRequested": false,
"nodeType": "Literal",
"src": "2270:1:1",
"typeDescriptions": {
"typeIdentifier": "t_rational_0_by_1",
"typeString": "int_const 0"
},
"value": "0"
},
{
"id": 929,
"name": "slot0ObservationCardinality",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 746,
"src": "2289:27:1",
"typeDescriptions": {
"typeIdentifier": "t_uint16",
"typeString": "uint16"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_uint32",
"typeString": "uint32"
},
{
"typeIdentifier": "t_array$_t_uint32_$dyn_calldata_ptr",
"typeString": "uint32[] calldata"
},
{
"typeIdentifier": "t_int24",
"typeString": "int24"
},
{
"typeIdentifier": "t_uint16",
"typeString": "uint16"
},
{
"typeIdentifier": "t_rational_0_by_1",
"typeString": "int_const 0"
},
{
"typeIdentifier": "t_uint16",
"typeString": "uint16"
}
],
"expression": {
"id": 919,
"name": "observations",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 752,
"src": "2089:12:1",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_struct$_Observation_$11_storage_$65535_storage",
"typeString": "struct Oracle.Observation storage ref[65535] storage ref"
}
},
"id": 920,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"memberName": "observe",
"nodeType": "MemberAccess",
"referencedDeclaration": 733,
"src": "2089:20:1",
"typeDescriptions": {
"typeIdentifier": "t_function_internal_view$_t_array$_t_struct$_Observation_$11_storage_$65535_storage_ptr_$_t_uint32_$_t_array$_t_uint32_$dyn_memory_ptr_$_t_int24_$_t_uint16_$_t_uint128_$_t_uint16_$returns$_t_array$_t_int56_$dyn_memory_ptr_$_t_array$_t_uint160_$dyn_memory_ptr_$bound_to$_t_array$_t_struct$_Observation_$11_storage_$65535_storage_ptr_$",
"typeString": "function (struct Oracle.Observation storage ref[65535] storage pointer,uint32,uint32[] memory,int24,uint16,uint128,uint16) view returns (int56[] memory,uint160[] memory)"
}
},
"id": 930,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "2089:241:1",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_tuple$_t_array$_t_int56_$dyn_memory_ptr_$_t_array$_t_uint160_$dyn_memory_ptr_$",
"typeString": "tuple(int56[] memory,uint160[] memory)"
}
},
"functionReturnParameters": 918,
"id": 931,
"nodeType": "Return",
"src": "2070:260:1"
}
]
},
"functionSelector": "883bdbfd",
"id": 933,
"implemented": true,
"kind": "function",
"modifiers": [],
"name": "observe",
"nodeType": "FunctionDefinition",
"parameters": {
"id": 911,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 910,
"mutability": "mutable",
"name": "secondsAgos",
"nodeType": "VariableDeclaration",
"scope": 933,
"src": "1893:29:1",
"stateVariable": false,
"storageLocation": "calldata",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_uint32_$dyn_calldata_ptr",
"typeString": "uint32[]"
},
"typeName": {
"baseType": {
"id": 908,
"name": "uint32",
"nodeType": "ElementaryTypeName",
"src": "1893:6:1",
"typeDescriptions": {
"typeIdentifier": "t_uint32",
"typeString": "uint32"
}
},
"id": 909,
"nodeType": "ArrayTypeName",
"src": "1893:8:1",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_uint32_$dyn_storage_ptr",
"typeString": "uint32[]"
}
},
"visibility": "internal"
}
],
"src": "1892:31:1"
},
"returnParameters": {
"id": 918,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 914,
"mutability": "mutable",
"name": "tickCumulatives",
"nodeType": "VariableDeclaration",
"scope": 933,
"src": "1971:30:1",
"stateVariable": false,
"storageLocation": "memory",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_int56_$dyn_memory_ptr",
"typeString": "int56[]"
},
"typeName": {
"baseType": {
"id": 912,
"name": "int56",
"nodeType": "ElementaryTypeName",
"src": "1971:5:1",
"typeDescriptions": {
"typeIdentifier": "t_int56",
"typeString": "int56"
}
},
"id": 913,
"nodeType": "ArrayTypeName",
"src": "1971:7:1",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_int56_$dyn_storage_ptr",
"typeString": "int56[]"
}
},
"visibility": "internal"
},
{
"constant": false,
"id": 917,
"mutability": "mutable",
"name": "secondsPerLiquidityCumulativeX128s",
"nodeType": "VariableDeclaration",
"scope": 933,
"src": "2003:51:1",
"stateVariable": false,
"storageLocation": "memory",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_uint160_$dyn_memory_ptr",
"typeString": "uint160[]"
},
"typeName": {
"baseType": {
"id": 915,
"name": "uint160",
"nodeType": "ElementaryTypeName",
"src": "2003:7:1",
"typeDescriptions": {
"typeIdentifier": "t_uint160",
"typeString": "uint160"
}
},
"id": 916,
"nodeType": "ArrayTypeName",
"src": "2003:9:1",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_uint160_$dyn_storage_ptr",
"typeString": "uint160[]"
}
},
"visibility": "internal"
}
],
"src": "1970:85:1"
},
"scope": 934,
"src": "1876:461:1",
"stateMutability": "view",
"virtual": false,
"visibility": "external"
}
],
"scope": 935,
"src": "128:2211:1"
}
],
"src": "39:2301:1"
},
"id": 1
}
}
}
}