Contract 0x6d297c84a242aff33e33617e109d664f081f2889

Contract Overview

Balance:
0 BNB
Txn Hash Method
Block
From
To
Value [Txn Fee]
0x7542cea45455cb48763a9d8405b25a41698d7912790f23d640808c8b267f89620x6080604087371782021-05-11 3:03:45137 days 23 hrs ago0x20000b9b01e93a39db9d286e9264eff7f2af16e9 IN  Contract Creation0 BNB0.01385341
[ Download CSV Export 
Latest 25 internal transaction
Parent Txn Hash Block From To Value
0x5a54b423f9a45abfce4c5887e1ce84ca62989eb5d3c8a1f8ff4135348051cb51123873562021-09-15 12:22:0710 days 14 hrs ago 0x94f3d7ecd0c421a334d93a72f23254d94bc717f1 0x6d297c84a242aff33e33617e109d664f081f28890 BNB
0x625e5023ff9116ae5bc7345883efe44b87128dd425d7c0f5f23b1e6b54c14314123873492021-09-15 12:21:4610 days 14 hrs ago 0x94f3d7ecd0c421a334d93a72f23254d94bc717f1 0x6d297c84a242aff33e33617e109d664f081f28890 BNB
0x191d40b329b740f1d48a4f240f97bec567eb925ebc2b3cafd57ce2e180c7c8ef123873292021-09-15 12:20:4610 days 14 hrs ago 0x94f3d7ecd0c421a334d93a72f23254d94bc717f1 0x6d297c84a242aff33e33617e109d664f081f28890 BNB
0x6112466e6e95ddff7c7ff01f624e20a5932fad2fe8534a2d2ba090ba563192c8123872632021-09-15 12:17:2810 days 14 hrs ago 0x94f3d7ecd0c421a334d93a72f23254d94bc717f1 0x6d297c84a242aff33e33617e109d664f081f28890 BNB
0xd9d092213f7121c351146ba2ffc4e5b36000c33e51a5e9fb9c33d905b0e187cb123872292021-09-15 12:15:4610 days 14 hrs ago 0x94f3d7ecd0c421a334d93a72f23254d94bc717f1 0x6d297c84a242aff33e33617e109d664f081f28890 BNB
0x885af7b861aed679fb97d62edc3526ea9ca49a7b6f8b047653dbe259953d14c3123872232021-09-15 12:15:2810 days 14 hrs ago 0x94f3d7ecd0c421a334d93a72f23254d94bc717f1 0x6d297c84a242aff33e33617e109d664f081f28890 BNB
0xe1a6657d036e10dce32a5d1e793ac58229765aaa589d329888bea82362d00a43123871692021-09-15 12:12:4610 days 14 hrs ago 0x94f3d7ecd0c421a334d93a72f23254d94bc717f1 0x6d297c84a242aff33e33617e109d664f081f28890 BNB
0x70a7e781a69519fa28a9fafdcba9fd2e46fa735a9b7569d5955617639b62e163123871562021-09-15 12:12:0710 days 14 hrs ago 0x94f3d7ecd0c421a334d93a72f23254d94bc717f1 0x6d297c84a242aff33e33617e109d664f081f28890 BNB
0xe56ab4dadbdad552e6a8a5e66de7f704e5d17032328e51d38c33618fa556ca44123870832021-09-15 12:08:2810 days 14 hrs ago 0x94f3d7ecd0c421a334d93a72f23254d94bc717f1 0x6d297c84a242aff33e33617e109d664f081f28890 BNB
0x3e35a860f6885abb4aa51b3aa070750928d003991653e3fd5f6db41608822c43123870632021-09-15 12:07:2810 days 14 hrs ago 0x94f3d7ecd0c421a334d93a72f23254d94bc717f1 0x6d297c84a242aff33e33617e109d664f081f28890 BNB
0xcee49178f21d6509020e55f7ddab3d131a7235d24eb868299439ab16a984124d123870432021-09-15 12:06:2810 days 14 hrs ago 0x94f3d7ecd0c421a334d93a72f23254d94bc717f1 0x6d297c84a242aff33e33617e109d664f081f28890 BNB
0xd672575061bacea0b8c24cd0723943b1003ee308b00071f302fc7aea5acec457123870362021-09-15 12:06:0710 days 14 hrs ago 0x94f3d7ecd0c421a334d93a72f23254d94bc717f1 0x6d297c84a242aff33e33617e109d664f081f28890 BNB
0xb530f883d09de39b255632d8b5886ba45c2270c5869aab9ae57a1a3396821696123869892021-09-15 12:03:4610 days 14 hrs ago 0x94f3d7ecd0c421a334d93a72f23254d94bc717f1 0x6d297c84a242aff33e33617e109d664f081f28890 BNB
0xc8936efb4c5b324b007dca89699cc3b00b040e9cbf3fef509705a306d22c6211123869632021-09-15 12:02:2810 days 14 hrs ago 0x94f3d7ecd0c421a334d93a72f23254d94bc717f1 0x6d297c84a242aff33e33617e109d664f081f28890 BNB
0xc854986696e5323510929d844a45e283f4dea95767ffba5ec9a6775550c9be1b123869232021-09-15 12:00:2810 days 14 hrs ago 0x94f3d7ecd0c421a334d93a72f23254d94bc717f1 0x6d297c84a242aff33e33617e109d664f081f28890 BNB
0xea2e58ab6b688628faef7723119ae9c0e5fee41b975db837ba59ef488816d9e6123869162021-09-15 12:00:0710 days 14 hrs ago 0x94f3d7ecd0c421a334d93a72f23254d94bc717f1 0x6d297c84a242aff33e33617e109d664f081f28890 BNB
0x61685772f5b5c89c11c2c65e2278b1bb7f321bec4fc51284412d18b0e8b260bb123869102021-09-15 11:59:4910 days 14 hrs ago 0x94f3d7ecd0c421a334d93a72f23254d94bc717f1 0x6d297c84a242aff33e33617e109d664f081f28890 BNB
0xbd1c8ae56c56ed79fff2f3187327847f670e4f164e7985aa67f4695ac26df89e123869032021-09-15 11:59:2810 days 14 hrs ago 0x94f3d7ecd0c421a334d93a72f23254d94bc717f1 0x6d297c84a242aff33e33617e109d664f081f28890 BNB
0xca98a79a4590cd5c0f5a8cca85f7bb29735d105c0b6d8e7c52302762dc8b07a4123868962021-09-15 11:59:0710 days 14 hrs ago 0x94f3d7ecd0c421a334d93a72f23254d94bc717f1 0x6d297c84a242aff33e33617e109d664f081f28890 BNB
0xe082e3084059adf23dace51d5bb404718be8b23126473aac1ca3a47c7cc76ae4123868892021-09-15 11:58:4610 days 14 hrs ago 0x94f3d7ecd0c421a334d93a72f23254d94bc717f1 0x6d297c84a242aff33e33617e109d664f081f28890 BNB
0x1b2d835d857379bbf74817b3bf9565d5542803a53b2f591c1a64a5c493ef5402123868492021-09-15 11:56:4610 days 14 hrs ago 0x94f3d7ecd0c421a334d93a72f23254d94bc717f1 0x6d297c84a242aff33e33617e109d664f081f28890 BNB
0x500bcad16eec413baf39907f5240d400db766ea14b93aa97b8ddd856e3301a9d123868432021-09-15 11:56:2810 days 14 hrs ago 0x94f3d7ecd0c421a334d93a72f23254d94bc717f1 0x6d297c84a242aff33e33617e109d664f081f28890 BNB
0x6398618bb56849a78952cf91e9543148bc4fa2cd4d90081c80cbacf1ccd0a061123868362021-09-15 11:56:0710 days 14 hrs ago 0x94f3d7ecd0c421a334d93a72f23254d94bc717f1 0x6d297c84a242aff33e33617e109d664f081f28890 BNB
0x682902b3f9d534fdf7656dea46673c347e57bb9e3107cd9626c0399a0532aca8123868302021-09-15 11:55:4910 days 14 hrs ago 0x94f3d7ecd0c421a334d93a72f23254d94bc717f1 0x6d297c84a242aff33e33617e109d664f081f28890 BNB
0xad48587e672f1012c26b3b5b9dc1b7d4631919059fc281bc5f9de6f9025fac30123868232021-09-15 11:55:2810 days 14 hrs ago 0x94f3d7ecd0c421a334d93a72f23254d94bc717f1 0x6d297c84a242aff33e33617e109d664f081f28890 BNB
[ Download CSV Export 
Loading

Contract Source Code Verified (Similar Match)
Note: This contract matches the deployed ByteCode of the Source Code for Contract 0xd20357E70C73a9eb5a67F33e4380495743D572A7

Contract Name:
SystemSettings

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 16 : SystemSettings.sol
// SPDX-License-Identifier: GPL-3.0-or-later
pragma solidity ^0.6.12;
pragma experimental ABIEncoderV2;

// Inheritance
import "@openzeppelin/contracts-upgradeable/math/SafeMathUpgradeable.sol";
import "@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol";
import "./interface/ISystemSettings.sol";
import "./interface/IExchange.sol";
import "./interface/IInsuranceFund.sol";
// Libraries
import "./utils/Decimal.sol";

contract SystemSettings is OwnableUpgradeable, ISystemSettings {
    using Decimal for Decimal.decimal;
    using SafeMathUpgradeable for uint256;

    //
    // EVENTS
    //
    event InsuranceFundFeeRatioChanged(uint256 insuranceFundFeeRatio);
    event LpWithdrawFeeRatioChanged(uint256 lpWithdrawFeeRatio);
    event OvernightFeeRatioChanged(uint256 overnightFeeRatio);
    event OvernightFeeLpShareRatioChanged(uint256 overnightFeeLpShareRatio);
    event FundingFeeLpShareRatioChanged(uint256 fundingFeeLpShareRatio);
    event OvernightFeePeriodChanged(uint256 overnightFeePeriod);
    event ExchangeAdded(address exchange, address insuranceFund);
    event ExchangeRemoved(address exchange);

    // only admin
    Decimal.decimal private _insuranceFundFeeRatio;

    // only admin
    Decimal.decimal private _lpWithdrawFeeRatio;

    // only admin
    Decimal.decimal private _overnightFeeRatio;

    // only admin
    Decimal.decimal private _overnightFeeLpShareRatio;

    // only admin
    Decimal.decimal private _fundingFeeLpShareRatio;

    // only admin
    bool public _paused;

    struct ExchangeMap {
        IInsuranceFund insuranceFund;
        bool existed;
        uint256 _nextOvernightFeeTime;
    }

    mapping(address => ExchangeMap) private exchangeMap;
    IExchange[] private exchanges;

    //only admin
    uint256 private _overnightFeePeriod;
    address public _sakePerp;

    bool public blockTransfer; // if block lp token transfer
    mapping(address => bool) public transferWhitelist;
    //**********************************************************//
    //    Can not change the order of above state variables     //
    //**********************************************************//

    //◥◤◥◤◥◤◥◤◥◤◥◤◥◤◥◤ add state variables below ◥◤◥◤◥◤◥◤◥◤◥◤◥◤◥◤//

    //◢◣◢◣◢◣◢◣◢◣◢◣◢◣◢◣ add state variables above ◢◣◢◣◢◣◢◣◢◣◢◣◢◣◢◣//
    uint256[50] private __gap;

    //
    // MODIFIERS
    //
    modifier onlySakePerp() {
        require(msg.sender == _sakePerp, "only sakePerp");
        _;
    }

    //
    // External
    //
    function initialize(
        address sakePerp,
        uint256 insuranceFundFeeRatio,
        uint256 lpWithdrawFeeRatio,
        uint256 overnightFeeRatio,
        uint256 overnightFeeLpShareRatio,
        uint256 fundingFeeLpShareRatio,
        uint256 overnightFeePeriod
    ) public initializer {
        __Ownable_init();

        _sakePerp = sakePerp;
        _insuranceFundFeeRatio = Decimal.decimal(insuranceFundFeeRatio);
        _lpWithdrawFeeRatio = Decimal.decimal(lpWithdrawFeeRatio);
        _overnightFeeRatio = Decimal.decimal(overnightFeeRatio);
        _overnightFeeLpShareRatio = Decimal.decimal(overnightFeeLpShareRatio);
        _fundingFeeLpShareRatio = Decimal.decimal(fundingFeeLpShareRatio);
        _overnightFeePeriod = overnightFeePeriod;
        blockTransfer = true;
    }

    /**
     * @notice set SakePerp dependency
     * @dev only owner can call
     * @param sakePerp address
     */

    function setSakePerp(address sakePerp) external onlyOwner {
        require(sakePerp != address(0), "empty address");
        _sakePerp = sakePerp;
    }

    /**
     * @notice set insurancefund fee  ratio
     * @dev only owner can call
     * @param insuranceFundFeeRatio new insurance fund ratio in 18 digits
     */
    function setInsuranceFundFeeRatio(Decimal.decimal memory insuranceFundFeeRatio) public onlyOwner {
        _insuranceFundFeeRatio = insuranceFundFeeRatio;
        emit InsuranceFundFeeRatioChanged(_insuranceFundFeeRatio.toUint());
    }

    /**
     * @notice set lpwithdraw fee  ratio
     * @dev only owner can call
     * @param lpWithdrawFeeRatio new lp withdraw fee ratio in 18 digits
     */
    function setLpWithdrawFeeRatio(Decimal.decimal memory lpWithdrawFeeRatio) public onlyOwner {
        _lpWithdrawFeeRatio = lpWithdrawFeeRatio;
        emit LpWithdrawFeeRatioChanged(_lpWithdrawFeeRatio.toUint());
    }

    /**
     * @notice set overnight fee ratio
     * @dev only owner can call
     * @param overnightFeeRatio new overnight fee ratio in 18 digits
     */
    function setOvernightFeeRatio(Decimal.decimal memory overnightFeeRatio) public onlyOwner {
        _overnightFeeRatio = overnightFeeRatio;
        emit OvernightFeeRatioChanged(_overnightFeeRatio.toUint());
    }

    /**
     * @notice set overnight fee period
     * @dev only owner can call
     * @param overnightFeePeriod new overnight fee period
     */
    function setOvernightFeePeriod(uint256 overnightFeePeriod) public onlyOwner {
        _overnightFeePeriod = overnightFeePeriod;
        emit OvernightFeeLpShareRatioChanged(_overnightFeeLpShareRatio.toUint());
    }

    /**
     * @notice set overnight fee lp share ratio
     * @dev only owner can call
     * @param overnightFeeLpShareRatio new overnight fee ratio in 18 digits
     */
    function setOvernightFeeLpShareRatio(Decimal.decimal memory overnightFeeLpShareRatio) public onlyOwner {
        _overnightFeeLpShareRatio = overnightFeeLpShareRatio;
        emit OvernightFeeLpShareRatioChanged(_overnightFeeLpShareRatio.toUint());
    }

    /**
     * @notice set
     * @dev only owner can call
     * @param fundingFeeLpShareRatio new funding fee lp share ratio in 18 digits
     */
    function setFundingFeeLpShareRatio(Decimal.decimal memory fundingFeeLpShareRatio) public onlyOwner {
        _fundingFeeLpShareRatio = fundingFeeLpShareRatio;
        emit FundingFeeLpShareRatioChanged(_fundingFeeLpShareRatio.toUint());
    }

    /**
     * @notice set next overnight fee time
     * @param _exchange exchange address
     */
    function setNextOvernightFeeTime(IExchange _exchange) public override onlySakePerp {
        require(
            _blockTimestamp() >= exchangeMap[address(_exchange)]._nextOvernightFeeTime,
            "pay overnight fee too early"
        );

        uint256 fundingPeriod = _overnightFeePeriod;
        uint256 fundingBufferPeriod = fundingPeriod.div(2);

        // in order to prevent multiple funding settlement during very short time after network congestion
        uint256 minNextValidOvernightFeeTime = _blockTimestamp().add(fundingBufferPeriod);

        // floor((nextFundingTime + fundingPeriod) / 3600) * 3600
        uint256 nextOvernightFeeTimeOnHourStart =
            exchangeMap[address(_exchange)]._nextOvernightFeeTime.add(fundingPeriod).div(1 hours).mul(1 hours);

        // max(nextFundingTimeOnHourStart, minNextValidFundingTime)
        exchangeMap[address(_exchange)]._nextOvernightFeeTime = nextOvernightFeeTimeOnHourStart >
            minNextValidOvernightFeeTime
            ? nextOvernightFeeTimeOnHourStart
            : minNextValidOvernightFeeTime;
    }

    /**
     * @dev only owner can call
     * @param _exchange IExchange address
     */
    function addExchange(IExchange _exchange, IInsuranceFund _insuranceFund) public onlyOwner {
        require(!isExistedExchange(_exchange), "exchange already added");
        exchangeMap[address(_exchange)].existed = true;
        exchangeMap[address(_exchange)].insuranceFund = _insuranceFund;
        exchanges.push(_exchange);

        exchangeMap[address(_exchange)]._nextOvernightFeeTime = _blockTimestamp()
            .add(_overnightFeePeriod)
            .div(1 hours)
            .mul(1 hours);

        emit ExchangeAdded(address(_exchange), address(_insuranceFund));
    }

    /**
     * @dev only owner can call. no need to call
     * @param _exchange IExchange address
     */
    function removeExchange(IExchange _exchange) external onlyOwner {
        require(isExistedExchange(_exchange), "amm not existed");
        exchangeMap[address(_exchange)].existed = false;
        exchangeMap[address(_exchange)].insuranceFund = IInsuranceFund(address(0));
        uint256 exchangeLength = exchanges.length;
        for (uint256 i = 0; i < exchangeLength; i++) {
            if (exchanges[i] == _exchange) {
                exchanges[i] = exchanges[exchangeLength - 1];
                exchanges.pop();
                break;
            }
        }
        emit ExchangeRemoved(address(_exchange));
    }

    function setBlockTransfer(bool _ifBlock) public onlyOwner {
        blockTransfer = _ifBlock;
    }

    function setTransferWhitelist(address _white, bool _can) public onlyOwner {
        transferWhitelist[_white] = _can;
    }

    function isExistedExchange(IExchange _exchange) public view override returns (bool) {
        return exchangeMap[address(_exchange)].existed;
    }

    function getAllExchanges() external view override returns (IExchange[] memory) {
        return exchanges;
    }

    function getInsuranceFund(IExchange _exchange) public view override returns (IInsuranceFund) {
        return exchangeMap[address(_exchange)].insuranceFund;
    }

    function insuranceFundFeeRatio() external view override returns (Decimal.decimal memory) {
        return _insuranceFundFeeRatio;
    }

    /**
     * @notice get lp withdraw fee ratio
     * @return lp withdraw fee ratio in 18 digits
     */
    function lpWithdrawFeeRatio() external view override returns (Decimal.decimal memory) {
        return _lpWithdrawFeeRatio;
    }

    function overnightFeeRatio() external view override returns (Decimal.decimal memory) {
        return _overnightFeeRatio;
    }

    function overnightFeeLpShareRatio() external view override returns (Decimal.decimal memory) {
        return _overnightFeeLpShareRatio;
    }

    function fundingFeeLpShareRatio() external view override returns (Decimal.decimal memory) {
        return _fundingFeeLpShareRatio;
    }

    function overnightFeePeriod() external view override returns (uint256) {
        return _overnightFeePeriod;
    }

    function nextOvernightFeeTime(address _exchange) external view override returns (uint256) {
        return exchangeMap[address(_exchange)]._nextOvernightFeeTime;
    }

    function _blockTimestamp() internal view virtual returns (uint256) {
        return block.timestamp;
    }

    function checkTransfer(address _from, address _to) external view override returns (bool) {
        if (!blockTransfer || _from == address(0) || _to == address(0)) return true;
        if (transferWhitelist[_from] || transferWhitelist[_to]) return true;
        return false;
    }
}

File 2 of 16 : IExchange.sol
// SPDX-License-Identifier: GPL-3.0-or-later
pragma solidity ^0.6.12;
pragma experimental ABIEncoderV2;

import "@openzeppelin/contracts-upgradeable/token/ERC20/IERC20Upgradeable.sol";
import "../utils/Decimal.sol";
import "../utils/SignedDecimal.sol";
import "../types/ISakePerpVaultTypes.sol";
import "../types/IExchangeTypes.sol";

interface IExchange is IExchangeTypes {
    function swapInput(
        Dir _dir,
        Decimal.decimal calldata _quoteAssetAmount,
        Decimal.decimal calldata _baseAssetAmountLimit
    ) external returns (Decimal.decimal memory);

    function swapOutput(
        Dir _dir,
        Decimal.decimal calldata _baseAssetAmount,
        Decimal.decimal calldata _quoteAssetAmountLimit,
        bool _skipFluctuationCheck
    ) external returns (Decimal.decimal memory);

    function migrateLiquidity(Decimal.decimal calldata _liquidityMultiplier, Decimal.decimal calldata _priceLimitRatio)
        external;

    function shutdown() external;

    function settleFunding() external returns (SignedDecimal.signedDecimal memory);

    function calcFee(Decimal.decimal calldata _quoteAssetAmount) external view returns (Decimal.decimal memory);

    function calcBaseAssetAfterLiquidityMigration(
        SignedDecimal.signedDecimal memory _baseAssetAmount,
        Decimal.decimal memory _fromQuoteReserve,
        Decimal.decimal memory _fromBaseReserve
    ) external view returns (SignedDecimal.signedDecimal memory);

    function getInputTwap(Dir _dir, Decimal.decimal calldata _quoteAssetAmount)
        external
        view
        returns (Decimal.decimal memory);

    function getOutputTwap(Dir _dir, Decimal.decimal calldata _baseAssetAmount)
        external
        view
        returns (Decimal.decimal memory);

    function getInputPrice(Dir _dir, Decimal.decimal calldata _quoteAssetAmount)
        external
        view
        returns (Decimal.decimal memory);

    function getOutputPrice(Dir _dir, Decimal.decimal calldata _baseAssetAmount)
        external
        view
        returns (Decimal.decimal memory);

    function getInputPriceWithReserves(
        Dir _dir,
        Decimal.decimal memory _quoteAssetAmount,
        Decimal.decimal memory _quoteAssetPoolAmount,
        Decimal.decimal memory _baseAssetPoolAmount
    ) external view returns (Decimal.decimal memory);

    function getOutputPriceWithReserves(
        Dir _dir,
        Decimal.decimal memory _baseAssetAmount,
        Decimal.decimal memory _quoteAssetPoolAmount,
        Decimal.decimal memory _baseAssetPoolAmount
    ) external view returns (Decimal.decimal memory);

    function getSpotPrice() external view returns (Decimal.decimal memory);

    function getLiquidityHistoryLength() external view returns (uint256);

    // overridden by state variable
    function quoteAsset() external view returns (IERC20Upgradeable);

    function open() external view returns (bool);

    // can not be overridden by state variable due to type `Deciaml.decimal`
    function getSettlementPrice() external view returns (Decimal.decimal memory);

    function getCumulativeNotional() external view returns (SignedDecimal.signedDecimal memory);

    function getMaxHoldingBaseAsset() external view returns (Decimal.decimal memory);

    function getOpenInterestNotionalCap() external view returns (Decimal.decimal memory);

    function getLiquidityChangedSnapshots(uint256 i) external view returns (LiquidityChangedSnapshot memory);

    function mint(
        ISakePerpVaultTypes.Risk _level,
        address account,
        uint256 amount
    ) external;

    function burn(
        ISakePerpVaultTypes.Risk _level,
        address account,
        uint256 amount
    ) external;

    function getMMUnrealizedPNL(Decimal.decimal memory _baseAssetReserve, Decimal.decimal memory _quoteAssetReserve)
        external
        view
        returns (SignedDecimal.signedDecimal memory);

    function moveAMMPriceToOracle(uint256 _oraclePrice, bytes32 _priceFeedKey) external;

    function setPriceFeed(address _priceFeed) external;

    function getReserve() external view returns (Decimal.decimal memory, Decimal.decimal memory);

    function initMarginRatio() external view returns (Decimal.decimal memory);

    function maintenanceMarginRatio() external view returns (Decimal.decimal memory);

    function liquidationFeeRatio() external view returns (Decimal.decimal memory);

    function maxLiquidationFee() external view returns (Decimal.decimal memory);

    function spreadRatio() external view returns (Decimal.decimal memory);

    function priceFeedKey() external view returns (bytes32);

    function tradeLimitRatio() external view returns (uint256);

    function priceAdjustRatio() external view returns (uint256);

    function fluctuationLimitRatio() external view returns (uint256);

    function fundingPeriod() external view returns (uint256);

    function adjustTotalPosition(
        SignedDecimal.signedDecimal memory adjustedPosition,
        SignedDecimal.signedDecimal memory oldAdjustedPosition
    ) external;

    function getTotalPositionSize() external view returns (SignedDecimal.signedDecimal memory);

    function getExchangeState() external view returns (address);

    function getUnderlyingPrice() external view returns (Decimal.decimal memory);

    function isOverSpreadLimit() external view returns (bool);
}

File 3 of 16 : IInsuranceFund.sol
// SPDX-License-Identifier: GPL-3.0-or-later
pragma solidity ^0.6.12;
pragma experimental ABIEncoderV2;

import "../utils/Decimal.sol";
import "./IExchange.sol";

interface IInsuranceFund {
    function withdraw(Decimal.decimal calldata _amount) external returns (Decimal.decimal memory badDebt);

    function setExchange(IExchange _exchange) external;

    function setBeneficiary(address _beneficiary) external;
}

File 4 of 16 : ISystemSettings.sol
// SPDX-License-Identifier: GPL-3.0-or-later
pragma solidity ^0.6.12;
pragma experimental ABIEncoderV2;

import "./IExchange.sol";
import "./IInsuranceFund.sol";
import "../utils/Decimal.sol";

interface ISystemSettings {
    function insuranceFundFeeRatio() external view returns (Decimal.decimal memory);

    function lpWithdrawFeeRatio() external view returns (Decimal.decimal memory);

    function overnightFeeRatio() external view returns (Decimal.decimal memory);

    function overnightFeeLpShareRatio() external view returns (Decimal.decimal memory);

    function fundingFeeLpShareRatio() external view returns (Decimal.decimal memory);

    function overnightFeePeriod() external view returns (uint256);

    function isExistedExchange(IExchange _exchange) external view returns (bool);

    function getAllExchanges() external view returns (IExchange[] memory);

    function getInsuranceFund(IExchange _exchange) external view returns (IInsuranceFund);

    function setNextOvernightFeeTime(IExchange _exchange) external;

    function nextOvernightFeeTime(address _exchange) external view returns (uint256);

    function checkTransfer(address _from, address _to) external view returns (bool);
}

File 5 of 16 : IExchangeTypes.sol
// SPDX-License-Identifier: GPL-3.0-or-later
pragma solidity ^0.6.12;
pragma experimental ABIEncoderV2;

import "../utils/Decimal.sol";
import "../utils/SignedDecimal.sol";

interface IExchangeTypes {
    /**
     * @notice asset direction, used in getInputPrice, getOutputPrice, swapInput and swapOutput
     * @param ADD_TO_AMM add asset to Amm
     * @param REMOVE_FROM_AMM remove asset from Amm
     */
    enum Dir {ADD_TO_AMM, REMOVE_FROM_AMM}

    struct LiquidityChangedSnapshot {
        SignedDecimal.signedDecimal cumulativeNotional;
        // the base/quote reserve of amm right before liquidity changed
        Decimal.decimal quoteAssetReserve;
        Decimal.decimal baseAssetReserve;
        // total position size owned by amm after last snapshot taken
        // `totalPositionSize` = currentBaseAssetReserve - lastLiquidityChangedHistoryItem.baseAssetReserve + prevTotalPositionSize
        SignedDecimal.signedDecimal totalPositionSize;
    }
}

File 6 of 16 : ISakePerpVaultTypes.sol
// SPDX-License-Identifier: GPL-3.0-or-later
pragma solidity ^0.6.12;
pragma experimental ABIEncoderV2;

interface ISakePerpVaultTypes {
    /**
     * @notice pool types
     * @param HIGH high risk pool
     * @param LOW low risk pool
     */
    enum Risk {HIGH, LOW}
}

File 7 of 16 : Decimal.sol
// SPDX-License-Identifier: GPL-3.0-or-later
pragma solidity ^0.6.12;

import "@openzeppelin/contracts-upgradeable/math/SafeMathUpgradeable.sol";
import "./DecimalMath.sol";

library Decimal {
    using DecimalMath for uint256;
    using SafeMathUpgradeable for uint256;

    struct decimal {
        uint256 d;
    }

    function zero() internal pure returns (decimal memory) {
        return decimal(0);
    }

    function one() internal pure returns (decimal memory) {
        return decimal(DecimalMath.unit(18));
    }

    function toUint(decimal memory x) internal pure returns (uint256) {
        return x.d;
    }

    function modD(decimal memory x, decimal memory y) internal pure returns (decimal memory) {
        return decimal(x.d.mul(DecimalMath.unit(18)) % y.d);
    }

    function cmp(decimal memory x, decimal memory y) internal pure returns (int8) {
        if (x.d > y.d) {
            return 1;
        } else if (x.d < y.d) {
            return -1;
        }
        return 0;
    }

    /// @dev add two decimals
    function addD(decimal memory x, decimal memory y) internal pure returns (decimal memory) {
        decimal memory t;
        t.d = x.d.add(y.d);
        return t;
    }

    /// @dev subtract two decimals
    function subD(decimal memory x, decimal memory y) internal pure returns (decimal memory) {
        decimal memory t;
        t.d = x.d.sub(y.d);
        return t;
    }

    /// @dev multiple two decimals
    function mulD(decimal memory x, decimal memory y) internal pure returns (decimal memory) {
        decimal memory t;
        t.d = x.d.muld(y.d);
        return t;
    }

    /// @dev multiple a decimal by a uint256
    function mulScalar(decimal memory x, uint256 y) internal pure returns (decimal memory) {
        decimal memory t;
        t.d = x.d.mul(y);
        return t;
    }

    /// @dev divide two decimals
    function divD(decimal memory x, decimal memory y) internal pure returns (decimal memory) {
        decimal memory t;
        t.d = x.d.divd(y.d);
        return t;
    }

    /// @dev divide a decimal by a uint256
    function divScalar(decimal memory x, uint256 y) internal pure returns (decimal memory) {
        decimal memory t;
        t.d = x.d.div(y);
        return t;
    }
}

File 8 of 16 : DecimalMath.sol
// SPDX-License-Identifier: GPL-3.0-or-later
pragma solidity ^0.6.12;

import "@openzeppelin/contracts-upgradeable/math/SafeMathUpgradeable.sol";

/// @dev Implements simple fixed point math add, sub, mul and div operations.
/// @author Alberto Cuesta Cañada
library DecimalMath {
    using SafeMathUpgradeable for uint256;

    /// @dev Returns 1 in the fixed point representation, with `decimals` decimals.
    function unit(uint8 decimals) internal pure returns (uint256) {
        return 10**uint256(decimals);
    }

    /// @dev Adds x and y, assuming they are both fixed point with 18 decimals.
    function addd(uint256 x, uint256 y) internal pure returns (uint256) {
        return x.add(y);
    }

    /// @dev Subtracts y from x, assuming they are both fixed point with 18 decimals.
    function subd(uint256 x, uint256 y) internal pure returns (uint256) {
        return x.sub(y);
    }

    /// @dev Multiplies x and y, assuming they are both fixed point with 18 digits.
    function muld(uint256 x, uint256 y) internal pure returns (uint256) {
        return muld(x, y, 18);
    }

    /// @dev Multiplies x and y, assuming they are both fixed point with `decimals` digits.
    function muld(
        uint256 x,
        uint256 y,
        uint8 decimals
    ) internal pure returns (uint256) {
        return x.mul(y).div(unit(decimals));
    }

    /// @dev Divides x between y, assuming they are both fixed point with 18 digits.
    function divd(uint256 x, uint256 y) internal pure returns (uint256) {
        return divd(x, y, 18);
    }

    /// @dev Divides x between y, assuming they are both fixed point with `decimals` digits.
    function divd(
        uint256 x,
        uint256 y,
        uint8 decimals
    ) internal pure returns (uint256) {
        return x.mul(unit(decimals)).div(y);
    }
}

File 9 of 16 : SignedDecimal.sol
// SPDX-License-Identifier: GPL-3.0-or-later
pragma solidity ^0.6.12;

import "@openzeppelin/contracts-upgradeable/math/SignedSafeMathUpgradeable.sol";
import "./SignedDecimalMath.sol";
import "./Decimal.sol";

library SignedDecimal {
    using SignedDecimalMath for int256;
    using SignedSafeMathUpgradeable for int256;

    struct signedDecimal {
        int256 d;
    }

    function zero() internal pure returns (signedDecimal memory) {
        return signedDecimal(0);
    }

    function toInt(signedDecimal memory x) internal pure returns (int256) {
        return x.d;
    }

    function isNegative(signedDecimal memory x) internal pure returns (bool) {
        if (x.d < 0) {
            return true;
        }
        return false;
    }

    function abs(signedDecimal memory x) internal pure returns (Decimal.decimal memory) {
        Decimal.decimal memory t;
        if (x.d < 0) {
            t.d = uint256(0 - x.d);
        } else {
            t.d = uint256(x.d);
        }
        return t;
    }

    /// @dev add two decimals
    function addD(signedDecimal memory x, signedDecimal memory y) internal pure returns (signedDecimal memory) {
        signedDecimal memory t;
        t.d = x.d.add(y.d);
        return t;
    }

    /// @dev subtract two decimals
    function subD(signedDecimal memory x, signedDecimal memory y) internal pure returns (signedDecimal memory) {
        signedDecimal memory t;
        t.d = x.d.sub(y.d);
        return t;
    }

    /// @dev multiple two decimals
    function mulD(signedDecimal memory x, signedDecimal memory y) internal pure returns (signedDecimal memory) {
        signedDecimal memory t;
        t.d = x.d.muld(y.d);
        return t;
    }

    /// @dev multiple a signedDecimal by a int256
    function mulScalar(signedDecimal memory x, int256 y) internal pure returns (signedDecimal memory) {
        signedDecimal memory t;
        t.d = x.d.mul(y);
        return t;
    }

    /// @dev divide two decimals
    function divD(signedDecimal memory x, signedDecimal memory y) internal pure returns (signedDecimal memory) {
        signedDecimal memory t;
        t.d = x.d.divd(y.d);
        return t;
    }

    /// @dev divide a signedDecimal by a int256
    function divScalar(signedDecimal memory x, int256 y) internal pure returns (signedDecimal memory) {
        signedDecimal memory t;
        t.d = x.d.div(y);
        return t;
    }
}

File 10 of 16 : SignedDecimalMath.sol
// SPDX-License-Identifier: GPL-3.0-or-later
pragma solidity ^0.6.12;

import "@openzeppelin/contracts-upgradeable/math/SignedSafeMathUpgradeable.sol";

/// @dev Implements simple signed fixed point math add, sub, mul and div operations.
library SignedDecimalMath {
    using SignedSafeMathUpgradeable for int256;

    /// @dev Returns 1 in the fixed point representation, with `decimals` decimals.
    function unit(uint8 decimals) internal pure returns (int256) {
        return int256(10**uint256(decimals));
    }

    /// @dev Adds x and y, assuming they are both fixed point with 18 decimals.
    function addd(int256 x, int256 y) internal pure returns (int256) {
        return x.add(y);
    }

    /// @dev Subtracts y from x, assuming they are both fixed point with 18 decimals.
    function subd(int256 x, int256 y) internal pure returns (int256) {
        return x.sub(y);
    }

    /// @dev Multiplies x and y, assuming they are both fixed point with 18 digits.
    function muld(int256 x, int256 y) internal pure returns (int256) {
        return muld(x, y, 18);
    }

    /// @dev Multiplies x and y, assuming they are both fixed point with `decimals` digits.
    function muld(
        int256 x,
        int256 y,
        uint8 decimals
    ) internal pure returns (int256) {
        return x.mul(y).div(unit(decimals));
    }

    /// @dev Divides x between y, assuming they are both fixed point with 18 digits.
    function divd(int256 x, int256 y) internal pure returns (int256) {
        return divd(x, y, 18);
    }

    /// @dev Divides x between y, assuming they are both fixed point with `decimals` digits.
    function divd(
        int256 x,
        int256 y,
        uint8 decimals
    ) internal pure returns (int256) {
        return x.mul(unit(decimals)).div(y);
    }
}

File 11 of 16 : ContextUpgradeable.sol
// SPDX-License-Identifier: MIT

pragma solidity >=0.6.0 <0.8.0;
import "../proxy/Initializable.sol";

/*
 * @dev Provides information about the current execution context, including the
 * sender of the transaction and its data. While these are generally available
 * via msg.sender and msg.data, they should not be accessed in such a direct
 * manner, since when dealing with GSN meta-transactions the account sending and
 * paying for execution may not be the actual sender (as far as an application
 * is concerned).
 *
 * This contract is only required for intermediate, library-like contracts.
 */
abstract contract ContextUpgradeable is Initializable {
    function __Context_init() internal initializer {
        __Context_init_unchained();
    }

    function __Context_init_unchained() internal initializer {
    }
    function _msgSender() internal view virtual returns (address payable) {
        return msg.sender;
    }

    function _msgData() internal view virtual returns (bytes memory) {
        this; // silence state mutability warning without generating bytecode - see https://github.com/ethereum/solidity/issues/2691
        return msg.data;
    }
    uint256[50] private __gap;
}

File 12 of 16 : OwnableUpgradeable.sol
// SPDX-License-Identifier: MIT

pragma solidity >=0.6.0 <0.8.0;

import "../GSN/ContextUpgradeable.sol";
import "../proxy/Initializable.sol";
/**
 * @dev Contract module which provides a basic access control mechanism, where
 * there is an account (an owner) that can be granted exclusive access to
 * specific functions.
 *
 * By default, the owner account will be the one that deploys the contract. This
 * can later be changed with {transferOwnership}.
 *
 * This module is used through inheritance. It will make available the modifier
 * `onlyOwner`, which can be applied to your functions to restrict their use to
 * the owner.
 */
abstract contract OwnableUpgradeable is Initializable, ContextUpgradeable {
    address private _owner;

    event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);

    /**
     * @dev Initializes the contract setting the deployer as the initial owner.
     */
    function __Ownable_init() internal initializer {
        __Context_init_unchained();
        __Ownable_init_unchained();
    }

    function __Ownable_init_unchained() internal initializer {
        address msgSender = _msgSender();
        _owner = msgSender;
        emit OwnershipTransferred(address(0), msgSender);
    }

    /**
     * @dev Returns the address of the current owner.
     */
    function owner() public view returns (address) {
        return _owner;
    }

    /**
     * @dev Throws if called by any account other than the owner.
     */
    modifier onlyOwner() {
        require(_owner == _msgSender(), "Ownable: caller is not the owner");
        _;
    }

    /**
     * @dev Leaves the contract without owner. It will not be possible to call
     * `onlyOwner` functions anymore. Can only be called by the current owner.
     *
     * NOTE: Renouncing ownership will leave the contract without an owner,
     * thereby removing any functionality that is only available to the owner.
     */
    function renounceOwnership() public virtual onlyOwner {
        emit OwnershipTransferred(_owner, address(0));
        _owner = address(0);
    }

    /**
     * @dev Transfers ownership of the contract to a new account (`newOwner`).
     * Can only be called by the current owner.
     */
    function transferOwnership(address newOwner) public virtual onlyOwner {
        require(newOwner != address(0), "Ownable: new owner is the zero address");
        emit OwnershipTransferred(_owner, newOwner);
        _owner = newOwner;
    }
    uint256[49] private __gap;
}

File 13 of 16 : SafeMathUpgradeable.sol
// SPDX-License-Identifier: MIT

pragma solidity >=0.6.0 <0.8.0;

/**
 * @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 SafeMathUpgradeable {
    /**
     * @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 14 of 16 : SignedSafeMathUpgradeable.sol
// SPDX-License-Identifier: MIT

pragma solidity >=0.6.0 <0.8.0;

/**
 * @title SignedSafeMath
 * @dev Signed math operations with safety checks that revert on error.
 */
library SignedSafeMathUpgradeable {
    int256 constant private _INT256_MIN = -2**255;

    /**
     * @dev Returns the multiplication of two signed integers, reverting on
     * overflow.
     *
     * Counterpart to Solidity's `*` operator.
     *
     * Requirements:
     *
     * - Multiplication cannot overflow.
     */
    function mul(int256 a, int256 b) internal pure returns (int256) {
        // 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;
        }

        require(!(a == -1 && b == _INT256_MIN), "SignedSafeMath: multiplication overflow");

        int256 c = a * b;
        require(c / a == b, "SignedSafeMath: multiplication overflow");

        return c;
    }

    /**
     * @dev Returns the integer division of two signed 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(int256 a, int256 b) internal pure returns (int256) {
        require(b != 0, "SignedSafeMath: division by zero");
        require(!(b == -1 && a == _INT256_MIN), "SignedSafeMath: division overflow");

        int256 c = a / b;

        return c;
    }

    /**
     * @dev Returns the subtraction of two signed integers, reverting on
     * overflow.
     *
     * Counterpart to Solidity's `-` operator.
     *
     * Requirements:
     *
     * - Subtraction cannot overflow.
     */
    function sub(int256 a, int256 b) internal pure returns (int256) {
        int256 c = a - b;
        require((b >= 0 && c <= a) || (b < 0 && c > a), "SignedSafeMath: subtraction overflow");

        return c;
    }

    /**
     * @dev Returns the addition of two signed integers, reverting on
     * overflow.
     *
     * Counterpart to Solidity's `+` operator.
     *
     * Requirements:
     *
     * - Addition cannot overflow.
     */
    function add(int256 a, int256 b) internal pure returns (int256) {
        int256 c = a + b;
        require((b >= 0 && c >= a) || (b < 0 && c < a), "SignedSafeMath: addition overflow");

        return c;
    }
}

