Support CREATE2
opcode
#328
tinker-michaelj
started this conversation in
Ideas
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
EIP-1014 introduced the
CREATE2
opcode to let a contract be deployed to a predictable address. Distributed exchanges, for example, make heavy use of theCREATE2
opcode. It can also be used to improve user onboarding flows.On Hedera today, the Solidity address of a contract is derived from the contract's
0.0.X
id, whereX
is a ledger-wide unique number that increments with each new entity created on the ledger. This address is 20 bytes where the first 12 bytes are all0
's and the last 8 bytes are the big-endian representation ofX
.For example, the Solidity address of contract
0.0.1001
isFurthermore, because each Hedera entity must have a unique
0.0.X
id, there is no way to predict before aContractCreate
has been handled what the new contract's address will be. So there was no obvious way to implementCREATE2
.But after HIP-32, there is now a mechanism in the code that provides a level of indirection between a
ByteString
"alias" and a0.0.X
id. This idea is to implementCREATE2
by using the alias mechanism to link the deterministic address specified in EIP-1014 to the new contract's0.0.X
id.Beta Was this translation helpful? Give feedback.
All reactions