Skip to content

Commit

Permalink
Merge pull request #98 from AWTammsaar/master
Browse files Browse the repository at this point in the history
Update handleAction documentation
  • Loading branch information
miguelmtzinf authored Oct 19, 2022
2 parents 13d0634 + 78a065a commit b0c30d2
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 11 deletions.
8 changes: 4 additions & 4 deletions contracts/rewards/interfaces/IRewardsController.sol
Original file line number Diff line number Diff line change
Expand Up @@ -110,10 +110,10 @@ interface IRewardsController is IRewardsDistributor {
function configureAssets(RewardsDataTypes.RewardsConfigInput[] memory config) external;

/**
* @dev Called by the corresponding asset on any update that affects the rewards distribution
* @param user The address of the user
* @param userBalance The user balance of the asset
* @param totalSupply The total supply of the asset
* @dev Called by the corresponding asset on transfer hook in order to update the rewards distribution.
* @param user The address of the user whose asset balance has changed
* @param userBalance The previous user balance prior to balance change
* @param totalSupply The total supply of the asset prior to user balance change
**/
function handleAction(
address user,
Expand Down
14 changes: 7 additions & 7 deletions docs/rewards/rewards-controller.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ The `RewardsDistributor` abstract contract manages the distribution and accounta

## Rewards Controller

The Rewards Controller is the main contract and where the user interacts to claim the rewards of their positions. It inherits `RewardsDistributor` to handle the distribution of rewards. The users of the incentivised ERC20 assets will accrue value if they hold their tokens in possession without the need of staking or blocking the assets inside a contract. At every transfer the asset must call the `handleAction` method to account the rewards of the user.
The Rewards Controller is the main contract and where the user interacts to claim the rewards of their positions. It inherits `RewardsDistributor` to handle the distribution of rewards. The users of the incentivised ERC20 assets will accrue value if they hold their tokens in possession without the need of staking or blocking the assets inside a contract. At every transfer the asset must call the `handleAction` method to account for the accumulated rewards of the user prior to balance change.

The users can claim all the rewards or an individual reward per transaction, with a variety of functions that allow more granularity at claim.

Expand Down Expand Up @@ -155,19 +155,19 @@ The `RewardsDistributorTypes.RewardsConfigInput` struct is composed with the fol

## handleAction

Called by the corresponding asset on transfer hook to update the rewards distribution of an user.
Called by the corresponding asset on transfer hook in order to update the rewards distribution.

### Interface

`function handleAction(address user, uint256 userBalance, uint256 totalSupply) external;`

### Input parameters

| Parameter Name | Type | Description |
| -------------- | ------- | ----------------------------- |
| user | address | The address of the user |
| userBalance | uint256 | The user balance of the asset |
| totalSupply | uint256 | The total supply of the asset |
| Parameter Name | Type | Description |
| -------------- | ------- | ---------------------------------------------------------- |
| user | address | The address of the user whose asset balance has changed |
| userBalance | uint256 | The previous user balance prior to balance change |
| totalSupply | uint256 | The total supply of the asset prior to user balance change |

## claimRewards

Expand Down

0 comments on commit b0c30d2

Please sign in to comment.