wise-foundation / wise-website-requests

This is a public repo for users to submit reports of bugs/issues or request new features for the WISE Token website
https://wisetoken.net
2 stars 4 forks source link

[BUG] **Advanced Stake totals are not counted in side nav on the staking page** #53

Open Tim-TheToolmanTaylor opened 10 months ago

Tim-TheToolmanTaylor commented 10 months ago

Describe the bug Currently, the total WISE for a given account connected to the web app will only show WISE counts from direct WISE stakes, and will not account for WISE staked in "Advanced Stakes" because Advanced Stakes are directly owned by the WS-NFT contract (the staker maintains complete control).

Screenshot: image

To Reproduce Steps to reproduce the behavior:

  1. Go to 'app.wisetoken.net'
  2. Click on the 'Wise Staking' page
  3. Create an advanced stake
  4. update the page, and total WISE will be deducted by the amount of WISE you staked

Expected behavior Total WISE should remain the same, and accrued interest on advanced stakes should also be added to 'Total:' just the same as normal WISE stakes

Desktop (please complete the following information):

Additional context Presumably, today the app goes to: 0x66a0f676479Cee1d7373f3DC2e2952778BfF5bd6 and checks liquid balance with WiseToken.balanceOf(addr) + all staked WISE by looping through all the stakes, generating the stakeID with WiseToken.generateID(addr, stakeCount[addr], 0x01), Then calculated stakedAmount + RewardAmount for(i = WiseToken.stakeCount(addr) )

Please correct me if I am wrong here. If this is the case, then you would just have to add on to this. You would query the WiseStaking-NFTs address: 0xf863a603501fcd30f56dffcb6700a25effefbe94 you would call WS-NFTs.WalletOfOwner(addr) to get the token IDs, call: WS-NFTs.NFTStake(tokenId) and do this for(WS-NFTs.balanceOf(addr) ) then call back to the original WISE Token contract with: WiseToken.stakes(0xf863a603501fcd30f56dffcb6700a25effefbe94, {bytes16_Value_From_WS-NFTs.NFTStake} )

vm06007 commented 10 months ago

Thanks @Tim-TheToolmanTaylor we will add this to the calculation

vm06007 commented 10 months ago

Please correct me if I am wrong here.

Yes, your observation of current calculation is correct.

Tim-TheToolmanTaylor commented 10 months ago

Great, ty @vm06007 Btw, super excited about the wise lending work + arbitrum deploys coming up. Keep up the great work 💪