contract seems to have been mined but address undefined in geth console!? How recover address?

seberinoseberino Member Posts: 7
I entered this on geth console http://pastebin.com/HhW9tA95:

eth.getCompilers();

var source = "contract mortal { /* Define variable owner of the type address*/ address owner; /*
this function is executed at initialization and sets the owner of the contract */ function mortal() { o
wner = msg.sender; } /* Function to recover the funds on the contract */ function kill() { if (msg.send
er == owner) suicide(owner); } } contract greeter is mortal { /* define variable greeting of the type strin
g */ string greeting; /* this runs when the contract is executed */ function greeter(string _greeti
ng) public { greeting = _greeting; } /* main function */ function greet() constant returns
(string) { return greeting; } }";

var compiled = web3.eth.compile.solidity(source);

var contract_ = web3.eth.contract(compiled.greeter.info.abiDefinition);

var contract = contract_.new("This is a param!",
{from: web3.eth.accounts[0],
data: compiled.greeter.code,
gas: 300000},
function(e, contract) {
if(!e) {
if(!contract.address) {
console.log("Wait.");
} else {
console.log("Done.");
}
}
})

I can see contract apparently got mined here: https://etherscan.io/tx/0x41da0d02cf83c9caf52c6d004c70328304bffcf5caa0119f78eee22bbe5a6b5a

My contract still has an undefined address...why?

Also, how find address of contract if you forget it or geth console won't reveal it for that contract?

Thanks!

Chris

Comments

Sign In or Register to comment.