Contract 0x7ddba3daea8f1d8fc3c1060eff96c3d2d9dd6c0d

 
Txn Hash Method
Block
From
To
Value [Txn Fee]
0xf9ca627b271f933bc7cf9ce29bdec099f2c867164e73726e931e04d65bfdaf49Set Token Config79269422022-03-15 7:31:53204 days 16 hrs ago0x420220b72bbd307db8615e7aa0eadca399cf2fc0 IN  0x7ddba3daea8f1d8fc3c1060eff96c3d2d9dd6c0d0 ETH0.000148059377 ETH
0x02ea5e0b407bf0494b28c6e43ca984713f8f6283d3f7bbb33d396cddb40b1ad3Set Token Config79264132022-03-15 7:17:22204 days 17 hrs ago0x420220b72bbd307db8615e7aa0eadca399cf2fc0 IN  0x7ddba3daea8f1d8fc3c1060eff96c3d2d9dd6c0d0 ETH0.000174781571 ETH
0xbd402af51ea3650617fd00e7b47cee0daf6058f5c1ee544a7a8863a0925614fbSet Token Config79264022022-03-15 7:17:22204 days 17 hrs ago0x420220b72bbd307db8615e7aa0eadca399cf2fc0 IN  0x7ddba3daea8f1d8fc3c1060eff96c3d2d9dd6c0d0 ETH0.000175162356 ETH
0xfdc6240f91a162d94f74cda2960e32cb9b9a39f115a029bb83b189d0967375e0Set Token Config79263932022-03-15 7:17:22204 days 17 hrs ago0x420220b72bbd307db8615e7aa0eadca399cf2fc0 IN  0x7ddba3daea8f1d8fc3c1060eff96c3d2d9dd6c0d0 ETH0.000174402159 ETH
0xcdbe8fe946c7875150c011b5e7ee8dfc5d58fbaf1ac925adc4549c28e43e4713Set Token Config79263882022-03-15 7:17:22204 days 17 hrs ago0x420220b72bbd307db8615e7aa0eadca399cf2fc0 IN  0x7ddba3daea8f1d8fc3c1060eff96c3d2d9dd6c0d0 ETH0.000174778826 ETH
0xe9e119e64cb8aa188db14bc29ecfc1cd2e3ebaf0438605dfce45cafa8a7e0ba5Set Token Config79263832022-03-15 7:17:22204 days 17 hrs ago0x420220b72bbd307db8615e7aa0eadca399cf2fc0 IN  0x7ddba3daea8f1d8fc3c1060eff96c3d2d9dd6c0d0 ETH0.00017516016 ETH
0x2568f50126072a3ccbbb411edf66eb052ddc21efb2819a6fed4d4d8635d33b83Set Token Config79263802022-03-15 7:17:22204 days 17 hrs ago0x420220b72bbd307db8615e7aa0eadca399cf2fc0 IN  0x7ddba3daea8f1d8fc3c1060eff96c3d2d9dd6c0d0 ETH0.000174783219 ETH
0xfbb5cf76ab75a98ff72269d9de704124ee98273f060e0da9bce38ee1b22e6eb4Set Token Config79263752022-03-15 7:17:03204 days 17 hrs ago0x420220b72bbd307db8615e7aa0eadca399cf2fc0 IN  0x7ddba3daea8f1d8fc3c1060eff96c3d2d9dd6c0d0 ETH0.000188906846 ETH
0x4c8dbc3860da93bc3ca21387e704f7e77020886d47eb1851c55a8a489a7ee811Set Token Config79263702022-03-15 7:17:03204 days 17 hrs ago0x420220b72bbd307db8615e7aa0eadca399cf2fc0 IN  0x7ddba3daea8f1d8fc3c1060eff96c3d2d9dd6c0d0 ETH0.000174776355 ETH
0xf9e4a839aa77b7b2bcf91b08180dd9510eb1e9844864d4b8f940a4ee72bcd5e2Set Is Amm Enabl...79263612022-03-15 7:17:03204 days 17 hrs ago0x420220b72bbd307db8615e7aa0eadca399cf2fc0 IN  0x7ddba3daea8f1d8fc3c1060eff96c3d2d9dd6c0d0 ETH0.000118843276 ETH
0x349efcb53a145bcf91076f943affa224aa5405d0fa28252ce9bff3a0a3357347Set Price Sample...79263552022-03-15 7:17:03204 days 17 hrs ago0x420220b72bbd307db8615e7aa0eadca399cf2fc0 IN  0x7ddba3daea8f1d8fc3c1060eff96c3d2d9dd6c0d0 ETH0.000120363395 ETH
0x69029cf2047b245a48542a5c07b9544a341b3b05ee25790876994e568014f0abSet Max Strict P...79263462022-03-15 7:16:38204 days 17 hrs ago0x420220b72bbd307db8615e7aa0eadca399cf2fc0 IN  0x7ddba3daea8f1d8fc3c1060eff96c3d2d9dd6c0d0 ETH0.000136750317 ETH
0x2a5ea65fa4c778099c09194766c458ef687ff01bd4ca8c6843d3974feb86ec4b0x6080604079258492022-03-15 7:10:47204 days 17 hrs ago0x420220b72bbd307db8615e7aa0eadca399cf2fc0 IN  Create: VaultPriceFeed0 ETH0.007908084101 ETH
[ Download CSV Export 
Latest 25 internal transaction
Parent Txn Hash Block From To Value
0x9ff6b0565f7a324dafe7d908ec6a07207e45e859ca730893d90c4bd679ada184144858492022-06-13 9:03:49114 days 15 hrs ago 0x1785e8491e7e9d771b2a6e9e389c25265f06326a 0x7ddba3daea8f1d8fc3c1060eff96c3d2d9dd6c0d0 ETH
0x9ff6b0565f7a324dafe7d908ec6a07207e45e859ca730893d90c4bd679ada184144858492022-06-13 9:03:49114 days 15 hrs ago 0x7ddba3daea8f1d8fc3c1060eff96c3d2d9dd6c0d 0x50834f3163758fcc1df9973b6e91f0f0f0434ad30 ETH
0x9ff6b0565f7a324dafe7d908ec6a07207e45e859ca730893d90c4bd679ada184144858492022-06-13 9:03:49114 days 15 hrs ago 0x7ddba3daea8f1d8fc3c1060eff96c3d2d9dd6c0d 0x50834f3163758fcc1df9973b6e91f0f0f0434ad30 ETH
0x9ff6b0565f7a324dafe7d908ec6a07207e45e859ca730893d90c4bd679ada184144858492022-06-13 9:03:49114 days 15 hrs ago 0x7ddba3daea8f1d8fc3c1060eff96c3d2d9dd6c0d 0x50834f3163758fcc1df9973b6e91f0f0f0434ad30 ETH
0x9ff6b0565f7a324dafe7d908ec6a07207e45e859ca730893d90c4bd679ada184144858492022-06-13 9:03:49114 days 15 hrs ago 0x7ddba3daea8f1d8fc3c1060eff96c3d2d9dd6c0d 0x50834f3163758fcc1df9973b6e91f0f0f0434ad30 ETH
0x9ff6b0565f7a324dafe7d908ec6a07207e45e859ca730893d90c4bd679ada184144858492022-06-13 9:03:49114 days 15 hrs ago 0x1785e8491e7e9d771b2a6e9e389c25265f06326a 0x7ddba3daea8f1d8fc3c1060eff96c3d2d9dd6c0d0 ETH
0x9ff6b0565f7a324dafe7d908ec6a07207e45e859ca730893d90c4bd679ada184144858492022-06-13 9:03:49114 days 15 hrs ago 0x7ddba3daea8f1d8fc3c1060eff96c3d2d9dd6c0d 0xa14d53bc1f1c0f31b4aa3bd109344e5009051a840 ETH
0x9ff6b0565f7a324dafe7d908ec6a07207e45e859ca730893d90c4bd679ada184144858492022-06-13 9:03:49114 days 15 hrs ago 0x7ddba3daea8f1d8fc3c1060eff96c3d2d9dd6c0d 0xa14d53bc1f1c0f31b4aa3bd109344e5009051a840 ETH
0x9ff6b0565f7a324dafe7d908ec6a07207e45e859ca730893d90c4bd679ada184144858492022-06-13 9:03:49114 days 15 hrs ago 0x1785e8491e7e9d771b2a6e9e389c25265f06326a 0x7ddba3daea8f1d8fc3c1060eff96c3d2d9dd6c0d0 ETH
0x128d88f2d15f746c4261678fa5eca80222375de5955bfed6fe9f067c7b1c5d7e144855622022-06-13 9:02:10114 days 15 hrs ago 0x7ddba3daea8f1d8fc3c1060eff96c3d2d9dd6c0d 0x639fe6ab55c921f74e7fac1ee960c0b6293ba6120 ETH
0x128d88f2d15f746c4261678fa5eca80222375de5955bfed6fe9f067c7b1c5d7e144855622022-06-13 9:02:10114 days 15 hrs ago 0x1785e8491e7e9d771b2a6e9e389c25265f06326a 0x7ddba3daea8f1d8fc3c1060eff96c3d2d9dd6c0d0 ETH
0x128d88f2d15f746c4261678fa5eca80222375de5955bfed6fe9f067c7b1c5d7e144855622022-06-13 9:02:10114 days 15 hrs ago 0x7ddba3daea8f1d8fc3c1060eff96c3d2d9dd6c0d 0x639fe6ab55c921f74e7fac1ee960c0b6293ba6120 ETH
0x128d88f2d15f746c4261678fa5eca80222375de5955bfed6fe9f067c7b1c5d7e144855622022-06-13 9:02:10114 days 15 hrs ago 0x7ddba3daea8f1d8fc3c1060eff96c3d2d9dd6c0d 0x639fe6ab55c921f74e7fac1ee960c0b6293ba6120 ETH
0x128d88f2d15f746c4261678fa5eca80222375de5955bfed6fe9f067c7b1c5d7e144855622022-06-13 9:02:10114 days 15 hrs ago 0x7ddba3daea8f1d8fc3c1060eff96c3d2d9dd6c0d 0x639fe6ab55c921f74e7fac1ee960c0b6293ba6120 ETH
0x128d88f2d15f746c4261678fa5eca80222375de5955bfed6fe9f067c7b1c5d7e144855622022-06-13 9:02:10114 days 15 hrs ago 0x7ddba3daea8f1d8fc3c1060eff96c3d2d9dd6c0d 0x639fe6ab55c921f74e7fac1ee960c0b6293ba6120 ETH
0x128d88f2d15f746c4261678fa5eca80222375de5955bfed6fe9f067c7b1c5d7e144855622022-06-13 9:02:10114 days 15 hrs ago 0x1785e8491e7e9d771b2a6e9e389c25265f06326a 0x7ddba3daea8f1d8fc3c1060eff96c3d2d9dd6c0d0 ETH
0x128d88f2d15f746c4261678fa5eca80222375de5955bfed6fe9f067c7b1c5d7e144855622022-06-13 9:02:10114 days 15 hrs ago 0x1785e8491e7e9d771b2a6e9e389c25265f06326a 0x7ddba3daea8f1d8fc3c1060eff96c3d2d9dd6c0d0 ETH
0x128d88f2d15f746c4261678fa5eca80222375de5955bfed6fe9f067c7b1c5d7e144855622022-06-13 9:02:10114 days 15 hrs ago 0x7ddba3daea8f1d8fc3c1060eff96c3d2d9dd6c0d 0x639fe6ab55c921f74e7fac1ee960c0b6293ba6120 ETH
0x128d88f2d15f746c4261678fa5eca80222375de5955bfed6fe9f067c7b1c5d7e144855622022-06-13 9:02:10114 days 15 hrs ago 0x7ddba3daea8f1d8fc3c1060eff96c3d2d9dd6c0d 0x639fe6ab55c921f74e7fac1ee960c0b6293ba6120 ETH
0x128d88f2d15f746c4261678fa5eca80222375de5955bfed6fe9f067c7b1c5d7e144855622022-06-13 9:02:10114 days 15 hrs ago 0x7ddba3daea8f1d8fc3c1060eff96c3d2d9dd6c0d 0x639fe6ab55c921f74e7fac1ee960c0b6293ba6120 ETH
0x128d88f2d15f746c4261678fa5eca80222375de5955bfed6fe9f067c7b1c5d7e144855622022-06-13 9:02:10114 days 15 hrs ago 0x1785e8491e7e9d771b2a6e9e389c25265f06326a 0x7ddba3daea8f1d8fc3c1060eff96c3d2d9dd6c0d0 ETH
0x128d88f2d15f746c4261678fa5eca80222375de5955bfed6fe9f067c7b1c5d7e144855622022-06-13 9:02:10114 days 15 hrs ago 0x7ddba3daea8f1d8fc3c1060eff96c3d2d9dd6c0d 0x639fe6ab55c921f74e7fac1ee960c0b6293ba6120 ETH
0x128d88f2d15f746c4261678fa5eca80222375de5955bfed6fe9f067c7b1c5d7e144855622022-06-13 9:02:10114 days 15 hrs ago 0x7ddba3daea8f1d8fc3c1060eff96c3d2d9dd6c0d 0x639fe6ab55c921f74e7fac1ee960c0b6293ba6120 ETH
0x128d88f2d15f746c4261678fa5eca80222375de5955bfed6fe9f067c7b1c5d7e144855622022-06-13 9:02:10114 days 15 hrs ago 0x1785e8491e7e9d771b2a6e9e389c25265f06326a 0x7ddba3daea8f1d8fc3c1060eff96c3d2d9dd6c0d0 ETH
0x128d88f2d15f746c4261678fa5eca80222375de5955bfed6fe9f067c7b1c5d7e144855622022-06-13 9:02:10114 days 15 hrs ago 0x7ddba3daea8f1d8fc3c1060eff96c3d2d9dd6c0d 0x639fe6ab55c921f74e7fac1ee960c0b6293ba6120 ETH
[ Download CSV Export 
Loading

Contract Source Code Verified (Exact Match)

Contract Name:
VaultPriceFeed

Compiler Version
v0.6.12+commit.27d51765

Optimization Enabled:
Yes with 200 runs

Other Settings:
default evmVersion

Contract Source Code (Solidity Standard Json-Input format)

File 1 of 7 : VaultPriceFeed.sol
// SPDX-License-Identifier: MIT

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

import "./interfaces/IVaultPriceFeed.sol";
import "../oracle/interfaces/IPriceFeed.sol";
import "../oracle/interfaces/ISecondaryPriceFeed.sol";
import "../oracle/interfaces/IChainlinkFlags.sol";
import "../amm/interfaces/IPancakePair.sol";

pragma solidity 0.6.12;

contract VaultPriceFeed is IVaultPriceFeed {
    using SafeMath for uint256;

    uint256 public constant PRICE_PRECISION = 10 ** 30;
    uint256 public constant ONE_USD = PRICE_PRECISION;
    uint256 public constant BASIS_POINTS_DIVISOR = 10000;
    uint256 public constant MAX_SPREAD_BASIS_POINTS = 50;
    uint256 public constant MAX_ADJUSTMENT_INTERVAL = 2 hours;
    uint256 public constant MAX_ADJUSTMENT_BASIS_POINTS = 20;

    // Identifier of the Sequencer offline flag on the Flags contract
    address constant private FLAG_ARBITRUM_SEQ_OFFLINE = address(bytes20(bytes32(uint256(keccak256("chainlink.flags.arbitrum-seq-offline")) - 1)));

    address public gov;
    address public chainlinkFlags;

    bool public isAmmEnabled = true;
    bool public isSecondaryPriceEnabled = true;
    bool public useV2Pricing = false;
    bool public favorPrimaryPrice = false;
    uint256 public priceSampleSpace = 3;
    uint256 public maxStrictPriceDeviation = 0;
    address public secondaryPriceFeed;
    uint256 public spreadThresholdBasisPoints = 30;

    address public btc;
    address public eth;
    address public bnb;
    address public bnbBusd;
    address public ethBnb;
    address public btcBnb;

    mapping (address => address) public priceFeeds;
    mapping (address => uint256) public priceDecimals;
    mapping (address => uint256) public spreadBasisPoints;
    // Chainlink can return prices for stablecoins
    // that differs from 1 USD by a larger percentage than stableSwapFeeBasisPoints
    // we use strictStableTokens to cap the price to 1 USD
    // this allows us to configure stablecoins like DAI as being a stableToken
    // while not being a strictStableToken
    mapping (address => bool) public strictStableTokens;

    mapping (address => uint256) public override adjustmentBasisPoints;
    mapping (address => bool) public override isAdjustmentAdditive;
    mapping (address => uint256) public lastAdjustmentTimings;

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

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

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

    function setChainlinkFlags(address _chainlinkFlags) external onlyGov {
        chainlinkFlags = _chainlinkFlags;
    }

    function setAdjustment(address _token, bool _isAdditive, uint256 _adjustmentBps) external override onlyGov {
        require(
            lastAdjustmentTimings[_token].add(MAX_ADJUSTMENT_INTERVAL) < block.timestamp,
            "VaultPriceFeed: adjustment frequency exceeded"
        );
        require(_adjustmentBps <= MAX_ADJUSTMENT_BASIS_POINTS, "invalid _adjustmentBps");
        isAdjustmentAdditive[_token] = _isAdditive;
        adjustmentBasisPoints[_token] = _adjustmentBps;
        lastAdjustmentTimings[_token] = block.timestamp;
    }

    function setUseV2Pricing(bool _useV2Pricing) external override onlyGov {
        useV2Pricing = _useV2Pricing;
    }

    function setIsAmmEnabled(bool _isEnabled) external override onlyGov {
        isAmmEnabled = _isEnabled;
    }

    function setIsSecondaryPriceEnabled(bool _isEnabled) external override onlyGov {
        isSecondaryPriceEnabled = _isEnabled;
    }

    function setSecondaryPriceFeed(address _secondaryPriceFeed) external onlyGov {
        secondaryPriceFeed = _secondaryPriceFeed;
    }

    function setTokens(address _btc, address _eth, address _bnb) external onlyGov {
        btc = _btc;
        eth = _eth;
        bnb = _bnb;
    }

    function setPairs(address _bnbBusd, address _ethBnb, address _btcBnb) external onlyGov {
        bnbBusd = _bnbBusd;
        ethBnb = _ethBnb;
        btcBnb = _btcBnb;
    }

    function setSpreadBasisPoints(address _token, uint256 _spreadBasisPoints) external override onlyGov {
        require(_spreadBasisPoints <= MAX_SPREAD_BASIS_POINTS, "VaultPriceFeed: invalid _spreadBasisPoints");
        spreadBasisPoints[_token] = _spreadBasisPoints;
    }

    function setSpreadThresholdBasisPoints(uint256 _spreadThresholdBasisPoints) external override onlyGov {
        spreadThresholdBasisPoints = _spreadThresholdBasisPoints;
    }

    function setFavorPrimaryPrice(bool _favorPrimaryPrice) external override onlyGov {
        favorPrimaryPrice = _favorPrimaryPrice;
    }

    function setPriceSampleSpace(uint256 _priceSampleSpace) external override onlyGov {
        require(_priceSampleSpace > 0, "VaultPriceFeed: invalid _priceSampleSpace");
        priceSampleSpace = _priceSampleSpace;
    }

    function setMaxStrictPriceDeviation(uint256 _maxStrictPriceDeviation) external override onlyGov {
        maxStrictPriceDeviation = _maxStrictPriceDeviation;
    }

    function setTokenConfig(
        address _token,
        address _priceFeed,
        uint256 _priceDecimals,
        bool _isStrictStable
    ) external override onlyGov {
        priceFeeds[_token] = _priceFeed;
        priceDecimals[_token] = _priceDecimals;
        strictStableTokens[_token] = _isStrictStable;
    }

    function getPrice(address _token, bool _maximise, bool _includeAmmPrice, bool /* _useSwapPricing */) public override view returns (uint256) {
        uint256 price = useV2Pricing ? getPriceV2(_token, _maximise, _includeAmmPrice) : getPriceV1(_token, _maximise, _includeAmmPrice);

        uint256 adjustmentBps = adjustmentBasisPoints[_token];
        if (adjustmentBps > 0) {
            bool isAdditive = isAdjustmentAdditive[_token];
            if (isAdditive) {
                price = price.mul(BASIS_POINTS_DIVISOR.add(adjustmentBps)).div(BASIS_POINTS_DIVISOR);
            } else {
                price = price.mul(BASIS_POINTS_DIVISOR.sub(adjustmentBps)).div(BASIS_POINTS_DIVISOR);
            }
        }

        return price;
    }

    function getPriceV1(address _token, bool _maximise, bool _includeAmmPrice) public view returns (uint256) {
        uint256 price = getPrimaryPrice(_token, _maximise);

        if (_includeAmmPrice && isAmmEnabled) {
            uint256 ammPrice = getAmmPrice(_token);
            if (ammPrice > 0) {
                if (_maximise && ammPrice > price) {
                    price = ammPrice;
                }
                if (!_maximise && ammPrice < price) {
                    price = ammPrice;
                }
            }
        }

        if (isSecondaryPriceEnabled) {
            price = getSecondaryPrice(_token, price, _maximise);
        }

        if (strictStableTokens[_token]) {
            uint256 delta = price > ONE_USD ? price.sub(ONE_USD) : ONE_USD.sub(price);
            if (delta <= maxStrictPriceDeviation) {
                return ONE_USD;
            }
        }

        uint256 _spreadBasisPoints = spreadBasisPoints[_token];

        if (_maximise) {
            return price.mul(BASIS_POINTS_DIVISOR.add(_spreadBasisPoints)).div(BASIS_POINTS_DIVISOR);
        }

        return price.mul(BASIS_POINTS_DIVISOR.sub(_spreadBasisPoints)).div(BASIS_POINTS_DIVISOR);
    }

    function getPriceV2(address _token, bool _maximise, bool _includeAmmPrice) public view returns (uint256) {
        uint256 price = getPrimaryPrice(_token, _maximise);

        if (_includeAmmPrice && isAmmEnabled) {
            price = getAmmPriceV2(_token, _maximise, price);
        }

        if (isSecondaryPriceEnabled) {
            price = getSecondaryPrice(_token, price, _maximise);
        }

        if (strictStableTokens[_token]) {
            uint256 delta = price > ONE_USD ? price.sub(ONE_USD) : ONE_USD.sub(price);
            if (delta <= maxStrictPriceDeviation) {
                return ONE_USD;
            }
        }

        uint256 _spreadBasisPoints = spreadBasisPoints[_token];

        if (_maximise) {
            return price.mul(BASIS_POINTS_DIVISOR.add(_spreadBasisPoints)).div(BASIS_POINTS_DIVISOR);
        }

        return price.mul(BASIS_POINTS_DIVISOR.sub(_spreadBasisPoints)).div(BASIS_POINTS_DIVISOR);
    }

    function getAmmPriceV2(address _token, bool _maximise, uint256 _primaryPrice) public view returns (uint256) {
        uint256 ammPrice = getAmmPrice(_token);
        if (ammPrice == 0) {
            return _primaryPrice;
        }

        uint256 diff = ammPrice > _primaryPrice ? ammPrice.sub(_primaryPrice) : _primaryPrice.sub(ammPrice);
        if (diff.mul(BASIS_POINTS_DIVISOR) < _primaryPrice.mul(spreadThresholdBasisPoints)) {
            if (favorPrimaryPrice) {
                return _primaryPrice;
            }
            return ammPrice;
        }

        if (_maximise && ammPrice > _primaryPrice) {
            return ammPrice;
        }

        if (!_maximise && ammPrice < _primaryPrice) {
            return ammPrice;
        }

        return _primaryPrice;
    }

    function getPrimaryPrice(address _token, bool _maximise) public override view returns (uint256) {
        address priceFeedAddress = priceFeeds[_token];
        require(priceFeedAddress != address(0), "VaultPriceFeed: invalid price feed");

        if (chainlinkFlags != address(0)) {
            bool isRaised = IChainlinkFlags(chainlinkFlags).getFlag(FLAG_ARBITRUM_SEQ_OFFLINE);
            if (isRaised) {
                    // If flag is raised we shouldn't perform any critical operations
                revert("Chainlink feeds are not being updated");
            }
        }

        IPriceFeed priceFeed = IPriceFeed(priceFeedAddress);

        uint256 price = 0;
        uint80 roundId = priceFeed.latestRound();

        for (uint80 i = 0; i < priceSampleSpace; i++) {
            if (roundId <= i) { break; }
            uint256 p;

            if (i == 0) {
                int256 _p = priceFeed.latestAnswer();
                require(_p > 0, "VaultPriceFeed: invalid price");
                p = uint256(_p);
            } else {
                (, int256 _p, , ,) = priceFeed.getRoundData(roundId - i);
                require(_p > 0, "VaultPriceFeed: invalid price");
                p = uint256(_p);
            }

            if (price == 0) {
                price = p;
                continue;
            }

            if (_maximise && p > price) {
                price = p;
                continue;
            }

            if (!_maximise && p < price) {
                price = p;
            }
        }

        require(price > 0, "VaultPriceFeed: could not fetch price");
        // normalise price precision
        uint256 _priceDecimals = priceDecimals[_token];
        return price.mul(PRICE_PRECISION).div(10 ** _priceDecimals);
    }

    function getSecondaryPrice(address _token, uint256 _referencePrice, bool _maximise) public view returns (uint256) {
        if (secondaryPriceFeed == address(0)) { return _referencePrice; }
        return ISecondaryPriceFeed(secondaryPriceFeed).getPrice(_token, _referencePrice, _maximise);
    }

    function getAmmPrice(address _token) public override view returns (uint256) {
        if (_token == bnb) {
            // for bnbBusd, reserve0: BNB, reserve1: BUSD
            return getPairPrice(bnbBusd, true);
        }

        if (_token == eth) {
            uint256 price0 = getPairPrice(bnbBusd, true);
            // for ethBnb, reserve0: ETH, reserve1: BNB
            uint256 price1 = getPairPrice(ethBnb, true);
            // this calculation could overflow if (price0 / 10**30) * (price1 / 10**30) is more than 10**17
            return price0.mul(price1).div(PRICE_PRECISION);
        }

        if (_token == btc) {
            uint256 price0 = getPairPrice(bnbBusd, true);
            // for btcBnb, reserve0: BTC, reserve1: BNB
            uint256 price1 = getPairPrice(btcBnb, true);
            // this calculation could overflow if (price0 / 10**30) * (price1 / 10**30) is more than 10**17
            return price0.mul(price1).div(PRICE_PRECISION);
        }

        return 0;
    }

    // if divByReserve0: calculate price as reserve1 / reserve0
    // if !divByReserve1: calculate price as reserve0 / reserve1
    function getPairPrice(address _pair, bool _divByReserve0) public view returns (uint256) {
        (uint256 reserve0, uint256 reserve1, ) = IPancakePair(_pair).getReserves();
        if (_divByReserve0) {
            if (reserve0 == 0) { return 0; }
            return reserve1.mul(PRICE_PRECISION).div(reserve0);
        }
        if (reserve1 == 0) { return 0; }
        return reserve0.mul(PRICE_PRECISION).div(reserve1);
    }
}

File 2 of 7 : 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 3 of 7 : 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 getPrimaryPrice(address _token, bool _maximise) external view returns (uint256);
    function setTokenConfig(
        address _token,
        address _priceFeed,
        uint256 _priceDecimals,
        bool _isStrictStable
    ) external;
}

File 4 of 7 : IPriceFeed.sol
// SPDX-License-Identifier: MIT

pragma solidity 0.6.12;

interface IPriceFeed {
    function description() external view returns (string memory);
    function aggregator() external view returns (address);
    function latestAnswer() external view returns (int256);
    function latestRound() external view returns (uint80);
    function getRoundData(uint80 roundId) external view returns (uint80, int256, uint256, uint256, uint80);
}

File 5 of 7 : 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);
}

