Universal deployer for EVM contracts
To deploy a contract send the
init_code of the contract to the Universal deployer. The deployed contract will have the same counter-factual address on all networks.
Universal deployer address:
Required funds: 0.02170000000014 ETH
This contract is going to be deployed using the keyless deployment method—also known as Nick’s method—which relies on a single-use address. (See Nick’s article for more details). This method works as follows:
Generate a transaction which deploys the contract from a new random account. This transaction MUST NOT use EIP155 in order to work on any chain. This transaction MUST have a relatively high gas price to be deployed on any chain. In this case, it is going to be 100 Gwei. Set the v, r, s of the transaction signature to the following values:
v: 27, r: 0x1820182018201820182018201820182018201820182018201820182018201820' s: 0x1820182018201820182018201820182018201820182018201820182018201820'
Those r and s values—made of a repeating pattern of 1820’s—are predictable “random numbers” generated deterministically by a human.
We recover the sender of this transaction, i.e., the single-use deployment account.
Thus we obtain an account that can broadcast that transaction, but we also have the warranty that nobody knows the private key of that account.
Send exactly 0.02170000000014 ether to this single-use deployment account.
Broadcast the deployment transaction. This operation can be done on any chain, guaranteeing that the contract address is always the same and nobody can use that address with a different contract.