File 15 of 16 : Initializable.sol
// SPDX-License-Identifier: MIT

// solhint-disable-next-line compiler-version
pragma solidity >=0.4.24 <0.8.0;


/**
 * @dev This is a base contract to aid in writing upgradeable contracts, or any kind of contract that will be deployed
 * behind a proxy. Since a proxied contract can't have a constructor, it's common to move constructor logic to an
 * external initializer function, usually called `initialize`. It then becomes necessary to protect this initializer
 * function so it can only be called once. The {initializer} modifier provided by this contract will have this effect.
 * 
 * TIP: To avoid leaving the proxy in an uninitialized state, the initializer function should be called as early as
 * possible by providing the encoded function call as the `_data` argument to {UpgradeableProxy-constructor}.
 * 
 * CAUTION: When used with inheritance, manual care must be taken to not invoke a parent initializer twice, or to ensure
 * that all initializers are idempotent. This is not verified automatically as constructors are by Solidity.
 */
abstract contract Initializable {

    /**
     * @dev Indicates that the contract has been initialized.
     */
    bool private _initialized;

    /**
     * @dev Indicates that the contract is in the process of being initialized.
     */
    bool private _initializing;

    /**
     * @dev Modifier to protect an initializer function from being invoked twice.
     */
    modifier initializer() {
        require(_initializing || _isConstructor() || !_initialized, "Initializable: contract is already initialized");

        bool isTopLevelCall = !_initializing;
        if (isTopLevelCall) {
            _initializing = true;
            _initialized = true;
        }

        _;

        if (isTopLevelCall) {
            _initializing = false;
        }
    }

    /// @dev Returns true if and only if the function is running in the constructor
    function _isConstructor() private view returns (bool) {
        // extcodesize checks the size of the code stored in an address, and
        // address returns the current address. Since the code is still not
        // deployed when running a constructor, any checks on its code size will
        // yield zero, making it an effective way to detect if a contract is
        // under construction or not.
        address self = address(this);
        uint256 cs;
        // solhint-disable-next-line no-inline-assembly
        assembly { cs := extcodesize(self) }
        return cs == 0;
    }
}

