Skip to content

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

@Tim-TheToolmanTaylor

Description

@Tim-TheToolmanTaylor

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):

  • 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} )

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions