The contracts may need a preliminary reworking to fixate logic.
There should be stake/unstake/withdrawRewards for rewards.ride and stake/unstake for farming.ride user functions. Because there is no reason to have withdrawRewards then you can unstake this compounding part in farming.ride. Or you can wrap unstake( reward ) into withdrawRewards call if you still need it. But its hard to track the exact reward in compounding solution.
Every user function should do ackRewards prior to anything else. And ackRewards should track assetBalance instead of payments or another invoke result. Also there is no need for another version of ackRewards such as addRewards.
The contracts may need a preliminary reworking to fixate logic.
There should be
stake
/unstake
/withdrawRewards
for rewards.ride andstake
/unstake
forfarming.ride
user functions. Because there is no reason to havewithdrawRewards
then you canunstake
this compounding part infarming.ride
. Or you can wrapunstake
( reward ) intowithdrawRewards
call if you still need it. But its hard to track the exact reward in compounding solution.Every user function should do
ackRewards
prior to anything else. AndackRewards
should track assetBalance instead of payments or another invoke result. Also there is no need for another version ofackRewards
such asaddRewards
.