File 16 of 16 : IERC20Upgradeable.sol
// SPDX-License-Identifier: MIT

pragma solidity >=0.6.0 <0.8.0;

/**
 * @dev Interface of the ERC20 standard as defined in the EIP.
 */
interface IERC20Upgradeable {
    /**
     * @dev Returns the amount of tokens in existence.
     */
    function totalSupply() external view returns (uint256);

    /**
     * @dev Returns the amount of tokens owned by `account`.
     */
    function balanceOf(address account) external view returns (uint256);

    /**
     * @dev Moves `amount` tokens from the caller's account to `recipient`.
     *
     * Returns a boolean value indicating whether the operation succeeded.
     *
     * Emits a {Transfer} event.
     */
    function transfer(address recipient, uint256 amount) external returns (bool);

    /**
     * @dev Returns the remaining number of tokens that `spender` will be
     * allowed to spend on behalf of `owner` through {transferFrom}. This is
     * zero by default.
     *
     * This value changes when {approve} or {transferFrom} are called.
     */
    function allowance(address owner, address spender) external view returns (uint256);

    /**
     * @dev Sets `amount` as the allowance of `spender` over the caller's tokens.
     *
     * Returns a boolean value indicating whether the operation succeeded.
     *
     * IMPORTANT: Beware that changing an allowance with this method brings the risk
     * that someone may use both the old and the new allowance by unfortunate
     * transaction ordering. One possible solution to mitigate this race
     * condition is to first reduce the spender's allowance to 0 and set the
     * desired value afterwards:
     * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729
     *
     * Emits an {Approval} event.
     */
    function approve(address spender, uint256 amount) external returns (bool);

