The Gnosis Chain (formerly xDai Chain) journey begins! STAKE to GNO swap application now live on Ethereum and Gnosis Chain. Swap now. Learn about the benefits of GNO token.

Contract Address Details
contract

0x6f38D112b13eda1E3abAFC61E296Be2E27F15071

Contract Name
IncentivisedSlidingWind..wOracle
Creator
0xdf456b–40fb02 at 0xa52ed1–08a98f
Balance
0 xDAI ( )
Tokens
Fetching tokens...
Transactions
Fetching transactions...
Transfers
Fetching transfers...
Gas Used
137,688,899
Last Balance Update
20322308
Contract name:
IncentivisedSlidingWindowOracle




Optimization enabled
true
Compiler version
v0.6.6+commit.6c089d02




Optimization runs
10000
EVM Version
default




Verified at
2021-04-07 14:31:23.128396Z

Constructor Arguments

000000000000000000000000a818b4f111ccac7aa31d0bcc0806d64f2e0737d70000000000000000000000000000000000000000000000000000000000015180000000000000000000000000000000000000000000000000000000000000000800000000000000000000000071850b7e9ee3f13ab46d67167341e4bdc905eef900000000000000000000000000000000000000000000000000470de4df8200000000000000000000000000004505b262dc053998c10685dc5f9098af8ae5c8ad

Arg [0] (address) : 0xa818b4f111ccac7aa31d0bcc0806d64f2e0737d7
Arg [1] (uint256) : 86400
Arg [2] (uint8) : 8
Arg [3] (address) : 0x71850b7e9ee3f13ab46d67167341e4bdc905eef9
Arg [4] (uint256) : 20000000000000000
Arg [5] (address) : 0x4505b262dc053998c10685dc5f9098af8ae5c8ad

              

Contract source code

