Contracts
Get Contract ABI for Verified Contract Source Codes
Returns the contract Application Binary Interface ( ABI ) of a verified smart contract.
Find verified contracts ✅ on our Verified Contracts Source Code page.
https://api.ftmscan.com/api
?module=contract
&action=getabi
&address=0xe8B0643c1330307a6fA81e5e8b09548455aCA538
&apikey=YourApiKeyToken
Try this endpoint in your browser 🔗
Query Parameters
Parameter | Description |
---|---|
address | the |
Sample Response
{
"status":"1",
"message":"OK",
"result":"[{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"MUMMYAmount\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"bondAmount\",\"type\":\"uint256\"}],\"name\":\"BoughmBONDs\",\"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\":\"MUMMYAmount\",\"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\":\"MUMMY\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"MUMMYOracle\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"MUMMYPriceCeiling\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"MUMMYPriceOne\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"PERIOD\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"allocateSeigniorage\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"bondDepletionFloorPercent\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"bootstrapEpochs\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"bootstrapSupplyExpansionPercent\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_MUMMYAmount\",\"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\":\"gemBONDDiscountRate\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"_rate\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"gemBONDPremiumRate\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"_rate\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getBurnableMUMMYLeft\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"_burnableMUMMYLeft\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getMUMMYCirculatingSupply\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getMUMMYPrice\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"MUMMYPrice\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getMUMMYUpdatedPrice\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"_MUMMYPrice\",\"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\":[{\"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\":\"_MUMMY\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"_mBOND\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"_mSHARE\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"_MUMMYOracle\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"_masonry\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"_startTime\",\"type\":\"uint256\"}],\"name\":\"initialize\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"initialized\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"isInitialized\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"mBOND\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"mSHARE\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"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\":\"previousEpochMUMMYPrice\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_bondAmount\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"targetPrice\",\"type\":\"uint256\"}],\"name\":\"redeemBonds\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"seigniorageExpansionFloorPercent\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"seigniorageSaved\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_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\":[],\"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\"}]"
}
A simple sample for retrieving the contractABI using Web3.js and Jquery to interact with a contract.
var Web3 = require('web3');
var web3 = new Web3(new Web3.providers.HttpProvider());
var version = web3.version.api;
$.getJSON('https://api.ftmscan.com/api?module=contract&action=getabi&address=0x0000000000000000000000000000000000001004&apikey=YourApiKeyToken', function (data) {
var contractABI = "";
contractABI = JSON.parse(data.result);
if (contractABI != '') {
var MyContract = web3.eth.contract(contractABI);
var myContractInstance = MyContract.at("0x0000000000000000000000000000000000001004");
var result = myContractInstance.memberId("0xfe8ad7dd2f564a877cc23feea6c0a9cc2e783715");
console.log("result1 : " + result);
var result = myContractInstance.members(1);
console.log("result2 : " + result);
} else {
console.log("Error");
}
});
Get Contract Source Code for Verified Contract Source Codes
Returns the Solidity source code of a verified smart contract.
📩 Tip : You can also download a CSV list of Verified Contract Addresses of which the code publishers have provided a corresponding Open Source license for redistribution.
https://api.ftmscan.com/api
?module=contract
&action=getsourcecode
&address=0x0d500B1d8E8eF31E21C99d1Db9A6444d3ADf1270
&apikey=YourApiKeyToken
Try this endpoint in your browser 🔗
Query Parameters
Parameter | Description |
---|---|
address | the |
Sample Response
{
"status":"1",
"message":"OK",
"result":[
{
"SourceCode":"{{\r\n \"language\": \"Solidity\",\r\n \"sources\": {\r\n \"hardhat-tutorial/contracts/Treasury.sol\": {\r\n \"content\": \"// SPDX-License-Identifier: MIT\\n\\npragma solidity 0.6.12;\\n\\nimport \\\"@openzeppelin/contracts/math/Math.sol\\\";\\nimport \\\"@openzeppelin/contracts/token/ERC20/IERC20.sol\\\";\\nimport \\\"@openzeppelin/contracts/token/ERC20/SafeERC20.sol\\\";\\nimport \\\"@openzeppelin/contracts/utils/ReentrancyGuard.sol\\\";\\n\\nimport \\\"./lib/Babylonian.sol\\\";\\nimport \\\"./owner/Operator.sol\\\";\\nimport \\\"./utils/ContractGuard.sol\\\";\\nimport \\\"./interfaces/IBasisAsset.sol\\\";\\nimport \\\"./interfaces/IOracle.sol\\\";\\nimport \\\"./interfaces/IMasonry.sol\\\";\\n\\n/*\\n https://www.thecatacomb.finance/\\n*/\\ncontract Treasury is ContractGuard {\\n using SafeERC20 for IERC20;\\n using Address for address;\\n using SafeMath for uint256;\\n\\n /* ========= CONSTANT VARIABLES ======== */\\n\\n uint256 public constant PERIOD = 6 hours;\\n\\n /* ========== STATE VARIABLES ========== */\\n\\n // governance\\n address public operator;\\n\\n // flags\\n bool public initialized = false;\\n\\n // epoch\\n uint256 public startTime;\\n uint256 public epoch = 0;\\n uint256 public epochSupplyContractionLeft = 0;\\n\\n // exclusions from total supply\\n address[] public excludedFromTotalSupply = [\\n address(0xa7b9123f4b15fE0fF01F469ff5Eab2b41296dC0E) // new MUMMYRewardPool\\n ];\\n\\n // core components\\n address public MUMMY;\\n address public mBOND;\\n address public mSHARE;\\n\\n address public masonry;\\n address public MUMMYOracle;\\n\\n // price\\n uint256 public MUMMYPriceOne;\\n uint256 public MUMMYPriceCeiling;\\n\\n uint256 public seigniorageSaved;\\n\\n uint256[] public supplyTiers;\\n uint256[] public maxExpansionTiers;\\n\\n uint256 public maxSupplyExpansionPercent;\\n uint256 public bondDepletionFloorPercent;\\n uint256 public seigniorageExpansionFloorPercent;\\n uint256 public maxSupplyContractionPercent;\\n uint256 public maxDebtRatioPercent;\\n\\n // 28 first epochs (1 week) with 4.5% expansion regardless of MUMMY price\\n uint256 public bootstrapEpochs;\\n uint256 public bootstrapSupplyExpansionPercent;\\n\\n /* =================== Added variables =================== */\\n uint256 public previousEpochMUMMYPrice;\\n uint256 public maxDiscountRate; // when purchasing bond\\n uint256 public maxPremiumRate; // when redeeming bond\\n uint256 public discountPercent;\\n uint256 public premiumThreshold;\\n uint256 public premiumPercent;\\n uint256 public mintingFactorForPayingDebt; // print extra MUMMY during debt phase\\n\\n address public daoFund;\\n uint256 public daoFundSharedPercent;\\n\\n address public devFund;\\n uint256 public devFundSharedPercent;\\n\\n /* =================== Events =================== */\\n\\n event Initialized(address indexed executor, uint256 at);\\n event BurnedBonds(address indexed from, uint256 bondAmount);\\n event RedeemedBonds(address indexed from, uint256 MUMMYAmount, uint256 bondAmount);\\n event BoughmBONDs(address indexed from, uint256 MUMMYAmount, uint256 bondAmount);\\n event TreasuryFunded(uint256 timestamp, uint256 seigniorage);\\n event MasonryFunded(uint256 timestamp, uint256 seigniorage);\\n event DaoFundFunded(uint256 timestamp, uint256 seigniorage);\\n event DevFundFunded(uint256 timestamp, uint256 seigniorage);\\n\\n /* =================== Modifier =================== */\\n\\n modifier onlyOperator() {\\n require(operator == msg.sender, \\\"Treasury: caller is not the operator\\\");\\n _;\\n }\\n\\n modifier checkCondition {\\n require(now >= startTime, \\\"Treasury: not started yet\\\");\\n\\n _;\\n }\\n\\n modifier checkEpoch {\\n require(now >= nextEpochPoint(), \\\"Treasury: not opened yet\\\");\\n\\n _;\\n\\n epoch = epoch.add(1);\\n epochSupplyContractionLeft = (getMUMMYPrice() > MUMMYPriceCeiling) ? 0 : getMUMMYCirculatingSupply().mul(maxSupplyContractionPercent).div(10000);\\n }\\n\\n modifier checkOperator {\\n require(\\n IBasisAsset(MUMMY).operator() == address(this) &&\\n IBasisAsset(mBOND).operator() == address(this) &&\\n IBasisAsset(mSHARE).operator() == address(this) &&\\n Operator(masonry).operator() == address(this),\\n \\\"Treasury: need more permission\\\"\\n );\\n\\n _;\\n }\\n\\n modifier notInitialized {\\n require(!initialized, \\\"Treasury: already initialized\\\");\\n\\n _;\\n }\\n\\n /* ========== VIEW FUNCTIONS ========== */\\n\\n function isInitialized() public view returns (bool) {\\n return initialized;\\n }\\n\\n // epoch\\n function nextEpochPoint() public view returns (uint256) {\\n return startTime.add(epoch.mul(PERIOD));\\n }\\n\\n // oracle\\n function getMUMMYPrice() public view returns (uint256 MUMMYPrice) {\\n try IOracle(MUMMYOracle).consult(MUMMY, 1e18) returns (uint144 price) {\\n return uint256(price);\\n } catch {\\n revert(\\\"Treasury: failed to consult MUMMY price from the oracle\\\");\\n }\\n }\\n\\n function getMUMMYUpdatedPrice() public view returns (uint256 _MUMMYPrice) {\\n try IOracle(MUMMYOracle).twap(MUMMY, 1e18) returns (uint144 price) {\\n return uint256(price);\\n } catch {\\n revert(\\\"Treasury: failed to consult MUMMY price from the oracle\\\");\\n }\\n }\\n\\n // budget\\n function getReserve() public view returns (uint256) {\\n return seigniorageSaved;\\n }\\n\\n function getBurnableMUMMYLeft() public view returns (uint256 _burnableMUMMYLeft) {\\n uint256 _MUMMYPrice = getMUMMYPrice();\\n if (_MUMMYPrice <= MUMMYPriceOne) {\\n uint256 _MUMMYSupply = getMUMMYCirculatingSupply();\\n uint256 _bondMaxSupply = _MUMMYSupply.mul(maxDebtRatioPercent).div(10000);\\n uint256 _bondSupply = IERC20(mBOND).totalSupply();\\n if (_bondMaxSupply > _bondSupply) {\\n uint256 _maxMintableBond = _bondMaxSupply.sub(_bondSupply);\\n uint256 _maxBurnableMUMMY = _maxMintableBond.mul(_MUMMYPrice).div(1e18);\\n _burnableMUMMYLeft = Math.min(epochSupplyContractionLeft, _maxBurnableMUMMY);\\n }\\n }\\n }\\n\\n function getRedeemableBonds() public view returns (uint256 _redeemableBonds) {\\n uint256 _MUMMYPrice = getMUMMYPrice();\\n if (_MUMMYPrice > MUMMYPriceCeiling) {\\n uint256 _totalMUMMY = IERC20(MUMMY).balanceOf(address(this));\\n uint256 _rate = gemBONDPremiumRate();\\n if (_rate > 0) {\\n _redeemableBonds = _totalMUMMY.mul(1e18).div(_rate);\\n }\\n }\\n }\\n\\n function gemBONDDiscountRate() public view returns (uint256 _rate) {\\n uint256 _MUMMYPrice = getMUMMYPrice();\\n if (_MUMMYPrice <= MUMMYPriceOne) {\\n if (discountPercent == 0) {\\n // no discount\\n _rate = MUMMYPriceOne;\\n } else {\\n uint256 _bondAmount = MUMMYPriceOne.mul(1e18).div(_MUMMYPrice); // to burn 1 MUMMY\\n uint256 _discountAmount = _bondAmount.sub(MUMMYPriceOne).mul(discountPercent).div(10000);\\n _rate = MUMMYPriceOne.add(_discountAmount);\\n if (maxDiscountRate > 0 && _rate > maxDiscountRate) {\\n _rate = maxDiscountRate;\\n }\\n }\\n }\\n }\\n\\n function gemBONDPremiumRate() public view returns (uint256 _rate) {\\n uint256 _MUMMYPrice = getMUMMYPrice();\\n if (_MUMMYPrice > MUMMYPriceCeiling) {\\n uint256 _MUMMYPricePremiumThreshold = MUMMYPriceOne.mul(premiumThreshold).div(100);\\n if (_MUMMYPrice >= _MUMMYPricePremiumThreshold) {\\n //Price > 1.10\\n uint256 _premiumAmount = _MUMMYPrice.sub(MUMMYPriceOne).mul(premiumPercent).div(10000);\\n _rate = MUMMYPriceOne.add(_premiumAmount);\\n if (maxPremiumRate > 0 && _rate > maxPremiumRate) {\\n _rate = maxPremiumRate;\\n }\\n } else {\\n // no premium bonus\\n _rate = MUMMYPriceOne;\\n }\\n }\\n }\\n\\n /* ========== GOVERNANCE ========== */\\n\\n function initialize(\\n address _MUMMY,\\n address _mBOND,\\n address _mSHARE,\\n address _MUMMYOracle,\\n address _masonry,\\n uint256 _startTime\\n ) public notInitialized {\\n MUMMY = _MUMMY;\\n mBOND = _mBOND;\\n mSHARE = _mSHARE;\\n MUMMYOracle = _MUMMYOracle;\\n masonry = _masonry;\\n startTime = _startTime;\\n\\n MUMMYPriceOne = 10**18;\\n MUMMYPriceCeiling = MUMMYPriceOne.mul(101).div(100);\\n\\n // Dynamic max expansion percent\\n supplyTiers = [0 ether, 500000 ether, 1000000 ether, 1500000 ether, 2000000 ether, 5000000 ether, 10000000 ether, 20000000 ether, 50000000 ether];\\n maxExpansionTiers = [450, 400, 350, 300, 250, 200, 150, 125, 100];\\n\\n maxSupplyExpansionPercent = 400; // Upto 4.0% supply for expansion\\n\\n bondDepletionFloorPercent = 10000; // 100% of Bond supply for depletion floor\\n seigniorageExpansionFloorPercent = 3500; // At least 35% of expansion reserved for masonry\\n maxSupplyContractionPercent = 300; // Upto 3.0% supply for contraction (to burn MUMMY and mint mBOND)\\n maxDebtRatioPercent = 3500; // Upto 35% supply of mBOND to purchase\\n\\n premiumThreshold = 110;\\n premiumPercent = 7000;\\n\\n // First 28 epochs with 4.5% expansion\\n bootstrapEpochs = 28;\\n bootstrapSupplyExpansionPercent = 450;\\n\\n // set seigniorageSaved to it's balance\\n seigniorageSaved = IERC20(MUMMY).balanceOf(address(this));\\n\\n initialized = true;\\n operator = msg.sender;\\n emit Initialized(msg.sender, block.number);\\n }\\n /*\\n function setOperator(address _operator) external onlyOperator {\\n operator = _operator;\\n }\\n\\n function setMasonry(address _masonry) external onlyOperator {\\n masonry = _masonry;\\n }\\n\\n function setMUMMYOracle(address _MUMMYOracle) external onlyOperator {\\n MUMMYOracle = _MUMMYOracle;\\n }\\n\\n function setMUMMYPriceCeiling(uint256 _MUMMYPriceCeiling) external onlyOperator {\\n require(_MUMMYPriceCeiling >= MUMMYPriceOne && _MUMMYPriceCeiling <= MUMMYPriceOne.mul(120).div(100), \\\"out of range\\\"); // [$1.0, $1.2]\\n MUMMYPriceCeiling = _MUMMYPriceCeiling;\\n }\\n\\n function setMaxSupplyExpansionPercents(uint256 _maxSupplyExpansionPercent) external onlyOperator {\\n require(_maxSupplyExpansionPercent >= 10 && _maxSupplyExpansionPercent <= 1000, \\\"_maxSupplyExpansionPercent: out of range\\\"); // [0.1%, 10%]\\n maxSupplyExpansionPercent = _maxSupplyExpansionPercent;\\n }\\n\\n function setSupplyTiersEntry(uint8 _index, uint256 _value) external onlyOperator returns (bool) {\\n require(_index >= 0, \\\"Index has to be higher than 0\\\");\\n require(_index < 9, \\\"Index has to be lower than count of tiers\\\");\\n if (_index > 0) {\\n require(_value > supplyTiers[_index - 1]);\\n }\\n if (_index < 8) {\\n require(_value < supplyTiers[_index + 1]);\\n }\\n supplyTiers[_index] = _value;\\n return true;\\n }\\n\\n function setMaxExpansionTiersEntry(uint8 _index, uint256 _value) external onlyOperator returns (bool) {\\n require(_index >= 0, \\\"Index has to be higher than 0\\\");\\n require(_index < 9, \\\"Index has to be lower than count of tiers\\\");\\n require(_value >= 10 && _value <= 1000, \\\"_value: out of range\\\"); // [0.1%, 10%]\\n maxExpansionTiers[_index] = _value;\\n return true;\\n }\\n\\n function semBONDDepletionFloorPercent(uint256 _bondDepletionFloorPercent) external onlyOperator {\\n require(_bondDepletionFloorPercent >= 500 && _bondDepletionFloorPercent <= 10000, \\\"out of range\\\"); // [5%, 100%]\\n bondDepletionFloorPercent = _bondDepletionFloorPercent;\\n }\\n\\n function setMaxSupplyContractionPercent(uint256 _maxSupplyContractionPercent) external onlyOperator {\\n require(_maxSupplyContractionPercent >= 100 && _maxSupplyContractionPercent <= 1500, \\\"out of range\\\"); // [0.1%, 15%]\\n maxSupplyContractionPercent = _maxSupplyContractionPercent;\\n }\\n\\n function setMaxDebtRatioPercent(uint256 _maxDebtRatioPercent) external onlyOperator {\\n require(_maxDebtRatioPercent >= 1000 && _maxDebtRatioPercent <= 10000, \\\"out of range\\\"); // [10%, 100%]\\n maxDebtRatioPercent = _maxDebtRatioPercent;\\n }\\n\\n function setBootstrap(uint256 _bootstrapEpochs, uint256 _bootstrapSupplyExpansionPercent) external onlyOperator {\\n require(_bootstrapEpochs <= 120, \\\"_bootstrapEpochs: out of range\\\"); // <= 1 month\\n require(_bootstrapSupplyExpansionPercent >= 100 && _bootstrapSupplyExpansionPercent <= 1000, \\\"_bootstrapSupplyExpansionPercent: out of range\\\"); // [1%, 10%]\\n bootstrapEpochs = _bootstrapEpochs;\\n bootstrapSupplyExpansionPercent = _bootstrapSupplyExpansionPercent;\\n }\\n */\\n function setExtraFunds(\\n address _daoFund,\\n uint256 _daoFundSharedPercent,\\n address _devFund,\\n uint256 _devFundSharedPercent\\n ) external onlyOperator {\\n require(_daoFund != address(0), \\\"zero\\\");\\n require(_daoFundSharedPercent <= 3000, \\\"out of range\\\"); // <= 30%\\n require(_devFund != address(0), \\\"zero\\\");\\n require(_devFundSharedPercent <= 1000, \\\"out of range\\\"); // <= 10%\\n daoFund = _daoFund;\\n daoFundSharedPercent = _daoFundSharedPercent;\\n devFund = _devFund;\\n devFundSharedPercent = _devFundSharedPercent;\\n }\\n /*\\n function setMaxDiscountRate(uint256 _maxDiscountRate) external onlyOperator {\\n maxDiscountRate = _maxDiscountRate;\\n }\\n\\n function setMaxPremiumRate(uint256 _maxPremiumRate) external onlyOperator {\\n maxPremiumRate = _maxPremiumRate;\\n }\\n\\n function setDiscountPercent(uint256 _discountPercent) external onlyOperator {\\n require(_discountPercent <= 20000, \\\"_discountPercent is over 200%\\\");\\n discountPercent = _discountPercent;\\n }\\n\\n function setPremiumThreshold(uint256 _premiumThreshold) external onlyOperator {\\n require(_premiumThreshold >= MUMMYPriceCeiling, \\\"_premiumThreshold exceeds MUMMYPriceCeiling\\\");\\n require(_premiumThreshold <= 150, \\\"_premiumThreshold is higher than 1.5\\\");\\n premiumThreshold = _premiumThreshold;\\n }\\n\\n function setPremiumPercent(uint256 _premiumPercent) external onlyOperator {\\n require(_premiumPercent <= 20000, \\\"_premiumPercent is over 200%\\\");\\n premiumPercent = _premiumPercent;\\n }\\n\\n function setMintingFactorForPayingDebt(uint256 _mintingFactorForPayingDebt) external onlyOperator {\\n require(_mintingFactorForPayingDebt >= 10000 && _mintingFactorForPayingDebt <= 20000, \\\"_mintingFactorForPayingDebt: out of range\\\"); // [100%, 200%]\\n mintingFactorForPayingDebt = _mintingFactorForPayingDebt;\\n }\\n */\\n /* ========== MUTABLE FUNCTIONS ========== */\\n\\n function _updateMUMMYPrice() internal {\\n try IOracle(MUMMYOracle).update() {} catch {}\\n }\\n\\n function getMUMMYCirculatingSupply() public view returns (uint256) {\\n IERC20 MUMMYErc20 = IERC20(MUMMY);\\n uint256 totalSupply = MUMMYErc20.totalSupply();\\n uint256 balanceExcluded = 0;\\n for (uint8 entryId = 0; entryId < excludedFromTotalSupply.length; ++entryId) {\\n balanceExcluded = balanceExcluded.add(MUMMYErc20.balanceOf(excludedFromTotalSupply[entryId]));\\n }\\n return totalSupply.sub(balanceExcluded);\\n }\\n\\n function buyBonds(uint256 _MUMMYAmount, uint256 targetPrice) external onlyOneBlock checkCondition checkOperator {\\n require(_MUMMYAmount > 0, \\\"Treasury: cannot purchase bonds with zero amount\\\");\\n\\n uint256 MUMMYPrice = getMUMMYPrice();\\n require(MUMMYPrice == targetPrice, \\\"Treasury: MUMMY price moved\\\");\\n require(\\n MUMMYPrice < MUMMYPriceOne, // price < $1\\n \\\"Treasury: MUMMYPrice not eligible for bond purchase\\\"\\n );\\n\\n require(_MUMMYAmount <= epochSupplyContractionLeft, \\\"Treasury: not enough bond left to purchase\\\");\\n\\n uint256 _rate = gemBONDDiscountRate();\\n require(_rate > 0, \\\"Treasury: invalid bond rate\\\");\\n\\n uint256 _bondAmount = _MUMMYAmount.mul(_rate).div(1e18);\\n uint256 MUMMYSupply = getMUMMYCirculatingSupply();\\n uint256 newBondSupply = IERC20(mBOND).totalSupply().add(_bondAmount);\\n require(newBondSupply <= MUMMYSupply.mul(maxDebtRatioPercent).div(10000), \\\"over max debt ratio\\\");\\n\\n IBasisAsset(MUMMY).burnFrom(msg.sender, _MUMMYAmount);\\n IBasisAsset(mBOND).mint(msg.sender, _bondAmount);\\n\\n epochSupplyContractionLeft = epochSupplyContractionLeft.sub(_MUMMYAmount);\\n _updateMUMMYPrice();\\n\\n emit BoughmBONDs(msg.sender, _MUMMYAmount, _bondAmount);\\n }\\n\\n function redeemBonds(uint256 _bondAmount, uint256 targetPrice) external onlyOneBlock checkCondition checkOperator {\\n require(_bondAmount > 0, \\\"Treasury: cannot redeem bonds with zero amount\\\");\\n\\n uint256 MUMMYPrice = getMUMMYPrice();\\n require(MUMMYPrice == targetPrice, \\\"Treasury: MUMMY price moved\\\");\\n require(\\n MUMMYPrice > MUMMYPriceCeiling, // price > $1.01\\n \\\"Treasury: MUMMYPrice not eligible for bond purchase\\\"\\n );\\n\\n uint256 _rate = gemBONDPremiumRate();\\n require(_rate > 0, \\\"Treasury: invalid bond rate\\\");\\n\\n uint256 _MUMMYAmount = _bondAmount.mul(_rate).div(1e18);\\n require(IERC20(MUMMY).balanceOf(address(this)) >= _MUMMYAmount, \\\"Treasury: treasury has no more budget\\\");\\n\\n seigniorageSaved = seigniorageSaved.sub(Math.min(seigniorageSaved, _MUMMYAmount));\\n\\n IBasisAsset(mBOND).burnFrom(msg.sender, _bondAmount);\\n IERC20(MUMMY).safeTransfer(msg.sender, _MUMMYAmount);\\n\\n _updateMUMMYPrice();\\n\\n emit RedeemedBonds(msg.sender, _MUMMYAmount, _bondAmount);\\n }\\n\\n function _sendToMasonry(uint256 _amount) internal {\\n IBasisAsset(MUMMY).mint(address(this), _amount);\\n\\n uint256 _daoFundSharedAmount = 0;\\n if (daoFundSharedPercent > 0) {\\n _daoFundSharedAmount = _amount.mul(daoFundSharedPercent).div(10000);\\n IERC20(MUMMY).transfer(daoFund, _daoFundSharedAmount);\\n emit DaoFundFunded(now, _daoFundSharedAmount);\\n }\\n\\n uint256 _devFundSharedAmount = 0;\\n if (devFundSharedPercent > 0) {\\n _devFundSharedAmount = _amount.mul(devFundSharedPercent).div(10000);\\n IERC20(MUMMY).transfer(devFund, _devFundSharedAmount);\\n emit DevFundFunded(now, _devFundSharedAmount);\\n }\\n\\n _amount = _amount.sub(_daoFundSharedAmount).sub(_devFundSharedAmount);\\n\\n IERC20(MUMMY).safeApprove(masonry, 0);\\n IERC20(MUMMY).safeApprove(masonry, _amount);\\n IMasonry(masonry).allocateSeigniorage(_amount);\\n emit MasonryFunded(now, _amount);\\n }\\n\\n function _calculateMaxSupplyExpansionPercent(uint256 _MUMMYSupply) internal returns (uint256) {\\n for (uint8 tierId = 8; tierId >= 0; --tierId) {\\n if (_MUMMYSupply >= supplyTiers[tierId]) {\\n maxSupplyExpansionPercent = maxExpansionTiers[tierId];\\n break;\\n }\\n }\\n return maxSupplyExpansionPercent;\\n }\\n\\n function allocateSeigniorage() external onlyOneBlock checkCondition checkEpoch checkOperator {\\n _updateMUMMYPrice();\\n previousEpochMUMMYPrice = getMUMMYPrice();\\n uint256 MUMMYSupply = getMUMMYCirculatingSupply().sub(seigniorageSaved);\\n if (epoch < bootstrapEpochs) {\\n // 28 first epochs with 4.5% expansion\\n _sendToMasonry(MUMMYSupply.mul(bootstrapSupplyExpansionPercent).div(10000));\\n } else {\\n if (previousEpochMUMMYPrice > MUMMYPriceCeiling) {\\n // Expansion ($MUMMY Price > 1 $FTM): there is some seigniorage to be allocated\\n uint256 bondSupply = IERC20(mBOND).totalSupply();\\n uint256 _percentage = previousEpochMUMMYPrice.sub(MUMMYPriceOne);\\n uint256 _savedForBond;\\n uint256 _savedForMasonry;\\n uint256 _mse = _calculateMaxSupplyExpansionPercent(MUMMYSupply).mul(1e14);\\n if (_percentage > _mse) {\\n _percentage = _mse;\\n }\\n if (seigniorageSaved >= bondSupply.mul(bondDepletionFloorPercent).div(10000)) {\\n // saved enough to pay debt, mint as usual rate\\n _savedForMasonry = MUMMYSupply.mul(_percentage).div(1e18);\\n } else {\\n // have not saved enough to pay debt, mint more\\n uint256 _seigniorage = MUMMYSupply.mul(_percentage).div(1e18);\\n _savedForMasonry = _seigniorage.mul(seigniorageExpansionFloorPercent).div(10000);\\n _savedForBond = _seigniorage.sub(_savedForMasonry);\\n if (mintingFactorForPayingDebt > 0) {\\n _savedForBond = _savedForBond.mul(mintingFactorForPayingDebt).div(10000);\\n }\\n }\\n if (_savedForMasonry > 0) {\\n _sendToMasonry(_savedForMasonry);\\n }\\n if (_savedForBond > 0) {\\n seigniorageSaved = seigniorageSaved.add(_savedForBond);\\n IBasisAsset(MUMMY).mint(address(this), _savedForBond);\\n emit TreasuryFunded(now, _savedForBond);\\n }\\n }\\n }\\n }\\n\\n function governanceRecoverUnsupported(\\n IERC20 _token,\\n uint256 _amount,\\n address _to\\n ) external onlyOperator {\\n // do not allow to drain core tokens\\n require(address(_token) != address(MUMMY), \\\"MUMMY\\\");\\n require(address(_token) != address(mBOND), \\\"bond\\\");\\n require(address(_token) != address(mSHARE), \\\"share\\\");\\n _token.safeTransfer(_to, _amount);\\n }\\n\\n function masonrySetOperator(address _operator) external onlyOperator {\\n IMasonry(masonry).setOperator(_operator);\\n }\\n\\n function masonrySetLockUp(uint256 _withdrawLockupEpochs, uint256 _rewardLockupEpochs) external onlyOperator {\\n IMasonry(masonry).setLockUp(_withdrawLockupEpochs, _rewardLockupEpochs);\\n }\\n\\n function masonryAllocateSeigniorage(uint256 amount) external onlyOperator {\\n IMasonry(masonry).allocateSeigniorage(amount);\\n }\\n\\n function masonryGovernanceRecoverUnsupported(\\n address _token,\\n uint256 _amount,\\n address _to\\n ) external onlyOperator {\\n IMasonry(masonry).governanceRecoverUnsupported(_token, _amount, _to);\\n }\\n}\"\r\n },\r\n \"@openzeppelin/contracts/math/Math.sol\": {\r\n \"content\": \"pragma solidity ^0.6.0;\\n\\n/**\\n * @dev Standard math utilities missing in the Solidity language.\\n */\\nlibrary Math {\\n /**\\n * @dev Returns the largest of two numbers.\\n */\\n function max(uint256 a, uint256 b) internal pure returns (uint256) {\\n return a >= b ? a : b;\\n }\\n\\n /**\\n * @dev Returns the smallest of two numbers.\\n */\\n function min(uint256 a, uint256 b) internal pure returns (uint256) {\\n return a < b ? a : b;\\n }\\n\\n /**\\n * @dev Returns the average of two numbers. The result is rounded towards\\n * zero.\\n */\\n function average(uint256 a, uint256 b) internal pure returns (uint256) {\\n // (a + b) / 2 can overflow, so we distribute\\n return (a / 2) + (b / 2) + ((a % 2 + b % 2) / 2);\\n }\\n}\\n\"\r\n },\r\n \"@openzeppelin/contracts/token/ERC20/IERC20.sol\": {\r\n \"content\": \"pragma solidity ^0.6.0;\\n\\n/**\\n * @dev Interface of the ERC20 standard as defined in the EIP.\\n */\\ninterface IERC20 {\\n /**\\n * @dev Returns the amount of tokens in existence.\\n */\\n function totalSupply() external view returns (uint256);\\n\\n /**\\n * @dev Returns the amount of tokens owned by `account`.\\n */\\n function balanceOf(address account) external view returns (uint256);\\n\\n /**\\n * @dev Moves `amount` tokens from the caller's account to `recipient`.\\n *\\n * Returns a boolean value indicating whether the operation succeeded.\\n *\\n * Emits a {Transfer} event.\\n */\\n function transfer(address recipient, uint256 amount) external returns (bool);\\n\\n /**\\n * @dev Returns the remaining number of tokens that `spender` will be\\n * allowed to spend on behalf of `owner` through {transferFrom}. This is\\n * zero by default.\\n *\\n * This value changes when {approve} or {transferFrom} are called.\\n */\\n function allowance(address owner, address spender) external view returns (uint256);\\n\\n /**\\n * @dev Sets `amount` as the allowance of `spender` over the caller's tokens.\\n *\\n * Returns a boolean value indicating whether the operation succeeded.\\n *\\n * IMPORTANT: Beware that changing an allowance with this method brings the risk\\n * that someone may use both the old and the new allowance by unfortunate\\n * transaction ordering. One possible solution to mitigate this race\\n * condition is to first reduce the spender's allowance to 0 and set the\\n * desired value afterwards:\\n * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729\\n *\\n * Emits an {Approval} event.\\n */\\n function approve(address spender, uint256 amount) external returns (bool);\\n\\n /**\\n * @dev Moves `amount` tokens from `sender` to `recipient` using the\\n * allowance mechanism. `amount` is then deducted from the caller's\\n * allowance.\\n *\\n * Returns a boolean value indicating whether the operation succeeded.\\n *\\n * Emits a {Transfer} event.\\n */\\n function transferFrom(address sender, address recipient, uint256 amount) external returns (bool);\\n\\n /**\\n * @dev Emitted when `value` tokens are moved from one account (`from`) to\\n * another (`to`).\\n *\\n * Note that `value` may be zero.\\n */\\n event Transfer(address indexed from, address indexed to, uint256 value);\\n\\n /**\\n * @dev Emitted when the allowance of a `spender` for an `owner` is set by\\n * a call to {approve}. `value` is the new allowance.\\n */\\n event Approval(address indexed owner, address indexed spender, uint256 value);\\n}\\n\"\r\n },\r\n \"@openzeppelin/contracts/token/ERC20/SafeERC20.sol\": {\r\n \"content\": \"pragma solidity ^0.6.0;\\n\\nimport \\\"./IERC20.sol\\\";\\nimport \\\"../../math/SafeMath.sol\\\";\\nimport \\\"../../utils/Address.sol\\\";\\n\\n/**\\n * @title SafeERC20\\n * @dev Wrappers around ERC20 operations that throw on failure (when the token\\n * contract returns false). Tokens that return no value (and instead revert or\\n * throw on failure) are also supported, non-reverting calls are assumed to be\\n * successful.\\n * To use this library you can add a `using SafeERC20 for ERC20;` statement to your contract,\\n * which allows you to call the safe operations as `token.safeTransfer(...)`, etc.\\n */\\nlibrary SafeERC20 {\\n using SafeMath for uint256;\\n using Address for address;\\n\\n function safeTransfer(IERC20 token, address to, uint256 value) internal {\\n _callOptionalReturn(token, abi.encodeWithSelector(token.transfer.selector, to, value));\\n }\\n\\n function safeTransferFrom(IERC20 token, address from, address to, uint256 value) internal {\\n _callOptionalReturn(token, abi.encodeWithSelector(token.transferFrom.selector, from, to, value));\\n }\\n\\n function safeApprove(IERC20 token, address spender, uint256 value) internal {\\n // safeApprove should only be called when setting an initial allowance,\\n // or when resetting it to zero. To increase and decrease it, use\\n // 'safeIncreaseAllowance' and 'safeDecreaseAllowance'\\n // solhint-disable-next-line max-line-length\\n require((value == 0) || (token.allowance(address(this), spender) == 0),\\n \\\"SafeERC20: approve from non-zero to non-zero allowance\\\"\\n );\\n _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, value));\\n }\\n\\n function safeIncreaseAllowance(IERC20 token, address spender, uint256 value) internal {\\n uint256 newAllowance = token.allowance(address(this), spender).add(value);\\n _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance));\\n }\\n\\n function safeDecreaseAllowance(IERC20 token, address spender, uint256 value) internal {\\n uint256 newAllowance = token.allowance(address(this), spender).sub(value, \\\"SafeERC20: decreased allowance below zero\\\");\\n _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance));\\n }\\n\\n /**\\n * @dev Imitates a Solidity high-level call (i.e. a regular function call to a contract), relaxing the requirement\\n * on the return value: the return value is optional (but if data is returned, it must not be false).\\n * @param token The token targeted by the call.\\n * @param data The call data (encoded using abi.encode or one of its variants).\\n */\\n function _callOptionalReturn(IERC20 token, bytes memory data) private {\\n // We need to perform a low level call here, to bypass Solidity's return data size checking mechanism, since\\n // we're implementing it ourselves.\\n\\n // A Solidity high level call has three parts:\\n // 1. The target address is checked to verify it contains contract code\\n // 2. The call itself is made, and success asserted\\n // 3. The return value is decoded, which in turn checks the size of the returned data.\\n // solhint-disable-next-line max-line-length\\n require(address(token).isContract(), \\\"SafeERC20: call to non-contract\\\");\\n\\n // solhint-disable-next-line avoid-low-level-calls\\n (bool success, bytes memory returndata) = address(token).call(data);\\n require(success, \\\"SafeERC20: low-level call failed\\\");\\n\\n if (returndata.length > 0) { // Return data is optional\\n // solhint-disable-next-line max-line-length\\n require(abi.decode(returndata, (bool)), \\\"SafeERC20: ERC20 operation did not succeed\\\");\\n }\\n }\\n}\\n\"\r\n },\r\n \"@openzeppelin/contracts/utils/ReentrancyGuard.sol\": {\r\n \"content\": \"pragma solidity ^0.6.0;\\n\\n/**\\n * @dev Contract module that helps prevent reentrant calls to a function.\\n *\\n * Inheriting from `ReentrancyGuard` will make the {nonReentrant} modifier\\n * available, which can be applied to functions to make sure there are no nested\\n * (reentrant) calls to them.\\n *\\n * Note that because there is a single `nonReentrant` guard, functions marked as\\n * `nonReentrant` may not call one another. This can be worked around by making\\n * those functions `private`, and then adding `external` `nonReentrant` entry\\n * points to them.\\n *\\n * TIP: If you would like to learn more about reentrancy and alternative ways\\n * to protect against it, check out our blog post\\n * https://blog.openzeppelin.com/reentrancy-after-istanbul/[Reentrancy After Istanbul].\\n */\\ncontract ReentrancyGuard {\\n bool private _notEntered;\\n\\n constructor () internal {\\n // Storing an initial non-zero value makes deployment a bit more\\n // expensive, but in exchange the refund on every call to nonReentrant\\n // will be lower in amount. Since refunds are capped to a percetange of\\n // the total transaction's gas, it is best to keep them low in cases\\n // like this one, to increase the likelihood of the full refund coming\\n // into effect.\\n _notEntered = true;\\n }\\n\\n /**\\n * @dev Prevents a contract from calling itself, directly or indirectly.\\n * Calling a `nonReentrant` function from another `nonReentrant`\\n * function is not supported. It is possible to prevent this from happening\\n * by making the `nonReentrant` function external, and make it call a\\n * `private` function that does the actual work.\\n */\\n modifier nonReentrant() {\\n // On the first call to nonReentrant, _notEntered will be true\\n require(_notEntered, \\\"ReentrancyGuard: reentrant call\\\");\\n\\n // Any calls to nonReentrant after this point will fail\\n _notEntered = false;\\n\\n _;\\n\\n // By storing the original value once again, a refund is triggered (see\\n // https://eips.ethereum.org/EIPS/eip-2200)\\n _notEntered = true;\\n }\\n}\\n\"\r\n },\r\n \"hardhat-tutorial/contracts/lib/Babylonian.sol\": {\r\n \"content\": \"pragma solidity ^0.6.0;\\n\\nlibrary Babylonian {\\n function sqrt(uint256 y) internal pure returns (uint256 z) {\\n if (y > 3) {\\n z = y;\\n uint256 x = y / 2 + 1;\\n while (x < z) {\\n z = x;\\n x = (y / x + x) / 2;\\n }\\n } else if (y != 0) {\\n z = 1;\\n }\\n // else z = 0\\n }\\n}\\n\"\r\n },\r\n \"hardhat-tutorial/contracts/owner/Operator.sol\": {\r\n \"content\": \"// SPDX-License-Identifier: MIT\\n\\npragma solidity 0.6.12;\\n\\nimport \\\"@openzeppelin/contracts/GSN/Context.sol\\\";\\nimport \\\"@openzeppelin/contracts/access/Ownable.sol\\\";\\n\\ncontract Operator is Context, Ownable {\\n address private _operator;\\n\\n event OperatorTransferred(address indexed previousOperator, address indexed newOperator);\\n\\n constructor() internal {\\n _operator = _msgSender();\\n emit OperatorTransferred(address(0), _operator);\\n }\\n\\n function operator() public view returns (address) {\\n return _operator;\\n }\\n\\n modifier onlyOperator() {\\n require(_operator == msg.sender, \\\"operator: caller is not the operator\\\");\\n _;\\n }\\n\\n function isOperator() public view returns (bool) {\\n return _msgSender() == _operator;\\n }\\n\\n function transferOperator(address newOperator_) public onlyOwner {\\n _transferOperator(newOperator_);\\n }\\n\\n function _transferOperator(address newOperator_) internal {\\n require(newOperator_ != address(0), \\\"operator: zero address given for new operator\\\");\\n emit OperatorTransferred(address(0), newOperator_);\\n _operator = newOperator_;\\n }\\n}\\n\"\r\n },\r\n \"hardhat-tutorial/contracts/utils/ContractGuard.sol\": {\r\n \"content\": \"pragma solidity 0.6.12;\\n\\ncontract ContractGuard {\\n mapping(uint256 => mapping(address => bool)) private _status;\\n\\n function checkSameOriginReentranted() internal view returns (bool) {\\n return _status[block.number][tx.origin];\\n }\\n\\n function checkSameSenderReentranted() internal view returns (bool) {\\n return _status[block.number][msg.sender];\\n }\\n\\n modifier onlyOneBlock() {\\n require(!checkSameOriginReentranted(), \\\"ContractGuard: one block, one function\\\");\\n require(!checkSameSenderReentranted(), \\\"ContractGuard: one block, one function\\\");\\n\\n _;\\n\\n _status[block.number][tx.origin] = true;\\n _status[block.number][msg.sender] = true;\\n }\\n}\\n\"\r\n },\r\n \"hardhat-tutorial/contracts/interfaces/IBasisAsset.sol\": {\r\n \"content\": \"pragma solidity ^0.6.0;\\n\\ninterface IBasisAsset {\\n function mint(address recipient, uint256 amount) external returns (bool);\\n\\n function burn(uint256 amount) external;\\n\\n function burnFrom(address from, uint256 amount) external;\\n\\n function isOperator() external returns (bool);\\n\\n function operator() external view returns (address);\\n\\n function transferOperator(address newOperator_) external;\\n}\\n\"\r\n },\r\n \"hardhat-tutorial/contracts/interfaces/IOracle.sol\": {\r\n \"content\": \"// SPDX-License-Identifier: MIT\\n\\npragma solidity 0.6.12;\\n\\ninterface IOracle {\\n function update() external;\\n\\n function consult(address _token, uint256 _amountIn) external view returns (uint144 amountOut);\\n\\n function twap(address _token, uint256 _amountIn) external view returns (uint144 _amountOut);\\n}\\n\"\r\n },\r\n \"hardhat-tutorial/contracts/interfaces/IMasonry.sol\": {\r\n \"content\": \"// SPDX-License-Identifier: MIT\\n\\npragma solidity 0.6.12;\\n\\ninterface IMasonry {\\n function balanceOf(address _mason) external view returns (uint256);\\n\\n function earned(address _mason) external view returns (uint256);\\n\\n function canWithdraw(address _mason) external view returns (bool);\\n\\n function canClaimReward(address _mason) external view returns (bool);\\n\\n function epoch() external view returns (uint256);\\n\\n function nextEpochPoint() external view returns (uint256);\\n\\n function getMUMMYPrice() external view returns (uint256);\\n\\n function setOperator(address _operator) external;\\n\\n function setLockUp(uint256 _withdrawLockupEpochs, uint256 _rewardLockupEpochs) external;\\n\\n function stake(uint256 _amount) external;\\n\\n function withdraw(uint256 _amount) external;\\n\\n function exit() external;\\n\\n function claimReward() external;\\n\\n function allocateSeigniorage(uint256 _amount) external;\\n\\n function governanceRecoverUnsupported(address _token, uint256 _amount, address _to) external;\\n}\\n\"\r\n },\r\n \"@openzeppelin/contracts/math/SafeMath.sol\": {\r\n \"content\": \"pragma solidity ^0.6.0;\\n\\n/**\\n * @dev Wrappers over Solidity's arithmetic operations with added overflow\\n * checks.\\n *\\n * Arithmetic operations in Solidity wrap on overflow. This can easily result\\n * in bugs, because programmers usually assume that an overflow raises an\\n * error, which is the standard behavior in high level programming languages.\\n * `SafeMath` restores this intuition by reverting the transaction when an\\n * operation overflows.\\n *\\n * Using this library instead of the unchecked operations eliminates an entire\\n * class of bugs, so it's recommended to use it always.\\n */\\nlibrary SafeMath {\\n /**\\n * @dev Returns the addition of two unsigned integers, reverting on\\n * overflow.\\n *\\n * Counterpart to Solidity's `+` operator.\\n *\\n * Requirements:\\n * - Addition cannot overflow.\\n */\\n function add(uint256 a, uint256 b) internal pure returns (uint256) {\\n uint256 c = a + b;\\n require(c >= a, \\\"SafeMath: addition overflow\\\");\\n\\n return c;\\n }\\n\\n /**\\n * @dev Returns the subtraction of two unsigned integers, reverting on\\n * overflow (when the result is negative).\\n *\\n * Counterpart to Solidity's `-` operator.\\n *\\n * Requirements:\\n * - Subtraction cannot overflow.\\n */\\n function sub(uint256 a, uint256 b) internal pure returns (uint256) {\\n return sub(a, b, \\\"SafeMath: subtraction overflow\\\");\\n }\\n\\n /**\\n * @dev Returns the subtraction of two unsigned integers, reverting with custom message on\\n * overflow (when the result is negative).\\n *\\n * Counterpart to Solidity's `-` operator.\\n *\\n * Requirements:\\n * - Subtraction cannot overflow.\\n */\\n function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {\\n require(b <= a, errorMessage);\\n uint256 c = a - b;\\n\\n return c;\\n }\\n\\n /**\\n * @dev Returns the multiplication of two unsigned integers, reverting on\\n * overflow.\\n *\\n * Counterpart to Solidity's `*` operator.\\n *\\n * Requirements:\\n * - Multiplication cannot overflow.\\n */\\n function mul(uint256 a, uint256 b) internal pure returns (uint256) {\\n // Gas optimization: this is cheaper than requiring 'a' not being zero, but the\\n // benefit is lost if 'b' is also tested.\\n // See: https://github.com/OpenZeppelin/openzeppelin-contracts/pull/522\\n if (a == 0) {\\n return 0;\\n }\\n\\n uint256 c = a * b;\\n require(c / a == b, \\\"SafeMath: multiplication overflow\\\");\\n\\n return c;\\n }\\n\\n /**\\n * @dev Returns the integer division of two unsigned integers. Reverts on\\n * division by zero. The result is rounded towards zero.\\n *\\n * Counterpart to Solidity's `/` operator. Note: this function uses a\\n * `revert` opcode (which leaves remaining gas untouched) while Solidity\\n * uses an invalid opcode to revert (consuming all remaining gas).\\n *\\n * Requirements:\\n * - The divisor cannot be zero.\\n */\\n function div(uint256 a, uint256 b) internal pure returns (uint256) {\\n return div(a, b, \\\"SafeMath: division by zero\\\");\\n }\\n\\n /**\\n * @dev Returns the integer division of two unsigned integers. Reverts with custom message on\\n * division by zero. The result is rounded towards zero.\\n *\\n * Counterpart to Solidity's `/` operator. Note: this function uses a\\n * `revert` opcode (which leaves remaining gas untouched) while Solidity\\n * uses an invalid opcode to revert (consuming all remaining gas).\\n *\\n * Requirements:\\n * - The divisor cannot be zero.\\n */\\n function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {\\n // Solidity only automatically asserts when dividing by 0\\n require(b > 0, errorMessage);\\n uint256 c = a / b;\\n // assert(a == b * c + a % b); // There is no case in which this doesn't hold\\n\\n return c;\\n }\\n\\n /**\\n * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo),\\n * Reverts when dividing by zero.\\n *\\n * Counterpart to Solidity's `%` operator. This function uses a `revert`\\n * opcode (which leaves remaining gas untouched) while Solidity uses an\\n * invalid opcode to revert (consuming all remaining gas).\\n *\\n * Requirements:\\n * - The divisor cannot be zero.\\n */\\n function mod(uint256 a, uint256 b) internal pure returns (uint256) {\\n return mod(a, b, \\\"SafeMath: modulo by zero\\\");\\n }\\n\\n /**\\n * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo),\\n * Reverts with custom message when dividing by zero.\\n *\\n * Counterpart to Solidity's `%` operator. This function uses a `revert`\\n * opcode (which leaves remaining gas untouched) while Solidity uses an\\n * invalid opcode to revert (consuming all remaining gas).\\n *\\n * Requirements:\\n * - The divisor cannot be zero.\\n */\\n function mod(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {\\n require(b != 0, errorMessage);\\n return a % b;\\n }\\n}\\n\"\r\n },\r\n \"@openzeppelin/contracts/utils/Address.sol\": {\r\n \"content\": \"pragma solidity ^0.6.2;\\n\\n/**\\n * @dev Collection of functions related to the address type\\n */\\nlibrary Address {\\n /**\\n * @dev Returns true if `account` is a contract.\\n *\\n * [IMPORTANT]\\n * ====\\n * It is unsafe to assume that an address for which this function returns\\n * false is an externally-owned account (EOA) and not a contract.\\n *\\n * Among others, `isContract` will return false for the following\\n * types of addresses:\\n *\\n * - an externally-owned account\\n * - a contract in construction\\n * - an address where a contract will be created\\n * - an address where a contract lived, but was destroyed\\n * ====\\n */\\n function isContract(address account) internal view returns (bool) {\\n // According to EIP-1052, 0x0 is the value returned for not-yet created accounts\\n // and 0xc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470 is returned\\n // for accounts without code, i.e. `keccak256('')`\\n bytes32 codehash;\\n bytes32 accountHash = 0xc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470;\\n // solhint-disable-next-line no-inline-assembly\\n assembly { codehash := extcodehash(account) }\\n return (codehash != accountHash && codehash != 0x0);\\n }\\n\\n /**\\n * @dev Replacement for Solidity's `transfer`: sends `amount` wei to\\n * `recipient`, forwarding all available gas and reverting on errors.\\n *\\n * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost\\n * of certain opcodes, possibly making contracts go over the 2300 gas limit\\n * imposed by `transfer`, making them unable to receive funds via\\n * `transfer`. {sendValue} removes this limitation.\\n *\\n * https://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more].\\n *\\n * IMPORTANT: because control is transferred to `recipient`, care must be\\n * taken to not create reentrancy vulnerabilities. Consider using\\n * {ReentrancyGuard} or the\\n * https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].\\n */\\n function sendValue(address payable recipient, uint256 amount) internal {\\n require(address(this).balance >= amount, \\\"Address: insufficient balance\\\");\\n\\n // solhint-disable-next-line avoid-low-level-calls, avoid-call-value\\n (bool success, ) = recipient.call{ value: amount }(\\\"\\\");\\n require(success, \\\"Address: unable to send value, recipient may have reverted\\\");\\n }\\n}\\n\"\r\n },\r\n \"@openzeppelin/contracts/GSN/Context.sol\": {\r\n \"content\": \"pragma solidity ^0.6.0;\\n\\n/*\\n * @dev Provides information about the current execution context, including the\\n * sender of the transaction and its data. While these are generally available\\n * via msg.sender and msg.data, they should not be accessed in such a direct\\n * manner, since when dealing with GSN meta-transactions the account sending and\\n * paying for execution may not be the actual sender (as far as an application\\n * is concerned).\\n *\\n * This contract is only required for intermediate, library-like contracts.\\n */\\ncontract Context {\\n // Empty internal constructor, to prevent people from mistakenly deploying\\n // an instance of this contract, which should be used via inheritance.\\n constructor () internal { }\\n\\n function _msgSender() internal view virtual returns (address payable) {\\n return msg.sender;\\n }\\n\\n function _msgData() internal view virtual returns (bytes memory) {\\n this; // silence state mutability warning without generating bytecode - see https://github.com/ethereum/solidity/issues/2691\\n return msg.data;\\n }\\n}\\n\"\r\n },\r\n \"@openzeppelin/contracts/access/Ownable.sol\": {\r\n \"content\": \"pragma solidity ^0.6.0;\\n\\nimport \\\"../GSN/Context.sol\\\";\\n/**\\n * @dev Contract module which provides a basic access control mechanism, where\\n * there is an account (an owner) that can be granted exclusive access to\\n * specific functions.\\n *\\n * By default, the owner account will be the one that deploys the contract. This\\n * can later be changed with {transferOwnership}.\\n *\\n * This module is used through inheritance. It will make available the modifier\\n * `onlyOwner`, which can be applied to your functions to restrict their use to\\n * the owner.\\n */\\ncontract Ownable is Context {\\n address private _owner;\\n\\n event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);\\n\\n /**\\n * @dev Initializes the contract setting the deployer as the initial owner.\\n */\\n constructor () internal {\\n address msgSender = _msgSender();\\n _owner = msgSender;\\n emit OwnershipTransferred(address(0), msgSender);\\n }\\n\\n /**\\n * @dev Returns the address of the current owner.\\n */\\n function owner() public view returns (address) {\\n return _owner;\\n }\\n\\n /**\\n * @dev Throws if called by any account other than the owner.\\n */\\n modifier onlyOwner() {\\n require(_owner == _msgSender(), \\\"Ownable: caller is not the owner\\\");\\n _;\\n }\\n\\n /**\\n * @dev Leaves the contract without owner. It will not be possible to call\\n * `onlyOwner` functions anymore. Can only be called by the current owner.\\n *\\n * NOTE: Renouncing ownership will leave the contract without an owner,\\n * thereby removing any functionality that is only available to the owner.\\n */\\n function renounceOwnership() public virtual onlyOwner {\\n emit OwnershipTransferred(_owner, address(0));\\n _owner = address(0);\\n }\\n\\n /**\\n * @dev Transfers ownership of the contract to a new account (`newOwner`).\\n * Can only be called by the current owner.\\n */\\n function transferOwnership(address newOwner) public virtual onlyOwner {\\n require(newOwner != address(0), \\\"Ownable: new owner is the zero address\\\");\\n emit OwnershipTransferred(_owner, newOwner);\\n _owner = newOwner;\\n }\\n}\\n\"\r\n }\r\n },\r\n \"settings\": {\r\n \"optimizer\": {\r\n \"enabled\": false,\r\n \"runs\": 200\r\n },\r\n \"outputSelection\": {\r\n \"*\": {\r\n \"*\": [\r\n \"evm.bytecode\",\r\n \"evm.deployedBytecode\",\r\n \"devdoc\",\r\n \"userdoc\",\r\n \"metadata\",\r\n \"abi\"\r\n ]\r\n }\r\n },\r\n \"libraries\": {}\r\n }\r\n}}",
"ABI":"[{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"MUMMYAmount\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"bondAmount\",\"type\":\"uint256\"}],\"name\":\"BoughmBONDs\",\"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\":\"MUMMYAmount\",\"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\":\"MUMMY\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"MUMMYOracle\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"MUMMYPriceCeiling\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"MUMMYPriceOne\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"PERIOD\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"allocateSeigniorage\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"bondDepletionFloorPercent\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"bootstrapEpochs\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"bootstrapSupplyExpansionPercent\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_MUMMYAmount\",\"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\":\"gemBONDDiscountRate\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"_rate\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"gemBONDPremiumRate\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"_rate\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getBurnableMUMMYLeft\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"_burnableMUMMYLeft\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getMUMMYCirculatingSupply\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getMUMMYPrice\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"MUMMYPrice\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getMUMMYUpdatedPrice\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"_MUMMYPrice\",\"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\":[{\"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\":\"_MUMMY\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"_mBOND\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"_mSHARE\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"_MUMMYOracle\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"_masonry\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"_startTime\",\"type\":\"uint256\"}],\"name\":\"initialize\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"initialized\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"isInitialized\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"mBOND\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"mSHARE\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"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\":\"previousEpochMUMMYPrice\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_bondAmount\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"targetPrice\",\"type\":\"uint256\"}],\"name\":\"redeemBonds\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"seigniorageExpansionFloorPercent\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"seigniorageSaved\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_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\":[],\"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\"}]",
"ContractName":"Treasury",
"CompilerVersion":"v0.6.12+commit.27d51765",
"OptimizationUsed":"0",
"Runs":"200",
"ConstructorArguments":"",
"EVMVersion":"Default",
"Library":"",
"LicenseType":"",
"Proxy":"0",
"Implementation":"",
"SwarmSource":""
}
]
}
Verify Source Code
Submits a contract source code to FTMScan for verification.
📝 Note : This endpoint is limited to 100 verifications/day, regardless of API PRO tier.
Requires a valid FTMScan API key, it will be rejected otherwise
Only supports HTTP POST due to max transfer size limitations for HTTP GET
Supports up to 10 different library pairs
Contracts that use "imports" will need to have the code concatenated into one file as we do not support "imports" in separate files.
List of supported solc versions, only solc version v0.4.11 and above is supported e.g. v0.4.25+commit.59dbf8f1
Upon successful submission you will receive a GUID (50 characters) as a receipt
You may use this GUID to track the status of your submission
Verified Source Codes will be displayed at the Verified Contracts page.
Source Code Submission Gist
👇 Note: Upon successful submission, a GUID is returned, which can be used to check for submission status.
//Submit Source Code for Verification
$.ajax({
type: "POST", //Only POST supported
url: "//api.ftmscan.com/api", //Set to the correct API url for Other Networks
data: {
apikey: $('#apikey').val(), //A valid API-Key is required
module: 'contract', //Do not change
action: 'verifysourcecode', //Do not change
contractaddress: $('#contractaddress').val(), //Contract Address starts with 0x...
sourceCode: $('#sourceCode').val(), //Contract Source Code (Flattened if necessary)
codeformat: $('#codeformat').val(), //solidity-single-file (default) or solidity-standard-json-input (for std-input-json-format support
contractname: $('#contractname').val(), //ContractName (if codeformat=solidity-standard-json-input, then enter contractname as ex: erc20.sol:erc20)
compilerversion: $('#compilerversion').val(), // see https://ftmscan.com/solcversions for list of support versions
optimizationUsed: $('#optimizationUsed').val(), //0 = No Optimization, 1 = Optimization used (applicable when codeformat=solidity-single-file)
runs: 200, //set to 200 as default unless otherwise (applicable when codeformat=solidity-single-file)
constructorArguements: $('#constructorArguements').val(), //if applicable
evmversion: $('#evmVersion').val(), //leave blank for compiler default, homestead, tangerineWhistle, spuriousDragon, byzantium, constantinople, petersburg, istanbul (applicable when codeformat=solidity-single-file)
licenseType: $('#licenseType').val(), //Valid codes 1-12 where 1=No License .. 12=Apache 2.0, see https://ftmscan.com/contract-license-types
libraryname1: $('#libraryname1').val(), //if applicable, a matching pair with libraryaddress1 required
libraryaddress1: $('#libraryaddress1').val(), //if applicable, a matching pair with libraryname1 required
libraryname2: $('#libraryname2').val(), //if applicable, matching pair required
libraryaddress2: $('#libraryaddress2').val(), //if applicable, matching pair required
libraryname3: $('#libraryname3').val(), //if applicable, matching pair required
libraryaddress3: $('#libraryaddress3').val(), //if applicable, matching pair required
libraryname4: $('#libraryname4').val(), //if applicable, matching pair required
libraryaddress4: $('#libraryaddress4').val(), //if applicable, matching pair required
libraryname5: $('#libraryname5').val(), //if applicable, matching pair required
libraryaddress5: $('#libraryaddress5').val(), //if applicable, matching pair required
libraryname6: $('#libraryname6').val(), //if applicable, matching pair required
libraryaddress6: $('#libraryaddress6').val(), //if applicable, matching pair required
libraryname7: $('#libraryname7').val(), //if applicable, matching pair required
libraryaddress7: $('#libraryaddress7').val(), //if applicable, matching pair required
libraryname8: $('#libraryname8').val(), //if applicable, matching pair required
libraryaddress8: $('#libraryaddress8').val(), //if applicable, matching pair required
libraryname9: $('#libraryname9').val(), //if applicable, matching pair required
libraryaddress9: $('#libraryaddress9').val(), //if applicable, matching pair required
libraryname10: $('#libraryname10').val(), //if applicable, matching pair required
libraryaddress10: $('#libraryaddress10').val() //if applicable, matching pair required
},
success: function (result) {
console.log(result);
if (result.status == "1") {
//1 = submission success, use the guid returned (result.result) to check the status of your submission.
// Average time of processing is 30-60 seconds
document.getElementById("postresult").innerHTML = result.status + ";" + result.message + ";" + result.result;
// result.result is the GUID receipt for the submission, you can use this guid for checking the verification status
} else {
//0 = error
document.getElementById("postresult").innerHTML = result.status + ";" + result.message + ";" + result.result;
}
console.log("status : " + result.status);
console.log("result : " + result.result);
},
error: function (result) {
console.log("error!");
document.getElementById("postresult").innerHTML = "Unexpected Error"
}
});
Check Source Code Verification Submission Status
//Check Source Code Verification Status
$.ajax({
type: "GET",
url: "//api.ftmscan.com/api",
data: {
apikey: $('#apikey').val(),
guid: 'ezq878u486pzijkvvmerl6a9mzwhv6sefgvqi5tkwceejc7tvn', //Replace with your Source Code GUID receipt above
module: "contract",
action: "checkverifystatus"
},
success: function (result) {
console.log("status : " + result.status); //0=Error, 1=Pass
console.log("message : " + result.message); //OK, NOTOK
console.log("result : " + result.result); //result explanation
$('#guidstatus').html(">> " + result.result);
},
error: function (result) {
alert('error');
}
});
Verify Proxy Contract
Submits a proxy contract source code to FTMScan for verification.
Requires a valid FTMScan API key, it will be rejected otherwise
Current daily limit of 100 submissions per day per user (subject to change)
Only supports HTTP post
Upon successful submission you will receive a GUID (50 characters) as a receipt
You may use this GUID to track the status of your submission
Verified proxy contracts will display the "Read/Write as Proxy" of the implementation contract under the contract address's contract tab
Verifying Proxy Contract using cURL
// example with only the mandatory contract address parameter
curl -d "address=0xcbdcd3815b5f975e1a2c944a9b2cd1c985a1cb7f" "https://api.ftmscan.com/api?module=contract&action=verifyproxycontract&apikey=YourApiKeyToken"
// example using the expectedimplementation optional parameter
// the expectedimplementation enforces a check to ensure the returned implementation contract address == address picked up by the verifier
curl -d "address=0xbc46363a7669f6e12353fa95bb067aead3675c29&expectedimplementation=0xe45a5176bc0f2c1198e2451c4e4501d4ed9b65a6" "https://api.ftmscan.com/api?module=contract&action=verifyproxycontract&apikey=YourApiKeyToken"
// OK
{"status":"1","message":"OK","result":"gwgrrnfy56zf6vc1fljuejwg6pelnc5yns6fg6y2i6zfpgzquz"}
// NOTOK
{"status":"0","message":"NOTOK","result":"Invalid API Key"}
Checking Proxy Contract Verification Submission Status using cURL
curl "https://api.ftmscan.com/api?module=contract&action=checkproxyverification&guid=gwgrrnfy56zf6vc1fljuejwg6pelnc5yns6fg6y2i6zfpgzquz&apikey=YourApiKeyToken"
// OK
{"status":"1","message":"OK","result":"The proxy's (0xbc46363a7669f6e12353fa95bb067aead3675c29) implementation contract is found at 0xe45a5176bc0f2c1198e2451c4e4501d4ed9b65a6 and is successfully updated."}
// NOTOK
{"status":"0","message":"NOTOK","result":"A corresponding implementation contract was unfortunately not detected for the proxy address."}
Last updated