9

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

 3 years ago
source link: https://learnblockchain.cn/question/1924
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
复现使用Truffle构造链上笔记本,在web端调用函数总是返回invalid address

复现使用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);
});

About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK