Created
May 12, 2020 10:37
-
-
Save MrChico/73bfb879a231a406bf2d8fd5f6df3d97 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
pragma solidity ^0.6.0; | |
import "../deposit_contract.sol"; | |
contract DepositContractFactory { | |
bool public deployed; | |
uint public deploymentTime; | |
DepositContract depositContract; | |
constructor(uint _deploymentTime) public { | |
deploymentTime = _deploymentTime; | |
} | |
function deploy() external { | |
require(block.timestamp >= deploymentTime, "not yet!"); | |
require(!deployed, "already deployed"); | |
depositContract = new DepositContract(); | |
deployed = true; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I reckon actually CREATE2 would be a bad idea if the salt exists in the factory because the contract could be deployed outside the factory.