defi-stake-yield-brownie-freecode icon indicating copy to clipboard operation
defi-stake-yield-brownie-freecode copied to clipboard

Fix getUserTotalValue function

Open MSalaberry opened this issue 3 years ago • 3 comments

Hi Patrick! If you do the require and the user has no tokens the transaction will revert, stopping the execution of issueTokens function. Additionally, the "if (uniqueTokensStaked[_user] <= 0)" in getUserSingleTokenValue function is now redundant in this implementation, but how it is a public function i didn't delete it.

MSalaberry avatar Dec 17 '21 03:12 MSalaberry

Ah... Thank you so much for this!

Could you make it as a comment actually? Users who watched the video will be confused by the different code. Thank you so much for this PR though! You're right!

PatrickAlphaC avatar Dec 22 '21 00:12 PatrickAlphaC

No problem! I submit another PR with the comments of this function.

MSalaberry avatar Dec 22 '21 00:12 MSalaberry

Nice catch!

Markkop avatar Jan 14 '22 22:01 Markkop