I have trouble sending an address to a deployed contract, my function looks like this:
function addNote(uint _value, address _owner) public {
...
}
and when I'm sending the parameters:
contract.deployed().then(function(instance) {
return instance.addNote(value,"0x092f90acAbb3b23Aded64D59FB6f6Be97615476b");
})
.then(function(result) {
console.log(result);
})
.catch(function(error) {
console.log(error);
});
I'm getting this error:
Error: invalid address
at inputAddressFormatter (/Desktop/Server/node_modules/truffle-contract/node_modules/web3/lib/web3/formatters.js:274:11)
Also when I'm adding the last parameter:
{
from: "0x092f90acAbb3b23Aded64D59FB6f6Be97615476b",
gas: 1000000
}
then the error is:
TypeError: Cannot read property 'constructor' of undefined
at /Desktop/Server/node_modules/truffle-contract/contract.js:96:1
What's the problem?
addNote
?constructor
that resulted in this errorCannot read property 'constructor' of undefined
and it is clear that theinvalid address
error is gone when adding thefrom
attribute.