Contract 0x82bdf1A570Fb5de81F6a4C96a7840fb625Ee420D

 
Txn Hash Method
Block
From
To
Value [Txn Fee]
0x08e9ce57eacbc4bbfa0e3da409a86c5f22b08a01bb0727e9462db206ccbd4806Buy Bonds338002132022-03-19 1:41:41377 days 7 hrs ago0xb80d9f56c799ba4f3e11ff418c3cf4bc574a135d IN  0x82bdf1a570fb5de81f6a4c96a7840fb625ee420d0 FTM0.030882574878
0xe68a126ac3987a7ad94dcd677e0e830b4309a2df35bc1791f4e3750103993ca4Buy Bonds338001692022-03-19 1:41:00377 days 7 hrs ago0xb80d9f56c799ba4f3e11ff418c3cf4bc574a135d IN  0x82bdf1a570fb5de81f6a4c96a7840fb625ee420d0 FTM0.032240242518
0xc4b3736b25f1e1cdc1e1c54b58ad3ec87f945fb605cc566335633054d381e952Buy Bonds337998022022-03-19 1:35:32377 days 7 hrs ago0xb80d9f56c799ba4f3e11ff418c3cf4bc574a135d IN  0x82bdf1a570fb5de81f6a4c96a7840fb625ee420d0 FTM0.07675671126
0xf5fbfc30badb08a554518a687706ba6902204e7b959dea97f34e5a41c70c13c1Buy Bonds326794152022-03-06 2:35:06390 days 6 hrs ago0x35916f6da575f7ccc27b4fa5fd682e1e5ac01968 IN  0x82bdf1a570fb5de81f6a4c96a7840fb625ee420d0 FTM0.049401323601
0x37150b60ffc05c2c512476ce81771ccb99e62ac0e603fdbdab772b291933594bBuy Bonds326793782022-03-06 2:34:37390 days 6 hrs ago0x35916f6da575f7ccc27b4fa5fd682e1e5ac01968 IN  0x82bdf1a570fb5de81f6a4c96a7840fb625ee420d0 FTM0.049401323601
0xe5ba17eea40efc1c674f6aa40e910f96cc0247f1dadcc2886854c42fea4cfd42Buy Bonds326741732022-03-06 1:18:18390 days 7 hrs ago0x35916f6da575f7ccc27b4fa5fd682e1e5ac01968 IN  0x82bdf1a570fb5de81f6a4c96a7840fb625ee420d0 FTM0.063044581863
0x3ba6eb2eceeacdea891047aedd082e97bee8d438692308c0b332094a1300d950Allocate Seignio...325629792022-03-04 21:00:17391 days 12 hrs agoFDoge Finance: Deployer IN  0x82bdf1a570fb5de81f6a4c96a7840fb625ee420d0 FTM0.087151256092
0xc7f85794454c8979a3979f940c23566da6e1a00987440cc2f77a7138075c34d8Allocate Seignio...325408092022-03-04 15:15:12391 days 17 hrs agoFDoge Finance: Deployer IN  0x82bdf1a570fb5de81f6a4c96a7840fb625ee420d0 FTM0.080147858374
0x70da02dc7097959a1826dc022e59e2531c8f3ab73408b0923699099ade4120c7Allocate Seignio...325162182022-03-04 9:00:12392 days 8 mins agoFDoge Finance: Deployer IN  0x82bdf1a570fb5de81f6a4c96a7840fb625ee420d0 FTM0.059636441875
0x8ca884a5f92b10bcda786518787bde8fa1586ee9351b666db424934f2527137aAllocate Seignio...324934892022-03-04 3:00:12392 days 6 hrs agoFDoge Finance: Deployer IN  0x82bdf1a570fb5de81f6a4c96a7840fb625ee420d0 FTM0.050945953105
0xc4d2ca160b9cb01fbea244ec152b49ad5ec152bf296436a4aca7799227590a69Allocate Seignio...324883552022-03-04 1:45:12392 days 7 hrs agoFDoge Finance: Deployer IN  0x82bdf1a570fb5de81f6a4c96a7840fb625ee420d0 FTM0.082416797388
0x9199fcc4ab9b8b1e857158461d92eb049b4481ab294868d63497b9fc1c5f08dcAllocate Seignio...324475792022-03-03 15:00:15392 days 18 hrs agoFDoge Finance: Deployer IN  0x82bdf1a570fb5de81f6a4c96a7840fb625ee420d0 FTM0.218172901094
0x219fb89f5684e05999df3430fbfeee5e758eb8a52847df44ad60f6f5b2ff88c5Allocate Seignio...324273292022-03-03 9:30:14392 days 23 hrs agoFDoge Finance: Deployer IN  0x82bdf1a570fb5de81f6a4c96a7840fb625ee420d0 FTM0.225325368208
0x8478fc6648fb6bb185e446832a1de72082e7910eb8f15c93fb3222919d38dad2Allocate Seignio...324058912022-03-03 3:15:25393 days 5 hrs agoFDoge Finance: Deployer IN  0x82bdf1a570fb5de81f6a4c96a7840fb625ee420d0 FTM0.269283950392
0x7eb84a8bc586cbb8db3927441add0696f5953b12b8283b68b59ad0002b1faee1Allocate Seignio...323865082022-03-02 21:00:18393 days 12 hrs agoFDoge Finance: Deployer IN  0x82bdf1a570fb5de81f6a4c96a7840fb625ee420d0 FTM0.226315743418
0xaf365dc98579abe2a826c53e11ee8c3ec48626fb60db71b920f7e70efc7ca990Allocate Seignio...323684682022-03-02 15:30:27393 days 17 hrs agoFDoge Finance: Deployer IN  0x82bdf1a570fb5de81f6a4c96a7840fb625ee420d0 FTM0.23268043752
0xfe3b2cb131750f5aee4609da4369fa0f3ae562a6d1a8740ee18052defdbb6a94Allocate Seignio...323467712022-03-02 9:02:21394 days 6 mins agoFDoge Finance: Deployer IN  0x82bdf1a570fb5de81f6a4c96a7840fb625ee420d0 FTM0.249844291447
0xa51d732aaf47d3f3c44d5d9d896bfee3b8c5180d469907cb41c9144b910880d3Allocate Seignio...323262922022-03-02 3:15:12394 days 5 hrs agoFDoge Finance: Deployer IN  0x82bdf1a570fb5de81f6a4c96a7840fb625ee420d0 FTM0.235822423848
0xa58122d606d1246c8214f63831fad6de9c884018d0e44d80fd0c27782867ef94Allocate Seignio...323040072022-03-01 21:00:16394 days 12 hrs agoFDoge Finance: Deployer IN  0x82bdf1a570fb5de81f6a4c96a7840fb625ee420d0 FTM0.338854442262
0xaa2abc5fa57989091d60128fcb66abd30a082746a483ac5bf1a0b9c839ea6117Allocate Seignio...322821802022-03-01 15:15:13394 days 17 hrs agoFDoge Finance: Deployer IN  0x82bdf1a570fb5de81f6a4c96a7840fb625ee420d0 FTM0.21735815974
0x04e256c044719019a4baa73de38365617f36ce9fbf0917cebb84c2d87f2e9605Allocate Seignio...322612782022-03-01 9:15:13394 days 23 hrs agoFDoge Finance: Deployer IN  0x82bdf1a570fb5de81f6a4c96a7840fb625ee420d0 FTM0.16321366568
0xfa0c8ad4b4bb594d93fa9b7f9027ebb12095c2d57b96a413f7b09a41984c8e5aBuy Bonds322555852022-03-01 7:45:17395 days 1 hr ago0x0f381486de6794655589e50ad83fe6a08ab79009 IN  0x82bdf1a570fb5de81f6a4c96a7840fb625ee420d0 FTM0.057049818
0x8a6fcb4dfd67287dd15f7702263af1539cdb819d9820a69fc3e7671a3d81e0c6Allocate Seignio...322381172022-03-01 3:00:16395 days 6 hrs agoFDoge Finance: Deployer IN  0x82bdf1a570fb5de81f6a4c96a7840fb625ee420d0 FTM0.336561805862
0x07b5de30e2d683c6e43d817932037535dd56886a2002a2ef8b6d358f4ef5730aAllocate Seignio...322171182022-02-28 21:00:32395 days 12 hrs agoFDoge Finance: Deployer IN  0x82bdf1a570fb5de81f6a4c96a7840fb625ee420d0 FTM0.402884271912
0xcf7cd3f1b51718da4d1a87008daf2477de975def4887faff67af85057b7ad638Allocate Seignio...321984152022-02-28 15:32:41395 days 17 hrs agoFDoge Finance: Deployer IN  0x82bdf1a570fb5de81f6a4c96a7840fb625ee420d0 FTM0.056353592808
[ Download CSV Export 
Latest 1 internal transaction
Parent Txn Hash Block From To Value
0x281c6e67b8040cdc222bc4598d4ef7d729dcd57b183f9b0c489f10c60d71f3a5314618922022-02-19 22:39:31404 days 10 hrs ago FDoge Finance: Deployer  Contract Creation0 FTM
[ Download CSV Export 
Loading

Similar Match Source Code
Note: This contract matches the deployed ByteCode of the Source Code for Contract 0xc29C18CedDb27ce0B6dF89ee80d2219dF9179988

Contract Name:
FdogeTreasury

Compiler Version
v0.6.12+commit.27d51765

Optimization Enabled:
Yes with 1000 runs

Other Settings:
default evmVersion

Contract Source Code (Solidity Standard Json-Input format)

File 1 of 15 : FdogeTreasury.sol
// SPDX-License-Identifier: MIT

pragma solidity 0.6.12;

import "../lib/Math.sol";
import "../interfaces/IERC20.sol";
import "../lib/SafeERC20.sol";
import "../lib/ReentrancyGuard.sol";

import "../lib/Babylonian.sol";
import "../owner/Operator.sol";
import "../utils/ContractGuard.sol";
import "../interfaces/IBasisAsset.sol";
import "../interfaces/IOracle.sol";
import "../interfaces/IMasonry.sol";

/*$$$$$_ $$$$$___ __$$$___ __$$$$__ $$$$$$$_ ____ $$$$$$$_ $$$$_ $$___$$_ __$$$___ $$___$$_ __$$$$_ $$$$$$$_
$$______ $$__$$__ _$$_$$__ _$$__$$_ $$______ ____ $$______ _$$__ $$$__$$_ _$$_$$__ $$$__$$_ _$$____ $$______
$$$$$___ $$___$$_ $$___$$_ $$______ $$$$$___ ____ $$$$$___ _$$__ $$$$_$$_ $$___$$_ $$$$_$$_ $$_____ $$$$$___
$$______ $$___$$_ $$___$$_ $$__$$$_ $$______ ____ $$______ _$$__ $$_$$$$_ $$$$$$$_ $$_$$$$_ $$_____ $$______
$$______ $$__$$__ _$$_$$__ _$$__$$_ $$______ _$$_ $$______ _$$__ $$__$$$_ $$___$$_ $$__$$$_ _$$____ $$______
$$______ $$$$$___ __$$$___ __$$$$__ $$$$$$$_ _$$_ $$______ $$$$_ $$___$$_ $$___$$_ $$___$$_ __$$$$_ $$$$$$$_*/

contract FdogeTreasury is ContractGuard {
    using SafeERC20 for IERC20;
    using Address for address;
    using SafeMath for uint256;

    /* ========= CONSTANT VARIABLES ======== */

    uint256 public constant PERIOD = 6 hours;

    /* ========== STATE VARIABLES ========== */

    // governance
    address public operator;

    // flags
    bool public initialized = false;

    // epoch
    uint256 public startTime;
    uint256 public epoch = 0;
    uint256 public epochSupplyContractionLeft = 0;

    // exclusions from total supply
    address[] public excludedFromTotalSupply = [
        address(0x7404b088d40b78b6373b035a677826ecE6d6D0aa), // TombGenesisPool
        address(0x40c033a76F71440403c7dCf509574cd497774a1B) // TombRewardPool
    ];

    // core components
    address public tomb;
    address public tbond;
    address public tshare;

    address public masonry;
    address public tombOracle;

    // price
    uint256 public tombPriceOne;
    uint256 public tombPriceCeiling;

    uint256 public seigniorageSaved;

    uint256[] public supplyTiers;
    uint256[] public maxExpansionTiers;

    uint256 public maxSupplyExpansionPercent;
    uint256 public bondDepletionFloorPercent;
    uint256 public seigniorageExpansionFloorPercent;
    uint256 public maxSupplyContractionPercent;
    uint256 public maxDebtRatioPercent;

    // 28 first epochs (1 week) with 4.5% expansion regardless of TOMB price
    uint256 public bootstrapEpochs;
    uint256 public bootstrapSupplyExpansionPercent;

    /* =================== Added variables =================== */
    uint256 public previousEpochTombPrice;
    uint256 public maxDiscountRate; // when purchasing bond
    uint256 public maxPremiumRate; // when redeeming bond
    uint256 public discountPercent;
    uint256 public premiumThreshold;
    uint256 public premiumPercent;
    uint256 public mintingFactorForPayingDebt; // print extra TOMB during debt phase

    address public daoFund;
    uint256 public daoFundSharedPercent;

    address public devFund;
    uint256 public devFundSharedPercent;

    /* =================== Events =================== */

    event Initialized(address indexed executor, uint256 at);
    event BurnedBonds(address indexed from, uint256 bondAmount);
    event RedeemedBonds(address indexed from, uint256 tombAmount, uint256 bondAmount);
    event BoughtBonds(address indexed from, uint256 tombAmount, uint256 bondAmount);
    event TreasuryFunded(uint256 timestamp, uint256 seigniorage);
    event MasonryFunded(uint256 timestamp, uint256 seigniorage);
    event DaoFundFunded(uint256 timestamp, uint256 seigniorage);
    event DevFundFunded(uint256 timestamp, uint256 seigniorage);

    /* =================== Modifier =================== */

    modifier onlyOperator() {
        require(operator == msg.sender, "Treasury: caller is not the operator");
        _;
    }

    modifier checkCondition() {
        require(now >= startTime, "Treasury: not started yet");

        _;
    }

    modifier checkEpoch() {
        require(now >= nextEpochPoint(), "Treasury: not opened yet");

        _;

        epoch = epoch.add(1);
        epochSupplyContractionLeft = (getTombPrice() > tombPriceCeiling) ? 0 : getTombCirculatingSupply().mul(maxSupplyContractionPercent).div(10000);
    }

    modifier checkOperator() {
        require(
            IBasisAsset(tomb).operator() == address(this) &&
                IBasisAsset(tbond).operator() == address(this) &&
                IBasisAsset(tshare).operator() == address(this) &&
                Operator(masonry).operator() == address(this),
            "Treasury: need more permission"
        );

        _;
    }

    modifier notInitialized() {
        require(!initialized, "Treasury: already initialized");

        _;
    }

    /* ========== VIEW FUNCTIONS ========== */

    function isInitialized() public view returns (bool) {
        return initialized;
    }

    // epoch
    function nextEpochPoint() public view returns (uint256) {
        return startTime.add(epoch.mul(PERIOD));
    }

    // oracle
    function getTombPrice() public view returns (uint256 tombPrice) {
        try IOracle(tombOracle).consult(tomb, 1e18) returns (uint144 price) {
            return uint256(price);
        } catch {
            revert("Treasury: failed to consult TOMB price from the oracle");
        }
    }

    function getTombUpdatedPrice() public view returns (uint256 _tombPrice) {
        try IOracle(tombOracle).twap(tomb, 1e18) returns (uint144 price) {
            return uint256(price);
        } catch {
            revert("Treasury: failed to consult TOMB price from the oracle");
        }
    }

    // budget
    function getReserve() public view returns (uint256) {
        return seigniorageSaved;
    }

    function getBurnableTombLeft() public view returns (uint256 _burnableTombLeft) {
        uint256 _tombPrice = getTombPrice();
        if (_tombPrice <= tombPriceOne) {
            uint256 _tombSupply = getTombCirculatingSupply();
            uint256 _bondMaxSupply = _tombSupply.mul(maxDebtRatioPercent).div(10000);
            uint256 _bondSupply = IERC20(tbond).totalSupply();
            if (_bondMaxSupply > _bondSupply) {
                uint256 _maxMintableBond = _bondMaxSupply.sub(_bondSupply);
                uint256 _maxBurnableTomb = _maxMintableBond.mul(_tombPrice).div(1e18);
                _burnableTombLeft = Math.min(epochSupplyContractionLeft, _maxBurnableTomb);
            }
        }
    }

    function getRedeemableBonds() public view returns (uint256 _redeemableBonds) {
        uint256 _tombPrice = getTombPrice();
        if (_tombPrice > tombPriceCeiling) {
            uint256 _totalTomb = IERC20(tomb).balanceOf(address(this));
            uint256 _rate = getBondPremiumRate();
            if (_rate > 0) {
                _redeemableBonds = _totalTomb.mul(1e18).div(_rate);
            }
        }
    }

    function getBondDiscountRate() public view returns (uint256 _rate) {
        uint256 _tombPrice = getTombPrice();
        if (_tombPrice <= tombPriceOne) {
            if (discountPercent == 0) {
                // no discount
                _rate = tombPriceOne;
            } else {
                uint256 _bondAmount = tombPriceOne.mul(1e18).div(_tombPrice); // to burn 1 TOMB
                uint256 _discountAmount = _bondAmount.sub(tombPriceOne).mul(discountPercent).div(10000);
                _rate = tombPriceOne.add(_discountAmount);
                if (maxDiscountRate > 0 && _rate > maxDiscountRate) {
                    _rate = maxDiscountRate;
                }
            }
        }
    }

    function getBondPremiumRate() public view returns (uint256 _rate) {
        uint256 _tombPrice = getTombPrice();
        if (_tombPrice > tombPriceCeiling) {
            uint256 _tombPricePremiumThreshold = tombPriceOne.mul(premiumThreshold).div(100);
            if (_tombPrice >= _tombPricePremiumThreshold) {
                //Price > 1.10
                uint256 _premiumAmount = _tombPrice.sub(tombPriceOne).mul(premiumPercent).div(10000);
                _rate = tombPriceOne.add(_premiumAmount);
                if (maxPremiumRate > 0 && _rate > maxPremiumRate) {
                    _rate = maxPremiumRate;
                }
            } else {
                // no premium bonus
                _rate = tombPriceOne;
            }
        }
    }

    /* ========== GOVERNANCE ========== */

    function initialize(
        address _tomb,
        address _tbond,
        address _tshare,
        address _tombOracle,
        address _masonry,
        uint256 _startTime
    ) public notInitialized {
        tomb = _tomb;
        tbond = _tbond;
        tshare = _tshare;
        tombOracle = _tombOracle;
        masonry = _masonry;
        startTime = _startTime;

        tombPriceOne = 10**18;
        tombPriceCeiling = tombPriceOne.mul(101).div(100);

        // Dynamic max expansion percent
        supplyTiers = [0 ether, 500000 ether, 1000000 ether, 1500000 ether, 2000000 ether, 5000000 ether, 10000000 ether, 20000000 ether, 50000000 ether];
        maxExpansionTiers = [450, 400, 350, 300, 250, 200, 150, 125, 100];

        maxSupplyExpansionPercent = 400; // Upto 4.0% supply for expansion

        bondDepletionFloorPercent = 10000; // 100% of Bond supply for depletion floor
        seigniorageExpansionFloorPercent = 3500; // At least 35% of expansion reserved for masonry
        maxSupplyContractionPercent = 300; // Upto 3.0% supply for contraction (to burn TOMB and mint tBOND)
        maxDebtRatioPercent = 3500; // Upto 35% supply of tBOND to purchase

        premiumThreshold = 110;
        premiumPercent = 7000;

        // First 28 epochs with 4.5% expansion
        bootstrapEpochs = 28;
        bootstrapSupplyExpansionPercent = 450;

        // set seigniorageSaved to it's balance
        seigniorageSaved = IERC20(tomb).balanceOf(address(this));

        initialized = true;
        operator = msg.sender;
        emit Initialized(msg.sender, block.number);
    }

    function setOperator(address _operator) external onlyOperator {
        operator = _operator;
    }

    function setMasonry(address _masonry) external onlyOperator {
        masonry = _masonry;
    }

    function setAddr(
        address _tomb,
        address _tbond,
        address _tshare,
        address _tombOracle,
        address _masonry,
        uint256 _startTime
    ) external onlyOperator {
        tomb = _tomb;
        tbond = _tbond;
        tshare = _tshare;
        tombOracle = _tombOracle;
        masonry = _masonry;
        startTime = _startTime;
    }

    function setTombOracle(address _tombOracle) external onlyOperator {
        tombOracle = _tombOracle;
    }

    function setTombPriceCeiling(uint256 _tombPriceCeiling) external onlyOperator {
        require(_tombPriceCeiling >= tombPriceOne && _tombPriceCeiling <= tombPriceOne.mul(120).div(100), "out of range"); // [$1.0, $1.2]
        tombPriceCeiling = _tombPriceCeiling;
    }

    function setMaxSupplyExpansionPercents(uint256 _maxSupplyExpansionPercent) external onlyOperator {
        require(_maxSupplyExpansionPercent >= 10 && _maxSupplyExpansionPercent <= 1000, "_maxSupplyExpansionPercent: out of range"); // [0.1%, 10%]
        maxSupplyExpansionPercent = _maxSupplyExpansionPercent;
    }

    function setSupplyTiersEntry(uint8 _index, uint256 _value) external onlyOperator returns (bool) {
        require(_index >= 0, "Index has to be higher than 0");
        require(_index < 9, "Index has to be lower than count of tiers");
        if (_index > 0) {
            require(_value > supplyTiers[_index - 1]);
        }
        if (_index < 8) {
            require(_value < supplyTiers[_index + 1]);
        }
        supplyTiers[_index] = _value;
        return true;
    }

    function setMaxExpansionTiersEntry(uint8 _index, uint256 _value) external onlyOperator returns (bool) {
        require(_index >= 0, "Index has to be higher than 0");
        require(_index < 9, "Index has to be lower than count of tiers");
        require(_value >= 10 && _value <= 1000, "_value: out of range"); // [0.1%, 10%]
        maxExpansionTiers[_index] = _value;
        return true;
    }

    function setBondDepletionFloorPercent(uint256 _bondDepletionFloorPercent) external onlyOperator {
        require(_bondDepletionFloorPercent >= 500 && _bondDepletionFloorPercent <= 10000, "out of range"); // [5%, 100%]
        bondDepletionFloorPercent = _bondDepletionFloorPercent;
    }

    function setMaxSupplyContractionPercent(uint256 _maxSupplyContractionPercent) external onlyOperator {
        require(_maxSupplyContractionPercent >= 100 && _maxSupplyContractionPercent <= 1500, "out of range"); // [0.1%, 15%]
        maxSupplyContractionPercent = _maxSupplyContractionPercent;
    }

    function setMaxDebtRatioPercent(uint256 _maxDebtRatioPercent) external onlyOperator {
        require(_maxDebtRatioPercent >= 1000 && _maxDebtRatioPercent <= 10000, "out of range"); // [10%, 100%]
        maxDebtRatioPercent = _maxDebtRatioPercent;
    }

    function setBootstrap(uint256 _bootstrapEpochs, uint256 _bootstrapSupplyExpansionPercent) external onlyOperator {
        require(_bootstrapEpochs <= 120, "_bootstrapEpochs: out of range"); // <= 1 month
        require(_bootstrapSupplyExpansionPercent >= 100 && _bootstrapSupplyExpansionPercent <= 1000, "_bootstrapSupplyExpansionPercent: out of range"); // [1%, 10%]
        bootstrapEpochs = _bootstrapEpochs;
        bootstrapSupplyExpansionPercent = _bootstrapSupplyExpansionPercent;
    }

    function setExtraFunds(
        address _daoFund,
        uint256 _daoFundSharedPercent,
        address _devFund,
        uint256 _devFundSharedPercent
    ) external onlyOperator {
        require(_daoFund != address(0), "zero");
        require(_daoFundSharedPercent <= 3000, "out of range"); // <= 30%
        require(_devFund != address(0), "zero");
        require(_devFundSharedPercent <= 1000, "out of range"); // <= 10%
        daoFund = _daoFund;
        daoFundSharedPercent = _daoFundSharedPercent;
        devFund = _devFund;
        devFundSharedPercent = _devFundSharedPercent;
    }

    function setMaxDiscountRate(uint256 _maxDiscountRate) external onlyOperator {
        maxDiscountRate = _maxDiscountRate;
    }

    function setMaxPremiumRate(uint256 _maxPremiumRate) external onlyOperator {
        maxPremiumRate = _maxPremiumRate;
    }

    function setDiscountPercent(uint256 _discountPercent) external onlyOperator {
        require(_discountPercent <= 20000, "_discountPercent is over 200%");
        discountPercent = _discountPercent;
    }

    function setPremiumThreshold(uint256 _premiumThreshold) external onlyOperator {
        require(_premiumThreshold >= tombPriceCeiling, "_premiumThreshold exceeds tombPriceCeiling");
        require(_premiumThreshold <= 150, "_premiumThreshold is higher than 1.5");
        premiumThreshold = _premiumThreshold;
    }

    function setPremiumPercent(uint256 _premiumPercent) external onlyOperator {
        require(_premiumPercent <= 20000, "_premiumPercent is over 200%");
        premiumPercent = _premiumPercent;
    }

    function setMintingFactorForPayingDebt(uint256 _mintingFactorForPayingDebt) external onlyOperator {
        require(_mintingFactorForPayingDebt >= 10000 && _mintingFactorForPayingDebt <= 20000, "_mintingFactorForPayingDebt: out of range"); // [100%, 200%]
        mintingFactorForPayingDebt = _mintingFactorForPayingDebt;
    }

    /* ========== MUTABLE FUNCTIONS ========== */

    function _updateTombPrice() internal {
        try IOracle(tombOracle).update() {} catch {}
    }

    function getTombCirculatingSupply() public view returns (uint256) {
        IERC20 tombErc20 = IERC20(tomb);
        uint256 totalSupply = tombErc20.totalSupply();
        uint256 balanceExcluded = 0;
        for (uint8 entryId = 0; entryId < excludedFromTotalSupply.length; ++entryId) {
            balanceExcluded = balanceExcluded.add(tombErc20.balanceOf(excludedFromTotalSupply[entryId]));
        }
        return totalSupply.sub(balanceExcluded);
    }

    function buyBonds(uint256 _tombAmount, uint256 targetPrice) external onlyOneBlock checkCondition checkOperator {
        require(_tombAmount > 0, "Treasury: cannot purchase bonds with zero amount");

        uint256 tombPrice = getTombPrice();
        require(tombPrice == targetPrice, "Treasury: TOMB price moved");
        require(
            tombPrice < tombPriceOne, // price < $1
            "Treasury: tombPrice not eligible for bond purchase"
        );

        require(_tombAmount <= epochSupplyContractionLeft, "Treasury: not enough bond left to purchase");

        uint256 _rate = getBondDiscountRate();
        require(_rate > 0, "Treasury: invalid bond rate");

        uint256 _bondAmount = _tombAmount.mul(_rate).div(1e18);
        uint256 tombSupply = getTombCirculatingSupply();
        uint256 newBondSupply = IERC20(tbond).totalSupply().add(_bondAmount);
        require(newBondSupply <= tombSupply.mul(maxDebtRatioPercent).div(10000), "over max debt ratio");

        IBasisAsset(tomb).burnFrom(msg.sender, _tombAmount);
        IBasisAsset(tbond).mint(msg.sender, _bondAmount);

        epochSupplyContractionLeft = epochSupplyContractionLeft.sub(_tombAmount);
        _updateTombPrice();

        emit BoughtBonds(msg.sender, _tombAmount, _bondAmount);
    }

    function redeemBonds(uint256 _bondAmount, uint256 targetPrice) external onlyOneBlock checkCondition checkOperator {
        require(_bondAmount > 0, "Treasury: cannot redeem bonds with zero amount");

        uint256 tombPrice = getTombPrice();
        require(tombPrice == targetPrice, "Treasury: TOMB price moved");
        require(
            tombPrice > tombPriceCeiling, // price > $1.01
            "Treasury: tombPrice not eligible for bond purchase"
        );

        uint256 _rate = getBondPremiumRate();
        require(_rate > 0, "Treasury: invalid bond rate");

        uint256 _tombAmount = _bondAmount.mul(_rate).div(1e18);
        require(IERC20(tomb).balanceOf(address(this)) >= _tombAmount, "Treasury: treasury has no more budget");

        seigniorageSaved = seigniorageSaved.sub(Math.min(seigniorageSaved, _tombAmount));

        IBasisAsset(tbond).burnFrom(msg.sender, _bondAmount);
        IERC20(tomb).safeTransfer(msg.sender, _tombAmount);

        _updateTombPrice();

        emit RedeemedBonds(msg.sender, _tombAmount, _bondAmount);
    }

    function _sendToMasonry(uint256 _amount) internal {
        IBasisAsset(tomb).mint(address(this), _amount);

        uint256 _daoFundSharedAmount = 0;
        if (daoFundSharedPercent > 0) {
            _daoFundSharedAmount = _amount.mul(daoFundSharedPercent).div(10000);
            IERC20(tomb).transfer(daoFund, _daoFundSharedAmount);
            emit DaoFundFunded(now, _daoFundSharedAmount);
        }

        uint256 _devFundSharedAmount = 0;
        if (devFundSharedPercent > 0) {
            _devFundSharedAmount = _amount.mul(devFundSharedPercent).div(10000);
            IERC20(tomb).transfer(devFund, _devFundSharedAmount);
            emit DevFundFunded(now, _devFundSharedAmount);
        }

        _amount = _amount.sub(_daoFundSharedAmount).sub(_devFundSharedAmount);

        IERC20(tomb).safeApprove(masonry, 0);
        IERC20(tomb).safeApprove(masonry, _amount);
        IMasonry(masonry).allocateSeigniorage(_amount);
        emit MasonryFunded(now, _amount);
    }

    function _calculateMaxSupplyExpansionPercent(uint256 _tombSupply) internal returns (uint256) {
        for (uint8 tierId = 8; tierId >= 0; --tierId) {
            if (_tombSupply >= supplyTiers[tierId]) {
                maxSupplyExpansionPercent = maxExpansionTiers[tierId];
                break;
            }
        }
        return maxSupplyExpansionPercent;
    }

    function allocateSeigniorage() external onlyOneBlock checkCondition checkEpoch checkOperator {
        _updateTombPrice();
        previousEpochTombPrice = getTombPrice();
        uint256 tombSupply = getTombCirculatingSupply().sub(seigniorageSaved);
        if (epoch < bootstrapEpochs) {
            // 28 first epochs with 4.5% expansion
            _sendToMasonry(tombSupply.mul(bootstrapSupplyExpansionPercent).div(10000));
        } else {
            if (previousEpochTombPrice > tombPriceCeiling) {
                // Expansion ($TOMB Price > 1 $FTM): there is some seigniorage to be allocated
                uint256 bondSupply = IERC20(tbond).totalSupply();
                uint256 _percentage = previousEpochTombPrice.sub(tombPriceOne);
                uint256 _savedForBond;
                uint256 _savedForMasonry;
                uint256 _mse = _calculateMaxSupplyExpansionPercent(tombSupply).mul(1e14);
                if (_percentage > _mse) {
                    _percentage = _mse;
                }
                if (seigniorageSaved >= bondSupply.mul(bondDepletionFloorPercent).div(10000)) {
                    // saved enough to pay debt, mint as usual rate
                    _savedForMasonry = tombSupply.mul(_percentage).div(1e18);
                } else {
                    // have not saved enough to pay debt, mint more
                    uint256 _seigniorage = tombSupply.mul(_percentage).div(1e18);
                    _savedForMasonry = _seigniorage.mul(seigniorageExpansionFloorPercent).div(10000);
                    _savedForBond = _seigniorage.sub(_savedForMasonry);
                    if (mintingFactorForPayingDebt > 0) {
                        _savedForBond = _savedForBond.mul(mintingFactorForPayingDebt).div(10000);
                    }
                }
                if (_savedForMasonry > 0) {
                    _sendToMasonry(_savedForMasonry);
                }
                if (_savedForBond > 0) {
                    seigniorageSaved = seigniorageSaved.add(_savedForBond);
                    IBasisAsset(tomb).mint(address(this), _savedForBond);
                    emit TreasuryFunded(now, _savedForBond);
                }
            }
        }
    }

    // function governanceRecoverUnsupported(
    //     IERC20 _token,
    //     uint256 _amount,
    //     address _to
    // ) external onlyOperator {
    //     // do not allow to drain core tokens
    //     require(address(_token) != address(tomb), "tomb");
    //     require(address(_token) != address(tbond), "bond");
    //     require(address(_token) != address(tshare), "share");
    //     _token.safeTransfer(_to, _amount);
    // }

    function masonrySetOperator(address _operator) external onlyOperator {
        IMasonry(masonry).setOperator(_operator);
    }

    function masonrySetLockUp(uint256 _withdrawLockupEpochs, uint256 _rewardLockupEpochs) external onlyOperator {
        IMasonry(masonry).setLockUp(_withdrawLockupEpochs, _rewardLockupEpochs);
    }

    function masonryAllocateSeigniorage(uint256 amount) external onlyOperator {
        IMasonry(masonry).allocateSeigniorage(amount);
    }

    // function masonryGovernanceRecoverUnsupported(
    //     address _token,
    //     uint256 _amount,
    //     address _to
    // ) external onlyOperator {
    //     IMasonry(masonry).governanceRecoverUnsupported(_token, _amount, _to);
    // }
}

File 2 of 15 : Math.sol
//SPDX-License-Identifier: UNLICENSED
pragma solidity ^0.6.0;

/**
 * @dev Standard math utilities missing in the Solidity language.
 */
library Math {
    /**
     * @dev Returns the largest of two numbers.
     */
    function max(uint256 a, uint256 b) internal pure returns (uint256) {
        return a >= b ? a : b;
    }

    /**
     * @dev Returns the smallest of two numbers.
     */
    function min(uint256 a, uint256 b) internal pure returns (uint256) {
        return a < b ? a : b;
    }

    /**
     * @dev Returns the average of two numbers. The result is rounded towards
     * zero.
     */
    function average(uint256 a, uint256 b) internal pure returns (uint256) {
        // (a + b) / 2 can overflow, so we distribute
        return (a / 2) + (b / 2) + ((a % 2 + b % 2) / 2);
    }
}

File 3 of 15 : IERC20.sol
// SPDX-License-Identifier: MIT

pragma solidity 0.6.12;

/**
 * @dev Interface of the ERC20 standard as defined in the EIP.
 */
interface IERC20 {
    /**
     * @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);
}

File 4 of 15 : SafeERC20.sol
//SPDX-License-Identifier: UNLICENSED
pragma solidity ^0.6.0;

import "../interfaces/IERC20.sol";
import "../lib/SafeMath.sol";
import "../utils/Address.sol";

/**
 * @title SafeERC20
 * @dev Wrappers around ERC20 operations that throw on failure (when the token
 * contract returns false). Tokens that return no value (and instead revert or
 * throw on failure) are also supported, non-reverting calls are assumed to be
 * successful.
 * To use this library you can add a `using SafeERC20 for ERC20;` statement to your contract,
 * which allows you to call the safe operations as `token.safeTransfer(...)`, etc.
 */
library SafeERC20 {
    using SafeMath for uint256;
    using Address for address;

    function safeTransfer(
        IERC20 token,
        address to,
        uint256 value
    ) internal {
        _callOptionalReturn(token, abi.encodeWithSelector(token.transfer.selector, to, value));
    }

    function safeTransferFrom(
        IERC20 token,
        address from,
        address to,
        uint256 value
    ) internal {
        _callOptionalReturn(token, abi.encodeWithSelector(token.transferFrom.selector, from, to, value));
    }

    function safeApprove(
        IERC20 token,
        address spender,
        uint256 value
    ) internal {
        // safeApprove should only be called when setting an initial allowance,
        // or when resetting it to zero. To increase and decrease it, use
        // 'safeIncreaseAllowance' and 'safeDecreaseAllowance'
        // solhint-disable-next-line max-line-length
        require((value == 0) || (token.allowance(address(this), spender) == 0), "SafeERC20: approve from non-zero to non-zero allowance");
        _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, value));
    }

    function safeIncreaseAllowance(
        IERC20 token,
        address spender,
        uint256 value
    ) internal {
        uint256 newAllowance = token.allowance(address(this), spender).add(value);
        _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance));
    }

    function safeDecreaseAllowance(
        IERC20 token,
        address spender,
        uint256 value
    ) internal {
        uint256 newAllowance = token.allowance(address(this), spender).sub(value, "SafeERC20: decreased allowance below zero");
        _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance));
    }

    /**
     * @dev Imitates a Solidity high-level call (i.e. a regular function call to a contract), relaxing the requirement
     * on the return value: the return value is optional (but if data is returned, it must not be false).
     * @param token The token targeted by the call.
     * @param data The call data (encoded using abi.encode or one of its variants).
     */
    function _callOptionalReturn(IERC20 token, bytes memory data) private {
        // We need to perform a low level call here, to bypass Solidity's return data size checking mechanism, since
        // we're implementing it ourselves.

        // A Solidity high level call has three parts:
        //  1. The target address is checked to verify it contains contract code
        //  2. The call itself is made, and success asserted
        //  3. The return value is decoded, which in turn checks the size of the returned data.
        // solhint-disable-next-line max-line-length
        require(address(token).isContract(), "SafeERC20: call to non-contract");

        // solhint-disable-next-line avoid-low-level-calls
        (bool success, bytes memory returndata) = address(token).call(data);
        require(success, "SafeERC20: low-level call failed");

        if (returndata.length > 0) {
            // Return data is optional
            // solhint-disable-next-line max-line-length
            require(abi.decode(returndata, (bool)), "SafeERC20: ERC20 operation did not succeed");
        }
    }
}