// File: @uniswap/v2-core/contracts/interfaces/IUniswapV2Factory.sol
pragma solidity >=0.5.0;
interface IUniswapV2Factory {
event PairCreated(address indexed token0, address indexed token1, address pair, uint);
function feeTo() external view returns (address);
function feeToSetter() external view returns (address);
function getPair(address tokenA, address tokenB) external view returns (address pair);
function allPairs(uint) external view returns (address pair);
function allPairsLength() external view returns (uint);
function createPair(address tokenA, address tokenB) external returns (address pair);
function setFeeTo(address) external;
function setFeeToSetter(address) external;
}
// File: @uniswap/v2-core/contracts/interfaces/IUniswapV2Pair.sol
pragma solidity >=0.5.0;
interface IUniswapV2Pair {
event Approval(address indexed owner, address indexed spender, uint value);
event Transfer(address indexed from, address indexed to, uint value);
function name() external pure returns (string memory);
function symbol() external pure returns (string memory);
function decimals() external pure returns (uint8);
function totalSupply() external view returns (uint);
function balanceOf(address owner) external view returns (uint);
function allowance(address owner, address spender) external view returns (uint);
function approve(address spender, uint value) external returns (bool);
function transfer(address to, uint value) external returns (bool);
function transferFrom(address from, address to, uint value) external returns (bool);
function DOMAIN_SEPARATOR() external view returns (bytes32);
function PERMIT_TYPEHASH() external pure returns (bytes32);
function nonces(address owner) external view returns (uint);
function permit(address owner, address spender, uint value, uint deadline, uint8 v, bytes32 r, bytes32 s) external;
event Mint(address indexed sender, uint amount0, uint amount1);
event Burn(address indexed sender, uint amount0, uint amount1, address indexed to);
event Swap(
address indexed sender,
uint amount0In,
uint amount1In,
uint amount0Out,
uint amount1Out,
address indexed to
);
event Sync(uint112 reserve0, uint112 reserve1);
function MINIMUM_LIQUIDITY() external pure returns (uint);
function factory() external view returns (address);
function token0() external view returns (address);
function token1() external view returns (address);
function getReserves() external view returns (uint112 reserve0, uint112 reserve1, uint32 blockTimestampLast);
function price0CumulativeLast() external view returns (uint);
function price1CumulativeLast() external view returns (uint);
function kLast() external view returns (uint);
function mint(address to) external returns (uint liquidity);
function burn(address to) external returns (uint amount0, uint amount1);
function swap(uint amount0Out, uint amount1Out, address to, bytes calldata data) external;
function skim(address to) external;
function sync() external;
function initialize(address, address) external;
}
// File: @uniswap/lib/contracts/libraries/FixedPoint.sol
pragma solidity >=0.4.0;
// a library for handling binary fixed point numbers (https://en.wikipedia.org/wiki/Q_(number_format))
library FixedPoint {
// range: [0, 2**112 - 1]
// resolution: 1 / 2**112
struct uq112x112 {
uint224 _x;
}
// range: [0, 2**144 - 1]
// resolution: 1 / 2**112
struct uq144x112 {
uint _x;
}
uint8 private constant RESOLUTION = 112;
// encode a uint112 as a UQ112x112
function encode(uint112 x) internal pure returns (uq112x112 memory) {
return uq112x112(uint224(x) << RESOLUTION);
}
// encodes a uint144 as a UQ144x112
function encode144(uint144 x) internal pure returns (uq144x112 memory) {
return uq144x112(uint256(x) << RESOLUTION);
}
// divide a UQ112x112 by a uint112, returning a UQ112x112
function div(uq112x112 memory self, uint112 x) internal pure returns (uq112x112 memory) {
require(x != 0, 'FixedPoint: DIV_BY_ZERO');
return uq112x112(self._x / uint224(x));
}
// multiply a UQ112x112 by a uint, returning a UQ144x112
// reverts on overflow
function mul(uq112x112 memory self, uint y) internal pure returns (uq144x112 memory) {
uint z;
require(y == 0 || (z = uint(self._x) * y) / y == uint(self._x), "FixedPoint: MULTIPLICATION_OVERFLOW");
return uq144x112(z);
}
// returns a UQ112x112 which represents the ratio of the numerator to the denominator
// equivalent to encode(numerator).div(denominator)
function fraction(uint112 numerator, uint112 denominator) internal pure returns (uq112x112 memory) {
require(denominator > 0, "FixedPoint: DIV_BY_ZERO");
return uq112x112((uint224(numerator) << RESOLUTION) / denominator);
}
// decode a UQ112x112 into a uint112 by truncating after the radix point
function decode(uq112x112 memory self) internal pure returns (uint112) {
return uint112(self._x >> RESOLUTION);
}
// decode a UQ144x112 into a uint144 by truncating after the radix point
function decode144(uq144x112 memory self) internal pure returns (uint144) {
return uint144(self._x >> RESOLUTION);
}
}
// File: contracts/libraries/SafeMath.sol
pragma solidity =0.6.6;
// a library for performing overflow-safe math, courtesy of DappHub (https://github.com/dapphub/ds-math)
library SafeMath {
function add(uint x, uint y) internal pure returns (uint z) {
require((z = x + y) >= x, 'ds-math-add-overflow');
}
function sub(uint x, uint y) internal pure returns (uint z) {
require((z = x - y) <= x, 'ds-math-sub-underflow');
}
function mul(uint x, uint y) internal pure returns (uint z) {
require(y == 0 || (z = x * y) / y == x, 'ds-math-mul-overflow');
}
}
// File: contracts/interfaces/IERC20.sol
pragma solidity >=0.5.0;
interface IERC20 {
event Approval(address indexed owner, address indexed spender, uint value);
event Transfer(address indexed from, address indexed to, uint value);
function name() external view returns (string memory);
function symbol() external view returns (string memory);
function decimals() external view returns (uint8);
function totalSupply() external view returns (uint);
function balanceOf(address owner) external view returns (uint);
function allowance(address owner, address spender) external view returns (uint);
function approve(address spender, uint value) external returns (bool);
function transfer(address to, uint value) external returns (bool);
function transferFrom(address from, address to, uint value) external returns (bool);
}
// File: contracts/libraries/UniswapV2Library.sol
pragma solidity >=0.5.0;
library UniswapV2Library {
using SafeMath for uint;
// returns sorted token addresses, used to handle return values from pairs sorted in this order
function sortTokens(address tokenA, address tokenB) internal pure returns (address token0, address token1) {
require(tokenA != tokenB, 'UniswapV2Library: IDENTICAL_ADDRESSES');
(token0, token1) = tokenA < tokenB ? (tokenA, tokenB) : (tokenB, tokenA);
require(token0 != address(0), 'UniswapV2Library: ZERO_ADDRESS');
}
// calculates the CREATE2 address for a pair without making any external calls
function pairFor(address factory, address tokenA, address tokenB) internal pure returns (address pair) {
(address token0, address token1) = sortTokens(tokenA, tokenB);
pair = address(uint(keccak256(abi.encodePacked(
hex'ff',
factory,
keccak256(abi.encodePacked(token0, token1)),
hex'3f88503e8580ab941773b59034fb4b2a63e86dbc031b3633a925533ad3ed2b93' // honeyswap deploy init code hash
// hex'96e8ac4277198ff8b6f785478aa9a39f403cb768dd02cbee326c3e7da348845f' // original init code hash
))));
}
// fetches and sorts the reserves for a pair
function getReserves(address factory, address tokenA, address tokenB) internal view returns (uint reserveA, uint reserveB) {
(address token0,) = sortTokens(tokenA, tokenB);
(uint reserve0, uint reserve1,) = IUniswapV2Pair(pairFor(factory, tokenA, tokenB)).getReserves();
(reserveA, reserveB) = tokenA == token0 ? (reserve0, reserve1) : (reserve1, reserve0);
}
// given some amount of an asset and pair reserves, returns an equivalent amount of the other asset
function quote(uint amountA, uint reserveA, uint reserveB) internal pure returns (uint amountB) {
require(amountA > 0, 'UniswapV2Library: INSUFFICIENT_AMOUNT');
require(reserveA > 0 && reserveB > 0, 'UniswapV2Library: INSUFFICIENT_LIQUIDITY');
amountB = amountA.mul(reserveB) / reserveA;
}
// given an input amount of an asset and pair reserves, returns the maximum output amount of the other asset
function getAmountOut(uint amountIn, uint reserveIn, uint reserveOut) internal pure returns (uint amountOut) {
require(amountIn > 0, 'UniswapV2Library: INSUFFICIENT_INPUT_AMOUNT');
require(reserveIn > 0 && reserveOut > 0, 'UniswapV2Library: INSUFFICIENT_LIQUIDITY');
uint amountInWithFee = amountIn.mul(997);
uint numerator = amountInWithFee.mul(reserveOut);
uint denominator = reserveIn.mul(1000).add(amountInWithFee);
amountOut = numerator / denominator;
}
// given an output amount of an asset and pair reserves, returns a required input amount of the other asset
function getAmountIn(uint amountOut, uint reserveIn, uint reserveOut) internal pure returns (uint amountIn) {
require(amountOut > 0, 'UniswapV2Library: INSUFFICIENT_OUTPUT_AMOUNT');
require(reserveIn > 0 && reserveOut > 0, 'UniswapV2Library: INSUFFICIENT_LIQUIDITY');
uint numerator = reserveIn.mul(amountOut).mul(1000);
uint denominator = reserveOut.sub(amountOut).mul(997);
amountIn = (numerator / denominator).add(1);
}
// performs chained getAmountOut calculations on any number of pairs
function getAmountsOut(address factory, uint amountIn, address[] memory path) internal view returns (uint[] memory amounts) {
require(path.length >= 2, 'UniswapV2Library: INVALID_PATH');
amounts = new uint[](path.length);
amounts[0] = amountIn;
for (uint i; i < path.length - 1; i++) {
(uint reserveIn, uint reserveOut) = getReserves(factory, path[i], path[i + 1]);
amounts[i + 1] = getAmountOut(amounts[i], reserveIn, reserveOut);
}
}
// performs chained getAmountIn calculations on any number of pairs
function getAmountsIn(address factory, uint amountOut, address[] memory path) internal view returns (uint[] memory amounts) {
require(path.length >= 2, 'UniswapV2Library: INVALID_PATH');
amounts = new uint[](path.length);
amounts[amounts.length - 1] = amountOut;
for (uint i = path.length - 1; i > 0; i--) {
(uint reserveIn, uint reserveOut) = getReserves(factory, path[i - 1], path[i]);
amounts[i - 1] = getAmountIn(amounts[i], reserveIn, reserveOut);
}
}
}
// File: contracts/libraries/UniswapV2OracleLibrary.sol
pragma solidity >=0.5.0;
// library with helper methods for oracles that are concerned with computing average prices
library UniswapV2OracleLibrary {
using FixedPoint for *;
// helper function that returns the current block timestamp within the range of uint32, i.e. [0, 2**32 - 1]
function currentBlockTimestamp() internal view returns (uint32) {
return uint32(block.timestamp % 2 ** 32);
}
// produces the cumulative price using counterfactuals to save gas and avoid a call to sync.
function currentCumulativePrices(
address pair
) internal view returns (uint price0Cumulative, uint price1Cumulative, uint32 blockTimestamp) {
blockTimestamp = currentBlockTimestamp();
price0Cumulative = IUniswapV2Pair(pair).price0CumulativeLast();
price1Cumulative = IUniswapV2Pair(pair).price1CumulativeLast();
// if time has elapsed since the last update on the pair, mock the accumulated price values
(uint112 reserve0, uint112 reserve1, uint32 blockTimestampLast) = IUniswapV2Pair(pair).getReserves();
if (blockTimestampLast != blockTimestamp) {
// subtraction overflow is desired
uint32 timeElapsed = blockTimestamp - blockTimestampLast;
// addition overflow is desired
// counterfactual
price0Cumulative += uint(FixedPoint.fraction(reserve1, reserve0)._x) * timeElapsed;
// counterfactual
price1Cumulative += uint(FixedPoint.fraction(reserve0, reserve1)._x) * timeElapsed;
}
}
}
// File: contracts/examples/IncentivisedSlidingWindowOracle.sol
pragma solidity =0.6.6;
// sliding window oracle that uses observations collected over a window to provide moving price averages in the past
// `windowSize` with a precision of `windowSize / granularity`
// note this is a singleton oracle and only needs to be deployed once per desired parameters, which
// differs from the simple oracle which must be deployed once per pair.
contract IncentivisedSlidingWindowOracle {
using FixedPoint for *;
using SafeMath for uint256;
uint256 public constant ONE_HUNDRED_PERCENT = 1e18;
struct Observation {
uint timestamp;
uint price0Cumulative;
uint price1Cumulative;
}
address public immutable factory;
// the desired amount of time over which the moving average should be computed, e.g. 24 hours
uint public immutable windowSize;
// the number of observations stored for each pair, i.e. how many price observations are stored for the window.
// as granularity increases from 1, more frequent updates are needed, but moving averages become more precise.
// averages are computed over intervals with sizes in the range:
// [windowSize - (windowSize / granularity) * 2, windowSize]
// e.g. if the window size is 24 hours, and the granularity is 24, the oracle will return the average price for
// the period:
// [now - [22 hours, 24 hours (whenever it was called between these times ago)], now]
uint8 public immutable granularity;
// this is redundant with granularity and windowSize, but stored for gas savings & informational purposes.
uint public immutable periodSize;
IERC20 public immutable incentiveToken;
uint256 public immutable percentIncentivePerCall;
address public incentivisedPair;
event PriceUpdatedForPair(address pair, address tokenA, address tokenB);
// mapping from pair address to a list of price observations of that pair
mapping(address => Observation[]) public pairObservations;
constructor(
address factory_,
uint windowSize_,
uint8 granularity_,
IERC20 incentiveToken_,
uint256 percentIncentivePerCall_,
address incentivisedPair_
) public {
require(granularity_ > 1, 'SlidingWindowOracle: GRANULARITY');
require(
(periodSize = windowSize_ / granularity_) * granularity_ == windowSize_,
'SlidingWindowOracle: WINDOW_NOT_EVENLY_DIVISIBLE'
);
factory = factory_;
windowSize = windowSize_;
granularity = granularity_;
incentiveToken = incentiveToken_;
percentIncentivePerCall = percentIncentivePerCall_;
incentivisedPair = incentivisedPair_;
}
function incentiveTokenBalance() public view returns (uint256) {
return incentiveToken.balanceOf(address(this));
}
function updateIncentiveAmount() public view returns (uint256) {
return incentiveTokenBalance().mul(percentIncentivePerCall) / ONE_HUNDRED_PERCENT;
}
// returns the index of the observation corresponding to the given timestamp
function observationIndexOf(uint timestamp) public view returns (uint8 index) {
uint epochPeriod = timestamp / periodSize;
return uint8(epochPeriod % granularity);
}
// returns the observation from the oldest epoch (at the beginning of the window) relative to the current time
function getFirstObservationInWindow(address pair) private view returns (Observation storage firstObservation) {
uint8 observationIndex = observationIndexOf(block.timestamp);
// no overflow issue. if observationIndex + 1 overflows, result is still zero.
uint8 firstObservationIndex = (observationIndex + 1) % granularity;
firstObservation = pairObservations[pair][firstObservationIndex];
}
function canUpdate(address tokenA, address tokenB) external view returns (bool) {
address pair = UniswapV2Library.pairFor(factory, tokenA, tokenB);
uint8 observationIndex = observationIndexOf(block.timestamp);
if (pairObservations[pair].length > 0) {
Observation storage observation = pairObservations[pair][observationIndex];
uint timeElapsed = block.timestamp - observation.timestamp;
return timeElapsed > periodSize;
} else {
return true;
}
}
// update the cumulative price for the observation at the current timestamp. each observation is updated at most
// once per epoch period.
function update(address tokenA, address tokenB) external {
address pair = UniswapV2Library.pairFor(factory, tokenA, tokenB);
// populate the array with empty observations (first call only)
for (uint i = pairObservations[pair].length; i < granularity; i++) {
pairObservations[pair].push();
}
// get the observation for the current period
uint8 observationIndex = observationIndexOf(block.timestamp);
Observation storage observation = pairObservations[pair][observationIndex];
// we only want to commit updates once per period (i.e. windowSize / granularity)
uint timeElapsed = block.timestamp - observation.timestamp;
require(timeElapsed > periodSize, 'SlidingWindowOracle: ALREADY_UPDATED_THIS_PERIOD');
(uint price0Cumulative, uint price1Cumulative,) = UniswapV2OracleLibrary.currentCumulativePrices(pair);
observation.timestamp = block.timestamp;
observation.price0Cumulative = price0Cumulative;
observation.price1Cumulative = price1Cumulative;
if (pair == incentivisedPair) {
incentiveToken.transfer(msg.sender, updateIncentiveAmount());
}
emit PriceUpdatedForPair(pair, tokenA, tokenB);
}
// returns the amount out corresponding to the amount in for a given token using the moving average over the time
// range [now - [windowSize, windowSize - periodSize * 2], now]
// update must have been called for the bucket corresponding to timestamp `now - windowSize`
function consult(address tokenIn, uint amountIn, address tokenOut) external view returns (uint amountOut) {
address pair = UniswapV2Library.pairFor(factory, tokenIn, tokenOut);
Observation storage firstObservation = getFirstObservationInWindow(pair);
uint timeElapsed = block.timestamp - firstObservation.timestamp;
require(timeElapsed <= windowSize, 'SlidingWindowOracle: MISSING_HISTORICAL_OBSERVATION'); // Not enough recorded observations
// should never happen.
require(timeElapsed >= windowSize - periodSize * 2, 'SlidingWindowOracle: UNEXPECTED_TIME_ELAPSED');
(uint price0Cumulative, uint price1Cumulative,) = UniswapV2OracleLibrary.currentCumulativePrices(pair);
(address token0,) = UniswapV2Library.sortTokens(tokenIn, tokenOut);
if (token0 == tokenIn) {
return computeAmountOut(firstObservation.price0Cumulative, price0Cumulative, timeElapsed, amountIn);
} else {
return computeAmountOut(firstObservation.price1Cumulative, price1Cumulative, timeElapsed, amountIn);
}
}
// given the cumulative prices of the start and end of a period, and the length of the period, compute the average
// price in terms of how much amount out is received for the amount in
function computeAmountOut(
uint priceCumulativeStart, uint priceCumulativeEnd,
uint timeElapsed, uint amountIn
) private pure returns (uint amountOut) {
// overflow is desired.
FixedPoint.uq112x112 memory priceAverage = FixedPoint.uq112x112(
uint224((priceCumulativeEnd - priceCumulativeStart) / timeElapsed)
);
amountOut = priceAverage.mul(amountIn).decode144();
}
function getPair(address factory, address tokenA, address tokenB) public returns (address) {
return UniswapV2Library.pairFor(factory, tokenA, tokenB);
}
}

