PatrickAlphaC / defi-stake-yield-brownie-freecode

52 stars 62 forks source link

Fix getUserTotalValue function #5

Open MSalaberry opened 2 years ago

MSalaberry commented 2 years ago

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.

PatrickAlphaC commented 2 years ago

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!

MSalaberry commented 2 years ago

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

Markkop commented 2 years ago

Nice catch!