File 5 of 15 : ReentrancyGuard.sol
//SPDX-License-Identifier: UNLICENSED
pragma solidity ^0.6.0;

/**
 * @dev Contract module that helps prevent reentrant calls to a function.
 *
 * Inheriting from `ReentrancyGuard` will make the {nonReentrant} modifier
 * available, which can be applied to functions to make sure there are no nested
 * (reentrant) calls to them.
 *
 * Note that because there is a single `nonReentrant` guard, functions marked as
 * `nonReentrant` may not call one another. This can be worked around by making
 * those functions `private`, and then adding `external` `nonReentrant` entry
 * points to them.
 *
 * TIP: If you would like to learn more about reentrancy and alternative ways
 * to protect against it, check out our blog post
 * https://blog.openzeppelin.com/reentrancy-after-istanbul/[Reentrancy After Istanbul].
 */
contract ReentrancyGuard {
    bool private _notEntered;

    constructor () internal {
        // Storing an initial non-zero value makes deployment a bit more
        // expensive, but in exchange the refund on every call to nonReentrant
        // will be lower in amount. Since refunds are capped to a percetange of
        // the total transaction's gas, it is best to keep them low in cases
        // like this one, to increase the likelihood of the full refund coming
        // into effect.
        _notEntered = true;
    }

    /**
     * @dev Prevents a contract from calling itself, directly or indirectly.
     * Calling a `nonReentrant` function from another `nonReentrant`
     * function is not supported. It is possible to prevent this from happening
     * by making the `nonReentrant` function external, and make it call a
     * `private` function that does the actual work.
     */
    modifier nonReentrant() {
        // On the first call to nonReentrant, _notEntered will be true
        require(_notEntered, "ReentrancyGuard: reentrant call");

        // Any calls to nonReentrant after this point will fail
        _notEntered = false;

        _;

        // By storing the original value once again, a refund is triggered (see
        // https://eips.ethereum.org/EIPS/eip-2200)
        _notEntered = true;
    }
}

