Basis Cash
Search…
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

1
mapping (address => Boardseat) private directors;
2
3
struct Boardseat {
4
uint256 appointmentTime;
5
uint256 shares;
6
}
Copied!
A map that records the current state of Basis Share stakers.
    address is the Share staker's address.
    appointmentTime is the block timestamp of last (deposit / withdrawal / dividend claim) of an account.
    shares is the account's current number of shares staked.

boardHistory

1
BoardSnapshot[] private boardHistory
2
3
struct BoardSnapshot {
4
uint256 timestamp;
5
uint256 rewardReceived;
6
uint256 totalShares;
7
}
Copied!
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.
    timestamp is the block timestamp when new seigniorage was added.
    rewardReceived is the amount of Basis Cash seigniorage that was newly added.
    totalShares is the total number of staked shares at the time of seigniorage generation.

Events

Staked

1
event Staked(address indexed user, uint256 amount);
Copied!
Emitted when Shares are staked via stake.

Withdrawn

1
event Withdrawn(address indexed user, uint256 amount);
Copied!
Emitted when staked Shares are withdrawn via withdraw.

RewardPaid

1
event RewardPaid(address indexed user, uint256 reward);
Copied!
Emitted when Share dividends are paid via claimDividends.

RewardAdded

1
event RewardAdded(uint256 reward);
Copied!
Emitted when new seigniorage is added, and the boardHistory is updated via allocateSeigniorage.

Modifiers

directorExists

1
modifier directorExists
Copied!
Checks whether sender has Shares staked.

Functions

Stake

1
function stake(uint256 amount) external nonReentrant
Copied!
Stakes amount Basis Shares to Boardroom sends all prior accrued dividends to sender if there is any.

withdraw

1
function withdraw(uint256 amount) public nonReentrant
Copied!
Withdraws amount Basis Shares and all accrued dividends to sender.

exit

1
function exit() external
Copied!
Withdraws all staked Basis Shares and all accrued dividends to sender.

getCashEarnings

1
function getCashEarnings() public view returns (uint256)
Copied!
Returns the amount of all dividends accrued by sender.

claimDividends

1
function claimDividends() public directorExists
Copied!
Claims all accrued dividends to sender.

allocateSeigniorage

1
function allocateSeigniorage(uint256 amount) external
Copied!
Executed 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 modified 10mo ago