UNPKG

@valueswap/v2-periphery

Version:

🎚 Peripheral smart contracts for interacting with Valueswap V2

512 lines • 317 kB
{ "contractName": "ExampleOracleSimple", "abi": [ { "inputs": [ { "internalType": "address", "name": "factory", "type": "address" }, { "internalType": "address", "name": "tokenA", "type": "address" }, { "internalType": "address", "name": "tokenB", "type": "address" } ], "stateMutability": "nonpayable", "type": "constructor" }, { "inputs": [], "name": "PERIOD", "outputs": [ { "internalType": "uint256", "name": "", "type": "uint256" } ], "stateMutability": "view", "type": "function" }, { "inputs": [], "name": "blockTimestampLast", "outputs": [ { "internalType": "uint32", "name": "", "type": "uint32" } ], "stateMutability": "view", "type": "function" }, { "inputs": [], "name": "price0Average", "outputs": [ { "internalType": "uint224", "name": "_x", "type": "uint224" } ], "stateMutability": "view", "type": "function" }, { "inputs": [], "name": "price0CumulativeLast", "outputs": [ { "internalType": "uint256", "name": "", "type": "uint256" } ], "stateMutability": "view", "type": "function" }, { "inputs": [], "name": "price1Average", "outputs": [ { "internalType": "uint224", "name": "_x", "type": "uint224" } ], "stateMutability": "view", "type": "function" }, { "inputs": [], "name": "price1CumulativeLast", "outputs": [ { "internalType": "uint256", "name": "", "type": "uint256" } ], "stateMutability": "view", "type": "function" }, { "inputs": [], "name": "token0", "outputs": [ { "internalType": "address", "name": "", "type": "address" } ], "stateMutability": "view", "type": "function" }, { "inputs": [], "name": "token1", "outputs": [ { "internalType": "address", "name": "", "type": "address" } ], "stateMutability": "view", "type": "function" }, { "inputs": [], "name": "update", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [ { "internalType": "address", "name": "token", "type": "address" }, { "internalType": "uint256", "name": "amountIn", "type": "uint256" } ], "name": "consult", "outputs": [ { "internalType": "uint256", "name": "amountOut", "type": "uint256" } ], "stateMutability": "view", "type": "function" } ], "metadata": "{\"compiler\":{\"version\":\"0.6.6+commit.6c089d02\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[{\"internalType\":\"address\",\"name\":\"factory\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"tokenA\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"tokenB\",\"type\":\"address\"}],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"inputs\":[],\"name\":\"PERIOD\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"blockTimestampLast\",\"outputs\":[{\"internalType\":\"uint32\",\"name\":\"\",\"type\":\"uint32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"token\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"amountIn\",\"type\":\"uint256\"}],\"name\":\"consult\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"amountOut\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"price0Average\",\"outputs\":[{\"internalType\":\"uint224\",\"name\":\"_x\",\"type\":\"uint224\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"price0CumulativeLast\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"price1Average\",\"outputs\":[{\"internalType\":\"uint224\",\"name\":\"_x\",\"type\":\"uint224\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"price1CumulativeLast\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"token0\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"token1\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"update\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"}],\"devdoc\":{\"methods\":{}},\"userdoc\":{\"methods\":{}}},\"settings\":{\"compilationTarget\":{\"/Users/second/Documents/work/valueswap-v2-periphery/contracts/examples/ExampleOracleSimple.sol\":\"ExampleOracleSimple\"},\"evmVersion\":\"istanbul\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\"},\"optimizer\":{\"enabled\":true,\"runs\":999999},\"remappings\":[]},\"sources\":{\"/Users/second/Documents/work/valueswap-v2-periphery/contracts/examples/ExampleOracleSimple.sol\":{\"keccak256\":\"0xf82d6ad1e897d53408e559c39bbd5fdc7bca7a6444453838e9806055c6132b92\",\"urls\":[\"bzz-raw://9491cd6c75c3e9c15cf0dffd604620924c7c18397e61b3605e85c7e91865a6aa\",\"dweb:/ipfs/Qma8D2ZetmCH3Ap6xLuoCBtojAQZQ8ZjLJjYfQo2DYYM1o\"]},\"/Users/second/Documents/work/valueswap-v2-periphery/contracts/libraries/SafeMath.sol\":{\"keccak256\":\"0x27f0ea82f879b3b01387b583e6d9d0ec858dca3b22b0aad173f8fbda06e761e1\",\"urls\":[\"bzz-raw://0db9cf37793eb7035f0bfced36323d240f0212150009c39a3a108701d9b50b6c\",\"dweb:/ipfs/QmUAdiG9XNcieXkKfiMB49zQqD34FbXFE15csV2KQzwEqg\"]},\"/Users/second/Documents/work/valueswap-v2-periphery/contracts/libraries/ValueswapV2Library.sol\":{\"keccak256\":\"0xf676dcf67bcef334c141c95ae2c8328c76bcaf316edd882fe9bf960dc7887904\",\"urls\":[\"bzz-raw://37aa805cf7db173d7465a186acb5d9a958c8d1628c2335807c054e7864501dc5\",\"dweb:/ipfs/QmbZhcmRJkPLzsfMoNbeRZ8UKrqsjF86QNiZjsYyfxg9t6\"]},\"/Users/second/Documents/work/valueswap-v2-periphery/contracts/libraries/ValueswapV2OracleLibrary.sol\":{\"keccak256\":\"0x3a8a56b8e1d867cecffdb0ff2de6e9a293cc132dd9b2fbd54a8e1cd0eb14cf38\",\"urls\":[\"bzz-raw://892355f90888817408635e26a4c9514f1e18f1a57d7fdd492aef676644bde319\",\"dweb:/ipfs/QmNcMiLuFVHdnEgTSMubByZkzVu8hWjchR9SRKQe7j53TQ\"]},\"@valueswap/lib/contracts/libraries/Babylonian.sol\":{\"keccak256\":\"0xeb1c2a281a00f4660775f75ccfa1e51fbe1d75f86aeb9d0d297151ecdb900177\",\"urls\":[\"bzz-raw://68515f0265381bddfb1d1356ea10ce4e5784276fc09f197fcdcedfa5c75cc069\",\"dweb:/ipfs/QmXWVVPnuJwRUAu3Qpu1s7Fyc5WPQxmZPczVEe5cJ5wVHZ\"]},\"@valueswap/lib/contracts/libraries/BitMath.sol\":{\"keccak256\":\"0x19f84d5268286794b44939ec0d85b3c6f59e133f826cdbd9e40112fc94919bb7\",\"urls\":[\"bzz-raw://d21c67ed58cf667d052e141df2fba76c46c159edcc45eb897c908c20c69d2727\",\"dweb:/ipfs/QmUyKz1992wgR8nYAzBuQzjBAKMxLAN3hTgzpYJxusbmVH\"]},\"@valueswap/lib/contracts/libraries/FixedPoint.sol\":{\"keccak256\":\"0xc3a39b8a11715cea45ad9f67f50e4e4c33778c1124acd59e90daf064c9a93974\",\"urls\":[\"bzz-raw://2c6c3cdcdb30caa5d15477550003b5dbb174cb2c0be3c012af030fce3d043f28\",\"dweb:/ipfs/QmWh3n5g6zq3umJcURnKCFhhif2c8yb6mKczFjfoCNLC3g\"]},\"@valueswap/lib/contracts/libraries/FullMath.sol\":{\"keccak256\":\"0xc4ffcf28169f73fc9fdd1f82345d6d4fcccf3fd5aea83c133437c25e4e0950a9\",\"urls\":[\"bzz-raw://c9257a47501005f0a648bc4801ef4abc33843681aaf03a6d0c43d46b69e37407\",\"dweb:/ipfs/QmciHvDrqhxs5fjsrm9aNq29FZXpunMn17n2wWj83Zsh3B\"]},\"@valueswap/v2-core/contracts/interfaces/IValueswapV2Factory.sol\":{\"keccak256\":\"0xb460a829a001f806a64896c88b0094dfc6f0673e4511028258e901e5bf100fcc\",\"urls\":[\"bzz-raw://0c5d49debe3da0e52d459238afb9c9170c0c57b7985fb10ac08b501251095775\",\"dweb:/ipfs/QmdZBtyUdxSwN1wy99GhQHUBexQbQaPbaYWjqmjkLmHos7\"]},\"@valueswap/v2-core/contracts/interfaces/IValueswapV2Pair.sol\":{\"keccak256\":\"0x4899f60670cbc336cd8f5fefb631d6ce27ae4226ad4aac5d0963cd23db2fc36a\",\"urls\":[\"bzz-raw://7aa68c3572d1a4713c4af9ba99dd1907a9dc5a104273dab86e1d02797f6b1dd6\",\"dweb:/ipfs/QmXq89Vb6D4XeA2PDqNy13VkNeevTJePCrLF7KUHkver4q\"]}},\"version\":1}", "bytecode": "0x60e06040523480156200001157600080fd5b50604051620015c9380380620015c9833981810160405260608110156200003757600080fd5b50805160208083015160409093015191929190600090620000679085908590859062000d1b6200037d821b17901c565b9050806001600160a01b03166080816001600160a01b031660601b81525050806001600160a01b0316630dfe16816040518163ffffffff1660e01b815260040160206040518083038186803b158015620000c057600080fd5b505afa158015620000d5573d6000803e3d6000fd5b505050506040513d6020811015620000ec57600080fd5b505160601b6001600160601b03191660a0526040805163d21220a760e01b815290516001600160a01b0383169163d21220a7916004808301926020929190829003018186803b1580156200013f57600080fd5b505afa15801562000154573d6000803e3d6000fd5b505050506040513d60208110156200016b57600080fd5b505160601b6001600160601b03191660c05260408051635909c0d560e01b815290516001600160a01b03831691635909c0d5916004808301926020929190829003018186803b158015620001be57600080fd5b505afa158015620001d3573d6000803e3d6000fd5b505050506040513d6020811015620001ea57600080fd5b505160005560408051635a3d549360e01b815290516001600160a01b03831691635a3d5493916004808301926020929190829003018186803b1580156200023057600080fd5b505afa15801562000245573d6000803e3d6000fd5b505050506040513d60208110156200025c57600080fd5b505160015560408051630240bc6b60e21b8152905160009182916001600160a01b03851691630902f1ac916004808301926060929190829003018186803b158015620002a757600080fd5b505afa158015620002bc573d6000803e3d6000fd5b505050506040513d6060811015620002d357600080fd5b50805160208201516040909201516002805463ffffffff191663ffffffff909216919091179055925090506001600160701b038216158015906200031f57506001600160701b03811615155b62000371576040805162461bcd60e51b815260206004820181905260248201527f4578616d706c654f7261636c6553696d706c653a204e4f5f5245534552564553604482015290519081900360640190fd5b5050505050506200053d565b600080806200039685856001600160e01b036200045a16565b604080516001600160601b0319606094851b811660208084019190915293851b81166034830152825160288184030181526048830184528051908501207fff0000000000000000000000000000000000000000000000000000000000000060688401529a90941b9093166069840152607d8301989098527ff27fee3fc000c2148077e3c1de2bfc88ca0e8881a5c9fbb18615dc16f0cc1b75609d808401919091528851808403909101815260bd909201909752805196019590952095945050505050565b600080826001600160a01b0316846001600160a01b03161415620004b05760405162461bcd60e51b8152600401808060200182810382526027815260200180620015a26027913960400191505060405180910390fd5b826001600160a01b0316846001600160a01b031610620004d2578284620004d5565b83835b90925090506001600160a01b03821662000536576040805162461bcd60e51b815260206004820181905260248201527f56616c75657377617056324c6962726172793a205a45524f5f41444452455353604482015290519081900360640190fd5b9250929050565b60805160601c60a05160601c60c05160601c6110256200057d600039806102a952806105da5250806101cd52806101f35250806103e452506110256000f3fe608060405234801561001057600080fd5b50600436106100be5760003560e01c8063a2e6204511610076578063b4d1d7951161005b578063b4d1d7951461019a578063c5700a02146101a2578063d21220a7146101c3576100be565b8063a2e6204514610188578063a6bb453914610192576100be565b80635909c0d5116100a75780635909c0d51461013f5780635a3d5493146101475780635e6aaf2c1461014f576100be565b80630dfe1681146100c35780633ddac953146100f4575b600080fd5b6100cb6101cb565b6040805173ffffffffffffffffffffffffffffffffffffffff9092168252519081900360200190f35b61012d6004803603604081101561010a57600080fd5b5073ffffffffffffffffffffffffffffffffffffffff81351690602001356101ef565b60408051918252519081900360200190f35b61012d6103aa565b61012d6103b0565b6101576103b6565b604080517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff9092168252519081900360200190f35b6101906103da565b005b6101576105a1565b61012d6105c5565b6101aa6105cc565b6040805163ffffffff9092168252519081900360200190f35b6100cb6105d8565b7f000000000000000000000000000000000000000000000000000000000000000081565b60007f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156102a75760408051602081019091526003547bffffffffffffffffffffffffffffffffffffffffffffffffffffffff16815261028c90610287908463ffffffff6105fc16565b6106bf565b71ffffffffffffffffffffffffffffffffffff1690506103a4565b7f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161461034b576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526022815260200180610f806022913960400191505060405180910390fd5b60408051602081019091526004547bffffffffffffffffffffffffffffffffffffffffffffffffffffffff16815261038d90610287908463ffffffff6105fc16565b71ffffffffffffffffffffffffffffffffffff1690505b92915050565b60005481565b60015481565b6004547bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1681565b60008060006104087f00000000000000000000000000000000000000000000000000000000000000006106c6565b600254929550909350915063ffffffff90811682039062015180908216101561047c576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526027815260200180610fa26027913960400191505060405180910390fd5b60405180602001604052808263ffffffff1660005487038161049a57fe5b047bffffffffffffffffffffffffffffffffffffffffffffffffffffffff9081169091529051600380547fffffffff0000000000000000000000000000000000000000000000000000000016919092161790556040805160208101909152600154819063ffffffff84169086038161050e57fe5b047bffffffffffffffffffffffffffffffffffffffffffffffffffffffff9081169091529051600480547fffffffff00000000000000000000000000000000000000000000000000000000169190921617905550600092909255600155600280547fffffffffffffffffffffffffffffffffffffffffffffffffffffffff000000001663ffffffff909216919091179055565b6003547bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1681565b6201518081565b60025463ffffffff1681565b7f000000000000000000000000000000000000000000000000000000000000000081565b610604610cf6565b600082158061063f57505082517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff168281029083828161063c57fe5b04145b6106aa57604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601960248201527f4669786564506f696e743a3a6d756c3a206f766572666c6f7700000000000000604482015290519081900360640190fd5b60408051602081019091529081529392505050565b5160701c90565b60008060006106d361094d565b90508373ffffffffffffffffffffffffffffffffffffffff16635909c0d56040518163ffffffff1660e01b815260040160206040518083038186803b15801561071b57600080fd5b505afa15801561072f573d6000803e3d6000fd5b505050506040513d602081101561074557600080fd5b5051604080517f5a3d5493000000000000000000000000000000000000000000000000000000008152905191945073ffffffffffffffffffffffffffffffffffffffff861691635a3d549391600480820192602092909190829003018186803b1580156107b157600080fd5b505afa1580156107c5573d6000803e3d6000fd5b505050506040513d60208110156107db57600080fd5b5051604080517f0902f1ac00000000000000000000000000000000000000000000000000000000815290519193506000918291829173ffffffffffffffffffffffffffffffffffffffff891691630902f1ac916004808301926060929190829003018186803b15801561084d57600080fd5b505afa158015610861573d6000803e3d6000fd5b505050506040513d606081101561087757600080fd5b5080516020820151604090920151909450909250905063ffffffff808216908516146109435780840363ffffffff81166108c46dffffffffffffffffffffffffffff808616908716610957565b600001517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1602870196508063ffffffff1661091c856dffffffffffffffffffffffffffff16856dffffffffffffffffffffffffffff16610957565b517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff16029590950194505b5050509193909250565b63ffffffff421690565b61095f610d09565b600082116109b8576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526026815260200180610f5a6026913960400191505060405180910390fd5b826109d257506040805160208101909152600081526103a4565b71ffffffffffffffffffffffffffffffffffff8311610abd57600082607085901b816109fa57fe5b0490507bffffffffffffffffffffffffffffffffffffffffffffffffffffffff811115610a8857604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601e60248201527f4669786564506f696e743a3a6672616374696f6e3a206f766572666c6f770000604482015290519081900360640190fd5b6040518060200160405280827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff168152509150506103a4565b6000610ad9846e01000000000000000000000000000085610b66565b90507bffffffffffffffffffffffffffffffffffffffffffffffffffffffff811115610a8857604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601e60248201527f4669786564506f696e743a3a6672616374696f6e3a206f766572666c6f770000604482015290519081900360640190fd5b6000806000610b758686610c3b565b9150915060008480610b8357fe5b868809905082811115610b97576001820391505b918290039181610bb557848381610baa57fe5b049350505050610c34565b848210610c2357604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601a60248201527f46756c6c4d6174683a2046554c4c4449565f4f564552464c4f57000000000000604482015290519081900360640190fd5b610c2e838387610c86565b93505050505b9392505050565b600080807fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff84860990508385029250828103915082811015610c7e576001820391505b509250929050565b60008181038216808381610c9657fe5b049250808581610ca257fe5b049450808160000381610cb157fe5b60028581038087028203028087028203028087028203028087028203028087028203028087028203029586029003909402930460010193909302939093010292915050565b6040518060200160405280600081525090565b60408051602081019091526000815290565b6000806000610d2a8585610e06565b604080517fffffffffffffffffffffffffffffffffffffffff000000000000000000000000606094851b811660208084019190915293851b81166034830152825160288184030181526048830184528051908501207fff0000000000000000000000000000000000000000000000000000000000000060688401529a90941b9093166069840152607d8301989098527ff27fee3fc000c2148077e3c1de2bfc88ca0e8881a5c9fbb18615dc16f0cc1b75609d808401919091528851808403909101815260bd909201909752805196019590952095945050505050565b6000808273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff161415610e8e576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526027815260200180610fc96027913960400191505060405180910390fd5b8273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1610610ec8578284610ecb565b83835b909250905073ffffffffffffffffffffffffffffffffffffffff8216610f5257604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820181905260248201527f56616c75657377617056324c6962726172793a205a45524f5f41444452455353604482015290519081900360640190fd5b925092905056fe4669786564506f696e743a3a6672616374696f6e3a206469766973696f6e206279207a65726f4578616d706c654f7261636c6553696d706c653a20494e56414c49445f544f4b454e4578616d706c654f7261636c6553696d706c653a20504552494f445f4e4f545f454c415053454456616c75657377617056324c6962726172793a204944454e544943414c5f414444524553534553a26469706673582212207f4262f8ebc0dd82875b7feb84ae3f205815e48578bb2afe1c4f20eb07492f8364736f6c6343000606003356616c75657377617056324c6962726172793a204944454e544943414c5f414444524553534553", "deployedBytecode": "0x608060405234801561001057600080fd5b50600436106100be5760003560e01c8063a2e6204511610076578063b4d1d7951161005b578063b4d1d7951461019a578063c5700a02146101a2578063d21220a7146101c3576100be565b8063a2e6204514610188578063a6bb453914610192576100be565b80635909c0d5116100a75780635909c0d51461013f5780635a3d5493146101475780635e6aaf2c1461014f576100be565b80630dfe1681146100c35780633ddac953146100f4575b600080fd5b6100cb6101cb565b6040805173ffffffffffffffffffffffffffffffffffffffff9092168252519081900360200190f35b61012d6004803603604081101561010a57600080fd5b5073ffffffffffffffffffffffffffffffffffffffff81351690602001356101ef565b60408051918252519081900360200190f35b61012d6103aa565b61012d6103b0565b6101576103b6565b604080517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff9092168252519081900360200190f35b6101906103da565b005b6101576105a1565b61012d6105c5565b6101aa6105cc565b6040805163ffffffff9092168252519081900360200190f35b6100cb6105d8565b7f000000000000000000000000000000000000000000000000000000000000000081565b60007f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156102a75760408051602081019091526003547bffffffffffffffffffffffffffffffffffffffffffffffffffffffff16815261028c90610287908463ffffffff6105fc16565b6106bf565b71ffffffffffffffffffffffffffffffffffff1690506103a4565b7f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161461034b576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526022815260200180610f806022913960400191505060405180910390fd5b60408051602081019091526004547bffffffffffffffffffffffffffffffffffffffffffffffffffffffff16815261038d90610287908463ffffffff6105fc16565b71ffffffffffffffffffffffffffffffffffff1690505b92915050565b60005481565b60015481565b6004547bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1681565b60008060006104087f00000000000000000000000000000000000000000000000000000000000000006106c6565b600254929550909350915063ffffffff90811682039062015180908216101561047c576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526027815260200180610fa26027913960400191505060405180910390fd5b60405180602001604052808263ffffffff1660005487038161049a57fe5b047bffffffffffffffffffffffffffffffffffffffffffffffffffffffff9081169091529051600380547fffffffff0000000000000000000000000000000000000000000000000000000016919092161790556040805160208101909152600154819063ffffffff84169086038161050e57fe5b047bffffffffffffffffffffffffffffffffffffffffffffffffffffffff9081169091529051600480547fffffffff00000000000000000000000000000000000000000000000000000000169190921617905550600092909255600155600280547fffffffffffffffffffffffffffffffffffffffffffffffffffffffff000000001663ffffffff909216919091179055565b6003547bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1681565b6201518081565b60025463ffffffff1681565b7f000000000000000000000000000000000000000000000000000000000000000081565b610604610cf6565b600082158061063f57505082517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff168281029083828161063c57fe5b04145b6106aa57604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601960248201527f4669786564506f696e743a3a6d756c3a206f766572666c6f7700000000000000604482015290519081900360640190fd5b60408051602081019091529081529392505050565b5160701c90565b60008060006106d361094d565b90508373ffffffffffffffffffffffffffffffffffffffff16635909c0d56040518163ffffffff1660e01b815260040160206040518083038186803b15801561071b57600080fd5b505afa15801561072f573d6000803e3d6000fd5b505050506040513d602081101561074557600080fd5b5051604080517f5a3d5493000000000000000000000000000000000000000000000000000000008152905191945073ffffffffffffffffffffffffffffffffffffffff861691635a3d549391600480820192602092909190829003018186803b1580156107b157600080fd5b505afa1580156107c5573d6000803e3d6000fd5b505050506040513d60208110156107db57600080fd5b5051604080517f0902f1ac00000000000000000000000000000000000000000000000000000000815290519193506000918291829173ffffffffffffffffffffffffffffffffffffffff891691630902f1ac916004808301926060929190829003018186803b15801561084d57600080fd5b505afa158015610861573d6000803e3d6000fd5b505050506040513d606081101561087757600080fd5b5080516020820151604090920151909450909250905063ffffffff808216908516146109435780840363ffffffff81166108c46dffffffffffffffffffffffffffff808616908716610957565b600001517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1602870196508063ffffffff1661091c856dffffffffffffffffffffffffffff16856dffffffffffffffffffffffffffff16610957565b517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff16029590950194505b5050509193909250565b63ffffffff421690565b61095f610d09565b600082116109b8576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526026815260200180610f5a6026913960400191505060405180910390fd5b826109d257506040805160208101909152600081526103a4565b71ffffffffffffffffffffffffffffffffffff8311610abd57600082607085901b816109fa57fe5b0490507bffffffffffffffffffffffffffffffffffffffffffffffffffffffff811115610a8857604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601e60248201527f4669786564506f696e743a3a6672616374696f6e3a206f766572666c6f770000604482015290519081900360640190fd5b6040518060200160405280827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff168152509150506103a4565b6000610ad9846e01000000000000000000000000000085610b66565b90507bffffffffffffffffffffffffffffffffffffffffffffffffffffffff811115610a8857604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601e60248201527f4669786564506f696e743a3a6672616374696f6e3a206f766572666c6f770000604482015290519081900360640190fd5b6000806000610b758686610c3b565b9150915060008480610b8357fe5b868809905082811115610b97576001820391505b918290039181610bb557848381610baa57fe5b049350505050610c34565b848210610c2357604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601a60248201527f46756c6c4d6174683a2046554c4c4449565f4f564552464c4f57000000000000604482015290519081900360640190fd5b610c2e838387610c86565b93505050505b9392505050565b600080807fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff84860990508385029250828103915082811015610c7e576001820391505b509250929050565b60008181038216808381610c9657fe5b049250808581610ca257fe5b049450808160000381610cb157fe5b60028581038087028203028087028203028087028203028087028203028087028203028087028203029586029003909402930460010193909302939093010292915050565b6040518060200160405280600081525090565b60408051602081019091526000815290565b6000806000610d2a8585610e06565b604080517fffffffffffffffffffffffffffffffffffffffff000000000000000000000000606094851b811660208084019190915293851b81166034830152825160288184030181526048830184528051908501207fff0000000000000000000000000000000000000000000000000000000000000060688401529a90941b9093166069840152607d8301989098527ff27fee3fc000c2148077e3c1de2bfc88ca0e8881a5c9fbb18615dc16f0cc1b75609d808401919091528851808403909101815260bd909201909752805196019590952095945050505050565b6000808273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff161415610e8e576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526027815260200180610fc96027913960400191505060405180910390fd5b8273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1610610ec8578284610ecb565b83835b909250905073ffffffffffffffffffffffffffffffffffffffff8216610f5257604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820181905260248201527f56616c75657377617056324c6962726172793a205a45524f5f41444452455353604482015290519081900360640190fd5b925092905056fe4669786564506f696e743a3a6672616374696f6e3a206469766973696f6e206279207a65726f4578616d706c654f7261636c6553696d706c653a20494e56414c49445f544f4b454e4578616d706c654f7261636c6553696d706c653a20504552494f445f4e4f545f454c415053454456616c75657377617056324c6962726172793a204944454e544943414c5f414444524553534553a26469706673582212207f4262f8ebc0dd82875b7feb84ae3f205815e48578bb2afe1c4f20eb07492f8364736f6c63430006060033", "immutableReferences": { "4089": [ { "length": 32, "start": 996 } ], "4091": [ { "length": 32, "start": 461 }, { "length": 32, "start": 499 } ], "4093": [ { "length": 32, "start": 681 }, { "length": 32, "start": 1498 } ] }, "sourceMap": "539:2648:5:-:0;;;976:749;5:9:-1;2:2;;;27:1;24;17:12;2:2;976:749:5;;;;;;;;;;;;;;;15:2:-1;10:3;7:11;4:2;;;31:1;28;21:12;4:2;-1:-1;976:749:5;;;;;;;;;;;;;;;;1054:22;;1096:51;;976:749;;;;;;1096:26;;;;;:51;;:::i;:::-;1054:94;;1165:5;-1:-1:-1;;;;;1158:12:5;;;-1:-1:-1;;;;;1158:12:5;;;;;;;1189:5;-1:-1:-1;;;;;1189:12:5;;:14;;;;;;;;;;;;;;;;;;;;;;5:9:-1;2:2;;;27:1;24;17:12;2:2;1189:14:5;;;;8:9:-1;5:2;;;45:16;42:1;39;24:38;77:16;74:1;67:27;5:2;1189:14:5;;;;;;;15:2:-1;10:3;7:11;4:2;;;31:1;28;21:12;4:2;-1:-1;1189:14:5;1180:23;;-1:-1:-1;;;;;;1180:23:5;;;1222:14;;;-1:-1:-1;;;1222:14:5;;;;-1:-1:-1;;;;;1222:12:5;;;;;:14;;;;;1189;;1222;;;;;;;:12;:14;;;2:2:-1;;;;27:1;24;17:12;2:2;1222:14:5;;;;8:9:-1;5:2;;;45:16;42:1;39;24:38;77:16;74:1;67:27;5:2;1222:14:5;;;;;;;15:2:-1;10:3;7:11;4:2;;;31:1;28;21:12;4:2;-1:-1;1222:14:5;1213:23;;-1:-1:-1;;;;;;1213:23:5;;;1269:28;;;-1:-1:-1;;;1269:28:5;;;;-1:-1:-1;;;;;1269:26:5;;;;;:28;;;;;1222:14;;1269:28;;;;;;;:26;:28;;;2:2:-1;;;;27:1;24;17:12;2:2;1269:28:5;;;;8:9:-1;5:2;;;45:16;42:1;39;24:38;77:16;74:1;67:27;5:2;1269:28:5;;;;;;;15:2:-1;10:3;7:11;4:2;;;31:1;28;21:12;4:2;-1:-1;1269:28:5;1246:20;:51;1383:28;;;-1:-1:-1;;;1383:28:5;;;;-1:-1:-1;;;;;1383:26:5;;;;;:28;;;;;1269;;1383;;;;;;;:26;:28;;;2:2:-1;;;;27:1;24;17:12;2:2;1383:28:5;;;;8:9:-1;5:2;;;45:16;42:1;39;24:38;77:16;74:1;67:27;5:2;1383:28:5;;;;;;;15:2:-1;10:3;7:11;4:2;;;31:1;28;21:12;4:2;-1:-1;1383:28:5;1360:20;:51;1569:19;;;-1:-1:-1;;;1569:19:5;;;;1474:16;;;;-1:-1:-1;;;;;1569:17:5;;;;;:19;;;;;;;;;;;;;;:17;:19;;;2:2:-1;;;;27:1;24;17:12;2:2;1569:19:5;;;;8:9:-1;5:2;;;45:16;42:1;39;24:38;77:16;74:1;67:27;5:2;1569:19:5;;;;;;;15:2:-1;10:3;7:11;4:2;;;31:1;28;21:12;4:2;-1:-1;1569:19:5;;;;;;;;;;;1547:18;1526:62;;-1:-1:-1;;1526:62:5;;;;;;;;;;;1569:19;-1:-1:-1;1569:19:5;-1:-1:-1;;;;;;1606:13:5;;;;;;:30;;-1:-1:-1;;;;;;1623:13:5;;;;1606:30;1598:75;;;;;-1:-1:-1;;;1598:75:5;;;;;;;;;;;;;;;;;;;;;;;;;;;;;976:749;;;;;;539:2648;;725:470:16;814:12;;;873:26;884:6;892;-1:-1:-1;;;;;873:10:16;:26;:::i;:::-;1033:32;;;-1:-1:-1;;;;;;1033:32:16;;;;;;;;;;;;;;;;;;;;;;;;;22::-1;26:21;;;22:32;6:49;;1033:32:16;;;;;1023:43;;;;;;939:246;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;26:21:-1;;;22:32;;;6:49;;939:246:16;;;;;;;929:257;;;;;;;;;725:470;-1:-1:-1;;;;;725:470:16:o;287:349::-;362:14;378;422:6;-1:-1:-1;;;;;412:16:16;:6;-1:-1:-1;;;;;412:16:16;;;404:68;;;;-1:-1:-1;;;404:68:16;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;510:6;-1:-1:-1;;;;;501:15:16;:6;-1:-1:-1;;;;;501:15:16;;:53;;539:6;547;501:53;;;520:6;528;501:53;482:72;;-1:-1:-1;482:72:16;-1:-1:-1;;;;;;572:20:16;;564:65;;;;;-1:-1:-1;;;564:65:16;;;;;;;;;;;;;;;;;;;;;;;;;;;;;287:349;;;;;:::o;539:2648:5:-;;;;;;;;;;;;;;;;;;;;;;", "deployedSourceMap": "539:2648:5:-:0;;;;5:9:-1;2:2;;;27:1;24;17:12;2:2;539:2648:5;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;12:1:-1;9;2:12;685:31:5;;;:::i;:::-;;;;;;;;;;;;;;;;;;;2828:357;;;;;;15:2:-1;10:3;7:11;4:2;;;31:1;28;21:12;4:2;-1:-1;2828:357:5;;;;;;;;;:::i;:::-;;;;;;;;;;;;;;;;760:35;;;:::i;801:::-;;;:::i;928:41::-;;;:::i;:::-;;;;;;;;;;;;;;;;;;;1731:990;;;:::i;:::-;;881:41;;;:::i;603:38::-;;;:::i;842:33::-;;;:::i;:::-;;;;;;;;;;;;;;;;;;;722:31;;;:::i;685:::-;;;:::o;2828:357::-;2898:14;2937:6;2928:15;;:5;:15;;;2924:255;;;2971:17;;;;;;;;;:13;:17;;;;;:39;;:27;;2989:8;2971:27;:17;:27;:::i;:::-;:37;:39::i;:::-;2959:51;;;;2924:255;;;3058:6;3049:15;;:5;:15;;;3041:62;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;3129:17;;;;;;;;;:13;:17;;;;;:39;;:27;;3147:8;3129:27;:17;:27;:::i;:39::-;3117:51;;;;2924:255;2828:357;;;;:::o;760:35::-;;;;:::o;801:::-;;;;:::o;928:41::-;;;;;;:::o;1731:990::-;1769:21;1792;1815;1852:63;1909:4;1852:48;:63::i;:::-;1963:18;;1768:147;;-1:-1:-1;1768:147:5;;-1:-1:-1;1768:147:5;-1:-1:-1;1963:18:5;;;;1946:35;;;633:8;2104:21;;;;;2096:73;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;2372:86;;;;;;;;2445:11;2401:55;;2421:20;;2402:16;:39;2401:55;;;;;;2372:86;;;;;;;2356:102;;:13;:102;;;;;;;;;;;2484:86;;;;;;;;;-1:-1:-1;2533:20:5;2484:86;;2513:55;;;;2514:39;;2513:55;;;;;;2484:86;;;;;;;2468:102;;:13;:102;;;;;;;;;;;-1:-1:-1;;2581:39:5;;;;-1:-1:-1;2630:39:5;2679:18;:35;;;;;;;;;;;;;;1731:990::o;881:41::-;;;;;;:::o;603:38::-;633:8;603:38;:::o;842:33::-;;;;;;:::o;722:31::-;;;:::o;1694:237:24:-;1764:16;;:::i;:::-;1792:9;1823:6;;;:42;;-1:-1:-1;;1858:7:24;;1833:32;;1838:11;;;;1853:1;1838:11;1853:1;1833:21;;;;;:32;1823:42;1815:80;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;1912:12;;;;;;;;;;;;;1694:237;-1:-1:-1;;;1694:237:24:o;1472:128::-;1571:7;531:3;1571:21;;1472:128::o;654:1046:17:-;738:21;761;784;834:23;:21;:23::i;:::-;817:40;;903:4;886:43;;;:45;;;;;;;;;;;;;;;;;;;;;;5:9:-1;2:2;;;27:1;24;17:12;2:2;886:45:17;;;;8:9:-1;5:2;;;45:16;42:1;39;24:38;77:16;74:1;67:27;5:2;886:45:17;;;;;;;15:2:-1;10:3;7:11;4:2;;;31:1;28;21:12;4:2;-1:-1;886:45:17;960;;;;;;;;886;;-1:-1:-1;960:43:17;;;;;;:45;;;;;886;;960;;;;;;;;:43;:45;;;2:2:-1;;;;27:1;24;17:12;2:2;960:45:17;;;;8:9:-1;5:2;;;45:16;42:1;39;24:38;77:16;74:1;67:27;5:2;960:45:17;;;;;;;15:2:-1;10:3;7:11;4:2;;;31:1;28;21:12;4:2;-1:-1;960:45:17;1182:36;;;;;;;;960:45;;-1:-1:-1;1117:16:17;;;;;;1182:34;;;;;;:36;;;;;;;;;;;;;;:34;:36;;;2:2:-1;;;;27:1;24;17:12;2:2;1182:36:17;;;;8:9:-1;5:2;;;45:16;42:1;39;24:38;77:16;74:1;67:27;5:2;1182:36:17;;;;;;;15:2:-1;10:3;7:11;4:2;;;31:1;28;21:12;4:2;-1:-1;1182:36:17;;;;;;;;;;;;;-1:-1:-1;1182:36:17;;-1:-1:-1;1182:36:17;-1:-1:-1;1232:36:17;;;;;;;;1228:466;;1352:35;;;1495:62;;;1500:39;;;;;;;;:19;:39::i;:::-;:42;;;1495:48;;:62;1475:82;;;;1672:11;1621:62;;1626:39;1646:8;1626:39;;1656:8;1626:39;;:19;:39::i;:::-;:42;1621:48;;:62;1601:82;;;;;-1:-1:-1;1228:466:17;654:1046;;;;;;;;:::o;430:121::-;518:25;:15;:25;;430:121::o;4526:706:24:-;4607:16;;:::i;:::-;4657:1;4643:11;:15;4635:66;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;4715:14;4711:50;;-1:-1:-1;4738:23:24;;;;;;;;;-1:-1:-1;4738:23:24;;4731:30;;4711:50;4776:24;;;4772:454;;4816:14;4861:11;531:3;4834:23;;;4861:11;4833:39;;;;;;-1:-1:-1;4894:21:24;;;;4886:64;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;4971:26;;;;;;;;4989:6;4971:26;;;;;4964:33;;;;;4772:454;5028:14;5045:45;5061:9;571:31;5078:11;5045:15;:45::i;:::-;5028:62;-1:-1:-1;5112:21:24;;;;5104:64;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;897:373:25;999:7;1019:9;1030;1043:13;1051:1;1054;1043:7;:13::i;:::-;1018:38;;;;1067:10;1093:1;1080:15;;;;;1090:1;1087;1080:15;1067:28;;1114:1;1109:2;:6;1105:18;;;1122:1;1117:6;;;;1105:18;1133:7;;;;;1155:6;1151:24;;1174:1;1170;:5;;;;;;1163:12;;;;;;;1151:24;1198:1;1194;:5;1186:44;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;1247:16;1255:1;1258;1261;1247:7;:16::i;:::-;1240:23;;;;;897:373;;;;;;:::o;216:206::-;278:9;;;344:2;333:1;330;323:25;310:38;;366:1;362;:5;358:9;;386:1;381:2;:6;377:10;;406:1;401:2;:6;397:18;;;414:1;409:6;;;;397:18;216:206;;;;;;:::o;428:463::-;530:7;568:2;;;564:6;;;569:1;564:6;580:9;;;;;;;604:4;599:9;;;;;;;;;638:4;630;629:5;;628:14;;;;;685:1;:9;;;713:5;;;709:9;;704:14;737:5;;;733:9;;728:14;761:5;;;757:9;;752:14;785:5;;;781:9;;776:14;809:5;;;805:9;;800:14;833:5;;;829:9;;824:14;857:5;;;853:9;;848:14;;;628;;645:1;628:18;623:24;;;;618:29;;;;879:5;;428:463;-1:-1:-1;;428:463:25:o;539:2648:5:-;;;;;;;;;;;;;;:::o;:::-;;;;;;;;;;-1:-1:-1;539:2648:5;;;:::o;725:470:16:-;814:12;839:14;855;873:26;884:6;892;873:10;:26::i;:::-;1033:32;;;;;;;;;;;;;;;;;;;;;;;;;;;;;22::-1;26:21;;;22:32;6:49;;1033:32:16;;;;;1023:43;;;;;;939:246;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;26:21:-1;;;22:32;;;6:49;;939:246:16;;;;;;;929:257;;;;;;;;;725:470;-1:-1:-1;;;;;725:470:16:o;287:349::-;362:14;378;422:6;412:16;;:6;:16;;;;404:68;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;510:6;501:15;;:6;:15;;;:53;;539:6;547;501:53;;;520:6;528;501:53;482:72;;-1:-1:-1;482:72:16;-1:-1:-1;572:20:16;;;564:65;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;287:349;;;;;:::o", "source": "pragma solidity =0.6.6;\n\nimport '@valueswap/v2-core/contracts/interfaces/IValueswapV2Factory.sol';\nimport '@valueswap/v2-core/contracts/interfaces/IValueswapV2Pair.sol';\nimport '@valueswap/lib/contracts/libraries/FixedPoint.sol';\n\nimport '../libraries/ValueswapV2OracleLibrary.sol';\nimport '../libraries/ValueswapV2Library.sol';\n\n// fixed window oracle that recomputes the average price for the entire period once every period\n// note that the price average is only guaranteed to be over at least 1 period, but may be over a longer period\ncontract ExampleOracleSimple {\n using FixedPoint for *;\n\n uint public constant PERIOD = 24 hours;\n\n IValueswapV2Pair immutable pair;\n address public immutable token0;\n address public immutable token1;\n\n uint public price0CumulativeLast;\n uint public price1CumulativeLast;\n uint32 public blockTimestampLast;\n FixedPoint.uq112x112 public price0Average;\n FixedPoint.uq112x112 public price1Average;\n\n constructor(address factory, address tokenA, address tokenB) public {\n IValueswapV2Pair _pair = IValueswapV2Pair(ValueswapV2Library.pairFor(factory, tokenA, tokenB));\n pair = _pair;\n token0 = _pair.token0();\n token1 = _pair.token1();\n price0CumulativeLast = _pair.price0CumulativeLast(); // fetch the current accumulated price value (1 / 0)\n price1CumulativeLast = _pair.price1CumulativeLast(); // fetch the current accumulated price value (0 / 1)\n uint112 reserve0;\n uint112 reserve1;\n (reserve0, reserve1, blockTimestampLast) = _pair.getReserves();\n require(reserve0 != 0 && reserve1 != 0, 'ExampleOracleSimple: NO_RESERVES'); // ensure that there's liquidity in the pair\n }\n\n function update() external {\n (uint price0Cumulative, uint price1Cumulative, uint32 blockTimestamp) =\n ValueswapV2OracleLibrary.currentCumulativePrices(address(pair));\n uint32 timeElapsed = blockTimestamp - blockTimestampLast; // overflow is desired\n\n // ensure that at least one full period has passed since the last update\n require(timeElapsed >= PERIOD, 'ExampleOracleSimple: PERIOD_NOT_ELAPSED');\n\n // overflow is desired, casting never truncates\n // cumulative price is in (uq112x112 price * seconds) units so we simply wrap it after division by time elapsed\n price0Average = FixedPoint.uq112x112(uint224((price0Cumulative - price0CumulativeLast) / timeElapsed));\n price1Average = FixedPoint.uq112x112(uint224((price1Cumulative - price1CumulativeLast) / timeElapsed));\n\n price0CumulativeLast = price0Cumulative;\n price1CumulativeLast = price1Cumulative;\n blockTimestampLast = blockTimestamp;\n }\n\n // note this will always return 0 before update has been called successfully for the first time.\n function consult(address token, uint amountIn) external view returns (uint amountOut) {\n if (token == token0) {\n amountOut = price0Average.mul(amountIn).decode144();\n } else {\n require(token == token1, 'ExampleOracleSimple: INVALID_TOKEN');\n amountOut = price1Average.mul(amountIn).decode144();\n }\n }\n}\n", "sourcePath": "/Users/second/Documents/work/valueswap-v2-periphery/contracts/examples/ExampleOracleSimple.sol", "ast": { "absolutePath": "/Users/second/Documents/work/valueswap-v2-periphery/contracts/examples/ExampleOracleSimple.sol", "exportedSymbols": { "ExampleOracleSimple": [ 4293 ] }, "id": 4294, "nodeType": "SourceUnit", "nodes": [ { "id": 4077, "literals": [ "solidity", "=", "0.6", ".6" ], "nodeType": "PragmaDirective", "src": "0:23:5" }, { "absolutePath": "@valueswap/v2-core/contracts/interfaces/IValueswapV2Factory.sol", "file": "@valueswap/v2-core/contracts/interfaces/IValueswapV2Factory.sol", "id": 4078, "nodeType": "ImportDirective", "scope": 4294, "sourceUnit": 9117, "src": "25:73:5", "symbolAliases": [], "unitAlias": "" }, { "absolutePath": "@valueswap/v2-core/contracts/interfaces/IValueswapV2Pair.sol", "file": "@valueswap/v2-core/contracts/interfaces/IValueswapV2Pair.sol", "id": 4079, "nodeType": "ImportDirective", "scope": 4294, "sourceUnit": 9359, "src": "99:70:5", "symbolAliases": [], "unitAlias": "" }, { "absolutePath": "@valueswap/lib/contracts/libraries/FixedPoint.sol", "file": "@valueswap/lib/contracts/libraries/FixedPoint.sol", "id": 4080, "nodeType": "ImportDirective", "scope": 4294, "sourceUnit": 8659, "src": "170:59:5", "symbolAliases": [], "unitAlias": "" }, { "absolutePath": "/Users/second/Documents/work/valueswap-v2-periphery/contracts/libraries/ValueswapV2OracleLibrary.sol", "file": "../libraries/ValueswapV2OracleLibrary.sol", "id": 4081, "nodeType": "ImportDirective", "scope": 4294, "sourceUnit": 6161, "src": "231:51:5", "symbolAliases": [], "unitAlias": "" }, { "absolutePath": "/Users/second/Documents/work/valueswap-v2-periphery/contracts/libraries/ValueswapV2Library.sol", "file": "../libraries/ValueswapV2Library.sol", "id": 4082, "nodeType": "ImportDirective", "scope": 4294, "sourceUnit": 6054, "src": "283:45:5", "symbolAliases": [], "unitAlias": "" }, { "abstract": false, "baseContracts": [], "contractDependencies": [], "contractKind": "contract", "documentation": null, "fullyImplemented": true, "id": 4293, "linearizedBaseContracts": [ 4293 ], "name": "ExampleOracleSimple", "nodeType": "ContractDefinition", "nodes": [ { "id": 4084, "libraryName": { "contractScope": null, "id": 4083, "name": "FixedPoint", "nodeType": "UserDefinedTypeName", "referencedDeclaration": 8658, "src": "580:10:5", "typeDescriptions": { "typeIdentifier": "t_contract$_FixedPoint_$8658", "typeString": "library FixedPoint" } }, "nodeType": "UsingForDirective", "src": "574:23:5", "typeName": null }, { "constant": true, "functionSelector": "b4d1d795", "id": 4087, "mutability": "constant", "name": "PERIOD", "nodeType": "VariableDeclaration", "overrides": null, "scope": 4293, "src": "603:38:5", "stateVariable": true, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "typeName": { "id": 4085, "name": "uint", "nodeType": "ElementaryTypeName", "src": "603:4:5", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "value": { "argumentTypes": null, "hexValue": "3234", "id": 4086, "isConstant": false, "isLValue": false, "isPure": true, "kind": "number", "lValueRequested": false, "nodeType": "Literal", "src": "633:8:5", "subdenomination": "hours", "typeDescriptions": { "typeIdentifier": "t_rational_86400_by_1", "typeString": "int_const 86400" }, "value": "24" }, "visibility": "public" }, { "constant": false, "id": 4089, "mutability": "immutable", "name": "pair", "nodeType": "VariableDeclaration", "overrides": null, "scope": 4293, "src": "648:31:5", "stateVariable": true, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_contract$_IValueswapV2Pair_$9358", "typeString": "contract IValueswapV2Pair" }, "typeName": { "contractScope": null, "id": 4088, "name": "IValueswapV2Pair", "nodeType": "UserDefinedTypeName", "referencedDeclaration": 9358, "src": "648:16:5", "typeDescriptions": { "typeIdentifier": "t_contract$_IValueswapV2Pair_$9358", "typeString": "contract IValueswapV2Pair" } }, "value": null, "visibility": "internal" }, { "constant": false, "functionSelector": "0dfe1681", "id": 4091, "mutability": "immutable", "name": "token0", "nodeType": "VariableDeclaration", "overrides": null, "scope": 4293, "src": "685:31:5", "stateVariable": true, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" }, "typeName": { "id": 4090, "name": "address", "nodeType": "ElementaryTypeName", "src": "685:7:5", "stateMutability": "nonpayable", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" } }, "value": null, "visibility": "public" }, { "constant": false, "functionSelector": "d21220a7", "id": 4093, "mutability": "immutable", "name": "token1", "nodeType": "VariableDeclaration", "overrides": null, "scope": 4293, "src": "722:31:5", "stateVariable": true, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" }, "typeName": { "id": 4092, "name": "address", "nodeType": "ElementaryTypeName", "src": "722:7:5", "stateMutability": "nonpayable", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" } }, "value": null, "visibility": "public" }, { "constant": false, "functionSelector": "5909c0d5", "id": 4095, "mutability": "mutable", "name": "price0CumulativeLast", "nodeType": "VariableDeclaration", "overrides": null, "scope": 4293, "src": "760:35:5", "stateVariable": true, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "typeName": { "id": 4094, "name": "uint", "nodeType": "ElementaryTypeName", "src": "760:4:5", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "value": null, "visibility": "public" }, { "constant": false, "functionSelector": "5a3d5493", "id": 4097, "mutability": "mutable", "name": "price1CumulativeLast", "nodeType": "VariableDeclaration", "overrides": null, "scope": 4293, "src": "801:35:5", "stateVariable": true, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "typeName": { "id": 4096, "name": "uint", "nodeType": "ElementaryTypeName", "src": "801:4:5", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "value": null, "visibility": "public" }, { "constant": false, "functionSelector": "c5700a02", "id": 4099, "mutability": "mutable", "name": "blockTimestampLast", "nodeType": "VariableDeclaration", "overrides": null, "scope": 4293, "src": "842:33:5", "stateVariable": true, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_uint32", "ty