nftstaking icon indicating copy to clipboard operation
nftstaking copied to clipboard

Claim and earningInfo() not working properly

Open tirobs000 opened this issue 2 years ago • 2 comments

Hello NFTs rewards isn't working properly, when you stake id 4 and 5, and ID 4 have let's say 10 tokens of rewards, but ID 5 have 1 token and you claim 4 and 5 rewards, it only sends to you 1 token instead of 11 and then both go to 0 to start counting again. The same happens with earningInfo function, in this case it will only show 1 token of reward calling ["4","5"].

tirobs000 avatar Apr 28 '22 16:04 tirobs000

yes, i come accross this issue too.

hcaihao avatar May 15 '22 14:05 hcaihao

Line 103 and 130 should be earned += rewardmath / 100;

I was having the same issue. Havent actually checked to make sure, but checking the code it looks like you need to accumulate the earnings otherwise earning will just be the last token id. So it needs to be earning += instead of just earning =

thekesslereffect avatar May 20 '22 10:05 thekesslereffect