【发布时间】:2021-03-05 03:44:30
【问题描述】:
我在我的 react 前端尝试与我的智能合约交互时收到此错误消息。我正在运行 localhost3000 并且需要元掩码才能登录。
Unhandled Rejection (Error): call revert exception (method="symbol()", errorSignature=null, errorArgs=[null], reason=null, code=CALL_EXCEPTION, version=abi/5.0.8)
Logger.makeError
/Users/username/Desktop/final-4/src.ts/index.ts:205
Logger.throwError
/Users/username/Desktop/final-4/src.ts/index.ts:217
Interface.decodeFunctionResult
/Users/username/Desktop/final-4/src.ts/interface.ts:326
323 | eventFragment = this.getEvent(eventFragment);
324 | }
325 | const topics = [];
> 326 | const dataTypes = [];
| ^ 327 | const dataValues = [];
328 | if (!eventFragment.anonymous) {
329 | topics.push(this.getEventTopic(eventFragment));
View compiled
Contract.<anonymous>
/Users/username/Desktop/final-4/src.ts/index.ts:309
fulfilled
http://localhost:3000/static/js/0.chunk.js:5079:24
同样来自检查中的源选项卡:
未捕获(承诺中)错误:调用还原异常(method="symbol()",errorSignature=null,errorArgs=[null],reason=null,code=CALL_EXCEPTION,version=abi/5.0.8) 未捕获(承诺中)错误:调用还原异常(method="balanceOf(address)", errorSignature=null, errorArgs=[null], reason=null, code=CALL_EXCEPTION, version=abi/5.0.8)
这是我的目录结构:
client
|--node_modules
|-—public
|—-src
|—-contracts
|—-Address.json
|—-Context.json
|—-ERC20.json
|—-IERC20.json
|—-Migrations.json
|—-PreciousChicken.json
|——SafeMath.json
|—-App.css
|—-App.js
|—-App.test.js
|—-index.css
|—-logo.svg
|—-reportWebVitalls.js
|—-setupTests.js
|—-gitignore
|—-package-lock.json
|—-package.json
|—-yarn.lock
|—-contracts
|—-Migrations.sol
|—-MyPreciousToken
|—-migrations
|—-1_initial_migations.js
|—-2_deploy_contracts.js
|—-node-modules
|—-test
【问题讨论】:
-
你能贴出导致错误的代码吗?
-
嗨@FastDeveloper 我不知道如何找到它。
-
右击页面,点击Inspect,然后进入Console选项卡。
-
谢谢!您可以发布导致此错误的行吗?
-
我不知道如何找到它们。它看起来像是在“index.ts”文件中,但不确定它在哪里。
标签: reactjs frontend ethereum solidity erc20