TRC: Create2 #26
A new contract creation function called CREATE2
A new method of creating a contract is proposed where the resulting address can be determined by parties ahead of time.
Allows interactions to (actually or counterfactually in channels) be made with addresses that do not exist yet on-chain but can be relied on to only possibly eventually contain code that has been created by a particular piece of init code. Important for state-channel use cases that involve counterfactual interactions with contracts.
Adds a new opcode at 0xf5, which takes 4 stack arguments: endowment, memory_start, memory_length, salt. Behaves identically to CREATE, except using
The preimage for the final hashing round is thus always exactly
Since address calculation depends on hashing the
@taihaofu the formula in ETH is different and
Excerpt from EIP-1014:
address is always 21 bytes
Interesting reading: https://medium.com/coinmonks/why-create2-e99b6afcc28c