File 6 of 7 : IChainlinkFlags.sol
// SPDX-License-Identifier: MIT

pragma solidity 0.6.12;

interface IChainlinkFlags {
  function getFlag(address) external view returns (bool);
}

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

pragma solidity >=0.5.0;

interface IPancakePair {
    function getReserves() external view returns (uint112 reserve0, uint112 reserve1, uint32 blockTimestampLast);
}

Settings
{
  "optimizer": {
    "enabled": true,
    "runs": 200
  },
  "outputSelection": {
    "*": {
      "*": [
        "evm.bytecode",
        "evm.deployedBytecode",
        "devdoc",
        "userdoc",
        "metadata",
        "abi"
      ]
    }
  },
  "libraries": {}
}

Contract ABI

[{"inputs":[],"stateMutability":"nonpayable","type":"constructor"},{"inputs":[],"name":"BASIS_POINTS_DIVISOR","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"MAX_ADJUSTMENT_BASIS_POINTS","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"MAX_ADJUSTMENT_INTERVAL","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"MAX_SPREAD_BASIS_POINTS","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"ONE_USD","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":[{"internalType":"address","name":"","type":"address"}],"name":"adjustmentBasisPoints","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"bnb","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"bnbBusd","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"btc","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"btcBnb","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"chainlinkFlags","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"eth","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"ethBnb","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"favorPrimaryPrice","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_token","type":"address"}],"name":"getAmmPrice","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_token","type":"address"},{"internalType":"bool","name":"_maximise","type":"bool"},{"internalType":"uint256","name":"_primaryPrice","type":"uint256"}],"name":"getAmmPriceV2","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_pair","type":"address"},{"internalType":"bool","name":"_divByReserve0","type":"bool"}],"name":"getPairPrice","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_token","type":"address"},{"internalType":"bool","name":"_maximise","type":"bool"},{"internalType":"bool","name":"_includeAmmPrice","type":"bool"},{"internalType":"bool","name":"","type":"bool"}],"name":"getPrice","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_token","type":"address"},{"internalType":"bool","name":"_maximise","type":"bool"},{"internalType":"bool","name":"_includeAmmPrice","type":"bool"}],"name":"getPriceV1","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_token","type":"address"},{"internalType":"bool","name":"_maximise","type":"bool"},{"internalType":"bool","name":"_includeAmmPrice","type":"bool"}],"name":"getPriceV2","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_token","type":"address"},{"internalType":"bool","name":"_maximise","type":"bool"}],"name":"getPrimaryPrice","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_token","type":"address"},{"internalType":"uint256","name":"_referencePrice","type":"uint256"},{"internalType":"bool","name":"_maximise","type":"bool"}],"name":"getSecondaryPrice","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"gov","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"isAdjustmentAdditive","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"isAmmEnabled","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"isSecondaryPriceEnabled","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"lastAdjustmentTimings","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"maxStrictPriceDeviation","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"priceDecimals","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"priceFeeds","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"priceSampleSpace","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"secondaryPriceFeed","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_token","type":"address"},{"internalType":"bool","name":"_isAdditive","type":"bool"},{"internalType":"uint256","name":"_adjustmentBps","type":"uint256"}],"name":"setAdjustment","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_chainlinkFlags","type":"address"}],"name":"setChainlinkFlags","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bool","name":"_favorPrimaryPrice","type":"bool"}],"name":"setFavorPrimaryPrice","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_gov","type":"address"}],"name":"setGov","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bool","name":"_isEnabled","type":"bool"}],"name":"setIsAmmEnabled","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bool","name":"_isEnabled","type":"bool"}],"name":"setIsSecondaryPriceEnabled","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_maxStrictPriceDeviation","type":"uint256"}],"name":"setMaxStrictPriceDeviation","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_bnbBusd","type":"address"},{"internalType":"address","name":"_ethBnb","type":"address"},{"internalType":"address","name":"_btcBnb","type":"address"}],"name":"setPairs","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_priceSampleSpace","type":"uint256"}],"name":"setPriceSampleSpace","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_secondaryPriceFeed","type":"address"}],"name":"setSecondaryPriceFeed","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_token","type":"address"},{"internalType":"uint256","name":"_spreadBasisPoints","type":"uint256"}],"name":"setSpreadBasisPoints","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_spreadThresholdBasisPoints","type":"uint256"}],"name":"setSpreadThresholdBasisPoints","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_token","type":"address"},{"internalType":"address","name":"_priceFeed","type":"address"},{"internalType":"uint256","name":"_priceDecimals","type":"uint256"},{"internalType":"bool","name":"_isStrictStable","type":"bool"}],"name":"setTokenConfig","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_btc","type":"address"},{"internalType":"address","name":"_eth","type":"address"},{"internalType":"address","name":"_bnb","type":"address"}],"name":"setTokens","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bool","name":"_useV2Pricing","type":"bool"}],"name":"setUseV2Pricing","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"spreadBasisPoints","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"spreadThresholdBasisPoints","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"strictStableTokens","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"useV2Pricing","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"}]

