Contract | Mainnet Address | Testnet Address |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
This contract is yet to be deployed.
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
​
uint256 public lastUpdateTime;
​
uint256 public rewardPerTokenStored;
mapping(address => uint256) public userRewardPerTokenPaid;
​
address
is
uint256
is
mapping(address => uint256) public rewards;
​
address
is
uint256
is
mapping(address => uint256) public deposits;
​
address
is
uint256
is
event RewardAdded(uint256 reward);
Emitted when rewards a
event Staked(address indexed user, uint256 amount);
Emitted when tokens are staked via stake
.
event Withdrawn(address indexed user, uint256 amount);
Emitted when staked tokens are withdrawn via withdraw
.
event RewardPaid(address indexed user, uint reward);
Emitted when
modifier checkStart()
Checks whether distribution of tokens have started.
modifier updateReward(address account)
Updates the amount of rewards accrued by account
.
function lastTimeRewardApplicable() public view returns (uint256)
​
function rewardPerToken() public view returns (uint256)
​
function earned(address account) public view returns (uint256)
​
account
is
function getReward() public updateReward(msg.sender) checkStart
​
function notifyRewardAmount(uint256 reward) external overrid onlyRewardDistribution updateReward(address(0))
​
reward
is
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.
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.
function withdraw(uint256 amount) public override updateReward(msg.sender) checkStart
Withdraws amount
stablecoins from the distribution contract. Emits Withdrawn
.
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.
function exit() external
WIthdraws all staked stablecoins to the sender
.