Contract 0x73fe72c9caa0faf0e488570d5898984783e728df

 
Txn Hash Method
Block
From
To
Value [Txn Fee]
0x257f822a1249c9026c7e69af7217d202a109aab6d285126bc3b26c2997e157b8Set Compacted Pr...40395352021-12-23 11:23:59153 days 14 hrs ago0xeba076279f41571f7860661ee36665b54f4ca315 IN  0x73fe72c9caa0faf0e488570d5898984783e728df0 ETH0.000524509527 ETH
0x56f999c14bcb2131488a42a7d5fc2f3f79adfdee4b6aec2a19beab710075c86cSet Compacted Pr...40395072021-12-23 11:22:10153 days 14 hrs ago0xeba076279f41571f7860661ee36665b54f4ca315 IN  0x73fe72c9caa0faf0e488570d5898984783e728df0 ETH0.000525517987 ETH
0x20b9a4feb4c9fb3031afa7bacdbce8c952ed6f34be69f65a2861022c1790532cSet Compacted Pr...40394612021-12-23 11:17:42153 days 14 hrs ago0xeba076279f41571f7860661ee36665b54f4ca315 IN  0x73fe72c9caa0faf0e488570d5898984783e728df0 ETH0.000524509527 ETH
0xb8a2ed7acc693f8d549ce9bb79d834c25076d283d22fc3dddc45ffb6fa4e3bf2Set Compacted Pr...40394282021-12-23 11:14:41153 days 14 hrs ago0xeba076279f41571f7860661ee36665b54f4ca315 IN  0x73fe72c9caa0faf0e488570d5898984783e728df0 ETH0.000524509527 ETH
0xdb271301ed2e9b96ac533a286819496be5ca65949fc9f5dfac8f2a8b1627a5b9Set Compacted Pr...40394252021-12-23 11:14:41153 days 14 hrs ago0xeba076279f41571f7860661ee36665b54f4ca315 IN  0x73fe72c9caa0faf0e488570d5898984783e728df0 ETH0.000525517987 ETH
0x6a1c3e52e77a17002dc50e617c9c6dcdedd09598def4f7ab29b3a0ad92e4d5c8Set Compacted Pr...40393672021-12-23 11:08:42153 days 14 hrs ago0xeba076279f41571f7860661ee36665b54f4ca315 IN  0x73fe72c9caa0faf0e488570d5898984783e728df0 ETH0.000523501067 ETH
0x38e9cf66b19004f55955b9b3cf7070cb48f6d0e9aa7c87e42fa5a4471894fc8aSet Compacted Pr...40393272021-12-23 11:05:37153 days 14 hrs ago0xeba076279f41571f7860661ee36665b54f4ca315 IN  0x73fe72c9caa0faf0e488570d5898984783e728df0 ETH0.000524509527 ETH
0x211eff003ed6f62a7ecb37087bc0318f8e71bb3e7a330c2c1177d553abd7d4a9Set Compacted Pr...40393052021-12-23 11:04:33153 days 14 hrs ago0xeba076279f41571f7860661ee36665b54f4ca315 IN  0x73fe72c9caa0faf0e488570d5898984783e728df0 ETH0.000524509527 ETH
0x3af48363a924066e0f1f8b3f3c0bbab5289499f887ce909228c4cfea2e209477Set Compacted Pr...40392962021-12-23 11:03:53153 days 14 hrs ago0xeba076279f41571f7860661ee36665b54f4ca315 IN  0x73fe72c9caa0faf0e488570d5898984783e728df0 ETH0.000524509527 ETH
0x3fa3211140841788a0a981b249f45d22097e1393ef27607e59f70c94b995468bSet Compacted Pr...40392922021-12-23 11:02:39153 days 14 hrs ago0xeba076279f41571f7860661ee36665b54f4ca315 IN  0x73fe72c9caa0faf0e488570d5898984783e728df0 ETH0.000524509527 ETH
0x5a29d04c7f3a1034aac7147e5cf6f783e8d7c6a2710058002d84ef93ea989b22Set Compacted Pr...40392822021-12-23 11:00:43153 days 14 hrs ago0xeba076279f41571f7860661ee36665b54f4ca315 IN  0x73fe72c9caa0faf0e488570d5898984783e728df0 ETH0.000525517987 ETH
0x2995849b008811bc0940de58a257b0953c03ecee0a80b5a09ba30a00538739d4Set Compacted Pr...40392552021-12-23 10:59:58153 days 14 hrs ago0xeba076279f41571f7860661ee36665b54f4ca315 IN  0x73fe72c9caa0faf0e488570d5898984783e728df0 ETH0.000525517987 ETH
0x2ee950f4fd83e87ec71b0ff5d527b3aa7f50ca0c552b35953917fa9e41fa2875Set Compacted Pr...40392442021-12-23 10:58:52153 days 14 hrs ago0xeba076279f41571f7860661ee36665b54f4ca315 IN  0x73fe72c9caa0faf0e488570d5898984783e728df0 ETH0.000525517987 ETH
0xcc78137266ac5021c73e3018b5ca3b003037f969872ef18d68b9fedc630e131eSet Compacted Pr...40392222021-12-23 10:57:21153 days 14 hrs ago0xeba076279f41571f7860661ee36665b54f4ca315 IN  0x73fe72c9caa0faf0e488570d5898984783e728df0 ETH0.000525517987 ETH
0xfe2f71cd2bc893bfd671390afa511747d4083a38249f7f0b8514e4e7e8dc3fbeSet Compacted Pr...40391432021-12-23 10:49:45153 days 14 hrs ago0xeba076279f41571f7860661ee36665b54f4ca315 IN  0x73fe72c9caa0faf0e488570d5898984783e728df0 ETH0.000524509527 ETH
0x01676cb3a3a72021735c4a95e31dbdb08fbb78234577956d71b371dfe1da9790Set Compacted Pr...40391032021-12-23 10:47:00153 days 14 hrs ago0xeba076279f41571f7860661ee36665b54f4ca315 IN  0x73fe72c9caa0faf0e488570d5898984783e728df0 ETH0.000524509527 ETH
0x7e26e9782fc31c5188d06513a9a047e0dbdf06b6b20ad6eb29fcaf86a06b1509Set Compacted Pr...40390912021-12-23 10:47:00153 days 14 hrs ago0xeba076279f41571f7860661ee36665b54f4ca315 IN  0x73fe72c9caa0faf0e488570d5898984783e728df0 ETH0.000525517987 ETH
0x319d1501bc8a0ba8e60f0ee8d78cb4a4d51d4c87b57f0e47086ba959518e0ea5Set Compacted Pr...40390212021-12-23 10:43:01153 days 14 hrs ago0xeba076279f41571f7860661ee36665b54f4ca315 IN  0x73fe72c9caa0faf0e488570d5898984783e728df0 ETH0.000524509527 ETH
0xeda59a45f2fe180a2ba007876509e0102bb99a53076a79a6e1a91bcffd6cefafSet Compacted Pr...40389582021-12-23 10:38:15153 days 14 hrs ago0xeba076279f41571f7860661ee36665b54f4ca315 IN  0x73fe72c9caa0faf0e488570d5898984783e728df0 ETH0.000524509527 ETH
0x32eaac6f731725fb593610d2f61661028e2d290dd10d2adc4dbcb3d068a0c98aSet Compacted Pr...40387892021-12-23 10:26:47153 days 15 hrs ago0xeba076279f41571f7860661ee36665b54f4ca315 IN  0x73fe72c9caa0faf0e488570d5898984783e728df0 ETH0.000524509527 ETH
0xb4ef95866f96c5a0820d9f30f3442be86aeee7ff0745eb86f6909c53a7667e89Set Compacted Pr...40387552021-12-23 10:24:04153 days 15 hrs ago0xeba076279f41571f7860661ee36665b54f4ca315 IN  0x73fe72c9caa0faf0e488570d5898984783e728df0 ETH0.000525517987 ETH
0x8af7c0b43bd4fdcdf59d6c7a57b047075e65b77b0204341d08bcce6c33f8b915Set Compacted Pr...40386942021-12-23 10:19:36153 days 15 hrs ago0xeba076279f41571f7860661ee36665b54f4ca315 IN  0x73fe72c9caa0faf0e488570d5898984783e728df0 ETH0.000523501067 ETH
0x15491d760ed437e4d297d921fd15ab6014580a23f0d0fd285251381696093499Set Compacted Pr...40386812021-12-23 10:18:44153 days 15 hrs ago0xeba076279f41571f7860661ee36665b54f4ca315 IN  0x73fe72c9caa0faf0e488570d5898984783e728df0 ETH0.000524509527 ETH
0x0776eec481452d4c06f5786fd733b9c7e3e5741b5a1647fd1b33b3d6f39df81dSet Compacted Pr...40386482021-12-23 10:13:53153 days 15 hrs ago0xeba076279f41571f7860661ee36665b54f4ca315 IN  0x73fe72c9caa0faf0e488570d5898984783e728df0 ETH0.000524509527 ETH
0xca8fbcaa016e3e744806cb00517828c54e462e0ed08ed3feac80eafc18e0f1ebSet Compacted Pr...40386402021-12-23 10:13:53153 days 15 hrs ago0xeba076279f41571f7860661ee36665b54f4ca315 IN  0x73fe72c9caa0faf0e488570d5898984783e728df0 ETH0.000524509527 ETH
[ Download CSV Export 
Latest 25 internal transaction
Parent Txn Hash Block From To Value
0x8c3a397a295e3c4d437d24791170796f3ca962612e78e473e375d51830c00c0240324402021-12-23 2:52:15153 days 22 hrs ago 0x1cf4579904eb2acda0e4081e39ec10d0c32b5de3 0x73fe72c9caa0faf0e488570d5898984783e728df0 ETH
0x8c3a397a295e3c4d437d24791170796f3ca962612e78e473e375d51830c00c0240324402021-12-23 2:52:15153 days 22 hrs ago 0x1cf4579904eb2acda0e4081e39ec10d0c32b5de3 0x73fe72c9caa0faf0e488570d5898984783e728df0 ETH
0x8c3a397a295e3c4d437d24791170796f3ca962612e78e473e375d51830c00c0240324402021-12-23 2:52:15153 days 22 hrs ago 0x1cf4579904eb2acda0e4081e39ec10d0c32b5de3 0x73fe72c9caa0faf0e488570d5898984783e728df0 ETH
0xd9de4b32bc24fc34895e4362b36c45c56f472fddeb1669b190a83e7095656c9c40324262021-12-23 2:51:19153 days 22 hrs ago 0x1cf4579904eb2acda0e4081e39ec10d0c32b5de3 0x73fe72c9caa0faf0e488570d5898984783e728df0 ETH
0xd9de4b32bc24fc34895e4362b36c45c56f472fddeb1669b190a83e7095656c9c40324262021-12-23 2:51:19153 days 22 hrs ago 0x1cf4579904eb2acda0e4081e39ec10d0c32b5de3 0x73fe72c9caa0faf0e488570d5898984783e728df0 ETH
0xd9de4b32bc24fc34895e4362b36c45c56f472fddeb1669b190a83e7095656c9c40324262021-12-23 2:51:19153 days 22 hrs ago 0x1cf4579904eb2acda0e4081e39ec10d0c32b5de3 0x73fe72c9caa0faf0e488570d5898984783e728df0 ETH
0x7cf352cced15f386baf7ee7779b05fb76ce8e61e5428f1cbb9827aa61289bb2040324172021-12-23 2:50:30153 days 22 hrs ago 0x1cf4579904eb2acda0e4081e39ec10d0c32b5de3 0x73fe72c9caa0faf0e488570d5898984783e728df0 ETH
0x7cf352cced15f386baf7ee7779b05fb76ce8e61e5428f1cbb9827aa61289bb2040324172021-12-23 2:50:30153 days 22 hrs ago 0x1cf4579904eb2acda0e4081e39ec10d0c32b5de3 0x73fe72c9caa0faf0e488570d5898984783e728df0 ETH
0x7cf352cced15f386baf7ee7779b05fb76ce8e61e5428f1cbb9827aa61289bb2040324172021-12-23 2:50:30153 days 22 hrs ago 0x1cf4579904eb2acda0e4081e39ec10d0c32b5de3 0x73fe72c9caa0faf0e488570d5898984783e728df0 ETH
0x7cf352cced15f386baf7ee7779b05fb76ce8e61e5428f1cbb9827aa61289bb2040324172021-12-23 2:50:30153 days 22 hrs ago 0x1cf4579904eb2acda0e4081e39ec10d0c32b5de3 0x73fe72c9caa0faf0e488570d5898984783e728df0 ETH
0x7cf352cced15f386baf7ee7779b05fb76ce8e61e5428f1cbb9827aa61289bb2040324172021-12-23 2:50:30153 days 22 hrs ago 0x1cf4579904eb2acda0e4081e39ec10d0c32b5de3 0x73fe72c9caa0faf0e488570d5898984783e728df0 ETH
0x7cf352cced15f386baf7ee7779b05fb76ce8e61e5428f1cbb9827aa61289bb2040324172021-12-23 2:50:30153 days 22 hrs ago 0x1cf4579904eb2acda0e4081e39ec10d0c32b5de3 0x73fe72c9caa0faf0e488570d5898984783e728df0 ETH
0x0ee0df14f582780f6513ca9bba17b3bcbf738feea6bf7161727ae4e9c95c269240324112021-12-23 2:48:51153 days 22 hrs ago 0x1cf4579904eb2acda0e4081e39ec10d0c32b5de3 0x73fe72c9caa0faf0e488570d5898984783e728df0 ETH
0x0ee0df14f582780f6513ca9bba17b3bcbf738feea6bf7161727ae4e9c95c269240324112021-12-23 2:48:51153 days 22 hrs ago 0x1cf4579904eb2acda0e4081e39ec10d0c32b5de3 0x73fe72c9caa0faf0e488570d5898984783e728df0 ETH
0x0ee0df14f582780f6513ca9bba17b3bcbf738feea6bf7161727ae4e9c95c269240324112021-12-23 2:48:51153 days 22 hrs ago 0x1cf4579904eb2acda0e4081e39ec10d0c32b5de3 0x73fe72c9caa0faf0e488570d5898984783e728df0 ETH
0x0ee0df14f582780f6513ca9bba17b3bcbf738feea6bf7161727ae4e9c95c269240324112021-12-23 2:48:51153 days 22 hrs ago 0x1cf4579904eb2acda0e4081e39ec10d0c32b5de3 0x73fe72c9caa0faf0e488570d5898984783e728df0 ETH
0x0ee0df14f582780f6513ca9bba17b3bcbf738feea6bf7161727ae4e9c95c269240324112021-12-23 2:48:51153 days 22 hrs ago 0x1cf4579904eb2acda0e4081e39ec10d0c32b5de3 0x73fe72c9caa0faf0e488570d5898984783e728df0 ETH
0x6b079e303ab8dfbd8f133b22a6ca7ce5ff2643d3b0127f0c7ea54dd6bef8f77a40324002021-12-23 2:48:51153 days 22 hrs ago 0x1cf4579904eb2acda0e4081e39ec10d0c32b5de3 0x73fe72c9caa0faf0e488570d5898984783e728df0 ETH
0x6b079e303ab8dfbd8f133b22a6ca7ce5ff2643d3b0127f0c7ea54dd6bef8f77a40324002021-12-23 2:48:51153 days 22 hrs ago 0x1cf4579904eb2acda0e4081e39ec10d0c32b5de3 0x73fe72c9caa0faf0e488570d5898984783e728df0 ETH
0x6b079e303ab8dfbd8f133b22a6ca7ce5ff2643d3b0127f0c7ea54dd6bef8f77a40324002021-12-23 2:48:51153 days 22 hrs ago 0x1cf4579904eb2acda0e4081e39ec10d0c32b5de3 0x73fe72c9caa0faf0e488570d5898984783e728df0 ETH
0x6b079e303ab8dfbd8f133b22a6ca7ce5ff2643d3b0127f0c7ea54dd6bef8f77a40324002021-12-23 2:48:51153 days 22 hrs ago 0x1cf4579904eb2acda0e4081e39ec10d0c32b5de3 0x73fe72c9caa0faf0e488570d5898984783e728df0 ETH
0x6b079e303ab8dfbd8f133b22a6ca7ce5ff2643d3b0127f0c7ea54dd6bef8f77a40324002021-12-23 2:48:51153 days 22 hrs ago 0x1cf4579904eb2acda0e4081e39ec10d0c32b5de3 0x73fe72c9caa0faf0e488570d5898984783e728df0 ETH
0xd36fe9aaed74169ca4921a3dfac8b0cbd201fe87a3e6672f9f0b7fba5a537d5140323972021-12-23 2:48:51153 days 22 hrs ago 0x1cf4579904eb2acda0e4081e39ec10d0c32b5de3 0x73fe72c9caa0faf0e488570d5898984783e728df0 ETH
0xd36fe9aaed74169ca4921a3dfac8b0cbd201fe87a3e6672f9f0b7fba5a537d5140323972021-12-23 2:48:51153 days 22 hrs ago 0x1cf4579904eb2acda0e4081e39ec10d0c32b5de3 0x73fe72c9caa0faf0e488570d5898984783e728df0 ETH
0xd36fe9aaed74169ca4921a3dfac8b0cbd201fe87a3e6672f9f0b7fba5a537d5140323972021-12-23 2:48:51153 days 22 hrs ago 0x1cf4579904eb2acda0e4081e39ec10d0c32b5de3 0x73fe72c9caa0faf0e488570d5898984783e728df0 ETH
[ Download CSV Export 
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

Contract Source Code (Solidity Standard Json-Input format)

File 1 of 4 : FastPriceFeed.sol
// SPDX-License-Identifier: MIT

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

import "./interfaces/ISecondaryPriceFeed.sol";
import "../access/Governable.sol";

pragma solidity 0.6.12;

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

    uint256 public constant PRICE_PRECISION = 10 ** 30;
    uint256 public constant COMPACTED_PRECISION = 10 ** 3;

    // 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 PRICE_BITMASK = uint256(~0) >> (256 - 32);

    bool public isInitialized;
    bool public isSpreadEnabled = false;

    uint256 public constant BASIS_POINTS_DIVISOR = 10000;

    uint256 public constant MAX_PRICE_DURATION = 30 minutes;

    uint256 public lastUpdatedAt;
    uint256 public priceDuration;

    // volatility basis points
    uint256 public volBasisPoints;
    // max deviation from primary price
    uint256 public maxDeviationBasisPoints;

    mapping (address => uint256) public prices;

    uint256 public minAuthorizations;
    uint256 public disableFastPriceVoteCount = 0;
    mapping (address => bool) public isSigner;
    mapping (address => bool) public disableFastPriceVotes;

    address[] public tokens;

    event SetPrice(address token, uint256 price);

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

    constructor(uint256 _priceDuration, uint256 _maxDeviationBasisPoints) public {
        require(_priceDuration <= MAX_PRICE_DURATION, "FastPriceFeed: invalid _priceDuration");
        priceDuration = _priceDuration;
        maxDeviationBasisPoints = _maxDeviationBasisPoints;
    }

    function initialize(uint256 _minAuthorizations, address[] memory _signers) 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;
        }
    }

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

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

    function setVolBasisPoints(uint256 _volBasisPoints) external onlyGov {
        volBasisPoints = _volBasisPoints;
    }

    function setPrices(address[] memory _tokens, uint256[] memory _prices) external onlyGov {
        for (uint256 i = 0; i < _tokens.length; i++) {
            address token = _tokens[i];
            prices[token] = _prices[i];
            emit SetPrice(token, _prices[i]);
        }
        lastUpdatedAt = block.timestamp;
    }

    function setTokens(address[] memory _tokens) external onlyGov {
        tokens = _tokens;
    }

    function setCompactedPrices(uint256[] memory _priceBitArray) external onlyGov {
        lastUpdatedAt = block.timestamp;

        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) & PRICE_BITMASK;

                address token = tokens[i * 8 + j];
                uint256 adjustedPrice = price.mul(PRICE_PRECISION).div(COMPACTED_PRECISION);
                prices[token] = adjustedPrice;
                emit SetPrice(token, adjustedPrice);
            }
        }
    }

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

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

    function favorFastPrice() public view returns (bool) {
        return (disableFastPriceVoteCount < minAuthorizations) && !isSpreadEnabled;
    }

    function getPrice(address _token, uint256 _refPrice, bool _maximise) external override view returns (uint256) {
        if (block.timestamp > lastUpdatedAt.add(priceDuration)) { return _refPrice; }

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

        uint256 maxPrice = _refPrice.mul(BASIS_POINTS_DIVISOR.add(maxDeviationBasisPoints)).div(BASIS_POINTS_DIVISOR);
        uint256 minPrice = _refPrice.mul(BASIS_POINTS_DIVISOR.sub(maxDeviationBasisPoints)).div(BASIS_POINTS_DIVISOR);

        if (favorFastPrice()) {
            if (fastPrice >= minPrice && fastPrice <= maxPrice) {
                if (_maximise) {
                    if (_refPrice > fastPrice) {
                        uint256 volPrice = fastPrice.mul(BASIS_POINTS_DIVISOR.add(volBasisPoints)).div(BASIS_POINTS_DIVISOR);
                        // the volPrice should not be more than _refPrice
                        return volPrice > _refPrice ? _refPrice : volPrice;
                    }
                    return fastPrice;
                }

                if (_refPrice < fastPrice) {
                    uint256 volPrice = fastPrice.mul(BASIS_POINTS_DIVISOR.sub(volBasisPoints)).div(BASIS_POINTS_DIVISOR);
                    // the volPrice should not be less than _refPrice
                    return volPrice < _refPrice ? _refPrice : volPrice;
                }

                return fastPrice;
            }
        }

        if (_maximise) {
            if (_refPrice > fastPrice) { return _refPrice; }
            return fastPrice > maxPrice ? maxPrice : fastPrice;
        }

        if (_refPrice < fastPrice) { return _refPrice; }
        return fastPrice < minPrice ? minPrice : fastPrice;
    }
}

