init
Signed-off-by: T-Hax <>
This commit is contained in:
commit
8f085566cc
69 changed files with 19692 additions and 0 deletions
28
contracts/libraries/SingletonFactory.sol
Normal file
28
contracts/libraries/SingletonFactory.sol
Normal file
|
@ -0,0 +1,28 @@
|
|||
// SPDX-License-Identifier: MIT
|
||||
|
||||
/**
|
||||
*Submitted for verification at Etherscan.io on 2020-03-30
|
||||
*/
|
||||
|
||||
pragma solidity 0.6.2;
|
||||
|
||||
/**
|
||||
* @title Singleton Factory (EIP-2470)
|
||||
* @notice Exposes CREATE2 (EIP-1014) to deploy bytecode on deterministic addresses based on initialization code and salt.
|
||||
* @author Ricardo Guilherme Schmidt (Status Research & Development GmbH)
|
||||
*/
|
||||
contract SingletonFactory {
|
||||
/**
|
||||
* @notice Deploys `_initCode` using `_salt` for defining the deterministic address.
|
||||
* @param _initCode Initialization code.
|
||||
* @param _salt Arbitrary value to modify resulting address.
|
||||
* @return createdContract Created contract address.
|
||||
*/
|
||||
function deploy(bytes memory _initCode, bytes32 _salt) public returns (address payable createdContract) {
|
||||
assembly {
|
||||
createdContract := create2(0, add(_initCode, 0x20), mload(_initCode), _salt)
|
||||
}
|
||||
}
|
||||
}
|
||||
// IV is a value changed to generate the vanity address.
|
||||
// IV: 6583047
|
Loading…
Add table
Add a link
Reference in a new issue