Contract 0xe069f042151fd2b4cD67673585A8648E5855aF10

 
Txn Hash Method
Block
From
To
Value [Txn Fee]
0xff594f164417b6c5867522d655c7e502a5a8a2588329af627e2bdfc36da8a26eBuy Bonds508653802022-11-14 13:21:1517 days 19 hrs ago0xa2390a0222e423de9b5ecd613bb66e6dd5818752 IN  0xe069f042151fd2b4cd67673585a8648e5855af100 FTM0.020601098296
0x6bb6cc5c6425ad45b90dda768c57119648474cc9d0bc4982644c818464fc8a37Buy Bonds490107112022-10-12 13:34:2850 days 19 hrs ago0x4325c590dd27437f08aced052608fc3db9b50cd5 IN  0xe069f042151fd2b4cd67673585a8648e5855af100 FTM0.000570052168
0x5aa4eabecc3a287371933c6eec0948952cd8328a3b1546663ebcd3187605d337Allocate Seignio...488249612022-10-10 1:16:2253 days 7 hrs ago0xe2e23c12e3f15471c4e5f4c4e1b87cf6672e5ca5 IN  0xe069f042151fd2b4cd67673585a8648e5855af100 FTM0.000255036158
0xd3a0fedaed6c33506fbed287c1f4742df967fd0c47c21878e4c704c5b842163eAllocate Seignio...488249552022-10-10 1:16:1453 days 7 hrs ago0xe2e23c12e3f15471c4e5f4c4e1b87cf6672e5ca5 IN  0xe069f042151fd2b4cd67673585a8648e5855af100 FTM0.00017268679
0x1c4203c3f201bda690198da9233884f985dcf52ba9f40161d09a5c79e9eea067Allocate Seignio...488249512022-10-10 1:16:0053 days 7 hrs ago0xe2e23c12e3f15471c4e5f4c4e1b87cf6672e5ca5 IN  0xe069f042151fd2b4cd67673585a8648e5855af100 FTM0.00017268679
0xdeb0a5f9dbcf3bea5c1568ce05ca6930c09034f79314e3e562adc3d802247253Allocate Seignio...488249452022-10-10 1:15:5153 days 7 hrs ago0xe2e23c12e3f15471c4e5f4c4e1b87cf6672e5ca5 IN  0xe069f042151fd2b4cd67673585a8648e5855af100 FTM0.00017268679
0xbde2655c97afe15ca9cf535a0973a18986f4a869368ef7edc9c86f5e955844d2Allocate Seignio...488249422022-10-10 1:15:4653 days 7 hrs ago0xe2e23c12e3f15471c4e5f4c4e1b87cf6672e5ca5 IN  0xe069f042151fd2b4cd67673585a8648e5855af100 FTM0.00017268679
0xedcb2992b127bd52026ce419a278315c31498b671112f1b5a50fb7e4db67af34Allocate Seignio...488249072022-10-10 1:14:5753 days 7 hrs ago0xe2e23c12e3f15471c4e5f4c4e1b87cf6672e5ca5 IN  0xe069f042151fd2b4cd67673585a8648e5855af100 FTM0.00017268679
0x75b29bf823529829dd02d11d7cd4c8556e5f2e0e18c9ea81fc020e4c19b59774Allocate Seignio...488247982022-10-10 1:13:0553 days 7 hrs ago0xe2e23c12e3f15471c4e5f4c4e1b87cf6672e5ca5 IN  0xe069f042151fd2b4cd67673585a8648e5855af100 FTM0.000337484779
0x0edacd5bc7b4e9de6dd0e6a01af482288e0b737fda8093ecd3fd95894373d5f0Allocate Seignio...488247962022-10-10 1:13:0353 days 7 hrs ago0xe2e23c12e3f15471c4e5f4c4e1b87cf6672e5ca5 IN  0xe069f042151fd2b4cd67673585a8648e5855af100 FTM0.000337484779
0xb0f6bb912387ad2bb3591af89050b8cb51608df55c67ed9a055ee8636c80236cAllocate Seignio...488230712022-10-10 0:40:0653 days 8 hrs ago0xe2e23c12e3f15471c4e5f4c4e1b87cf6672e5ca5 IN  0xe069f042151fd2b4cd67673585a8648e5855af100 FTM0.000176582761
0x33bd68b8dc3658aa2ce7c8eb7d6af9abbdaa02d6e7aa57252b39b1f0f962284bAllocate Seignio...488230332022-10-10 0:39:2553 days 8 hrs ago0xe2e23c12e3f15471c4e5f4c4e1b87cf6672e5ca5 IN  0xe069f042151fd2b4cd67673585a8648e5855af100 FTM0.000176582761
0xe0b6bda35d2f4d16bba7e3335e5a3524ff4e4f7541d44f1433bcbecde10ed8a1Allocate Seignio...488229182022-10-10 0:37:2353 days 8 hrs ago0xe2e23c12e3f15471c4e5f4c4e1b87cf6672e5ca5 IN  0xe069f042151fd2b4cd67673585a8648e5855af100 FTM0.000219695987
0xb208bfd834793e34a40e354821fe11475d662bbfa173a3c606c4656e6b23431aAllocate Seignio...488228322022-10-10 0:35:5953 days 8 hrs ago0xd5ad7b4b3a5478f390254e26f70a3d8b169f9075 IN  0xe069f042151fd2b4cd67673585a8648e5855af100 FTM0.000482808
0x28a8ddf84e2300a6e70be737bb7e7dfd82648ddac5139d0ffe47b50fde08ccc6Allocate Seignio...488228272022-10-10 0:35:5453 days 8 hrs ago0xd5ad7b4b3a5478f390254e26f70a3d8b169f9075 IN  0xe069f042151fd2b4cd67673585a8648e5855af100 FTM0.000142428
0x076c916349c21daf7fa77fbeb6b5fc1f6a4325ab24c28460296f017d4fcd4ad9Allocate Seignio...488228232022-10-10 0:35:5053 days 8 hrs ago0xd5ad7b4b3a5478f390254e26f70a3d8b169f9075 IN  0xe069f042151fd2b4cd67673585a8648e5855af100 FTM0.000482808
0xcfee64bffde803b3a0d1e50eb69e726fc2af55f8471c97b8d99fb0de461fd8e4Allocate Seignio...488227032022-10-10 0:33:3753 days 8 hrs ago0xd5ad7b4b3a5478f390254e26f70a3d8b169f9075 IN  0xe069f042151fd2b4cd67673585a8648e5855af100 FTM0.000482808
0x0f1bdf1352d56efba55d60a1a347300997c0eaa9c39af2da85cef26fe9b106b7Allocate Seignio...488226672022-10-10 0:32:3653 days 8 hrs ago0xd5ad7b4b3a5478f390254e26f70a3d8b169f9075 IN  0xe069f042151fd2b4cd67673585a8648e5855af100 FTM0.000705789
0xffb9ee224475454af595bde71a1a55144991b5831f7a87ed26745343402b7eebBuy Bonds485553232022-10-06 13:35:2156 days 19 hrs ago0x4325c590dd27437f08aced052608fc3db9b50cd5 IN  0xe069f042151fd2b4cd67673585a8648e5855af100 FTM0.000533061
0x166b2e82939c2f0f207e0a624ef6599f895f79e617570550dc98c809e3d32ebcBuy Bonds485535882022-10-06 13:04:1256 days 19 hrs ago0xc789e3456223918db57f83df274a50f19161c4e8 IN  0xe069f042151fd2b4cd67673585a8648e5855af100 FTM0.0229009
0xaad1124bd3f84b52b36b83f13c71818ec0c9673b476f6b0d8382288ff224c96cAllocate Seignio...483143222022-10-03 11:03:4559 days 21 hrs ago0xd5ad7b4b3a5478f390254e26f70a3d8b169f9075 IN  0xe069f042151fd2b4cd67673585a8648e5855af100 FTM0.000524916
0xfbcaffbb1b7747f9d4ab187d5881c9ba1cec50849efef72c3633470393c8273eAllocate Seignio...483142552022-10-03 11:02:2859 days 21 hrs ago0xd5ad7b4b3a5478f390254e26f70a3d8b169f9075 IN  0xe069f042151fd2b4cd67673585a8648e5855af100 FTM0.000524916
0x50202fb8eea584efc09fbbbbd0202dbdf92031a5ddca12a27d033d7a7b6f6056Allocate Seignio...483142132022-10-03 11:01:4459 days 22 hrs ago0xd5ad7b4b3a5478f390254e26f70a3d8b169f9075 IN  0xe069f042151fd2b4cd67673585a8648e5855af100 FTM0.000524916
0x6e3a4e5720821d01768646f0f2ee75d6406bcadd7158d4aa546566fde3dddb1aAllocate Seignio...483140742022-10-03 10:59:1059 days 22 hrs ago0xd5ad7b4b3a5478f390254e26f70a3d8b169f9075 IN  0xe069f042151fd2b4cd67673585a8648e5855af100 FTM0.000524916
0xc8e324b1468f9bc326d7177ecbcaac92956ff40e0e2e2094e2050ee243570b5fAllocate Seignio...483139682022-10-03 10:57:2059 days 22 hrs ago0xd5ad7b4b3a5478f390254e26f70a3d8b169f9075 IN  0xe069f042151fd2b4cd67673585a8648e5855af100 FTM0.000524916
[ Download CSV Export 
Latest 1 internal transaction
Parent Txn Hash Block From To Value
0x5c7c4131dfc0f8aecabf6445aa88894f8330bf662d585973e87c3a9da1356a96289852892022-01-25 7:12:32311 days 1 hr ago 0x45c9105c653afaed63c14ca1b035dd179135c964  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 0x0A43379ABD2D9DE81eC8988f8e79caABEa9B1797

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

interface IBondTreasury {
    function totalVested() external view returns (uint256);
}

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;

    // exclusions from total supply
    address[] public excludedFromTotalSupply;

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

    address public masonry;
    address public bondTreasury;
    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;

    uint256 public bondSupplyExpansionPercent;

    // 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,
        address _genesisPool,
        address _bondTreasury,
        uint256 _startTime
    ) public notInitialized {
        tomb = _tomb;
        tbond = _tbond;
        tshare = _tshare;
        tombOracle = _tombOracle;
        masonry = _masonry;
        bondTreasury = _bondTreasury;
        startTime = _startTime;

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

        // exclude contracts from total supply
        excludedFromTotalSupply.push(_genesisPool);
        excludedFromTotalSupply.push(_bondTreasury);

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

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

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

        bondSupplyExpansionPercent = 500; // maximum 5% emissions per epoch for POL bonds

        premiumThreshold = 110;
        premiumPercent = 7000;

        // First 12 epochs with 5% expansion
        bootstrapEpochs = 12;
        bootstrapSupplyExpansionPercent = 500;

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

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

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

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

    function setBondTreasury(address _bondTreasury) external onlyOperator {
        bondTreasury = _bondTreasury;
    }

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

    function setBondSupplyExpansionPercent(uint256 _bondSupplyExpansionPercent) external onlyOperator {
        bondSupplyExpansionPercent = _bondSupplyExpansionPercent;
    }

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        _updateTombPrice();

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

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

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

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

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

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

    function _sendToBondTreasury(uint256 _amount) internal {
        uint256 treasuryBalance = IERC20(tomb).balanceOf(bondTreasury);
        uint256 treasuryVested = IBondTreasury(bondTreasury).totalVested();
        if (treasuryVested >= treasuryBalance) return;
        uint256 unspent = treasuryBalance.sub(treasuryVested);
        if (_amount > unspent) {
            IBasisAsset(tomb).mint(bondTreasury, _amount.sub(unspent));
        }
    }

    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);
        _sendToBondTreasury(tombSupply.mul(bondSupplyExpansionPercent).div(10000));
        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":"bondSupplyExpansionPercent","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"bondTreasury","outputs":[{"internalType":"address","name":"","type":"address"}],"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":"address","name":"_genesisPool","type":"address"},{"internalType":"address","name":"_bondTreasury","type":"address"},{"internalType":"uint256","name":"_startTime","type":"uint256"}],"name":"initialize","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"initialized","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"isInitialized","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"masonry","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"masonryAllocateSeigniorage","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"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":"_bondSupplyExpansionPercent","type":"uint256"}],"name":"setBondSupplyExpansionPercent","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_bondTreasury","type":"address"}],"name":"setBondTreasury","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"}]

