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? – Kaki Master Of Time Aug 08 '18 at 12:40constructorthat resulted in this errorCannot read property 'constructor' of undefinedand it is clear that theinvalid addresserror is gone when adding thefromattribute. – Kaki Master Of Time Aug 08 '18 at 13:28inputfor your contract asextra dataparameter in the transaction. You just have to supply the correct ABI specification. Now, if you want to manage addresses as string inside the contract, that's totally different story and you can do everything since EVM is a Turing Complete machine , and can do any type of generic computation. – Nulik Aug 08 '18 at 13:38gethinstead of truffle, you are going to understand better how it works. https://medium.com/@gus_tavo_guim/deploying-a-smart-contract-the-hard-way-8aae778d4f2a – Nulik Aug 08 '18 at 13:40contract.jsat line 96? – Mikhail Vladimirov Oct 16 '19 at 20:46