Contract 0xe0356010a513950a762d6ee73f0a3a4e62756790

 
Txn Hash Method
Block
From
To
Value [Txn Fee]
0xf21b683997679ee9057df982955827e2183ffa35a6c680c01ef74f6662558b54Buy Bonds348150242022-03-30 18:21:49180 days 22 hrs ago0xf80a2e0632a1c3b77d22e280c970cb03c01d0fc9 IN  0xe0356010a513950a762d6ee73f0a3a4e627567900 FTM0.040056020809
0xae31cd3991c27b623c5671d50801c671267ce66d503de9f7b11be0a7e00259e5Buy Bonds344115422022-03-26 2:42:15185 days 14 hrs ago0xf80a2e0632a1c3b77d22e280c970cb03c01d0fc9 IN  0xe0356010a513950a762d6ee73f0a3a4e627567900 FTM0.025449819242
0xfb0315aa811c3b9575ab78779f92f338e280e6fa9c336c52989050a9064a83cbBuy Bonds341765392022-03-23 8:09:25188 days 8 hrs ago0x6bfc44690eb5f38346c9eef2ca5aad27e0c66b38 IN  0xe0356010a513950a762d6ee73f0a3a4e627567900 FTM0.030607335564
0xb464ec50a5dc11f9f0482f5e213880f9e0cb0602e7d3529b7549079f409e6ff7Buy Bonds339936722022-03-21 6:00:04190 days 10 hrs ago0x6bfc44690eb5f38346c9eef2ca5aad27e0c66b38 IN  0xe0356010a513950a762d6ee73f0a3a4e627567900 FTM0.024960988172
0x9fb0c77a5529826ce4244852ac569552ab7834f25cb6fdd7e75529a7b99172ccBuy Bonds339936622022-03-21 5:59:53190 days 10 hrs ago0x6bfc44690eb5f38346c9eef2ca5aad27e0c66b38 IN  0xe0356010a513950a762d6ee73f0a3a4e627567900 FTM0.021714514526
0xa32a5986c287d4d9345c085292f2ed14e8b66210f36c1298e96bfabe550e5299Buy Bonds339936012022-03-21 5:58:46190 days 10 hrs ago0x6bfc44690eb5f38346c9eef2ca5aad27e0c66b38 IN  0xe0356010a513950a762d6ee73f0a3a4e627567900 FTM0.021714514526
0x63916cda8801f4e5226ff511d2f383f7814ff736b844ab25a48575a131387072Buy Bonds339935382022-03-21 5:57:49190 days 10 hrs ago0x6bfc44690eb5f38346c9eef2ca5aad27e0c66b38 IN  0xe0356010a513950a762d6ee73f0a3a4e627567900 FTM0.021948387827
0xffed2cda05db3ecb23b6b51fb614c0a1c52ea53899dd5ac19f81029031b356a7Buy Bonds339833432022-03-21 3:16:32190 days 13 hrs ago0xd135b84b9e0f72a528281e029967f2a0c4a2f540 IN  0xe0356010a513950a762d6ee73f0a3a4e627567900 FTM0.034690033564
0x0471bdafc454f85b40c767cbfc4d14cda5fbf3a5b6ed057a92853ac755cf1166Buy Bonds339831762022-03-21 3:13:50190 days 13 hrs ago0xd135b84b9e0f72a528281e029967f2a0c4a2f540 IN  0xe0356010a513950a762d6ee73f0a3a4e627567900 FTM0.046606989256
0x35117729cb8958a9d9ebd9d1a130b5f877c4ed83ff15cc75c01760053e8579b0Buy Bonds339678592022-03-20 22:52:49190 days 17 hrs ago0x3f7f2a0faa31a291a7b3470ac5c4dd6b8b060470 IN  0xe0356010a513950a762d6ee73f0a3a4e627567900 FTM0.023257726378
0x64036283b815a65f27400d189fb69406be93448f33a00a470b5714dff8a1ff2fBuy Bonds339676942022-03-20 22:50:34190 days 17 hrs ago0x5eae6c797ac561cb68cd7a972963069122138157 IN  0xe0356010a513950a762d6ee73f0a3a4e627567900 FTM0.021717838881
0x2cdc94dc560061774ffb762ff16de6c042d79881439e6dbae84daae62296545aBuy Bonds339539092022-03-20 19:09:52190 days 21 hrs ago0x3c811c0b7c4ac2a59f490cdf114099d8173a21e1 IN  0xe0356010a513950a762d6ee73f0a3a4e627567900 FTM0.022630171027
0x3c03fe16a6f8339e4e19943d1069e28b2f4b064173c343b2cde88ae399f61c64Buy Bonds339408502022-03-20 15:47:13191 days 1 hr ago0xff7da03a836e8b56fa2fe5430a14d1c7d364dde3 IN  0xe0356010a513950a762d6ee73f0a3a4e627567900 FTM0.020834824669
0x0b6eb339b10a6aed5ca0fae21efa74d295d7b0785b9d39006676e3cc6241b197Buy Bonds339398322022-03-20 15:31:49191 days 1 hr ago0xff7da03a836e8b56fa2fe5430a14d1c7d364dde3 IN  0xe0356010a513950a762d6ee73f0a3a4e627567900 FTM0.024193978322
0xf2845d7fbe94543a8aebcb42899c17d8c0ddca6b50cd165ff5d3e1befeb8c47aBuy Bonds339096792022-03-20 7:27:09191 days 9 hrs ago0x3c811c0b7c4ac2a59f490cdf114099d8173a21e1 IN  0xe0356010a513950a762d6ee73f0a3a4e627567900 FTM0.020599036922
0x97d2e5421f03134a6d8c74fccff19c64c1695fe4b6356d815d1ca7a4d6af0573Buy Bonds338993712022-03-20 4:39:56191 days 12 hrs ago0x3c811c0b7c4ac2a59f490cdf114099d8173a21e1 IN  0xe0356010a513950a762d6ee73f0a3a4e627567900 FTM0.024591269792
0x19f113a003371c5fa37cb02a674b89de3d44b61255074da6fd26900d40f5f47aBuy Bonds338992442022-03-20 4:37:20191 days 12 hrs ago0x3c811c0b7c4ac2a59f490cdf114099d8173a21e1 IN  0xe0356010a513950a762d6ee73f0a3a4e627567900 FTM0.022374469207
0x486ad1e53dd80782d3f6ccb52d83285bf847c0195eb0c2d0e50561dbd1d33f18Buy Bonds338962852022-03-20 3:51:18191 days 12 hrs ago0x6bfc44690eb5f38346c9eef2ca5aad27e0c66b38 IN  0xe0356010a513950a762d6ee73f0a3a4e627567900 FTM0.022622398465
0x1883196cc89f9b462473d0705040b257ad866ec0c461c26d6794d6e202abce20Buy Bonds338890492022-03-20 1:59:18191 days 14 hrs ago0xf80a2e0632a1c3b77d22e280c970cb03c01d0fc9 IN  0xe0356010a513950a762d6ee73f0a3a4e627567900 FTM0.028097234807
0x72d5952b87ab3804eb722350d6eba9f0560f0a70ad016adba0ece287ca0df2d8Buy Bonds338407222022-03-19 12:42:12192 days 4 hrs ago0x1e2cc37406f868b3d481170248e8ab2fb0181644 IN  0xe0356010a513950a762d6ee73f0a3a4e627567900 FTM0.040080522097
0x8385390956ea016bcebdebba5548234fabf8c21176b379699825ca8a59df13feBuy Bonds338188232022-03-19 6:38:47192 days 10 hrs ago0x65c9d1776235ec114576f4fd159b8b7c1b758c8c IN  0xe0356010a513950a762d6ee73f0a3a4e627567900 FTM0.019319152944
0x58f2f84c720e7b3938baddfca59a732e3ac825a2ef48545305b7d0f5bea5ea19Buy Bonds338187812022-03-19 6:38:07192 days 10 hrs ago0x65c9d1776235ec114576f4fd159b8b7c1b758c8c IN  0xe0356010a513950a762d6ee73f0a3a4e627567900 FTM0.0208041191
0xc0604c36f1561418426971a7163dcff4c00e4b8f0e106ccdfd1b941a78464742Buy Bonds338175702022-03-19 6:19:34192 days 10 hrs ago0x35b0ed9ecd8781ee241ccd7067e4bae5fdb65912 IN  0xe0356010a513950a762d6ee73f0a3a4e627567900 FTM0.022831738071
0xfce79020b8f614eef5471e2ef6b696f8e9b6f3ce007dad99f5f57f04333924f5Buy Bonds337947642022-03-19 0:12:48192 days 16 hrs ago0x3f7f2a0faa31a291a7b3470ac5c4dd6b8b060470 IN  0xe0356010a513950a762d6ee73f0a3a4e627567900 FTM0.025083405797
0xac4feaf33ff281544478a7caf495a433835df823d62cb3fd6833b7141c119dcfBuy Bonds337619242022-03-18 15:25:48193 days 1 hr ago0x3f7f2a0faa31a291a7b3470ac5c4dd6b8b060470 IN  0xe0356010a513950a762d6ee73f0a3a4e627567900 FTM0.060796628732
[ Download CSV Export 
Latest 1 internal transaction
Parent Txn Hash Block From To Value
0xe29a3e5f228ad7b87c49fa90b03c5d72a8e1a7f35c2a2ff49d3cefd348267829332124422022-03-12 8:04:33199 days 8 hrs ago 0x3f7f2a0faa31a291a7b3470ac5c4dd6b8b060470  Contract Creation0 FTM
[ Download CSV Export 
Loading
This contract may be a proxy contract. Click on More Options and select Is this a proxy? to confirm and enable the "Read as Proxy" & "Write as Proxy" tabs.

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

Contract Name:
Treasury

Compiler Version
v0.6.12+commit.27d51765

Optimization Enabled:
Yes with 200 runs

Other Settings:
default evmVersion
File 1 of 16 : Treasury.sol
// SPDX-License-Identifier: MIT

pragma solidity 0.6.12;

import "@openzeppelin/contracts/math/Math.sol";
import "@openzeppelin/contracts/token/ERC20/IERC20.sol";
import "@openzeppelin/contracts/token/ERC20/SafeERC20.sol";
import "@openzeppelin/contracts/utils/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 Treasury 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;

    address[] public excludedFromTotalSupply;

    // 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,
        address[] memory excludedFromTotalSupply_
    ) public notInitialized {
        tomb = _tomb;
        tbond = _tbond;
        tshare = _tshare;
        tombOracle = _tombOracle;
        masonry = _masonry;
        startTime = _startTime;

        tombPriceOne = 10**18; // 1 tomb with 18 decimals
        tombPriceCeiling = tombPriceOne.mul(101).div(100);

        // Dynamic max expansion percent
        // supplyTiers = [0 ether, 100000 ether, 200000 ether, 400000 ether, 600000 ether, 1000000 ether, 1500000 ether, 2000000 ether, 5000000 ether];
        // maxExpansionTiers = [450, 400, 350, 300, 250, 200, 150, 125, 100];
        // more tokens versions of stuido exapansion... following the playbook of most other forks
        supplyTiers = [
            0 ether,
            250000 ether,
            500000 ether,
            1000000 ether,
            2000000 ether,
            4000000 ether,
            8000000 ether,
            16000000 ether,
            32000000 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
        // bondDepletionFloorPercent = 9900; // 99% 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; // NOTE bootstrap epochs blocks the treasury from minting tokens to itself in case under peg
        bootstrapSupplyExpansionPercent = 450;

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

        initialized = true;
        operator = msg.sender;

        for (uint256 i = 0; i < excludedFromTotalSupply_.length; i++) {
            excludedFromTotalSupply.push(excludedFromTotalSupply_[i]);
            // TombGenesisPool && TombRewardPool
        }

        emit Initialized(msg.sender, block.number);
    }

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

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

    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();
        // excluding tomb pools
        uint256 balanceExcluded = 0;
        for (uint8 entryId = 0; entryId < excludedFromTotalSupply.length; ++entryId) {
            balanceExcluded = balanceExcluded.add(tombErc20.balanceOf(excludedFromTotalSupply[entryId]));
        }
        return totalSupply.sub(balanceExcluded);
        return totalSupply;
    }

    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 TOMB
            "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 redemption"
        );

        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 16 : Math.sol
// SPDX-License-Identifier: MIT

pragma solidity >=0.6.0 <0.8.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 16 : IERC20.sol
// SPDX-License-Identifier: MIT

pragma solidity >=0.6.0 <0.8.0;

/**
 * @dev Interface of the ERC20 standard as defined in the EIP.
 */
interface 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 16 : SafeERC20.sol
// SPDX-License-Identifier: MIT

pragma solidity >=0.6.0 <0.8.0;

import "./IERC20.sol";
import "../../math/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 IERC20;` 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));
    }

    /**
     * @dev Deprecated. This function has issues similar to the ones found in
     * {IERC20-approve}, and its usage is discouraged.
     *
     * Whenever possible, use {safeIncreaseAllowance} and
     * {safeDecreaseAllowance} instead.
     */
    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. We use {Address.functionCall} to perform this call, which verifies that
        // the target address contains contract code and also asserts for success in the low-level call.

        bytes memory returndata = address(token).functionCall(data, "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 16 : ReentrancyGuard.sol
// SPDX-License-Identifier: MIT

pragma solidity >=0.6.0 <0.8.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].
 */
abstract contract ReentrancyGuard {
    // Booleans are more expensive than uint256 or any type that takes up a full
    // word because each write operation emits an extra SLOAD to first read the
    // slot's contents, replace the bits taken up by the boolean, and then write
    // back. This is the compiler's defense against contract upgrades and
    // pointer aliasing, and it cannot be disabled.

    // The values being 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 percentage 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.
    uint256 private constant _NOT_ENTERED = 1;
    uint256 private constant _ENTERED = 2;

    uint256 private _status;

    constructor () internal {
        _status = _NOT_ENTERED;
    }

    /**
     * @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(_status != _ENTERED, "ReentrancyGuard: reentrant call");

        // Any calls to nonReentrant after this point will fail
        _status = _ENTERED;

        _;

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

File 6 of 16 : Babylonian.sol
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 16 : Operator.sol
// SPDX-License-Identifier: MIT

pragma solidity 0.6.12;

import "@openzeppelin/contracts/GSN/Context.sol";
import "@openzeppelin/contracts/access/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 16 : ContractGuard.sol
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 16 : IBasisAsset.sol
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 16 : 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 16 : 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 16 : SafeMath.sol
// SPDX-License-Identifier: MIT

pragma solidity >=0.6.0 <0.8.0;

/**
 * @dev Wrappers over Solidity's arithmetic operations with added overflow
 * checks.
 *
 * Arithmetic operations in Solidity wrap on overflow. This can easily result
 * in bugs, because programmers usually assume that an overflow raises an
 * error, which is the standard behavior in high level programming languages.
 * `SafeMath` restores this intuition by reverting the transaction when an
 * operation overflows.
 *
 * Using this library instead of the unchecked operations eliminates an entire
 * class of bugs, so it's recommended to use it always.
 */
library SafeMath {
    /**
     * @dev Returns the addition of two unsigned integers, with an overflow flag.
     *
     * _Available since v3.4._
     */
    function tryAdd(uint256 a, uint256 b) internal pure returns (bool, uint256) {
        uint256 c = a + b;
        if (c < a) return (false, 0);
        return (true, c);
    }

    /**
     * @dev Returns the substraction of two unsigned integers, with an overflow flag.
     *
     * _Available since v3.4._
     */
    function trySub(uint256 a, uint256 b) internal pure returns (bool, uint256) {
        if (b > a) return (false, 0);
        return (true, a - b);
    }

    /**
     * @dev Returns the multiplication of two unsigned integers, with an overflow flag.
     *
     * _Available since v3.4._
     */
    function tryMul(uint256 a, uint256 b) internal pure returns (bool, 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 (true, 0);
        uint256 c = a * b;
        if (c / a != b) return (false, 0);
        return (true, c);
    }

    /**
     * @dev Returns the division of two unsigned integers, with a division by zero flag.
     *
     * _Available since v3.4._
     */
    function tryDiv(uint256 a, uint256 b) internal pure returns (bool, uint256) {
        if (b == 0) return (false, 0);
        return (true, a / b);
    }

    /**
     * @dev Returns the remainder of dividing two unsigned integers, with a division by zero flag.
     *
     * _Available since v3.4._
     */
    function tryMod(uint256 a, uint256 b) internal pure returns (bool, uint256) {
        if (b == 0) return (false, 0);
        return (true, a % b);
    }

    /**
     * @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) {
        require(b <= a, "SafeMath: subtraction overflow");
        return a - b;
    }

    /**
     * @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) {
        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, reverting 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) {
        require(b > 0, "SafeMath: division by zero");
        return a / b;
    }

    /**
     * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo),
     * reverting 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) {
        require(b > 0, "SafeMath: modulo by zero");
        return a % b;
    }

    /**
     * @dev Returns the subtraction of two unsigned integers, reverting with custom message on
     * overflow (when the result is negative).
     *
     * CAUTION: This function is deprecated because it requires allocating memory for the error
     * message unnecessarily. For custom revert reasons use {trySub}.
     *
     * 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);
        return a - b;
    }

    /**
     * @dev Returns the integer division of two unsigned integers, reverting with custom message on
     * division by zero. The result is rounded towards zero.
     *
     * CAUTION: This function is deprecated because it requires allocating memory for the error
     * message unnecessarily. For custom revert reasons use {tryDiv}.
     *
     * Counterpart to Solidity's `/` operator. Note: this function uses a
     * `revert` opcode (which leaves remaining gas untouched) while Solidity
     * uses an invalid opcode to revert (consuming all remaining gas).
     *
     * Requirements:
     *
     * - The divisor cannot be zero.
     */
    function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
        require(b > 0, errorMessage);
        return a / b;
    }

    /**
     * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo),
     * reverting with custom message when dividing by zero.
     *
     * CAUTION: This function is deprecated because it requires allocating memory for the error
     * message unnecessarily. For custom revert reasons use {tryMod}.
     *
     * 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 16 : Address.sol
// SPDX-License-Identifier: MIT

pragma solidity >=0.6.2 <0.8.0;

/**
 * @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) {
        // This method relies on extcodesize, which returns 0 for contracts in
        // construction, since the code is only stored at the end of the
        // constructor execution.

        uint256 size;
        // solhint-disable-next-line no-inline-assembly
        assembly { size := extcodesize(account) }
        return size > 0;
    }

    /**
     * @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");
    }

    /**
     * @dev Performs a Solidity function call using a low level `call`. A
     * plain`call` is an unsafe replacement for a function call: use this
     * function instead.
     *
     * If `target` reverts with a revert reason, it is bubbled up by this
     * function (like regular Solidity function calls).
     *
     * Returns the raw returned data. To convert to the expected return value,
     * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`].
     *
     * Requirements:
     *
     * - `target` must be a contract.
     * - calling `target` with `data` must not revert.
     *
     * _Available since v3.1._
     */
    function functionCall(address target, bytes memory data) internal returns (bytes memory) {
      return functionCall(target, data, "Address: low-level call failed");
    }

    /**
     * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with
     * `errorMessage` as a fallback revert reason when `target` reverts.
     *
     * _Available since v3.1._
     */
    function functionCall(address target, bytes memory data, string memory errorMessage) internal returns (bytes memory) {
        return functionCallWithValue(target, data, 0, errorMessage);
    }

    /**
     * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
     * but also transferring `value` wei to `target`.
     *
     * Requirements:
     *
     * - the calling contract must have an ETH balance of at least `value`.
     * - the called Solidity function must be `payable`.
     *
     * _Available since v3.1._
     */
    function functionCallWithValue(address target, bytes memory data, uint256 value) internal returns (bytes memory) {
        return functionCallWithValue(target, data, value, "Address: low-level call with value failed");
    }

    /**
     * @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but
     * with `errorMessage` as a fallback revert reason when `target` reverts.
     *
     * _Available since v3.1._
     */
    function functionCallWithValue(address target, bytes memory data, uint256 value, string memory errorMessage) internal returns (bytes memory) {
        require(address(this).balance >= value, "Address: insufficient balance for call");
        require(isContract(target), "Address: call to non-contract");

        // solhint-disable-next-line avoid-low-level-calls
        (bool success, bytes memory returndata) = target.call{ value: value }(data);
        return _verifyCallResult(success, returndata, errorMessage);
    }

    /**
     * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
     * but performing a static call.
     *
     * _Available since v3.3._
     */
    function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) {
        return functionStaticCall(target, data, "Address: low-level static call failed");
    }

    /**
     * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],
     * but performing a static call.
     *
     * _Available since v3.3._
     */
    function functionStaticCall(address target, bytes memory data, string memory errorMessage) internal view returns (bytes memory) {
        require(isContract(target), "Address: static call to non-contract");

        // solhint-disable-next-line avoid-low-level-calls
        (bool success, bytes memory returndata) = target.staticcall(data);
        return _verifyCallResult(success, returndata, errorMessage);
    }

    /**
     * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
     * but performing a delegate call.
     *
     * _Available since v3.4._
     */
    function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) {
        return functionDelegateCall(target, data, "Address: low-level delegate call failed");
    }

    /**
     * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],
     * but performing a delegate call.
     *
     * _Available since v3.4._
     */
    function functionDelegateCall(address target, bytes memory data, string memory errorMessage) internal returns (bytes memory) {
        require(isContract(target), "Address: delegate call to non-contract");

        // solhint-disable-next-line avoid-low-level-calls
        (bool success, bytes memory returndata) = target.delegatecall(data);
        return _verifyCallResult(success, returndata, errorMessage);
    }

    function _verifyCallResult(bool success, bytes memory returndata, string memory errorMessage) private pure returns(bytes memory) {
        if (success) {
            return returndata;
        } else {
            // Look for revert reason and bubble it up if present
            if (returndata.length > 0) {
                // The easiest way to bubble the revert reason is using memory via assembly

                // solhint-disable-next-line no-inline-assembly
                assembly {
                    let returndata_size := mload(returndata)
                    revert(add(32, returndata), returndata_size)
                }
            } else {
                revert(errorMessage);
            }
        }
    }
}

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

