Truffle+Ganache调试问题求教各位大神
rhsor 2019-09-14 09:19:35 各位大神好,小弟刚接触以太坊开发,费了好大功夫装好环境,模拟智能合约又调试不过了,折腾了几个小时,有没哪位朋友能帮指点一下错误原因吗?
truffle下unbox的MetaCoin代码没修改过,直接compile,mirgaration后在console下执行如下命令,一直提示错误。万分感谢
truffle(ganache)> MetaCoin.deployed().getBalance.call(web3.eth.accounts[0])
Thrown:
evalmachine.<anonymous>:0
MetaCoin.deployed().getBalance.call(web3.eth.accounts[0])
^
TypeError: Cannot read property 'call' of undefined
at evalmachine.<anonymous>:0:31
at Script.runInContext (vm.js:133:20)
at runScript (/usr/local/lib/node_modules/truffle/build/cli.bundled.js:535394:21)
at Console.interpret (/usr/local/lib/node_modules/truffle/build/cli.bundled.js:535409:21)
at ReplManager.interpret (/usr/local/lib/node_modules/truffle/build/cli.bundled.js:385867:18)
at bound (domain.js:402:14)
at REPLServer.runBound [as eval] (domain.js:415:12)
at REPLServer.onLine (repl.js:642:10)
at REPLServer.emit (events.js:198:13)
at REPLServer.EventEmitter.emit (domain.js:448:20)