Specification for an extension of ECIP-1040 to allow an EVM contract to create multiple versions.
This ECIP defines an extension to the base layer of account versioning (ECIP-1040) to allow an EVM contract to create sub-contracts of multiple versions. Although this is not necessary at this moment, it will be a nice-to-have add-on.
The base account versioning layer only allows contracts of the same
version to be deployed through
CREATE2. In this
section, we provide an extension to allow different versions of
contracts to be deployed via them, by providing two new opcodes,
Define two new opcodes
VCREATE takes 4 stack arguments (version, value, input
offset, input size), and
VCREATE2 takes 5 stack arguments (version,
endowment, memory_start, memory_length, salt). Note that except the
version, other arguments are the same as
The two new opcodes behave identically to
except that it deploys contracts with version specified by stack item
The network at all times maintains a constant list within the client
of all deployable versions (which can be different from supported
VCREATE2, if the specified
is not on the list of deployable versions, return out-of-gas.
By providing two additional opcodes
developers can deploy new contracts that take advantage of them to
create new sub-contracts of multiple versions. This may be useful for
situations like upgradable contracts (while it currently still can be
done via proxy contacts using only base layer account versioning).
This ECIP introduces two new opcodes for EVM runtime. Based on current assumed invariants, it should not have any noticeable backward compatibility issues.
Not yet provided.
Not yet implemented.
This work is licensed under Apache License, Version 2.0.