    /**
     * @dev Moves `amount` tokens from `sender` to `recipient` using the
     * allowance mechanism. `amount` is then deducted from the caller's
     * allowance.
     *
     * Returns a boolean value indicating whether the operation succeeded.
     *
     * Emits a {Transfer} event.
     */
    function transferFrom(address sender, address recipient, uint256 amount) external returns (bool);

    /**
     * @dev Emitted when `value` tokens are moved from one account (`from`) to
     * another (`to`).
     *
     * Note that `value` may be zero.
     */
    event Transfer(address indexed from, address indexed to, uint256 value);

    /**
     * @dev Emitted when the allowance of a `spender` for an `owner` is set by
     * a call to {approve}. `value` is the new allowance.
     */
    event Approval(address indexed owner, address indexed spender, uint256 value);
}

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

Contract ABI

[{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"exchange","type":"address"},{"indexed":false,"internalType":"address","name":"insuranceFund","type":"address"}],"name":"ExchangeAdded","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"exchange","type":"address"}],"name":"ExchangeRemoved","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"fundingFeeLpShareRatio","type":"uint256"}],"name":"FundingFeeLpShareRatioChanged","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"insuranceFundFeeRatio","type":"uint256"}],"name":"InsuranceFundFeeRatioChanged","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"lpWithdrawFeeRatio","type":"uint256"}],"name":"LpWithdrawFeeRatioChanged","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"overnightFeeLpShareRatio","type":"uint256"}],"name":"OvernightFeeLpShareRatioChanged","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"overnightFeePeriod","type":"uint256"}],"name":"OvernightFeePeriodChanged","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"overnightFeeRatio","type":"uint256"}],"name":"OvernightFeeRatioChanged","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"inputs":[],"name":"_paused","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"_sakePerp","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"contract IExchange","name":"_exchange","type":"address"},{"internalType":"contract IInsuranceFund","name":"_insuranceFund","type":"address"}],"name":"addExchange","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"blockTransfer","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_from","type":"address"},{"internalType":"address","name":"_to","type":"address"}],"name":"checkTransfer","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"fundingFeeLpShareRatio","outputs":[{"components":[{"internalType":"uint256","name":"d","type":"uint256"}],"internalType":"struct Decimal.decimal","name":"","type":"tuple"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getAllExchanges","outputs":[{"internalType":"contract IExchange[]","name":"","type":"address[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"contract IExchange","name":"_exchange","type":"address"}],"name":"getInsuranceFund","outputs":[{"internalType":"contract IInsuranceFund","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"sakePerp","type":"address"},{"internalType":"uint256","name":"insuranceFundFeeRatio","type":"uint256"},{"internalType":"uint256","name":"lpWithdrawFeeRatio","type":"uint256"},{"internalType":"uint256","name":"overnightFeeRatio","type":"uint256"},{"internalType":"uint256","name":"overnightFeeLpShareRatio","type":"uint256"},{"internalType":"uint256","name":"fundingFeeLpShareRatio","type":"uint256"},{"internalType":"uint256","name":"overnightFeePeriod","type":"uint256"}],"name":"initialize","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"insuranceFundFeeRatio","outputs":[{"components":[{"internalType":"uint256","name":"d","type":"uint256"}],"internalType":"struct Decimal.decimal","name":"","type":"tuple"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"contract IExchange","name":"_exchange","type":"address"}],"name":"isExistedExchange","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"lpWithdrawFeeRatio","outputs":[{"components":[{"internalType":"uint256","name":"d","type":"uint256"}],"internalType":"struct Decimal.decimal","name":"","type":"tuple"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_exchange","type":"address"}],"name":"nextOvernightFeeTime","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"overnightFeeLpShareRatio","outputs":[{"components":[{"internalType":"uint256","name":"d","type":"uint256"}],"internalType":"struct Decimal.decimal","name":"","type":"tuple"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"overnightFeePeriod","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"overnightFeeRatio","outputs":[{"components":[{"internalType":"uint256","name":"d","type":"uint256"}],"internalType":"struct Decimal.decimal","name":"","type":"tuple"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"contract IExchange","name":"_exchange","type":"address"}],"name":"removeExchange","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bool","name":"_ifBlock","type":"bool"}],"name":"setBlockTransfer","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"components":[{"internalType":"uint256","name":"d","type":"uint256"}],"internalType":"struct Decimal.decimal","name":"fundingFeeLpShareRatio","type":"tuple"}],"name":"setFundingFeeLpShareRatio","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"components":[{"internalType":"uint256","name":"d","type":"uint256"}],"internalType":"struct Decimal.decimal","name":"insuranceFundFeeRatio","type":"tuple"}],"name":"setInsuranceFundFeeRatio","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"components":[{"internalType":"uint256","name":"d","type":"uint256"}],"internalType":"struct Decimal.decimal","name":"lpWithdrawFeeRatio","type":"tuple"}],"name":"setLpWithdrawFeeRatio","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"contract IExchange","name":"_exchange","type":"address"}],"name":"setNextOvernightFeeTime","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"components":[{"internalType":"uint256","name":"d","type":"uint256"}],"internalType":"struct Decimal.decimal","name":"overnightFeeLpShareRatio","type":"tuple"}],"name":"setOvernightFeeLpShareRatio","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"overnightFeePeriod","type":"uint256"}],"name":"setOvernightFeePeriod","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"components":[{"internalType":"uint256","name":"d","type":"uint256"}],"internalType":"struct Decimal.decimal","name":"overnightFeeRatio","type":"tuple"}],"name":"setOvernightFeeRatio","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"sakePerp","type":"address"}],"name":"setSakePerp","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_white","type":"address"},{"internalType":"bool","name":"_can","type":"bool"}],"name":"setTransferWhitelist","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"transferWhitelist","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"}]

