Hi, everyone! I seem to get a weird result when calling the ERC20 allowance function on Polygon for the address 0xFfeEcd85edF58666AEb95Cc2EFA855DA62E6ea56. The output is 49999999999999999957000000000000000000 wei which obviuosly can’t be true. I checked the result using Remix IDE and it returned 0. The other addresses seem fine.
Here is the code
export const _allowance = async(owner) => {
let options = {
chain: '0x89',
address: '0x8f3Cf7ad23Cd3CaDbD9735AFf958023239c6A063',
function_name: "allowance",
abi: ERC20ABI,
params: {
owner,
spender: '0xDfEc2EC7E96f54fD41B229122c30874e49c23a5F'
},
};
try {
let allowance = await Moralis.Web3API.native.runContractFunction(
options
);
console.log('allowance', allowance);
return allowance;
} catch (error){
console.error(error);
}
}
Here ERC20ABI is imported from config. Thanks!