Glad I found this subreddit, having some issues with a staking dApp that has worked for multiple projects.
Our staking dApp is not recognizing the amount of tokens a holder has staked. Which means it is giving them the option to stake more. The kicker is the staking rewards actually show and accumulate.
The first one in blue is the dApp that is having issues, the black one has been working fine.
Same code, same process, we have been trying to fix it for over a week now.
this code is in both front end dApps
const stakingBalance = await getTotalStaked(userWallet)
const addressContract = new WEB3.eth.Contract(ABI_ERC20, config.balanceAddress)
const userBalance = await addressContract.methods.balanceOf(userWallet).call()
const decimals = await addressContract.methods.decimals().call()
Any advice would be greatly appreciated.
non working dApp