File 6 of 15 : Babylonian.sol
//SPDX-License-Identifier: UNLICENSED
pragma solidity ^0.6.0;

library Babylonian {
    function sqrt(uint256 y) internal pure returns (uint256 z) {
        if (y > 3) {
            z = y;
            uint256 x = y / 2 + 1;
            while (x < z) {
                z = x;
                x = (y / x + x) / 2;
            }
        } else if (y != 0) {
            z = 1;
        }
        // else z = 0
    }
}

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

pragma solidity 0.6.12;

import "../lib/Context.sol";
import "../lib/Ownable.sol";

contract Operator is Context, Ownable {
    address private _operator;

    event OperatorTransferred(address indexed previousOperator, address indexed newOperator);

    constructor() internal {
        _operator = _msgSender();
        emit OperatorTransferred(address(0), _operator);
    }

    function operator() public view returns (address) {
        return _operator;
    }

    modifier onlyOperator() {
        require(_operator == msg.sender, "operator: caller is not the operator");
        _;
    }

    function isOperator() public view returns (bool) {
        return _msgSender() == _operator;
    }

    function transferOperator(address newOperator_) public onlyOwner {
        _transferOperator(newOperator_);
    }

    function _transferOperator(address newOperator_) internal {
        require(newOperator_ != address(0), "operator: zero address given for new operator");
        emit OperatorTransferred(address(0), newOperator_);
        _operator = newOperator_;
    }
}

