ETH Price: $3,915.10 (+5.12%)

Contract

0x4800879F32e37298a6eBa72361eD99d4AA7A7E22

Overview

ETH Balance

0 ETH

ETH Value

$0.00

Multichain Info

No addresses found
Transaction Hash
Method
Block
From
To
Set Prices With ...1124079332023-11-19 17:24:03388 days ago1700414643IN
0x4800879F...4AA7A7E22
0 ETH0.0000385233430.00902854
Set Prices With ...1124078132023-11-19 17:20:03388 days ago1700414403IN
0x4800879F...4AA7A7E22
0 ETH0.000041528120.0092188
Set Prices With ...1124076932023-11-19 17:16:03388 days ago1700414163IN
0x4800879F...4AA7A7E22
0 ETH0.0000398512980.00891403
Set Prices With ...1124075732023-11-19 17:12:03388 days ago1700413923IN
0x4800879F...4AA7A7E22
0 ETH0.0000398403470.00960977
Set Prices With ...1124074532023-11-19 17:08:03388 days ago1700413683IN
0x4800879F...4AA7A7E22
0 ETH0.0000434899190.00951131
Set Prices With ...1124073332023-11-19 17:04:03388 days ago1700413443IN
0x4800879F...4AA7A7E22
0 ETH0.0000394473820.00963673
Set Prices With ...1124072132023-11-19 17:00:03388 days ago1700413203IN
0x4800879F...4AA7A7E22
0 ETH0.0000324729740.00913096
Set Prices With ...1124070932023-11-19 16:56:03388 days ago1700412963IN
0x4800879F...4AA7A7E22
0 ETH0.0000361928690.00929657
Set Prices With ...1124069732023-11-19 16:52:03388 days ago1700412723IN
0x4800879F...4AA7A7E22
0 ETH0.000035456850.00982985
Set Prices With ...1124068532023-11-19 16:48:03388 days ago1700412483IN
0x4800879F...4AA7A7E22
0 ETH0.0000349473020.00928029
Set Prices With ...1124067332023-11-19 16:44:03388 days ago1700412243IN
0x4800879F...4AA7A7E22
0 ETH0.0000371005130.00919385
Set Prices With ...1124066132023-11-19 16:40:03388 days ago1700412003IN
0x4800879F...4AA7A7E22
0 ETH0.0000339254020.00941045
Set Prices With ...1124064942023-11-19 16:36:05388 days ago1700411765IN
0x4800879F...4AA7A7E22
0 ETH0.0000374185820.00922222
Set Prices With ...1124063732023-11-19 16:32:03388 days ago1700411523IN
0x4800879F...4AA7A7E22
0 ETH0.0000387054440.00924501
Set Prices With ...1124062532023-11-19 16:28:03388 days ago1700411283IN
0x4800879F...4AA7A7E22
0 ETH0.0000351160310.01047292
Set Prices With ...1124061332023-11-19 16:24:03388 days ago1700411043IN
0x4800879F...4AA7A7E22
0 ETH0.0000346580560.01039758
Set Prices With ...1124060132023-11-19 16:20:03388 days ago1700410803IN
0x4800879F...4AA7A7E22
0 ETH0.0000366005740.01182832
Set Prices With ...1124058932023-11-19 16:16:03388 days ago1700410563IN
0x4800879F...4AA7A7E22
0 ETH0.0000344267590.01123068
Set Prices With ...1124057732023-11-19 16:12:03388 days ago1700410323IN
0x4800879F...4AA7A7E22
0 ETH0.0000331590880.01167605
Set Prices With ...1124056532023-11-19 16:08:03388 days ago1700410083IN
0x4800879F...4AA7A7E22
0 ETH0.0000326992180.01152495
Set Prices With ...1124055332023-11-19 16:04:03388 days ago1700409843IN
0x4800879F...4AA7A7E22
0 ETH0.0000339722350.01159413
Set Prices With ...1124054132023-11-19 16:00:03388 days ago1700409603IN
0x4800879F...4AA7A7E22
0 ETH0.0000361648030.01123809
Set Prices With ...1124052932023-11-19 15:56:03388 days ago1700409363IN
0x4800879F...4AA7A7E22
0 ETH0.0000410185450.01179386
Set Prices With ...1124051622023-11-19 15:51:41388 days ago1700409101IN
0x4800879F...4AA7A7E22
0 ETH0.0000401236720.01158431
Set Prices With ...1124050622023-11-19 15:48:21388 days ago1700408901IN
0x4800879F...4AA7A7E22
0 ETH0.0000425089280.01225269
View all transactions

Latest 25 internal transactions (View All)

Advanced mode:
Parent Transaction Hash Block From To
1075583432023-07-30 11:11:03501 days ago1690715463
0x4800879F...4AA7A7E22
0 ETH
1075583432023-07-30 11:11:03501 days ago1690715463
0x4800879F...4AA7A7E22
0 ETH
1075583432023-07-30 11:11:03501 days ago1690715463
0x4800879F...4AA7A7E22
0 ETH
1075583432023-07-30 11:11:03501 days ago1690715463
0x4800879F...4AA7A7E22
0 ETH
1075583432023-07-30 11:11:03501 days ago1690715463
0x4800879F...4AA7A7E22
0 ETH
1075583432023-07-30 11:11:03501 days ago1690715463
0x4800879F...4AA7A7E22
0 ETH
1075582232023-07-30 11:07:03501 days ago1690715223
0x4800879F...4AA7A7E22
0 ETH
1075582232023-07-30 11:07:03501 days ago1690715223
0x4800879F...4AA7A7E22
0 ETH
1075582232023-07-30 11:07:03501 days ago1690715223
0x4800879F...4AA7A7E22
0 ETH
1075582232023-07-30 11:07:03501 days ago1690715223
0x4800879F...4AA7A7E22
0 ETH
1075582232023-07-30 11:07:03501 days ago1690715223
0x4800879F...4AA7A7E22
0 ETH
1075582232023-07-30 11:07:03501 days ago1690715223
0x4800879F...4AA7A7E22
0 ETH
1075581032023-07-30 11:03:03501 days ago1690714983
0x4800879F...4AA7A7E22
0 ETH
1075581032023-07-30 11:03:03501 days ago1690714983
0x4800879F...4AA7A7E22
0 ETH
1075581032023-07-30 11:03:03501 days ago1690714983
0x4800879F...4AA7A7E22
0 ETH
1075581032023-07-30 11:03:03501 days ago1690714983
0x4800879F...4AA7A7E22
0 ETH
1075581032023-07-30 11:03:03501 days ago1690714983
0x4800879F...4AA7A7E22
0 ETH
1075581032023-07-30 11:03:03501 days ago1690714983
0x4800879F...4AA7A7E22
0 ETH
1075579832023-07-30 10:59:03501 days ago1690714743
0x4800879F...4AA7A7E22
0 ETH
1075579832023-07-30 10:59:03501 days ago1690714743
0x4800879F...4AA7A7E22
0 ETH
1075579832023-07-30 10:59:03501 days ago1690714743
0x4800879F...4AA7A7E22
0 ETH
1075579832023-07-30 10:59:03501 days ago1690714743
0x4800879F...4AA7A7E22
0 ETH
1075579832023-07-30 10:59:03501 days ago1690714743
0x4800879F...4AA7A7E22
0 ETH
1075579832023-07-30 10:59:03501 days ago1690714743
0x4800879F...4AA7A7E22
0 ETH
1075578632023-07-30 10:55:03501 days ago1690714503
0x4800879F...4AA7A7E22
0 ETH
View All Internal Transactions

Loading...
Loading

Contract Source Code Verified (Exact Match)

Contract Name:
FastPriceFeed

Compiler Version
v0.6.12+commit.27d51765

Optimization Enabled:
Yes with 1 runs

Other Settings:
default evmVersion, MIT license
File 1 of 8 : FastPriceFeed.sol
// SPDX-License-Identifier: MIT

import "../libraries/math/SafeMath.sol";

import "./interfaces/ISecondaryPriceFeed.sol";
import "./interfaces/IFastPriceFeed.sol";
import "./interfaces/IFastPriceEvents.sol";
import "../core/interfaces/IVaultPriceFeed.sol";
import "../core/interfaces/IPositionRouter.sol";
import "../access/Governable.sol";

pragma solidity 0.6.12;

