RewardsEscrow


Functions:

Events:

Graphs:


Function Definitions:

constructor()

constructor(contract IERC20 _pop) public 

isClaimable()

isClaimable(bytes32 _escrowId) external  returns (bool)
Parameter NameTypeDescription

_escrowId

bytes32

Bytes32 escrow ID

getClaimableAmount()

getClaimableAmount(bytes32 _escrowId) external  returns (uint256)
Parameter NameTypeDescription

_escrowId

bytes32

Bytes32 escrow ID

getEscrowIdsByUser()

getEscrowIdsByUser(address _account) external  returns (bytes32[])
Parameter NameTypeDescription

_account

address

address

getEscrows()

getEscrows(bytes32[] _escrowIds) external  returns (struct RewardsEscrow.Escrow[])

there is no check to ensure that all escrows are owned by the same account. Make sure to account for this either by only sending ids for a specific account or by filtering the Escrows by account later on.

Parameter NameTypeDescription

_escrowIds

bytes32[]

array of escrow ids

lock()

lock(address _account, uint256 _amount, uint256 _duration) external 

This creates a separate escrow structure which can later be iterated upon to unlock the escrowed funds

claimReward()

claimReward(bytes32 _escrowId) external 

Uses the escrowId at the specified index of escrowIdsByAddress. This function is used when a user only wants to claim a specific escrowVault or if they decide the gas cost of claimRewards is too high for now. (lower cost but also lower reward)

claimRewards()

claimRewards(bytes32[] _escrowIdsByAddress) external 

Uses the vaultIds at the specified indices of escrowIdsByAddress. This function is used when a user wants to claim multiple escrowVaults at once (probably most of the time) prevention for gas overflow should be handled in the frontend

addAuthorizedContract()

addAuthorizedContract(address _staking) external 

removeAuthorizedContract()

removeAuthorizedContract(address _staking) external 

Events

Locked

Locked(address account, uint256 amount)

RewardsClaimed

RewardsClaimed(address account, uint256 amount)

TokenAdded

TokenAdded(address token, uint256 index)

AddAuthorizedContract

AddAuthorizedContract(address _contract)

RemoveAuthorizedContract

RemoveAuthorizedContract(address _contract)

Graphs

Dependency Graph

Inheritance Graph

Last updated