Tsunami-Exchange / tsunami-contracts

Tsunami Exchange Smart Contracts (RIDE)
2 stars 3 forks source link

Brief audit of `rewards.ride` and `farming.ride` #23

Open deemru opened 1 year ago

deemru commented 1 year ago

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.