I'm attempting to copy the same concept as used in the ENS registrar contract like line 355:
// Creates a new hash contract with the owner Deed newBid = (new Deed).value(msg.value)(msg.sender);
Coming from a C# background I basically don't understand anything about this statement.
The Deed contract is in the same file at line 24
- (new Deed) when the Deed contract has a constructor - how does that work and why is it in brackets? I expected it to be new Deed(someAddress)
- What is the .value(msg.value)? Is this supposed to set the deed.value property?
- How is .value(msg.value) a function so you can append (msg.sender)? And was is that is that doing?
- An assumption is the that other properties in the deed contract are set to their default values. e.g. uint public creationDate will be 0?
- Finally, it appears as though ENS is deploying each of these deeds at separate addresses - Does this line do this, or is that done somewhere else?
Sorry, I totally don't get it, but need a simple explanation about everything in this line except for the fact that in the end the variable deed is a Deed contract where I presume I could get the previousOwner property with:
address addr = deed.previousOwner;