Earn While Learning Web3 Programming>> Start Here FREE!!!
Hi there
I am testing a smart contract and everything works fine but the second call to the contract (ajjjj) :
try {
await n.value.methods.withdrawToken().send({
from: i.value
}), p.success(\You have successfully unlock $${[Ht.lockedToken.id]( removed link )} Tokens. Thank you!), U()
} catch {
p.error("Signing failed, please try again!")
}
a.value = !1
}, w = (O, N) => !+O || !+N ? 0 : Number.parseFloat(N) * Number.parseFloat(O), x = (O, N) => !+O || !+N ? 0 : Number.parseFloat(N) / Number.parseFloat(O), k = async () => {
var S;
const O = await n.value.methods.totalTokensSoldR().call(),
N = (S = O == null ? void 0 : O.data) != null ? S : 0;
v.value = m.value.tokensForSale - N, v.value < 0 && (v.value = 0)};
What I do not understand is why calls to withdrawToken (smart contrasct’s function) work fine and when I try to get the value of the variable totalTokensSoldR from smart contract is not working…If I switch variable O=10000, then v.value is calculated correctly .Both withdrawToken() and totalTokensSoldR () are in the ABI…
totalTokensSoldR variable can be read from testnet and is declared as public view, please help ! I’m stucked <img class="emoji" title=":frowning:" src=" removed link " alt=":frowning:" width="20" height="20" />