RFC: Track total rewards earned per contract #9
chris-ricketts
started this conversation in
Ideas
Replies: 1 comment
-
Moved to Discussions under Ideas as this is an RFC; |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
It would be incredibly useful to have a query like
TotalContractRewards
, which returns the total rewards generated by a contract over it's lifetime (regardless of rewards recipient address changes).From the perspective of interacting with the rewards module from CosmWasm contracts, it would allow a contract to be the rewards recipient of multiple contracts and know how much each contract contributed it's total earnings.
This is not possible currently as the rewards contract can only query it's total outstanding rewards from all nominator contracts.
The addition of the
TotalContractRewards
query would allow the following flow:TotalContractRewards
, storing the result.TotalContractRewards
comparing it to the original stored value, calculates how much something to give to collector.The current workaround is for the RC to create a child contract per NC to act as the rewards recipient. As well as being both less efficient gas and lines of code wise, it also degrades UX by forcing collections to be made on a per NC basis.
Beta Was this translation helpful? Give feedback.
All reactions