File 8 of 15 : ContractGuard.sol
//SPDX-License-Identifier: UNLICENSED
pragma solidity 0.6.12;

contract ContractGuard {
    mapping(uint256 => mapping(address => bool)) private _status;

    function checkSameOriginReentranted() internal view returns (bool) {
        return _status[block.number][tx.origin];
    }

    function checkSameSenderReentranted() internal view returns (bool) {
        return _status[block.number][msg.sender];
    }

    modifier onlyOneBlock() {
        require(!checkSameOriginReentranted(), "ContractGuard: one block, one function");
        require(!checkSameSenderReentranted(), "ContractGuard: one block, one function");

        _;

        _status[block.number][tx.origin] = true;
        _status[block.number][msg.sender] = true;
    }
}

File 9 of 15 : IBasisAsset.sol
//SPDX-License-Identifier: UNLICENSED
pragma solidity ^0.6.0;

interface IBasisAsset {
    function mint(address recipient, uint256 amount) external returns (bool);

    function burn(uint256 amount) external;

    function burnFrom(address from, uint256 amount) external;

    function isOperator() external returns (bool);

    function operator() external view returns (address);

    function transferOperator(address newOperator_) external;
}

File 10 of 15 : IOracle.sol
// SPDX-License-Identifier: MIT

pragma solidity 0.6.12;

interface IOracle {
    function update() external;

    function consult(address _token, uint256 _amountIn) external view returns (uint144 amountOut);

    function twap(address _token, uint256 _amountIn) external view returns (uint144 _amountOut);
}

File 11 of 15 : IMasonry.sol
// SPDX-License-Identifier: MIT

pragma solidity 0.6.12;

interface IMasonry {
    function balanceOf(address _mason) external view returns (uint256);

    function earned(address _mason) external view returns (uint256);

    function canWithdraw(address _mason) external view returns (bool);

    function canClaimReward(address _mason) external view returns (bool);

    function epoch() external view returns (uint256);

    function nextEpochPoint() external view returns (uint256);

    function getTombPrice() external view returns (uint256);

    function setOperator(address _operator) external;

    function setLockUp(uint256 _withdrawLockupEpochs, uint256 _rewardLockupEpochs) external;

    function stake(uint256 _amount) external;

    function withdraw(uint256 _amount) external;

    function exit() external;

    function claimReward() external;

    function allocateSeigniorage(uint256 _amount) external;

    function governanceRecoverUnsupported(address _token, uint256 _amount, address _to) external;
}

File 12 of 15 : SafeMath.sol
//SPDX-License-Identifier: UNLICENSED
pragma solidity ^0.6.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 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) {
        // Solidity only automatically asserts when dividing by 0
        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 13 of 15 : Address.sol
//SPDX-License-Identifier: UNLICENSED
pragma solidity ^0.6.2;

/**
 * @dev Collection of functions related to the address type
 */
library Address {
    /**
     * @dev Returns true if `account` is a contract.
     *
     * [IMPORTANT]
     * ====
     * It is unsafe to assume that an address for which this function returns
     * false is an externally-owned account (EOA) and not a contract.
     *
     * Among others, `isContract` will return false for the following
     * types of addresses:
     *
     *  - an externally-owned account
     *  - a contract in construction
     *  - an address where a contract will be created
     *  - an address where a contract lived, but was destroyed
     * ====
     */
    function isContract(address account) internal view returns (bool) {
        // According to EIP-1052, 0x0 is the value returned for not-yet created accounts
        // and 0xc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470 is returned
        // for accounts without code, i.e. `keccak256('')`
        bytes32 codehash;
        bytes32 accountHash = 0xc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470;
        // solhint-disable-next-line no-inline-assembly
        assembly { codehash := extcodehash(account) }
        return (codehash != accountHash && codehash != 0x0);
    }

    /**
     * @dev Replacement for Solidity's `transfer`: sends `amount` wei to
     * `recipient`, forwarding all available gas and reverting on errors.
     *
     * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost
     * of certain opcodes, possibly making contracts go over the 2300 gas limit
     * imposed by `transfer`, making them unable to receive funds via
     * `transfer`. {sendValue} removes this limitation.
     *
     * https://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more].
     *
     * IMPORTANT: because control is transferred to `recipient`, care must be
     * taken to not create reentrancy vulnerabilities. Consider using
     * {ReentrancyGuard} or the
     * https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].
     */
    function sendValue(address payable recipient, uint256 amount) internal {
        require(address(this).balance >= amount, "Address: insufficient balance");

        // solhint-disable-next-line avoid-low-level-calls, avoid-call-value
        (bool success, ) = recipient.call{ value: amount }("");
        require(success, "Address: unable to send value, recipient may have reverted");
    }
}

File 14 of 15 : Context.sol
//SPDX-License-Identifier: UNLICENSED
pragma solidity ^0.6.0;

/*
 * @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.
 */
contract Context {
    // Empty internal constructor, to prevent people from mistakenly deploying
    // an instance of this contract, which should be used via inheritance.
    constructor () internal { }

    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;
    }
}

