I executed now this code in console and it works fine:
ERC20_ABI = [
{
constant: true,
inputs: [],
name: "totalSupply",
outputs: [{ name: "", type: "uint256" }],
payable: false,
stateMutability: "view",
type: "function",
},
];
x = await Moralis.Web3API.native.runContractFunction({
chain: "bsc",
address: "0x28e4f32fa7e842ad0a6e530bb6b4ec03b36d5078",
function_name: "totalSupply",
abi: ERC20_ABI,
})
console.log(x);
=> 10000000000000000000000
where do you call that cptsupply function?