Hello all!
Everything works and when I call the function
greet:
greeter.greet.call()
on
testrpc I get:
' '
, which is correct, because there is nothing in it!
How do I input for example:
"hello world" in the empty variable
greeting
using truffle?
Source tutorial:
https://ethereum.org/greeterThank you!
Comments
e.g.
greetMe = new greeter("Hello me");
I must admit that I only have a very basic understanding and that I am still not able to get it working.
The steps I follow:
1. Compile
2. Migrate
Then in Truffle console:
var greeter = greeter.deployed()
How do I implement what was explained above in the constructor greeter?
string greeting;
function greeter(string _greeting) public {
greeting = _greeting;
}
function greet() constant returns (string) {
return greeting;
}
}
I hope I make sense..
Best wishes,
From glancing over that, it look like Truffle will create a new instance using
<contract_name>.new(<constructor_parameters>)
So I guess
Greeter.new("Hello World!")
should get it working...