60806040526001805461ffff60b01b1960ff60a81b1960ff60a01b19909216600160a01b1791909116600160a81b171690556003600281905560009055601e60055534801561004d57600080fd5b50600080546001600160a01b031916331790556120268061006f6000396000f3fe608060405234801561001057600080fd5b506004361061030c5760003560e01c8063826e055f1161019d578063a28d57d8116100e9578063c2138d8c116100a2578063d694376c1161007c578063d694376c14610874578063e4440e02146108a8578063eb1c92a9146108b0578063fd34ec40146108cf5761030c565b8063c2138d8c14610802578063cefe0f2114610828578063cfad57a21461084e5761030c565b8063a28d57d81461074d578063a2ad7b9314610755578063a39c73a314610783578063b02a2de41461078b578063b731dd87146107bf578063b8f61105146107dc5761030c565b806397dfade7116101565780639b18dc47116101305780639b18dc47146106cd5780639b889380146106d55780639dcb511a14610701578063a27ea386146107275761030c565b806397dfade7146106805780639917dc74146106885780639a0a6635146106a75761030c565b8063826e055f1461060a5780638b86616c146106305780638c7c9e0c1461063857806393f690741461064057806395082d2514610578578063971bd396146106785761030c565b8063443be2091161025c578063593d9e80116102155780636ce8a44b116101ef5780636ce8a44b146105805780636fc80708146105a6578063717cfe7a146105ae578063732391b4146105d45761030c565b8063593d9e8014610551578063604f37e91461055957806367781c0e146105785761030c565b8063443be2091461047757806348cac277146104af57806349a876e4146104d55780634a4b1f4f146104dd5780634b9ade47146104e557806356c8c2c1146105235761030c565b80632fc3a70a116102c95780633d949c5f116102a35780633d949c5f146103fd5780633eba8d36146104335780633ebbc601146104675780633f0c3bb71461046f5761030c565b80632fc3a70a1461039b57806330536ee5146103d9578063378e7bf7146103f55761030c565b80630957aed9146103115780631193c8091461032b578063126082cf1461034f57806312d43a51146103575780632fa03b8f1461035f5780632fbfe3d31461037e575b600080fd5b6103196108ee565b60408051918252519081900360200190f35b6103336108f3565b604080516001600160a01b039092168252519081900360200190f35b610319610902565b610333610908565b61037c6004803603602081101561037557600080fd5b5035610917565b005b61037c6004803603602081101561039457600080fd5b50356109a8565b610319600480360360808110156103b157600080fd5b506001600160a01b0381351690602081013515159060408101351515906060013515156109fa565b6103e1610ab8565b604080519115158252519081900360200190f35b610319610ac8565b6103196004803603606081101561041357600080fd5b506001600160a01b03813516906020810135151590604001351515610ace565b6103196004803603606081101561044957600080fd5b506001600160a01b0381351690602081013590604001351515610c43565b6103e1610cf1565b6103e1610d01565b61037c6004803603606081101561048d57600080fd5b506001600160a01b038135811691602081013582169160409091013516610d11565b610319600480360360208110156104c557600080fd5b50356001600160a01b0316610d9d565b610333610daf565b610319610dbe565b61037c600480360360808110156104fb57600080fd5b506001600160a01b038135811691602081013590911690604081013590606001351515610dc3565b6103196004803603604081101561053957600080fd5b506001600160a01b0381351690602001351515610e65565b6103e16112b6565b61037c6004803603602081101561056f57600080fd5b503515156112c6565b610319611331565b6103e16004803603602081101561059657600080fd5b50356001600160a01b0316611341565b610319611356565b610319600480360360208110156105c457600080fd5b50356001600160a01b031661135c565b610319600480360360608110156105ea57600080fd5b506001600160a01b0381351690602081013515159060400135151561136e565b61037c6004803603602081101561062057600080fd5b50356001600160a01b03166113c3565b610333611432565b610333611441565b61037c6004803603606081101561065657600080fd5b506001600160a01b038135811691602081013582169160409091013516611450565b6103336114dc565b6103336114eb565b61037c6004803603602081101561069e57600080fd5b503515156114fa565b61037c600480360360208110156106bd57600080fd5b50356001600160a01b0316611565565b6103196115d4565b61037c600480360360408110156106eb57600080fd5b506001600160a01b0381351690602001356115da565b6103336004803603602081101561071757600080fd5b50356001600160a01b0316611683565b6103196004803603602081101561073d57600080fd5b50356001600160a01b031661169e565b6103336116b0565b6103196004803603604081101561076b57600080fd5b506001600160a01b03813516906020013515156116bf565b6103196117b3565b610319600480360360608110156107a157600080fd5b506001600160a01b03813516906020810135151590604001356117b9565b61037c600480360360208110156107d557600080fd5b5035611881565b6103e1600480360360208110156107f257600080fd5b50356001600160a01b03166118d3565b6103196004803603602081101561081857600080fd5b50356001600160a01b03166118e8565b6103196004803603602081101561083e57600080fd5b50356001600160a01b03166119e7565b61037c6004803603602081101561086457600080fd5b50356001600160a01b03166119f9565b61037c6004803603606081101561088a57600080fd5b506001600160a01b0381351690602081013515159060400135611a68565b610333611bab565b61037c600480360360208110156108c657600080fd5b50351515611bba565b61037c600480360360208110156108e557600080fd5b50351515611c25565b603281565b600a546001600160a01b031681565b61271081565b6000546001600160a01b031681565b6000546001600160a01b03163314610964576040805162461bcd60e51b81526020600482015260196024820152600080516020611f60833981519152604482015290519081900360640190fd5b600081116109a35760405162461bcd60e51b8152600401808060200182810382526029815260200180611ec46029913960400191505060405180910390fd5b600255565b6000546001600160a01b031633146109f5576040805162461bcd60e51b81526020600482015260196024820152600080516020611f60833981519152604482015290519081900360640190fd5b600355565b6001546000908190600160b01b900460ff16610a2057610a1b868686610ace565b610a2b565b610a2b86868661136e565b6001600160a01b0387166000908152601060205260409020549091508015610aae576001600160a01b03871660009081526011602052604090205460ff168015610a9657610a8f612710610a89610a828286611c90565b8690611cea565b90611d43565b9250610aac565b610aa9612710610a89610a828286611d85565b92505b505b5095945050505050565b600154600160b01b900460ff1681565b60035481565b600080610adb8585610e65565b9050828015610af35750600154600160a01b900460ff165b15610b38576000610b03866118e8565b90508015610b3657848015610b1757508181115b15610b20578091505b84158015610b2d57508181105b15610b36578091505b505b600154600160a81b900460ff1615610b5857610b55858286610c43565b90505b6001600160a01b0385166000908152600f602052604090205460ff1615610be257600068327cb2734119d3b7a9601e1b8211610ba957610ba468327cb2734119d3b7a9601e1b83611d85565b610bbf565b610bbf8268327cb2734119d3b7a9601e1b611d85565b90506003548111610be05768327cb2734119d3b7a9601e1b92505050610c3c565b505b6001600160a01b0385166000908152600e60205260409020548415610c2457610c1b612710610a89610c148285611c90565b8590611cea565b92505050610c3c565b610c37612710610a89610c148285611d85565b925050505b9392505050565b6004546000906001600160a01b0316610c5d575081610c3c565b6004805460408051630ffd9c6d60e31b81526001600160a01b038881169482019490945260248101879052851515604482015290519290911691637fece36891606480820192602092909190829003018186803b158015610cbd57600080fd5b505afa158015610cd1573d6000803e3d6000fd5b505050506040513d6020811015610ce757600080fd5b5051949350505050565b600154600160a81b900460ff1681565b600154600160a01b900460ff1681565b6000546001600160a01b03163314610d5e576040805162461bcd60e51b81526020600482015260196024820152600080516020611f60833981519152604482015290519081900360640190fd5b600680546001600160a01b039485166001600160a01b031991821617909155600780549385169382169390931790925560088054919093169116179055565b60106020526000908152604090205481565b6008546001600160a01b031681565b601481565b6000546001600160a01b03163314610e10576040805162461bcd60e51b81526020600482015260196024820152600080516020611f60833981519152604482015290519081900360640190fd5b6001600160a01b039384166000908152600c6020908152604080832080546001600160a01b0319169690971695909517909555600d855283812092909255600f90935220805460ff1916911515919091179055565b6001600160a01b038083166000908152600c602052604081205490911680610ebe5760405162461bcd60e51b8152600401808060200182810382526022815260200180611fcf6022913960400191505060405180910390fd5b6001546001600160a01b031615610f9b5760015460408051631abf23ff60e11b815273a438451d6458044c3c8cd2f6f31c91ac882a6d91600482015290516000926001600160a01b03169163357e47fe916024808301926020929190829003018186803b158015610f2e57600080fd5b505afa158015610f42573d6000803e3d6000fd5b505050506040513d6020811015610f5857600080fd5b505190508015610f995760405162461bcd60e51b8152600401808060200182810382526025815260200180611f806025913960400191505060405180910390fd5b505b6000819050600080826001600160a01b031663668a0f026040518163ffffffff1660e01b815260040160206040518083038186803b158015610fdc57600080fd5b505afa158015610ff0573d6000803e3d6000fd5b505050506040513d602081101561100657600080fd5b5051905060005b600254816001600160501b0316101561123157806001600160501b0316826001600160501b03161161103e57611231565b60006001600160501b038216611113576000856001600160a01b03166350d25bcd6040518163ffffffff1660e01b815260040160206040518083038186803b15801561108957600080fd5b505afa15801561109d573d6000803e3d6000fd5b505050506040513d60208110156110b357600080fd5b505190506000811361110c576040805162461bcd60e51b815260206004820152601d60248201527f5661756c745072696365466565643a20696e76616c6964207072696365000000604482015290519081900360640190fd5b90506111ed565b6000856001600160a01b0316639a6fc8f58486036040518263ffffffff1660e01b815260040180826001600160501b0316815260200191505060a06040518083038186803b15801561116457600080fd5b505afa158015611178573d6000803e3d6000fd5b505050506040513d60a081101561118e57600080fd5b50602001519050600081136111ea576040805162461bcd60e51b815260206004820152601d60248201527f5661756c745072696365466565643a20696e76616c6964207072696365000000604482015290519081900360640190fd5b90505b836111f9579250611229565b87801561120557508381115b15611211579250611229565b8715801561121e57508381105b15611227578093505b505b60010161100d565b50600082116112715760405162461bcd60e51b8152600401808060200182810382526025815260200180611eed6025913960400191505060405180910390fd5b6001600160a01b0387166000908152600d60205260409020546112a8600a82900a610a898568327cb2734119d3b7a9601e1b611cea565b955050505050505b92915050565b600154600160b81b900460ff1681565b6000546001600160a01b03163314611313576040805162461bcd60e51b81526020600482015260196024820152600080516020611f60833981519152604482015290519081900360640190fd5b60018054911515600160b81b0260ff60b81b19909216919091179055565b68327cb2734119d3b7a9601e1b81565b60116020526000908152604090205460ff1681565b60025481565b60126020526000908152604090205481565b60008061137b8585610e65565b90508280156113935750600154600160a01b900460ff165b15610b38576113a38585836117b9565b905060015460ff600160a81b9091041615610b5857610b55858286610c43565b6000546001600160a01b03163314611410576040805162461bcd60e51b81526020600482015260196024820152600080516020611f60833981519152604482015290519081900360640190fd5b600180546001600160a01b0319166001600160a01b0392909216919091179055565b6004546001600160a01b031681565b6007546001600160a01b031681565b6000546001600160a01b0316331461149d576040805162461bcd60e51b81526020600482015260196024820152600080516020611f60833981519152604482015290519081900360640190fd5b600980546001600160a01b039485166001600160a01b031991821617909155600a805493851693821693909317909255600b8054919093169116179055565b600b546001600160a01b031681565b6009546001600160a01b031681565b6000546001600160a01b03163314611547576040805162461bcd60e51b81526020600482015260196024820152600080516020611f60833981519152604482015290519081900360640190fd5b60018054911515600160a01b0260ff60a01b19909216919091179055565b6000546001600160a01b031633146115b2576040805162461bcd60e51b81526020600482015260196024820152600080516020611f60833981519152604482015290519081900360640190fd5b600480546001600160a01b0319166001600160a01b0392909216919091179055565b611c2081565b6000546001600160a01b03163314611627576040805162461bcd60e51b81526020600482015260196024820152600080516020611f60833981519152604482015290519081900360640190fd5b60328111156116675760405162461bcd60e51b815260040180806020018281038252602a815260200180611fa5602a913960400191505060405180910390fd5b6001600160a01b039091166000908152600e6020526040902055565b600c602052600090815260409020546001600160a01b031681565b600e6020526000908152604090205481565b6006546001600160a01b031681565b6000806000846001600160a01b0316630902f1ac6040518163ffffffff1660e01b815260040160606040518083038186803b1580156116fd57600080fd5b505afa158015611711573d6000803e3d6000fd5b505050506040513d606081101561172757600080fd5b5080516020909101516dffffffffffffffffffffffffffff91821693501690508315611780578161175d576000925050506112b0565b61177782610a898368327cb2734119d3b7a9601e1b611cea565b925050506112b0565b80611790576000925050506112b0565b6117aa81610a898468327cb2734119d3b7a9601e1b611cea565b95945050505050565b60055481565b6000806117c5856118e8565b9050806117d55782915050610c3c565b60008382116117ed576117e88483611d85565b6117f7565b6117f78285611d85565b905061180e60055485611cea90919063ffffffff16565b61181a82612710611cea565b101561184457600154600160b81b900460ff161561183c578392505050610c3c565b509050610c3c565b84801561185057508382115b1561185d57509050610c3c565b8415801561186a57508382105b1561187757509050610c3c565b5091949350505050565b6000546001600160a01b031633146118ce576040805162461bcd60e51b81526020600482015260196024820152600080516020611f60833981519152604482015290519081900360640190fd5b600555565b600f6020526000908152604090205460ff1681565b6008546000906001600160a01b038381169116141561191f57600954611918906001600160a01b031660016116bf565b90506119e2565b6007546001600160a01b03838116911614156119915760095460009061194f906001600160a01b031660016116bf565b600a5490915060009061196c906001600160a01b031660016116bf565b905061198868327cb2734119d3b7a9601e1b610a898484611cea565b925050506119e2565b6006546001600160a01b03838116911614156119de576009546000906119c1906001600160a01b031660016116bf565b600b5490915060009061196c906001600160a01b031660016116bf565b5060005b919050565b600d6020526000908152604090205481565b6000546001600160a01b03163314611a46576040805162461bcd60e51b81526020600482015260196024820152600080516020611f60833981519152604482015290519081900360640190fd5b600080546001600160a01b0319166001600160a01b0392909216919091179055565b6000546001600160a01b03163314611ab5576040805162461bcd60e51b81526020600482015260196024820152600080516020611f60833981519152604482015290519081900360640190fd5b6001600160a01b0383166000908152601260205260409020544290611adc90611c20611c90565b10611b185760405162461bcd60e51b815260040180806020018281038252602d815260200180611f33602d913960400191505060405180910390fd5b6014811115611b67576040805162461bcd60e51b8152602060048201526016602482015275696e76616c6964205f61646a7573746d656e7442707360501b604482015290519081900360640190fd5b6001600160a01b03929092166000908152601160209081526040808320805460ff191694151594909417909355601081528282209390935560129092529020429055565b6001546001600160a01b031681565b6000546001600160a01b03163314611c07576040805162461bcd60e51b81526020600482015260196024820152600080516020611f60833981519152604482015290519081900360640190fd5b60018054911515600160a81b0260ff60a81b19909216919091179055565b6000546001600160a01b03163314611c72576040805162461bcd60e51b81526020600482015260196024820152600080516020611f60833981519152604482015290519081900360640190fd5b60018054911515600160b01b0260ff60b01b19909216919091179055565b600082820183811015610c3c576040805162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015290519081900360640190fd5b600082611cf9575060006112b0565b82820282848281611d0657fe5b0414610c3c5760405162461bcd60e51b8152600401808060200182810382526021815260200180611f126021913960400191505060405180910390fd5b6000610c3c83836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250611dc7565b6000610c3c83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611e69565b60008183611e535760405162461bcd60e51b81526004018080602001828103825283818151815260200191508051906020019080838360005b83811015611e18578181015183820152602001611e00565b50505050905090810190601f168015611e455780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b506000838581611e5f57fe5b0495945050505050565b60008184841115611ebb5760405162461bcd60e51b8152602060048201818152835160248401528351909283926044909101919085019080838360008315611e18578181015183820152602001611e00565b50505090039056fe5661756c745072696365466565643a20696e76616c6964205f707269636553616d706c6553706163655661756c745072696365466565643a20636f756c64206e6f74206665746368207072696365536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f775661756c745072696365466565643a2061646a7573746d656e74206672657175656e63792065786365656465645661756c745072696365466565643a20666f7262696464656e00000000000000436861696e6c696e6b20666565647320617265206e6f74206265696e6720757064617465645661756c745072696365466565643a20696e76616c6964205f7370726561644261736973506f696e74735661756c745072696365466565643a20696e76616c69642070726963652066656564a2646970667358221220abe3ce9b09347efe852de5650cb49a28400cc5d7d7121bb13d268dcd284019eb64736f6c634300060c0033

Block Transaction Gas Used Reward
Age Block Fee Address BC Fee Address Voting Power Jailed Incoming
Block Uncle Number Difficulty Gas Used Reward
Loading
Make sure to use the "Vote Down" button for any spammy posts, and the "Vote Up" for interesting conversations.