Treasury
The Treasury contract handles bond purchases and redemptions
Code
Treasury.sol
Deployed at [0xcontract_address] on the Ethereum mainnet, [other_testnets] testnets.
This contract is yet to be deployed.
Events
RedeemedBonds
event RedeemedBonds(address indexed from, uint256 amount);Emitted when Basis Bonds are redeemed via redeemBonds.
BoughtBonds
event BoughtBonds(address indexed from, uint256 amount);Emitted when Basis Bonds are bought via buyBonds.
TreasuryFunded
event TreasuryFunded(uint256 timestamp, uint256 seigniorage);Emitted when new Basis Cash is minted to the Treasury via allocateSeigniorage.
BoardroomFunded
event BoardroomFunded(uint256 timestamp, uint256 seigniorage);Emitted when new Basis Cash is minted to the Boardroom via allocateSeigniorage.
Modifiers
allocationTimeRipe
modifier allocationTimeRipeChecks whether a day has passed since the last successful execution of allocateSeigniorage.
Functions
getCashPrice
function getCashPrice() internal returns (uint cashPrice)Returns the oracle price of Basis Cash denominated in DAI.
buyBonds
function buyBonds(uint256 amount) externalMints amount / bondPrice Basis Bonds, in exchange for amount Basis Cash burnt.
amountis the amount of Basis Cash used in the purchase.Emits
BoughtBonds.
redeemBonds
function redeemBonds(uint256 amount) externalIf the Basis Cash price is above 1 DAI, mints amount Basis Cash, in exchange for amount Basis Bonds burnt.
amountis the number of Basis Bonds to redeem.Emits
RedeemedBonds.
allocateSeigniorage
function allocateSeigniorage() external allocationTimeRipeIf the oracle price of Basis Cash is above (1+ε) DAI, mints ((BAC Oracle Price) - 1) * cashSupply number of Basis Cash to either the Boardroom contract or the Treasury contract.
If the Treasury's balance is below 1,000 BAC, seigniorage is given to the Treasury. Emits
TreasuryFunded.If the Treasury's balance is above 1,000 BAC, seigniorage is given to the Boardroom. Emits
BoardroomFunded.
Last updated
Was this helpful?