Skip to content

Instantly share code, notes, and snippets.

@izqui

izqui/counterfact.sol

Last active Mar 14, 2017
Embed
What would you like to do?
contract Counterfact is LiveFactory {
function addressForNonce(uint8 nonce) constant returns (address) {
if (nonce > 127) throw;
return address(sha3(0xd6, 0x94, address(this), nonce));
}
function Counterfact() payable {
firstDeployment = addressForNonce(uint8(1));
bool b = firstDeployment.send(msg.value);
}
address public firstDeployment;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.