60806040526001805460ff60a01b191690556000600381905560045534801561002757600080fd5b50614a63806100376000396000f3fe608060405234801561001057600080fd5b50600436106104545760003560e01c806382cad83811610241578063b981cdf31161013b578063d4b14944116100c3578063ee6822a711610087578063ee6822a714610a31578063f14698de14610a39578063f245245a14610a41578063f774110314610a5e578063fcb6f00814610a6657610454565b8063d4b14944146109cd578063d5d3b26c146109f3578063d98f249514610a19578063da3ed41914610a21578063e90b245414610a2957610454565b8063c5967c261161010a578063c5967c2614610990578063c5cc772d14610998578063c8412d02146109a0578063c8f987f3146109a8578063cecce38e146109b057610454565b8063b981cdf314610929578063bcc81f1914610931578063be266d541461096b578063c040f23a1461098857610454565b8063951357d4116101c9578063a204452b1161018d578063a204452b146108ce578063b3406cfc146108eb578063b3ab15fb146108f3578063b4d1d79514610919578063b8a878f91461092157610454565b8063951357d41461083957806398b762a11461086f578063998200251461088c5780639ab4f775146108a9578063a0487eea146108b157610454565b80638c664db6116102105780638c664db6146107c35780638d934f74146107e0578063900cf0cf146107e857806391bbfed5146107f0578063940e60641461081357610454565b806382cad83814610739578063874106cc14610756578063883019111461075e5780638a6426e7146107bb57610454565b806340af7ba51161035257806359bf5d39116102da57806372c054f91161029e57806372c054f9146106d8578063734f7096146106e057806375be5ae11461070357806378e979251461072957806381d11eaf1461073157610454565b806359bf5d39146106925780635a0fc79c1461069a5780635b756179146106a257806362ac58e4146106aa57806363f96cf4146106d057610454565b806354575af41161032157806354575af41461060c57806354f04a111461064257806355ebdeef14610665578063570ca7351461066d578063591663e11461067557610454565b806340af7ba5146105a65780634294cf8e146105c35780634390d2a8146105cb578063499f3f19146105ef57610454565b8063154ec2db116103e05780632e9c7b65116103a45780632e9c7b6514610569578063349aa30a14610571578063392e53cd146105795780633ed9ae25146105815780634013a08e1461059e57610454565b8063154ec2db14610518578063158ef93e1461053557806319a983491461055157806322f832cd1461055957806329ef19191461056157610454565b80630b5bcec7116104275780630b5bcec7146104c05780630cac939c146104dd5780630cf60175146104e55780630db7eb0b146104ed578063118ebbf9146104f557610454565b806303be7e761461045957806304e5c7b11461047357806309bb4f92146104925780630a79c9511461049a575b600080fd5b610461610a6e565b60408051918252519081900360200190f35b6104906004803603602081101561048957600080fd5b5035610a74565b005b610461610b43565b610490600480360360208110156104b057600080fd5b50356001600160a01b0316610c1e565b610490600480360360208110156104d657600080fd5b5035610c89565b610461610d25565b610461610e33565b610461610ede565b6104906004803603604081101561050b57600080fd5b5080359060200135610f80565b6104906004803603602081101561052e57600080fd5b50356115dd565b61053d611682565b604080519115158252519081900360200190f35b610461611692565b610461611698565b61046161169e565b6104616116a4565b6104616116aa565b61053d6116b0565b6104906004803603602081101561059757600080fd5b50356116c0565b61046161177a565b610490600480360360208110156105bc57600080fd5b5035611780565b610461611825565b6105d361182b565b604080516001600160a01b039092168252519081900360200190f35b6104906004803603602081101561060557600080fd5b503561183a565b6104906004803603606081101561062257600080fd5b506001600160a01b038135811691602081013591604090910135166118d7565b6104906004803603604081101561065857600080fd5b5080359060200135611a1c565b61046161215b565b6105d3612161565b6104906004803603602081101561068b57600080fd5b5035612170565b610461612212565b610461612218565b61049061221e565b610490600480360360208110156106c057600080fd5b50356001600160a01b03166128f3565b6105d36129a5565b6104616129b4565b610490600480360360408110156106f657600080fd5b5080359060200135612a74565b6104906004803603602081101561071957600080fd5b50356001600160a01b0316612b2d565b610461612b98565b610461612b9e565b6105d36004803603602081101561074f57600080fd5b5035612ba4565b610461612bcb565b610490600480360361010081101561077557600080fd5b506001600160a01b038135811691602081013582169160408201358116916060810135821691608082013581169160a081013582169160c0820135169060e00135612bd1565b610461612f37565b610490600480360360208110156107d957600080fd5b5035613077565b6105d3613119565b610461613128565b6104906004803603604081101561080657600080fd5b508035906020013561312e565b61053d6004803603604081101561082957600080fd5b5060ff8135169060200135613226565b6104906004803603606081101561084f57600080fd5b506001600160a01b03813581169160208101359160409091013516613342565b6104906004803603602081101561088557600080fd5b5035613405565b610461600480360360208110156108a257600080fd5b5035613453565b6105d3613471565b610461600480360360208110156108c757600080fd5b5035613480565b610490600480360360208110156108e457600080fd5b503561348d565b6104616134db565b6104906004803603602081101561090957600080fd5b50356001600160a01b03166134e1565b61046161354c565b610461613552565b6105d3613558565b6104906004803603608081101561094757600080fd5b506001600160a01b0381358116916020810135916040820135169060600135613567565b6104906004803603602081101561098157600080fd5b50356136fc565b6105d3613792565b6104616137a1565b6104616137cb565b61046161382d565b610461613833565b610490600480360360208110156109c657600080fd5b5035613839565b61053d600480360360408110156109e357600080fd5b5060ff81351690602001356138da565b61049060048036036020811015610a0957600080fd5b50356001600160a01b03166139d4565b610461613a3f565b610461613a45565b610461613a4b565b6105d3613a51565b610461613a60565b61049060048036036020811015610a5757600080fd5b5035613a66565b6105d3613ab4565b610461613ac3565b60235481565b6001546001600160a01b03163314610abd5760405162461bcd60e51b81526004018080602001828103825260248152602001806148fa6024913960400191505060405180910390fd5b600d54811015610afe5760405162461bcd60e51b815260040180806020018281038252602a815260200180614732602a913960400191505060405180910390fd5b6096811115610b3e5760405162461bcd60e51b81526004018080602001828103825260248152602001806147c06024913960400191505060405180910390fd5b601d55565b600b5460065460408051633ddac95360e01b81526001600160a01b039283166004820152670de0b6b3a7640000602482015290516000939290921691633ddac95391604480820192602092909190829003018186803b158015610ba557600080fd5b505afa925050508015610bca57506040513d6020811015610bc557600080fd5b505160015b610c055760405162461bcd60e51b815260040180806020018281038252603681526020018061478a6036913960400191505060405180910390fd5b71ffffffffffffffffffffffffffffffffffff16905090565b6001546001600160a01b03163314610c675760405162461bcd60e51b81526004018080602001828103825260248152602001806148fa6024913960400191505060405180910390fd5b600a80546001600160a01b0319166001600160a01b0392909216919091179055565b6001546001600160a01b03163314610cd25760405162461bcd60e51b81526004018080602001828103825260248152602001806148fa6024913960400191505060405180910390fd5b600a8110158015610ce557506103e88111155b610d205760405162461bcd60e51b81526004018080602001828103825260288152602001806148a96028913960400191505060405180910390fd5b601155565b600080610d30610b43565b9050600c548111610e2f576000610d45612f37565b90506000610d6a612710610d6460155485613ac990919063ffffffff16565b90613b29565b90506000600760009054906101000a90046001600160a01b03166001600160a01b03166318160ddd6040518163ffffffff1660e01b815260040160206040518083038186803b158015610dbc57600080fd5b505afa158015610dd0573d6000803e3d6000fd5b505050506040513d6020811015610de657600080fd5b5051905080821115610e2b576000610dfe8383613b90565b90506000610e18670de0b6b3a7640000610d648489613ac9565b9050610e2660045482613bed565b965050505b5050505b5090565b600080610e3e610b43565b9050600c548111610e2f57601c54610e5a57600c549150610e2f565b6000610e7d82610d64670de0b6b3a7640000600c54613ac990919063ffffffff16565b90506000610ea8612710610d64601c54610ea2600c5487613b9090919063ffffffff16565b90613ac9565b600c54909150610eb89082613c03565b93506000601a54118015610ecd5750601a5484115b15610ed857601a5493505b50505090565b600080610ee9610b43565b9050600d54811115610e2f576000610f136064610d64601d54600c54613ac990919063ffffffff16565b9050808210610f75576000610f3f612710610d64601e54610ea2600c5488613b9090919063ffffffff16565b600c54909150610f4f9082613c03565b93506000601b54118015610f645750601b5484115b15610f6f57601b5493505b50610f7b565b600c5492505b505090565b610f88613c5d565b15610fc45760405162461bcd60e51b81526004018080602001828103825260268152602001806149486026913960400191505060405180910390fd5b610fcc613c7c565b156110085760405162461bcd60e51b81526004018080602001828103825260268152602001806149486026913960400191505060405180910390fd5b60025442101561105b576040805162461bcd60e51b8152602060048201526019602482015278151c99585cdd5c9e4e881b9bdd081cdd185c9d1959081e595d603a1b604482015290519081900360640190fd5b6006546040805163570ca73560e01b8152905130926001600160a01b03169163570ca735916004808301926020929190829003018186803b15801561109f57600080fd5b505afa1580156110b3573d6000803e3d6000fd5b505050506040513d60208110156110c957600080fd5b50516001600160a01b031614801561115757506007546040805163570ca73560e01b8152905130926001600160a01b03169163570ca735916004808301926020929190829003018186803b15801561112057600080fd5b505afa158015611134573d6000803e3d6000fd5b505050506040513d602081101561114a57600080fd5b50516001600160a01b0316145b80156111d957506008546040805163570ca73560e01b8152905130926001600160a01b03169163570ca735916004808301926020929190829003018186803b1580156111a257600080fd5b505afa1580156111b6573d6000803e3d6000fd5b505050506040513d60208110156111cc57600080fd5b50516001600160a01b0316145b801561125b57506009546040805163570ca73560e01b8152905130926001600160a01b03169163570ca735916004808301926020929190829003018186803b15801561122457600080fd5b505afa158015611238573d6000803e3d6000fd5b505050506040513d602081101561124e57600080fd5b50516001600160a01b0316145b6112ac576040805162461bcd60e51b815260206004820152601e60248201527f54726561737572793a206e656564206d6f7265207065726d697373696f6e0000604482015290519081900360640190fd5b600082116112eb5760405162461bcd60e51b815260040180806020018281038252602e81526020018061475c602e913960400191505060405180910390fd5b60006112f5610b43565b905081811461134b576040805162461bcd60e51b815260206004820152601a60248201527f54726561737572793a20544f4d42207072696365206d6f766564000000000000604482015290519081900360640190fd5b600d54811161138b5760405162461bcd60e51b81526004018080602001828103825260328152602001806149a46032913960400191505060405180910390fd5b6000611395610ede565b9050600081116113ec576040805162461bcd60e51b815260206004820152601b60248201527f54726561737572793a20696e76616c696420626f6e6420726174650000000000604482015290519081900360640190fd5b6000611404670de0b6b3a7640000610d648785613ac9565b600654604080516370a0823160e01b8152306004820152905192935083926001600160a01b03909216916370a0823191602480820192602092909190829003018186803b15801561145457600080fd5b505afa158015611468573d6000803e3d6000fd5b505050506040513d602081101561147e57600080fd5b505110156114bd5760405162461bcd60e51b815260040180806020018281038252602581526020018061480a6025913960400191505060405180910390fd5b6114d56114cc600e5483613bed565b600e5490613b90565b600e556007546040805163079cc67960e41b81523360048201526024810188905290516001600160a01b03909216916379cc67909160448082019260009290919082900301818387803b15801561152b57600080fd5b505af115801561153f573d6000803e3d6000fd5b505060065461155b92506001600160a01b031690503383613c9b565b611563613ced565b6040805182815260208101879052815133927f51e0d16595cabc591e64da08e45bb223577e5b9a39cd947b4ddc3472b2dd8878928290030190a25050436000908152602081815260408083203284529091528082208054600160ff1991821681179092553384529190922080549091169091179055505050565b6001546001600160a01b031633146116265760405162461bcd60e51b81526004018080602001828103825260248152602001806148fa6024913960400191505060405180910390fd5b614e2081111561167d576040805162461bcd60e51b815260206004820152601d60248201527f5f646973636f756e7450657263656e74206973206f7665722032303025000000604482015290519081900360640190fd5b601c55565b600154600160a01b900460ff1681565b600d5481565b60135481565b601c5481565b601b5481565b60165481565b600154600160a01b900460ff1690565b6001546001600160a01b031633146117095760405162461bcd60e51b81526004018080602001828103825260248152602001806148fa6024913960400191505060405180910390fd5b600c54811015801561173557506117316064610d646078600c54613ac990919063ffffffff16565b8111155b611775576040805162461bcd60e51b815260206004820152600c60248201526b6f7574206f662072616e676560a01b604482015290519081900360640190fd5b600d55565b601f5481565b6001546001600160a01b031633146117c95760405162461bcd60e51b81526004018080602001828103825260248152602001806148fa6024913960400191505060405180910390fd5b614e20811115611820576040805162461bcd60e51b815260206004820152601c60248201527f5f7072656d69756d50657263656e74206973206f766572203230302500000000604482015290519081900360640190fd5b601e55565b600c5481565b6022546001600160a01b031681565b6001546001600160a01b031633146118835760405162461bcd60e51b81526004018080602001828103825260248152602001806148fa6024913960400191505060405180910390fd5b61271081101580156118975750614e208111155b6118d25760405162461bcd60e51b81526004018080602001828103825260298152602001806148806029913960400191505060405180910390fd5b601f55565b6001546001600160a01b031633146119205760405162461bcd60e51b81526004018080602001828103825260248152602001806148fa6024913960400191505060405180910390fd5b6006546001600160a01b038481169116141561196c576040805162461bcd60e51b815260206004808301919091526024820152633a37b6b160e11b604482015290519081900360640190fd5b6007546001600160a01b03848116911614156119b8576040805162461bcd60e51b81526020600480830191909152602482015263189bdb9960e21b604482015290519081900360640190fd5b6008546001600160a01b0384811691161415611a03576040805162461bcd60e51b8152602060048201526005602482015264736861726560d81b604482015290519081900360640190fd5b611a176001600160a01b0384168284613c9b565b505050565b611a24613c5d565b15611a605760405162461bcd60e51b81526004018080602001828103825260268152602001806149486026913960400191505060405180910390fd5b611a68613c7c565b15611aa45760405162461bcd60e51b81526004018080602001828103825260268152602001806149486026913960400191505060405180910390fd5b600254421015611af7576040805162461bcd60e51b8152602060048201526019602482015278151c99585cdd5c9e4e881b9bdd081cdd185c9d1959081e595d603a1b604482015290519081900360640190fd5b6006546040805163570ca73560e01b8152905130926001600160a01b03169163570ca735916004808301926020929190829003018186803b158015611b3b57600080fd5b505afa158015611b4f573d6000803e3d6000fd5b505050506040513d6020811015611b6557600080fd5b50516001600160a01b0316148015611bf357506007546040805163570ca73560e01b8152905130926001600160a01b03169163570ca735916004808301926020929190829003018186803b158015611bbc57600080fd5b505afa158015611bd0573d6000803e3d6000fd5b505050506040513d6020811015611be657600080fd5b50516001600160a01b0316145b8015611c7557506008546040805163570ca73560e01b8152905130926001600160a01b03169163570ca735916004808301926020929190829003018186803b158015611c3e57600080fd5b505afa158015611c52573d6000803e3d6000fd5b505050506040513d6020811015611c6857600080fd5b50516001600160a01b0316145b8015611cf757506009546040805163570ca73560e01b8152905130926001600160a01b03169163570ca735916004808301926020929190829003018186803b158015611cc057600080fd5b505afa158015611cd4573d6000803e3d6000fd5b505050506040513d6020811015611cea57600080fd5b50516001600160a01b0316145b611d48576040805162461bcd60e51b815260206004820152601e60248201527f54726561737572793a206e656564206d6f7265207065726d697373696f6e0000604482015290519081900360640190fd5b60008211611d875760405162461bcd60e51b81526004018080602001828103825260308152602001806148506030913960400191505060405180910390fd5b6000611d91610b43565b9050818114611de7576040805162461bcd60e51b815260206004820152601a60248201527f54726561737572793a20544f4d42207072696365206d6f766564000000000000604482015290519081900360640190fd5b600c548110611e275760405162461bcd60e51b81526004018080602001828103825260328152602001806149a46032913960400191505060405180910390fd5b600454831115611e685760405162461bcd60e51b815260040180806020018281038252602a8152602001806149d6602a913960400191505060405180910390fd5b6000611e72610e33565b905060008111611ec9576040805162461bcd60e51b815260206004820152601b60248201527f54726561737572793a20696e76616c696420626f6e6420726174650000000000604482015290519081900360640190fd5b6000611ee1670de0b6b3a7640000610d648785613ac9565b90506000611eed612f37565b90506000611f7583600760009054906101000a90046001600160a01b03166001600160a01b03166318160ddd6040518163ffffffff1660e01b815260040160206040518083038186803b158015611f4357600080fd5b505afa158015611f57573d6000803e3d6000fd5b505050506040513d6020811015611f6d57600080fd5b505190613c03565b9050611f92612710610d6460155485613ac990919063ffffffff16565b811115611fdc576040805162461bcd60e51b81526020600482015260136024820152726f766572206d6178206465627420726174696f60681b604482015290519081900360640190fd5b6006546040805163079cc67960e41b8152336004820152602481018a905290516001600160a01b03909216916379cc67909160448082019260009290919082900301818387803b15801561202f57600080fd5b505af1158015612043573d6000803e3d6000fd5b5050600754604080516340c10f1960e01b81523360048201526024810188905290516001600160a01b0390921693506340c10f1992506044808201926020929091908290030181600087803b15801561209b57600080fd5b505af11580156120af573d6000803e3d6000fd5b505050506040513d60208110156120c557600080fd5b50506004546120d49088613b90565b6004556120df613ced565b6040805188815260208101859052815133927f73017f1b70789e2e66759eeb3c7ec11f59e6eedb55d921cfaec5410dd42a4799928290030190a25050436000908152602081815260408083203284529091528082208054600160ff19918216811790925533845291909220805490911690911790555050505050565b60215481565b6001546001600160a01b031681565b6001546001600160a01b031633146121b95760405162461bcd60e51b81526004018080602001828103825260248152602001806148fa6024913960400191505060405180910390fd5b6103e881101580156121cd57506127108111155b61220d576040805162461bcd60e51b815260206004820152600c60248201526b6f7574206f662072616e676560a01b604482015290519081900360640190fd5b601555565b600e5490565b600e5481565b612226613c5d565b156122625760405162461bcd60e51b81526004018080602001828103825260268152602001806149486026913960400191505060405180910390fd5b61226a613c7c565b156122a65760405162461bcd60e51b81526004018080602001828103825260268152602001806149486026913960400191505060405180910390fd5b6002544210156122f9576040805162461bcd60e51b8152602060048201526019602482015278151c99585cdd5c9e4e881b9bdd081cdd185c9d1959081e595d603a1b604482015290519081900360640190fd5b6123016137a1565b421015612355576040805162461bcd60e51b815260206004820152601860248201527f54726561737572793a206e6f74206f70656e6564207965740000000000000000604482015290519081900360640190fd5b6006546040805163570ca73560e01b8152905130926001600160a01b03169163570ca735916004808301926020929190829003018186803b15801561239957600080fd5b505afa1580156123ad573d6000803e3d6000fd5b505050506040513d60208110156123c357600080fd5b50516001600160a01b031614801561245157506007546040805163570ca73560e01b8152905130926001600160a01b03169163570ca735916004808301926020929190829003018186803b15801561241a57600080fd5b505afa15801561242e573d6000803e3d6000fd5b505050506040513d602081101561244457600080fd5b50516001600160a01b0316145b80156124d357506008546040805163570ca73560e01b8152905130926001600160a01b03169163570ca735916004808301926020929190829003018186803b15801561249c57600080fd5b505afa1580156124b0573d6000803e3d6000fd5b505050506040513d60208110156124c657600080fd5b50516001600160a01b0316145b801561255557506009546040805163570ca73560e01b8152905130926001600160a01b03169163570ca735916004808301926020929190829003018186803b15801561251e57600080fd5b505afa158015612532573d6000803e3d6000fd5b505050506040513d602081101561254857600080fd5b50516001600160a01b0316145b6125a6576040805162461bcd60e51b815260206004820152601e60248201527f54726561737572793a206e656564206d6f7265207065726d697373696f6e0000604482015290519081900360640190fd5b6125ae613ced565b6125b6610b43565b601955600e546000906125d1906125cb612f37565b90613b90565b90506125f66125f1612710610d6460165485613ac990919063ffffffff16565b613d51565b601754600354101561262a57612625612620612710610d6460185485613ac990919063ffffffff16565b613f07565b612877565b600d54601954111561287757600754604080516318160ddd60e01b815290516000926001600160a01b0316916318160ddd916004808301926020929190829003018186803b15801561267b57600080fd5b505afa15801561268f573d6000803e3d6000fd5b505050506040513d60208110156126a557600080fd5b5051600c546019549192506000916126bc91613b90565b905060008060006126d6655af3107a4000610ea288614247565b9050808411156126e4578093505b6126ff612710610d6460125488613ac990919063ffffffff16565b600e54106127245761271d670de0b6b3a7640000610d648887613ac9565b9150612790565b600061273c670de0b6b3a7640000610d648988613ac9565b9050612759612710610d6460135484613ac990919063ffffffff16565b92506127658184613b90565b601f549094501561278e5761278b612710610d64601f5487613ac990919063ffffffff16565b93505b505b811561279f5761279f82613f07565b821561287157600e546127b29084613c03565b600e55600654604080516340c10f1960e01b81523060048201526024810186905290516001600160a01b03909216916340c10f19916044808201926020929091908290030181600087803b15801561280957600080fd5b505af115801561281d573d6000803e3d6000fd5b505050506040513d602081101561283357600080fd5b5050604080514281526020810185905281517ff705142bf09f04297640495ddf7c59b7fd6f51894c5aea9602d631cf05f0efc2929181900390910190a15b50505050505b50600354612886906001613c03565b600355600d54612894610b43565b116128b2576128ad612710610d64601454610ea2612f37565b6128b5565b60005b600455436000908152602081815260408083203284529091528082208054600160ff1991821681179092553384529190922080549091169091179055565b6001546001600160a01b0316331461293c5760405162461bcd60e51b81526004018080602001828103825260248152602001806148fa6024913960400191505060405180910390fd5b6009546040805163b3ab15fb60e01b81526001600160a01b0384811660048301529151919092169163b3ab15fb91602480830192600092919082900301818387803b15801561298a57600080fd5b505af115801561299e573d6000803e3d6000fd5b5050505050565b6009546001600160a01b031681565b6000806129bf610b43565b9050600d54811115610e2f57600654604080516370a0823160e01b815230600482015290516000926001600160a01b0316916370a08231916024808301926020929190829003018186803b158015612a1657600080fd5b505afa158015612a2a573d6000803e3d6000fd5b505050506040513d6020811015612a4057600080fd5b505190506000612a4e610ede565b90508015610ed857612a6c81610d6484670de0b6b3a7640000613ac9565b935050505090565b6001546001600160a01b03163314612abd5760405162461bcd60e51b81526004018080602001828103825260248152602001806148fa6024913960400191505060405180910390fd5b60095460408051632ffaaa0960e01b8152600481018590526024810184905290516001600160a01b0390921691632ffaaa099160448082019260009290919082900301818387803b158015612b1157600080fd5b505af1158015612b25573d6000803e3d6000fd5b505050505050565b6001546001600160a01b03163314612b765760405162461bcd60e51b81526004018080602001828103825260248152602001806148fa6024913960400191505060405180910390fd5b600b80546001600160a01b0319166001600160a01b0392909216919091179055565b60025481565b60125481565b60058181548110612bb157fe5b6000918252602090912001546001600160a01b0316905081565b60185481565b600154600160a01b900460ff1615612c30576040805162461bcd60e51b815260206004820152601d60248201527f54726561737572793a20616c726561647920696e697469616c697a6564000000604482015290519081900360640190fd5b600680546001600160a01b03199081166001600160a01b038b8116919091179092556007805482168a8416179055600880548216898416179055600b80548216888416179055600980548216878416179055600a80549091169184169190911790556002819055670de0b6b3a7640000600c819055612cb790606490610d64906065613ac9565b600d55600580546001818101835560008381527f036b6384b5eca791c62761152d0c79bb0604c104a5fb6f4eb0703f3154bb3db092830180546001600160a01b03808a166001600160a01b0319928316179092558554938401909555919092018054918616919093161790915560408051610120810182529182526969e10de76676d0800000602083015269d3c21bcecceda1000000908201526a013da329b633647180000060608201526a01a784379d99db4200000060808201526a0422ca8b0a00a42500000060a08201526a084595161401484a00000060c08201526a108b2a2c2802909400000060e08201526a295be96e64066972000000610100820152612dc690600f906009614685565b5060408051610120810182526101c28152610190602082015261015e9181019190915261012c606082015260fa608082015260c860a0820152609660c0820152607d60e08201526064610100820152612e239060109060096146db565b50610190601155612710601255610dac601381905561012c6014556015556101f46016819055606e601d55611b58601e55600c601755601855600654604080516370a0823160e01b815230600482015290516001600160a01b03909216916370a0823191602480820192602092909190829003018186803b158015612ea757600080fd5b505afa158015612ebb573d6000803e3d6000fd5b505050506040513d6020811015612ed157600080fd5b5051600e55600180546001600160a01b031960ff60a01b19909116600160a01b1716339081179091556040805143815290517f25ff68dd81b34665b5ba7e553ee5511bf6812e12adb4a7e2c0d9e26b3099ce799181900360200190a25050505050505050565b600654604080516318160ddd60e01b815290516000926001600160a01b031691839183916318160ddd916004808301926020929190829003018186803b158015612f8057600080fd5b505afa158015612f94573d6000803e3d6000fd5b505050506040513d6020811015612faa57600080fd5b505190506000805b60055460ff8216101561306c57613062846001600160a01b03166370a0823160058460ff1681548110612fe157fe5b60009182526020918290200154604080516001600160e01b031960e086901b1681526001600160a01b0390921660048301525160248083019392829003018186803b15801561302f57600080fd5b505afa158015613043573d6000803e3d6000fd5b505050506040513d602081101561305957600080fd5b50518390613c03565b9150600101612fb2565b50612a6c8282613b90565b6001546001600160a01b031633146130c05760405162461bcd60e51b81526004018080602001828103825260248152602001806148fa6024913960400191505060405180910390fd5b6101f481101580156130d457506127108111155b613114576040805162461bcd60e51b815260206004820152600c60248201526b6f7574206f662072616e676560a01b604482015290519081900360640190fd5b601255565b6020546001600160a01b031681565b60035481565b6001546001600160a01b031633146131775760405162461bcd60e51b81526004018080602001828103825260248152602001806148fa6024913960400191505060405180910390fd5b60788211156131cd576040805162461bcd60e51b815260206004820152601e60248201527f5f626f6f74737472617045706f6368733a206f7574206f662072616e67650000604482015290519081900360640190fd5b606481101580156131e057506103e88111155b61321b5760405162461bcd60e51b815260040180806020018281038252602e815260200180614a00602e913960400191505060405180910390fd5b601791909155601855565b6001546000906001600160a01b031633146132725760405162461bcd60e51b81526004018080602001828103825260248152602001806148fa6024913960400191505060405180910390fd5b60098360ff16106132b45760405162461bcd60e51b81526004018080602001828103825260298152602001806148d16029913960400191505060405180910390fd5b60ff8316156132e657600f6001840360ff16815481106132d057fe5b906000526020600020015482116132e657600080fd5b60088360ff16101561331b57600f8360010160ff168154811061330557fe5b9060005260206000200154821061331b57600080fd5b81600f8460ff168154811061332c57fe5b6000918252602090912001555060015b92915050565b6001546001600160a01b0316331461338b5760405162461bcd60e51b81526004018080602001828103825260248152602001806148fa6024913960400191505060405180910390fd5b60095460408051631515d6bd60e21b81526001600160a01b038681166004830152602482018690528481166044830152915191909216916354575af491606480830192600092919082900301818387803b1580156133e857600080fd5b505af11580156133fc573d6000803e3d6000fd5b50505050505050565b6001546001600160a01b0316331461344e5760405162461bcd60e51b81526004018080602001828103825260248152602001806148fa6024913960400191505060405180910390fd5b601a55565b600f818154811061346057fe5b600091825260209091200154905081565b600a546001600160a01b031681565b6010818154811061346057fe5b6001546001600160a01b031633146134d65760405162461bcd60e51b81526004018080602001828103825260248152602001806148fa6024913960400191505060405180910390fd5b601b55565b60195481565b6001546001600160a01b0316331461352a5760405162461bcd60e51b81526004018080602001828103825260248152602001806148fa6024913960400191505060405180910390fd5b600180546001600160a01b0319166001600160a01b0392909216919091179055565b61546081565b601a5481565b6007546001600160a01b031681565b6001546001600160a01b031633146135b05760405162461bcd60e51b81526004018080602001828103825260248152602001806148fa6024913960400191505060405180910390fd5b6001600160a01b0384166135f4576040805162461bcd60e51b815260206004808301919091526024820152637a65726f60e01b604482015290519081900360640190fd5b610bb883111561363a576040805162461bcd60e51b815260206004820152600c60248201526b6f7574206f662072616e676560a01b604482015290519081900360640190fd5b6001600160a01b03821661367e576040805162461bcd60e51b815260206004808301919091526024820152637a65726f60e01b604482015290519081900360640190fd5b6103e88111156136c4576040805162461bcd60e51b815260206004820152600c60248201526b6f7574206f662072616e676560a01b604482015290519081900360640190fd5b602080546001600160a01b03199081166001600160a01b03968716179091556021939093556022805490931691909316179055602355565b6001546001600160a01b031633146137455760405162461bcd60e51b81526004018080602001828103825260248152602001806148fa6024913960400191505060405180910390fd5b600954604080516397ffe1d760e01b81526004810184905290516001600160a01b03909216916397ffe1d79160248082019260009290919082900301818387803b15801561298a57600080fd5b6006546001600160a01b031681565b60006137c66137bd615460600354613ac990919063ffffffff16565b60025490613c03565b905090565b600b5460065460408051630d01142560e31b81526001600160a01b039283166004820152670de0b6b3a7640000602482015290516000939290921691636808a12891604480820192602092909190829003018186803b158015610ba557600080fd5b601e5481565b601d5481565b6001546001600160a01b031633146138825760405162461bcd60e51b81526004018080602001828103825260248152602001806148fa6024913960400191505060405180910390fd5b6064811015801561389557506105dc8111155b6138d5576040805162461bcd60e51b815260206004820152600c60248201526b6f7574206f662072616e676560a01b604482015290519081900360640190fd5b601455565b6001546000906001600160a01b031633146139265760405162461bcd60e51b81526004018080602001828103825260248152602001806148fa6024913960400191505060405180910390fd5b60098360ff16106139685760405162461bcd60e51b81526004018080602001828103825260298152602001806148d16029913960400191505060405180910390fd5b600a821015801561397b57506103e88211155b6139c3576040805162461bcd60e51b81526020600482015260146024820152735f76616c75653a206f7574206f662072616e676560601b604482015290519081900360640190fd5b8160108460ff168154811061332c57fe5b6001546001600160a01b03163314613a1d5760405162461bcd60e51b81526004018080602001828103825260248152602001806148fa6024913960400191505060405180910390fd5b600980546001600160a01b0319166001600160a01b0392909216919091179055565b60115481565b60155481565b60145481565b6008546001600160a01b031681565b60175481565b6001546001600160a01b03163314613aaf5760405162461bcd60e51b81526004018080602001828103825260248152602001806148fa6024913960400191505060405180910390fd5b601655565b600b546001600160a01b031681565b60045481565b600082613ad85750600061333c565b82820282848281613ae557fe5b0414613b225760405162461bcd60e51b815260040180806020018281038252602181526020018061482f6021913960400191505060405180910390fd5b9392505050565b6000808211613b7f576040805162461bcd60e51b815260206004820152601a60248201527f536166654d6174683a206469766973696f6e206279207a65726f000000000000604482015290519081900360640190fd5b818381613b8857fe5b049392505050565b600082821115613be7576040805162461bcd60e51b815260206004820152601e60248201527f536166654d6174683a207375627472616374696f6e206f766572666c6f770000604482015290519081900360640190fd5b50900390565b6000818310613bfc5781613b22565b5090919050565b600082820183811015613b22576040805162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015290519081900360640190fd5b4360009081526020818152604080832032845290915290205460ff1690565b4360009081526020818152604080832033845290915290205460ff1690565b604080516001600160a01b038416602482015260448082018490528251808303909101815260649091019091526020810180516001600160e01b031663a9059cbb60e01b179052611a179084906142a4565b600b60009054906101000a90046001600160a01b03166001600160a01b031663a2e620456040518163ffffffff1660e01b8152600401600060405180830381600087803b158015613d3d57600080fd5b505af1925050508015613d4e575060015b50565b600654600a54604080516370a0823160e01b81526001600160a01b039283166004820152905160009392909216916370a0823191602480820192602092909190829003018186803b158015613da557600080fd5b505afa158015613db9573d6000803e3d6000fd5b505050506040513d6020811015613dcf57600080fd5b5051600a54604080516306672f1560e21b815290519293506000926001600160a01b039092169163199cbc5491600480820192602092909190829003018186803b158015613e1c57600080fd5b505afa158015613e30573d6000803e3d6000fd5b505050506040513d6020811015613e4657600080fd5b50519050818110613e58575050613d4e565b6000613e648383613b90565b905080841115613f0157600654600a546001600160a01b03918216916340c10f199116613e918785613b90565b6040518363ffffffff1660e01b815260040180836001600160a01b0316815260200182815260200192505050602060405180830381600087803b158015613ed757600080fd5b505af1158015613eeb573d6000803e3d6000fd5b505050506040513d6020811015612b2557600080fd5b50505050565b600654604080516340c10f1960e01b81523060048201526024810184905290516001600160a01b03909216916340c10f19916044808201926020929091908290030181600087803b158015613f5b57600080fd5b505af1158015613f6f573d6000803e3d6000fd5b505050506040513d6020811015613f8557600080fd5b50506021546000901561406d57613fad612710610d6460215485613ac990919063ffffffff16565b600654602080546040805163a9059cbb60e01b81526001600160a01b03928316600482015260248101869052905194955092169263a9059cbb9260448082019392918290030181600087803b15801561400557600080fd5b505af1158015614019573d6000803e3d6000fd5b505050506040513d602081101561402f57600080fd5b5050604080514281526020810183905281517fcb3f34aaa3445b461e6da5492dc89e5c257a59fa598131f3b6bbc97a3638e409929181900390910190a15b6023546000901561415657614093612710610d6460235486613ac990919063ffffffff16565b6006546022546040805163a9059cbb60e01b81526001600160a01b03928316600482015260248101859052905193945091169163a9059cbb916044808201926020929091908290030181600087803b1580156140ee57600080fd5b505af1158015614102573d6000803e3d6000fd5b505050506040513d602081101561411857600080fd5b5050604080514281526020810183905281517fdc8b715b18523e58b7fd0da53259dfa91efd91df4a854d94b136e3333a3b9395929181900390910190a15b614164816125cb8585613b90565b600954600654919450614185916001600160a01b0390811691166000614355565b6009546006546141a2916001600160a01b03918216911685614355565b600954604080516397ffe1d760e01b81526004810186905290516001600160a01b03909216916397ffe1d79160248082019260009290919082900301818387803b1580156141ef57600080fd5b505af1158015614203573d6000803e3d6000fd5b5050604080514281526020810187905281517fa72fa2f263b243b0f0e1fec5f3d49d33de573d15929b6b730c6b8ab3838c1c4d9450908190039091019150a1505050565b600060085b600f8160ff168154811061425c57fe5b906000526020600020015483106142915760108160ff168154811061427d57fe5b60009182526020909120015460115561429a565b6000190161424c565b5050601154919050565b60606142f9826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b03166144689092919063ffffffff16565b805190915015611a175780806020019051602081101561431857600080fd5b5051611a175760405162461bcd60e51b815260040180806020018281038252602a81526020018061491e602a913960400191505060405180910390fd5b8015806143db575060408051636eb1769f60e11b81523060048201526001600160a01b03848116602483015291519185169163dd62ed3e91604480820192602092909190829003018186803b1580156143ad57600080fd5b505afa1580156143c1573d6000803e3d6000fd5b505050506040513d60208110156143d757600080fd5b5051155b6144165760405162461bcd60e51b815260040180806020018281038252603681526020018061496e6036913960400191505060405180910390fd5b604080516001600160a01b038416602482015260448082018490528251808303909101815260649091019091526020810180516001600160e01b031663095ea7b360e01b179052611a179084906142a4565b6060614477848460008561447f565b949350505050565b6060824710156144c05760405162461bcd60e51b81526004018080602001828103825260268152602001806147e46026913960400191505060405180910390fd5b6144c9856145db565b61451a576040805162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e7472616374000000604482015290519081900360640190fd5b60006060866001600160a01b031685876040518082805190602001908083835b602083106145595780518252601f19909201916020918201910161453a565b6001836020036101000a03801982511681845116808217855250505050505090500191505060006040518083038185875af1925050503d80600081146145bb576040519150601f19603f3d011682016040523d82523d6000602084013e6145c0565b606091505b50915091506145d08282866145e1565b979650505050505050565b3b151590565b606083156145f0575081613b22565b8251156146005782518084602001fd5b8160405162461bcd60e51b81526004018080602001828103825283818151815260200191508051906020019080838360005b8381101561464a578181015183820152602001614632565b50505050905090810190601f1680156146775780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b8280548282559060005260206000209081019282156146cf579160200282015b828111156146cf57825182906affffffffffffffffffffff169055916020019190600101906146a5565b50610e2f92915061471c565b8280548282559060005260206000209081019282156146cf579160200282015b828111156146cf578251829061ffff169055916020019190600101906146fb565b5b80821115610e2f576000815560010161471d56fe5f7072656d69756d5468726573686f6c64206578636565647320746f6d6250726963654365696c696e6754726561737572793a2063616e6e6f742072656465656d20626f6e64732077697468207a65726f20616d6f756e7454726561737572793a206661696c656420746f20636f6e73756c7420544f4d422070726963652066726f6d20746865206f7261636c655f7072656d69756d5468726573686f6c6420697320686967686572207468616e20312e35416464726573733a20696e73756666696369656e742062616c616e636520666f722063616c6c54726561737572793a20747265617375727920686173206e6f206d6f726520627564676574536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f7754726561737572793a2063616e6e6f7420707572636861736520626f6e64732077697468207a65726f20616d6f756e745f6d696e74696e67466163746f72466f72506179696e67446562743a206f7574206f662072616e67655f6d6178537570706c79457870616e73696f6e50657263656e743a206f7574206f662072616e6765496e6465782068617320746f206265206c6f776572207468616e20636f756e74206f6620746965727354726561737572793a2063616c6c6572206973206e6f7420746865206f70657261746f725361666545524332303a204552433230206f7065726174696f6e20646964206e6f742073756363656564436f6e747261637447756172643a206f6e6520626c6f636b2c206f6e652066756e6374696f6e5361666545524332303a20617070726f76652066726f6d206e6f6e2d7a65726f20746f206e6f6e2d7a65726f20616c6c6f77616e636554726561737572793a20746f6d625072696365206e6f7420656c696769626c6520666f7220626f6e6420707572636861736554726561737572793a206e6f7420656e6f75676820626f6e64206c65667420746f2070757263686173655f626f6f747374726170537570706c79457870616e73696f6e50657263656e743a206f7574206f662072616e6765a26469706673582212204520c35956a3d2116dea6136aea43055f925769f7cc983ed3af3dc52a2f61e4d64736f6c634300060c0033

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.