Skip to content

EOF creator contract for devnets #195

@chfast

Description

@chfast

After removal of the Creator Contract from the TXCREATE EIP we have to design a workflow for EOF code deployments on devnets and testnets.

Goals

Goals

  1. Have a stable address for the Creator Contract.

Maybe goals

  1. Have the creator contract in EOF.
  2. Reuse the Creator Contract from the earlier revision of the EIP.
  3. Mine a nice address for the creator contract.

Non-goals

  1. Have a full-featured creator contract.

Creator contracts

Pass-though

txcreate(calldataload(0), calldataload(32), 64, calldatasize()-64, callvalue())

Initcode-bounded

txcreate(calldataload(0), calldataload(0), 32, calldatasize()-32, callvalue())

or

txcreate(calldataload(0), calldataload(0), 0, 0, callvalue())

Initcode and arguments bounded

calldatacopy(0, 0, calldatasize())
let final_salt := keccack(0, calldatasize())
txcreate(calldataload(0), final_salt, 32, calldatasize()-32, callvalue())

One-off

let fixed_initcode_hash := 0x...
txcreate(fixed_initcode_hash, fixed_initcode_hash, 0, calldatasize(), callvalue())

Workflow

  1. Deploy the legacy creator contract with TXCREATE: either initcode-bounded, initcode-and-arguments-bounded or one-off with the hash of the EOF creator contract initcode. Use Nick's method to create and publish such transaction. This gives the stable address of this factory. This is the same as all system contracts' addresses are defined.
  2. Deploy the EOF creator contract using the legacy creator contract from 1. Because 1 has a stable address, the EOF creator contract will have a stable address too: the addresses derived from TXCREATE used only depend on the legacy creator contract itself ("sender") and the final salt which depends on EOF creator contract initcode only (it should have empty arguments).

Which legacy creator contract?

  • If we want to discourage any usage of it in the future, the one-off may be a good selection. However, it feels slightly wasteful.
  • Because the EOF creator contract initcode doesn't use any arguments, we can ignore bounding these and use initcode-bounded one.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions