-
Notifications
You must be signed in to change notification settings - Fork 4
Description
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).
To Reproduce
Steps to reproduce the behavior:
- Go to 'app.wisetoken.net'
- Click on the 'Wise Staking' page
- Create an advanced stake
- 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):
- Chrome browser
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} )
