ehters连接stark的合约,调用balanceOf方法报错balanceOf not a function

代码如下

const stkProvider = new ethers.JsonRpcProvider(`https://starknet-mainnet.infura.io/v3/${this.apiKey}`);
            const wallet = new ethers.Wallet(secret, stkProvider);
            const starkGateContract = new ethers.Contract(this.starkJson.starkGate.address, this.starkJson.starkGate.abi2, wallet);
            console.log(stkProvider)

            console.log(starkGateContract)
            const name = starkGateContract.balanceOf(addr);

报错如下图

image.png

请先 登录 后评论

最佳答案 2023-08-14 00:04

找到问题了 要用starkjs而不是etherjs

请先 登录 后评论

其它 4 个回答

Ss
请先 登录 后评论
raven
请先 登录 后评论
IT_浩哥 - 接区块链DAPP开发
请先 登录 后评论
dl96200
请先 登录 后评论
  • 4 关注
  • 0 收藏,1025 浏览
  • Ss 提出于 2023-08-09 22:39

相似问题