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

uint256 public DURATION = 5 days;
uint256 public starttime = 1600831965;
uint256 public periodFinish = 0;
uint256 public rewardRate = 0;

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

uint256 public lastUpdateTime;

rewardPerTokenStored

uint256 public rewardPerTokenStored;

userRewardPerTokenPaid

mapping(address => uint256) public userRewardPerTokenPaid;

  • address is

  • uint256 is

rewards

mapping(address => uint256) public rewards;

  • address is

  • uint256 is

deposits

mapping(address => uint256) public deposits;

  • address is

  • uint256 is

Events

RewardAdded

event RewardAdded(uint256 reward);

Emitted when rewards a

Staked

event Staked(address indexed user, uint256 amount);

Emitted when tokens are staked via stake.

Withdrawn

event Withdrawn(address indexed user, uint256 amount);

Emitted when staked tokens are withdrawn via withdraw.

RewardPaid

event RewardPaid(address indexed user, uint reward);

Emitted when

Modifiers

checkStart

modifier checkStart()

Checks whether distribution of tokens have started.

updateReward

modifier updateReward(address account)

Updates the amount of rewards accrued by account.

Functions

lastTimeRewardApplicable

function lastTimeRewardApplicable() public view returns (uint256)

rewardPerToken

function rewardPerToken() public view returns (uint256)

earned

function earned(address account) public view returns (uint256)

  • account is

getReward

function getReward() public updateReward(msg.sender) checkStart

notifyRewardAmount

function notifyRewardAmount(uint256 reward) external overrid onlyRewardDistribution updateReward(address(0))

  • reward is

Stake

function stake(uint256 amount) public override updateReward(msg.sender) checkStart

Stakes amount stablecoins to the distribution contract. Emits Staked.

  • amount is the amount of stablecoins being staked.

[Internal] Stake

function stake(uint256 amount) public virtual

Performs staking by transferring stablecoins from the staker to the distribution contract.

  • amount is the amount of stablecoins being staked.

Withdraw

function withdraw(uint256 amount) public override updateReward(msg.sender) checkStart

Withdraws amount stablecoins from the distribution contract. Emits Withdrawn.

[Internal] Withdraw

function withdraw(uint256 amount) public virtual

Performs withdrawal by transferring stablecoins from the distribution contract to the withdrawer.

  • amount is the amount of stablecoins being withdrawn.

Exit

function exit() external

WIthdraws all staked stablecoins to the sender.