复现使用Truffle构造链上笔记本,在web端调用函数总是返回invalid address

我用的Ganache测试链,合约是成功部署的,前端console里可以看到address和Truffle contract的实例,为什么调用合约返回invalid address呢

bindEvents: function() {
$("#add_new").on('click', function() {
console.log(" click ");
$("#loader").show();
console.log(App.account);
console.log(App.noteIntance);
console.log(web3.eth.defaultAccount);
App.noteIntance.addNote($("#new_note").val()).then(function(result) {
return App.watchChange();
}).catch(function (err) {
console.log(err.message);
});
请先 登录 后评论

最佳答案 2021-04-13 08:16

第 8 行

App.noteIntance.addNote($("#new_note").val(), {from: App.account} )
请先 登录 后评论

其它 1 个回答

darren
请先 登录 后评论