这是我遇到的问题:
//this is just a smart contract i just picked up from etherscan
var c = web3.eth.contract([{"constant":true,"inputs":[{"name":"user","type":"address"},{"name":"token","type":"address"}],"name":"tokenBalance","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"name":"users","type":"address[]"},{"name":"tokens","type":"address[]"}],"name":"balances","outputs":[{"name":"","type":"uint256[]"}],"payable":false,"stateMutability":"view","type":"function"},{"payable":true,"stateMutability":"payable","type":"fallback"}]);
var contract = c.at("0xb1F8e55c7f64D203C1400B9D8555d050F94aDF39");
//This is not working
contract.methods.tokenBalance("0x", "0x").call((err, balance) => {
console.log({err, balance});
})
它说contract.methods不是函数。我不知道我在做什么错。