contract FastPriceFeed is ISecondaryPriceFeed, IFastPriceFeed, Governable {
    using SafeMath for uint256;

    // fit data in a uint256 slot to save gas costs
    struct PriceDataItem {
        uint160 refPrice; // Chainlink price
        uint32 refTime; // last updated at time
        uint32 cumulativeRefDelta; // cumulative Chainlink price delta
        uint32 cumulativeFastDelta; // cumulative fast price delta
    }

    uint256 public constant PRICE_PRECISION = 10 ** 30;

    uint256 public constant CUMULATIVE_DELTA_PRECISION = 10 * 1000 * 1000;

    uint256 public constant MAX_REF_PRICE = type(uint160).max;
    uint256 public constant MAX_CUMULATIVE_REF_DELTA = type(uint32).max;
    uint256 public constant MAX_CUMULATIVE_FAST_DELTA = type(uint32).max;

    // uint256(~0) is 256 bits of 1s
    // shift the 1s by (256 - 32) to get (256 - 32) 0s followed by 32 1s
    uint256 constant public BITMASK_32 = uint256(~0) >> (256 - 32);

    uint256 public constant BASIS_POINTS_DIVISOR = 10000;

    uint256 public constant MAX_PRICE_DURATION = 30 minutes;

    bool public isInitialized;
    bool public isSpreadEnabled = false;

    address public vaultPriceFeed;
    address public fastPriceEvents;

    address public tokenManager;

    address public positionRouter;

    uint256 public override lastUpdatedAt;
    uint256 public override lastUpdatedBlock;

    uint256 public priceDuration;
    uint256 public maxPriceUpdateDelay;
    uint256 public spreadBasisPointsIfInactive;
    uint256 public spreadBasisPointsIfChainError;
    uint256 public minBlockInterval;
    uint256 public maxTimeDeviation;

    uint256 public priceDataInterval;

    // allowed deviation from primary price
    uint256 public maxDeviationBasisPoints;

    uint256 public minAuthorizations;
    uint256 public disableFastPriceVoteCount = 0;

    mapping (address => bool) public isUpdater;

    mapping (address => uint256) public prices;
    mapping (address => PriceDataItem) public priceData;
    mapping (address => uint256) public maxCumulativeDeltaDiffs;

    mapping (address => bool) public isSigner;
    mapping (address => bool) public disableFastPriceVotes;

    // array of tokens used in setCompactedPrices, saves L1 calldata gas costs
    address[] public tokens;
    // array of tokenPrecisions used in setCompactedPrices, saves L1 calldata gas costs
    // if the token price will be sent with 3 decimals, then tokenPrecision for that token
    // should be 10 ** 3
    uint256[] public tokenPrecisions;

    event DisableFastPrice(address signer);
    event EnableFastPrice(address signer);
    event PriceData(address token, uint256 refPrice, uint256 fastPrice, uint256 cumulativeRefDelta, uint256 cumulativeFastDelta);
    event MaxCumulativeDeltaDiffExceeded(address token, uint256 refPrice, uint256 fastPrice, uint256 cumulativeRefDelta, uint256 cumulativeFastDelta);

    modifier onlySigner() {
        require(isSigner[msg.sender], "FastPriceFeed: forbidden");
        _;
    }

    modifier onlyUpdater() {
        require(isUpdater[msg.sender], "FastPriceFeed: forbidden");
        _;
    }

    modifier onlyTokenManager() {
        require(msg.sender == tokenManager, "FastPriceFeed: forbidden");
        _;
    }

    constructor(
      uint256 _priceDuration,
      uint256 _maxPriceUpdateDelay,
      uint256 _minBlockInterval,
      uint256 _maxDeviationBasisPoints,
      address _fastPriceEvents,
      address _tokenManager,
      address _positionRouter
    ) public {
        require(_priceDuration <= MAX_PRICE_DURATION, "FastPriceFeed: invalid _priceDuration");
        priceDuration = _priceDuration;
        maxPriceUpdateDelay = _maxPriceUpdateDelay;
        minBlockInterval = _minBlockInterval;
        maxDeviationBasisPoints = _maxDeviationBasisPoints;
        fastPriceEvents = _fastPriceEvents;
        tokenManager = _tokenManager;
        positionRouter = _positionRouter;
    }

    function initialize(uint256 _minAuthorizations, address[] memory _signers, address[] memory _updaters) public onlyGov {
        require(!isInitialized, "FastPriceFeed: already initialized");
        isInitialized = true;

        minAuthorizations = _minAuthorizations;

        for (uint256 i = 0; i < _signers.length; i++) {
            address signer = _signers[i];
            isSigner[signer] = true;
        }

        for (uint256 i = 0; i < _updaters.length; i++) {
            address updater = _updaters[i];
            isUpdater[updater] = true;
        }
    }

    function setTokenManager(address _tokenManager) external onlyGov {
        tokenManager = _tokenManager;
    }

    function setSigner(address _account, bool _isActive) external override onlyGov {
        isSigner[_account] = _isActive;
    }

    function setUpdater(address _account, bool _isActive) external override onlyGov {
        isUpdater[_account] = _isActive;
    }

    function setFastPriceEvents(address _fastPriceEvents) external onlyGov {
      fastPriceEvents = _fastPriceEvents;
    }

    function setVaultPriceFeed(address _vaultPriceFeed) external override onlyGov {
      vaultPriceFeed = _vaultPriceFeed;
    }

    function setMaxTimeDeviation(uint256 _maxTimeDeviation) external onlyGov {
        maxTimeDeviation = _maxTimeDeviation;
    }

    function setPriceDuration(uint256 _priceDuration) external override onlyGov {
        require(_priceDuration <= MAX_PRICE_DURATION, "FastPriceFeed: invalid _priceDuration");
        priceDuration = _priceDuration;
    }

    function setMaxPriceUpdateDelay(uint256 _maxPriceUpdateDelay) external override onlyGov {
        maxPriceUpdateDelay = _maxPriceUpdateDelay;
    }

    function setSpreadBasisPointsIfInactive(uint256 _spreadBasisPointsIfInactive) external override onlyGov {
        spreadBasisPointsIfInactive = _spreadBasisPointsIfInactive;
    }

    function setSpreadBasisPointsIfChainError(uint256 _spreadBasisPointsIfChainError) external override onlyGov {
        spreadBasisPointsIfChainError = _spreadBasisPointsIfChainError;
    }

    function setMinBlockInterval(uint256 _minBlockInterval) external override onlyGov {
        minBlockInterval = _minBlockInterval;
    }

    function setIsSpreadEnabled(bool _isSpreadEnabled) external override onlyGov {
        isSpreadEnabled = _isSpreadEnabled;
    }

    function setMaxDeviationBasisPoints(uint256 _maxDeviationBasisPoints) external override onlyGov {
        maxDeviationBasisPoints = _maxDeviationBasisPoints;
    }

    function setMaxCumulativeDeltaDiffs(address[] memory _tokens,  uint256[] memory _maxCumulativeDeltaDiffs) external override onlyGov {
        for (uint256 i = 0; i < _tokens.length; i++) {
            address token = _tokens[i];
            maxCumulativeDeltaDiffs[token] = _maxCumulativeDeltaDiffs[i];
        }
    }

    function setPriceDataInterval(uint256 _priceDataInterval) external override onlyGov {
        priceDataInterval = _priceDataInterval;
    }

    function setLastUpdatedAt(uint256 _lastUpdatedAt) external onlyGov {
        lastUpdatedAt = _lastUpdatedAt;
    }

    function setMinAuthorizations(uint256 _minAuthorizations) external onlyTokenManager {
        minAuthorizations = _minAuthorizations;
    }

    function setTokens(address[] memory _tokens, uint256[] memory _tokenPrecisions) external onlyGov {
        require(_tokens.length == _tokenPrecisions.length, "FastPriceFeed: invalid lengths");
        tokens = _tokens;
        tokenPrecisions = _tokenPrecisions;
    }

    function setPrices(address[] memory _tokens, uint256[] memory _prices, uint256 _timestamp) external onlyUpdater {
        bool shouldUpdate = _setLastUpdatedValues(_timestamp);

        if (shouldUpdate) {
            address _fastPriceEvents = fastPriceEvents;
            address _vaultPriceFeed = vaultPriceFeed;

            for (uint256 i = 0; i < _tokens.length; i++) {
                address token = _tokens[i];
                _setPrice(token, _prices[i], _vaultPriceFeed, _fastPriceEvents);
            }
        }
    }

    function setCompactedPrices(uint256[] memory _priceBitArray, uint256 _timestamp) external onlyUpdater {
        _setCompactedPrices(_priceBitArray, _timestamp);
    }

    function _setCompactedPrices(uint256[] memory _priceBitArray, uint256 _timestamp) private {
        bool shouldUpdate = _setLastUpdatedValues(_timestamp);

        if (shouldUpdate) {
            address _fastPriceEvents = fastPriceEvents;
            address _vaultPriceFeed = vaultPriceFeed;

            for (uint256 i = 0; i < _priceBitArray.length; i++) {
                uint256 priceBits = _priceBitArray[i];

                for (uint256 j = 0; j < 8; j++) {
                    uint256 index = i * 8 + j;
                    if (index >= tokens.length) { return; }

                    uint256 startBit = 32 * j;
                    uint256 price = (priceBits >> startBit) & BITMASK_32;

                    address token = tokens[i * 8 + j];
                    uint256 tokenPrecision = tokenPrecisions[i * 8 + j];
                    uint256 adjustedPrice = price.mul(PRICE_PRECISION).div(tokenPrecision);

                    _setPrice(token, adjustedPrice, _vaultPriceFeed, _fastPriceEvents);
                }
            }
        }
    }

    function setPricesWithBits(uint256 _priceBits, uint256 _timestamp) external onlyUpdater {
        _setPricesWithBits(_priceBits, _timestamp);
    }

    function setPricesWithBitsAndExecute(
        uint256 _priceBits,
        uint256 _timestamp,
        uint256 _endIndexForIncreasePositions,
        uint256 _endIndexForDecreasePositions,
        uint256 _maxIncreasePositions,
        uint256 _maxDecreasePositions
    ) external onlyUpdater {
        _setPricesWithBits(_priceBits, _timestamp);

        IPositionRouter _positionRouter = IPositionRouter(positionRouter);
        uint256 maxEndIndexForIncrease = _positionRouter.increasePositionRequestKeysStart().add(_maxIncreasePositions);
        uint256 maxEndIndexForDecrease = _positionRouter.increasePositionRequestKeysStart().add(_maxDecreasePositions);

        if (_endIndexForIncreasePositions > maxEndIndexForIncrease) {
            _endIndexForIncreasePositions = maxEndIndexForIncrease;
        }

        if (_endIndexForDecreasePositions > maxEndIndexForDecrease) {
            _endIndexForDecreasePositions = maxEndIndexForDecrease;
        }

        _positionRouter.executeIncreasePositions(_endIndexForIncreasePositions, payable(msg.sender));
        _positionRouter.executeDecreasePositions(_endIndexForDecreasePositions, payable(msg.sender));
    }

    function setCompactedPricesAndExecute(
        uint256[] memory _priceBitArray,
        uint256 _timestamp,
        uint256 _endIndexForIncreasePositions,
        uint256 _endIndexForDecreasePositions,
        uint256 _maxIncreasePositions,
        uint256 _maxDecreasePositions
    ) external onlyUpdater {
        _setCompactedPrices(_priceBitArray, _timestamp);

        IPositionRouter _positionRouter = IPositionRouter(positionRouter);
        uint256 maxEndIndexForIncrease = _positionRouter.increasePositionRequestKeysStart().add(_maxIncreasePositions);
        uint256 maxEndIndexForDecrease = _positionRouter.increasePositionRequestKeysStart().add(_maxDecreasePositions);

        if (_endIndexForIncreasePositions > maxEndIndexForIncrease) {
            _endIndexForIncreasePositions = maxEndIndexForIncrease;
        }

        if (_endIndexForDecreasePositions > maxEndIndexForDecrease) {
            _endIndexForDecreasePositions = maxEndIndexForDecrease;
        }

        _positionRouter.executeIncreasePositions(_endIndexForIncreasePositions, payable(msg.sender));
        _positionRouter.executeDecreasePositions(_endIndexForDecreasePositions, payable(msg.sender));
    }

    function disableFastPrice() external onlySigner {
        require(!disableFastPriceVotes[msg.sender], "FastPriceFeed: already voted");
        disableFastPriceVotes[msg.sender] = true;
        disableFastPriceVoteCount = disableFastPriceVoteCount.add(1);

        emit DisableFastPrice(msg.sender);
    }

    function enableFastPrice() external onlySigner {
        require(disableFastPriceVotes[msg.sender], "FastPriceFeed: already enabled");
        disableFastPriceVotes[msg.sender] = false;
        disableFastPriceVoteCount = disableFastPriceVoteCount.sub(1);

        emit EnableFastPrice(msg.sender);
    }

    // under regular operation, the fastPrice (prices[token]) is returned and there is no spread returned from this function,
    // though VaultPriceFeed might apply its own spread
    //
    // if the fastPrice has not been updated within priceDuration then it is ignored and only _refPrice with a spread is used (spread: spreadBasisPointsIfInactive)
    // in case the fastPrice has not been updated for maxPriceUpdateDelay then the _refPrice with a larger spread is used (spread: spreadBasisPointsIfChainError)
    //
    // there will be a spread from the _refPrice to the fastPrice in the following cases:
    // - in case isSpreadEnabled is set to true
    // - in case the maxDeviationBasisPoints between _refPrice and fastPrice is exceeded
    // - in case watchers flag an issue
    // - in case the cumulativeFastDelta exceeds the cumulativeRefDelta by the maxCumulativeDeltaDiff
    function getPrice(address _token, uint256 _refPrice, bool _maximise) external override view returns (uint256) {
        if (block.timestamp > lastUpdatedAt.add(maxPriceUpdateDelay)) {
            if (_maximise) {
                return _refPrice.mul(BASIS_POINTS_DIVISOR.add(spreadBasisPointsIfChainError)).div(BASIS_POINTS_DIVISOR);
            }

            return _refPrice.mul(BASIS_POINTS_DIVISOR.sub(spreadBasisPointsIfChainError)).div(BASIS_POINTS_DIVISOR);
        }

        if (block.timestamp > lastUpdatedAt.add(priceDuration)) {
            if (_maximise) {
                return _refPrice.mul(BASIS_POINTS_DIVISOR.add(spreadBasisPointsIfInactive)).div(BASIS_POINTS_DIVISOR);
            }

            return _refPrice.mul(BASIS_POINTS_DIVISOR.sub(spreadBasisPointsIfInactive)).div(BASIS_POINTS_DIVISOR);
        }

        uint256 fastPrice = prices[_token];
        if (fastPrice == 0) { return _refPrice; }

        uint256 diffBasisPoints = _refPrice > fastPrice ? _refPrice.sub(fastPrice) : fastPrice.sub(_refPrice);
        diffBasisPoints = diffBasisPoints.mul(BASIS_POINTS_DIVISOR).div(_refPrice);

        // create a spread between the _refPrice and the fastPrice if the maxDeviationBasisPoints is exceeded
        // or if watchers have flagged an issue with the fast price
        bool hasSpread = !favorFastPrice(_token) || diffBasisPoints > maxDeviationBasisPoints;

        if (hasSpread) {
            // return the higher of the two prices
            if (_maximise) {
                return _refPrice > fastPrice ? _refPrice : fastPrice;
            }

            // return the lower of the two prices
            return _refPrice < fastPrice ? _refPrice : fastPrice;
        }

        return fastPrice;
    }

    function favorFastPrice(address _token) public view returns (bool) {
        if (isSpreadEnabled) {
            return false;
        }

        if (disableFastPriceVoteCount >= minAuthorizations) {
            // force a spread if watchers have flagged an issue with the fast price
            return false;
        }

        (/* uint256 prevRefPrice */, /* uint256 refTime */, uint256 cumulativeRefDelta, uint256 cumulativeFastDelta) = getPriceData(_token);
        if (cumulativeFastDelta > cumulativeRefDelta && cumulativeFastDelta.sub(cumulativeRefDelta) > maxCumulativeDeltaDiffs[_token]) {
            // force a spread if the cumulative delta for the fast price feed exceeds the cumulative delta
            // for the Chainlink price feed by the maxCumulativeDeltaDiff allowed
            return false;
        }

        return true;
    }

    function getPriceData(address _token) public view returns (uint256, uint256, uint256, uint256) {
        PriceDataItem memory data = priceData[_token];
        return (uint256(data.refPrice), uint256(data.refTime), uint256(data.cumulativeRefDelta), uint256(data.cumulativeFastDelta));
    }

    function _setPricesWithBits(uint256 _priceBits, uint256 _timestamp) private {
        bool shouldUpdate = _setLastUpdatedValues(_timestamp);

        if (shouldUpdate) {
            address _fastPriceEvents = fastPriceEvents;
            address _vaultPriceFeed = vaultPriceFeed;

            for (uint256 j = 0; j < 8; j++) {
                uint256 index = j;
                if (index >= tokens.length) { return; }

                uint256 startBit = 32 * j;
                uint256 price = (_priceBits >> startBit) & BITMASK_32;

                address token = tokens[j];
                uint256 tokenPrecision = tokenPrecisions[j];
                uint256 adjustedPrice = price.mul(PRICE_PRECISION).div(tokenPrecision);

                _setPrice(token, adjustedPrice, _vaultPriceFeed, _fastPriceEvents);
            }
        }
    }

    function _setPrice(address _token, uint256 _price, address _vaultPriceFeed, address _fastPriceEvents) private {
        if (_vaultPriceFeed != address(0)) {
            uint256 refPrice = IVaultPriceFeed(_vaultPriceFeed).getLatestPrimaryPrice(_token);
            uint256 fastPrice = prices[_token];

            (uint256 prevRefPrice, uint256 refTime, uint256 cumulativeRefDelta, uint256 cumulativeFastDelta) = getPriceData(_token);

            if (prevRefPrice > 0) {
                uint256 refDeltaAmount = refPrice > prevRefPrice ? refPrice.sub(prevRefPrice) : prevRefPrice.sub(refPrice);
                uint256 fastDeltaAmount = fastPrice > _price ? fastPrice.sub(_price) : _price.sub(fastPrice);

                // reset cumulative delta values if it is a new time window
                if (refTime.div(priceDataInterval) != block.timestamp.div(priceDataInterval)) {
                    cumulativeRefDelta = 0;
                    cumulativeFastDelta = 0;
                }

                cumulativeRefDelta = cumulativeRefDelta.add(refDeltaAmount.mul(CUMULATIVE_DELTA_PRECISION).div(prevRefPrice));
                cumulativeFastDelta = cumulativeFastDelta.add(fastDeltaAmount.mul(CUMULATIVE_DELTA_PRECISION).div(fastPrice));
            }

            if (cumulativeFastDelta > cumulativeRefDelta && cumulativeFastDelta.sub(cumulativeRefDelta) > maxCumulativeDeltaDiffs[_token]) {
                emit MaxCumulativeDeltaDiffExceeded(_token, refPrice, fastPrice, cumulativeRefDelta, cumulativeFastDelta);
            }

            _setPriceData(_token, refPrice, cumulativeRefDelta, cumulativeFastDelta);
            emit PriceData(_token, refPrice, fastPrice, cumulativeRefDelta, cumulativeFastDelta);
        }

        prices[_token] = _price;
        _emitPriceEvent(_fastPriceEvents, _token, _price);
    }

    function _setPriceData(address _token, uint256 _refPrice, uint256 _cumulativeRefDelta, uint256 _cumulativeFastDelta) private {
        require(_refPrice < MAX_REF_PRICE, "FastPriceFeed: invalid refPrice");
        // skip validation of block.timestamp, it should only be out of range after the year 2100
        require(_cumulativeRefDelta < MAX_CUMULATIVE_REF_DELTA, "FastPriceFeed: invalid cumulativeRefDelta");
        require(_cumulativeFastDelta < MAX_CUMULATIVE_FAST_DELTA, "FastPriceFeed: invalid cumulativeFastDelta");

        priceData[_token] = PriceDataItem(
            uint160(_refPrice),
            uint32(block.timestamp),
            uint32(_cumulativeRefDelta),
            uint32(_cumulativeFastDelta)
        );
    }

    function _emitPriceEvent(address _fastPriceEvents, address _token, uint256 _price) private {
        if (_fastPriceEvents == address(0)) {
            return;
        }

        IFastPriceEvents(_fastPriceEvents).emitPriceEvent(_token, _price);
    }

    function _setLastUpdatedValues(uint256 _timestamp) private returns (bool) {
        if (minBlockInterval > 0) {
            require(block.number.sub(lastUpdatedBlock) >= minBlockInterval, "FastPriceFeed: minBlockInterval not yet passed");
        }

        uint256 _maxTimeDeviation = maxTimeDeviation;
        require(_timestamp > block.timestamp.sub(_maxTimeDeviation), "FastPriceFeed: _timestamp below allowed range");
        require(_timestamp < block.timestamp.add(_maxTimeDeviation), "FastPriceFeed: _timestamp exceeds allowed range");

        // do not update prices if _timestamp is before the current lastUpdatedAt value
        if (_timestamp < lastUpdatedAt) {
            return false;
        }

        lastUpdatedAt = _timestamp;
        lastUpdatedBlock = block.number;

        return true;
    }
}

