Contract Address Details
contract

0x43b7b9a571e6B578F8E0E2e7ba05f960C40cB0f0

Creator
0x5ef09c–178794 at 0xbc51f6–3c517b
Balance
0 xDAI ( )
Tokens
Fetching tokens...
Transactions
Fetching transactions...
Transfers
Fetching transfers...
Gas Used
Fetching gas used...
Last Balance Update
19258191
Contract is not verified. However, we found a verified contract with the same bytecode in Blockscout DB 0x9767cc18bb51b40469c569c27328107d089ff8e4.
All metadata displayed below is from that contract. In order to verify current contract, click Verify & Publish button
Contract name:
OracleCreator




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




Optimization runs
200
Verified at
2020-12-18 16:01:15.845763Z

Contract source code

// File: dxswap-core/contracts/interfaces/IDXswapPair.sol
pragma solidity >=0.5.0;
interface IDXswapPair {
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 swapFee() external view returns (uint32);
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;
function setSwapFee(uint32) external;
}
// File: contracts/libraries/FixedPoint.sol
pragma solidity >=0.5.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 {
uint256 _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, uint256 y) internal pure returns (uq144x112 memory) {
uint256 z;
require(y == 0 || (z = uint256(self._x) * y) / y == uint256(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/DXswapOracleLibrary.sol
pragma solidity >=0.5.0;
// library with helper methods for oracles that are concerned with computing average prices
library DXswapOracleLibrary {
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 (
uint256 price0Cumulative,
uint256 price1Cumulative,
uint32 blockTimestamp
)
{
blockTimestamp = currentBlockTimestamp();
price0Cumulative = IDXswapPair(pair).price0CumulativeLast();
price1Cumulative = IDXswapPair(pair).price1CumulativeLast();
// if time has elapsed since the last update on the pair, mock the accumulated price values
(uint112 reserve0, uint112 reserve1, uint32 blockTimestampLast) = IDXswapPair(pair).getReserves();
if (blockTimestampLast != blockTimestamp) {
// subtraction overflow is desired
uint32 timeElapsed = blockTimestamp - blockTimestampLast;
// addition overflow is desired
// counterfactual
price0Cumulative += uint256(FixedPoint.fraction(reserve1, reserve0)._x) * timeElapsed;
// counterfactual
price1Cumulative += uint256(FixedPoint.fraction(reserve0, reserve1)._x) * timeElapsed;
}
}
}
// 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(uint256 x, uint256 y) internal pure returns (uint256 z) {
require((z = x + y) >= x, "ds-math-add-overflow");
}
function sub(uint256 x, uint256 y) internal pure returns (uint256 z) {
require((z = x - y) <= x, "ds-math-sub-underflow");
}
function mul(uint256 x, uint256 y) internal pure returns (uint256 z) {
require(y == 0 || (z = x * y) / y == x, "ds-math-mul-overflow");
}
}
// File: contracts/libraries/DXswapLibrary.sol
pragma solidity >=0.5.0;
library DXswapLibrary {
using SafeMath for uint256;
// 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, "DXswapLibrary: IDENTICAL_ADDRESSES");
(token0, token1) = tokenA < tokenB ? (tokenA, tokenB) : (tokenB, tokenA);
require(token0 != address(0), "DXswapLibrary: 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(
uint256(
keccak256(
abi.encodePacked(
hex"ff",
factory,
keccak256(abi.encodePacked(token0, token1)),
hex"2db943b381c6ef706828ea5e89f480bd449d4d3a2b98e6da97b30d0eb41fb6d6" // init code hash
)
)
)
);
}
// fetches and sorts the reserves for a pair
function getReserves(
address factory,
address tokenA,
address tokenB
) internal view returns (uint256 reserveA, uint256 reserveB) {
(address token0, ) = sortTokens(tokenA, tokenB);
(uint256 reserve0, uint256 reserve1, ) = IDXswapPair(pairFor(factory, tokenA, tokenB)).getReserves();
(reserveA, reserveB) = tokenA == token0 ? (reserve0, reserve1) : (reserve1, reserve0);
}
// fetches and sorts the reserves for a pair
function getSwapFee(
address factory,
address tokenA,
address tokenB
) internal view returns (uint256 swapFee) {
(address token0, ) = sortTokens(tokenA, tokenB);
swapFee = IDXswapPair(pairFor(factory, tokenA, tokenB)).swapFee();
}
// given some amount of an asset and pair reserves, returns an equivalent amount of the other asset
function quote(
uint256 amountA,
uint256 reserveA,
uint256 reserveB
) internal pure returns (uint256 amountB) {
require(amountA > 0, "DXswapLibrary: INSUFFICIENT_AMOUNT");
require(reserveA > 0 && reserveB > 0, "DXswapLibrary: 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(
uint256 amountIn,
uint256 reserveIn,
uint256 reserveOut,
uint256 swapFee
) internal pure returns (uint256 amountOut) {
require(amountIn > 0, "DXswapLibrary: INSUFFICIENT_INPUT_AMOUNT");
require(reserveIn > 0 && reserveOut > 0, "DXswapLibrary: INSUFFICIENT_LIQUIDITY");
uint256 amountInWithFee = amountIn.mul(uint256(10000).sub(swapFee));
uint256 numerator = amountInWithFee.mul(reserveOut);
uint256 denominator = reserveIn.mul(10000).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(
uint256 amountOut,
uint256 reserveIn,
uint256 reserveOut,
uint256 swapFee
) internal pure returns (uint256 amountIn) {
require(amountOut > 0, "DXswapLibrary: INSUFFICIENT_OUTPUT_AMOUNT");
require(reserveIn > 0 && reserveOut > 0, "DXswapLibrary: INSUFFICIENT_LIQUIDITY");
uint256 numerator = reserveIn.mul(amountOut).mul(10000);
uint256 denominator = reserveOut.sub(amountOut).mul(uint256(10000).sub(swapFee));
amountIn = (numerator / denominator).add(1);
}
// performs chained getAmountOut calculations on any number of pairs
function getAmountsOut(
address factory,
uint256 amountIn,
address[] memory path
) internal view returns (uint256[] memory amounts) {
require(path.length >= 2, "DXswapLibrary: INVALID_PATH");
amounts = new uint256[](path.length);
amounts[0] = amountIn;
for (uint256 i; i < path.length - 1; i++) {
(uint256 reserveIn, uint256 reserveOut) = getReserves(factory, path[i], path[i + 1]);
amounts[i + 1] = getAmountOut(amounts[i], reserveIn, reserveOut, getSwapFee(factory, path[i], path[i + 1]));
}
}
// performs chained getAmountIn calculations on any number of pairs
function getAmountsIn(
address factory,
uint256 amountOut,
address[] memory path
) internal view returns (uint256[] memory amounts) {
require(path.length >= 2, "DXswapLibrary: INVALID_PATH");
amounts = new uint256[](path.length);
amounts[amounts.length - 1] = amountOut;
for (uint256 i = path.length - 1; i > 0; i--) {
(uint256 reserveIn, uint256 reserveOut) = getReserves(factory, path[i - 1], path[i]);
amounts[i - 1] = getAmountIn(amounts[i], reserveIn, reserveOut, getSwapFee(factory, path[i - 1], path[i]));
}
}
}
// File: contracts/OracleCreator.sol
pragma solidity =0.6.6;
pragma experimental ABIEncoderV2;
contract OracleCreator {
using FixedPoint for *;
using SafeMath for uint256;
event OracleCreated(
uint256 indexed _oracleIndex,
address indexed _pair,
uint256 _windowTime
);
struct Oracle{
uint256 windowTime;
address token0;
address token1;
IDXswapPair pair;
uint32 blockTimestampLast;
uint256 price0CumulativeLast;
uint256 price1CumulativeLast;
FixedPoint.uq112x112 price0Average;
FixedPoint.uq112x112 price1Average;
uint256 observationsCount;
address owner;
}
mapping(uint256 => Oracle) public oracles;
uint256 public oraclesIndex;
function createOracle(
uint256 windowTime,
address pair
) public returns (uint256 oracleId) {
IDXswapPair sourcePair = IDXswapPair(pair);
address token0 = sourcePair.token0();
address token1 = sourcePair.token1();
(,, uint32 blockTimestampLast) = sourcePair.getReserves();
oracles[oraclesIndex] = Oracle({
windowTime: windowTime,
token0: token0,
token1: token1,
pair: sourcePair,
blockTimestampLast: blockTimestampLast,
price0CumulativeLast: sourcePair.price0CumulativeLast(),
price1CumulativeLast: sourcePair.price1CumulativeLast(),
price0Average: FixedPoint.uq112x112(0),
price1Average: FixedPoint.uq112x112(0),
observationsCount: 0,
owner: msg.sender
});
oracleId = oraclesIndex;
oraclesIndex++;
emit OracleCreated(oracleId, address(sourcePair), windowTime);
}
function update(uint256 oracleIndex) public {
Oracle storage oracle = oracles[oracleIndex];
require(msg.sender == oracle.owner, 'OracleCreator: CALLER_NOT_OWNER');
require(oracle.observationsCount < 2, 'OracleCreator: FINISHED_OBERSERVATION');
(uint price0Cumulative, uint price1Cumulative, uint32 blockTimestamp) =
DXswapOracleLibrary.currentCumulativePrices(address(oracle.pair));
uint32 timeElapsed = blockTimestamp - oracle.blockTimestampLast; // overflow is desired
// first update can be executed immediately. Ensure that at least one full period has passed since the first update
require(
oracle.observationsCount == 0 || timeElapsed >= oracle.windowTime,
'OracleCreator: PERIOD_NOT_ELAPSED'
);
// overflow is desired, casting never truncates
// cumulative price is in (uq112x112 price * seconds) units so we simply wrap it after division by time elapsed
oracle.price0Average = FixedPoint.uq112x112(
uint224((price0Cumulative - oracle.price0CumulativeLast) / timeElapsed)
);
oracle.price1Average = FixedPoint.uq112x112(
uint224((price1Cumulative - oracle.price1CumulativeLast) / timeElapsed)
);
oracle.price0CumulativeLast = price0Cumulative;
oracle.price1CumulativeLast = price1Cumulative;
oracle.blockTimestampLast = blockTimestamp;
oracle.observationsCount++;
}
// note this will always return 0 before update has been called successfully for the first time.
function consult(uint256 oracleIndex, address token, uint256 amountIn) external view returns (uint256 amountOut) {
Oracle storage oracle = oracles[oracleIndex];
FixedPoint.uq112x112 memory avg;
if (token == oracle.token0) {
avg = oracle.price0Average;
} else {
require(token == oracle.token1, 'OracleCreator: INVALID_TOKEN');
avg = oracle.price1Average;
}
amountOut = avg.mul(amountIn).decode144();
}
function isOracleFinalized(uint256 oracleIndex) external view returns (bool){
return oracles[oracleIndex].observationsCount == 2;
}
function getOracleDetails(uint256 oracleIndex) external view returns (Oracle memory) {
return oracles[oracleIndex];
}
}

Contract ABI

[{"type":"event","name":"OracleCreated","inputs":[{"type":"uint256","name":"_oracleIndex","internalType":"uint256","indexed":true},{"type":"address","name":"_pair","internalType":"address","indexed":true},{"type":"uint256","name":"_windowTime","internalType":"uint256","indexed":false}],"anonymous":false},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"amountOut","internalType":"uint256"}],"name":"consult","inputs":[{"type":"uint256","name":"oracleIndex","internalType":"uint256"},{"type":"address","name":"token","internalType":"address"},{"type":"uint256","name":"amountIn","internalType":"uint256"}]},{"type":"function","stateMutability":"nonpayable","outputs":[{"type":"uint256","name":"oracleId","internalType":"uint256"}],"name":"createOracle","inputs":[{"type":"uint256","name":"windowTime","internalType":"uint256"},{"type":"address","name":"pair","internalType":"address"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"tuple","name":"","internalType":"struct OracleCreator.Oracle","components":[{"type":"uint256","name":"windowTime","internalType":"uint256"},{"type":"address","name":"token0","internalType":"address"},{"type":"address","name":"token1","internalType":"address"},{"type":"address","name":"pair","internalType":"contract IDXswapPair"},{"type":"uint32","name":"blockTimestampLast","internalType":"uint32"},{"type":"uint256","name":"price0CumulativeLast","internalType":"uint256"},{"type":"uint256","name":"price1CumulativeLast","internalType":"uint256"},{"type":"tuple","name":"price0Average","internalType":"struct FixedPoint.uq112x112","components":[{"type":"uint224","name":"_x","internalType":"uint224"}]},{"type":"tuple","name":"price1Average","internalType":"struct FixedPoint.uq112x112","components":[{"type":"uint224","name":"_x","internalType":"uint224"}]},{"type":"uint256","name":"observationsCount","internalType":"uint256"},{"type":"address","name":"owner","internalType":"address"}]}],"name":"getOracleDetails","inputs":[{"type":"uint256","name":"oracleIndex","internalType":"uint256"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"bool","name":"","internalType":"bool"}],"name":"isOracleFinalized","inputs":[{"type":"uint256","name":"oracleIndex","internalType":"uint256"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"windowTime","internalType":"uint256"},{"type":"address","name":"token0","internalType":"address"},{"type":"address","name":"token1","internalType":"address"},{"type":"address","name":"pair","internalType":"contract IDXswapPair"},{"type":"uint32","name":"blockTimestampLast","internalType":"uint32"},{"type":"uint256","name":"price0CumulativeLast","internalType":"uint256"},{"type":"uint256","name":"price1CumulativeLast","internalType":"uint256"},{"type":"tuple","name":"price0Average","internalType":"struct FixedPoint.uq112x112","components":[{"type":"uint224","name":"_x","internalType":"uint224"}]},{"type":"tuple","name":"price1Average","internalType":"struct FixedPoint.uq112x112","components":[{"type":"uint224","name":"_x","internalType":"uint224"}]},{"type":"uint256","name":"observationsCount","internalType":"uint256"},{"type":"address","name":"owner","internalType":"address"}],"name":"oracles","inputs":[{"type":"uint256","name":"","internalType":"uint256"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"oraclesIndex","inputs":[]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"update","inputs":[{"type":"uint256","name":"oracleIndex","internalType":"uint256"}]}]
            

Contract Creation Code

Verify & Publish
0x608060405234801561001057600080fd5b50611100806100206000396000f3fe608060405234801561001057600080fd5b506004361061007d5760003560e01c80634023282b1161005b5780634023282b146100d35780635b69a7d8146100e657806382ab890a14610110578063c6668d45146101255761007d565b806306649d67146100825780630eb5295f146100ab57806325fa7003146100b3575b600080fd5b610095610090366004610d6c565b610145565b6040516100a29190611028565b60405180910390f35b61009561055c565b6100c66100c1366004610d3c565b610562565b6040516100a29190610df7565b6100956100e1366004610d9b565b61057a565b6100f96100f4366004610d3c565b610654565b6040516100a29b9a99989796959493929190611031565b61012361011e366004610d3c565b6106e8565b005b610138610133366004610d3c565b61088a565b6040516100a29190610f70565b6000808290506000816001600160a01b0316630dfe16816040518163ffffffff1660e01b815260040160206040518083038186803b15801561018657600080fd5b505afa15801561019a573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906101be9190610cc5565b90506000826001600160a01b031663d21220a76040518163ffffffff1660e01b815260040160206040518083038186803b1580156101fb57600080fd5b505afa15801561020f573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906102339190610cc5565b90506000836001600160a01b0316630902f1ac6040518163ffffffff1660e01b815260040160606040518083038186803b15801561027057600080fd5b505afa158015610284573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906102a89190610ce8565b92505050604051806101600160405280888152602001846001600160a01b03168152602001836001600160a01b03168152602001856001600160a01b031681526020018263ffffffff168152602001856001600160a01b0316635909c0d56040518163ffffffff1660e01b815260040160206040518083038186803b15801561033057600080fd5b505afa158015610344573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906103689190610d54565b8152602001856001600160a01b0316635a3d54936040518163ffffffff1660e01b815260040160206040518083038186803b1580156103a657600080fd5b505afa1580156103ba573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906103de9190610d54565b81526040805160208181018352600080835281850192909252825180820184528281528385015260608085018390523360809586015260018054845283835292849020865181559186015182840180546001600160a01b039283166001600160a01b03199182161790915587860151600285018054918416918316919091179055918701516003840180549789015163ffffffff16600160a01b0263ffffffff60a01b1992841698851698909817919091169690961790955560a0860151600483015560c0860151600583015560e0860151516006830180546001600160e01b039283166001600160e01b0319918216179091556101008801515160078501805491909316911617905561012086015160088301556101409095015160099091018054918516919095161790935582548084019093555191965085169086907ffe5474489c150632f13da433a8fbebd5e91fe495940c6776c0b3934f5f636c509061054a908b90611028565b60405180910390a35050505092915050565b60015481565b60009081526020819052604090206008015460021490565b6000838152602081905260408120610590610c19565b60018201546001600160a01b03868116911614156105c95750604080516020810190915260068201546001600160e01b0316815261061e565b60028201546001600160a01b038681169116146106015760405162461bcd60e51b81526004016105f890610e39565b60405180910390fd5b50604080516020810190915260078201546001600160e01b031681525b610636610631828663ffffffff61095916565b6109b8565b71ffffffffffffffffffffffffffffffffffff169695505050505050565b600060208181529181526040908190208054600182015460028301546003840154600485015460058601548751808a01895260068801546001600160e01b03908116825289519a8b0190995260078801549098168952600887015460099097015495986001600160a01b03958616989486169786851697600160a01b90950463ffffffff169693959294929391929091168b565b600081815260208190526040902060098101546001600160a01b031633146107225760405162461bcd60e51b81526004016105f890610e02565b60028160080154106107465760405162461bcd60e51b81526004016105f890610f2b565b600381015460009081908190610764906001600160a01b03166109bf565b600387015460088801549396509194509250600160a01b900463ffffffff1682039015806107995750845463ffffffff821610155b6107b55760405162461bcd60e51b81526004016105f890610eb3565b60405180602001604052808263ffffffff1687600401548703816107d557fe5b046001600160e01b0390811690915290516006870180546001600160e01b0319169190921617905560408051602081019091526005860154819063ffffffff84169086038161082057fe5b046001600160e01b0390811690915290516007870180546001600160e01b03191691909216179055506004840192909255600583015560038201805463ffffffff60a01b1916600160a01b63ffffffff909316929092029190911790556008018054600101905550565b610892610c2b565b50600090815260208181526040918290208251610160810184528154815260018201546001600160a01b0390811682850152600283015481168286015260038301548082166060840152600160a01b900463ffffffff166080830152600483015460a0830152600583015460c08301528451808501865260068401546001600160e01b03908116825260e084019190915285519485019095526007830154909416835261010081019290925260088101546101208301526009015490911661014082015290565b610961610cb2565b600082158061098757505082516001600160e01b03168281029083828161098457fe5b04145b6109a35760405162461bcd60e51b81526004016105f890610e70565b60408051602081019091529081529392505050565b5160701c90565b60008060006109cc610b94565b9050836001600160a01b0316635909c0d56040518163ffffffff1660e01b815260040160206040518083038186803b158015610a0757600080fd5b505afa158015610a1b573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610a3f9190610d54565b9250836001600160a01b0316635a3d54936040518163ffffffff1660e01b815260040160206040518083038186803b158015610a7a57600080fd5b505afa158015610a8e573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610ab29190610d54565b91506000806000866001600160a01b0316630902f1ac6040518163ffffffff1660e01b815260040160606040518083038186803b158015610af257600080fd5b505afa158015610b06573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610b2a9190610ce8565b9250925092508363ffffffff168163ffffffff1614610b8a5780840363ffffffff8116610b578486610b9e565b516001600160e01b031602969096019563ffffffff8116610b788585610b9e565b516001600160e01b0316029590950194505b5050509193909250565b63ffffffff421690565b610ba6610c19565b6000826001600160701b031611610bcf5760405162461bcd60e51b81526004016105f890610ef4565b6040805160208101909152806001600160701b0384166dffffffffffffffffffffffffffff60701b607087901b1681610c0457fe5b046001600160e01b0316815250905092915050565b60408051602081019091526000815290565b6040518061016001604052806000815260200160006001600160a01b0316815260200160006001600160a01b0316815260200160006001600160a01b03168152602001600063ffffffff1681526020016000815260200160008152602001610c91610c19565b8152602001610c9e610c19565b815260006020820181905260409091015290565b6040518060200160405280600081525090565b600060208284031215610cd6578081fd5b8151610ce18161109d565b9392505050565b600080600060608486031215610cfc578182fd5b8351610d07816110b5565b6020850151909350610d18816110b5565b604085015190925063ffffffff81168114610d31578182fd5b809150509250925092565b600060208284031215610d4d578081fd5b5035919050565b600060208284031215610d65578081fd5b5051919050565b60008060408385031215610d7e578182fd5b823591506020830135610d908161109d565b809150509250929050565b600080600060608486031215610daf578283fd5b833592506020840135610dc18161109d565b929592945050506040919091013590565b6001600160a01b03169052565b516001600160e01b03169052565b63ffffffff169052565b901515815260200190565b6020808252601f908201527f4f7261636c6543726561746f723a2043414c4c45525f4e4f545f4f574e455200604082015260600190565b6020808252601c908201527f4f7261636c6543726561746f723a20494e56414c49445f544f4b454e00000000604082015260600190565b60208082526023908201527f4669786564506f696e743a204d554c5449504c49434154494f4e5f4f564552466040820152624c4f5760e81b606082015260800190565b60208082526021908201527f4f7261636c6543726561746f723a20504552494f445f4e4f545f454c415053456040820152601160fa1b606082015260800190565b60208082526017908201527f4669786564506f696e743a204449565f42595f5a45524f000000000000000000604082015260600190565b60208082526025908201527f4f7261636c6543726561746f723a2046494e49534845445f4f4245525345525660408201526420aa24a7a760d91b606082015260800190565b81518152602080830151610160830191610f8c90840182610dd2565b506040830151610f9f6040840182610dd2565b506060830151610fb26060840182610dd2565b506080830151610fc56080840182610ded565b5060a083015160a083015260c083015160c083015260e0830151610fec60e0840182610ddf565b506101008084015161100082850182610ddf565b505061012083810151908301526101408084015161102082850182610dd2565b505092915050565b90815260200190565b9a8b526001600160a01b03998a1660208c015297891660408b015295881660608a015263ffffffff94909416608089015260a088019290925260c0870152516001600160e01b0390811660e0870152905116610100850152610120840152166101408201526101600190565b6001600160a01b03811681146110b257600080fd5b50565b6001600160701b03811681146110b257600080fdfea26469706673582212205dd0c4aaa6a8d17ad4dee13efbe572998a0bef43735811dec69cf2ce7c7e8af164736f6c63430006060033

Deployed ByteCode

0x608060405234801561001057600080fd5b506004361061007d5760003560e01c80634023282b1161005b5780634023282b146100d35780635b69a7d8146100e657806382ab890a14610110578063c6668d45146101255761007d565b806306649d67146100825780630eb5295f146100ab57806325fa7003146100b3575b600080fd5b610095610090366004610d6c565b610145565b6040516100a29190611028565b60405180910390f35b61009561055c565b6100c66100c1366004610d3c565b610562565b6040516100a29190610df7565b6100956100e1366004610d9b565b61057a565b6100f96100f4366004610d3c565b610654565b6040516100a29b9a99989796959493929190611031565b61012361011e366004610d3c565b6106e8565b005b610138610133366004610d3c565b61088a565b6040516100a29190610f70565b6000808290506000816001600160a01b0316630dfe16816040518163ffffffff1660e01b815260040160206040518083038186803b15801561018657600080fd5b505afa15801561019a573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906101be9190610cc5565b90506000826001600160a01b031663d21220a76040518163ffffffff1660e01b815260040160206040518083038186803b1580156101fb57600080fd5b505afa15801561020f573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906102339190610cc5565b90506000836001600160a01b0316630902f1ac6040518163ffffffff1660e01b815260040160606040518083038186803b15801561027057600080fd5b505afa158015610284573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906102a89190610ce8565b92505050604051806101600160405280888152602001846001600160a01b03168152602001836001600160a01b03168152602001856001600160a01b031681526020018263ffffffff168152602001856001600160a01b0316635909c0d56040518163ffffffff1660e01b815260040160206040518083038186803b15801561033057600080fd5b505afa158015610344573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906103689190610d54565b8152602001856001600160a01b0316635a3d54936040518163ffffffff1660e01b815260040160206040518083038186803b1580156103a657600080fd5b505afa1580156103ba573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906103de9190610d54565b81526040805160208181018352600080835281850192909252825180820184528281528385015260608085018390523360809586015260018054845283835292849020865181559186015182840180546001600160a01b039283166001600160a01b03199182161790915587860151600285018054918416918316919091179055918701516003840180549789015163ffffffff16600160a01b0263ffffffff60a01b1992841698851698909817919091169690961790955560a0860151600483015560c0860151600583015560e0860151516006830180546001600160e01b039283166001600160e01b0319918216179091556101008801515160078501805491909316911617905561012086015160088301556101409095015160099091018054918516919095161790935582548084019093555191965085169086907ffe5474489c150632f13da433a8fbebd5e91fe495940c6776c0b3934f5f636c509061054a908b90611028565b60405180910390a35050505092915050565b60015481565b60009081526020819052604090206008015460021490565b6000838152602081905260408120610590610c19565b60018201546001600160a01b03868116911614156105c95750604080516020810190915260068201546001600160e01b0316815261061e565b60028201546001600160a01b038681169116146106015760405162461bcd60e51b81526004016105f890610e39565b60405180910390fd5b50604080516020810190915260078201546001600160e01b031681525b610636610631828663ffffffff61095916565b6109b8565b71ffffffffffffffffffffffffffffffffffff169695505050505050565b600060208181529181526040908190208054600182015460028301546003840154600485015460058601548751808a01895260068801546001600160e01b03908116825289519a8b0190995260078801549098168952600887015460099097015495986001600160a01b03958616989486169786851697600160a01b90950463ffffffff169693959294929391929091168b565b600081815260208190526040902060098101546001600160a01b031633146107225760405162461bcd60e51b81526004016105f890610e02565b60028160080154106107465760405162461bcd60e51b81526004016105f890610f2b565b600381015460009081908190610764906001600160a01b03166109bf565b600387015460088801549396509194509250600160a01b900463ffffffff1682039015806107995750845463ffffffff821610155b6107b55760405162461bcd60e51b81526004016105f890610eb3565b60405180602001604052808263ffffffff1687600401548703816107d557fe5b046001600160e01b0390811690915290516006870180546001600160e01b0319169190921617905560408051602081019091526005860154819063ffffffff84169086038161082057fe5b046001600160e01b0390811690915290516007870180546001600160e01b03191691909216179055506004840192909255600583015560038201805463ffffffff60a01b1916600160a01b63ffffffff909316929092029190911790556008018054600101905550565b610892610c2b565b50600090815260208181526040918290208251610160810184528154815260018201546001600160a01b0390811682850152600283015481168286015260038301548082166060840152600160a01b900463ffffffff166080830152600483015460a0830152600583015460c08301528451808501865260068401546001600160e01b03908116825260e084019190915285519485019095526007830154909416835261010081019290925260088101546101208301526009015490911661014082015290565b610961610cb2565b600082158061098757505082516001600160e01b03168281029083828161098457fe5b04145b6109a35760405162461bcd60e51b81526004016105f890610e70565b60408051602081019091529081529392505050565b5160701c90565b60008060006109cc610b94565b9050836001600160a01b0316635909c0d56040518163ffffffff1660e01b815260040160206040518083038186803b158015610a0757600080fd5b505afa158015610a1b573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610a3f9190610d54565b9250836001600160a01b0316635a3d54936040518163ffffffff1660e01b815260040160206040518083038186803b158015610a7a57600080fd5b505afa158015610a8e573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610ab29190610d54565b91506000806000866001600160a01b0316630902f1ac6040518163ffffffff1660e01b815260040160606040518083038186803b158015610af257600080fd5b505afa158015610b06573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610b2a9190610ce8565b9250925092508363ffffffff168163ffffffff1614610b8a5780840363ffffffff8116610b578486610b9e565b516001600160e01b031602969096019563ffffffff8116610b788585610b9e565b516001600160e01b0316029590950194505b5050509193909250565b63ffffffff421690565b610ba6610c19565b6000826001600160701b031611610bcf5760405162461bcd60e51b81526004016105f890610ef4565b6040805160208101909152806001600160701b0384166dffffffffffffffffffffffffffff60701b607087901b1681610c0457fe5b046001600160e01b0316815250905092915050565b60408051602081019091526000815290565b6040518061016001604052806000815260200160006001600160a01b0316815260200160006001600160a01b0316815260200160006001600160a01b03168152602001600063ffffffff1681526020016000815260200160008152602001610c91610c19565b8152602001610c9e610c19565b815260006020820181905260409091015290565b6040518060200160405280600081525090565b600060208284031215610cd6578081fd5b8151610ce18161109d565b9392505050565b600080600060608486031215610cfc578182fd5b8351610d07816110b5565b6020850151909350610d18816110b5565b604085015190925063ffffffff81168114610d31578182fd5b809150509250925092565b600060208284031215610d4d578081fd5b5035919050565b600060208284031215610d65578081fd5b5051919050565b60008060408385031215610d7e578182fd5b823591506020830135610d908161109d565b809150509250929050565b600080600060608486031215610daf578283fd5b833592506020840135610dc18161109d565b929592945050506040919091013590565b6001600160a01b03169052565b516001600160e01b03169052565b63ffffffff169052565b901515815260200190565b6020808252601f908201527f4f7261636c6543726561746f723a2043414c4c45525f4e4f545f4f574e455200604082015260600190565b6020808252601c908201527f4f7261636c6543726561746f723a20494e56414c49445f544f4b454e00000000604082015260600190565b60208082526023908201527f4669786564506f696e743a204d554c5449504c49434154494f4e5f4f564552466040820152624c4f5760e81b606082015260800190565b60208082526021908201527f4f7261636c6543726561746f723a20504552494f445f4e4f545f454c415053456040820152601160fa1b606082015260800190565b60208082526017908201527f4669786564506f696e743a204449565f42595f5a45524f000000000000000000604082015260600190565b60208082526025908201527f4f7261636c6543726561746f723a2046494e49534845445f4f4245525345525660408201526420aa24a7a760d91b606082015260800190565b81518152602080830151610160830191610f8c90840182610dd2565b506040830151610f9f6040840182610dd2565b506060830151610fb26060840182610dd2565b506080830151610fc56080840182610ded565b5060a083015160a083015260c083015160c083015260e0830151610fec60e0840182610ddf565b506101008084015161100082850182610ddf565b505061012083810151908301526101408084015161102082850182610dd2565b505092915050565b90815260200190565b9a8b526001600160a01b03998a1660208c015297891660408b015295881660608a015263ffffffff94909416608089015260a088019290925260c0870152516001600160e01b0390811660e0870152905116610100850152610120840152166101408201526101600190565b6001600160a01b03811681146110b257600080fd5b50565b6001600160701b03811681146110b257600080fdfea26469706673582212205dd0c4aaa6a8d17ad4dee13efbe572998a0bef43735811dec69cf2ce7c7e8af164736f6c63430006060033