current position:Home>The replica uses truffle to construct the notebook on the chain. Calling the function on the web side always returns invalid address

The replica uses truffle to construct the notebook on the chain. Calling the function on the web side always returns invalid address

2022-02-04 00:10:37 Q & A of Denglian community

I am using Ganache Test chain , The contract was successfully deployed , front end console You can see address and Truffle contract Example , Why call the contract to return invalid address Well

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);});



Take the answer 1:

The first 8 That's ok

App.noteIntance.addNote($("#new_note").val(), {from: App.account} )



copyright notice
author[Q & A of Denglian community],Please bring the original link to reprint, thank you.
https://en.netfreeman.com/2022/02/202202040010360702.html

Random recommended