File 2 of 8 : Governable.sol
// SPDX-License-Identifier: MIT

pragma solidity 0.6.12;

contract Governable {
    address public gov;

    constructor() public {
        gov = msg.sender;
    }

    modifier onlyGov() {
        require(msg.sender == gov, "Governable: forbidden");
        _;
    }

    function setGov(address _gov) external onlyGov {
        gov = _gov;
    }
}

File 3 of 8 : IPositionRouter.sol
// SPDX-License-Identifier: MIT

pragma solidity 0.6.12;

interface IPositionRouter {
    function increasePositionRequestKeysStart() external returns (uint256);
    function decreasePositionRequestKeysStart() external returns (uint256);
    function executeIncreasePositions(uint256 _count, address payable _executionFeeReceiver) external;
    function executeDecreasePositions(uint256 _count, address payable _executionFeeReceiver) external;
}

File 4 of 8 : IVaultPriceFeed.sol
// SPDX-License-Identifier: MIT

pragma solidity 0.6.12;

interface IVaultPriceFeed {
    function adjustmentBasisPoints(address _token) external view returns (uint256);
    function isAdjustmentAdditive(address _token) external view returns (bool);
    function setAdjustment(address _token, bool _isAdditive, uint256 _adjustmentBps) external;
    function setUseV2Pricing(bool _useV2Pricing) external;
    function setIsAmmEnabled(bool _isEnabled) external;
    function setIsSecondaryPriceEnabled(bool _isEnabled) external;
    function setSpreadBasisPoints(address _token, uint256 _spreadBasisPoints) external;
    function setSpreadThresholdBasisPoints(uint256 _spreadThresholdBasisPoints) external;
    function setFavorPrimaryPrice(bool _favorPrimaryPrice) external;
    function setPriceSampleSpace(uint256 _priceSampleSpace) external;
    function setMaxStrictPriceDeviation(uint256 _maxStrictPriceDeviation) external;
    function getPrice(address _token, bool _maximise, bool _includeAmmPrice, bool _useSwapPricing) external view returns (uint256);
    function getAmmPrice(address _token) external view returns (uint256);
    function getLatestPrimaryPrice(address _token) external view returns (uint256);
    function getPrimaryPrice(address _token, bool _maximise) external view returns (uint256);
    function setTokenConfig(
        address _token,
        address _priceFeed,
        uint256 _priceDecimals,
        bool _isStrictStable
    ) external;
}

File 5 of 8 : SafeMath.sol
// SPDX-License-Identifier: MIT

pragma solidity 0.6.12;

/**
 * @dev Wrappers over Solidity's arithmetic operations with added overflow
 * checks.
 *
 * Arithmetic operations in Solidity wrap on overflow. This can easily result
 * in bugs, because programmers usually assume that an overflow raises an
 * error, which is the standard behavior in high level programming languages.
 * `SafeMath` restores this intuition by reverting the transaction when an
 * operation overflows.
 *
 * Using this library instead of the unchecked operations eliminates an entire
 * class of bugs, so it's recommended to use it always.
 */
library SafeMath {
    /**
     * @dev Returns the addition of two unsigned integers, reverting on
     * overflow.
     *
     * Counterpart to Solidity's `+` operator.
     *
     * Requirements:
     *
     * - Addition cannot overflow.
     */
    function add(uint256 a, uint256 b) internal pure returns (uint256) {
        uint256 c = a + b;
        require(c >= a, "SafeMath: addition overflow");

        return c;
    }

    /**
     * @dev Returns the subtraction of two unsigned integers, reverting on
     * overflow (when the result is negative).
     *
     * Counterpart to Solidity's `-` operator.
     *
     * Requirements:
     *
     * - Subtraction cannot overflow.
     */
    function sub(uint256 a, uint256 b) internal pure returns (uint256) {
        return sub(a, b, "SafeMath: subtraction overflow");
    }

    /**
     * @dev Returns the subtraction of two unsigned integers, reverting with custom message on
     * overflow (when the result is negative).
     *
     * Counterpart to Solidity's `-` operator.
     *
     * Requirements:
     *
     * - Subtraction cannot overflow.
     */
    function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
        require(b <= a, errorMessage);
        uint256 c = a - b;

        return c;
    }

    /**
     * @dev Returns the multiplication of two unsigned integers, reverting on
     * overflow.
     *
     * Counterpart to Solidity's `*` operator.
     *
     * Requirements:
     *
     * - Multiplication cannot overflow.
     */
    function mul(uint256 a, uint256 b) internal pure returns (uint256) {
        // Gas optimization: this is cheaper than requiring 'a' not being zero, but the
        // benefit is lost if 'b' is also tested.
        // See: https://github.com/OpenZeppelin/openzeppelin-contracts/pull/522
        if (a == 0) {
            return 0;
        }

        uint256 c = a * b;
        require(c / a == b, "SafeMath: multiplication overflow");

        return c;
    }

    /**
     * @dev Returns the integer division of two unsigned integers. Reverts on
     * division by zero. The result is rounded towards zero.
     *
     * Counterpart to Solidity's `/` operator. Note: this function uses a
     * `revert` opcode (which leaves remaining gas untouched) while Solidity
     * uses an invalid opcode to revert (consuming all remaining gas).
     *
     * Requirements:
     *
     * - The divisor cannot be zero.
     */
    function div(uint256 a, uint256 b) internal pure returns (uint256) {
        return div(a, b, "SafeMath: division by zero");
    }

    /**
     * @dev Returns the integer division of two unsigned integers. Reverts with custom message on
     * division by zero. The result is rounded towards zero.
     *
     * Counterpart to Solidity's `/` operator. Note: this function uses a
     * `revert` opcode (which leaves remaining gas untouched) while Solidity
     * uses an invalid opcode to revert (consuming all remaining gas).
     *
     * Requirements:
     *
     * - The divisor cannot be zero.
     */
    function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
        require(b > 0, errorMessage);
        uint256 c = a / b;
        // assert(a == b * c + a % b); // There is no case in which this doesn't hold

        return c;
    }

    /**
     * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo),
     * Reverts when dividing by zero.
     *
     * Counterpart to Solidity's `%` operator. This function uses a `revert`
     * opcode (which leaves remaining gas untouched) while Solidity uses an
     * invalid opcode to revert (consuming all remaining gas).
     *
     * Requirements:
     *
     * - The divisor cannot be zero.
     */
    function mod(uint256 a, uint256 b) internal pure returns (uint256) {
        return mod(a, b, "SafeMath: modulo by zero");
    }

    /**
     * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo),
     * Reverts with custom message when dividing by zero.
     *
     * Counterpart to Solidity's `%` operator. This function uses a `revert`
     * opcode (which leaves remaining gas untouched) while Solidity uses an
     * invalid opcode to revert (consuming all remaining gas).
     *
     * Requirements:
     *
     * - The divisor cannot be zero.
     */
    function mod(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
        require(b != 0, errorMessage);
        return a % b;
    }
}

File 6 of 8 : IFastPriceEvents.sol
// SPDX-License-Identifier: MIT

pragma solidity 0.6.12;

interface IFastPriceEvents {
    function emitPriceEvent(address _token, uint256 _price) external;
}

File 7 of 8 : IFastPriceFeed.sol
// SPDX-License-Identifier: MIT

pragma solidity 0.6.12;

interface IFastPriceFeed {
    function lastUpdatedAt() external view returns (uint256);
    function lastUpdatedBlock() external view returns (uint256);
    function setSigner(address _account, bool _isActive) external;
    function setUpdater(address _account, bool _isActive) external;
    function setPriceDuration(uint256 _priceDuration) external;
    function setMaxPriceUpdateDelay(uint256 _maxPriceUpdateDelay) external;
    function setSpreadBasisPointsIfInactive(uint256 _spreadBasisPointsIfInactive) external;
    function setSpreadBasisPointsIfChainError(uint256 _spreadBasisPointsIfChainError) external;
    function setMinBlockInterval(uint256 _minBlockInterval) external;
    function setIsSpreadEnabled(bool _isSpreadEnabled) external;
    function setMaxDeviationBasisPoints(uint256 _maxDeviationBasisPoints) external;
    function setMaxCumulativeDeltaDiffs(address[] memory _tokens,  uint256[] memory _maxCumulativeDeltaDiffs) external;
    function setPriceDataInterval(uint256 _priceDataInterval) external;
    function setVaultPriceFeed(address _vaultPriceFeed) external;
}

File 8 of 8 : ISecondaryPriceFeed.sol
// SPDX-License-Identifier: MIT

pragma solidity 0.6.12;

interface ISecondaryPriceFeed {
    function getPrice(address _token, uint256 _referencePrice, bool _maximise) external view returns (uint256);
}

Settings
{
  "evmVersion": "istanbul",
  "libraries": {},
  "metadata": {
    "bytecodeHash": "none",
    "useLiteralContent": true
  },
  "optimizer": {
    "enabled": true,
    "runs": 1
  },
  "remappings": [],
  "outputSelection": {
    "*": {
      "*": [
        "evm.bytecode",
        "evm.deployedBytecode",
        "devdoc",
        "userdoc",
        "metadata",
        "abi"
      ]
    }
  }
}

Contract Security Audit

Contract ABI

