rewards pool contracts
RewardsPoolWSD Contract: Rebasing Token Rewards
RewardsPoolWSD is similar to RewardsPool but it handles a single rebasing token minted by a StakingPool by wrapping the tokens when they’re received for distribution and unwrapping them when a user claims their rewards.
View Functions
Section titled “View Functions”Returns the address of the rewards token this pool distributes
function token() external view returns (address)Return Values
Section titled “Return Values”| Name | Type | Description |
|---|---|---|
| token | address | Address of rewards token |
wsdToken
Section titled “wsdToken”Returns the address of the wrapped version of the token this pool distributes
function wsdToken() external view returns (address)Return Values
Section titled “Return Values”| Name | Type | Description |
|---|---|---|
| wrappedToken | address | Address of wrapped rewards token |
withdrawableRewards
Section titled “withdrawableRewards”Returns an account’s total unwrapped unclaimed rewards
function withdrawableRewards(address _account) public view returns (uint256)Parameters
Section titled “Parameters”| Name | Type | Description |
|---|---|---|
| _account | address | Address of account |
Return Values
Section titled “Return Values”| Name | Type | Description |
|---|---|---|
| rewards | uint256 | Total unclaimed rewards (unwrapped) |
withdrawableRewardsWrapped
Section titled “withdrawableRewardsWrapped”Returns an account’s total wrapped unclaimed rewards
function withdrawableRewardsWrapped(address _account) public view returns (uint256)Parameters
Section titled “Parameters”| Name | Type | Description |
|---|---|---|
| _account | address | Address of account |
Return Values
Section titled “Return Values”| Name | Type | Description |
|---|---|---|
| rewards | uint256 | Total unclaimed rewards (wrapped) |
Write Functions
Section titled “Write Functions”withdraw
Section titled “withdraw”Withdraws the sender’s unclaimed rewards
function withdraw() externalwithdraw
Section titled “withdraw”Withdraws an account’s unclaimed rewards
function withdraw(address _account) externalParameters
Section titled “Parameters”| Name | Type | Description |
|---|---|---|
| _account | address | Account to withdraw for |
onTokenTransfer
Section titled “onTokenTransfer”ERC677 implementation that receives rewards and distributes them
function onTokenTransfer(address, uint256, bytes) externaldistributeRewards
Section titled “distributeRewards”Distributes new rewards that have been deposited
function distributeRewards() publicupdateReward
Section titled “updateReward”Updates an account’s principal reward balance
function updateReward(address _account) publicParameters
Section titled “Parameters”| Name | Type | Description |
|---|---|---|
| _account | address | Address of account |