Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

draft: implement eof_create_inputs definitions #648

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

0xMushow
Copy link
Collaborator

No description provided.

Parameter eof_decode : Bytes.t -> Eof.t.

Definition new (caller : Address.t) (value : U256.t)
(gas_limit : U64.t) (kind : EOFCreateKind.t) : Self :=
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We do not create any definitions in the links mode and only write run_new. This is one advantage of the links approach. Here the statement would be something like:

Definition run_new (caller : Address.t) (value : U256.t) (gas_limit : U64.t) (kind : EOFCreateKind.t) :
  {{
    (* the name is in the translation file and might be longer with more module prefixes *)
    Impl_revm_interpreter_interpreter_action_eof_create_inputs_EOFCreateInputs.new
      [] [] [φ caller; φ value; φ gas_limit; φ kind] ⇓
    fun (v : Self) => inl (φ v)
  }}.
Proof.

Then for an example of proof there is the file https://github.com/formal-land/coq-of-rust/blob/main/CoqOfRust/revm/links/interpreter/interpreter/gas.v , although it is still quite experimental.

Definition new_opcode (caller : Address.t) (created_address : Address.t)
(value : U256.t) (eof_init_code : Eof.t)
(gas_limit : U64.t) (input : Bytes.t) : Self :=
new caller value gas_limit (EOFCreateKind.Opcode eof_init_code input created_address).
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same as with the new function!

@0xMushow 0xMushow force-pushed the antoine-james@links-file-eof-create-inputs branch from d70bfdc to 6bf7f68 Compare January 24, 2025 15:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants