Basis Cash
Search…
Token Distributor
The Token Distributor contract handles the distribution of Basis Cash and Basis Shares to token stakers.

Code

Contract
Mainnet Address
Testnet Address
BACDAIPool.sol
[0xcontract_address]
[0xcontract_address]
BACSUSDPool.sol
[0xcontract_address]
[0xcontract_address]
BACUSDCPool.sol
[0xcontract_address]
[0xcontract_address]
BACUSDTPool.sol
[0xcontract_address]
[0xcontract_address]
BACyCRVPool.sol
[0xcontract_address]
[0xcontract_address]
DAIBACLPTokenSharePool.sol
[0xcontract_address]
[0xcontract_address]
DAIBASLPTokenSharePool.sol
[0xcontract_address]
[0xcontract_address]
This contract is yet to be deployed.

State

Config
1
uint256 public DURATION = 5 days;
2
uint256 public starttime = 1600831965;
3
uint256 public periodFinish = 0;
4
uint256 public rewardRate = 0;
Copied!
Stores protocol parameters
  • DURATION is the duration of token distribution.
  • starttime is the time when token distribution starts.
  • periodFinish is the time when token distribution ends.
  • rewardRate is

lastUpdateTime

1
uint256 public lastUpdateTime;
Copied!

rewardPerTokenStored

1
uint256 public rewardPerTokenStored;
Copied!

userRewardPerTokenPaid

1
mapping(address => uint256) public userRewardPerTokenPaid;
Copied!
  • address is
  • uint256 is

rewards

1
mapping(address => uint256) public rewards;
Copied!
  • address is
  • uint256 is

deposits

1
mapping(address => uint256) public deposits;
Copied!
  • address is
  • uint256 is

Events

RewardAdded

1
event RewardAdded(uint256 reward);
Copied!
Emitted when rewards a

Staked

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

Withdrawn

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

RewardPaid

1
event RewardPaid(address indexed user, uint reward);
Copied!
Emitted when

Modifiers

checkStart

1
modifier checkStart()
Copied!
Checks whether distribution of tokens have started.

updateReward

1
modifier updateReward(address account)
Copied!
Updates the amount of rewards accrued by account.

Functions

lastTimeRewardApplicable

1
function lastTimeRewardApplicable() public view returns (uint256)
Copied!

rewardPerToken

1
function rewardPerToken() public view returns (uint256)
Copied!

earned

1
function earned(address account) public view returns (uint256)
Copied!
  • account is

getReward

1
function getReward() public updateReward(msg.sender) checkStart
Copied!

notifyRewardAmount

1
function notifyRewardAmount(uint256 reward) external overrid onlyRewardDistribution updateReward(address(0))
Copied!
  • reward is

Stake

1
function stake(uint256 amount) public override updateReward(msg.sender) checkStart
Copied!
Stakes amount stablecoins to the distribution contract. Emits Staked.
  • amount is the amount of stablecoins being staked.

[Internal] Stake

1
function stake(uint256 amount) public virtual
Copied!
Performs staking by transferring stablecoins from the staker to the distribution contract.
  • amount is the amount of stablecoins being staked.

Withdraw

1
function withdraw(uint256 amount) public override updateReward(msg.sender) checkStart
Copied!
Withdraws amount stablecoins from the distribution contract. Emits Withdrawn.

[Internal] Withdraw

1
function withdraw(uint256 amount) public virtual
Copied!
Performs withdrawal by transferring stablecoins from the distribution contract to the withdrawer.
  • amount is the amount of stablecoins being withdrawn.

Exit

1
function exit() external
Copied!
WIthdraws all staked stablecoins to the sender.
Last modified 1yr ago