pragma solidity >=0.6.0 <0.8.0;

import "../utils/Context.sol";

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

pragma solidity >=0.6.0 <0.8.0;

import "../utils/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.
 */
abstract 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 virtual 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;
    }
}

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

pragma solidity >=0.6.0 <0.8.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.
 */
abstract contract Context {
    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;
    }
}

Settings
{
  "optimizer": {
    "enabled": true,
    "runs": 200
  },
  "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":"contract IERC20","name":"_token","type":"address"},{"internalType":"uint256","name":"_amount","type":"uint256"},{"internalType":"address","name":"_to","type":"address"}],"name":"governanceRecoverUnsupported","outputs":[],"stateMutability":"nonpayable","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"},{"internalType":"address[]","name":"excludedFromTotalSupply_","type":"address[]"}],"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":"address","name":"_token","type":"address"},{"internalType":"uint256","name":"_amount","type":"uint256"},{"internalType":"address","name":"_to","type":"address"}],"name":"masonryGovernanceRecoverUnsupported","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":"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"}]

60806040526001805460ff60a01b191690556000600381905560045534801561002757600080fd5b506147d6806100376000396000f3fe608060405234801561001057600080fd5b50600436106104285760003560e01c806382cad8381161022b578063bcc81f1911610130578063d5d3b26c116100b8578063e90b245411610087578063e90b245414610a45578063ee6822a714610a4d578063f14698de14610a55578063f774110314610a5d578063fcb6f00814610a6557610428565b8063d5d3b26c14610934578063d98f24951461095a578063da3ed41914610962578063da64fc271461096a57610428565b8063c5cc772d116100ff578063c5cc772d146108d9578063c8412d02146108e1578063c8f987f3146108e9578063cecce38e146108f1578063d4b149441461090e57610428565b8063bcc81f1914610872578063be266d54146108ac578063c040f23a146108c9578063c5967c26146108d157610428565b806398b762a1116101b3578063b3406cfc11610182578063b3406cfc1461082c578063b3ab15fb14610834578063b4d1d7951461085a578063b8a878f914610862578063b981cdf31461086a57610428565b806398b762a1146107b857806399820025146107d5578063a0487eea146107f2578063a204452b1461080f57610428565b80638d934f74116101fa5780638d934f7414610729578063900cf0cf1461073157806391bbfed514610739578063940e60641461075c578063951357d41461078257610428565b806382cad838146106df578063874106cc146106fc5780638a6426e7146107045780638c664db61461070c57610428565b80634294cf8e116103315780635a0fc79c116102b957806372c054f91161028857806372c054f91461067e578063734f70961461068657806375be5ae1146106a957806378e97925146106cf57806381d11eaf146106d757610428565b80635a0fc79c146106405780635b7561791461064857806362ac58e41461065057806363f96cf41461067657610428565b806354f04a111161030057806354f04a11146105e857806355ebdeef1461060b578063570ca73514610613578063591663e11461061b57806359bf5d391461063857610428565b80634294cf8e146105695780634390d2a814610571578063499f3f191461059557806354575af4146105b257610428565b8063158ef93e116103b45780632e9c7b65116103835780632e9c7b6514610517578063392e53cd1461051f5780633ed9ae25146105275780634013a08e1461054457806340af7ba51461054c57610428565b8063158ef93e146104e357806319a98349146104ff57806322f832cd1461050757806329ef19191461050f57610428565b80630cac939c116103fb5780630cac939c1461048b5780630cf60175146104935780630db7eb0b1461049b578063118ebbf9146104a3578063154ec2db146104c657610428565b806303be7e761461042d57806304e5c7b11461044757806309bb4f92146104665780630b5bcec71461046e575b600080fd5b610435610a6d565b60408051918252519081900360200190f35b6104646004803603602081101561045d57600080fd5b5035610a73565b005b610435610b42565b6104646004803603602081101561048457600080fd5b5035610c1d565b610435610cb9565b610435610dc7565b610435610e72565b610464600480360360408110156104b957600080fd5b5080359060200135610f14565b610464600480360360208110156104dc57600080fd5b5035611571565b6104eb611616565b604080519115158252519081900360200190f35b610435611626565b61043561162c565b610435611632565b610435611638565b6104eb61163e565b6104646004803603602081101561053d57600080fd5b503561164e565b610435611708565b6104646004803603602081101561056257600080fd5b503561170e565b6104356117b3565b6105796117b9565b604080516001600160a01b039092168252519081900360200190f35b610464600480360360208110156105ab57600080fd5b50356117c8565b610464600480360360608110156105c857600080fd5b506001600160a01b03813581169160208101359160409091013516611865565b610464600480360360408110156105fe57600080fd5b50803590602001356119aa565b6104356120e9565b6105796120ef565b6104646004803603602081101561063157600080fd5b50356120fe565b6104356121a0565b6104356121a6565b6104646121ac565b6104646004803603602081101561066657600080fd5b50356001600160a01b031661285e565b610579612910565b61043561291f565b6104646004803603604081101561069c57600080fd5b50803590602001356129df565b610464600480360360208110156106bf57600080fd5b50356001600160a01b0316612a98565b610435612b03565b610435612b09565b610579600480360360208110156106f557600080fd5b5035612b0f565b610435612b36565b610435612b3c565b6104646004803603602081101561072257600080fd5b5035612c7c565b610579612d1e565b610435612d2d565b6104646004803603604081101561074f57600080fd5b5080359060200135612d33565b6104eb6004803603604081101561077257600080fd5b5060ff8135169060200135612e2b565b6104646004803603606081101561079857600080fd5b506001600160a01b03813581169160208101359160409091013516612f47565b610464600480360360208110156107ce57600080fd5b503561300a565b610435600480360360208110156107eb57600080fd5b5035613058565b6104356004803603602081101561080857600080fd5b5035613076565b6104646004803603602081101561082557600080fd5b5035613083565b6104356130d1565b6104646004803603602081101561084a57600080fd5b50356001600160a01b03166130d7565b610435613142565b610435613148565b61057961314e565b6104646004803603608081101561088857600080fd5b506001600160a01b038135811691602081013591604082013516906060013561315d565b610464600480360360208110156108c257600080fd5b50356132f2565b610579613388565b610435613397565b6104356133c1565b610435613423565b610435613429565b6104646004803603602081101561090757600080fd5b503561342f565b6104eb6004803603604081101561092457600080fd5b5060ff81351690602001356134d0565b6104646004803603602081101561094a57600080fd5b50356001600160a01b03166135ca565b610435613635565b61043561363b565b610464600480360360e081101561098057600080fd5b6001600160a01b03823581169260208101358216926040820135831692606083013581169260808101359091169160a0820135919081019060e0810160c08201356401000000008111156109d357600080fd5b8201836020820111156109e557600080fd5b80359060200191846020830284011164010000000083111715610a0757600080fd5b919080806020026020016040519081016040528093929190818152602001838360200280828437600092019190915250929550613641945050505050565b61043561398e565b610579613994565b6104356139a3565b6105796139a9565b6104356139b8565b60215481565b6001546001600160a01b03163314610abc5760405162461bcd60e51b815260040180806020018281038252602481526020018061466d6024913960400191505060405180910390fd5b600c54811015610afd5760405162461bcd60e51b815260040180806020018281038252602a815260200180614471602a913960400191505060405180910390fd5b6096811115610b3d5760405162461bcd60e51b81526004018080602001828103825260248152602001806144ff6024913960400191505060405180910390fd5b601b55565b600a5460065460408051633ddac95360e01b81526001600160a01b039283166004820152670de0b6b3a7640000602482015290516000939290921691633ddac95391604480820192602092909190829003018186803b158015610ba457600080fd5b505afa925050508015610bc957506040513d6020811015610bc457600080fd5b505160015b610c045760405162461bcd60e51b81526004018080602001828103825260368152602001806144c96036913960400191505060405180910390fd5b71ffffffffffffffffffffffffffffffffffff16905090565b6001546001600160a01b03163314610c665760405162461bcd60e51b815260040180806020018281038252602481526020018061466d6024913960400191505060405180910390fd5b600a8110158015610c7957506103e88111155b610cb45760405162461bcd60e51b815260040180806020018281038252602881526020018061461c6028913960400191505060405180910390fd5b601055565b600080610cc4610b42565b9050600b548111610dc3576000610cd9612b3c565b90506000610cfe612710610cf8601454856139be90919063ffffffff16565b90613a1e565b90506000600760009054906101000a90046001600160a01b03166001600160a01b03166318160ddd6040518163ffffffff1660e01b815260040160206040518083038186803b158015610d5057600080fd5b505afa158015610d64573d6000803e3d6000fd5b505050506040513d6020811015610d7a57600080fd5b5051905080821115610dbf576000610d928383613a85565b90506000610dac670de0b6b3a7640000610cf884896139be565b9050610dba60045482613ae2565b965050505b5050505b5090565b600080610dd2610b42565b9050600b548111610dc357601a54610dee57600b549150610dc3565b6000610e1182610cf8670de0b6b3a7640000600b546139be90919063ffffffff16565b90506000610e3c612710610cf8601a54610e36600b5487613a8590919063ffffffff16565b906139be565b600b54909150610e4c9082613af8565b93506000601854118015610e61575060185484115b15610e6c5760185493505b50505090565b600080610e7d610b42565b9050600c54811115610dc3576000610ea76064610cf8601b54600b546139be90919063ffffffff16565b9050808210610f09576000610ed3612710610cf8601c54610e36600b5488613a8590919063ffffffff16565b600b54909150610ee39082613af8565b93506000601954118015610ef8575060195484115b15610f035760195493505b50610f0f565b600b5492505b505090565b610f1c613b52565b15610f585760405162461bcd60e51b81526004018080602001828103825260268152602001806146bb6026913960400191505060405180910390fd5b610f60613b71565b15610f9c5760405162461bcd60e51b81526004018080602001828103825260268152602001806146bb6026913960400191505060405180910390fd5b600254421015610fef576040805162461bcd60e51b8152602060048201526019602482015278151c99585cdd5c9e4e881b9bdd081cdd185c9d1959081e595d603a1b604482015290519081900360640190fd5b6006546040805163570ca73560e01b8152905130926001600160a01b03169163570ca735916004808301926020929190829003018186803b15801561103357600080fd5b505afa158015611047573d6000803e3d6000fd5b505050506040513d602081101561105d57600080fd5b50516001600160a01b03161480156110eb57506007546040805163570ca73560e01b8152905130926001600160a01b03169163570ca735916004808301926020929190829003018186803b1580156110b457600080fd5b505afa1580156110c8573d6000803e3d6000fd5b505050506040513d60208110156110de57600080fd5b50516001600160a01b0316145b801561116d57506008546040805163570ca73560e01b8152905130926001600160a01b03169163570ca735916004808301926020929190829003018186803b15801561113657600080fd5b505afa15801561114a573d6000803e3d6000fd5b505050506040513d602081101561116057600080fd5b50516001600160a01b0316145b80156111ef57506009546040805163570ca73560e01b8152905130926001600160a01b03169163570ca735916004808301926020929190829003018186803b1580156111b857600080fd5b505afa1580156111cc573d6000803e3d6000fd5b505050506040513d60208110156111e257600080fd5b50516001600160a01b0316145b611240576040805162461bcd60e51b815260206004820152601e60248201527f54726561737572793a206e656564206d6f7265207065726d697373696f6e0000604482015290519081900360640190fd5b6000821161127f5760405162461bcd60e51b815260040180806020018281038252602e81526020018061449b602e913960400191505060405180910390fd5b6000611289610b42565b90508181146112df576040805162461bcd60e51b815260206004820152601a60248201527f54726561737572793a20544f4d42207072696365206d6f766564000000000000604482015290519081900360640190fd5b600c54811161131f5760405162461bcd60e51b815260040180806020018281038252603481526020018061456e6034913960400191505060405180910390fd5b6000611329610e72565b905060008111611380576040805162461bcd60e51b815260206004820152601b60248201527f54726561737572793a20696e76616c696420626f6e6420726174650000000000604482015290519081900360640190fd5b6000611398670de0b6b3a7640000610cf887856139be565b600654604080516370a0823160e01b8152306004820152905192935083926001600160a01b03909216916370a0823191602480820192602092909190829003018186803b1580156113e857600080fd5b505afa1580156113fc573d6000803e3d6000fd5b505050506040513d602081101561141257600080fd5b505110156114515760405162461bcd60e51b81526004018080602001828103825260258152602001806145496025913960400191505060405180910390fd5b611469611460600d5483613ae2565b600d5490613a85565b600d556007546040805163079cc67960e41b81523360048201526024810188905290516001600160a01b03909216916379cc67909160448082019260009290919082900301818387803b1580156114bf57600080fd5b505af11580156114d3573d6000803e3d6000fd5b50506006546114ef92506001600160a01b031690503383613b90565b6114f7613be2565b6040805182815260208101879052815133927f51e0d16595cabc591e64da08e45bb223577e5b9a39cd947b4ddc3472b2dd8878928290030190a25050436000908152602081815260408083203284529091528082208054600160ff1991821681179092553384529190922080549091169091179055505050565b6001546001600160a01b031633146115ba5760405162461bcd60e51b815260040180806020018281038252602481526020018061466d6024913960400191505060405180910390fd5b614e20811115611611576040805162461bcd60e51b815260206004820152601d60248201527f5f646973636f756e7450657263656e74206973206f7665722032303025000000604482015290519081900360640190fd5b601a55565b600154600160a01b900460ff1681565b600c5481565b60125481565b601a5481565b60195481565b600154600160a01b900460ff1690565b6001546001600160a01b031633146116975760405162461bcd60e51b815260040180806020018281038252602481526020018061466d6024913960400191505060405180910390fd5b600b5481101580156116c357506116bf6064610cf86078600b546139be90919063ffffffff16565b8111155b611703576040805162461bcd60e51b815260206004820152600c60248201526b6f7574206f662072616e676560a01b604482015290519081900360640190fd5b600c55565b601d5481565b6001546001600160a01b031633146117575760405162461bcd60e51b815260040180806020018281038252602481526020018061466d6024913960400191505060405180910390fd5b614e208111156117ae576040805162461bcd60e51b815260206004820152601c60248201527f5f7072656d69756d50657263656e74206973206f766572203230302500000000604482015290519081900360640190fd5b601c55565b600b5481565b6020546001600160a01b031681565b6001546001600160a01b031633146118115760405162461bcd60e51b815260040180806020018281038252602481526020018061466d6024913960400191505060405180910390fd5b61271081101580156118255750614e208111155b6118605760405162461bcd60e51b81526004018080602001828103825260298152602001806145f36029913960400191505060405180910390fd5b601d55565b6001546001600160a01b031633146118ae5760405162461bcd60e51b815260040180806020018281038252602481526020018061466d6024913960400191505060405180910390fd5b6006546001600160a01b03848116911614156118fa576040805162461bcd60e51b815260206004808301919091526024820152633a37b6b160e11b604482015290519081900360640190fd5b6007546001600160a01b0384811691161415611946576040805162461bcd60e51b81526020600480830191909152602482015263189bdb9960e21b604482015290519081900360640190fd5b6008546001600160a01b0384811691161415611991576040805162461bcd60e51b8152602060048201526005602482015264736861726560d81b604482015290519081900360640190fd5b6119a56001600160a01b0384168284613b90565b505050565b6119b2613b52565b156119ee5760405162461bcd60e51b81526004018080602001828103825260268152602001806146bb6026913960400191505060405180910390fd5b6119f6613b71565b15611a325760405162461bcd60e51b81526004018080602001828103825260268152602001806146bb6026913960400191505060405180910390fd5b600254421015611a85576040805162461bcd60e51b8152602060048201526019602482015278151c99585cdd5c9e4e881b9bdd081cdd185c9d1959081e595d603a1b604482015290519081900360640190fd5b6006546040805163570ca73560e01b8152905130926001600160a01b03169163570ca735916004808301926020929190829003018186803b158015611ac957600080fd5b505afa158015611add573d6000803e3d6000fd5b505050506040513d6020811015611af357600080fd5b50516001600160a01b0316148015611b8157506007546040805163570ca73560e01b8152905130926001600160a01b03169163570ca735916004808301926020929190829003018186803b158015611b4a57600080fd5b505afa158015611b5e573d6000803e3d6000fd5b505050506040513d6020811015611b7457600080fd5b50516001600160a01b0316145b8015611c0357506008546040805163570ca73560e01b8152905130926001600160a01b03169163570ca735916004808301926020929190829003018186803b158015611bcc57600080fd5b505afa158015611be0573d6000803e3d6000fd5b505050506040513d6020811015611bf657600080fd5b50516001600160a01b0316145b8015611c8557506009546040805163570ca73560e01b8152905130926001600160a01b03169163570ca735916004808301926020929190829003018186803b158015611c4e57600080fd5b505afa158015611c62573d6000803e3d6000fd5b505050506040513d6020811015611c7857600080fd5b50516001600160a01b0316145b611cd6576040805162461bcd60e51b815260206004820152601e60248201527f54726561737572793a206e656564206d6f7265207065726d697373696f6e0000604482015290519081900360640190fd5b60008211611d155760405162461bcd60e51b81526004018080602001828103825260308152602001806145c36030913960400191505060405180910390fd5b6000611d1f610b42565b9050818114611d75576040805162461bcd60e51b815260206004820152601a60248201527f54726561737572793a20544f4d42207072696365206d6f766564000000000000604482015290519081900360640190fd5b600b548110611db55760405162461bcd60e51b81526004018080602001828103825260328152602001806147176032913960400191505060405180910390fd5b600454831115611df65760405162461bcd60e51b815260040180806020018281038252602a815260200180614749602a913960400191505060405180910390fd5b6000611e00610dc7565b905060008111611e57576040805162461bcd60e51b815260206004820152601b60248201527f54726561737572793a20696e76616c696420626f6e6420726174650000000000604482015290519081900360640190fd5b6000611e6f670de0b6b3a7640000610cf887856139be565b90506000611e7b612b3c565b90506000611f0383600760009054906101000a90046001600160a01b03166001600160a01b03166318160ddd6040518163ffffffff1660e01b815260040160206040518083038186803b158015611ed157600080fd5b505afa158015611ee5573d6000803e3d6000fd5b505050506040513d6020811015611efb57600080fd5b505190613af8565b9050611f20612710610cf8601454856139be90919063ffffffff16565b811115611f6a576040805162461bcd60e51b81526020600482015260136024820152726f766572206d6178206465627420726174696f60681b604482015290519081900360640190fd5b6006546040805163079cc67960e41b8152336004820152602481018a905290516001600160a01b03909216916379cc67909160448082019260009290919082900301818387803b158015611fbd57600080fd5b505af1158015611fd1573d6000803e3d6000fd5b5050600754604080516340c10f1960e01b81523360048201526024810188905290516001600160a01b0390921693506340c10f1992506044808201926020929091908290030181600087803b15801561202957600080fd5b505af115801561203d573d6000803e3d6000fd5b505050506040513d602081101561205357600080fd5b50506004546120629088613a85565b60045561206d613be2565b6040805188815260208101859052815133927f73017f1b70789e2e66759eeb3c7ec11f59e6eedb55d921cfaec5410dd42a4799928290030190a25050436000908152602081815260408083203284529091528082208054600160ff19918216811790925533845291909220805490911690911790555050505050565b601f5481565b6001546001600160a01b031681565b6001546001600160a01b031633146121475760405162461bcd60e51b815260040180806020018281038252602481526020018061466d6024913960400191505060405180910390fd5b6103e8811015801561215b57506127108111155b61219b576040805162461bcd60e51b815260206004820152600c60248201526b6f7574206f662072616e676560a01b604482015290519081900360640190fd5b601455565b600d5490565b600d5481565b6121b4613b52565b156121f05760405162461bcd60e51b81526004018080602001828103825260268152602001806146bb6026913960400191505060405180910390fd5b6121f8613b71565b156122345760405162461bcd60e51b81526004018080602001828103825260268152602001806146bb6026913960400191505060405180910390fd5b600254421015612287576040805162461bcd60e51b8152602060048201526019602482015278151c99585cdd5c9e4e881b9bdd081cdd185c9d1959081e595d603a1b604482015290519081900360640190fd5b61228f613397565b4210156122e3576040805162461bcd60e51b815260206004820152601860248201527f54726561737572793a206e6f74206f70656e6564207965740000000000000000604482015290519081900360640190fd5b6006546040805163570ca73560e01b8152905130926001600160a01b03169163570ca735916004808301926020929190829003018186803b15801561232757600080fd5b505afa15801561233b573d6000803e3d6000fd5b505050506040513d602081101561235157600080fd5b50516001600160a01b03161480156123df57506007546040805163570ca73560e01b8152905130926001600160a01b03169163570ca735916004808301926020929190829003018186803b1580156123a857600080fd5b505afa1580156123bc573d6000803e3d6000fd5b505050506040513d60208110156123d257600080fd5b50516001600160a01b0316145b801561246157506008546040805163570ca73560e01b8152905130926001600160a01b03169163570ca735916004808301926020929190829003018186803b15801561242a57600080fd5b505afa15801561243e573d6000803e3d6000fd5b505050506040513d602081101561245457600080fd5b50516001600160a01b0316145b80156124e357506009546040805163570ca73560e01b8152905130926001600160a01b03169163570ca735916004808301926020929190829003018186803b1580156124ac57600080fd5b505afa1580156124c0573d6000803e3d6000fd5b505050506040513d60208110156124d657600080fd5b50516001600160a01b0316145b612534576040805162461bcd60e51b815260206004820152601e60248201527f54726561737572793a206e656564206d6f7265207065726d697373696f6e0000604482015290519081900360640190fd5b61253c613be2565b612544610b42565b601755600d5460009061255f90612559612b3c565b90613a85565b905060155460035410156125955761259061258b612710610cf8601654856139be90919063ffffffff16565b613c46565b6127e2565b600c5460175411156127e257600754604080516318160ddd60e01b815290516000926001600160a01b0316916318160ddd916004808301926020929190829003018186803b1580156125e657600080fd5b505afa1580156125fa573d6000803e3d6000fd5b505050506040513d602081101561261057600080fd5b5051600b5460175491925060009161262791613a85565b90506000806000612641655af3107a4000610e3688613f86565b90508084111561264f578093505b61266a612710610cf8601154886139be90919063ffffffff16565b600d541061268f57612688670de0b6b3a7640000610cf888876139be565b91506126fb565b60006126a7670de0b6b3a7640000610cf889886139be565b90506126c4612710610cf8601254846139be90919063ffffffff16565b92506126d08184613a85565b601d54909450156126f9576126f6612710610cf8601d54876139be90919063ffffffff16565b93505b505b811561270a5761270a82613c46565b82156127dc57600d5461271d9084613af8565b600d55600654604080516340c10f1960e01b81523060048201526024810186905290516001600160a01b03909216916340c10f19916044808201926020929091908290030181600087803b15801561277457600080fd5b505af1158015612788573d6000803e3d6000fd5b505050506040513d602081101561279e57600080fd5b5050604080514281526020810185905281517ff705142bf09f04297640495ddf7c59b7fd6f51894c5aea9602d631cf05f0efc2929181900390910190a15b50505050505b506003546127f1906001613af8565b600355600c546127ff610b42565b1161281d57612818612710610cf8601354610e36612b3c565b612820565b60005b600455436000908152602081815260408083203284529091528082208054600160ff1991821681179092553384529190922080549091169091179055565b6001546001600160a01b031633146128a75760405162461bcd60e51b815260040180806020018281038252602481526020018061466d6024913960400191505060405180910390fd5b6009546040805163b3ab15fb60e01b81526001600160a01b0384811660048301529151919092169163b3ab15fb91602480830192600092919082900301818387803b1580156128f557600080fd5b505af1158015612909573d6000803e3d6000fd5b5050505050565b6009546001600160a01b031681565b60008061292a610b42565b9050600c54811115610dc357600654604080516370a0823160e01b815230600482015290516000926001600160a01b0316916370a08231916024808301926020929190829003018186803b15801561298157600080fd5b505afa158015612995573d6000803e3d6000fd5b505050506040513d60208110156129ab57600080fd5b5051905060006129b9610e72565b90508015610e6c576129d781610cf884670de0b6b3a76400006139be565b935050505090565b6001546001600160a01b03163314612a285760405162461bcd60e51b815260040180806020018281038252602481526020018061466d6024913960400191505060405180910390fd5b60095460408051632ffaaa0960e01b8152600481018590526024810184905290516001600160a01b0390921691632ffaaa099160448082019260009290919082900301818387803b158015612a7c57600080fd5b505af1158015612a90573d6000803e3d6000fd5b505050505050565b6001546001600160a01b03163314612ae15760405162461bcd60e51b815260040180806020018281038252602481526020018061466d6024913960400191505060405180910390fd5b600a80546001600160a01b0319166001600160a01b0392909216919091179055565b60025481565b60115481565b60058181548110612b1c57fe5b6000918252602090912001546001600160a01b0316905081565b60165481565b600654604080516318160ddd60e01b815290516000926001600160a01b031691839183916318160ddd916004808301926020929190829003018186803b158015612b8557600080fd5b505afa158015612b99573d6000803e3d6000fd5b505050506040513d6020811015612baf57600080fd5b505190506000805b60055460ff82161015612c7157612c67846001600160a01b03166370a0823160058460ff1681548110612be657fe5b60009182526020918290200154604080516001600160e01b031960e086901b1681526001600160a01b0390921660048301525160248083019392829003018186803b158015612c3457600080fd5b505afa158015612c48573d6000803e3d6000fd5b505050506040513d6020811015612c5e57600080fd5b50518390613af8565b9150600101612bb7565b506129d78282613a85565b6001546001600160a01b03163314612cc55760405162461bcd60e51b815260040180806020018281038252602481526020018061466d6024913960400191505060405180910390fd5b6101f48110158015612cd957506127108111155b612d19576040805162461bcd60e51b815260206004820152600c60248201526b6f7574206f662072616e676560a01b604482015290519081900360640190fd5b601155565b601e546001600160a01b031681565b60035481565b6001546001600160a01b03163314612d7c5760405162461bcd60e51b815260040180806020018281038252602481526020018061466d6024913960400191505060405180910390fd5b6078821115612dd2576040805162461bcd60e51b815260206004820152601e60248201527f5f626f6f74737472617045706f6368733a206f7574206f662072616e67650000604482015290519081900360640190fd5b60648110158015612de557506103e88111155b612e205760405162461bcd60e51b815260040180806020018281038252602e815260200180614773602e913960400191505060405180910390fd5b601591909155601655565b6001546000906001600160a01b03163314612e775760405162461bcd60e51b815260040180806020018281038252602481526020018061466d6024913960400191505060405180910390fd5b60098360ff1610612eb95760405162461bcd60e51b81526004018080602001828103825260298152602001806146446029913960400191505060405180910390fd5b60ff831615612eeb57600e6001840360ff1681548110612ed557fe5b90600052602060002001548211612eeb57600080fd5b60088360ff161015612f2057600e8360010160ff1681548110612f0a57fe5b90600052602060002001548210612f2057600080fd5b81600e8460ff1681548110612f3157fe5b6000918252602090912001555060015b92915050565b6001546001600160a01b03163314612f905760405162461bcd60e51b815260040180806020018281038252602481526020018061466d6024913960400191505060405180910390fd5b60095460408051631515d6bd60e21b81526001600160a01b038681166004830152602482018690528481166044830152915191909216916354575af491606480830192600092919082900301818387803b158015612fed57600080fd5b505af1158015613001573d6000803e3d6000fd5b50505050505050565b6001546001600160a01b031633146130535760405162461bcd60e51b815260040180806020018281038252602481526020018061466d6024913960400191505060405180910390fd5b601855565b600e818154811061306557fe5b600091825260209091200154905081565b600f818154811061306557fe5b6001546001600160a01b031633146130cc5760405162461bcd60e51b815260040180806020018281038252602481526020018061466d6024913960400191505060405180910390fd5b601955565b60175481565b6001546001600160a01b031633146131205760405162461bcd60e51b815260040180806020018281038252602481526020018061466d6024913960400191505060405180910390fd5b600180546001600160a01b0319166001600160a01b0392909216919091179055565b61546081565b60185481565b6007546001600160a01b031681565b6001546001600160a01b031633146131a65760405162461bcd60e51b815260040180806020018281038252602481526020018061466d6024913960400191505060405180910390fd5b6001600160a01b0384166131ea576040805162461bcd60e51b815260206004808301919091526024820152637a65726f60e01b604482015290519081900360640190fd5b610bb8831115613230576040805162461bcd60e51b815260206004820152600c60248201526b6f7574206f662072616e676560a01b604482015290519081900360640190fd5b6001600160a01b038216613274576040805162461bcd60e51b815260206004808301919091526024820152637a65726f60e01b604482015290519081900360640190fd5b6103e88111156132ba576040805162461bcd60e51b815260206004820152600c60248201526b6f7574206f662072616e676560a01b604482015290519081900360640190fd5b601e80546001600160a01b03199081166001600160a01b0396871617909155601f939093556020805490931691909316179055602155565b6001546001600160a01b0316331461333b5760405162461bcd60e51b815260040180806020018281038252602481526020018061466d6024913960400191505060405180910390fd5b600954604080516397ffe1d760e01b81526004810184905290516001600160a01b03909216916397ffe1d79160248082019260009290919082900301818387803b1580156128f557600080fd5b6006546001600160a01b031681565b60006133bc6133b36154606003546139be90919063ffffffff16565b60025490613af8565b905090565b600a5460065460408051630d01142560e31b81526001600160a01b039283166004820152670de0b6b3a7640000602482015290516000939290921691636808a12891604480820192602092909190829003018186803b158015610ba457600080fd5b601c5481565b601b5481565b6001546001600160a01b031633146134785760405162461bcd60e51b815260040180806020018281038252602481526020018061466d6024913960400191505060405180910390fd5b6064811015801561348b57506105dc8111155b6134cb576040805162461bcd60e51b815260206004820152600c60248201526b6f7574206f662072616e676560a01b604482015290519081900360640190fd5b601355565b6001546000906001600160a01b0316331461351c5760405162461bcd60e51b815260040180806020018281038252602481526020018061466d6024913960400191505060405180910390fd5b60098360ff161061355e5760405162461bcd60e51b81526004018080602001828103825260298152602001806146446029913960400191505060405180910390fd5b600a821015801561357157506103e88211155b6135b9576040805162461bcd60e51b81526020600482015260146024820152735f76616c75653a206f7574206f662072616e676560601b604482015290519081900360640190fd5b81600f8460ff1681548110612f3157fe5b6001546001600160a01b031633146136135760405162461bcd60e51b815260040180806020018281038252602481526020018061466d6024913960400191505060405180910390fd5b600980546001600160a01b0319166001600160a01b0392909216919091179055565b60105481565b60145481565b600154600160a01b900460ff16156136a0576040805162461bcd60e51b815260206004820152601d60248201527f54726561737572793a20616c726561647920696e697469616c697a6564000000604482015290519081900360640190fd5b600680546001600160a01b03199081166001600160a01b038a811691909117909255600780548216898416179055600880548216888416179055600a80548216878416179055600980549091169185169190911790556002829055670de0b6b3a7640000600b81905561371b90606490610cf89060656139be565b600c556040805161012081018252600081526934f086f3b33b6840000060208201526969e10de76676d08000009181019190915269d3c21bcecceda100000060608201526a01a784379d99db4200000060808201526a034f086f3b33b68400000060a08201526a069e10de76676d0800000060c08201526a0d3c21bcecceda1000000060e08201526a1a784379d99db4200000006101008201526137c390600e9060096143c4565b5060408051610120810182526101c28152610190602082015261015e9181019190915261012c606082015260fa608082015260c860a0820152609660c0820152607d60e0820152606461010082015261382090600f90600961441a565b50610190601055612710601155610dac601281905561012c601355601455606e601b55611b58601c9081556015556101c2601655600654604080516370a0823160e01b815230600482015290516001600160a01b03909216916370a0823191602480820192602092909190829003018186803b15801561389f57600080fd5b505afa1580156138b3573d6000803e3d6000fd5b505050506040513d60208110156138c957600080fd5b5051600d55600180546001600160a01b031960ff60a01b19909116600160a01b17163317905560005b815181101561394e57600582828151811061390957fe5b60209081029190910181015182546001808201855560009485529290932090920180546001600160a01b0319166001600160a01b0390931692909217909155016138f2565b5060408051438152905133917f25ff68dd81b34665b5ba7e553ee5511bf6812e12adb4a7e2c0d9e26b3099ce79919081900360200190a250505050505050565b60135481565b6008546001600160a01b031681565b60155481565b600a546001600160a01b031681565b60045481565b6000826139cd57506000612f41565b828202828482816139da57fe5b0414613a175760405162461bcd60e51b81526004018080602001828103825260218152602001806145a26021913960400191505060405180910390fd5b9392505050565b6000808211613a74576040805162461bcd60e51b815260206004820152601a60248201527f536166654d6174683a206469766973696f6e206279207a65726f000000000000604482015290519081900360640190fd5b818381613a7d57fe5b049392505050565b600082821115613adc576040805162461bcd60e51b815260206004820152601e60248201527f536166654d6174683a207375627472616374696f6e206f766572666c6f770000604482015290519081900360640190fd5b50900390565b6000818310613af15781613a17565b5090919050565b600082820183811015613a17576040805162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015290519081900360640190fd5b4360009081526020818152604080832032845290915290205460ff1690565b4360009081526020818152604080832033845290915290205460ff1690565b604080516001600160a01b038416602482015260448082018490528251808303909101815260649091019091526020810180516001600160e01b031663a9059cbb60e01b1790526119a5908490613fe3565b600a60009054906101000a90046001600160a01b03166001600160a01b031663a2e620456040518163ffffffff1660e01b8152600401600060405180830381600087803b158015613c3257600080fd5b505af1925050508015613c43575060015b50565b600654604080516340c10f1960e01b81523060048201526024810184905290516001600160a01b03909216916340c10f19916044808201926020929091908290030181600087803b158015613c9a57600080fd5b505af1158015613cae573d6000803e3d6000fd5b505050506040513d6020811015613cc457600080fd5b5050601f5460009015613daf57613cec612710610cf8601f54856139be90919063ffffffff16565b600654601e546040805163a9059cbb60e01b81526001600160a01b03928316600482015260248101859052905193945091169163a9059cbb916044808201926020929091908290030181600087803b158015613d4757600080fd5b505af1158015613d5b573d6000803e3d6000fd5b505050506040513d6020811015613d7157600080fd5b5050604080514281526020810183905281517fcb3f34aaa3445b461e6da5492dc89e5c257a59fa598131f3b6bbc97a3638e409929181900390910190a15b60215460009015613e9557613dd5612710610cf8602154866139be90919063ffffffff16565b600654602080546040805163a9059cbb60e01b81526001600160a01b03928316600482015260248101869052905194955092169263a9059cbb9260448082019392918290030181600087803b158015613e2d57600080fd5b505af1158015613e41573d6000803e3d6000fd5b505050506040513d6020811015613e5757600080fd5b5050604080514281526020810183905281517fdc8b715b18523e58b7fd0da53259dfa91efd91df4a854d94b136e3333a3b9395929181900390910190a15b613ea3816125598585613a85565b600954600654919450613ec4916001600160a01b0390811691166000614094565b600954600654613ee1916001600160a01b03918216911685614094565b600954604080516397ffe1d760e01b81526004810186905290516001600160a01b03909216916397ffe1d79160248082019260009290919082900301818387803b158015613f2e57600080fd5b505af1158015613f42573d6000803e3d6000fd5b5050604080514281526020810187905281517fa72fa2f263b243b0f0e1fec5f3d49d33de573d15929b6b730c6b8ab3838c1c4d9450908190039091019150a1505050565b600060085b600e8160ff1681548110613f9b57fe5b90600052602060002001548310613fd057600f8160ff1681548110613fbc57fe5b600091825260209091200154601055613fd9565b60001901613f8b565b5050601054919050565b6060614038826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b03166141a79092919063ffffffff16565b8051909150156119a55780806020019051602081101561405757600080fd5b50516119a55760405162461bcd60e51b815260040180806020018281038252602a815260200180614691602a913960400191505060405180910390fd5b80158061411a575060408051636eb1769f60e11b81523060048201526001600160a01b03848116602483015291519185169163dd62ed3e91604480820192602092909190829003018186803b1580156140ec57600080fd5b505afa158015614100573d6000803e3d6000fd5b505050506040513d602081101561411657600080fd5b5051155b6141555760405162461bcd60e51b81526004018080602001828103825260368152602001806146e16036913960400191505060405180910390fd5b604080516001600160a01b038416602482015260448082018490528251808303909101815260649091019091526020810180516001600160e01b031663095ea7b360e01b1790526119a5908490613fe3565b60606141b684846000856141be565b949350505050565b6060824710156141ff5760405162461bcd60e51b81526004018080602001828103825260268152602001806145236026913960400191505060405180910390fd5b6142088561431a565b614259576040805162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e7472616374000000604482015290519081900360640190fd5b60006060866001600160a01b031685876040518082805190602001908083835b602083106142985780518252601f199092019160209182019101614279565b6001836020036101000a03801982511681845116808217855250505050505090500191505060006040518083038185875af1925050503d80600081146142fa576040519150601f19603f3d011682016040523d82523d6000602084013e6142ff565b606091505b509150915061430f828286614320565b979650505050505050565b3b151590565b6060831561432f575081613a17565b82511561433f5782518084602001fd5b8160405162461bcd60e51b81526004018080602001828103825283818151815260200191508051906020019080838360005b83811015614389578181015183820152602001614371565b50505050905090810190601f1680156143b65780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b82805482825590600052602060002090810192821561440e579160200282015b8281111561440e57825182906affffffffffffffffffffff169055916020019190600101906143e4565b50610dc392915061445b565b82805482825590600052602060002090810192821561440e579160200282015b8281111561440e578251829061ffff1690559160200191906001019061443a565b5b80821115610dc3576000815560010161445c56fe5f7072656d69756d5468726573686f6c64206578636565647320746f6d6250726963654365696c696e6754726561737572793a2063616e6e6f742072656465656d20626f6e64732077697468207a65726f20616d6f756e7454726561737572793a206661696c656420746f20636f6e73756c7420544f4d422070726963652066726f6d20746865206f7261636c655f7072656d69756d5468726573686f6c6420697320686967686572207468616e20312e35416464726573733a20696e73756666696369656e742062616c616e636520666f722063616c6c54726561737572793a20747265617375727920686173206e6f206d6f72652062756467657454726561737572793a20746f6d625072696365206e6f7420656c696769626c6520666f7220626f6e6420726564656d7074696f6e536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f7754726561737572793a2063616e6e6f7420707572636861736520626f6e64732077697468207a65726f20616d6f756e745f6d696e74696e67466163746f72466f72506179696e67446562743a206f7574206f662072616e67655f6d6178537570706c79457870616e73696f6e50657263656e743a206f7574206f662072616e6765496e6465782068617320746f206265206c6f776572207468616e20636f756e74206f6620746965727354726561737572793a2063616c6c6572206973206e6f7420746865206f70657261746f725361666545524332303a204552433230206f7065726174696f6e20646964206e6f742073756363656564436f6e747261637447756172643a206f6e6520626c6f636b2c206f6e652066756e6374696f6e5361666545524332303a20617070726f76652066726f6d206e6f6e2d7a65726f20746f206e6f6e2d7a65726f20616c6c6f77616e636554726561737572793a20746f6d625072696365206e6f7420656c696769626c6520666f7220626f6e6420707572636861736554726561737572793a206e6f7420656e6f75676820626f6e64206c65667420746f2070757263686173655f626f6f747374726170537570706c79457870616e73696f6e50657263656e743a206f7574206f662072616e6765a2646970667358221220f701b1e880ecd77e9f1a46350a0210091d5e361ac50f3c397cfbe0842468a0d864736f6c634300060c0033

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.