SIP-342: Add getAvailableRewards to Rewards Manager Module
Author | |
---|---|
Status | Draft |
Type | Governance |
Network | Ethereum & Optimism |
Implementor | James Zwar (@jmzwar) |
Release | TBD |
Created | 2023-10-03 |
Abstract
SIP-342 Proposes adding a view method getAvailableRewards
to the Rewards Manager Module to return a account balance for a registered distributor.
Motivation
Currently, to retrieve the available balance of an account a static call to claimRewards
is required, which throws an exception on an account have a zero balance. This is cumbersome for frontend providers to handle an the exceptions must be handled.
Rationale
This is where you explain the reasoning behind how you propose to solve the problem. Why did you propose to implement the change in this way, what were the considerations and trade-offs. The rationale fleshes out what motivated the design and why particular design decisions were made. It should describe alternate designs that were considered and related work. The rationale may also provide evidence of consensus within the community, and should discuss important objections or concerns raised during discussion.
Technical Specification
In the RewardsManagerModule - the getAvailableRewards(uint128 accountId, uint128 poolId, address collateralType, address distributor)
view function to be added.
Configurable Values (Via SCCP)
N/A
Copyright
Copyright and related rights waived via CC0.