0
myContractInstance.methods.approve('0x...', 300).call(function(error, approve){
        if(error){console.log(error)};

        if(approve){console.log("allowance for this address :"+ approve)};
        //$('#allowanceAmount').text(allowance);
})})};

Hi, what's the problem with the function? It doesn't work.. Thanks

2

Function approve is not constant (neither pure nor view).

You should therefore execute it using send instead of call.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.