pragma solidity >=0.4.22 <0.6.0; // First, we start with the contract that we're committing to deploying: /// @title A widget contract Machine { // This is our contract that does stuff. We'll be committing to deploying this contract in the future. constructor() public { // etc } } // Now, we create a contract that's sole purpose is to commit to deploying some arbitrary code /// @title A commitment to make a widget contract MachineCommitment { function commit() public { new Machine(); selfdestruct(msg.sender); } }
0.4.18