Boardroom
The Boardroom contract handles dividend claims from Share holders
Code
Boardroom.sol
Deployed at [0xcontract_address] on the Ethereum mainnet, [other_testnets] testnets.
This contract is yet to be deployed.
State
directors
mapping (address => Boardseat) private directors;
struct Boardseat {
uint256 appointmentTime;
uint256 shares;
}A map that records the current state of Basis Share stakers.
addressis the Share staker's address.appointmentTimeis the block timestamp of last (deposit / withdrawal / dividend claim) of an account.sharesis the account's current number of shares staked.
boardHistory
BoardSnapshot[] private boardHistory
struct BoardSnapshot {
uint256 timestamp;
uint256 rewardReceived;
uint256 totalShares;
}An array that records the history of past seigniorage events. This array is used to calculate the amount of dividends that a specific Share holder has accrued. New elements are added to boardHistory whenever Basis Cash is newly minted to the Boardroom contract.
timestampis the block timestamp when new seigniorage was added.rewardReceivedis the amount of Basis Cash seigniorage that was newly added.totalSharesis the total number of staked shares at the time of seigniorage generation.
Events
Staked
event Staked(address indexed user, uint256 amount);Emitted when Shares are staked via stake.
Withdrawn
event Withdrawn(address indexed user, uint256 amount);Emitted when staked Shares are withdrawn via withdraw.
RewardPaid
event RewardPaid(address indexed user, uint256 reward);Emitted when Share dividends are paid via claimDividends.
RewardAdded
event RewardAdded(uint256 reward);Emitted when new seigniorage is added, and the boardHistory is updated via allocateSeigniorage.
Modifiers
directorExists
modifier directorExistsChecks whether sender has Shares staked.
Functions
Stake
function stake(uint256 amount) external nonReentrantStakes amount Basis Shares to Boardroom sends all prior accrued dividends to sender if there is any.
withdraw
function withdraw(uint256 amount) public nonReentrantWithdraws amount Basis Shares and all accrued dividends to sender.
exit
function exit() externalWithdraws all staked Basis Shares and all accrued dividends to sender.
getCashEarnings
function getCashEarnings() public view returns (uint256)Returns the amount of all dividends accrued by sender.
claimDividends
function claimDividends() public directorExistsClaims all accrued dividends to sender.
allocateSeigniorage
function allocateSeigniorage(uint256 amount) externalExecuted when new seigniorage is assigned to the Boardroom contract. Records the current block timestamp, the amount of new Basis Cash seigniorage, and the current amount of total Shares staked to boardHistory.
Last updated
Was this helpful?