Contract ABI

[{"type":"constructor","stateMutability":"nonpayable","inputs":[{"type":"address","name":"factory_","internalType":"address"},{"type":"uint256","name":"windowSize_","internalType":"uint256"},{"type":"uint8","name":"granularity_","internalType":"uint8"},{"type":"address","name":"incentiveToken_","internalType":"contract IERC20"},{"type":"uint256","name":"percentIncentivePerCall_","internalType":"uint256"},{"type":"address","name":"incentivisedPair_","internalType":"address"}]},{"type":"event","name":"PriceUpdatedForPair","inputs":[{"type":"address","name":"pair","internalType":"address","indexed":false},{"type":"address","name":"tokenA","internalType":"address","indexed":false},{"type":"address","name":"tokenB","internalType":"address","indexed":false}],"anonymous":false},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"ONE_HUNDRED_PERCENT","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"bool","name":"","internalType":"bool"}],"name":"canUpdate","inputs":[{"type":"address","name":"tokenA","internalType":"address"},{"type":"address","name":"tokenB","internalType":"address"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"amountOut","internalType":"uint256"}],"name":"consult","inputs":[{"type":"address","name":"tokenIn","internalType":"address"},{"type":"uint256","name":"amountIn","internalType":"uint256"},{"type":"address","name":"tokenOut","internalType":"address"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"address","name":"","internalType":"address"}],"name":"factory","inputs":[]},{"type":"function","stateMutability":"nonpayable","outputs":[{"type":"address","name":"","internalType":"address"}],"name":"getPair","inputs":[{"type":"address","name":"factory","internalType":"address"},{"type":"address","name":"tokenA","internalType":"address"},{"type":"address","name":"tokenB","internalType":"address"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint8","name":"","internalType":"uint8"}],"name":"granularity","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"address","name":"","internalType":"contract IERC20"}],"name":"incentiveToken","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"incentiveTokenBalance","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"address","name":"","internalType":"address"}],"name":"incentivisedPair","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint8","name":"index","internalType":"uint8"}],"name":"observationIndexOf","inputs":[{"type":"uint256","name":"timestamp","internalType":"uint256"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"timestamp","internalType":"uint256"},{"type":"uint256","name":"price0Cumulative","internalType":"uint256"},{"type":"uint256","name":"price1Cumulative","internalType":"uint256"}],"name":"pairObservations","inputs":[{"type":"address","name":"","internalType":"address"},{"type":"uint256","name":"","internalType":"uint256"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"percentIncentivePerCall","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"periodSize","inputs":[]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"update","inputs":[{"type":"address","name":"tokenA","internalType":"address"},{"type":"address","name":"tokenB","internalType":"address"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"updateIncentiveAmount","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"windowSize","inputs":[]}]
            

Deployed ByteCode

0x608060405234801561001057600080fd5b50600436106101005760003560e01c80638c86f1e411610097578063cd380d1b11610066578063cd380d1b146102f9578063dbaad32f14610301578063dd0081c71461031e578063e4463eb21461032657610100565b80638c86f1e41461021a578063bfcc8e421461025d578063c45a0155146102b4578063c640752d146102bc57610100565b8063638126f8116100d3578063638126f8146101fa57806363f55949146102025780636a6f1b4e1461020a5780638a14117a1461021257610100565b806346dbf03f14610105578063556f0dc71461011f57806361e0b77f1461013d57806363602c19146101ab575b600080fd5b61010d61032e565b60408051918252519081900360200190f35b61012761037e565b6040805160ff9092168252519081900360200190f35b6101826004803603606081101561015357600080fd5b5073ffffffffffffffffffffffffffffffffffffffff81358116916020810135821691604090910135166103a2565b6040805173ffffffffffffffffffffffffffffffffffffffff9092168252519081900360200190f35b6101e6600480360360408110156101c157600080fd5b5073ffffffffffffffffffffffffffffffffffffffff813581169160200135166103b9565b604080519115158252519081900360200190f35b6101826104a6565b61010d6104ca565b61010d61058b565b61010d6105af565b61010d6004803603606081101561023057600080fd5b5073ffffffffffffffffffffffffffffffffffffffff8135811691602081013591604090910135166105d3565b6102966004803603604081101561027357600080fd5b5073ffffffffffffffffffffffffffffffffffffffff81351690602001356107ad565b60408051938452602084019290925282820152519081900360600190f35b6101826107ec565b6102f7600480360360408110156102d257600080fd5b5073ffffffffffffffffffffffffffffffffffffffff81358116916020013516610810565b005b610182610b1f565b6101276004803603602081101561031757600080fd5b5035610b3b565b61010d610b9e565b61010d610baa565b6000670de0b6b3a76400006103717f00000000000000000000000000000000000000000000000000470de4df8200006103656104ca565b9063ffffffff610bce16565b8161037857fe5b04905090565b7f000000000000000000000000000000000000000000000000000000000000000881565b60006103af848484610c54565b90505b9392505050565b6000806103e77f000000000000000000000000a818b4f111ccac7aa31d0bcc0806d64f2e0737d78585610c54565b905060006103f442610b3b565b73ffffffffffffffffffffffffffffffffffffffff8316600090815260016020526040902054909150156104995773ffffffffffffffffffffffffffffffffffffffff82166000908152600160205260408120805460ff841690811061045657fe5b60009182526020909120600390910201547f0000000000000000000000000000000000000000000000000000000000002a3042919091031193506104a092505050565b6001925050505b92915050565b7f00000000000000000000000071850b7e9ee3f13ab46d67167341e4bdc905eef981565b604080517f70a08231000000000000000000000000000000000000000000000000000000008152306004820152905160009173ffffffffffffffffffffffffffffffffffffffff7f00000000000000000000000071850b7e9ee3f13ab46d67167341e4bdc905eef916916370a0823191602480820192602092909190829003018186803b15801561055a57600080fd5b505afa15801561056e573d6000803e3d6000fd5b505050506040513d602081101561058457600080fd5b5051905090565b7f00000000000000000000000000000000000000000000000000470de4df82000081565b7f000000000000000000000000000000000000000000000000000000000001518081565b6000806106017f000000000000000000000000a818b4f111ccac7aa31d0bcc0806d64f2e0737d78685610c54565b9050600061060e82610d3f565b805490915042037f000000000000000000000000000000000000000000000000000000000001518081111561068e576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260338152602001806113dc6033913960400191505060405180910390fd5b7f0000000000000000000000000000000000000000000000000000000000002a306002027f00000000000000000000000000000000000000000000000000000000000151800381101561072c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602c81526020018061140f602c913960400191505060405180910390fd5b60008061073885610de8565b509150915060006107498a8961103a565b5090508973ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16141561079d57610790856001015484868c61118d565b96505050505050506103b2565b610790856002015483868c61118d565b600160205281600052604060002081815481106107c657fe5b600091825260209091206003909102018054600182015460029092015490935090915083565b7f000000000000000000000000a818b4f111ccac7aa31d0bcc0806d64f2e0737d781565b600061083d7f000000000000000000000000a818b4f111ccac7aa31d0bcc0806d64f2e0737d78484610c54565b73ffffffffffffffffffffffffffffffffffffffff81166000908152600160205260409020549091505b7f000000000000000000000000000000000000000000000000000000000000000860ff168110156108c85773ffffffffffffffffffffffffffffffffffffffff82166000908152600160208190526040822080548201815590915201610867565b5060006108d442610b3b565b73ffffffffffffffffffffffffffffffffffffffff831660009081526001602052604081208054929350909160ff841690811061090d57fe5b60009182526020909120600390910201805490915042037f0000000000000000000000000000000000000000000000000000000000002a30811161099c576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260308152602001806114606030913960400191505060405180910390fd5b6000806109a886610de8565b504286556001860182905560028601819055600054919350915073ffffffffffffffffffffffffffffffffffffffff87811691161415610abd577f00000000000000000000000071850b7e9ee3f13ab46d67167341e4bdc905eef973ffffffffffffffffffffffffffffffffffffffff1663a9059cbb33610a2761032e565b6040518363ffffffff1660e01b8152600401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b158015610a9057600080fd5b505af1158015610aa4573d6000803e3d6000fd5b505050506040513d6020811015610aba57600080fd5b50505b6040805173ffffffffffffffffffffffffffffffffffffffff8089168252808b16602083015289168183015290517f82963311976c84f25a4f3daa9927a93e40e345ac19bc3d0dfc5e8f96813063519181900360600190a15050505050505050565b60005473ffffffffffffffffffffffffffffffffffffffff1681565b6000807f0000000000000000000000000000000000000000000000000000000000002a308381610b6757fe5b0490507f000000000000000000000000000000000000000000000000000000000000000860ff168181610b9657fe5b069392505050565b670de0b6b3a764000081565b7f0000000000000000000000000000000000000000000000000000000000002a3081565b6000811580610be957505080820282828281610be657fe5b04145b6104a057604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601460248201527f64732d6d6174682d6d756c2d6f766572666c6f77000000000000000000000000604482015290519081900360640190fd5b6000806000610c63858561103a565b604080517fffffffffffffffffffffffffffffffffffffffff000000000000000000000000606094851b811660208084019190915293851b81166034830152825160288184030181526048830184528051908501207fff0000000000000000000000000000000000000000000000000000000000000060688401529a90941b9093166069840152607d8301989098527f3f88503e8580ab941773b59034fb4b2a63e86dbc031b3633a925533ad3ed2b93609d808401919091528851808403909101815260bd909201909752805196019590952095945050505050565b600080610d4b42610b3b565b905060007f000000000000000000000000000000000000000000000000000000000000000860ff168260010160ff1681610d8157fe5b069050600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208160ff1681548110610dd157fe5b906000526020600020906003020192505050919050565b6000806000610df5611200565b90508373ffffffffffffffffffffffffffffffffffffffff16635909c0d56040518163ffffffff1660e01b815260040160206040518083038186803b158015610e3d57600080fd5b505afa158015610e51573d6000803e3d6000fd5b505050506040513d6020811015610e6757600080fd5b5051604080517f5a3d5493000000000000000000000000000000000000000000000000000000008152905191945073ffffffffffffffffffffffffffffffffffffffff861691635a3d549391600480820192602092909190829003018186803b158015610ed357600080fd5b505afa158015610ee7573d6000803e3d6000fd5b505050506040513d6020811015610efd57600080fd5b5051604080517f0902f1ac00000000000000000000000000000000000000000000000000000000815290519193506000918291829173ffffffffffffffffffffffffffffffffffffffff891691630902f1ac916004808301926060929190829003018186803b158015610f6f57600080fd5b505afa158015610f83573d6000803e3d6000fd5b505050506040513d6060811015610f9957600080fd5b5080516020820151604090920151909450909250905063ffffffff808216908516146110305780840363ffffffff8116610fd3848661120a565b517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1602969096019563ffffffff8116611009858561120a565b517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff16029590950194505b5050509193909250565b6000808273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614156110c2576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602581526020018061143b6025913960400191505060405180910390fd5b8273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff16106110fc5782846110ff565b83835b909250905073ffffffffffffffffffffffffffffffffffffffff821661118657604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601e60248201527f556e697377617056324c6962726172793a205a45524f5f414444524553530000604482015290519081900360640190fd5b9250929050565b60006111976113b6565b604051806020016040528085888803816111ad57fe5b047bffffffffffffffffffffffffffffffffffffffffffffffffffffffff16905290506111e26111dd8285611302565b6113af565b71ffffffffffffffffffffffffffffffffffff169695505050505050565b63ffffffff421690565b6112126113b6565b6000826dffffffffffffffffffffffffffff161161129157604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601760248201527f4669786564506f696e743a204449565f42595f5a45524f000000000000000000604482015290519081900360640190fd5b6040805160208101909152806dffffffffffffffffffffffffffff84167bffffffffffffffffffffffffffff0000000000000000000000000000607087901b16816112d857fe5b047bffffffffffffffffffffffffffffffffffffffffffffffffffffffff16815250905092915050565b61130a6113c8565b600082158061134557505082517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff168281029083828161134257fe5b04145b61139a576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260238152602001806114906023913960400191505060405180910390fd5b60408051602081019091529081529392505050565b5160701c90565b60408051602081019091526000815290565b604051806020016040528060008152509056fe536c6964696e6757696e646f774f7261636c653a204d495353494e475f484953544f524943414c5f4f42534552564154494f4e536c6964696e6757696e646f774f7261636c653a20554e45585045435445445f54494d455f454c4150534544556e697377617056324c6962726172793a204944454e544943414c5f414444524553534553536c6964696e6757696e646f774f7261636c653a20414c52454144595f555044415445445f544849535f504552494f444669786564506f696e743a204d554c5449504c49434154494f4e5f4f564552464c4f57a264697066735822122089d9cd2daa26506c8048fd7cabfc9c9ea3e5ae485f9e8c6c2571bf48065f60ec64736f6c63430006060033