FluidLendingStakingRewards

Git Source

Inherits: Owned, ReentrancyGuard

State Variables

rewardsToken

IERC20 public immutable rewardsToken;

stakingToken

IERC20 public immutable stakingToken;

rewardsDuration

uint256 public immutable rewardsDuration;

periodFinish

uint256 public periodFinish;

rewardRate

uint256 public rewardRate;

lastUpdateTime

uint256 public lastUpdateTime;

rewardPerTokenStored

uint256 public rewardPerTokenStored;

userRewardPerTokenPaid

mapping(address => uint256) public userRewardPerTokenPaid;

rewards

mapping(address => uint256) public rewards;

_totalSupply

uint256 private _totalSupply;

_balances

mapping(address => uint256) private _balances;

Functions

constructor

constructor(address _owner, IERC20 _rewardsToken, IERC20 _stakingToken, uint256 _rewardsDuration) Owned(_owner);

totalSupply

function totalSupply() external view returns (uint256);

balanceOf

function balanceOf(address account) external view returns (uint256);

lastTimeRewardApplicable

function lastTimeRewardApplicable() public view returns (uint256);

rewardPerToken

function rewardPerToken() public view returns (uint256);

earned

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

getRewardForDuration

function getRewardForDuration() external view returns (uint256);

stakeWithPermit

function stakeWithPermit(uint256 amount, uint256 deadline, uint8 v, bytes32 r, bytes32 s)
    external
    nonReentrant
    updateReward(msg.sender);

stake

function stake(uint256 amount) external nonReentrant updateReward(msg.sender);

withdraw

function withdraw(uint256 amount) public nonReentrant updateReward(msg.sender);

getReward

function getReward() public nonReentrant updateReward(msg.sender);

exit

function exit() external;

notifyRewardAmount

function notifyRewardAmount(uint256 reward) external onlyOwner updateReward(address(0));

updateReward

modifier updateReward(address account);

Events

RewardAdded

event RewardAdded(uint256 reward);

Staked

event Staked(address indexed user, uint256 amount);

Withdrawn

event Withdrawn(address indexed user, uint256 amount);

RewardPaid

event RewardPaid(address indexed user, uint256 reward);