File 2 of 4 : 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 4 : 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 4 of 4 : 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;
    }
}

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

Contract ABI

[{"inputs":[{"internalType":"uint256","name":"_priceDuration","type":"uint256"},{"internalType":"uint256","name":"_maxDeviationBasisPoints","type":"uint256"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"token","type":"address"},{"indexed":false,"internalType":"uint256","name":"price","type":"uint256"}],"name":"SetPrice","type":"event"},{"inputs":[],"name":"BASIS_POINTS_DIVISOR","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"COMPACTED_PRECISION","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":"PRICE_BITMASK","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":"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":[],"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[]"}],"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":[],"name":"lastUpdatedAt","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":"minAuthorizations","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[]"}],"name":"setCompactedPrices","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":"_priceDuration","type":"uint256"}],"name":"setPriceDuration","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address[]","name":"_tokens","type":"address[]"},{"internalType":"uint256[]","name":"_prices","type":"uint256[]"}],"name":"setPrices","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address[]","name":"_tokens","type":"address[]"}],"name":"setTokens","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_volBasisPoints","type":"uint256"}],"name":"setVolBasisPoints","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"tokens","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"volBasisPoints","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"}]

60806040526000805460ff60a81b1916815560075534801561002057600080fd5b506040516115263803806115268339818101604052604081101561004357600080fd5b508051602090910151600080546001600160a01b0319163317905561070882111561009f5760405162461bcd60e51b81526004018080602001828103825260258152602001806115016025913960400191505060405180910390fd5b60029190915560045561144a806100b76000396000f3fe608060405234801561001057600080fd5b506004361061016a5760003560e01c806303b049361461016f57806303cd2571146101a9578063114fbeb3146101c3578063126082cf146101cb57806312d43a51146101d35780631d4e3740146101f7578063287800c91461029a5780633654c979146102a2578063392e53cd146102aa5780634352fa9f146102b257806344c23193146103d55780634f64b2be146103f257806354aea1271461040f578063625adaf214610417578063668d3d65146104b8578063695d4184146104c05780636ccd47c4146104c8578063715c7536146104d05780637df73e27146104d85780637fece368146104fe57806395082d25146105325780639e4de0e31461053a578063a920b78c14610557578063b0a25666146105ff578063c0e4de8e14610607578063c84a91241461060f578063ce98dfa814610617578063cfad57a214610636578063cfed246b1461065c578063f67e3bf014610682575b600080fd5b6101956004803603602081101561018557600080fd5b50356001600160a01b031661068a565b604080519115158252519081900360200190f35b6101b161069f565b60408051918252519081900360200190f35b6101b16106a5565b6101b16106ab565b6101db6106b1565b604080516001600160a01b039092168252519081900360200190f35b6102986004803603602081101561020d57600080fd5b810190602081018135600160201b81111561022757600080fd5b82018360208201111561023957600080fd5b803590602001918460208302840111600160201b8311171561025a57600080fd5b9190808060200260200160405190810160405280939291908181526020018383602002808284376000920191909152509295506106c0945050505050565b005b6101b161081d565b6101b1610823565b610195610829565b610298600480360360408110156102c857600080fd5b810190602081018135600160201b8111156102e257600080fd5b8201836020820111156102f457600080fd5b803590602001918460208302840111600160201b8311171561031557600080fd5b9190808060200260200160405190810160405280939291908181526020018383602002808284376000920191909152509295949360208101935035915050600160201b81111561036457600080fd5b82018360208201111561037657600080fd5b803590602001918460208302840111600160201b8311171561039757600080fd5b919080806020026020016040519081016040528093929190818152602001838360200280828437600092019190915250929550610839945050505050565b610298600480360360208110156103eb57600080fd5b5035610942565b6101db6004803603602081101561040857600080fd5b50356109d5565b6101b16109fc565b6102986004803603602081101561042d57600080fd5b810190602081018135600160201b81111561044757600080fd5b82018360208201111561045957600080fd5b803590602001918460208302840111600160201b8311171561047a57600080fd5b919080806020026020016040519081016040528093929190818152602001838360200280828437600092019190915250929550610a02945050505050565b6101b1610a62565b610195610a68565b610298610a78565b6101b1610b65565b610195600480360360208110156104ee57600080fd5b50356001600160a01b0316610b6b565b6101b16004803603606081101561051457600080fd5b506001600160a01b0381351690602081013590604001351515610b80565b6101b1610d3e565b6102986004803603602081101561055057600080fd5b5035610d4e565b6102986004803603604081101561056d57600080fd5b81359190810190604081016020820135600160201b81111561058e57600080fd5b8201836020820111156105a057600080fd5b803590602001918460208302840111600160201b831117156105c157600080fd5b919080806020026020016040519081016040528093929190818152602001838360200280828437600092019190915250929550610da0945050505050565b6101b1610ea7565b610195610ead565b610298610ed1565b6102986004803603602081101561062d57600080fd5b50351515610fbd565b6102986004803603602081101561064c57600080fd5b50356001600160a01b0316611028565b6101b16004803603602081101561067257600080fd5b50356001600160a01b0316611097565b6101b16110a9565b60096020526000908152604090205460ff1681565b60025481565b60035481565b61271081565b6000546001600160a01b031681565b6000546001600160a01b0316331461070d576040805162461bcd60e51b81526020600482015260156024820152600080516020611392833981519152604482015290519081900360640190fd5b4260015560005b815181101561081857600082828151811061072b57fe5b6020026020010151905060005b600881101561080e57600a5460088402820190811061075a575050505061081a565b600a8054602084029185831c63ffffffff16916000919060088902870190811061078057fe5b60009182526020822001546001600160a01b031691506107b86103e86107b28568327cb2734119d3b7a9601e1b6110b1565b90611113565b6001600160a01b0383166000818152600560209081526040918290208490558151928352820183905280519293506000805160206113f583398151915292918290030190a1505060019093019250610738915050565b5050600101610714565b505b50565b60065481565b6103e881565b600054600160a01b900460ff1681565b6000546001600160a01b03163314610886576040805162461bcd60e51b81526020600482015260156024820152600080516020611392833981519152604482015290519081900360640190fd5b60005b82518110156109395760008382815181106108a057fe5b602002602001015190508282815181106108b657fe5b602002602001015160056000836001600160a01b03166001600160a01b03168152602001908152602001600020819055506000805160206113f58339815191528184848151811061090357fe5b602002602001015160405180836001600160a01b031681526020018281526020019250505060405180910390a150600101610889565b50504260015550565b6000546001600160a01b0316331461098f576040805162461bcd60e51b81526020600482015260156024820152600080516020611392833981519152604482015290519081900360640190fd5b6107088111156109d05760405162461bcd60e51b815260040180806020018281038252602581526020018061136d6025913960400191505060405180910390fd5b600255565b600a81815481106109e257fe5b6000918252602090912001546001600160a01b0316905081565b60015481565b6000546001600160a01b03163314610a4f576040805162461bcd60e51b81526020600482015260156024820152600080516020611392833981519152604482015290519081900360640190fd5b805161081890600a9060208401906112e8565b61070881565b600054600160a81b900460ff1681565b3360009081526008602052604090205460ff16610ad7576040805162461bcd60e51b81526020600482015260186024820152772330b9ba283934b1b2a332b2b21d103337b93134b23232b760411b604482015290519081900360640190fd5b3360009081526009602052604090205460ff16610b3b576040805162461bcd60e51b815260206004820152601e60248201527f466173745072696365466565643a20616c726561647920656e61626c65640000604482015290519081900360640190fd5b336000908152600960205260409020805460ff19169055600754610b60906001611152565b600755565b60045481565b60086020526000908152604090205460ff1681565b6000610b9960025460015461119490919063ffffffff16565b421115610ba7575081610d37565b6001600160a01b03841660009081526005602052604090205480610bce5783915050610d37565b6000610bf76127106107b2610bf060045461271061119490919063ffffffff16565b88906110b1565b90506000610c226127106107b2610c1b60045461271061115290919063ffffffff16565b89906110b1565b9050610c2c610ead565b15610cdd57808310158015610c415750818311155b15610cdd578415610ca45782861115610c99576000610c7d6127106107b2610c7660035461271061119490919063ffffffff16565b87906110b1565b9050868111610c8c5780610c8e565b865b945050505050610d37565b829350505050610d37565b82861015610c99576000610cce6127106107b2610c7660035461271061115290919063ffffffff16565b9050868110610c8c5780610c8e565b8415610d0f5782861115610cf657859350505050610d37565b818311610d035782610d05565b815b9350505050610d37565b82861015610d2257859350505050610d37565b808310610d2f5782610d31565b805b93505050505b9392505050565b68327cb2734119d3b7a9601e1b81565b6000546001600160a01b03163314610d9b576040805162461bcd60e51b81526020600482015260156024820152600080516020611392833981519152604482015290519081900360640190fd5b600355565b6000546001600160a01b03163314610ded576040805162461bcd60e51b81526020600482015260156024820152600080516020611392833981519152604482015290519081900360640190fd5b600054600160a01b900460ff1615610e365760405162461bcd60e51b81526004018080602001828103825260228152602001806113d36022913960400191505060405180910390fd5b6000805460ff60a01b1916600160a01b17815560068390555b8151811015610ea2576000828281518110610e6657fe5b6020908102919091018101516001600160a01b03166000908152600890915260409020805460ff19166001908117909155919091019050610e4f565b505050565b60075481565b6000600654600754108015610ecc5750600054600160a81b900460ff16155b905090565b3360009081526008602052604090205460ff16610f30576040805162461bcd60e51b81526020600482015260186024820152772330b9ba283934b1b2a332b2b21d103337b93134b23232b760411b604482015290519081900360640190fd5b3360009081526009602052604090205460ff1615610f94576040805162461bcd60e51b815260206004820152601c60248201527b11985cdd141c9a58d9519959590e88185b1c9958591e481d9bdd195960221b604482015290519081900360640190fd5b336000908152600960205260409020805460ff19166001908117909155600754610b6091611194565b6000546001600160a01b0316331461100a576040805162461bcd60e51b81526020600482015260156024820152600080516020611392833981519152604482015290519081900360640190fd5b60008054911515600160a81b0260ff60a81b19909216919091179055565b6000546001600160a01b03163314611075576040805162461bcd60e51b81526020600482015260156024820152600080516020611392833981519152604482015290519081900360640190fd5b600080546001600160a01b0319166001600160a01b0392909216919091179055565b60056020526000908152604090205481565b63ffffffff81565b6000826110c05750600061110d565b828202828482816110cd57fe5b041461110a5760405162461bcd60e51b81526004018080602001828103825260218152602001806113b26021913960400191505060405180910390fd5b90505b92915050565b600061110a83836040518060400160405280601a815260200179536166654d6174683a206469766973696f6e206279207a65726f60301b8152506111ec565b600061110a83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f77000081525061128e565b60008282018381101561110a576040805162461bcd60e51b815260206004820152601b60248201527a536166654d6174683a206164646974696f6e206f766572666c6f7760281b604482015290519081900360640190fd5b600081836112785760405162461bcd60e51b81526004018080602001828103825283818151815260200191508051906020019080838360005b8381101561123d578181015183820152602001611225565b50505050905090810190601f16801561126a5780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b50600083858161128457fe5b0495945050505050565b600081848411156112e05760405162461bcd60e51b815260206004820181815283516024840152835190928392604490910191908501908083836000831561123d578181015183820152602001611225565b505050900390565b82805482825590600052602060002090810192821561133d579160200282015b8281111561133d57825182546001600160a01b0319166001600160a01b03909116178255602090920191600190910190611308565b5061134992915061134d565b5090565b5b808211156113495780546001600160a01b031916815560010161134e56fe466173745072696365466565643a20696e76616c6964205f70726963654475726174696f6e476f7665726e61626c653a20666f7262696464656e0000000000000000000000536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f77466173745072696365466565643a20616c726561647920696e697469616c697a656495dce27040c59c8b1c445b284f81a3aaae6eecd7d08d5c7684faee64cdb514a1a26469706673582212202320a60d244541f73309ba5838da6bd3b96b7e5d07e7465331a488f722a384b464736f6c634300060c0033466173745072696365466565643a20696e76616c6964205f70726963654475726174696f6e000000000000000000000000000000000000000000000000000000000000012c00000000000000000000000000000000000000000000000000000000000000fa

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

000000000000000000000000000000000000000000000000000000000000012c00000000000000000000000000000000000000000000000000000000000000fa

-----Decoded View---------------
Arg [0] : _priceDuration (uint256): 300
Arg [1] : _maxDeviationBasisPoints (uint256): 250

-----Encoded View---------------
2 Constructor Arguments found :
Arg [0] : 000000000000000000000000000000000000000000000000000000000000012c
Arg [1] : 00000000000000000000000000000000000000000000000000000000000000fa


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