File 15 of 15 : Ownable.sol
//SPDX-License-Identifier: UNLICENSED
pragma solidity ^0.6.0;

import "./Context.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.
 */
contract Ownable is Context {
    address private _owner;

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

    /**
     * @dev Initializes the contract setting the deployer as the initial owner.
     */
    constructor() internal {
        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;
    }
}

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

Contract Security Audit

Contract ABI

[{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"from","type":"address"},{"indexed":false,"internalType":"uint256","name":"tombAmount","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"bondAmount","type":"uint256"}],"name":"BoughtBonds","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"from","type":"address"},{"indexed":false,"internalType":"uint256","name":"bondAmount","type":"uint256"}],"name":"BurnedBonds","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"timestamp","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"seigniorage","type":"uint256"}],"name":"DaoFundFunded","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"timestamp","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"seigniorage","type":"uint256"}],"name":"DevFundFunded","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"executor","type":"address"},{"indexed":false,"internalType":"uint256","name":"at","type":"uint256"}],"name":"Initialized","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"timestamp","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"seigniorage","type":"uint256"}],"name":"MasonryFunded","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"from","type":"address"},{"indexed":false,"internalType":"uint256","name":"tombAmount","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"bondAmount","type":"uint256"}],"name":"RedeemedBonds","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"timestamp","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"seigniorage","type":"uint256"}],"name":"TreasuryFunded","type":"event"},{"inputs":[],"name":"PERIOD","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"allocateSeigniorage","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"bondDepletionFloorPercent","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"bootstrapEpochs","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"bootstrapSupplyExpansionPercent","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_tombAmount","type":"uint256"},{"internalType":"uint256","name":"targetPrice","type":"uint256"}],"name":"buyBonds","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"daoFund","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"daoFundSharedPercent","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"devFund","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"devFundSharedPercent","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"discountPercent","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"epoch","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"epochSupplyContractionLeft","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"excludedFromTotalSupply","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getBondDiscountRate","outputs":[{"internalType":"uint256","name":"_rate","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getBondPremiumRate","outputs":[{"internalType":"uint256","name":"_rate","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getBurnableTombLeft","outputs":[{"internalType":"uint256","name":"_burnableTombLeft","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getRedeemableBonds","outputs":[{"internalType":"uint256","name":"_redeemableBonds","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getReserve","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getTombCirculatingSupply","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getTombPrice","outputs":[{"internalType":"uint256","name":"tombPrice","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getTombUpdatedPrice","outputs":[{"internalType":"uint256","name":"_tombPrice","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_tomb","type":"address"},{"internalType":"address","name":"_tbond","type":"address"},{"internalType":"address","name":"_tshare","type":"address"},{"internalType":"address","name":"_tombOracle","type":"address"},{"internalType":"address","name":"_masonry","type":"address"},{"internalType":"uint256","name":"_startTime","type":"uint256"}],"name":"initialize","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"initialized","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"isInitialized","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"masonry","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"masonryAllocateSeigniorage","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_withdrawLockupEpochs","type":"uint256"},{"internalType":"uint256","name":"_rewardLockupEpochs","type":"uint256"}],"name":"masonrySetLockUp","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_operator","type":"address"}],"name":"masonrySetOperator","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"maxDebtRatioPercent","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"maxDiscountRate","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"maxExpansionTiers","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"maxPremiumRate","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"maxSupplyContractionPercent","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"maxSupplyExpansionPercent","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"mintingFactorForPayingDebt","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"nextEpochPoint","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"operator","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"premiumPercent","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"premiumThreshold","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"previousEpochTombPrice","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_bondAmount","type":"uint256"},{"internalType":"uint256","name":"targetPrice","type":"uint256"}],"name":"redeemBonds","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"seigniorageExpansionFloorPercent","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"seigniorageSaved","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_tomb","type":"address"},{"internalType":"address","name":"_tbond","type":"address"},{"internalType":"address","name":"_tshare","type":"address"},{"internalType":"address","name":"_tombOracle","type":"address"},{"internalType":"address","name":"_masonry","type":"address"},{"internalType":"uint256","name":"_startTime","type":"uint256"}],"name":"setAddr","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_bondDepletionFloorPercent","type":"uint256"}],"name":"setBondDepletionFloorPercent","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_bootstrapEpochs","type":"uint256"},{"internalType":"uint256","name":"_bootstrapSupplyExpansionPercent","type":"uint256"}],"name":"setBootstrap","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_discountPercent","type":"uint256"}],"name":"setDiscountPercent","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_daoFund","type":"address"},{"internalType":"uint256","name":"_daoFundSharedPercent","type":"uint256"},{"internalType":"address","name":"_devFund","type":"address"},{"internalType":"uint256","name":"_devFundSharedPercent","type":"uint256"}],"name":"setExtraFunds","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_masonry","type":"address"}],"name":"setMasonry","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_maxDebtRatioPercent","type":"uint256"}],"name":"setMaxDebtRatioPercent","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_maxDiscountRate","type":"uint256"}],"name":"setMaxDiscountRate","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint8","name":"_index","type":"uint8"},{"internalType":"uint256","name":"_value","type":"uint256"}],"name":"setMaxExpansionTiersEntry","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_maxPremiumRate","type":"uint256"}],"name":"setMaxPremiumRate","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_maxSupplyContractionPercent","type":"uint256"}],"name":"setMaxSupplyContractionPercent","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_maxSupplyExpansionPercent","type":"uint256"}],"name":"setMaxSupplyExpansionPercents","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_mintingFactorForPayingDebt","type":"uint256"}],"name":"setMintingFactorForPayingDebt","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_operator","type":"address"}],"name":"setOperator","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_premiumPercent","type":"uint256"}],"name":"setPremiumPercent","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_premiumThreshold","type":"uint256"}],"name":"setPremiumThreshold","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint8","name":"_index","type":"uint8"},{"internalType":"uint256","name":"_value","type":"uint256"}],"name":"setSupplyTiersEntry","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_tombOracle","type":"address"}],"name":"setTombOracle","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_tombPriceCeiling","type":"uint256"}],"name":"setTombPriceCeiling","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"startTime","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"supplyTiers","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"tbond","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"tomb","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"tombOracle","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"tombPriceCeiling","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"tombPriceOne","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"tshare","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"}]

6001805460ff60a01b191690556000600381905560045560c0604052737404b088d40b78b6373b035a677826ece6d6d0aa60809081527340c033a76f71440403c7dcf509574cd497774a1b60a0526200005d90600590600262000072565b503480156200006b57600080fd5b50620000fd565b828054828255906000526020600020908101928215620000ca579160200282015b82811115620000ca57825182546001600160a01b0319166001600160a01b0390911617825560209092019160019091019062000093565b50620000d8929150620000dc565b5090565b5b80821115620000d85780546001600160a01b0319168155600101620000dd565b614675806200010d6000396000f3fe608060405234801561001057600080fd5b506004361061048d5760003560e01c806381d11eaf1161026b578063b981cdf311610150578063d4b14944116100c8578063e90b245411610097578063f14698de1161007c578063f14698de14610a0b578063f774110314610a13578063fcb6f00814610a1b5761048d565b8063e90b2454146109fb578063ee6822a714610a035761048d565b8063d4b149441461099f578063d5d3b26c146109c5578063d98f2495146109eb578063da3ed419146109f35761048d565b8063c5967c261161011f578063c8412d0211610104578063c8412d0214610972578063c8f987f31461097a578063cecce38e146109825761048d565b8063c5967c2614610962578063c5cc772d1461096a5761048d565b8063b981cdf3146108fb578063bcc81f1914610903578063be266d541461093d578063c040f23a1461095a5761048d565b806395b6ef0c116101e3578063a204452b116101b2578063b3ab15fb11610197578063b3ab15fb146108c5578063b4d1d795146108eb578063b8a878f9146108f35761048d565b8063a204452b146108a0578063b3406cfc146108bd5761048d565b806395b6ef0c146107fd57806398b762a1146108495780639982002514610866578063a0487eea146108835761048d565b80638c664db61161023a578063900cf0cf1161021f578063900cf0cf146107ac57806391bbfed5146107b4578063940e6064146107d75761048d565b80638c664db6146107875780638d934f74146107a45761048d565b806381d11eaf1461075257806382cad8381461075a578063874106cc146107775780638a6426e71461077f5761048d565b806340af7ba5116103915780635a0fc79c1161030957806372c054f9116102d857806375be5ae1116102bd57806375be5ae1146106d857806375d4dd62146106fe57806378e979251461074a5761048d565b806372c054f9146106ad578063734f7096146106b55761048d565b80635a0fc79c1461066f5780635b7561791461067757806362ac58e41461067f57806363f96cf4146106a55761048d565b806354f04a1111610360578063570ca73511610345578063570ca73514610642578063591663e11461064a57806359bf5d39146106675761048d565b806354f04a111461061757806355ebdeef1461063a5761048d565b806340af7ba5146105b15780634294cf8e146105ce5780634390d2a8146105d6578063499f3f19146105fa5761048d565b8063154ec2db1161042457806329ef1919116103f3578063392e53cd116103d8578063392e53cd146105845780633ed9ae251461058c5780634013a08e146105a95761048d565b806329ef1919146105745780632e9c7b651461057c5761048d565b8063154ec2db1461052b578063158ef93e1461054857806319a983491461056457806322f832cd1461056c5761048d565b80630cac939c116104605780630cac939c146104f05780630cf60175146104f85780630db7eb0b14610500578063118ebbf9146105085761048d565b806303be7e761461049257806304e5c7b1146104ac57806309bb4f92146104cb5780630b5bcec7146104d3575b600080fd5b61049a610a23565b60408051918252519081900360200190f35b6104c9600480360360208110156104c257600080fd5b5035610a29565b005b61049a610af8565b6104c9600480360360208110156104e957600080fd5b5035610bec565b61049a610c88565b61049a610d96565b61049a610e41565b6104c96004803603604081101561051e57600080fd5b5080359060200135610ee3565b6104c96004803603602081101561054157600080fd5b5035611544565b6105506115e9565b604080519115158252519081900360200190f35b61049a6115f9565b61049a6115ff565b61049a611605565b61049a61160b565b610550611611565b6104c9600480360360208110156105a257600080fd5b5035611621565b61049a6116db565b6104c9600480360360208110156105c757600080fd5b50356116e1565b61049a611786565b6105de61178c565b604080516001600160a01b039092168252519081900360200190f35b6104c96004803603602081101561061057600080fd5b503561179b565b6104c96004803603604081101561062d57600080fd5b5080359060200135611838565b61049a611f85565b6105de611f8b565b6104c96004803603602081101561066057600080fd5b5035611f9a565b61049a61203c565b61049a612042565b6104c9612048565b6104c96004803603602081101561069557600080fd5b50356001600160a01b03166126fe565b6105de6127c9565b61049a6127d8565b6104c9600480360360408110156106cb57600080fd5b5080359060200135612898565b6104c9600480360360208110156106ee57600080fd5b50356001600160a01b031661296a565b6104c9600480360360c081101561071457600080fd5b506001600160a01b0381358116916020810135821691604082013581169160608101358216916080820135169060a001356129d5565b61049a612a81565b61049a612a87565b6105de6004803603602081101561077057600080fd5b5035612a8d565b61049a612ab4565b61049a612aba565b6104c96004803603602081101561079d57600080fd5b5035612c12565b6105de612cb4565b61049a612cc3565b6104c9600480360360408110156107ca57600080fd5b5080359060200135612cc9565b610550600480360360408110156107ed57600080fd5b5060ff8135169060200135612dc1565b6104c9600480360360c081101561081357600080fd5b506001600160a01b0381358116916020810135821691604082013581169160608101358216916080820135169060a00135612edd565b6104c96004803603602081101561085f57600080fd5b50356131e5565b61049a6004803603602081101561087c57600080fd5b5035613233565b61049a6004803603602081101561089957600080fd5b5035613251565b6104c9600480360360208110156108b657600080fd5b503561325e565b61049a6132ac565b6104c9600480360360208110156108db57600080fd5b50356001600160a01b03166132b2565b61049a61331d565b61049a613323565b6105de613329565b6104c96004803603608081101561091957600080fd5b506001600160a01b0381358116916020810135916040820135169060600135613338565b6104c96004803603602081101561095357600080fd5b50356134cd565b6105de613563565b61049a613572565b61049a61359c565b61049a613617565b61049a61361d565b6104c96004803603602081101561099857600080fd5b5035613623565b610550600480360360408110156109b557600080fd5b5060ff81351690602001356136c4565b6104c9600480360360208110156109db57600080fd5b50356001600160a01b03166137c7565b61049a613832565b61049a613838565b61049a61383e565b6105de613844565b61049a613853565b6105de613859565b61049a613868565b60215481565b6001546001600160a01b03163314610a725760405162461bcd60e51b815260040180806020018281038252602481526020018061450c6024913960400191505060405180910390fd5b600c54811015610ab35760405162461bcd60e51b815260040180806020018281038252602a81526020018061436a602a913960400191505060405180910390fd5b6096811115610af35760405162461bcd60e51b81526004018080602001828103825260248152602001806143f86024913960400191505060405180910390fd5b601b55565b600a54600654604080517f3ddac9530000000000000000000000000000000000000000000000000000000081526001600160a01b039283166004820152670de0b6b3a7640000602482015290516000939290921691633ddac95391604480820192602092909190829003018186803b158015610b7357600080fd5b505afa925050508015610b9857506040513d6020811015610b9357600080fd5b505160015b610bd35760405162461bcd60e51b81526004018080602001828103825260368152602001806143c26036913960400191505060405180910390fd5b71ffffffffffffffffffffffffffffffffffff16905090565b6001546001600160a01b03163314610c355760405162461bcd60e51b815260040180806020018281038252602481526020018061450c6024913960400191505060405180910390fd5b600a8110158015610c4857506103e88111155b610c835760405162461bcd60e51b81526004018080602001828103825260288152602001806144bb6028913960400191505060405180910390fd5b601055565b600080610c93610af8565b9050600b548111610d92576000610ca8612aba565b90506000610ccd612710610cc76014548561386e90919063ffffffff16565b906138ce565b90506000600760009054906101000a90046001600160a01b03166001600160a01b03166318160ddd6040518163ffffffff1660e01b815260040160206040518083038186803b158015610d1f57600080fd5b505afa158015610d33573d6000803e3d6000fd5b505050506040513d6020811015610d4957600080fd5b5051905080821115610d8e576000610d618383613910565b90506000610d7b670de0b6b3a7640000610cc7848961386e565b9050610d8960045482613952565b965050505b5050505b5090565b600080610da1610af8565b9050600b548111610d9257601a54610dbd57600b549150610d92565b6000610de082610cc7670de0b6b3a7640000600b5461386e90919063ffffffff16565b90506000610e0b612710610cc7601a54610e05600b548761391090919063ffffffff16565b9061386e565b600b54909150610e1b9082613968565b93506000601854118015610e30575060185484115b15610e3b5760185493505b50505090565b600080610e4c610af8565b9050600c54811115610d92576000610e766064610cc7601b54600b5461386e90919063ffffffff16565b9050808210610ed8576000610ea2612710610cc7601c54610e05600b548861391090919063ffffffff16565b600b54909150610eb29082613968565b93506000601954118015610ec7575060195484115b15610ed25760195493505b50610ede565b600b5492505b505090565b610eeb6139c2565b15610f275760405162461bcd60e51b815260040180806020018281038252602681526020018061455a6026913960400191505060405180910390fd5b610f2f6139e1565b15610f6b5760405162461bcd60e51b815260040180806020018281038252602681526020018061455a6026913960400191505060405180910390fd5b600254421015610fc2576040805162461bcd60e51b815260206004820152601960248201527f54726561737572793a206e6f7420737461727465642079657400000000000000604482015290519081900360640190fd5b6006546040805163570ca73560e01b8152905130926001600160a01b03169163570ca735916004808301926020929190829003018186803b15801561100657600080fd5b505afa15801561101a573d6000803e3d6000fd5b505050506040513d602081101561103057600080fd5b50516001600160a01b03161480156110be57506007546040805163570ca73560e01b8152905130926001600160a01b03169163570ca735916004808301926020929190829003018186803b15801561108757600080fd5b505afa15801561109b573d6000803e3d6000fd5b505050506040513d60208110156110b157600080fd5b50516001600160a01b0316145b801561114057506008546040805163570ca73560e01b8152905130926001600160a01b03169163570ca735916004808301926020929190829003018186803b15801561110957600080fd5b505afa15801561111d573d6000803e3d6000fd5b505050506040513d602081101561113357600080fd5b50516001600160a01b0316145b80156111c257506009546040805163570ca73560e01b8152905130926001600160a01b03169163570ca735916004808301926020929190829003018186803b15801561118b57600080fd5b505afa15801561119f573d6000803e3d6000fd5b505050506040513d60208110156111b557600080fd5b50516001600160a01b0316145b611213576040805162461bcd60e51b815260206004820152601e60248201527f54726561737572793a206e656564206d6f7265207065726d697373696f6e0000604482015290519081900360640190fd5b600082116112525760405162461bcd60e51b815260040180806020018281038252602e815260200180614394602e913960400191505060405180910390fd5b600061125c610af8565b90508181146112b2576040805162461bcd60e51b815260206004820152601a60248201527f54726561737572793a20544f4d42207072696365206d6f766564000000000000604482015290519081900360640190fd5b600c5481116112f25760405162461bcd60e51b81526004018080602001828103825260328152602001806145b66032913960400191505060405180910390fd5b60006112fc610e41565b905060008111611353576040805162461bcd60e51b815260206004820152601b60248201527f54726561737572793a20696e76616c696420626f6e6420726174650000000000604482015290519081900360640190fd5b600061136b670de0b6b3a7640000610cc7878561386e565b600654604080516370a0823160e01b8152306004820152905192935083926001600160a01b03909216916370a0823191602480820192602092909190829003018186803b1580156113bb57600080fd5b505afa1580156113cf573d6000803e3d6000fd5b505050506040513d60208110156113e557600080fd5b505110156114245760405162461bcd60e51b815260040180806020018281038252602581526020018061441c6025913960400191505060405180910390fd5b61143c611433600d5483613952565b600d5490613910565b600d556007546040805163079cc67960e41b81523360048201526024810188905290516001600160a01b03909216916379cc67909160448082019260009290919082900301818387803b15801561149257600080fd5b505af11580156114a6573d6000803e3d6000fd5b50506006546114c292506001600160a01b031690503383613a00565b6114ca613a6c565b6040805182815260208101879052815133927f51e0d16595cabc591e64da08e45bb223577e5b9a39cd947b4ddc3472b2dd8878928290030190a25050436000908152602081815260408083203284529091528082208054600160ff1991821681179092553384529190922080549091169091179055505050565b6001546001600160a01b0316331461158d5760405162461bcd60e51b815260040180806020018281038252602481526020018061450c6024913960400191505060405180910390fd5b614e208111156115e4576040805162461bcd60e51b815260206004820152601d60248201527f5f646973636f756e7450657263656e74206973206f7665722032303025000000604482015290519081900360640190fd5b601a55565b600154600160a01b900460ff1681565b600c5481565b60125481565b601a5481565b60195481565b600154600160a01b900460ff1690565b6001546001600160a01b0316331461166a5760405162461bcd60e51b815260040180806020018281038252602481526020018061450c6024913960400191505060405180910390fd5b600b54811015801561169657506116926064610cc76078600b5461386e90919063ffffffff16565b8111155b6116d6576040805162461bcd60e51b815260206004820152600c60248201526b6f7574206f662072616e676560a01b604482015290519081900360640190fd5b600c55565b601d5481565b6001546001600160a01b0316331461172a5760405162461bcd60e51b815260040180806020018281038252602481526020018061450c6024913960400191505060405180910390fd5b614e20811115611781576040805162461bcd60e51b815260206004820152601c60248201527f5f7072656d69756d50657263656e74206973206f766572203230302500000000604482015290519081900360640190fd5b601c55565b600b5481565b6020546001600160a01b031681565b6001546001600160a01b031633146117e45760405162461bcd60e51b815260040180806020018281038252602481526020018061450c6024913960400191505060405180910390fd5b61271081101580156117f85750614e208111155b6118335760405162461bcd60e51b81526004018080602001828103825260298152602001806144926029913960400191505060405180910390fd5b601d55565b6118406139c2565b1561187c5760405162461bcd60e51b815260040180806020018281038252602681526020018061455a6026913960400191505060405180910390fd5b6118846139e1565b156118c05760405162461bcd60e51b815260040180806020018281038252602681526020018061455a6026913960400191505060405180910390fd5b600254421015611917576040805162461bcd60e51b815260206004820152601960248201527f54726561737572793a206e6f7420737461727465642079657400000000000000604482015290519081900360640190fd5b6006546040805163570ca73560e01b8152905130926001600160a01b03169163570ca735916004808301926020929190829003018186803b15801561195b57600080fd5b505afa15801561196f573d6000803e3d6000fd5b505050506040513d602081101561198557600080fd5b50516001600160a01b0316148015611a1357506007546040805163570ca73560e01b8152905130926001600160a01b03169163570ca735916004808301926020929190829003018186803b1580156119dc57600080fd5b505afa1580156119f0573d6000803e3d6000fd5b505050506040513d6020811015611a0657600080fd5b50516001600160a01b0316145b8015611a9557506008546040805163570ca73560e01b8152905130926001600160a01b03169163570ca735916004808301926020929190829003018186803b158015611a5e57600080fd5b505afa158015611a72573d6000803e3d6000fd5b505050506040513d6020811015611a8857600080fd5b50516001600160a01b0316145b8015611b1757506009546040805163570ca73560e01b8152905130926001600160a01b03169163570ca735916004808301926020929190829003018186803b158015611ae057600080fd5b505afa158015611af4573d6000803e3d6000fd5b505050506040513d6020811015611b0a57600080fd5b50516001600160a01b0316145b611b68576040805162461bcd60e51b815260206004820152601e60248201527f54726561737572793a206e656564206d6f7265207065726d697373696f6e0000604482015290519081900360640190fd5b60008211611ba75760405162461bcd60e51b81526004018080602001828103825260308152602001806144626030913960400191505060405180910390fd5b6000611bb1610af8565b9050818114611c07576040805162461bcd60e51b815260206004820152601a60248201527f54726561737572793a20544f4d42207072696365206d6f766564000000000000604482015290519081900360640190fd5b600b548110611c475760405162461bcd60e51b81526004018080602001828103825260328152602001806145b66032913960400191505060405180910390fd5b600454831115611c885760405162461bcd60e51b815260040180806020018281038252602a8152602001806145e8602a913960400191505060405180910390fd5b6000611c92610d96565b905060008111611ce9576040805162461bcd60e51b815260206004820152601b60248201527f54726561737572793a20696e76616c696420626f6e6420726174650000000000604482015290519081900360640190fd5b6000611d01670de0b6b3a7640000610cc7878561386e565b90506000611d0d612aba565b90506000611d9583600760009054906101000a90046001600160a01b03166001600160a01b03166318160ddd6040518163ffffffff1660e01b815260040160206040518083038186803b158015611d6357600080fd5b505afa158015611d77573d6000803e3d6000fd5b505050506040513d6020811015611d8d57600080fd5b505190613968565b9050611db2612710610cc76014548561386e90919063ffffffff16565b811115611e06576040805162461bcd60e51b815260206004820152601360248201527f6f766572206d6178206465627420726174696f00000000000000000000000000604482015290519081900360640190fd5b6006546040805163079cc67960e41b8152336004820152602481018a905290516001600160a01b03909216916379cc67909160448082019260009290919082900301818387803b158015611e5957600080fd5b505af1158015611e6d573d6000803e3d6000fd5b5050600754604080516340c10f1960e01b81523360048201526024810188905290516001600160a01b0390921693506340c10f1992506044808201926020929091908290030181600087803b158015611ec557600080fd5b505af1158015611ed9573d6000803e3d6000fd5b505050506040513d6020811015611eef57600080fd5b5050600454611efe9088613910565b600455611f09613a6c565b6040805188815260208101859052815133927f73017f1b70789e2e66759eeb3c7ec11f59e6eedb55d921cfaec5410dd42a4799928290030190a25050436000908152602081815260408083203284529091528082208054600160ff19918216811790925533845291909220805490911690911790555050505050565b601f5481565b6001546001600160a01b031681565b6001546001600160a01b03163314611fe35760405162461bcd60e51b815260040180806020018281038252602481526020018061450c6024913960400191505060405180910390fd5b6103e88110158015611ff757506127108111155b612037576040805162461bcd60e51b815260206004820152600c60248201526b6f7574206f662072616e676560a01b604482015290519081900360640190fd5b601455565b600d5490565b600d5481565b6120506139c2565b1561208c5760405162461bcd60e51b815260040180806020018281038252602681526020018061455a6026913960400191505060405180910390fd5b6120946139e1565b156120d05760405162461bcd60e51b815260040180806020018281038252602681526020018061455a6026913960400191505060405180910390fd5b600254421015612127576040805162461bcd60e51b815260206004820152601960248201527f54726561737572793a206e6f7420737461727465642079657400000000000000604482015290519081900360640190fd5b61212f613572565b421015612183576040805162461bcd60e51b815260206004820152601860248201527f54726561737572793a206e6f74206f70656e6564207965740000000000000000604482015290519081900360640190fd5b6006546040805163570ca73560e01b8152905130926001600160a01b03169163570ca735916004808301926020929190829003018186803b1580156121c757600080fd5b505afa1580156121db573d6000803e3d6000fd5b505050506040513d60208110156121f157600080fd5b50516001600160a01b031614801561227f57506007546040805163570ca73560e01b8152905130926001600160a01b03169163570ca735916004808301926020929190829003018186803b15801561224857600080fd5b505afa15801561225c573d6000803e3d6000fd5b505050506040513d602081101561227257600080fd5b50516001600160a01b0316145b801561230157506008546040805163570ca73560e01b8152905130926001600160a01b03169163570ca735916004808301926020929190829003018186803b1580156122ca57600080fd5b505afa1580156122de573d6000803e3d6000fd5b505050506040513d60208110156122f457600080fd5b50516001600160a01b0316145b801561238357506009546040805163570ca73560e01b8152905130926001600160a01b03169163570ca735916004808301926020929190829003018186803b15801561234c57600080fd5b505afa158015612360573d6000803e3d6000fd5b505050506040513d602081101561237657600080fd5b50516001600160a01b0316145b6123d4576040805162461bcd60e51b815260206004820152601e60248201527f54726561737572793a206e656564206d6f7265207065726d697373696f6e0000604482015290519081900360640190fd5b6123dc613a6c565b6123e4610af8565b601755600d546000906123ff906123f9612aba565b90613910565b905060155460035410156124355761243061242b612710610cc76016548561386e90919063ffffffff16565b613ad0565b612682565b600c54601754111561268257600754604080516318160ddd60e01b815290516000926001600160a01b0316916318160ddd916004808301926020929190829003018186803b15801561248657600080fd5b505afa15801561249a573d6000803e3d6000fd5b505050506040513d60208110156124b057600080fd5b5051600b546017549192506000916124c791613910565b905060008060006124e1655af3107a4000610e0588613e10565b9050808411156124ef578093505b61250a612710610cc76011548861386e90919063ffffffff16565b600d541061252f57612528670de0b6b3a7640000610cc7888761386e565b915061259b565b6000612547670de0b6b3a7640000610cc7898861386e565b9050612564612710610cc76012548461386e90919063ffffffff16565b92506125708184613910565b601d549094501561259957612596612710610cc7601d548761386e90919063ffffffff16565b93505b505b81156125aa576125aa82613ad0565b821561267c57600d546125bd9084613968565b600d55600654604080516340c10f1960e01b81523060048201526024810186905290516001600160a01b03909216916340c10f19916044808201926020929091908290030181600087803b15801561261457600080fd5b505af1158015612628573d6000803e3d6000fd5b505050506040513d602081101561263e57600080fd5b5050604080514281526020810185905281517ff705142bf09f04297640495ddf7c59b7fd6f51894c5aea9602d631cf05f0efc2929181900390910190a15b50505050505b50600354612691906001613968565b600355600c5461269f610af8565b116126bd576126b8612710610cc7601354610e05612aba565b6126c0565b60005b600455436000908152602081815260408083203284529091528082208054600160ff1991821681179092553384529190922080549091169091179055565b6001546001600160a01b031633146127475760405162461bcd60e51b815260040180806020018281038252602481526020018061450c6024913960400191505060405180910390fd5b600954604080517fb3ab15fb0000000000000000000000000000000000000000000000000000000081526001600160a01b0384811660048301529151919092169163b3ab15fb91602480830192600092919082900301818387803b1580156127ae57600080fd5b505af11580156127c2573d6000803e3d6000fd5b5050505050565b6009546001600160a01b031681565b6000806127e3610af8565b9050600c54811115610d9257600654604080516370a0823160e01b815230600482015290516000926001600160a01b0316916370a08231916024808301926020929190829003018186803b15801561283a57600080fd5b505afa15801561284e573d6000803e3d6000fd5b505050506040513d602081101561286457600080fd5b505190506000612872610e41565b90508015610e3b5761289081610cc784670de0b6b3a764000061386e565b935050505090565b6001546001600160a01b031633146128e15760405162461bcd60e51b815260040180806020018281038252602481526020018061450c6024913960400191505060405180910390fd5b600954604080517f2ffaaa09000000000000000000000000000000000000000000000000000000008152600481018590526024810184905290516001600160a01b0390921691632ffaaa099160448082019260009290919082900301818387803b15801561294e57600080fd5b505af1158015612962573d6000803e3d6000fd5b505050505050565b6001546001600160a01b031633146129b35760405162461bcd60e51b815260040180806020018281038252602481526020018061450c6024913960400191505060405180910390fd5b600a80546001600160a01b0319166001600160a01b0392909216919091179055565b6001546001600160a01b03163314612a1e5760405162461bcd60e51b815260040180806020018281038252602481526020018061450c6024913960400191505060405180910390fd5b600680546001600160a01b03199081166001600160a01b03988916179091556007805482169688169690961790955560088054861694871694909417909355600a8054851692861692909217909155600980549093169316929092179055600255565b60025481565b60115481565b60058181548110612a9a57fe5b6000918252602090912001546001600160a01b0316905081565b60165481565b600654604080516318160ddd60e01b815290516000926001600160a01b031691839183916318160ddd916004808301926020929190829003018186803b158015612b0357600080fd5b505afa158015612b17573d6000803e3d6000fd5b505050506040513d6020811015612b2d57600080fd5b505190506000805b60055460ff82161015612c0757612bfd846001600160a01b03166370a0823160058460ff1681548110612b6457fe5b60009182526020918290200154604080517fffffffff0000000000000000000000000000000000000000000000000000000060e086901b1681526001600160a01b0390921660048301525160248083019392829003018186803b158015612bca57600080fd5b505afa158015612bde573d6000803e3d6000fd5b505050506040513d6020811015612bf457600080fd5b50518390613968565b9150600101612b35565b506128908282613910565b6001546001600160a01b03163314612c5b5760405162461bcd60e51b815260040180806020018281038252602481526020018061450c6024913960400191505060405180910390fd5b6101f48110158015612c6f57506127108111155b612caf576040805162461bcd60e51b815260206004820152600c60248201526b6f7574206f662072616e676560a01b604482015290519081900360640190fd5b601155565b601e546001600160a01b031681565b60035481565b6001546001600160a01b03163314612d125760405162461bcd60e51b815260040180806020018281038252602481526020018061450c6024913960400191505060405180910390fd5b6078821115612d68576040805162461bcd60e51b815260206004820152601e60248201527f5f626f6f74737472617045706f6368733a206f7574206f662072616e67650000604482015290519081900360640190fd5b60648110158015612d7b57506103e88111155b612db65760405162461bcd60e51b815260040180806020018281038252602e815260200180614612602e913960400191505060405180910390fd5b601591909155601655565b6001546000906001600160a01b03163314612e0d5760405162461bcd60e51b815260040180806020018281038252602481526020018061450c6024913960400191505060405180910390fd5b60098360ff1610612e4f5760405162461bcd60e51b81526004018080602001828103825260298152602001806144e36029913960400191505060405180910390fd5b60ff831615612e8157600e6001840360ff1681548110612e6b57fe5b90600052602060002001548211612e8157600080fd5b60088360ff161015612eb657600e8360010160ff1681548110612ea057fe5b90600052602060002001548210612eb657600080fd5b81600e8460ff1681548110612ec757fe5b6000918252602090912001555060015b92915050565b600154600160a01b900460ff1615612f3c576040805162461bcd60e51b815260206004820152601d60248201527f54726561737572793a20616c726561647920696e697469616c697a6564000000604482015290519081900360640190fd5b600680546001600160a01b03199081166001600160a01b0389811691909117909255600780548216888416179055600880548216878416179055600a80548216868416179055600980549091169184169190911790556002819055670de0b6b3a7640000600b819055612fb790606490610cc790606561386e565b600c556040805161012081018252600081526969e10de76676d0800000602082015269d3c21bcecceda1000000918101919091526a013da329b633647180000060608201526a01a784379d99db4200000060808201526a0422ca8b0a00a42500000060a08201526a084595161401484a00000060c08201526a108b2a2c2802909400000060e08201526a295be96e6406697200000061010082015261306090600e9060096142bd565b5060408051610120810182526101c28152610190602082015261015e9181019190915261012c606082015260fa608082015260c860a0820152609660c0820152607d60e082015260646101008201526130bd90600f906009614313565b50610190601055612710601155610dac601281905561012c601355601455606e601b55611b58601c9081556015556101c2601655600654604080516370a0823160e01b815230600482015290516001600160a01b03909216916370a0823191602480820192602092909190829003018186803b15801561313c57600080fd5b505afa158015613150573d6000803e3d6000fd5b505050506040513d602081101561316657600080fd5b5051600d55600180546001600160a01b03197fffffffffffffffffffffff00ffffffffffffffffffffffffffffffffffffffff909116600160a01b1716339081179091556040805143815290517f25ff68dd81b34665b5ba7e553ee5511bf6812e12adb4a7e2c0d9e26b3099ce799181900360200190a2505050505050565b6001546001600160a01b0316331461322e5760405162461bcd60e51b815260040180806020018281038252602481526020018061450c6024913960400191505060405180910390fd5b601855565b600e818154811061324057fe5b600091825260209091200154905081565b600f818154811061324057fe5b6001546001600160a01b031633146132a75760405162461bcd60e51b815260040180806020018281038252602481526020018061450c6024913960400191505060405180910390fd5b601955565b60175481565b6001546001600160a01b031633146132fb5760405162461bcd60e51b815260040180806020018281038252602481526020018061450c6024913960400191505060405180910390fd5b600180546001600160a01b0319166001600160a01b0392909216919091179055565b61546081565b60185481565b6007546001600160a01b031681565b6001546001600160a01b031633146133815760405162461bcd60e51b815260040180806020018281038252602481526020018061450c6024913960400191505060405180910390fd5b6001600160a01b0384166133c5576040805162461bcd60e51b815260206004808301919091526024820152637a65726f60e01b604482015290519081900360640190fd5b610bb883111561340b576040805162461bcd60e51b815260206004820152600c60248201526b6f7574206f662072616e676560a01b604482015290519081900360640190fd5b6001600160a01b03821661344f576040805162461bcd60e51b815260206004808301919091526024820152637a65726f60e01b604482015290519081900360640190fd5b6103e8811115613495576040805162461bcd60e51b815260206004820152600c60248201526b6f7574206f662072616e676560a01b604482015290519081900360640190fd5b601e80546001600160a01b03199081166001600160a01b0396871617909155601f939093556020805490931691909316179055602155565b6001546001600160a01b031633146135165760405162461bcd60e51b815260040180806020018281038252602481526020018061450c6024913960400191505060405180910390fd5b600954604080516397ffe1d760e01b81526004810184905290516001600160a01b03909216916397ffe1d79160248082019260009290919082900301818387803b1580156127ae57600080fd5b6006546001600160a01b031681565b600061359761358e61546060035461386e90919063ffffffff16565b60025490613968565b905090565b600a54600654604080517f6808a1280000000000000000000000000000000000000000000000000000000081526001600160a01b039283166004820152670de0b6b3a7640000602482015290516000939290921691636808a12891604480820192602092909190829003018186803b158015610b7357600080fd5b601c5481565b601b5481565b6001546001600160a01b0316331461366c5760405162461bcd60e51b815260040180806020018281038252602481526020018061450c6024913960400191505060405180910390fd5b6064811015801561367f57506105dc8111155b6136bf576040805162461bcd60e51b815260206004820152600c60248201526b6f7574206f662072616e676560a01b604482015290519081900360640190fd5b601355565b6001546000906001600160a01b031633146137105760405162461bcd60e51b815260040180806020018281038252602481526020018061450c6024913960400191505060405180910390fd5b60098360ff16106137525760405162461bcd60e51b81526004018080602001828103825260298152602001806144e36029913960400191505060405180910390fd5b600a821015801561376557506103e88211155b6137b6576040805162461bcd60e51b815260206004820152601460248201527f5f76616c75653a206f7574206f662072616e6765000000000000000000000000604482015290519081900360640190fd5b81600f8460ff1681548110612ec757fe5b6001546001600160a01b031633146138105760405162461bcd60e51b815260040180806020018281038252602481526020018061450c6024913960400191505060405180910390fd5b600980546001600160a01b0319166001600160a01b0392909216919091179055565b60105481565b60145481565b60135481565b6008546001600160a01b031681565b60155481565b600a546001600160a01b031681565b60045481565b60008261387d57506000612ed7565b8282028284828161388a57fe5b04146138c75760405162461bcd60e51b81526004018080602001828103825260218152602001806144416021913960400191505060405180910390fd5b9392505050565b60006138c783836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250613e6d565b60006138c783836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250613f0f565b600081831061396157816138c7565b5090919050565b6000828201838110156138c7576040805162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015290519081900360640190fd5b4360009081526020818152604080832032845290915290205460ff1690565b4360009081526020818152604080832033845290915290205460ff1690565b604080516001600160a01b038416602482015260448082018490528251808303909101815260649091019091526020810180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1663a9059cbb60e01b179052613a67908490613f69565b505050565b600a60009054906101000a90046001600160a01b03166001600160a01b031663a2e620456040518163ffffffff1660e01b8152600401600060405180830381600087803b158015613abc57600080fd5b505af1925050508015613acd575060015b50565b600654604080516340c10f1960e01b81523060048201526024810184905290516001600160a01b03909216916340c10f19916044808201926020929091908290030181600087803b158015613b2457600080fd5b505af1158015613b38573d6000803e3d6000fd5b505050506040513d6020811015613b4e57600080fd5b5050601f5460009015613c3957613b76612710610cc7601f548561386e90919063ffffffff16565b600654601e546040805163a9059cbb60e01b81526001600160a01b03928316600482015260248101859052905193945091169163a9059cbb916044808201926020929091908290030181600087803b158015613bd157600080fd5b505af1158015613be5573d6000803e3d6000fd5b505050506040513d6020811015613bfb57600080fd5b5050604080514281526020810183905281517fcb3f34aaa3445b461e6da5492dc89e5c257a59fa598131f3b6bbc97a3638e409929181900390910190a15b60215460009015613d1f57613c5f612710610cc76021548661386e90919063ffffffff16565b600654602080546040805163a9059cbb60e01b81526001600160a01b03928316600482015260248101869052905194955092169263a9059cbb9260448082019392918290030181600087803b158015613cb757600080fd5b505af1158015613ccb573d6000803e3d6000fd5b505050506040513d6020811015613ce157600080fd5b5050604080514281526020810183905281517fdc8b715b18523e58b7fd0da53259dfa91efd91df4a854d94b136e3333a3b9395929181900390910190a15b613d2d816123f98585613910565b600954600654919450613d4e916001600160a01b0390811691166000614127565b600954600654613d6b916001600160a01b03918216911685614127565b600954604080516397ffe1d760e01b81526004810186905290516001600160a01b03909216916397ffe1d79160248082019260009290919082900301818387803b158015613db857600080fd5b505af1158015613dcc573d6000803e3d6000fd5b5050604080514281526020810187905281517fa72fa2f263b243b0f0e1fec5f3d49d33de573d15929b6b730c6b8ab3838c1c4d9450908190039091019150a1505050565b600060085b600e8160ff1681548110613e2557fe5b90600052602060002001548310613e5a57600f8160ff1681548110613e4657fe5b600091825260209091200154601055613e63565b60001901613e15565b5050601054919050565b60008183613ef95760405162461bcd60e51b81526004018080602001828103825283818151815260200191508051906020019080838360005b83811015613ebe578181015183820152602001613ea6565b50505050905090810190601f168015613eeb5780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b506000838581613f0557fe5b0495945050505050565b60008184841115613f615760405162461bcd60e51b8152602060048201818152835160248401528351909283926044909101919085019080838360008315613ebe578181015183820152602001613ea6565b505050900390565b613f7b826001600160a01b0316614281565b613fcc576040805162461bcd60e51b815260206004820152601f60248201527f5361666545524332303a2063616c6c20746f206e6f6e2d636f6e747261637400604482015290519081900360640190fd5b60006060836001600160a01b0316836040518082805190602001908083835b6020831061400a5780518252601f199092019160209182019101613feb565b6001836020036101000a0380198251168184511680821785525050505050509050019150506000604051808303816000865af19150503d806000811461406c576040519150601f19603f3d011682016040523d82523d6000602084013e614071565b606091505b5091509150816140c8576040805162461bcd60e51b815260206004820181905260248201527f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564604482015290519081900360640190fd5b805115614121578080602001905160208110156140e457600080fd5b50516141215760405162461bcd60e51b815260040180806020018281038252602a815260200180614530602a913960400191505060405180910390fd5b50505050565b8015806141c65750604080517fdd62ed3e0000000000000000000000000000000000000000000000000000000081523060048201526001600160a01b03848116602483015291519185169163dd62ed3e91604480820192602092909190829003018186803b15801561419857600080fd5b505afa1580156141ac573d6000803e3d6000fd5b505050506040513d60208110156141c257600080fd5b5051155b6142015760405162461bcd60e51b81526004018080602001828103825260368152602001806145806036913960400191505060405180910390fd5b604080516001600160a01b038416602482015260448082018490528251808303909101815260649091019091526020810180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167f095ea7b300000000000000000000000000000000000000000000000000000000179052613a67908490613f69565b6000813f7fc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a4708181148015906142b557508115155b949350505050565b828054828255906000526020600020908101928215614307579160200282015b8281111561430757825182906affffffffffffffffffffff169055916020019190600101906142dd565b50610d92929150614354565b828054828255906000526020600020908101928215614307579160200282015b82811115614307578251829061ffff16905591602001919060010190614333565b5b80821115610d92576000815560010161435556fe5f7072656d69756d5468726573686f6c64206578636565647320746f6d6250726963654365696c696e6754726561737572793a2063616e6e6f742072656465656d20626f6e64732077697468207a65726f20616d6f756e7454726561737572793a206661696c656420746f20636f6e73756c7420544f4d422070726963652066726f6d20746865206f7261636c655f7072656d69756d5468726573686f6c6420697320686967686572207468616e20312e3554726561737572793a20747265617375727920686173206e6f206d6f726520627564676574536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f7754726561737572793a2063616e6e6f7420707572636861736520626f6e64732077697468207a65726f20616d6f756e745f6d696e74696e67466163746f72466f72506179696e67446562743a206f7574206f662072616e67655f6d6178537570706c79457870616e73696f6e50657263656e743a206f7574206f662072616e6765496e6465782068617320746f206265206c6f776572207468616e20636f756e74206f6620746965727354726561737572793a2063616c6c6572206973206e6f7420746865206f70657261746f725361666545524332303a204552433230206f7065726174696f6e20646964206e6f742073756363656564436f6e747261637447756172643a206f6e6520626c6f636b2c206f6e652066756e6374696f6e5361666545524332303a20617070726f76652066726f6d206e6f6e2d7a65726f20746f206e6f6e2d7a65726f20616c6c6f77616e636554726561737572793a20746f6d625072696365206e6f7420656c696769626c6520666f7220626f6e6420707572636861736554726561737572793a206e6f7420656e6f75676820626f6e64206c65667420746f2070757263686173655f626f6f747374726170537570706c79457870616e73696f6e50657263656e743a206f7574206f662072616e6765a26469706673582212201c6053497c9e1ec1ea82c168e7d1d644ea75d5bbb7e06dd5ff7dc0f0925e429464736f6c634300060c0033

Block Transaction Gas Used Reward
Age Block Fee Address BC Fee Address Voting Power Jailed Incoming
Validator ID :
0 FTM

Amount Staked
0

Amount Delegated
0

Staking Total
0

Staking Start Epoch
0

Staking Start Time
0

Proof of Importance
0

Origination Score
0

Validation Score
0

Active
0

Online
0

Downtime
0 s
Address Amount claimed Rewards Created On Epoch Created On
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.