[{"inputs":[{"internalType":"uint256","name":"_priceDuration","type":"uint256"},{"internalType":"uint256","name":"_maxPriceUpdateDelay","type":"uint256"},{"internalType":"uint256","name":"_minBlockInterval","type":"uint256"},{"internalType":"uint256","name":"_maxDeviationBasisPoints","type":"uint256"},{"internalType":"address","name":"_fastPriceEvents","type":"address"},{"internalType":"address","name":"_tokenManager","type":"address"},{"internalType":"address","name":"_positionRouter","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"signer","type":"address"}],"name":"DisableFastPrice","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"signer","type":"address"}],"name":"EnableFastPrice","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"token","type":"address"},{"indexed":false,"internalType":"uint256","name":"refPrice","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"fastPrice","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"cumulativeRefDelta","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"cumulativeFastDelta","type":"uint256"}],"name":"MaxCumulativeDeltaDiffExceeded","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"token","type":"address"},{"indexed":false,"internalType":"uint256","name":"refPrice","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"fastPrice","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"cumulativeRefDelta","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"cumulativeFastDelta","type":"uint256"}],"name":"PriceData","type":"event"},{"inputs":[],"name":"BASIS_POINTS_DIVISOR","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"BITMASK_32","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"CUMULATIVE_DELTA_PRECISION","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"MAX_CUMULATIVE_FAST_DELTA","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"MAX_CUMULATIVE_REF_DELTA","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"MAX_PRICE_DURATION","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"MAX_REF_PRICE","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"PRICE_PRECISION","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"disableFastPrice","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"disableFastPriceVoteCount","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"disableFastPriceVotes","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"enableFastPrice","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"fastPriceEvents","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_token","type":"address"}],"name":"favorFastPrice","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_token","type":"address"},{"internalType":"uint256","name":"_refPrice","type":"uint256"},{"internalType":"bool","name":"_maximise","type":"bool"}],"name":"getPrice","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_token","type":"address"}],"name":"getPriceData","outputs":[{"internalType":"uint256","name":"","type":"uint256"},{"internalType":"uint256","name":"","type":"uint256"},{"internalType":"uint256","name":"","type":"uint256"},{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"gov","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_minAuthorizations","type":"uint256"},{"internalType":"address[]","name":"_signers","type":"address[]"},{"internalType":"address[]","name":"_updaters","type":"address[]"}],"name":"initialize","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"isInitialized","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"isSigner","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"isSpreadEnabled","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"isUpdater","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"lastUpdatedAt","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"lastUpdatedBlock","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"maxCumulativeDeltaDiffs","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"maxDeviationBasisPoints","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"maxPriceUpdateDelay","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"maxTimeDeviation","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"minAuthorizations","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"minBlockInterval","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"positionRouter","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"priceData","outputs":[{"internalType":"uint160","name":"refPrice","type":"uint160"},{"internalType":"uint32","name":"refTime","type":"uint32"},{"internalType":"uint32","name":"cumulativeRefDelta","type":"uint32"},{"internalType":"uint32","name":"cumulativeFastDelta","type":"uint32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"priceDataInterval","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"priceDuration","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"prices","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256[]","name":"_priceBitArray","type":"uint256[]"},{"internalType":"uint256","name":"_timestamp","type":"uint256"}],"name":"setCompactedPrices","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256[]","name":"_priceBitArray","type":"uint256[]"},{"internalType":"uint256","name":"_timestamp","type":"uint256"},{"internalType":"uint256","name":"_endIndexForIncreasePositions","type":"uint256"},{"internalType":"uint256","name":"_endIndexForDecreasePositions","type":"uint256"},{"internalType":"uint256","name":"_maxIncreasePositions","type":"uint256"},{"internalType":"uint256","name":"_maxDecreasePositions","type":"uint256"}],"name":"setCompactedPricesAndExecute","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_fastPriceEvents","type":"address"}],"name":"setFastPriceEvents","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_gov","type":"address"}],"name":"setGov","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bool","name":"_isSpreadEnabled","type":"bool"}],"name":"setIsSpreadEnabled","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_lastUpdatedAt","type":"uint256"}],"name":"setLastUpdatedAt","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address[]","name":"_tokens","type":"address[]"},{"internalType":"uint256[]","name":"_maxCumulativeDeltaDiffs","type":"uint256[]"}],"name":"setMaxCumulativeDeltaDiffs","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_maxDeviationBasisPoints","type":"uint256"}],"name":"setMaxDeviationBasisPoints","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_maxPriceUpdateDelay","type":"uint256"}],"name":"setMaxPriceUpdateDelay","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_maxTimeDeviation","type":"uint256"}],"name":"setMaxTimeDeviation","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_minAuthorizations","type":"uint256"}],"name":"setMinAuthorizations","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_minBlockInterval","type":"uint256"}],"name":"setMinBlockInterval","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_priceDataInterval","type":"uint256"}],"name":"setPriceDataInterval","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_priceDuration","type":"uint256"}],"name":"setPriceDuration","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address[]","name":"_tokens","type":"address[]"},{"internalType":"uint256[]","name":"_prices","type":"uint256[]"},{"internalType":"uint256","name":"_timestamp","type":"uint256"}],"name":"setPrices","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_priceBits","type":"uint256"},{"internalType":"uint256","name":"_timestamp","type":"uint256"}],"name":"setPricesWithBits","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_priceBits","type":"uint256"},{"internalType":"uint256","name":"_timestamp","type":"uint256"},{"internalType":"uint256","name":"_endIndexForIncreasePositions","type":"uint256"},{"internalType":"uint256","name":"_endIndexForDecreasePositions","type":"uint256"},{"internalType":"uint256","name":"_maxIncreasePositions","type":"uint256"},{"internalType":"uint256","name":"_maxDecreasePositions","type":"uint256"}],"name":"setPricesWithBitsAndExecute","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_account","type":"address"},{"internalType":"bool","name":"_isActive","type":"bool"}],"name":"setSigner","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_spreadBasisPointsIfChainError","type":"uint256"}],"name":"setSpreadBasisPointsIfChainError","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_spreadBasisPointsIfInactive","type":"uint256"}],"name":"setSpreadBasisPointsIfInactive","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_tokenManager","type":"address"}],"name":"setTokenManager","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address[]","name":"_tokens","type":"address[]"},{"internalType":"uint256[]","name":"_tokenPrecisions","type":"uint256[]"}],"name":"setTokens","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_account","type":"address"},{"internalType":"bool","name":"_isActive","type":"bool"}],"name":"setUpdater","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_vaultPriceFeed","type":"address"}],"name":"setVaultPriceFeed","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"spreadBasisPointsIfChainError","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"spreadBasisPointsIfInactive","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"tokenManager","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"tokenPrecisions","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"tokens","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"vaultPriceFeed","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"}]

60806040526000805460ff60a81b1916815560105534801561002057600080fd5b506040516200303338038062003033833981810160405260e081101561004557600080fd5b508051602082015160408301516060840151608085015160a086015160c090960151600080546001600160a01b0319163317905594959394929391929091906107088711156100c65760405162461bcd60e51b81526004018080602001828103825260258152602001806200300e6025913960400191505060405180910390fd5b600796909655600894909455600b92909255600e55600280546001600160a01b039283166001600160a01b031991821617909155600380549383169382169390931790925560048054919093169116179055612ee680620001286000396000f3fe608060405234801561001057600080fd5b50600436106102eb5760003560e01c806303b04936146102f057806303cd25711461032a57806303f4d7dc146103445780630604ddea146103e95780630e9272ea146103f1578063126082cf1461041557806312d43a511461041d57806314dd2dce14610425578063162ac4e01461044257806317835d1c146104685780631a1533911461048b578063238aafb7146104b9578063287800c9146104df5780632a709b14146104e75780632e9cd94b146104ef57806331cb61051461050c578063392e53cd1461053a5780633aa08f861461054257806344c231931461054a5780634bd66c1c146103e95780634c0e31c8146105675780634d11fb4a1461068a5780634f64b2be146106a75780634fdfb086146106c457806354aea127146106ea578063574ec1be146106f257806361ef161f1461072d578063668d3d6514610735578063695d41841461073d5780636c56fd05146107455780636ccd47c41461076b578063715c75361461077357806372279ba11461077b57806374bfed89146107c7578063776d16c1146107cf578063782661bc146107ec5780637cb2b79c146109115780637df73e27146109375780637fbc79c61461095d5780637fece36814610a87578063807c9782146103e957806382553aad14610abb5780638b7677f414610ad857806395082d2514610af5578063a2b47c1614610afd578063a374242514610b05578063a6eca89614610b2b578063b0a2566614610b33578063b216b8ef14610b3b578063b3606b5614610bf3578063b70c7b7014610bfb578063c8390a4814610c18578063c84a912414610d3b578063cab44b7614610d43578063ce98dfa814610da1578063cfad57a214610dc0578063cfed246b14610de6578063d6a153f114610e0c578063d925351a14610e29578063de0d1b9414610e46578063dfb481c914610e63578063e64559ad14610e6b578063e68a22c014610e73578063eeaa783a14610e7b578063f90ce5ba14610e83575b600080fd5b6103166004803603602081101561030657600080fd5b50356001600160a01b0316610e8b565b604080519115158252519081900360200190f35b610332610ea0565b60408051918252519081900360200190f35b6103e76004803603604081101561035a57600080fd5b810190602081018135600160201b81111561037457600080fd5b82018360208201111561038657600080fd5b803590602001918460208302840111600160201b831117156103a757600080fd5b9190808060200260200160405190810160405280939291908181526020018383602002808284376000920191909152509295505091359250610ea6915050565b005b610332610f06565b6103f9610f0e565b604080516001600160a01b039092168252519081900360200190f35b610332610f1d565b6103f9610f23565b6103e76004803603602081101561043b57600080fd5b5035610f32565b6103e76004803603602081101561045857600080fd5b50356001600160a01b0316610f84565b6103e76004803603604081101561047e57600080fd5b5080359060200135610ff3565b6103e7600480360360408110156104a157600080fd5b506001600160a01b038135169060200135151561104f565b6103e7600480360360208110156104cf57600080fd5b50356001600160a01b03166110c7565b610332611136565b6103f961113c565b6103e76004803603602081101561050557600080fd5b503561114b565b6103e76004803603604081101561052257600080fd5b506001600160a01b038135169060200135151561119d565b610316611215565b610332611225565b6103e76004803603602081101561056057600080fd5b503561122b565b6103e76004803603604081101561057d57600080fd5b810190602081018135600160201b81111561059757600080fd5b8201836020820111156105a957600080fd5b803590602001918460208302840111600160201b831117156105ca57600080fd5b9190808060200260200160405190810160405280939291908181526020018383602002808284376000920191909152509295949360208101935035915050600160201b81111561061957600080fd5b82018360208201111561062b57600080fd5b803590602001918460208302840111600160201b8311171561064c57600080fd5b9190808060200260200160405190810160405280939291908181526020018383602002808284376000920191909152509295506112be945050505050565b610332600480360360208110156106a057600080fd5b503561136e565b6103f9600480360360208110156106bd57600080fd5b503561138c565b610316600480360360208110156106da57600080fd5b50356001600160a01b03166113b3565b6103326113c8565b6103e7600480360360c081101561070857600080fd5b5080359060208101359060408101359060608101359060808101359060a001356113ce565b6103f96115dd565b6103326115ec565b6103166115f2565b6103166004803603602081101561075b57600080fd5b50356001600160a01b0316611602565b6103e761168d565b6103326117a0565b6107a16004803603602081101561079157600080fd5b50356001600160a01b03166117a6565b604080519485526020850193909352838301919091526060830152519081900360800190f35b610332611824565b6103e7600480360360208110156107e557600080fd5b503561182a565b6103e76004803603606081101561080257600080fd5b810190602081018135600160201b81111561081c57600080fd5b82018360208201111561082e57600080fd5b803590602001918460208302840111600160201b8311171561084f57600080fd5b9190808060200260200160405190810160405280939291908181526020018383602002808284376000920191909152509295949360208101935035915050600160201b81111561089e57600080fd5b8201836020820111156108b057600080fd5b803590602001918460208302840111600160201b831117156108d157600080fd5b919080806020026020016040519081016040528093929190818152602001838360200280828437600092019190915250929550509135925061187c915050565b6103e76004803603602081101561092757600080fd5b50356001600160a01b031661194a565b6103166004803603602081101561094d57600080fd5b50356001600160a01b03166119b9565b6103e76004803603606081101561097357600080fd5b81359190810190604081016020820135600160201b81111561099457600080fd5b8201836020820111156109a657600080fd5b803590602001918460208302840111600160201b831117156109c757600080fd5b9190808060200260200160405190810160405280939291908181526020018383602002808284376000920191909152509295949360208101935035915050600160201b811115610a1657600080fd5b820183602082011115610a2857600080fd5b803590602001918460208302840111600160201b83111715610a4957600080fd5b9190808060200260200160405190810160405280939291908181526020018383602002808284376000920191909152509295506119ce945050505050565b61033260048036036060811015610a9d57600080fd5b506001600160a01b0381351690602081013590604001351515611b27565b6103e760048036036020811015610ad157600080fd5b5035611cb3565b6103e760048036036020811015610aee57600080fd5b5035611d05565b610332611d57565b610332611d67565b61033260048036036020811015610b1b57600080fd5b50356001600160a01b0316611d6e565b610332611d80565b610332611d86565b6103e7600480360360c0811015610b5157600080fd5b810190602081018135600160201b811115610b6b57600080fd5b820183602082011115610b7d57600080fd5b803590602001918460208302840111600160201b83111715610b9e57600080fd5b9190808060200260200160405190810160405280939291908181526020018383602002808284376000920191909152509295505082359350505060208101359060408101359060608101359060800135611d8c565b610332611de8565b6103e760048036036020811015610c1157600080fd5b5035611dee565b6103e760048036036040811015610c2e57600080fd5b810190602081018135600160201b811115610c4857600080fd5b820183602082011115610c5a57600080fd5b803590602001918460208302840111600160201b83111715610c7b57600080fd5b9190808060200260200160405190810160405280939291908181526020018383602002808284376000920191909152509295949360208101935035915050600160201b811115610cca57600080fd5b820183602082011115610cdc57600080fd5b803590602001918460208302840111600160201b83111715610cfd57600080fd5b919080806020026020016040519081016040528093929190818152602001838360200280828437600092019190915250929550611e40945050505050565b6103e7611f0a565b610d6960048036036020811015610d5957600080fd5b50356001600160a01b0316612021565b604080516001600160a01b03909516855263ffffffff9384166020860152918316848301529091166060830152519081900360800190f35b6103e760048036036020811015610db757600080fd5b50351515612060565b6103e760048036036020811015610dd657600080fd5b50356001600160a01b03166120cb565b61033260048036036020811015610dfc57600080fd5b50356001600160a01b031661213a565b6103e760048036036020811015610e2257600080fd5b503561214c565b6103e760048036036020811015610e3f57600080fd5b503561219e565b6103e760048036036020811015610e5c57600080fd5b50356121f0565b610332612242565b610332612248565b61033261224e565b6103f9612259565b610332612268565b60166020526000908152604090205460ff1681565b60075481565b3360009081526011602052604090205460ff16610ef8576040805162461bcd60e51b81526020600482015260186024820152600080516020612dc4833981519152604482015290519081900360640190fd5b610f02828261226e565b5050565b63ffffffff81565b6002546001600160a01b031681565b61271081565b6000546001600160a01b031681565b6000546001600160a01b03163314610f7f576040805162461bcd60e51b81526020600482015260156024820152600080516020612da4833981519152604482015290519081900360640190fd5b600555565b6000546001600160a01b03163314610fd1576040805162461bcd60e51b81526020600482015260156024820152600080516020612da4833981519152604482015290519081900360640190fd5b600280546001600160a01b0319166001600160a01b0392909216919091179055565b3360009081526011602052604090205460ff16611045576040805162461bcd60e51b81526020600482015260186024820152600080516020612dc4833981519152604482015290519081900360640190fd5b610f02828261238b565b6000546001600160a01b0316331461109c576040805162461bcd60e51b81526020600482015260156024820152600080516020612da4833981519152604482015290519081900360640190fd5b6001600160a01b03919091166000908152601160205260409020805460ff1916911515919091179055565b6000546001600160a01b03163314611114576040805162461bcd60e51b81526020600482015260156024820152600080516020612da4833981519152604482015290519081900360640190fd5b600180546001600160a01b0319166001600160a01b0392909216919091179055565b600f5481565b6003546001600160a01b031681565b6000546001600160a01b03163314611198576040805162461bcd60e51b81526020600482015260156024820152600080516020612da4833981519152604482015290519081900360640190fd5b600d55565b6000546001600160a01b031633146111ea576040805162461bcd60e51b81526020600482015260156024820152600080516020612da4833981519152604482015290519081900360640190fd5b6001600160a01b03919091166000908152601560205260409020805460ff1916911515919091179055565b600054600160a01b900460ff1681565b600c5481565b6000546001600160a01b03163314611278576040805162461bcd60e51b81526020600482015260156024820152600080516020612da4833981519152604482015290519081900360640190fd5b6107088111156112b95760405162461bcd60e51b8152600401808060200182810382526025815260200180612d556025913960400191505060405180910390fd5b600755565b6000546001600160a01b0316331461130b576040805162461bcd60e51b81526020600482015260156024820152600080516020612da4833981519152604482015290519081900360640190fd5b60005b825181101561136957600083828151811061132557fe5b6020026020010151905082828151811061133b57fe5b6020908102919091018101516001600160a01b0390921660009081526014909152604090205560010161130e565b505050565b6018818154811061137b57fe5b600091825260209091200154905081565b6017818154811061139957fe5b6000918252602090912001546001600160a01b0316905081565b60116020526000908152604090205460ff1681565b60055481565b3360009081526011602052604090205460ff16611420576040805162461bcd60e51b81526020600482015260186024820152600080516020612dc4833981519152604482015290519081900360640190fd5b61142a868661238b565b60048054604080516304dabc3160e51b815290516001600160a01b03909216926000926114aa9287928692639b57862092808301926020929182900301818987803b15801561147857600080fd5b505af115801561148c573d6000803e3d6000fd5b505050506040513d60208110156114a257600080fd5b505190612461565b905060006114ed84846001600160a01b0316639b5786206040518163ffffffff1660e01b8152600401602060405180830381600087803b15801561147857600080fd5b9050818711156114fb578196505b80861115611507578095505b60408051629a208160e81b81526004810189905233602482015290516001600160a01b03851691639a20810091604480830192600092919082900301818387803b15801561155457600080fd5b505af1158015611568573d6000803e3d6000fd5b50506040805163f3883d8b60e01b8152600481018a905233602482015290516001600160a01b038716935063f3883d8b9250604480830192600092919082900301818387803b1580156115ba57600080fd5b505af11580156115ce573d6000803e3d6000fd5b50505050505050505050505050565b6004546001600160a01b031681565b61070881565b600054600160a81b900460ff1681565b60008054600160a81b900460ff161561161d57506000611688565b600f546010541061163057506000611688565b60008061163c846117a6565b935093505050818111801561167157506001600160a01b03841660009081526014602052604090205461166f82846124c2565b115b1561168157600092505050611688565b6001925050505b919050565b3360009081526015602052604090205460ff166116df576040805162461bcd60e51b81526020600482015260186024820152600080516020612dc4833981519152604482015290519081900360640190fd5b3360009081526016602052604090205460ff16611743576040805162461bcd60e51b815260206004820152601e60248201527f466173745072696365466565643a20616c726561647920656e61626c65640000604482015290519081900360640190fd5b336000908152601660205260409020805460ff191690556010546117689060016124c2565b6010556040805133815290517f9fe0c305c33aa92757a537936872a60be0d91549a4303cc99fd8b7fce8a002759181900360200190a1565b600e5481565b6000806000806117b4612c4d565b505050506001600160a01b039182166000908152601360209081526040918290208251608081018452905494851680825263ffffffff600160a01b87048116938301849052600160c01b87048116948301859052600160e01b909604909516606090910181905293949093919250565b60095481565b6000546001600160a01b03163314611877576040805162461bcd60e51b81526020600482015260156024820152600080516020612da4833981519152604482015290519081900360640190fd5b600c55565b3360009081526011602052604090205460ff166118ce576040805162461bcd60e51b81526020600482015260186024820152600080516020612dc4833981519152604482015290519081900360640190fd5b60006118d982612504565b90508015611944576002546001546001600160a01b03918216911660005b865181101561194057600087828151811061190e57fe5b602002602001015190506119378188848151811061192857fe5b60200260200101518587612610565b506001016118f7565b5050505b50505050565b6000546001600160a01b03163314611997576040805162461bcd60e51b81526020600482015260156024820152600080516020612da4833981519152604482015290519081900360640190fd5b600380546001600160a01b0319166001600160a01b0392909216919091179055565b60156020526000908152604090205460ff1681565b6000546001600160a01b03163314611a1b576040805162461bcd60e51b81526020600482015260156024820152600080516020612da4833981519152604482015290519081900360640190fd5b600054600160a01b900460ff1615611a645760405162461bcd60e51b8152600401808060200182810382526022815260200180612eb86022913960400191505060405180910390fd5b6000805460ff60a01b1916600160a01b178155600f8490555b8251811015611ad0576000838281518110611a9457fe5b6020908102919091018101516001600160a01b03166000908152601590915260409020805460ff19166001908117909155919091019050611a7d565b5060005b8151811015611944576000828281518110611aeb57fe5b6020908102919091018101516001600160a01b03166000908152601190915260409020805460ff19166001908117909155919091019050611ad4565b6000611b4060085460055461246190919063ffffffff16565b421115611ba1578115611b8157611b7a612710611b74611b6d600a5461271061246190919063ffffffff16565b86906128a5565b906128fe565b9050611cac565b611b7a612710611b74611b6d600a546127106124c290919063ffffffff16565b600754600554611bb091612461565b421115611bfd578115611bdd57611b7a612710611b74611b6d60095461271061246190919063ffffffff16565b611b7a612710611b74611b6d6009546127106124c290919063ffffffff16565b6001600160a01b03841660009081526012602052604090205480611c245783915050611cac565b6000818511611c3c57611c3782866124c2565b611c46565b611c4685836124c2565b9050611c5885611b74836127106128a5565b90506000611c6587611602565b1580611c725750600e5482115b90508015611ca6578415611c9957828611611c8d5782611c8f565b855b9350505050611cac565b828610611c8d5782611c8f565b50909150505b9392505050565b6000546001600160a01b03163314611d00576040805162461bcd60e51b81526020600482015260156024820152600080516020612da4833981519152604482015290519081900360640190fd5b600e55565b6000546001600160a01b03163314611d52576040805162461bcd60e51b81526020600482015260156024820152600080516020612da4833981519152604482015290519081900360640190fd5b600855565b68327cb2734119d3b7a9601e1b81565b6298968081565b60146020526000908152604090205481565b600a5481565b60105481565b3360009081526011602052604090205460ff16611dde576040805162461bcd60e51b81526020600482015260186024820152600080516020612dc4833981519152604482015290519081900360640190fd5b61142a868661226e565b600b5481565b6000546001600160a01b03163314611e3b576040805162461bcd60e51b81526020600482015260156024820152600080516020612da4833981519152604482015290519081900360640190fd5b600955565b6000546001600160a01b03163314611e8d576040805162461bcd60e51b81526020600482015260156024820152600080516020612da4833981519152604482015290519081900360640190fd5b8051825114611ee3576040805162461bcd60e51b815260206004820152601e60248201527f466173745072696365466565643a20696e76616c6964206c656e677468730000604482015290519081900360640190fd5b8151611ef6906017906020850190612c74565b508051611369906018906020840190612cd9565b3360009081526015602052604090205460ff16611f5c576040805162461bcd60e51b81526020600482015260186024820152600080516020612dc4833981519152604482015290519081900360640190fd5b3360009081526016602052604090205460ff1615611fc0576040805162461bcd60e51b815260206004820152601c60248201527b11985cdd141c9a58d9519959590e88185b1c9958591e481d9bdd195960221b604482015290519081900360640190fd5b336000908152601660205260409020805460ff19166001908117909155601054611fe991612461565b6010556040805133815290517f4c0c5fabf50e808e3bc8d19577d305e3a7163eea7e8a74a50caa8896694cd44b9181900360200190a1565b6013602052600090815260409020546001600160a01b0381169063ffffffff600160a01b8204811691600160c01b8104821691600160e01b9091041684565b6000546001600160a01b031633146120ad576040805162461bcd60e51b81526020600482015260156024820152600080516020612da4833981519152604482015290519081900360640190fd5b60008054911515600160a81b0260ff60a81b19909216919091179055565b6000546001600160a01b03163314612118576040805162461bcd60e51b81526020600482015260156024820152600080516020612da4833981519152604482015290519081900360640190fd5b600080546001600160a01b0319166001600160a01b0392909216919091179055565b60126020526000908152604090205481565b6000546001600160a01b03163314612199576040805162461bcd60e51b81526020600482015260156024820152600080516020612da4833981519152604482015290519081900360640190fd5b600b55565b6003546001600160a01b031633146121eb576040805162461bcd60e51b81526020600482015260186024820152600080516020612dc4833981519152604482015290519081900360640190fd5b600f55565b6000546001600160a01b0316331461223d576040805162461bcd60e51b81526020600482015260156024820152600080516020612da4833981519152604482015290519081900360640190fd5b600a55565b600d5481565b60085481565b6001600160a01b0381565b6001546001600160a01b031681565b60065481565b600061227982612504565b90508015611369576002546001546001600160a01b03918216911660005b85518110156123835760008682815181106122ae57fe5b6020026020010151905060005b6008811015612379576017546008840282019081106122e05750505050505050610f02565b60178054602084029185831c63ffffffff16916000919060088902870190811061230657fe5b6000918252602082200154601880546001600160a01b0390921693509060088a02880190811061233257fe5b6000918252602082200154915061235982611b748668327cb2734119d3b7a9601e1b6128a5565b905061236783828c8e612610565b5050600190940193506122bb92505050565b5050600101612297565b505050505050565b600061239682612504565b90508015611369576002546001546001600160a01b03918216911660005b600881101561238357601754819081106123d2575050505050610f02565b60178054602084029189831c63ffffffff169160009190869081106123f357fe5b6000918252602082200154601880546001600160a01b039092169350908790811061241a57fe5b6000918252602082200154915061244182611b748668327cb2734119d3b7a9601e1b6128a5565b905061244f83828a8c612610565b5050600190940193506123b492505050565b6000828201838110156124b9576040805162461bcd60e51b815260206004820152601b60248201527a536166654d6174683a206164646974696f6e206f766572666c6f7760281b604482015290519081900360640190fd5b90505b92915050565b60006124b983836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f77000081525061293d565b600b546000901561255d57600b546006546125209043906124c2565b101561255d5760405162461bcd60e51b815260040180806020018281038252602e815260200180612e61602e913960400191505060405180910390fd5b600c5461256a42826124c2565b83116125a75760405162461bcd60e51b815260040180806020018281038252602d815260200180612e34602d913960400191505060405180910390fd5b6125b14282612461565b83106125ee5760405162461bcd60e51b815260040180806020018281038252602f815260200180612de4602f913960400191505060405180910390fd5b600554831015612602576000915050611688565b505060055543600655600190565b6001600160a01b0382161561287f576000826001600160a01b03166356bf9de4866040518263ffffffff1660e01b815260040180826001600160a01b0316815260200191505060206040518083038186803b15801561266e57600080fd5b505afa158015612682573d6000803e3d6000fd5b505050506040513d602081101561269857600080fd5b50516001600160a01b0386166000908152601260205260408120549192508080806126c28a6117a6565b935093509350935060008411156127895760008487116126eb576126e685886124c2565b6126f5565b6126f587866124c2565b905060008a871161270f5761270a8b886124c2565b612719565b612719878c6124c2565b9050612730600d54426128fe90919063ffffffff16565b600d5461273e9087906128fe565b1461274c5760009350600092505b61276761276087611b7485629896806128a5565b8590612461565b935061278461277d88611b7484629896806128a5565b8490612461565b925050505b81811180156127b857506001600160a01b038a166000908152601460205260409020546127b682846124c2565b115b1561281557604080516001600160a01b038c16815260208101889052808201879052606081018490526080810183905290517fe582322b389ad06b2bbf619cd6da3f16a288ec873ea0fa6df4d72f3d9480b4479181900360a00190a15b6128218a8784846129d4565b604080516001600160a01b038c16815260208101889052808201879052606081018490526080810183905290517f23b9387f81fca646aac1dc4487ede045c65f5f7445482906565f01e05afdb3a89181900360a00190a15050505050505b6001600160a01b0384166000908152601260205260409020839055611944818585612b6a565b6000826128b4575060006124bc565b828202828482816128c157fe5b04146124b95760405162461bcd60e51b8152600401808060200182810382526021815260200180612e136021913960400191505060405180910390fd5b60006124b983836040518060400160405280601a815260200179536166654d6174683a206469766973696f6e206279207a65726f60301b815250612be8565b600081848411156129cc5760405162461bcd60e51b81526004018080602001828103825283818151815260200191508051906020019080838360005b83811015612991578181015183820152602001612979565b50505050905090810190601f1680156129be5780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b505050900390565b6001600160a01b038310612a2f576040805162461bcd60e51b815260206004820152601f60248201527f466173745072696365466565643a20696e76616c696420726566507269636500604482015290519081900360640190fd5b63ffffffff8210612a715760405162461bcd60e51b8152600401808060200182810382526029815260200180612e8f6029913960400191505060405180910390fd5b63ffffffff8110612ab35760405162461bcd60e51b815260040180806020018281038252602a815260200180612d7a602a913960400191505060405180910390fd5b604080516080810182526001600160a01b03948516815263ffffffff4281166020808401918252958216838501908152948216606084019081529787166000908152601390965292909420905181549251935196518516600160e01b026001600160e01b03978616600160c01b0263ffffffff60c01b1995909616600160a01b0263ffffffff60a01b19929097166001600160a01b0319909416939093171694909417919091169190911792909216919091179055565b6001600160a01b038316612b7d57611369565b826001600160a01b031663e0409c7183836040518363ffffffff1660e01b815260040180836001600160a01b0316815260200182815260200192505050600060405180830381600087803b158015612bd457600080fd5b505af1158015611940573d6000803e3d6000fd5b60008183612c375760405162461bcd60e51b8152602060048201818152835160248401528351909283926044909101919085019080838360008315612991578181015183820152602001612979565b506000838581612c4357fe5b0495945050505050565b60408051608081018252600080825260208201819052918101829052606081019190915290565b828054828255906000526020600020908101928215612cc9579160200282015b82811115612cc957825182546001600160a01b0319166001600160a01b03909116178255602090920191600190910190612c94565b50612cd5929150612d20565b5090565b828054828255906000526020600020908101928215612d14579160200282015b82811115612d14578251825591602001919060010190612cf9565b50612cd5929150612d3f565b5b80821115612cd55780546001600160a01b0319168155600101612d21565b5b80821115612cd55760008155600101612d4056fe466173745072696365466565643a20696e76616c6964205f70726963654475726174696f6e466173745072696365466565643a20696e76616c69642063756d756c61746976654661737444656c7461476f7665726e61626c653a20666f7262696464656e0000000000000000000000466173745072696365466565643a20666f7262696464656e0000000000000000466173745072696365466565643a205f74696d657374616d70206578636565647320616c6c6f7765642072616e6765536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f77466173745072696365466565643a205f74696d657374616d702062656c6f7720616c6c6f7765642072616e6765466173745072696365466565643a206d696e426c6f636b496e74657276616c206e6f742079657420706173736564466173745072696365466565643a20696e76616c69642063756d756c617469766552656644656c7461466173745072696365466565643a20616c726561647920696e697469616c697a6564a164736f6c634300060c000a466173745072696365466565643a20696e76616c6964205f70726963654475726174696f6e000000000000000000000000000000000000000000000000000000000000012c0000000000000000000000000000000000000000000000000000000000000e10000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002ee0000000000000000000000006dfa72d904d9c4bb526a1f31a4d9c4f2fe18b32a000000000000000000000000904a08be742bd5bc6ad10f0924f06b0b23d1175c0000000000000000000000005d44a69ce8ee304b97391d29c4352e66ec8b9f15

Deployed Bytecode

0x608060405234801561001057600080fd5b50600436106102eb5760003560e01c806303b04936146102f057806303cd25711461032a57806303f4d7dc146103445780630604ddea146103e95780630e9272ea146103f1578063126082cf1461041557806312d43a511461041d57806314dd2dce14610425578063162ac4e01461044257806317835d1c146104685780631a1533911461048b578063238aafb7146104b9578063287800c9146104df5780632a709b14146104e75780632e9cd94b146104ef57806331cb61051461050c578063392e53cd1461053a5780633aa08f861461054257806344c231931461054a5780634bd66c1c146103e95780634c0e31c8146105675780634d11fb4a1461068a5780634f64b2be146106a75780634fdfb086146106c457806354aea127146106ea578063574ec1be146106f257806361ef161f1461072d578063668d3d6514610735578063695d41841461073d5780636c56fd05146107455780636ccd47c41461076b578063715c75361461077357806372279ba11461077b57806374bfed89146107c7578063776d16c1146107cf578063782661bc146107ec5780637cb2b79c146109115780637df73e27146109375780637fbc79c61461095d5780637fece36814610a87578063807c9782146103e957806382553aad14610abb5780638b7677f414610ad857806395082d2514610af5578063a2b47c1614610afd578063a374242514610b05578063a6eca89614610b2b578063b0a2566614610b33578063b216b8ef14610b3b578063b3606b5614610bf3578063b70c7b7014610bfb578063c8390a4814610c18578063c84a912414610d3b578063cab44b7614610d43578063ce98dfa814610da1578063cfad57a214610dc0578063cfed246b14610de6578063d6a153f114610e0c578063d925351a14610e29578063de0d1b9414610e46578063dfb481c914610e63578063e64559ad14610e6b578063e68a22c014610e73578063eeaa783a14610e7b578063f90ce5ba14610e83575b600080fd5b6103166004803603602081101561030657600080fd5b50356001600160a01b0316610e8b565b604080519115158252519081900360200190f35b610332610ea0565b60408051918252519081900360200190f35b6103e76004803603604081101561035a57600080fd5b810190602081018135600160201b81111561037457600080fd5b82018360208201111561038657600080fd5b803590602001918460208302840111600160201b831117156103a757600080fd5b9190808060200260200160405190810160405280939291908181526020018383602002808284376000920191909152509295505091359250610ea6915050565b005b610332610f06565b6103f9610f0e565b604080516001600160a01b039092168252519081900360200190f35b610332610f1d565b6103f9610f23565b6103e76004803603602081101561043b57600080fd5b5035610f32565b6103e76004803603602081101561045857600080fd5b50356001600160a01b0316610f84565b6103e76004803603604081101561047e57600080fd5b5080359060200135610ff3565b6103e7600480360360408110156104a157600080fd5b506001600160a01b038135169060200135151561104f565b6103e7600480360360208110156104cf57600080fd5b50356001600160a01b03166110c7565b610332611136565b6103f961113c565b6103e76004803603602081101561050557600080fd5b503561114b565b6103e76004803603604081101561052257600080fd5b506001600160a01b038135169060200135151561119d565b610316611215565b610332611225565b6103e76004803603602081101561056057600080fd5b503561122b565b6103e76004803603604081101561057d57600080fd5b810190602081018135600160201b81111561059757600080fd5b8201836020820111156105a957600080fd5b803590602001918460208302840111600160201b831117156105ca57600080fd5b9190808060200260200160405190810160405280939291908181526020018383602002808284376000920191909152509295949360208101935035915050600160201b81111561061957600080fd5b82018360208201111561062b57600080fd5b803590602001918460208302840111600160201b8311171561064c57600080fd5b9190808060200260200160405190810160405280939291908181526020018383602002808284376000920191909152509295506112be945050505050565b610332600480360360208110156106a057600080fd5b503561136e565b6103f9600480360360208110156106bd57600080fd5b503561138c565b610316600480360360208110156106da57600080fd5b50356001600160a01b03166113b3565b6103326113c8565b6103e7600480360360c081101561070857600080fd5b5080359060208101359060408101359060608101359060808101359060a001356113ce565b6103f96115dd565b6103326115ec565b6103166115f2565b6103166004803603602081101561075b57600080fd5b50356001600160a01b0316611602565b6103e761168d565b6103326117a0565b6107a16004803603602081101561079157600080fd5b50356001600160a01b03166117a6565b604080519485526020850193909352838301919091526060830152519081900360800190f35b610332611824565b6103e7600480360360208110156107e557600080fd5b503561182a565b6103e76004803603606081101561080257600080fd5b810190602081018135600160201b81111561081c57600080fd5b82018360208201111561082e57600080fd5b803590602001918460208302840111600160201b8311171561084f57600080fd5b9190808060200260200160405190810160405280939291908181526020018383602002808284376000920191909152509295949360208101935035915050600160201b81111561089e57600080fd5b8201836020820111156108b057600080fd5b803590602001918460208302840111600160201b831117156108d157600080fd5b919080806020026020016040519081016040528093929190818152602001838360200280828437600092019190915250929550509135925061187c915050565b6103e76004803603602081101561092757600080fd5b50356001600160a01b031661194a565b6103166004803603602081101561094d57600080fd5b50356001600160a01b03166119b9565b6103e76004803603606081101561097357600080fd5b81359190810190604081016020820135600160201b81111561099457600080fd5b8201836020820111156109a657600080fd5b803590602001918460208302840111600160201b831117156109c757600080fd5b9190808060200260200160405190810160405280939291908181526020018383602002808284376000920191909152509295949360208101935035915050600160201b811115610a1657600080fd5b820183602082011115610a2857600080fd5b803590602001918460208302840111600160201b83111715610a4957600080fd5b9190808060200260200160405190810160405280939291908181526020018383602002808284376000920191909152509295506119ce945050505050565b61033260048036036060811015610a9d57600080fd5b506001600160a01b0381351690602081013590604001351515611b27565b6103e760048036036020811015610ad157600080fd5b5035611cb3565b6103e760048036036020811015610aee57600080fd5b5035611d05565b610332611d57565b610332611d67565b61033260048036036020811015610b1b57600080fd5b50356001600160a01b0316611d6e565b610332611d80565b610332611d86565b6103e7600480360360c0811015610b5157600080fd5b810190602081018135600160201b811115610b6b57600080fd5b820183602082011115610b7d57600080fd5b803590602001918460208302840111600160201b83111715610b9e57600080fd5b9190808060200260200160405190810160405280939291908181526020018383602002808284376000920191909152509295505082359350505060208101359060408101359060608101359060800135611d8c565b610332611de8565b6103e760048036036020811015610c1157600080fd5b5035611dee565b6103e760048036036040811015610c2e57600080fd5b810190602081018135600160201b811115610c4857600080fd5b820183602082011115610c5a57600080fd5b803590602001918460208302840111600160201b83111715610c7b57600080fd5b9190808060200260200160405190810160405280939291908181526020018383602002808284376000920191909152509295949360208101935035915050600160201b811115610cca57600080fd5b820183602082011115610cdc57600080fd5b803590602001918460208302840111600160201b83111715610cfd57600080fd5b919080806020026020016040519081016040528093929190818152602001838360200280828437600092019190915250929550611e40945050505050565b6103e7611f0a565b610d6960048036036020811015610d5957600080fd5b50356001600160a01b0316612021565b604080516001600160a01b03909516855263ffffffff9384166020860152918316848301529091166060830152519081900360800190f35b6103e760048036036020811015610db757600080fd5b50351515612060565b6103e760048036036020811015610dd657600080fd5b50356001600160a01b03166120cb565b61033260048036036020811015610dfc57600080fd5b50356001600160a01b031661213a565b6103e760048036036020811015610e2257600080fd5b503561214c565b6103e760048036036020811015610e3f57600080fd5b503561219e565b6103e760048036036020811015610e5c57600080fd5b50356121f0565b610332612242565b610332612248565b61033261224e565b6103f9612259565b610332612268565b60166020526000908152604090205460ff1681565b60075481565b3360009081526011602052604090205460ff16610ef8576040805162461bcd60e51b81526020600482015260186024820152600080516020612dc4833981519152604482015290519081900360640190fd5b610f02828261226e565b5050565b63ffffffff81565b6002546001600160a01b031681565b61271081565b6000546001600160a01b031681565b6000546001600160a01b03163314610f7f576040805162461bcd60e51b81526020600482015260156024820152600080516020612da4833981519152604482015290519081900360640190fd5b600555565b6000546001600160a01b03163314610fd1576040805162461bcd60e51b81526020600482015260156024820152600080516020612da4833981519152604482015290519081900360640190fd5b600280546001600160a01b0319166001600160a01b0392909216919091179055565b3360009081526011602052604090205460ff16611045576040805162461bcd60e51b81526020600482015260186024820152600080516020612dc4833981519152604482015290519081900360640190fd5b610f02828261238b565b6000546001600160a01b0316331461109c576040805162461bcd60e51b81526020600482015260156024820152600080516020612da4833981519152604482015290519081900360640190fd5b6001600160a01b03919091166000908152601160205260409020805460ff1916911515919091179055565b6000546001600160a01b03163314611114576040805162461bcd60e51b81526020600482015260156024820152600080516020612da4833981519152604482015290519081900360640190fd5b600180546001600160a01b0319166001600160a01b0392909216919091179055565b600f5481565b6003546001600160a01b031681565b6000546001600160a01b03163314611198576040805162461bcd60e51b81526020600482015260156024820152600080516020612da4833981519152604482015290519081900360640190fd5b600d55565b6000546001600160a01b031633146111ea576040805162461bcd60e51b81526020600482015260156024820152600080516020612da4833981519152604482015290519081900360640190fd5b6001600160a01b03919091166000908152601560205260409020805460ff1916911515919091179055565b600054600160a01b900460ff1681565b600c5481565b6000546001600160a01b03163314611278576040805162461bcd60e51b81526020600482015260156024820152600080516020612da4833981519152604482015290519081900360640190fd5b6107088111156112b95760405162461bcd60e51b8152600401808060200182810382526025815260200180612d556025913960400191505060405180910390fd5b600755565b6000546001600160a01b0316331461130b576040805162461bcd60e51b81526020600482015260156024820152600080516020612da4833981519152604482015290519081900360640190fd5b60005b825181101561136957600083828151811061132557fe5b6020026020010151905082828151811061133b57fe5b6020908102919091018101516001600160a01b0390921660009081526014909152604090205560010161130e565b505050565b6018818154811061137b57fe5b600091825260209091200154905081565b6017818154811061139957fe5b6000918252602090912001546001600160a01b0316905081565b60116020526000908152604090205460ff1681565b60055481565b3360009081526011602052604090205460ff16611420576040805162461bcd60e51b81526020600482015260186024820152600080516020612dc4833981519152604482015290519081900360640190fd5b61142a868661238b565b60048054604080516304dabc3160e51b815290516001600160a01b03909216926000926114aa9287928692639b57862092808301926020929182900301818987803b15801561147857600080fd5b505af115801561148c573d6000803e3d6000fd5b505050506040513d60208110156114a257600080fd5b505190612461565b905060006114ed84846001600160a01b0316639b5786206040518163ffffffff1660e01b8152600401602060405180830381600087803b15801561147857600080fd5b9050818711156114fb578196505b80861115611507578095505b60408051629a208160e81b81526004810189905233602482015290516001600160a01b03851691639a20810091604480830192600092919082900301818387803b15801561155457600080fd5b505af1158015611568573d6000803e3d6000fd5b50506040805163f3883d8b60e01b8152600481018a905233602482015290516001600160a01b038716935063f3883d8b9250604480830192600092919082900301818387803b1580156115ba57600080fd5b505af11580156115ce573d6000803e3d6000fd5b50505050505050505050505050565b6004546001600160a01b031681565b61070881565b600054600160a81b900460ff1681565b60008054600160a81b900460ff161561161d57506000611688565b600f546010541061163057506000611688565b60008061163c846117a6565b935093505050818111801561167157506001600160a01b03841660009081526014602052604090205461166f82846124c2565b115b1561168157600092505050611688565b6001925050505b919050565b3360009081526015602052604090205460ff166116df576040805162461bcd60e51b81526020600482015260186024820152600080516020612dc4833981519152604482015290519081900360640190fd5b3360009081526016602052604090205460ff16611743576040805162461bcd60e51b815260206004820152601e60248201527f466173745072696365466565643a20616c726561647920656e61626c65640000604482015290519081900360640190fd5b336000908152601660205260409020805460ff191690556010546117689060016124c2565b6010556040805133815290517f9fe0c305c33aa92757a537936872a60be0d91549a4303cc99fd8b7fce8a002759181900360200190a1565b600e5481565b6000806000806117b4612c4d565b505050506001600160a01b039182166000908152601360209081526040918290208251608081018452905494851680825263ffffffff600160a01b87048116938301849052600160c01b87048116948301859052600160e01b909604909516606090910181905293949093919250565b60095481565b6000546001600160a01b03163314611877576040805162461bcd60e51b81526020600482015260156024820152600080516020612da4833981519152604482015290519081900360640190fd5b600c55565b3360009081526011602052604090205460ff166118ce576040805162461bcd60e51b81526020600482015260186024820152600080516020612dc4833981519152604482015290519081900360640190fd5b60006118d982612504565b90508015611944576002546001546001600160a01b03918216911660005b865181101561194057600087828151811061190e57fe5b602002602001015190506119378188848151811061192857fe5b60200260200101518587612610565b506001016118f7565b5050505b50505050565b6000546001600160a01b03163314611997576040805162461bcd60e51b81526020600482015260156024820152600080516020612da4833981519152604482015290519081900360640190fd5b600380546001600160a01b0319166001600160a01b0392909216919091179055565b60156020526000908152604090205460ff1681565b6000546001600160a01b03163314611a1b576040805162461bcd60e51b81526020600482015260156024820152600080516020612da4833981519152604482015290519081900360640190fd5b600054600160a01b900460ff1615611a645760405162461bcd60e51b8152600401808060200182810382526022815260200180612eb86022913960400191505060405180910390fd5b6000805460ff60a01b1916600160a01b178155600f8490555b8251811015611ad0576000838281518110611a9457fe5b6020908102919091018101516001600160a01b03166000908152601590915260409020805460ff19166001908117909155919091019050611a7d565b5060005b8151811015611944576000828281518110611aeb57fe5b6020908102919091018101516001600160a01b03166000908152601190915260409020805460ff19166001908117909155919091019050611ad4565b6000611b4060085460055461246190919063ffffffff16565b421115611ba1578115611b8157611b7a612710611b74611b6d600a5461271061246190919063ffffffff16565b86906128a5565b906128fe565b9050611cac565b611b7a612710611b74611b6d600a546127106124c290919063ffffffff16565b600754600554611bb091612461565b421115611bfd578115611bdd57611b7a612710611b74611b6d60095461271061246190919063ffffffff16565b611b7a612710611b74611b6d6009546127106124c290919063ffffffff16565b6001600160a01b03841660009081526012602052604090205480611c245783915050611cac565b6000818511611c3c57611c3782866124c2565b611c46565b611c4685836124c2565b9050611c5885611b74836127106128a5565b90506000611c6587611602565b1580611c725750600e5482115b90508015611ca6578415611c9957828611611c8d5782611c8f565b855b9350505050611cac565b828610611c8d5782611c8f565b50909150505b9392505050565b6000546001600160a01b03163314611d00576040805162461bcd60e51b81526020600482015260156024820152600080516020612da4833981519152604482015290519081900360640190fd5b600e55565b6000546001600160a01b03163314611d52576040805162461bcd60e51b81526020600482015260156024820152600080516020612da4833981519152604482015290519081900360640190fd5b600855565b68327cb2734119d3b7a9601e1b81565b6298968081565b60146020526000908152604090205481565b600a5481565b60105481565b3360009081526011602052604090205460ff16611dde576040805162461bcd60e51b81526020600482015260186024820152600080516020612dc4833981519152604482015290519081900360640190fd5b61142a868661226e565b600b5481565b6000546001600160a01b03163314611e3b576040805162461bcd60e51b81526020600482015260156024820152600080516020612da4833981519152604482015290519081900360640190fd5b600955565b6000546001600160a01b03163314611e8d576040805162461bcd60e51b81526020600482015260156024820152600080516020612da4833981519152604482015290519081900360640190fd5b8051825114611ee3576040805162461bcd60e51b815260206004820152601e60248201527f466173745072696365466565643a20696e76616c6964206c656e677468730000604482015290519081900360640190fd5b8151611ef6906017906020850190612c74565b508051611369906018906020840190612cd9565b3360009081526015602052604090205460ff16611f5c576040805162461bcd60e51b81526020600482015260186024820152600080516020612dc4833981519152604482015290519081900360640190fd5b3360009081526016602052604090205460ff1615611fc0576040805162461bcd60e51b815260206004820152601c60248201527b11985cdd141c9a58d9519959590e88185b1c9958591e481d9bdd195960221b604482015290519081900360640190fd5b336000908152601660205260409020805460ff19166001908117909155601054611fe991612461565b6010556040805133815290517f4c0c5fabf50e808e3bc8d19577d305e3a7163eea7e8a74a50caa8896694cd44b9181900360200190a1565b6013602052600090815260409020546001600160a01b0381169063ffffffff600160a01b8204811691600160c01b8104821691600160e01b9091041684565b6000546001600160a01b031633146120ad576040805162461bcd60e51b81526020600482015260156024820152600080516020612da4833981519152604482015290519081900360640190fd5b60008054911515600160a81b0260ff60a81b19909216919091179055565b6000546001600160a01b03163314612118576040805162461bcd60e51b81526020600482015260156024820152600080516020612da4833981519152604482015290519081900360640190fd5b600080546001600160a01b0319166001600160a01b0392909216919091179055565b60126020526000908152604090205481565b6000546001600160a01b03163314612199576040805162461bcd60e51b81526020600482015260156024820152600080516020612da4833981519152604482015290519081900360640190fd5b600b55565b6003546001600160a01b031633146121eb576040805162461bcd60e51b81526020600482015260186024820152600080516020612dc4833981519152604482015290519081900360640190fd5b600f55565b6000546001600160a01b0316331461223d576040805162461bcd60e51b81526020600482015260156024820152600080516020612da4833981519152604482015290519081900360640190fd5b600a55565b600d5481565b60085481565b6001600160a01b0381565b6001546001600160a01b031681565b60065481565b600061227982612504565b90508015611369576002546001546001600160a01b03918216911660005b85518110156123835760008682815181106122ae57fe5b6020026020010151905060005b6008811015612379576017546008840282019081106122e05750505050505050610f02565b60178054602084029185831c63ffffffff16916000919060088902870190811061230657fe5b6000918252602082200154601880546001600160a01b0390921693509060088a02880190811061233257fe5b6000918252602082200154915061235982611b748668327cb2734119d3b7a9601e1b6128a5565b905061236783828c8e612610565b5050600190940193506122bb92505050565b5050600101612297565b505050505050565b600061239682612504565b90508015611369576002546001546001600160a01b03918216911660005b600881101561238357601754819081106123d2575050505050610f02565b60178054602084029189831c63ffffffff169160009190869081106123f357fe5b6000918252602082200154601880546001600160a01b039092169350908790811061241a57fe5b6000918252602082200154915061244182611b748668327cb2734119d3b7a9601e1b6128a5565b905061244f83828a8c612610565b5050600190940193506123b492505050565b6000828201838110156124b9576040805162461bcd60e51b815260206004820152601b60248201527a536166654d6174683a206164646974696f6e206f766572666c6f7760281b604482015290519081900360640190fd5b90505b92915050565b60006124b983836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f77000081525061293d565b600b546000901561255d57600b546006546125209043906124c2565b101561255d5760405162461bcd60e51b815260040180806020018281038252602e815260200180612e61602e913960400191505060405180910390fd5b600c5461256a42826124c2565b83116125a75760405162461bcd60e51b815260040180806020018281038252602d815260200180612e34602d913960400191505060405180910390fd5b6125b14282612461565b83106125ee5760405162461bcd60e51b815260040180806020018281038252602f815260200180612de4602f913960400191505060405180910390fd5b600554831015612602576000915050611688565b505060055543600655600190565b6001600160a01b0382161561287f576000826001600160a01b03166356bf9de4866040518263ffffffff1660e01b815260040180826001600160a01b0316815260200191505060206040518083038186803b15801561266e57600080fd5b505afa158015612682573d6000803e3d6000fd5b505050506040513d602081101561269857600080fd5b50516001600160a01b0386166000908152601260205260408120549192508080806126c28a6117a6565b935093509350935060008411156127895760008487116126eb576126e685886124c2565b6126f5565b6126f587866124c2565b905060008a871161270f5761270a8b886124c2565b612719565b612719878c6124c2565b9050612730600d54426128fe90919063ffffffff16565b600d5461273e9087906128fe565b1461274c5760009350600092505b61276761276087611b7485629896806128a5565b8590612461565b935061278461277d88611b7484629896806128a5565b8490612461565b925050505b81811180156127b857506001600160a01b038a166000908152601460205260409020546127b682846124c2565b115b1561281557604080516001600160a01b038c16815260208101889052808201879052606081018490526080810183905290517fe582322b389ad06b2bbf619cd6da3f16a288ec873ea0fa6df4d72f3d9480b4479181900360a00190a15b6128218a8784846129d4565b604080516001600160a01b038c16815260208101889052808201879052606081018490526080810183905290517f23b9387f81fca646aac1dc4487ede045c65f5f7445482906565f01e05afdb3a89181900360a00190a15050505050505b6001600160a01b0384166000908152601260205260409020839055611944818585612b6a565b6000826128b4575060006124bc565b828202828482816128c157fe5b04146124b95760405162461bcd60e51b8152600401808060200182810382526021815260200180612e136021913960400191505060405180910390fd5b60006124b983836040518060400160405280601a815260200179536166654d6174683a206469766973696f6e206279207a65726f60301b815250612be8565b600081848411156129cc5760405162461bcd60e51b81526004018080602001828103825283818151815260200191508051906020019080838360005b83811015612991578181015183820152602001612979565b50505050905090810190601f1680156129be5780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b505050900390565b6001600160a01b038310612a2f576040805162461bcd60e51b815260206004820152601f60248201527f466173745072696365466565643a20696e76616c696420726566507269636500604482015290519081900360640190fd5b63ffffffff8210612a715760405162461bcd60e51b8152600401808060200182810382526029815260200180612e8f6029913960400191505060405180910390fd5b63ffffffff8110612ab35760405162461bcd60e51b815260040180806020018281038252602a815260200180612d7a602a913960400191505060405180910390fd5b604080516080810182526001600160a01b03948516815263ffffffff4281166020808401918252958216838501908152948216606084019081529787166000908152601390965292909420905181549251935196518516600160e01b026001600160e01b03978616600160c01b0263ffffffff60c01b1995909616600160a01b0263ffffffff60a01b19929097166001600160a01b0319909416939093171694909417919091169190911792909216919091179055565b6001600160a01b038316612b7d57611369565b826001600160a01b031663e0409c7183836040518363ffffffff1660e01b815260040180836001600160a01b0316815260200182815260200192505050600060405180830381600087803b158015612bd457600080fd5b505af1158015611940573d6000803e3d6000fd5b60008183612c375760405162461bcd60e51b8152602060048201818152835160248401528351909283926044909101919085019080838360008315612991578181015183820152602001612979565b506000838581612c4357fe5b0495945050505050565b60408051608081018252600080825260208201819052918101829052606081019190915290565b828054828255906000526020600020908101928215612cc9579160200282015b82811115612cc957825182546001600160a01b0319166001600160a01b03909116178255602090920191600190910190612c94565b50612cd5929150612d20565b5090565b828054828255906000526020600020908101928215612d14579160200282015b82811115612d14578251825591602001919060010190612cf9565b50612cd5929150612d3f565b5b80821115612cd55780546001600160a01b0319168155600101612d21565b5b80821115612cd55760008155600101612d4056fe466173745072696365466565643a20696e76616c6964205f70726963654475726174696f6e466173745072696365466565643a20696e76616c69642063756d756c61746976654661737444656c7461476f7665726e61626c653a20666f7262696464656e0000000000000000000000466173745072696365466565643a20666f7262696464656e0000000000000000466173745072696365466565643a205f74696d657374616d70206578636565647320616c6c6f7765642072616e6765536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f77466173745072696365466565643a205f74696d657374616d702062656c6f7720616c6c6f7765642072616e6765466173745072696365466565643a206d696e426c6f636b496e74657276616c206e6f742079657420706173736564466173745072696365466565643a20696e76616c69642063756d756c617469766552656644656c7461466173745072696365466565643a20616c726561647920696e697469616c697a6564a164736f6c634300060c000a

Constructor Arguments (ABI-Encoded and is the last bytes of the Contract Creation Code above)

000000000000000000000000000000000000000000000000000000000000012c0000000000000000000000000000000000000000000000000000000000000e10000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002ee0000000000000000000000006dfa72d904d9c4bb526a1f31a4d9c4f2fe18b32a000000000000000000000000904a08be742bd5bc6ad10f0924f06b0b23d1175c0000000000000000000000005d44a69ce8ee304b97391d29c4352e66ec8b9f15

-----Decoded View---------------
Arg [0] : _priceDuration (uint256): 300
Arg [1] : _maxPriceUpdateDelay (uint256): 3600
Arg [2] : _minBlockInterval (uint256): 0
Arg [3] : _maxDeviationBasisPoints (uint256): 750
Arg [4] : _fastPriceEvents (address): 0x6DFA72d904D9C4BB526a1f31a4d9c4F2fE18B32a
Arg [5] : _tokenManager (address): 0x904A08Be742bD5BC6ad10f0924F06b0B23d1175C
Arg [6] : _positionRouter (address): 0x5d44A69ce8EE304B97391D29c4352E66Ec8B9F15

-----Encoded View---------------
7 Constructor Arguments found :
Arg [0] : 000000000000000000000000000000000000000000000000000000000000012c
Arg [1] : 0000000000000000000000000000000000000000000000000000000000000e10
Arg [2] : 0000000000000000000000000000000000000000000000000000000000000000
Arg [3] : 00000000000000000000000000000000000000000000000000000000000002ee
Arg [4] : 0000000000000000000000006dfa72d904d9c4bb526a1f31a4d9c4f2fe18b32a
Arg [5] : 000000000000000000000000904a08be742bd5bc6ad10f0924f06b0b23d1175c
Arg [6] : 0000000000000000000000005d44a69ce8ee304b97391d29c4352e66ec8b9f15


Block Transaction Difficulty Gas Used Reward
View All Blocks Produced

Block Uncle Number Difficulty Gas Used Reward
View All Uncles
Loading...
Loading
Loading...
Loading

Validator Index Block Amount
View All Withdrawals

Transaction Hash Block Value Eth2 PubKey Valid
View All Deposits
[ Download: CSV Export  ]
[ Download: CSV Export  ]

A contract address hosts a smart contract, which is a set of code stored on the blockchain that runs when predetermined conditions are met. Learn more about addresses in our Knowledge Base.