编译器
0.6.12+commit.27d51765
文件 1 的 19:Address.sol
pragma solidity ^0.6.2;
library Address {
function isContract(address account) internal view returns (bool) {
uint256 size;
assembly { size := extcodesize(account) }
return size > 0;
}
function sendValue(address payable recipient, uint256 amount) internal {
require(address(this).balance >= amount, "Address: insufficient balance");
(bool success, ) = recipient.call{ value: amount }("");
require(success, "Address: unable to send value, recipient may have reverted");
}
function functionCall(address target, bytes memory data) internal returns (bytes memory) {
return functionCall(target, data, "Address: low-level call failed");
}
function functionCall(address target, bytes memory data, string memory errorMessage) internal returns (bytes memory) {
return _functionCallWithValue(target, data, 0, errorMessage);
}
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");
}
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");
return _functionCallWithValue(target, data, value, errorMessage);
}
function _functionCallWithValue(address target, bytes memory data, uint256 weiValue, string memory errorMessage) private returns (bytes memory) {
require(isContract(target), "Address: call to non-contract");
(bool success, bytes memory returndata) = target.call{ value: weiValue }(data);
if (success) {
return returndata;
} else {
if (returndata.length > 0) {
assembly {
let returndata_size := mload(returndata)
revert(add(32, returndata), returndata_size)
}
} else {
revert(errorMessage);
}
}
}
}
文件 2 的 19: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;
}
}
}
文件 3 的 19:Context.sol
pragma solidity ^0.6.0;
abstract contract Context {
function _msgSender() internal view virtual returns (address payable) {
return msg.sender;
}
function _msgData() internal view virtual returns (bytes memory) {
this;
return msg.data;
}
}
文件 4 的 19: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;
}
}
文件 5 的 19:Epoch.sol
pragma solidity ^0.6.0;
import '@openzeppelin/contracts/math/SafeMath.sol';
import '../owner/Operator.sol';
contract Epoch is Operator {
using SafeMath for uint256;
uint256 private period;
uint256 private startTime;
uint256 private epoch;
constructor(
uint256 _period,
uint256 _startTime,
uint256 _startEpoch
) public {
period = _period;
startTime = _startTime;
epoch = _startEpoch;
}
modifier checkStartTime {
require(now >= startTime, 'Epoch: not started yet');
_;
}
modifier checkEpoch {
require(now >= nextEpochPoint(), 'Epoch: not allowed');
_;
epoch = epoch.add(1);
}
function getCurrentEpoch() public view returns (uint256) {
return epoch;
}
function getPeriod() public view returns (uint256) {
return period;
}
function getStartTime() public view returns (uint256) {
return startTime;
}
function nextEpochPoint() public view returns (uint256) {
return startTime.add(epoch.mul(period));
}
function setPeriod(uint256 _period) external onlyOperator {
period = _period;
}
}
文件 6 的 19:FixedPoint.sol
pragma solidity ^0.6.0;
import './Babylonian.sol';
library FixedPoint {
struct uq112x112 {
uint224 _x;
}
struct uq144x112 {
uint256 _x;
}
uint8 private constant RESOLUTION = 112;
uint256 private constant Q112 = uint256(1) << RESOLUTION;
uint256 private constant Q224 = Q112 << RESOLUTION;
function encode(uint112 x) internal pure returns (uq112x112 memory) {
return uq112x112(uint224(x) << RESOLUTION);
}
function encode144(uint144 x) internal pure returns (uq144x112 memory) {
return uq144x112(uint256(x) << RESOLUTION);
}
function div(uq112x112 memory self, uint112 x)
internal
pure
returns (uq112x112 memory)
{
require(x != 0, 'FixedPoint: DIV_BY_ZERO');
return uq112x112(self._x / uint224(x));
}
function mul(uq112x112 memory self, uint256 y)
internal
pure
returns (uq144x112 memory)
{
uint256 z;
require(
y == 0 || (z = uint256(self._x) * y) / y == uint256(self._x),
'FixedPoint: MULTIPLICATION_OVERFLOW'
);
return uq144x112(z);
}
function fraction(uint112 numerator, uint112 denominator)
internal
pure
returns (uq112x112 memory)
{
require(denominator > 0, 'FixedPoint: DIV_BY_ZERO');
return uq112x112((uint224(numerator) << RESOLUTION) / denominator);
}
function decode(uq112x112 memory self) internal pure returns (uint112) {
return uint112(self._x >> RESOLUTION);
}
function decode144(uq144x112 memory self) internal pure returns (uint144) {
return uint144(self._x >> RESOLUTION);
}
function reciprocal(uq112x112 memory self)
internal
pure
returns (uq112x112 memory)
{
require(self._x != 0, 'FixedPoint: ZERO_RECIPROCAL');
return uq112x112(uint224(Q224 / self._x));
}
function sqrt(uq112x112 memory self)
internal
pure
returns (uq112x112 memory)
{
return uq112x112(uint224(Babylonian.sqrt(uint256(self._x)) << 56));
}
}
文件 7 的 19:IBoardroom.sol
pragma solidity ^0.6.0;
interface IBoardroom {
function allocateSeigniorage(uint256 amount) external;
}
文件 8 的 19:IERC20.sol
pragma solidity ^0.6.0;
interface IERC20 {
function totalSupply() external view returns (uint256);
function balanceOf(address account) external view returns (uint256);
function transfer(address recipient, uint256 amount) external returns (bool);
function allowance(address owner, address spender) external view returns (uint256);
function approve(address spender, uint256 amount) external returns (bool);
function transferFrom(address sender, address recipient, uint256 amount) external returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
event Approval(address indexed owner, address indexed spender, uint256 value);
}
文件 9 的 19:IKlondikeAsset.sol
pragma solidity ^0.6.0;
interface IKlondikeAsset {
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);
}
文件 10 的 19:IOracle.sol
pragma solidity ^0.6.0;
interface IOracle {
function update() external;
function consult(address token, uint256 amountIn)
external
view
returns (uint256 amountOut);
}
文件 11 的 19:ISimpleERCFund.sol
pragma solidity ^0.6.0;
interface ISimpleERCFund {
function deposit(
address token,
uint256 amount,
string memory reason
) external;
function withdraw(
address token,
uint256 amount,
address to,
string memory reason
) external;
}
文件 12 的 19:Math.sol
pragma solidity ^0.6.0;
library Math {
function max(uint256 a, uint256 b) internal pure returns (uint256) {
return a >= b ? a : b;
}
function min(uint256 a, uint256 b) internal pure returns (uint256) {
return a < b ? a : b;
}
function average(uint256 a, uint256 b) internal pure returns (uint256) {
return (a / 2) + (b / 2) + ((a % 2 + b % 2) / 2);
}
}
文件 13 的 19:Operator.sol
pragma solidity ^0.6.0;
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_;
}
}
文件 14 的 19:Ownable.sol
pragma solidity ^0.6.0;
import "../GSN/Context.sol";
contract Ownable is Context {
address private _owner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
constructor () internal {
address msgSender = _msgSender();
_owner = msgSender;
emit OwnershipTransferred(address(0), msgSender);
}
function owner() public view returns (address) {
return _owner;
}
modifier onlyOwner() {
require(_owner == _msgSender(), "Ownable: caller is not the owner");
_;
}
function renounceOwnership() public virtual onlyOwner {
emit OwnershipTransferred(_owner, address(0));
_owner = address(0);
}
function transferOwnership(address newOwner) public virtual onlyOwner {
require(newOwner != address(0), "Ownable: new owner is the zero address");
emit OwnershipTransferred(_owner, newOwner);
_owner = newOwner;
}
}
文件 15 的 19:ReentrancyGuard.sol
pragma solidity ^0.6.0;
contract ReentrancyGuard {
uint256 private constant _NOT_ENTERED = 1;
uint256 private constant _ENTERED = 2;
uint256 private _status;
constructor () internal {
_status = _NOT_ENTERED;
}
modifier nonReentrant() {
require(_status != _ENTERED, "ReentrancyGuard: reentrant call");
_status = _ENTERED;
_;
_status = _NOT_ENTERED;
}
}
文件 16 的 19:Safe112.sol
pragma solidity ^0.6.0;
library Safe112 {
function add(uint112 a, uint112 b) internal pure returns (uint256) {
uint256 c = a + b;
require(c >= a, 'Safe112: addition overflow');
return c;
}
function sub(uint112 a, uint112 b) internal pure returns (uint256) {
return sub(a, b, 'Safe112: subtraction overflow');
}
function sub(
uint112 a,
uint112 b,
string memory errorMessage
) internal pure returns (uint112) {
require(b <= a, errorMessage);
uint112 c = a - b;
return c;
}
function mul(uint112 a, uint112 b) internal pure returns (uint256) {
if (a == 0) {
return 0;
}
uint256 c = a * b;
require(c / a == b, 'Safe112: multiplication overflow');
return c;
}
function div(uint112 a, uint112 b) internal pure returns (uint256) {
return div(a, b, 'Safe112: division by zero');
}
function div(
uint112 a,
uint112 b,
string memory errorMessage
) internal pure returns (uint112) {
require(b > 0, errorMessage);
uint112 c = a / b;
return c;
}
function mod(uint112 a, uint112 b) internal pure returns (uint256) {
return mod(a, b, 'Safe112: modulo by zero');
}
function mod(
uint112 a,
uint112 b,
string memory errorMessage
) internal pure returns (uint112) {
require(b != 0, errorMessage);
return a % b;
}
}
文件 17 的 19:SafeERC20.sol
pragma solidity ^0.6.0;
import "./IERC20.sol";
import "../../math/SafeMath.sol";
import "../../utils/Address.sol";
library SafeERC20 {
using SafeMath for uint256;
using Address for address;
function safeTransfer(IERC20 token, address to, uint256 value) internal {
_callOptionalReturn(token, abi.encodeWithSelector(token.transfer.selector, to, value));
}
function safeTransferFrom(IERC20 token, address from, address to, uint256 value) internal {
_callOptionalReturn(token, abi.encodeWithSelector(token.transferFrom.selector, from, to, value));
}
function safeApprove(IERC20 token, address spender, uint256 value) internal {
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));
}
function _callOptionalReturn(IERC20 token, bytes memory data) private {
bytes memory returndata = address(token).functionCall(data, "SafeERC20: low-level call failed");
if (returndata.length > 0) {
require(abi.decode(returndata, (bool)), "SafeERC20: ERC20 operation did not succeed");
}
}
}
文件 18 的 19:SafeMath.sol
pragma solidity ^0.6.0;
library SafeMath {
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
require(c >= a, "SafeMath: addition overflow");
return c;
}
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
return sub(a, b, "SafeMath: subtraction overflow");
}
function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b <= a, errorMessage);
uint256 c = a - b;
return c;
}
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;
}
function div(uint256 a, uint256 b) internal pure returns (uint256) {
return div(a, b, "SafeMath: division by zero");
}
function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b > 0, errorMessage);
uint256 c = a / b;
return c;
}
function mod(uint256 a, uint256 b) internal pure returns (uint256) {
return mod(a, b, "SafeMath: modulo by zero");
}
function mod(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b != 0, errorMessage);
return a % b;
}
}
文件 19 的 19:Treasury.sol
pragma solidity ^0.6.0;
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 './interfaces/IOracle.sol';
import './interfaces/IBoardroom.sol';
import './interfaces/IKlondikeAsset.sol';
import './interfaces/ISimpleERCFund.sol';
import './lib/Babylonian.sol';
import './lib/FixedPoint.sol';
import './lib/Safe112.sol';
import './owner/Operator.sol';
import './utils/Epoch.sol';
import './utils/ContractGuard.sol';
contract Treasury is ContractGuard, Epoch {
using FixedPoint for *;
using SafeERC20 for IERC20;
using Address for address;
using SafeMath for uint256;
using Safe112 for uint112;
bool public migrated = false;
bool public initialized = false;
address public devfund;
address public stablefund;
address public kbtc;
address public kbond;
address public klon;
address public boardroom;
address public kbondOracle;
address public seigniorageOracle;
uint256 public constant kbtcOneUnit = 1e18;
uint256 public constant wbtcOneUnit = 1e8;
uint256 public kbtcPriceCeiling;
uint256 private accumulatedSeigniorage = 0;
uint256 public devfundAllocationRate = 2;
uint256 public stablefundAllocationRate = 50;
constructor(
address _kbtc,
address _kbond,
address _klon,
address _kbondOracle,
address _seigniorageOracle,
address _boardroom,
address _devfund,
address _stablefund,
uint256 _startTime,
uint256 _period
) public Epoch(_period, _startTime, 0) {
kbtc = _kbtc;
kbond = _kbond;
klon = _klon;
kbondOracle = _kbondOracle;
seigniorageOracle = _seigniorageOracle;
boardroom = _boardroom;
devfund = _devfund;
stablefund = _stablefund;
kbtcPriceCeiling = uint256(105).mul(wbtcOneUnit).div(10**2);
}
modifier checkMigration {
require(!migrated, 'Treasury: migrated');
_;
}
modifier checkOperator {
require(
IKlondikeAsset(kbtc).operator() == address(this) &&
IKlondikeAsset(kbond).operator() == address(this) &&
IKlondikeAsset(klon).operator() == address(this) &&
Operator(boardroom).operator() == address(this),
'Treasury: need more permission'
);
_;
}
function getReserve() public view returns (uint256) {
return accumulatedSeigniorage;
}
function getKbondOraclePrice() public view returns (uint256) {
return _getKBTCPrice(kbondOracle);
}
function getSeigniorageOraclePrice() public view returns (uint256) {
return _getKBTCPrice(seigniorageOracle);
}
function _getKBTCPrice(address oracle) internal view returns (uint256) {
try IOracle(oracle).consult(kbtc, kbtcOneUnit) returns (uint256 price) {
return price;
} catch {
revert('Treasury: failed to consult kbtc price from the oracle');
}
}
function initialize() public checkOperator {
require(!initialized, 'Treasury: initialized');
IKlondikeAsset(kbtc).burn(IERC20(kbtc).balanceOf(address(this)));
accumulatedSeigniorage = IERC20(kbtc).balanceOf(address(this));
initialized = true;
emit Initialized(msg.sender, block.number);
}
function migrate(address target) public onlyOperator checkOperator {
require(!migrated, 'Treasury: migrated');
Operator(kbtc).transferOperator(target);
Operator(kbtc).transferOwnership(target);
IERC20(kbtc).transfer(target, IERC20(kbtc).balanceOf(address(this)));
Operator(kbond).transferOperator(target);
Operator(kbond).transferOwnership(target);
IERC20(kbond).transfer(target, IERC20(kbond).balanceOf(address(this)));
Operator(klon).transferOperator(target);
Operator(klon).transferOwnership(target);
IERC20(klon).transfer(target, IERC20(klon).balanceOf(address(this)));
migrated = true;
emit Migration(target);
}
function setDevFund(address newFund) public onlyOperator {
devfund = newFund;
emit DevFundChanged(msg.sender, newFund);
}
function setDevFundAllocationRate(uint256 rate) public onlyOperator {
devfundAllocationRate = rate;
emit DevFundRateChanged(msg.sender, rate);
}
function setStableFund(address newFund) public onlyOperator {
stablefund = newFund;
emit StableFundChanged(msg.sender, newFund);
}
function setStableFundAllocationRate(uint256 rate) public onlyOperator {
stablefundAllocationRate = rate;
emit StableFundRateChanged(msg.sender, rate);
}
function setKBTCPriceCeiling(uint256 percentage) public onlyOperator {
kbtcPriceCeiling = percentage.mul(wbtcOneUnit).div(10**2);
}
function _updateKBTCPrice() internal {
try IOracle(kbondOracle).update() {} catch {}
try IOracle(seigniorageOracle).update() {} catch {}
}
function buyKbonds(uint256 amount, uint256 targetPrice)
external
onlyOneBlock
checkMigration
checkStartTime
checkOperator
{
require(
amount > 0,
'Treasury: cannot purchase kbonds with zero amount'
);
uint256 kbondPrice = getKbondOraclePrice();
require(kbondPrice == targetPrice, 'Treasury: kbtc price moved');
require(
kbondPrice < wbtcOneUnit,
'Treasury: kbtcPrice not eligible for kbond purchase'
);
IKlondikeAsset(kbtc).burnFrom(msg.sender, amount);
IKlondikeAsset(kbond).mint(
msg.sender,
amount.mul(wbtcOneUnit).div(kbondPrice)
);
_updateKBTCPrice();
emit BoughtKbonds(msg.sender, amount);
}
function redeemKbonds(uint256 amount, uint256 targetPrice)
external
onlyOneBlock
checkMigration
checkStartTime
checkOperator
{
require(amount > 0, 'Treasury: cannot redeem kbonds with zero amount');
uint256 kbtcPrice = _getKBTCPrice(kbondOracle);
require(kbtcPrice == targetPrice, 'Treasury: kbtc price moved');
require(
kbtcPrice > kbtcPriceCeiling,
'Treasury: kbtcPrice not eligible for kbond purchase'
);
require(
IERC20(kbtc).balanceOf(address(this)) >= amount,
'Treasury: treasury has no more budget'
);
accumulatedSeigniorage = accumulatedSeigniorage.sub(
Math.min(accumulatedSeigniorage, amount)
);
IKlondikeAsset(kbond).burnFrom(msg.sender, amount);
IERC20(kbtc).safeTransfer(msg.sender, amount);
_updateKBTCPrice();
emit RedeemedKbonds(msg.sender, amount);
}
function allocateSeigniorage()
external
onlyOneBlock
checkMigration
checkStartTime
checkEpoch
checkOperator
{
_updateKBTCPrice();
uint256 kbtcPrice = getSeigniorageOraclePrice();
if (kbtcPrice <= kbtcPriceCeiling) {
return;
}
uint256 kbtcSupply =
IERC20(kbtc).totalSupply().sub(accumulatedSeigniorage);
uint256 percentage = kbtcPrice.sub(wbtcOneUnit);
uint256 seigniorage = kbtcSupply.mul(percentage).div(wbtcOneUnit);
IKlondikeAsset(kbtc).mint(address(this), seigniorage);
uint256 devfundReserve =
seigniorage.mul(devfundAllocationRate).div(100);
if (devfundReserve > 0) {
IERC20(kbtc).safeApprove(devfund, devfundReserve);
ISimpleERCFund(devfund).deposit(
kbtc,
devfundReserve,
'Treasury: Seigniorage Allocation'
);
emit DevFundFunded(now, devfundReserve);
}
seigniorage = seigniorage.sub(devfundReserve);
uint256 treasuryReserve =
Math.min(
seigniorage,
IERC20(kbond).totalSupply().sub(accumulatedSeigniorage)
);
if (treasuryReserve > 0) {
accumulatedSeigniorage = accumulatedSeigniorage.add(
treasuryReserve
);
emit TreasuryFunded(now, treasuryReserve);
}
seigniorage = seigniorage.sub(treasuryReserve);
uint256 stablefundReserve =
seigniorage.mul(stablefundAllocationRate).div(100);
if (stablefundReserve > 0) {
IERC20(kbtc).safeTransfer(stablefund, stablefundReserve);
emit StableFundFunded(now, stablefundReserve);
}
seigniorage = seigniorage.sub(stablefundReserve);
uint256 boardroomReserve = seigniorage;
if (boardroomReserve > 0) {
IERC20(kbtc).safeApprove(boardroom, boardroomReserve);
IBoardroom(boardroom).allocateSeigniorage(boardroomReserve);
emit BoardroomFunded(now, boardroomReserve);
}
}
event Initialized(address indexed executor, uint256 at);
event Migration(address indexed target);
event DevFundChanged(address indexed operator, address newFund);
event DevFundRateChanged(address indexed operator, uint256 newRate);
event StableFundChanged(address indexed operator, address newFund);
event StableFundRateChanged(address indexed operator, uint256 newRate);
event RedeemedKbonds(address indexed from, uint256 amount);
event BoughtKbonds(address indexed from, uint256 amount);
event TreasuryFunded(uint256 timestamp, uint256 seigniorage);
event BoardroomFunded(uint256 timestamp, uint256 seigniorage);
event DevFundFunded(uint256 timestamp, uint256 seigniorage);
event StableFundFunded(uint256 timestamp, uint256 seigniorage);
}
{
"compilationTarget": {
"contracts/Treasury.sol": "Treasury"
},
"evmVersion": "istanbul",
"libraries": {},
"metadata": {
"bytecodeHash": "ipfs"
},
"optimizer": {
"enabled": true,
"runs": 999999
},
"remappings": []
}
[{"inputs":[{"internalType":"address","name":"_kbtc","type":"address"},{"internalType":"address","name":"_kbond","type":"address"},{"internalType":"address","name":"_klon","type":"address"},{"internalType":"address","name":"_kbondOracle","type":"address"},{"internalType":"address","name":"_seigniorageOracle","type":"address"},{"internalType":"address","name":"_boardroom","type":"address"},{"internalType":"address","name":"_devfund","type":"address"},{"internalType":"address","name":"_stablefund","type":"address"},{"internalType":"uint256","name":"_startTime","type":"uint256"},{"internalType":"uint256","name":"_period","type":"uint256"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"timestamp","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"seigniorage","type":"uint256"}],"name":"BoardroomFunded","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"from","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"BoughtKbonds","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"operator","type":"address"},{"indexed":false,"internalType":"address","name":"newFund","type":"address"}],"name":"DevFundChanged","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":"operator","type":"address"},{"indexed":false,"internalType":"uint256","name":"newRate","type":"uint256"}],"name":"DevFundRateChanged","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":true,"internalType":"address","name":"target","type":"address"}],"name":"Migration","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOperator","type":"address"},{"indexed":true,"internalType":"address","name":"newOperator","type":"address"}],"name":"OperatorTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"from","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"RedeemedKbonds","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"operator","type":"address"},{"indexed":false,"internalType":"address","name":"newFund","type":"address"}],"name":"StableFundChanged","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"timestamp","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"seigniorage","type":"uint256"}],"name":"StableFundFunded","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"operator","type":"address"},{"indexed":false,"internalType":"uint256","name":"newRate","type":"uint256"}],"name":"StableFundRateChanged","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":"allocateSeigniorage","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"boardroom","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"uint256","name":"targetPrice","type":"uint256"}],"name":"buyKbonds","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"devfund","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"devfundAllocationRate","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getCurrentEpoch","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getKbondOraclePrice","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getPeriod","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getReserve","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getSeigniorageOraclePrice","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getStartTime","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"initialize","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"initialized","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"isOperator","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"kbond","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"kbondOracle","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"kbtc","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"kbtcOneUnit","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"kbtcPriceCeiling","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"klon","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"target","type":"address"}],"name":"migrate","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"migrated","outputs":[{"internalType":"bool","name":"","type":"bool"}],"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":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"uint256","name":"targetPrice","type":"uint256"}],"name":"redeemKbonds","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"seigniorageOracle","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"newFund","type":"address"}],"name":"setDevFund","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"rate","type":"uint256"}],"name":"setDevFundAllocationRate","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"percentage","type":"uint256"}],"name":"setKBTCPriceCeiling","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_period","type":"uint256"}],"name":"setPeriod","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newFund","type":"address"}],"name":"setStableFund","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"rate","type":"uint256"}],"name":"setStableFundAllocationRate","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"stablefund","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"stablefundAllocationRate","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"newOperator_","type":"address"}],"name":"transferOperator","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"wbtcOneUnit","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"}]