Reputation: 330
I have a public address of owner of
address public owner;
I want to acess it inside a js function. I tried to call it from the instance of the deployed contract but it shows something like
ƒ () {
var instance = this;
var args = Array.prototype.slice.call(arguments);
var tx_params = {};
var last_arg = args[args.length - 1];
// It's only tx_params …
in console.
Upvotes: 0
Views: 84
Reputation: 9365
Assuming your contract name is Cat
and you have address public owner;
line inside it.
Here is the code that you can use in $ truffle console
terminal after you deploy the contract:
c = Cat.at("put Cat contract address here")
c.owner.call()
That's all.
Upvotes: 1