608060405234801561001057600080fd5b50611817806100206000396000f3fe608060405234801561001057600080fd5b50600436106101e55760003560e01c80638a6284c21161010f578063c1caaec9116100a2578063e50bda3811610071578063e50bda38146103be578063ed99da31146103c6578063f0ccffef146103d9578063f2fde38b146103ec576101e5565b8063c1caaec914610372578063ca6769f514610385578063d2ad07fb14610398578063e4a34dce146103ab576101e5565b8063914691bd116100de578063914691bd1461033c5780639cade4381461034f578063ada8788e14610362578063b3f885f21461036a576101e5565b80638a6284c2146102fb5780638d4235631461030e5780638da5cb5b146103215780638e0be36914610329576101e5565b806357de0c5b116101875780637ed2958a116101565780637ed2958a146102a25780637f604b45146102c25780637ffbe241146102d55780638142951a146102e8576101e5565b806357de0c5b146102775780635da7c8ec1461028a5780636b28d7a214610292578063715018a61461029a576101e5565b806329458529116101c3578063294585291461023057806337c03fb6146102455780633dd973871461025a578063575dc7b31461026f576101e5565b806316c61ccc146101ea5780632119158f14610208578063275348f114610228575b600080fd5b6101f26103ff565b6040516101ff919061153c565b60405180910390f35b61021b610216366004611361565b610408565b6040516101ff91906117c3565b61021b610426565b61023861042c565b6040516101ff91906117b9565b61024d610448565b6040516101ff91906114ef565b61026d610268366004611361565b6104aa565b005b610238610530565b6101f2610285366004611361565b61054c565b610238610571565b6101f261058d565b61026d61059d565b6102b56102b0366004611361565b61061c565b6040516101ff91906114c1565b61026d6102d036600461145a565b61063a565b6101f26102e3366004611361565b610792565b61026d6102f63660046113e6565b6107a7565b61026d61030936600461146c565b6108b9565b61026d61031c36600461146c565b610946565b6102b56109bb565b61026d610337366004611361565b6109ca565b61026d61034a36600461146c565b610b57565b61026d61035d3660046114a9565b610bcc565b610238610c41565b6102b5610c5d565b61026d61038036600461143a565b610c6c565b61026d61039336600461146c565b610cbf565b6101f26103a636600461137d565b610d34565b61026d6103b93660046113b5565b610dcc565b610238610e2c565b61026d6103d4366004611361565b610e48565b61026d6103e736600461146c565b610f43565b61026d6103fa366004611361565b610fb8565b606a5460ff1681565b6001600160a01b03166000908152606b602052604090206001015490565b606d5490565b61043461134e565b506040805160208101909152606654815290565b6060606c8054806020026020016040519081016040528092919081815260200182805480156104a057602002820191906000526020600020905b81546001600160a01b03168152600190910190602001808311610482575b5050505050905090565b6104b261106f565b6033546001600160a01b039081169116146104e85760405162461bcd60e51b81526004016104df906116f6565b60405180910390fd5b6001600160a01b03811661050e5760405162461bcd60e51b81526004016104df90611617565b606e80546001600160a01b0319166001600160a01b0392909216919091179055565b61053861134e565b506040805160208101909152606854815290565b6001600160a01b03166000908152606b6020526040902054600160a01b900460ff1690565b61057961134e565b506040805160208101909152606954815290565b606e54600160a01b900460ff1681565b6105a561106f565b6033546001600160a01b039081169116146105d25760405162461bcd60e51b81526004016104df906116f6565b6033546040516000916001600160a01b0316907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3603380546001600160a01b0319169055565b6001600160a01b039081166000908152606b60205260409020541690565b61064261106f565b6033546001600160a01b0390811691161461066f5760405162461bcd60e51b81526004016104df906116f6565b6106788261054c565b156106955760405162461bcd60e51b81526004016104df90611789565b6001600160a01b038083166000818152606b6020526040812080549385166001600160a01b031960ff60a01b19909516600160a01b178516179055606c805460018101825591527f2b4a51ab505fc96a0952efda2ba61bcd3078d4c02c39a186ec16f21883fbe016018054909216179055606d5461073590610e109061072f90829061072990610723611073565b90611077565b906110a3565b906110e5565b6001600160a01b0383166000908152606b60205260409081902060010191909155517f528c158ea66061a4d3de7a8a7bc010c45cb720774038359ec40db94b0a1247ef9061078690849084906114d5565b60405180910390a15050565b606f6020526000908152604090205460ff1681565b600054610100900460ff16806107c057506107c061111f565b806107ce575060005460ff16155b6107ea5760405162461bcd60e51b81526004016104df90611667565b600054610100900460ff16158015610815576000805460ff1961ff0019909116610100171660011790555b61081d611125565b606e80546040805160208082018352908b905260658b9055815180820183528a905260668a905581518082018352899052606789905581518082018352889052606888905581519081019091528590526069859055606d849055600160a01b6001600160a01b03199091166001600160a01b038b161760ff60a01b191617905580156108af576000805461ff00191690555b5050505050505050565b6108c161106f565b6033546001600160a01b039081169116146108ee5760405162461bcd60e51b81526004016104df906116f6565b8051606881905560408051602081019091529081527f9848100361049da71143c7e565145bf681d3ace1002e4c651e1dcbc67d0f87119061092e906111b8565b60405161093b91906117c3565b60405180910390a150565b61094e61106f565b6033546001600160a01b0390811691161461097b5760405162461bcd60e51b81526004016104df906116f6565b8051606981905560408051602081019091529081527fbbed2535a3cc81cbec2bb70a929a01f1884d32b888174cf181762044c39e67029061092e906111b8565b6033546001600160a01b031690565b6109d261106f565b6033546001600160a01b039081169116146109ff5760405162461bcd60e51b81526004016104df906116f6565b610a088161054c565b610a245760405162461bcd60e51b81526004016104df9061163e565b6001600160a01b0381166000908152606b6020526040812080546001600160a81b0319169055606c54905b81811015610b2757826001600160a01b0316606c8281548110610a6e57fe5b6000918252602090912001546001600160a01b03161415610b1f57606c6001830381548110610a9957fe5b600091825260209091200154606c80546001600160a01b039092169183908110610abf57fe5b9060005260206000200160006101000a8154816001600160a01b0302191690836001600160a01b03160217905550606c805480610af857fe5b600082815260209020810160001990810180546001600160a01b0319169055019055610b27565b600101610a4f565b507ff50d0d312d501878616eb5e78ebf3ed6dcd3955aaef8165af9c6b057cc4832fb8260405161078691906114c1565b610b5f61106f565b6033546001600160a01b03908116911614610b8c5760405162461bcd60e51b81526004016104df906116f6565b8051606681905560408051602081019091529081527f2046b3b23f3308135c4909307170e9c451797b0d5b0010a43ac55537874ba0059061092e906111b8565b610bd461106f565b6033546001600160a01b03908116911614610c015760405162461bcd60e51b81526004016104df906116f6565b606d819055604080516020810190915260685481527f9848100361049da71143c7e565145bf681d3ace1002e4c651e1dcbc67d0f87119061092e906111b8565b610c4961134e565b506040805160208101909152606554815290565b606e546001600160a01b031681565b610c7461106f565b6033546001600160a01b03908116911614610ca15760405162461bcd60e51b81526004016104df906116f6565b606e8054911515600160a01b0260ff60a01b19909216919091179055565b610cc761106f565b6033546001600160a01b03908116911614610cf45760405162461bcd60e51b81526004016104df906116f6565b8051606581905560408051602081019091529081527f39e8a98b864997e5c86ae3887711e4b871e6f023e6b968feb7c75e41135764ff9061092e906111b8565b606e54600090600160a01b900460ff161580610d5757506001600160a01b038316155b80610d6957506001600160a01b038216155b15610d7657506001610dc6565b6001600160a01b0383166000908152606f602052604090205460ff1680610db557506001600160a01b0382166000908152606f602052604090205460ff165b15610dc257506001610dc6565b5060005b92915050565b610dd461106f565b6033546001600160a01b03908116911614610e015760405162461bcd60e51b81526004016104df906116f6565b6001600160a01b03919091166000908152606f60205260409020805460ff1916911515919091179055565b610e3461134e565b506040805160208101909152606754815290565b606e546001600160a01b03163314610e725760405162461bcd60e51b81526004016104df9061172b565b6001600160a01b0381166000908152606b6020526040902060010154610e96611073565b1015610eb45760405162461bcd60e51b81526004016104df90611752565b606d546000610ec48260026110a3565b90506000610ed482610723611073565b6001600160a01b0385166000908152606b602052604081206001015491925090610f0c90610e109061072f9082906107299089611077565b9050818111610f1b5781610f1d565b805b6001600160a01b039095166000908152606b602052604090206001019490945550505050565b610f4b61106f565b6033546001600160a01b03908116911614610f785760405162461bcd60e51b81526004016104df906116f6565b8051606781905560408051602081019091529081527f648c14aaad4917fb4b21a26204029346e658b9d13f49d7a4a1308ebf587240da9061092e906111b8565b610fc061106f565b6033546001600160a01b03908116911614610fed5760405162461bcd60e51b81526004016104df906116f6565b6001600160a01b0381166110135760405162461bcd60e51b81526004016104df9061159a565b6033546040516001600160a01b038084169216907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a3603380546001600160a01b0319166001600160a01b0392909216919091179055565b3390565b4290565b60008282018381101561109c5760405162461bcd60e51b81526004016104df906115e0565b9392505050565b600061109c83836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f0000000000008152506111bc565b6000826110f457506000610dc6565b8282028284828161110157fe5b041461109c5760405162461bcd60e51b81526004016104df906116b5565b303b1590565b600054610100900460ff168061113e575061113e61111f565b8061114c575060005460ff16155b6111685760405162461bcd60e51b81526004016104df90611667565b600054610100900460ff16158015611193576000805460ff1961ff0019909116610100171660011790555b61119b6111f3565b6111a3611274565b80156111b5576000805461ff00191690555b50565b5190565b600081836111dd5760405162461bcd60e51b81526004016104df9190611547565b5060008385816111e957fe5b0495945050505050565b600054610100900460ff168061120c575061120c61111f565b8061121a575060005460ff16155b6112365760405162461bcd60e51b81526004016104df90611667565b600054610100900460ff161580156111a3576000805460ff1961ff00199091166101001716600117905580156111b5576000805461ff001916905550565b600054610100900460ff168061128d575061128d61111f565b8061129b575060005460ff16155b6112b75760405162461bcd60e51b81526004016104df90611667565b600054610100900460ff161580156112e2576000805460ff1961ff0019909116610100171660011790555b60006112ec61106f565b603380546001600160a01b0319166001600160a01b038316908117909155604051919250906000907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908290a35080156111b5576000805461ff001916905550565b6040518060200160405280600081525090565b600060208284031215611372578081fd5b813561109c816117cc565b6000806040838503121561138f578081fd5b823561139a816117cc565b915060208301356113aa816117cc565b809150509250929050565b600080604083850312156113c7578182fd5b82356113d2816117cc565b9150602083013580151581146113aa578182fd5b600080600080600080600060e0888a031215611400578283fd5b873561140b816117cc565b9960208901359950604089013598606081013598506080810135975060a0810135965060c00135945092505050565b60006020828403121561144b578081fd5b8135801515811461109c578182fd5b6000806040838503121561138f578182fd5b60006020828403121561147d578081fd5b6040516020810181811067ffffffffffffffff8211171561149c578283fd5b6040529135825250919050565b6000602082840312156114ba578081fd5b5035919050565b6001600160a01b0391909116815260200190565b6001600160a01b0392831681529116602082015260400190565b6020808252825182820181905260009190848201906040850190845b818110156115305783516001600160a01b03168352928401929184019160010161150b565b50909695505050505050565b901515815260200190565b6000602080835283518082850152825b8181101561157357858101830151858201604001528201611557565b818111156115845783604083870101525b50601f01601f1916929092016040019392505050565b60208082526026908201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160408201526564647265737360d01b606082015260800190565b6020808252601b908201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604082015260600190565b6020808252600d908201526c656d707479206164647265737360981b604082015260600190565b6020808252600f908201526e185b5b481b9bdd08195e1a5cdd1959608a1b604082015260600190565b6020808252602e908201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160408201526d191e481a5b9a5d1a585b1a5e995960921b606082015260800190565b60208082526021908201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6040820152607760f81b606082015260800190565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b6020808252600d908201526c06f6e6c792073616b655065727609c1b604082015260600190565b6020808252601b908201527f706179206f7665726e696768742066656520746f6f206561726c790000000000604082015260600190565b602080825260169082015275195e18da185b99d948185b1c9958591e48185919195960521b604082015260600190565b9051815260200190565b90815260200190565b6001600160a01b03811681146111b557600080fdfea26469706673582212209e76b9acf71faa1b256cf5196a8eae8f1982866071f4f1be6372578e9151343164736f6c634300060c0033

Block Transaction Gas Used Reward
Age Block Fee Address BC Fee Address Voting Power Jailed Incoming
Block Uncle Number Difficulty Gas Used Reward
Loading