diff --git a/CoqOfPython/CoqOfPython.v b/CoqOfPython/CoqOfPython.v index 4e197a9..e7d3d63 100644 --- a/CoqOfPython/CoqOfPython.v +++ b/CoqOfPython/CoqOfPython.v @@ -32,9 +32,32 @@ Module Dict. Definition t (Value : Set) : Set := list (string * Value). - Parameter read : forall {Value : Set}, t Value -> string -> option Value. + Fixpoint read {Value : Set} (dict : t Value) (key : string) : option Value := + match dict with + | [] => None + | (current_key, value) :: dict => + if String.eqb current_key key then + Some value + else + read dict key + end. + + Fixpoint update {Value : Set} (dict : t Value) (key : string) (value : Value) : t Value := + match dict with + | [] => [] + | (current_key, current_value) :: dict => + if String.eqb current_key key then + (current_key, value) :: dict + else + (current_key, current_value) :: update dict key value + end. - Parameter write : forall {Value : Set}, t Value -> string -> Value -> t Value. + (** Starting from Python 3.7 the ordering in `dict` is guaranted to follow the insersion order. *) + Definition write {Value : Set} (dict : t Value) (key : string) (value : Value) : t Value := + match read dict key with + | Some _ => update dict key value + | None => dict ++ [(key, value)] + end. End Dict. Module Globals. @@ -211,9 +234,12 @@ End Exception. Definition M : Set := LowM.t (Value.t + Exception.t). -Parameter IsInGlobals : string -> Value.t -> string -> Prop. +Parameter IsInGlobals : Globals.t -> string -> Value.t -> Prop. -Parameter IsImported : string -> string -> string -> Prop. +Definition IsImported (globals : Globals.t) (import : Globals.t) (name : string) : Prop := + forall (value : Value.t), + IsInGlobals import name value -> + IsInGlobals globals name value. Module M. Definition pure (v : Value.t) : M := @@ -494,15 +520,18 @@ Module builtins. Definition type : Value.t := make_klass [] [] []. - Axiom type_in_globals : IsInGlobals "builtins" type "type". + Axiom type_in_globals : IsInGlobals "builtins" "type" type. Definition int : Value.t := make_klass [] [] []. - Axiom int_in_globals : IsInGlobals "builtins" int "int". + Axiom int_in_globals : IsInGlobals "builtins" "int" int. Definition str : Value.t := make_klass [] [] []. - Axiom str_in_globals : IsInGlobals "builtins" str "str". + Axiom str_in_globals : IsInGlobals "builtins" "str" str. End builtins. Parameter make_list_concat : list Value.t -> M. + +Definition make_function (f : Value.t -> Value.t -> M) : Value.t := + Value.Make "builtins" "function" (Pointer.Imm (Object.wrapper (Data.Closure f))). diff --git a/CoqOfPython/ethereum/arrow_glacier/bloom.v b/CoqOfPython/ethereum/arrow_glacier/bloom.v index 128d38b..9d2635d 100644 --- a/CoqOfPython/ethereum/arrow_glacier/bloom.v +++ b/CoqOfPython/ethereum/arrow_glacier/bloom.v @@ -140,6 +140,9 @@ Definition add_to_bloom : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom add_to_bloom_in_globals : + IsInGlobals globals "add_to_bloom" (make_function add_to_bloom). + Definition logs_bloom : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "logs" ] in @@ -209,3 +212,6 @@ Definition logs_bloom : Value.t -> Value.t -> M := |) |) in M.pure Constant.None_)). + +Axiom logs_bloom_in_globals : + IsInGlobals globals "logs_bloom" (make_function logs_bloom). diff --git a/CoqOfPython/ethereum/arrow_glacier/fork.v b/CoqOfPython/ethereum/arrow_glacier/fork.v index c7458cf..0231cd1 100644 --- a/CoqOfPython/ethereum/arrow_glacier/fork.v +++ b/CoqOfPython/ethereum/arrow_glacier/fork.v @@ -253,6 +253,9 @@ Definition apply_fork : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom apply_fork_in_globals : + IsInGlobals globals "apply_fork" (make_function apply_fork). + Definition get_last_256_block_hashes : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "chain" ] in @@ -365,6 +368,9 @@ Definition get_last_256_block_hashes : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom get_last_256_block_hashes_in_globals : + IsInGlobals globals "get_last_256_block_hashes" (make_function get_last_256_block_hashes). + Definition state_transition : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "chain"; "block" ] in @@ -533,6 +539,9 @@ Definition state_transition : Value.t -> Value.t -> M := )) |) in M.pure Constant.None_)). +Axiom state_transition_in_globals : + IsInGlobals globals "state_transition" (make_function state_transition). + Definition calculate_base_fee_per_gas : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "block_gas_limit"; "parent_gas_limit"; "parent_gas_used"; "parent_base_fee_per_gas" ] in @@ -698,6 +707,9 @@ Definition calculate_base_fee_per_gas : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom calculate_base_fee_per_gas_in_globals : + IsInGlobals globals "calculate_base_fee_per_gas" (make_function calculate_base_fee_per_gas). + Definition validate_header : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "header"; "parent_header" ] in @@ -864,6 +876,9 @@ Definition validate_header : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom validate_header_in_globals : + IsInGlobals globals "validate_header" (make_function validate_header). + Definition generate_header_hash_for_pow : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "header" ] in @@ -920,6 +935,9 @@ Definition generate_header_hash_for_pow : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom generate_header_hash_for_pow_in_globals : + IsInGlobals globals "generate_header_hash_for_pow" (make_function generate_header_hash_for_pow). + Definition validate_proof_of_work : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "header" ] in @@ -1010,6 +1028,9 @@ Definition validate_proof_of_work : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom validate_proof_of_work_in_globals : + IsInGlobals globals "validate_proof_of_work" (make_function validate_proof_of_work). + Definition check_transaction : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "tx"; "base_fee_per_gas"; "gas_available"; "chain_id" ] in @@ -1143,6 +1164,9 @@ Definition check_transaction : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom check_transaction_in_globals : + IsInGlobals globals "check_transaction" (make_function check_transaction). + Definition make_receipt : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "tx"; "error"; "cumulative_gas_used"; "logs" ] in @@ -1240,6 +1264,9 @@ Definition make_receipt : Value.t -> Value.t -> M := )) |) in M.pure Constant.None_)). +Axiom make_receipt_in_globals : + IsInGlobals globals "make_receipt" (make_function make_receipt). + Definition ApplyBodyOutput : Value.t := builtins.make_klass [] @@ -1493,6 +1520,9 @@ Definition apply_body : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom apply_body_in_globals : + IsInGlobals globals "apply_body" (make_function apply_body). + Definition validate_ommers : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "ommers"; "block_header"; "chain" ] in @@ -1814,6 +1844,9 @@ Definition validate_ommers : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom validate_ommers_in_globals : + IsInGlobals globals "validate_ommers" (make_function validate_ommers). + Definition pay_rewards : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "state"; "block_number"; "coinbase"; "ommers" ] in @@ -1919,6 +1952,9 @@ Definition pay_rewards : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom pay_rewards_in_globals : + IsInGlobals globals "pay_rewards" (make_function pay_rewards). + Definition process_transaction : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "env"; "tx" ] in @@ -2395,6 +2431,9 @@ Definition process_transaction : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom process_transaction_in_globals : + IsInGlobals globals "process_transaction" (make_function process_transaction). + Definition validate_transaction : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "tx" ] in @@ -2451,6 +2490,9 @@ Definition validate_transaction : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom validate_transaction_in_globals : + IsInGlobals globals "validate_transaction" (make_function validate_transaction). + Definition calculate_intrinsic_cost : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "tx" ] in @@ -2616,6 +2658,9 @@ Definition calculate_intrinsic_cost : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom calculate_intrinsic_cost_in_globals : + IsInGlobals globals "calculate_intrinsic_cost" (make_function calculate_intrinsic_cost). + Definition recover_sender : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "chain_id"; "tx" ] in @@ -2908,6 +2953,9 @@ Definition recover_sender : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom recover_sender_in_globals : + IsInGlobals globals "recover_sender" (make_function recover_sender). + Definition signing_hash_pre155 : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "tx" ] in @@ -2942,6 +2990,9 @@ Definition signing_hash_pre155 : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom signing_hash_pre155_in_globals : + IsInGlobals globals "signing_hash_pre155" (make_function signing_hash_pre155). + Definition signing_hash_155 : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "tx"; "chain_id" ] in @@ -2990,6 +3041,9 @@ Definition signing_hash_155 : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom signing_hash_155_in_globals : + IsInGlobals globals "signing_hash_155" (make_function signing_hash_155). + Definition signing_hash_2930 : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "tx" ] in @@ -3027,6 +3081,9 @@ Definition signing_hash_2930 : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom signing_hash_2930_in_globals : + IsInGlobals globals "signing_hash_2930" (make_function signing_hash_2930). + Definition signing_hash_1559 : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "tx" ] in @@ -3064,6 +3121,9 @@ Definition signing_hash_1559 : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom signing_hash_1559_in_globals : + IsInGlobals globals "signing_hash_1559" (make_function signing_hash_1559). + Definition compute_header_hash : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "header" ] in @@ -3116,6 +3176,9 @@ Definition compute_header_hash : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom compute_header_hash_in_globals : + IsInGlobals globals "compute_header_hash" (make_function compute_header_hash). + Definition check_gas_limit : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "gas_limit"; "parent_gas_limit" ] in @@ -3216,6 +3279,9 @@ Definition check_gas_limit : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom check_gas_limit_in_globals : + IsInGlobals globals "check_gas_limit" (make_function check_gas_limit). + Definition calculate_block_difficulty : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "block_number"; "block_timestamp"; "parent_timestamp"; "parent_difficulty"; "parent_has_ommers" ] in @@ -3376,3 +3442,6 @@ Constant.int 1 |) |) in M.pure Constant.None_)). + +Axiom calculate_block_difficulty_in_globals : + IsInGlobals globals "calculate_block_difficulty" (make_function calculate_block_difficulty). diff --git a/CoqOfPython/ethereum/arrow_glacier/fork_types.v b/CoqOfPython/ethereum/arrow_glacier/fork_types.v index d1223e7..247c71e 100644 --- a/CoqOfPython/ethereum/arrow_glacier/fork_types.v +++ b/CoqOfPython/ethereum/arrow_glacier/fork_types.v @@ -99,3 +99,6 @@ Definition encode_account : Value.t -> Value.t -> M := |) |) in M.pure Constant.None_)). + +Axiom encode_account_in_globals : + IsInGlobals globals "encode_account" (make_function encode_account). diff --git a/CoqOfPython/ethereum/arrow_glacier/state.v b/CoqOfPython/ethereum/arrow_glacier/state.v index a0b8e6e..ee0b067 100644 --- a/CoqOfPython/ethereum/arrow_glacier/state.v +++ b/CoqOfPython/ethereum/arrow_glacier/state.v @@ -100,6 +100,9 @@ Definition close_state : Value.t -> Value.t -> M := let _ := M.delete (| M.get_field (| M.get_name (| globals, locals_stack, "state" |), "_created_accounts" |) |) in M.pure Constant.None_)). +Axiom close_state_in_globals : + IsInGlobals globals "close_state" (make_function close_state). + Definition begin_transaction : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "state" ] in @@ -130,6 +133,9 @@ Definition begin_transaction : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom begin_transaction_in_globals : + IsInGlobals globals "begin_transaction" (make_function begin_transaction). + Definition commit_transaction : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "state" ] in @@ -165,6 +171,9 @@ Definition commit_transaction : Value.t -> Value.t -> M := )) |) in M.pure Constant.None_)). +Axiom commit_transaction_in_globals : + IsInGlobals globals "commit_transaction" (make_function commit_transaction). + Definition rollback_transaction : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "state" ] in @@ -204,6 +213,9 @@ Definition rollback_transaction : Value.t -> Value.t -> M := )) |) in M.pure Constant.None_)). +Axiom rollback_transaction_in_globals : + IsInGlobals globals "rollback_transaction" (make_function rollback_transaction). + Definition get_account : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "state"; "address" ] in @@ -264,6 +276,9 @@ Definition get_account : Value.t -> Value.t -> M := )) |) in M.pure Constant.None_)). +Axiom get_account_in_globals : + IsInGlobals globals "get_account" (make_function get_account). + Definition get_account_optional : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "state"; "address" ] in @@ -300,6 +315,9 @@ Definition get_account_optional : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom get_account_optional_in_globals : + IsInGlobals globals "get_account_optional" (make_function get_account_optional). + Definition set_account : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "state"; "address"; "account" ] in @@ -328,6 +346,9 @@ Definition set_account : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom set_account_in_globals : + IsInGlobals globals "set_account" (make_function set_account). + Definition destroy_account : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "state"; "address" ] in @@ -365,6 +386,9 @@ Definition destroy_account : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom destroy_account_in_globals : + IsInGlobals globals "destroy_account" (make_function destroy_account). + Definition destroy_storage : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "state"; "address" ] in @@ -399,6 +423,9 @@ Definition destroy_storage : Value.t -> Value.t -> M := )) |) in M.pure Constant.None_)). +Axiom destroy_storage_in_globals : + IsInGlobals globals "destroy_storage" (make_function destroy_storage). + Definition mark_account_created : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "state"; "address" ] in @@ -428,6 +455,9 @@ Definition mark_account_created : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom mark_account_created_in_globals : + IsInGlobals globals "mark_account_created" (make_function mark_account_created). + Definition get_storage : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "state"; "address"; "key" ] in @@ -507,6 +537,9 @@ Definition get_storage : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom get_storage_in_globals : + IsInGlobals globals "get_storage" (make_function get_storage). + Definition set_storage : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "state"; "address"; "key"; "value" ] in @@ -605,6 +638,9 @@ Definition set_storage : Value.t -> Value.t -> M := )) |) in M.pure Constant.None_)). +Axiom set_storage_in_globals : + IsInGlobals globals "set_storage" (make_function set_storage). + Definition storage_root : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "state"; "address" ] in @@ -656,6 +692,9 @@ Definition storage_root : Value.t -> Value.t -> M := )) |) in M.pure Constant.None_)). +Axiom storage_root_in_globals : + IsInGlobals globals "storage_root" (make_function storage_root). + Definition state_root : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "state" ] in @@ -686,6 +725,9 @@ Definition state_root : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom state_root_in_globals : + IsInGlobals globals "state_root" (make_function state_root). + Definition account_exists : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "state"; "address" ] in @@ -720,6 +762,9 @@ Definition account_exists : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom account_exists_in_globals : + IsInGlobals globals "account_exists" (make_function account_exists). + Definition account_has_code_or_nonce : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "state"; "address" ] in @@ -773,6 +818,9 @@ Definition account_has_code_or_nonce : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom account_has_code_or_nonce_in_globals : + IsInGlobals globals "account_has_code_or_nonce" (make_function account_has_code_or_nonce). + Definition is_account_empty : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "state"; "address" ] in @@ -834,6 +882,9 @@ Definition is_account_empty : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom is_account_empty_in_globals : + IsInGlobals globals "is_account_empty" (make_function is_account_empty). + Definition account_exists_and_is_empty : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "state"; "address" ] in @@ -904,6 +955,9 @@ Definition account_exists_and_is_empty : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom account_exists_and_is_empty_in_globals : + IsInGlobals globals "account_exists_and_is_empty" (make_function account_exists_and_is_empty). + Definition is_account_alive : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "state"; "address" ] in @@ -981,6 +1035,9 @@ Definition is_account_alive : Value.t -> Value.t -> M := )) |) in M.pure Constant.None_)). +Axiom is_account_alive_in_globals : + IsInGlobals globals "is_account_alive" (make_function is_account_alive). + Definition modify_state : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "state"; "address"; "f" ] in @@ -1013,6 +1070,9 @@ Definition modify_state : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom modify_state_in_globals : + IsInGlobals globals "modify_state" (make_function modify_state). + Definition move_ether : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "state"; "sender_address"; "recipient_address"; "amount" ] in @@ -1042,6 +1102,9 @@ Definition move_ether : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom move_ether_in_globals : + IsInGlobals globals "move_ether" (make_function move_ether). + Definition set_account_balance : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "state"; "address"; "amount" ] in @@ -1072,6 +1135,9 @@ Definition set_account_balance : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom set_account_balance_in_globals : + IsInGlobals globals "set_account_balance" (make_function set_account_balance). + Definition touch_account : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "state"; "address" ] in @@ -1116,6 +1182,9 @@ Definition touch_account : Value.t -> Value.t -> M := )) |) in M.pure Constant.None_)). +Axiom touch_account_in_globals : + IsInGlobals globals "touch_account" (make_function touch_account). + Definition increment_nonce : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "state"; "address" ] in @@ -1143,6 +1212,9 @@ Definition increment_nonce : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom increment_nonce_in_globals : + IsInGlobals globals "increment_nonce" (make_function increment_nonce). + Definition set_code : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "state"; "address"; "code" ] in @@ -1173,6 +1245,9 @@ Definition set_code : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom set_code_in_globals : + IsInGlobals globals "set_code" (make_function set_code). + Definition create_ether : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "state"; "address"; "amount" ] in @@ -1201,6 +1276,9 @@ Definition create_ether : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom create_ether_in_globals : + IsInGlobals globals "create_ether" (make_function create_ether). + Definition get_storage_original : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "state"; "address"; "key" ] in @@ -1306,3 +1384,6 @@ Definition get_storage_original : Value.t -> Value.t -> M := M.get_name (| globals, locals_stack, "original_value" |) |) in M.pure Constant.None_)). + +Axiom get_storage_original_in_globals : + IsInGlobals globals "get_storage_original" (make_function get_storage_original). diff --git a/CoqOfPython/ethereum/arrow_glacier/transactions.v b/CoqOfPython/ethereum/arrow_glacier/transactions.v index ab24a7f..9fda9f0 100644 --- a/CoqOfPython/ethereum/arrow_glacier/transactions.v +++ b/CoqOfPython/ethereum/arrow_glacier/transactions.v @@ -201,6 +201,9 @@ Definition encode_transaction : Value.t -> Value.t -> M := )) |) in M.pure Constant.None_)). +Axiom encode_transaction_in_globals : + IsInGlobals globals "encode_transaction" (make_function encode_transaction). + Definition decode_transaction : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "tx" ] in @@ -295,3 +298,6 @@ Definition decode_transaction : Value.t -> Value.t -> M := M.pure Constant.None_ )) |) in M.pure Constant.None_)). + +Axiom decode_transaction_in_globals : + IsInGlobals globals "decode_transaction" (make_function decode_transaction). diff --git a/CoqOfPython/ethereum/arrow_glacier/trie.v b/CoqOfPython/ethereum/arrow_glacier/trie.v index a607f38..3777ab8 100644 --- a/CoqOfPython/ethereum/arrow_glacier/trie.v +++ b/CoqOfPython/ethereum/arrow_glacier/trie.v @@ -371,6 +371,9 @@ Definition encode_internal_node : Value.t -> Value.t -> M := )) |) in M.pure Constant.None_)). +Axiom encode_internal_node_in_globals : + IsInGlobals globals "encode_internal_node" (make_function encode_internal_node). + Definition encode_node : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "node"; "storage_root" ] in @@ -479,6 +482,9 @@ Definition encode_node : Value.t -> Value.t -> M := )) |) in M.pure Constant.None_)). +Axiom encode_node_in_globals : + IsInGlobals globals "encode_node" (make_function encode_node). + Definition Trie : Value.t := builtins.make_klass [(* At base: unsupported node type: Subscript *)] @@ -526,6 +532,9 @@ Definition copy_trie : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom copy_trie_in_globals : + IsInGlobals globals "copy_trie" (make_function copy_trie). + Definition trie_set : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "trie"; "key"; "value" ] in @@ -586,6 +595,9 @@ Definition trie_set : Value.t -> Value.t -> M := )) |) in M.pure Constant.None_)). +Axiom trie_set_in_globals : + IsInGlobals globals "trie_set" (make_function trie_set). + Definition trie_get : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "trie"; "key" ] in @@ -619,6 +631,9 @@ Definition trie_get : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom trie_get_in_globals : + IsInGlobals globals "trie_get" (make_function trie_get). + Definition common_prefix_length : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "a"; "b" ] in @@ -697,6 +712,9 @@ Definition common_prefix_length : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom common_prefix_length_in_globals : + IsInGlobals globals "common_prefix_length" (make_function common_prefix_length). + Definition nibble_list_to_compact : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "x"; "is_leaf" ] in @@ -905,6 +923,9 @@ Definition nibble_list_to_compact : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom nibble_list_to_compact_in_globals : + IsInGlobals globals "nibble_list_to_compact" (make_function nibble_list_to_compact). + Definition bytes_to_nibble_list : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "bytes_" ] in @@ -1001,6 +1022,9 @@ Definition bytes_to_nibble_list : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom bytes_to_nibble_list_in_globals : + IsInGlobals globals "bytes_to_nibble_list" (make_function bytes_to_nibble_list). + Definition _prepare_trie : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "trie"; "get_storage_root" ] in @@ -1152,6 +1176,9 @@ Definition _prepare_trie : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom _prepare_trie_in_globals : + IsInGlobals globals "_prepare_trie" (make_function _prepare_trie). + Definition root : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "trie"; "get_storage_root" ] in @@ -1267,6 +1294,9 @@ Definition root : Value.t -> Value.t -> M := )) |) in M.pure Constant.None_)). +Axiom root_in_globals : + IsInGlobals globals "root" (make_function root). + Definition patricialize : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "obj"; "level" ] in @@ -1606,3 +1636,6 @@ Definition patricialize : Value.t -> Value.t -> M := |) |) in M.pure Constant.None_)). + +Axiom patricialize_in_globals : + IsInGlobals globals "patricialize" (make_function patricialize). diff --git a/CoqOfPython/ethereum/arrow_glacier/utils/address.v b/CoqOfPython/ethereum/arrow_glacier/utils/address.v index a702f3e..659c888 100644 --- a/CoqOfPython/ethereum/arrow_glacier/utils/address.v +++ b/CoqOfPython/ethereum/arrow_glacier/utils/address.v @@ -79,6 +79,9 @@ Definition to_address : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom to_address_in_globals : + IsInGlobals globals "to_address" (make_function to_address). + Definition compute_contract_address : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "address"; "nonce" ] in @@ -149,6 +152,9 @@ Definition compute_contract_address : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom compute_contract_address_in_globals : + IsInGlobals globals "compute_contract_address" (make_function compute_contract_address). + Definition compute_create2_contract_address : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "address"; "salt"; "call_data" ] in @@ -230,3 +236,6 @@ Definition compute_create2_contract_address : Value.t -> Value.t -> M := |) |) in M.pure Constant.None_)). + +Axiom compute_create2_contract_address_in_globals : + IsInGlobals globals "compute_create2_contract_address" (make_function compute_create2_contract_address). diff --git a/CoqOfPython/ethereum/arrow_glacier/utils/hexadecimal.v b/CoqOfPython/ethereum/arrow_glacier/utils/hexadecimal.v index ff8431f..d63c03c 100644 --- a/CoqOfPython/ethereum/arrow_glacier/utils/hexadecimal.v +++ b/CoqOfPython/ethereum/arrow_glacier/utils/hexadecimal.v @@ -70,6 +70,9 @@ Definition hex_to_root : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom hex_to_root_in_globals : + IsInGlobals globals "hex_to_root" (make_function hex_to_root). + Definition hex_to_bloom : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "hex_string" ] in @@ -110,6 +113,9 @@ Definition hex_to_bloom : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom hex_to_bloom_in_globals : + IsInGlobals globals "hex_to_bloom" (make_function hex_to_bloom). + Definition hex_to_address : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "hex_string" ] in @@ -156,3 +162,6 @@ Definition hex_to_address : Value.t -> Value.t -> M := |) |) in M.pure Constant.None_)). + +Axiom hex_to_address_in_globals : + IsInGlobals globals "hex_to_address" (make_function hex_to_address). diff --git a/CoqOfPython/ethereum/arrow_glacier/utils/message.v b/CoqOfPython/ethereum/arrow_glacier/utils/message.v index f3cf69e..940bd50 100644 --- a/CoqOfPython/ethereum/arrow_glacier/utils/message.v +++ b/CoqOfPython/ethereum/arrow_glacier/utils/message.v @@ -267,3 +267,6 @@ Definition prepare_message : Value.t -> Value.t -> M := |) |) in M.pure Constant.None_)). + +Axiom prepare_message_in_globals : + IsInGlobals globals "prepare_message" (make_function prepare_message). diff --git a/CoqOfPython/ethereum/arrow_glacier/vm/__init__.v b/CoqOfPython/ethereum/arrow_glacier/vm/__init__.v index 07ef173..12056c6 100644 --- a/CoqOfPython/ethereum/arrow_glacier/vm/__init__.v +++ b/CoqOfPython/ethereum/arrow_glacier/vm/__init__.v @@ -182,6 +182,9 @@ Definition incorporate_child_on_success : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom incorporate_child_on_success_in_globals : + IsInGlobals globals "incorporate_child_on_success" (make_function incorporate_child_on_success). + Definition incorporate_child_on_error : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm"; "child_evm" ] in @@ -262,3 +265,6 @@ Definition incorporate_child_on_error : Value.t -> Value.t -> M := M.get_field (| M.get_name (| globals, locals_stack, "child_evm" |), "gas_left" |) |) in M.pure Constant.None_)). + +Axiom incorporate_child_on_error_in_globals : + IsInGlobals globals "incorporate_child_on_error" (make_function incorporate_child_on_error). diff --git a/CoqOfPython/ethereum/arrow_glacier/vm/gas.v b/CoqOfPython/ethereum/arrow_glacier/vm/gas.v index 49e4e06..73fe5f7 100644 --- a/CoqOfPython/ethereum/arrow_glacier/vm/gas.v +++ b/CoqOfPython/ethereum/arrow_glacier/vm/gas.v @@ -523,6 +523,9 @@ Definition charge_gas : Value.t -> Value.t -> M := )) |) in M.pure Constant.None_)). +Axiom charge_gas_in_globals : + IsInGlobals globals "charge_gas" (make_function charge_gas). + Definition calculate_memory_gas_cost : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "size_in_bytes" ] in @@ -582,6 +585,9 @@ Definition calculate_memory_gas_cost : Value.t -> Value.t -> M := (* At stmt: unsupported node type: Try *) M.pure Constant.None_)). +Axiom calculate_memory_gas_cost_in_globals : + IsInGlobals globals "calculate_memory_gas_cost" (make_function calculate_memory_gas_cost). + Definition calculate_gas_extend_memory : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "memory"; "extensions" ] in @@ -765,6 +771,9 @@ Definition calculate_gas_extend_memory : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom calculate_gas_extend_memory_in_globals : + IsInGlobals globals "calculate_gas_extend_memory" (make_function calculate_gas_extend_memory). + Definition calculate_message_call_gas : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "value"; "gas"; "gas_left"; "memory_cost"; "extra_gas"; "call_stipend" ] in @@ -890,6 +899,9 @@ M.get_name (| globals, locals_stack, "call_stipend" |) |) in M.pure Constant.None_)). +Axiom calculate_message_call_gas_in_globals : + IsInGlobals globals "calculate_message_call_gas" (make_function calculate_message_call_gas). + Definition max_message_call_gas : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "gas" ] in @@ -917,3 +929,6 @@ Definition max_message_call_gas : Value.t -> Value.t -> M := |) |) in M.pure Constant.None_)). + +Axiom max_message_call_gas_in_globals : + IsInGlobals globals "max_message_call_gas" (make_function max_message_call_gas). diff --git a/CoqOfPython/ethereum/arrow_glacier/vm/instructions/arithmetic.v b/CoqOfPython/ethereum/arrow_glacier/vm/instructions/arithmetic.v index 9597ba5..758bf7c 100644 --- a/CoqOfPython/ethereum/arrow_glacier/vm/instructions/arithmetic.v +++ b/CoqOfPython/ethereum/arrow_glacier/vm/instructions/arithmetic.v @@ -119,6 +119,9 @@ Definition add : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom add_in_globals : + IsInGlobals globals "add" (make_function add). + Definition sub : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -186,6 +189,9 @@ Definition sub : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom sub_in_globals : + IsInGlobals globals "sub" (make_function sub). + Definition mul : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -253,6 +259,9 @@ Definition mul : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom mul_in_globals : + IsInGlobals globals "mul" (make_function mul). + Definition div : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -341,6 +350,9 @@ Definition div : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom div_in_globals : + IsInGlobals globals "div" (make_function div). + Definition sdiv : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -491,6 +503,9 @@ Definition sdiv : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom sdiv_in_globals : + IsInGlobals globals "sdiv" (make_function sdiv). + Definition mod_ : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -579,6 +594,9 @@ Definition mod_ : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom mod__in_globals : + IsInGlobals globals "mod" (make_function mod_). + Definition smod : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -696,6 +714,9 @@ Definition smod : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom smod_in_globals : + IsInGlobals globals "smod" (make_function smod). + Definition addmod : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -821,6 +842,9 @@ Definition addmod : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom addmod_in_globals : + IsInGlobals globals "addmod" (make_function addmod). + Definition mulmod : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -946,6 +970,9 @@ Definition mulmod : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom mulmod_in_globals : + IsInGlobals globals "mulmod" (make_function mulmod). + Definition exp : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -1057,6 +1084,9 @@ Definition exp : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom exp_in_globals : + IsInGlobals globals "exp" (make_function exp). + Definition signextend : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -1231,3 +1261,6 @@ Definition signextend : Value.t -> Value.t -> M := Constant.int 1 |) in M.pure Constant.None_)). + +Axiom signextend_in_globals : + IsInGlobals globals "signextend" (make_function signextend). diff --git a/CoqOfPython/ethereum/arrow_glacier/vm/instructions/bitwise.v b/CoqOfPython/ethereum/arrow_glacier/vm/instructions/bitwise.v index c847f7a..eca8a4c 100644 --- a/CoqOfPython/ethereum/arrow_glacier/vm/instructions/bitwise.v +++ b/CoqOfPython/ethereum/arrow_glacier/vm/instructions/bitwise.v @@ -97,6 +97,9 @@ Definition bitwise_and : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom bitwise_and_in_globals : + IsInGlobals globals "bitwise_and" (make_function bitwise_and). + Definition bitwise_or : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -157,6 +160,9 @@ Definition bitwise_or : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom bitwise_or_in_globals : + IsInGlobals globals "bitwise_or" (make_function bitwise_or). + Definition bitwise_xor : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -217,6 +223,9 @@ Definition bitwise_xor : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom bitwise_xor_in_globals : + IsInGlobals globals "bitwise_xor" (make_function bitwise_xor). + Definition bitwise_not : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -264,6 +273,9 @@ Definition bitwise_not : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom bitwise_not_in_globals : + IsInGlobals globals "bitwise_not" (make_function bitwise_not). + Definition get_byte : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -380,6 +392,9 @@ Definition get_byte : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom get_byte_in_globals : + IsInGlobals globals "get_byte" (make_function get_byte). + Definition bitwise_shl : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -475,6 +490,9 @@ Definition bitwise_shl : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom bitwise_shl_in_globals : + IsInGlobals globals "bitwise_shl" (make_function bitwise_shl). + Definition bitwise_shr : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -561,6 +579,9 @@ Definition bitwise_shr : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom bitwise_shr_in_globals : + IsInGlobals globals "bitwise_shr" (make_function bitwise_shr). + Definition bitwise_sar : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -674,3 +695,6 @@ Definition bitwise_sar : Value.t -> Value.t -> M := Constant.int 1 |) in M.pure Constant.None_)). + +Axiom bitwise_sar_in_globals : + IsInGlobals globals "bitwise_sar" (make_function bitwise_sar). diff --git a/CoqOfPython/ethereum/arrow_glacier/vm/instructions/block.v b/CoqOfPython/ethereum/arrow_glacier/vm/instructions/block.v index 1a1ef12..e9ac3a7 100644 --- a/CoqOfPython/ethereum/arrow_glacier/vm/instructions/block.v +++ b/CoqOfPython/ethereum/arrow_glacier/vm/instructions/block.v @@ -129,6 +129,9 @@ Definition block_hash : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom block_hash_in_globals : + IsInGlobals globals "block_hash" (make_function block_hash). + Definition coinbase : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -176,6 +179,9 @@ Definition coinbase : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom coinbase_in_globals : + IsInGlobals globals "coinbase" (make_function coinbase). + Definition timestamp : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -217,6 +223,9 @@ Definition timestamp : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom timestamp_in_globals : + IsInGlobals globals "timestamp" (make_function timestamp). + Definition number : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -263,6 +272,9 @@ Definition number : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom number_in_globals : + IsInGlobals globals "number" (make_function number). + Definition difficulty : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -309,6 +321,9 @@ Definition difficulty : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom difficulty_in_globals : + IsInGlobals globals "difficulty" (make_function difficulty). + Definition gas_limit : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -355,6 +370,9 @@ Definition gas_limit : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom gas_limit_in_globals : + IsInGlobals globals "gas_limit" (make_function gas_limit). + Definition chain_id : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -397,3 +415,6 @@ Definition chain_id : Value.t -> Value.t -> M := Constant.int 1 |) in M.pure Constant.None_)). + +Axiom chain_id_in_globals : + IsInGlobals globals "chain_id" (make_function chain_id). diff --git a/CoqOfPython/ethereum/arrow_glacier/vm/instructions/comparison.v b/CoqOfPython/ethereum/arrow_glacier/vm/instructions/comparison.v index 908a3d2..b5f7ef5 100644 --- a/CoqOfPython/ethereum/arrow_glacier/vm/instructions/comparison.v +++ b/CoqOfPython/ethereum/arrow_glacier/vm/instructions/comparison.v @@ -105,6 +105,9 @@ Definition less_than : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom less_than_in_globals : + IsInGlobals globals "less_than" (make_function less_than). + Definition signed_less_than : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -182,6 +185,9 @@ Definition signed_less_than : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom signed_less_than_in_globals : + IsInGlobals globals "signed_less_than" (make_function signed_less_than). + Definition greater_than : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -252,6 +258,9 @@ Definition greater_than : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom greater_than_in_globals : + IsInGlobals globals "greater_than" (make_function greater_than). + Definition signed_greater_than : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -329,6 +338,9 @@ Definition signed_greater_than : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom signed_greater_than_in_globals : + IsInGlobals globals "signed_greater_than" (make_function signed_greater_than). + Definition equal : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -399,6 +411,9 @@ Definition equal : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom equal_in_globals : + IsInGlobals globals "equal" (make_function equal). + Definition is_zero : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -458,3 +473,6 @@ Definition is_zero : Value.t -> Value.t -> M := Constant.int 1 |) in M.pure Constant.None_)). + +Axiom is_zero_in_globals : + IsInGlobals globals "is_zero" (make_function is_zero). diff --git a/CoqOfPython/ethereum/arrow_glacier/vm/instructions/control_flow.v b/CoqOfPython/ethereum/arrow_glacier/vm/instructions/control_flow.v index 5ddb601..7b9d85d 100644 --- a/CoqOfPython/ethereum/arrow_glacier/vm/instructions/control_flow.v +++ b/CoqOfPython/ethereum/arrow_glacier/vm/instructions/control_flow.v @@ -71,6 +71,9 @@ Definition stop : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom stop_in_globals : + IsInGlobals globals "stop" (make_function stop). + Definition jump : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -136,6 +139,9 @@ Definition jump : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom jump_in_globals : + IsInGlobals globals "jump" (make_function jump). + Definition jumpi : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -237,6 +243,9 @@ Definition jumpi : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom jumpi_in_globals : + IsInGlobals globals "jumpi" (make_function jumpi). + Definition pc : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -281,6 +290,9 @@ Definition pc : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom pc_in_globals : + IsInGlobals globals "pc" (make_function pc). + Definition gas_left : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -325,6 +337,9 @@ Definition gas_left : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom gas_left_in_globals : + IsInGlobals globals "gas_left" (make_function gas_left). + Definition jumpdest : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -356,3 +371,6 @@ Definition jumpdest : Value.t -> Value.t -> M := Constant.int 1 |) in M.pure Constant.None_)). + +Axiom jumpdest_in_globals : + IsInGlobals globals "jumpdest" (make_function jumpdest). diff --git a/CoqOfPython/ethereum/arrow_glacier/vm/instructions/environment.v b/CoqOfPython/ethereum/arrow_glacier/vm/instructions/environment.v index df5ed9f..f3ecb1b 100644 --- a/CoqOfPython/ethereum/arrow_glacier/vm/instructions/environment.v +++ b/CoqOfPython/ethereum/arrow_glacier/vm/instructions/environment.v @@ -120,6 +120,9 @@ Definition address : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom address_in_globals : + IsInGlobals globals "address" (make_function address). + Definition balance : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -212,6 +215,9 @@ Definition balance : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom balance_in_globals : + IsInGlobals globals "balance" (make_function balance). + Definition origin : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -256,6 +262,9 @@ Definition origin : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom origin_in_globals : + IsInGlobals globals "origin" (make_function origin). + Definition caller : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -299,6 +308,9 @@ Definition caller : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom caller_in_globals : + IsInGlobals globals "caller" (make_function caller). + Definition callvalue : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -336,6 +348,9 @@ Definition callvalue : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom callvalue_in_globals : + IsInGlobals globals "callvalue" (make_function callvalue). + Definition calldataload : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -407,6 +422,9 @@ Definition calldataload : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom calldataload_in_globals : + IsInGlobals globals "calldataload" (make_function calldataload). + Definition calldatasize : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -456,6 +474,9 @@ Definition calldatasize : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom calldatasize_in_globals : + IsInGlobals globals "calldatasize" (make_function calldatasize). + Definition calldatacopy : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -591,6 +612,9 @@ Definition calldatacopy : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom calldatacopy_in_globals : + IsInGlobals globals "calldatacopy" (make_function calldatacopy). + Definition codesize : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -640,6 +664,9 @@ Definition codesize : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom codesize_in_globals : + IsInGlobals globals "codesize" (make_function codesize). + Definition codecopy : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -775,6 +802,9 @@ Definition codecopy : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom codecopy_in_globals : + IsInGlobals globals "codecopy" (make_function codecopy). + Definition gasprice : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -818,6 +848,9 @@ Definition gasprice : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom gasprice_in_globals : + IsInGlobals globals "gasprice" (make_function gasprice). + Definition extcodesize : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -922,6 +955,9 @@ Definition extcodesize : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom extcodesize_in_globals : + IsInGlobals globals "extcodesize" (make_function extcodesize). + Definition extcodecopy : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -1116,6 +1152,9 @@ Definition extcodecopy : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom extcodecopy_in_globals : + IsInGlobals globals "extcodecopy" (make_function extcodecopy). + Definition returndatasize : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -1164,6 +1203,9 @@ Definition returndatasize : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom returndatasize_in_globals : + IsInGlobals globals "returndatasize" (make_function returndatasize). + Definition returndatacopy : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -1327,6 +1369,9 @@ Definition returndatacopy : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom returndatacopy_in_globals : + IsInGlobals globals "returndatacopy" (make_function returndatacopy). + Definition extcodehash : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -1457,6 +1502,9 @@ Definition extcodehash : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom extcodehash_in_globals : + IsInGlobals globals "extcodehash" (make_function extcodehash). + Definition self_balance : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -1505,6 +1553,9 @@ Definition self_balance : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom self_balance_in_globals : + IsInGlobals globals "self_balance" (make_function self_balance). + Definition base_fee : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -1547,3 +1598,6 @@ Definition base_fee : Value.t -> Value.t -> M := Constant.int 1 |) in M.pure Constant.None_)). + +Axiom base_fee_in_globals : + IsInGlobals globals "base_fee" (make_function base_fee). diff --git a/CoqOfPython/ethereum/arrow_glacier/vm/instructions/keccak.v b/CoqOfPython/ethereum/arrow_glacier/vm/instructions/keccak.v index 1f22c7b..ea52096 100644 --- a/CoqOfPython/ethereum/arrow_glacier/vm/instructions/keccak.v +++ b/CoqOfPython/ethereum/arrow_glacier/vm/instructions/keccak.v @@ -189,3 +189,6 @@ Definition keccak : Value.t -> Value.t -> M := Constant.int 1 |) in M.pure Constant.None_)). + +Axiom keccak_in_globals : + IsInGlobals globals "keccak" (make_function keccak). diff --git a/CoqOfPython/ethereum/arrow_glacier/vm/instructions/log.v b/CoqOfPython/ethereum/arrow_glacier/vm/instructions/log.v index 2011aea..92ec5ae 100644 --- a/CoqOfPython/ethereum/arrow_glacier/vm/instructions/log.v +++ b/CoqOfPython/ethereum/arrow_glacier/vm/instructions/log.v @@ -208,6 +208,9 @@ Definition log_n : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom log_n_in_globals : + IsInGlobals globals "log_n" (make_function log_n). + Definition log0 : Value.t := M.run ltac:(M.monadic ( M.call (| M.get_name (| globals, locals_stack, "partial" |), diff --git a/CoqOfPython/ethereum/arrow_glacier/vm/instructions/memory.v b/CoqOfPython/ethereum/arrow_glacier/vm/instructions/memory.v index 2b19411..87af592 100644 --- a/CoqOfPython/ethereum/arrow_glacier/vm/instructions/memory.v +++ b/CoqOfPython/ethereum/arrow_glacier/vm/instructions/memory.v @@ -145,6 +145,9 @@ Definition mstore : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom mstore_in_globals : + IsInGlobals globals "mstore" (make_function mstore). + Definition mstore8 : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -249,6 +252,9 @@ Definition mstore8 : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom mstore8_in_globals : + IsInGlobals globals "mstore8" (make_function mstore8). + Definition mload : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -349,6 +355,9 @@ Definition mload : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom mload_in_globals : + IsInGlobals globals "mload" (make_function mload). + Definition msize : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -397,3 +406,6 @@ Definition msize : Value.t -> Value.t -> M := Constant.int 1 |) in M.pure Constant.None_)). + +Axiom msize_in_globals : + IsInGlobals globals "msize" (make_function msize). diff --git a/CoqOfPython/ethereum/arrow_glacier/vm/instructions/stack.v b/CoqOfPython/ethereum/arrow_glacier/vm/instructions/stack.v index 6b754e3..223f03b 100644 --- a/CoqOfPython/ethereum/arrow_glacier/vm/instructions/stack.v +++ b/CoqOfPython/ethereum/arrow_glacier/vm/instructions/stack.v @@ -82,6 +82,9 @@ Definition pop : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom pop_in_globals : + IsInGlobals globals "pop" (make_function pop). + Definition push_n : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm"; "num_bytes" ] in @@ -159,6 +162,9 @@ Definition push_n : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom push_n_in_globals : + IsInGlobals globals "push_n" (make_function push_n). + Definition dup_n : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm"; "item_number" ] in @@ -236,6 +242,9 @@ Definition dup_n : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom dup_n_in_globals : + IsInGlobals globals "dup_n" (make_function dup_n). + Definition swap_n : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm"; "item_number" ] in @@ -312,6 +321,9 @@ Definition swap_n : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom swap_n_in_globals : + IsInGlobals globals "swap_n" (make_function swap_n). + Definition push1 : Value.t := M.run ltac:(M.monadic ( M.call (| M.get_name (| globals, locals_stack, "partial" |), diff --git a/CoqOfPython/ethereum/arrow_glacier/vm/instructions/storage.v b/CoqOfPython/ethereum/arrow_glacier/vm/instructions/storage.v index 04a8c7a..e78757d 100644 --- a/CoqOfPython/ethereum/arrow_glacier/vm/instructions/storage.v +++ b/CoqOfPython/ethereum/arrow_glacier/vm/instructions/storage.v @@ -152,6 +152,9 @@ Definition sload : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom sload_in_globals : + IsInGlobals globals "sload" (make_function sload). + Definition sstore : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -493,3 +496,6 @@ Definition sstore : Value.t -> Value.t -> M := Constant.int 1 |) in M.pure Constant.None_)). + +Axiom sstore_in_globals : + IsInGlobals globals "sstore" (make_function sstore). diff --git a/CoqOfPython/ethereum/arrow_glacier/vm/instructions/system.v b/CoqOfPython/ethereum/arrow_glacier/vm/instructions/system.v index 642da72..9e682ef 100644 --- a/CoqOfPython/ethereum/arrow_glacier/vm/instructions/system.v +++ b/CoqOfPython/ethereum/arrow_glacier/vm/instructions/system.v @@ -383,6 +383,9 @@ Definition generic_create : Value.t -> Value.t -> M := )) |) in M.pure Constant.None_)). +Axiom generic_create_in_globals : + IsInGlobals globals "generic_create" (make_function generic_create). + Definition create : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -493,6 +496,9 @@ Definition create : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom create_in_globals : + IsInGlobals globals "create" (make_function create). + Definition create2 : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -647,6 +653,9 @@ Definition create2 : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom create2_in_globals : + IsInGlobals globals "create2" (make_function create2). + Definition return_ : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -730,6 +739,9 @@ Definition return_ : Value.t -> Value.t -> M := let _ := M.pass (| |) in M.pure Constant.None_)). +Axiom return__in_globals : + IsInGlobals globals "return_" (make_function return_). + Definition generic_call : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm"; "gas"; "value"; "caller"; "to"; "code_address"; "should_transfer_value"; "is_staticcall"; "memory_input_start_position"; "memory_input_size"; "memory_output_start_position"; "memory_output_size" ] in @@ -925,6 +937,9 @@ Definition generic_call : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom generic_call_in_globals : + IsInGlobals globals "generic_call" (make_function generic_call). + Definition call : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -1258,6 +1273,9 @@ M.get_name (| globals, locals_stack, "GAS_CALL_VALUE" |) |) in M.pure Constant.None_)). +Axiom call_in_globals : + IsInGlobals globals "call" (make_function call). + Definition callcode : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -1536,6 +1554,9 @@ M.get_name (| globals, locals_stack, "GAS_CALL_VALUE" |) |) in M.pure Constant.None_)). +Axiom callcode_in_globals : + IsInGlobals globals "callcode" (make_function callcode). + Definition selfdestruct : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -1740,6 +1761,9 @@ Definition selfdestruct : Value.t -> Value.t -> M := let _ := M.pass (| |) in M.pure Constant.None_)). +Axiom selfdestruct_in_globals : + IsInGlobals globals "selfdestruct" (make_function selfdestruct). + Definition delegatecall : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -1937,6 +1961,9 @@ Definition delegatecall : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom delegatecall_in_globals : + IsInGlobals globals "delegatecall" (make_function delegatecall). + Definition staticcall : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -2140,6 +2167,9 @@ Definition staticcall : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom staticcall_in_globals : + IsInGlobals globals "staticcall" (make_function staticcall). + Definition revert : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -2226,3 +2256,6 @@ Definition revert : Value.t -> Value.t -> M := let _ := M.raise (| Some (M.get_name (| globals, locals_stack, "Revert" |)) |) in let _ := M.pass (| |) in M.pure Constant.None_)). + +Axiom revert_in_globals : + IsInGlobals globals "revert" (make_function revert). diff --git a/CoqOfPython/ethereum/arrow_glacier/vm/interpreter.v b/CoqOfPython/ethereum/arrow_glacier/vm/interpreter.v index c82ea50..dfe783a 100644 --- a/CoqOfPython/ethereum/arrow_glacier/vm/interpreter.v +++ b/CoqOfPython/ethereum/arrow_glacier/vm/interpreter.v @@ -406,6 +406,9 @@ Definition process_message_call : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom process_message_call_in_globals : + IsInGlobals globals "process_message_call" (make_function process_message_call). + Definition process_create_message : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "message"; "env" ] in @@ -508,6 +511,9 @@ Definition process_create_message : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom process_create_message_in_globals : + IsInGlobals globals "process_create_message" (make_function process_create_message). + Definition process_message : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "message"; "env" ] in @@ -633,6 +639,9 @@ Definition process_message : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom process_message_in_globals : + IsInGlobals globals "process_message" (make_function process_message). + Definition execute_code : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "message"; "env" ] in @@ -679,3 +688,6 @@ Definition execute_code : Value.t -> Value.t -> M := M.get_name (| globals, locals_stack, "evm" |) |) in M.pure Constant.None_)). + +Axiom execute_code_in_globals : + IsInGlobals globals "execute_code" (make_function execute_code). diff --git a/CoqOfPython/ethereum/arrow_glacier/vm/memory.v b/CoqOfPython/ethereum/arrow_glacier/vm/memory.v index 4e18aa3..925891d 100644 --- a/CoqOfPython/ethereum/arrow_glacier/vm/memory.v +++ b/CoqOfPython/ethereum/arrow_glacier/vm/memory.v @@ -71,6 +71,9 @@ Definition memory_write : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom memory_write_in_globals : + IsInGlobals globals "memory_write" (make_function memory_write). + Definition memory_read_bytes : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "memory"; "start_position"; "size" ] in @@ -117,6 +120,9 @@ Definition memory_read_bytes : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom memory_read_bytes_in_globals : + IsInGlobals globals "memory_read_bytes" (make_function memory_read_bytes). + Definition buffer_read : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "buffer"; "start_position"; "size" ] in @@ -169,3 +175,6 @@ Definition buffer_read : Value.t -> Value.t -> M := |) |) in M.pure Constant.None_)). + +Axiom buffer_read_in_globals : + IsInGlobals globals "buffer_read" (make_function buffer_read). diff --git a/CoqOfPython/ethereum/arrow_glacier/vm/precompiled_contracts/alt_bn128.v b/CoqOfPython/ethereum/arrow_glacier/vm/precompiled_contracts/alt_bn128.v index 401bbbb..4433032 100644 --- a/CoqOfPython/ethereum/arrow_glacier/vm/precompiled_contracts/alt_bn128.v +++ b/CoqOfPython/ethereum/arrow_glacier/vm/precompiled_contracts/alt_bn128.v @@ -273,6 +273,9 @@ Definition alt_bn128_add : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom alt_bn128_add_in_globals : + IsInGlobals globals "alt_bn128_add" (make_function alt_bn128_add). + Definition alt_bn128_mul : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -455,6 +458,9 @@ Definition alt_bn128_mul : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom alt_bn128_mul_in_globals : + IsInGlobals globals "alt_bn128_mul" (make_function alt_bn128_mul). + Definition alt_bn128_pairing_check : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -781,3 +787,6 @@ Definition alt_bn128_pairing_check : Value.t -> Value.t -> M := M.pure Constant.None_ )) |) in M.pure Constant.None_)). + +Axiom alt_bn128_pairing_check_in_globals : + IsInGlobals globals "alt_bn128_pairing_check" (make_function alt_bn128_pairing_check). diff --git a/CoqOfPython/ethereum/arrow_glacier/vm/precompiled_contracts/blake2f.v b/CoqOfPython/ethereum/arrow_glacier/vm/precompiled_contracts/blake2f.v index 1c0b95b..a87737e 100644 --- a/CoqOfPython/ethereum/arrow_glacier/vm/precompiled_contracts/blake2f.v +++ b/CoqOfPython/ethereum/arrow_glacier/vm/precompiled_contracts/blake2f.v @@ -128,3 +128,6 @@ Definition blake2f : Value.t -> Value.t -> M := |) |) in M.pure Constant.None_)). + +Axiom blake2f_in_globals : + IsInGlobals globals "blake2f" (make_function blake2f). diff --git a/CoqOfPython/ethereum/arrow_glacier/vm/precompiled_contracts/ecrecover.v b/CoqOfPython/ethereum/arrow_glacier/vm/precompiled_contracts/ecrecover.v index 287fab3..50d828e 100644 --- a/CoqOfPython/ethereum/arrow_glacier/vm/precompiled_contracts/ecrecover.v +++ b/CoqOfPython/ethereum/arrow_glacier/vm/precompiled_contracts/ecrecover.v @@ -302,3 +302,6 @@ Definition ecrecover : Value.t -> Value.t -> M := M.get_name (| globals, locals_stack, "padded_address" |) |) in M.pure Constant.None_)). + +Axiom ecrecover_in_globals : + IsInGlobals globals "ecrecover" (make_function ecrecover). diff --git a/CoqOfPython/ethereum/arrow_glacier/vm/precompiled_contracts/identity.v b/CoqOfPython/ethereum/arrow_glacier/vm/precompiled_contracts/identity.v index 5934829..1bd07fa 100644 --- a/CoqOfPython/ethereum/arrow_glacier/vm/precompiled_contracts/identity.v +++ b/CoqOfPython/ethereum/arrow_glacier/vm/precompiled_contracts/identity.v @@ -95,3 +95,6 @@ Definition identity : Value.t -> Value.t -> M := M.get_name (| globals, locals_stack, "data" |) |) in M.pure Constant.None_)). + +Axiom identity_in_globals : + IsInGlobals globals "identity" (make_function identity). diff --git a/CoqOfPython/ethereum/arrow_glacier/vm/precompiled_contracts/modexp.v b/CoqOfPython/ethereum/arrow_glacier/vm/precompiled_contracts/modexp.v index 9fae72b..96073ce 100644 --- a/CoqOfPython/ethereum/arrow_glacier/vm/precompiled_contracts/modexp.v +++ b/CoqOfPython/ethereum/arrow_glacier/vm/precompiled_contracts/modexp.v @@ -356,6 +356,9 @@ Definition modexp : Value.t -> Value.t -> M := )) |) in M.pure Constant.None_)). +Axiom modexp_in_globals : + IsInGlobals globals "modexp" (make_function modexp). + Definition complexity : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "base_length"; "modulus_length" ] in @@ -419,6 +422,9 @@ Definition complexity : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom complexity_in_globals : + IsInGlobals globals "complexity" (make_function complexity). + Definition iterations : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "exponent_length"; "exponent_head" ] in @@ -600,6 +606,9 @@ Definition iterations : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom iterations_in_globals : + IsInGlobals globals "iterations" (make_function iterations). + Definition gas_cost : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "base_length"; "modulus_length"; "exponent_length"; "exponent_head" ] in @@ -680,3 +689,6 @@ Definition gas_cost : Value.t -> Value.t -> M := |) |) in M.pure Constant.None_)). + +Axiom gas_cost_in_globals : + IsInGlobals globals "gas_cost" (make_function gas_cost). diff --git a/CoqOfPython/ethereum/arrow_glacier/vm/precompiled_contracts/ripemd160.v b/CoqOfPython/ethereum/arrow_glacier/vm/precompiled_contracts/ripemd160.v index bdaeafd..1e23a30 100644 --- a/CoqOfPython/ethereum/arrow_glacier/vm/precompiled_contracts/ripemd160.v +++ b/CoqOfPython/ethereum/arrow_glacier/vm/precompiled_contracts/ripemd160.v @@ -126,3 +126,6 @@ Definition ripemd160 : Value.t -> Value.t -> M := M.get_name (| globals, locals_stack, "padded_hash" |) |) in M.pure Constant.None_)). + +Axiom ripemd160_in_globals : + IsInGlobals globals "ripemd160" (make_function ripemd160). diff --git a/CoqOfPython/ethereum/arrow_glacier/vm/precompiled_contracts/sha256.v b/CoqOfPython/ethereum/arrow_glacier/vm/precompiled_contracts/sha256.v index d0c1ce0..357e926 100644 --- a/CoqOfPython/ethereum/arrow_glacier/vm/precompiled_contracts/sha256.v +++ b/CoqOfPython/ethereum/arrow_glacier/vm/precompiled_contracts/sha256.v @@ -107,3 +107,6 @@ Definition sha256 : Value.t -> Value.t -> M := |) |) in M.pure Constant.None_)). + +Axiom sha256_in_globals : + IsInGlobals globals "sha256" (make_function sha256). diff --git a/CoqOfPython/ethereum/arrow_glacier/vm/runtime.v b/CoqOfPython/ethereum/arrow_glacier/vm/runtime.v index b2c3715..3680da9 100644 --- a/CoqOfPython/ethereum/arrow_glacier/vm/runtime.v +++ b/CoqOfPython/ethereum/arrow_glacier/vm/runtime.v @@ -158,3 +158,6 @@ Definition get_valid_jump_destinations : Value.t -> Value.t -> M := M.get_name (| globals, locals_stack, "valid_jump_destinations" |) |) in M.pure Constant.None_)). + +Axiom get_valid_jump_destinations_in_globals : + IsInGlobals globals "get_valid_jump_destinations" (make_function get_valid_jump_destinations). diff --git a/CoqOfPython/ethereum/arrow_glacier/vm/stack.v b/CoqOfPython/ethereum/arrow_glacier/vm/stack.v index 815fc8e..685abba 100644 --- a/CoqOfPython/ethereum/arrow_glacier/vm/stack.v +++ b/CoqOfPython/ethereum/arrow_glacier/vm/stack.v @@ -78,6 +78,9 @@ Definition pop : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom pop_in_globals : + IsInGlobals globals "pop" (make_function pop). + Definition push : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "stack"; "value" ] in @@ -125,3 +128,6 @@ Definition push : Value.t -> Value.t -> M := |) |) in M.pure Constant.None_)). + +Axiom push_in_globals : + IsInGlobals globals "push" (make_function push). diff --git a/CoqOfPython/ethereum/base_types.v b/CoqOfPython/ethereum/base_types.v index bf2b870..c19cb89 100644 --- a/CoqOfPython/ethereum/base_types.v +++ b/CoqOfPython/ethereum/base_types.v @@ -4315,6 +4315,9 @@ Definition _setattr_function : Value.t -> Value.t -> M := )) |) in M.pure Constant.None_)). +Axiom _setattr_function_in_globals : + IsInGlobals globals "_setattr_function" (make_function _setattr_function). + Definition _delattr_function : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "self"; "attr" ] in @@ -4347,6 +4350,9 @@ Definition _delattr_function : Value.t -> Value.t -> M := )) |) in M.pure Constant.None_)). +Axiom _delattr_function_in_globals : + IsInGlobals globals "_delattr_function" (make_function _delattr_function). + Definition _make_init_function : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "f" ] in @@ -4357,6 +4363,9 @@ Definition _make_init_function : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom _make_init_function_in_globals : + IsInGlobals globals "_make_init_function" (make_function _make_init_function). + Definition slotted_freezable : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "cls" ] in @@ -4424,6 +4433,9 @@ Definition slotted_freezable : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom slotted_freezable_in_globals : + IsInGlobals globals "slotted_freezable" (make_function slotted_freezable). + Definition S : Value.t := M.run ltac:(M.monadic ( M.call (| M.get_name (| globals, locals_stack, "TypeVar" |), @@ -4484,3 +4496,6 @@ Definition modify : Value.t -> Value.t -> M := M.get_name (| globals, locals_stack, "new_obj" |) |) in M.pure Constant.None_)). + +Axiom modify_in_globals : + IsInGlobals globals "modify" (make_function modify). diff --git a/CoqOfPython/ethereum/berlin/bloom.v b/CoqOfPython/ethereum/berlin/bloom.v index b2b59a3..c13bfa1 100644 --- a/CoqOfPython/ethereum/berlin/bloom.v +++ b/CoqOfPython/ethereum/berlin/bloom.v @@ -140,6 +140,9 @@ Definition add_to_bloom : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom add_to_bloom_in_globals : + IsInGlobals globals "add_to_bloom" (make_function add_to_bloom). + Definition logs_bloom : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "logs" ] in @@ -209,3 +212,6 @@ Definition logs_bloom : Value.t -> Value.t -> M := |) |) in M.pure Constant.None_)). + +Axiom logs_bloom_in_globals : + IsInGlobals globals "logs_bloom" (make_function logs_bloom). diff --git a/CoqOfPython/ethereum/berlin/fork.v b/CoqOfPython/ethereum/berlin/fork.v index fc29b97..ea566d1 100644 --- a/CoqOfPython/ethereum/berlin/fork.v +++ b/CoqOfPython/ethereum/berlin/fork.v @@ -243,6 +243,9 @@ Definition apply_fork : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom apply_fork_in_globals : + IsInGlobals globals "apply_fork" (make_function apply_fork). + Definition get_last_256_block_hashes : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "chain" ] in @@ -355,6 +358,9 @@ Definition get_last_256_block_hashes : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom get_last_256_block_hashes_in_globals : + IsInGlobals globals "get_last_256_block_hashes" (make_function get_last_256_block_hashes). + Definition state_transition : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "chain"; "block" ] in @@ -522,6 +528,9 @@ Definition state_transition : Value.t -> Value.t -> M := )) |) in M.pure Constant.None_)). +Axiom state_transition_in_globals : + IsInGlobals globals "state_transition" (make_function state_transition). + Definition validate_header : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "header"; "parent_header" ] in @@ -668,6 +677,9 @@ Definition validate_header : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom validate_header_in_globals : + IsInGlobals globals "validate_header" (make_function validate_header). + Definition generate_header_hash_for_pow : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "header" ] in @@ -723,6 +735,9 @@ Definition generate_header_hash_for_pow : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom generate_header_hash_for_pow_in_globals : + IsInGlobals globals "generate_header_hash_for_pow" (make_function generate_header_hash_for_pow). + Definition validate_proof_of_work : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "header" ] in @@ -813,6 +828,9 @@ Definition validate_proof_of_work : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom validate_proof_of_work_in_globals : + IsInGlobals globals "validate_proof_of_work" (make_function validate_proof_of_work). + Definition check_transaction : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "tx"; "gas_available"; "chain_id" ] in @@ -866,6 +884,9 @@ Definition check_transaction : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom check_transaction_in_globals : + IsInGlobals globals "check_transaction" (make_function check_transaction). + Definition make_receipt : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "tx"; "error"; "cumulative_gas_used"; "logs" ] in @@ -933,6 +954,9 @@ Definition make_receipt : Value.t -> Value.t -> M := )) |) in M.pure Constant.None_)). +Axiom make_receipt_in_globals : + IsInGlobals globals "make_receipt" (make_function make_receipt). + Definition ApplyBodyOutput : Value.t := builtins.make_klass [] @@ -1183,6 +1207,9 @@ Definition apply_body : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom apply_body_in_globals : + IsInGlobals globals "apply_body" (make_function apply_body). + Definition validate_ommers : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "ommers"; "block_header"; "chain" ] in @@ -1504,6 +1531,9 @@ Definition validate_ommers : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom validate_ommers_in_globals : + IsInGlobals globals "validate_ommers" (make_function validate_ommers). + Definition pay_rewards : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "state"; "block_number"; "coinbase"; "ommers" ] in @@ -1609,6 +1639,9 @@ Definition pay_rewards : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom pay_rewards_in_globals : + IsInGlobals globals "pay_rewards" (make_function pay_rewards). + Definition process_transaction : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "env"; "tx" ] in @@ -2046,6 +2079,9 @@ Definition process_transaction : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom process_transaction_in_globals : + IsInGlobals globals "process_transaction" (make_function process_transaction). + Definition validate_transaction : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "tx" ] in @@ -2102,6 +2138,9 @@ Definition validate_transaction : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom validate_transaction_in_globals : + IsInGlobals globals "validate_transaction" (make_function validate_transaction). + Definition calculate_intrinsic_cost : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "tx" ] in @@ -2267,6 +2306,9 @@ Definition calculate_intrinsic_cost : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom calculate_intrinsic_cost_in_globals : + IsInGlobals globals "calculate_intrinsic_cost" (make_function calculate_intrinsic_cost). + Definition recover_sender : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "chain_id"; "tx" ] in @@ -2522,6 +2564,9 @@ Definition recover_sender : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom recover_sender_in_globals : + IsInGlobals globals "recover_sender" (make_function recover_sender). + Definition signing_hash_pre155 : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "tx" ] in @@ -2556,6 +2601,9 @@ Definition signing_hash_pre155 : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom signing_hash_pre155_in_globals : + IsInGlobals globals "signing_hash_pre155" (make_function signing_hash_pre155). + Definition signing_hash_155 : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "tx"; "chain_id" ] in @@ -2604,6 +2652,9 @@ Definition signing_hash_155 : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom signing_hash_155_in_globals : + IsInGlobals globals "signing_hash_155" (make_function signing_hash_155). + Definition signing_hash_2930 : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "tx" ] in @@ -2641,6 +2692,9 @@ Definition signing_hash_2930 : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom signing_hash_2930_in_globals : + IsInGlobals globals "signing_hash_2930" (make_function signing_hash_2930). + Definition compute_header_hash : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "header" ] in @@ -2693,6 +2747,9 @@ Definition compute_header_hash : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom compute_header_hash_in_globals : + IsInGlobals globals "compute_header_hash" (make_function compute_header_hash). + Definition check_gas_limit : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "gas_limit"; "parent_gas_limit" ] in @@ -2793,6 +2850,9 @@ Definition check_gas_limit : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom check_gas_limit_in_globals : + IsInGlobals globals "check_gas_limit" (make_function check_gas_limit). + Definition calculate_block_difficulty : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "block_number"; "block_timestamp"; "parent_timestamp"; "parent_difficulty"; "parent_has_ommers" ] in @@ -2953,3 +3013,6 @@ Constant.int 1 |) |) in M.pure Constant.None_)). + +Axiom calculate_block_difficulty_in_globals : + IsInGlobals globals "calculate_block_difficulty" (make_function calculate_block_difficulty). diff --git a/CoqOfPython/ethereum/berlin/fork_types.v b/CoqOfPython/ethereum/berlin/fork_types.v index d33ec17..3275327 100644 --- a/CoqOfPython/ethereum/berlin/fork_types.v +++ b/CoqOfPython/ethereum/berlin/fork_types.v @@ -99,3 +99,6 @@ Definition encode_account : Value.t -> Value.t -> M := |) |) in M.pure Constant.None_)). + +Axiom encode_account_in_globals : + IsInGlobals globals "encode_account" (make_function encode_account). diff --git a/CoqOfPython/ethereum/berlin/state.v b/CoqOfPython/ethereum/berlin/state.v index f9ee9d5..9b7c736 100644 --- a/CoqOfPython/ethereum/berlin/state.v +++ b/CoqOfPython/ethereum/berlin/state.v @@ -100,6 +100,9 @@ Definition close_state : Value.t -> Value.t -> M := let _ := M.delete (| M.get_field (| M.get_name (| globals, locals_stack, "state" |), "_created_accounts" |) |) in M.pure Constant.None_)). +Axiom close_state_in_globals : + IsInGlobals globals "close_state" (make_function close_state). + Definition begin_transaction : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "state" ] in @@ -130,6 +133,9 @@ Definition begin_transaction : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom begin_transaction_in_globals : + IsInGlobals globals "begin_transaction" (make_function begin_transaction). + Definition commit_transaction : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "state" ] in @@ -165,6 +171,9 @@ Definition commit_transaction : Value.t -> Value.t -> M := )) |) in M.pure Constant.None_)). +Axiom commit_transaction_in_globals : + IsInGlobals globals "commit_transaction" (make_function commit_transaction). + Definition rollback_transaction : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "state" ] in @@ -204,6 +213,9 @@ Definition rollback_transaction : Value.t -> Value.t -> M := )) |) in M.pure Constant.None_)). +Axiom rollback_transaction_in_globals : + IsInGlobals globals "rollback_transaction" (make_function rollback_transaction). + Definition get_account : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "state"; "address" ] in @@ -264,6 +276,9 @@ Definition get_account : Value.t -> Value.t -> M := )) |) in M.pure Constant.None_)). +Axiom get_account_in_globals : + IsInGlobals globals "get_account" (make_function get_account). + Definition get_account_optional : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "state"; "address" ] in @@ -300,6 +315,9 @@ Definition get_account_optional : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom get_account_optional_in_globals : + IsInGlobals globals "get_account_optional" (make_function get_account_optional). + Definition set_account : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "state"; "address"; "account" ] in @@ -328,6 +346,9 @@ Definition set_account : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom set_account_in_globals : + IsInGlobals globals "set_account" (make_function set_account). + Definition destroy_account : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "state"; "address" ] in @@ -365,6 +386,9 @@ Definition destroy_account : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom destroy_account_in_globals : + IsInGlobals globals "destroy_account" (make_function destroy_account). + Definition destroy_storage : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "state"; "address" ] in @@ -399,6 +423,9 @@ Definition destroy_storage : Value.t -> Value.t -> M := )) |) in M.pure Constant.None_)). +Axiom destroy_storage_in_globals : + IsInGlobals globals "destroy_storage" (make_function destroy_storage). + Definition mark_account_created : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "state"; "address" ] in @@ -428,6 +455,9 @@ Definition mark_account_created : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom mark_account_created_in_globals : + IsInGlobals globals "mark_account_created" (make_function mark_account_created). + Definition get_storage : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "state"; "address"; "key" ] in @@ -507,6 +537,9 @@ Definition get_storage : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom get_storage_in_globals : + IsInGlobals globals "get_storage" (make_function get_storage). + Definition set_storage : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "state"; "address"; "key"; "value" ] in @@ -605,6 +638,9 @@ Definition set_storage : Value.t -> Value.t -> M := )) |) in M.pure Constant.None_)). +Axiom set_storage_in_globals : + IsInGlobals globals "set_storage" (make_function set_storage). + Definition storage_root : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "state"; "address" ] in @@ -656,6 +692,9 @@ Definition storage_root : Value.t -> Value.t -> M := )) |) in M.pure Constant.None_)). +Axiom storage_root_in_globals : + IsInGlobals globals "storage_root" (make_function storage_root). + Definition state_root : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "state" ] in @@ -686,6 +725,9 @@ Definition state_root : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom state_root_in_globals : + IsInGlobals globals "state_root" (make_function state_root). + Definition account_exists : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "state"; "address" ] in @@ -720,6 +762,9 @@ Definition account_exists : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom account_exists_in_globals : + IsInGlobals globals "account_exists" (make_function account_exists). + Definition account_has_code_or_nonce : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "state"; "address" ] in @@ -773,6 +818,9 @@ Definition account_has_code_or_nonce : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom account_has_code_or_nonce_in_globals : + IsInGlobals globals "account_has_code_or_nonce" (make_function account_has_code_or_nonce). + Definition is_account_empty : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "state"; "address" ] in @@ -834,6 +882,9 @@ Definition is_account_empty : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom is_account_empty_in_globals : + IsInGlobals globals "is_account_empty" (make_function is_account_empty). + Definition account_exists_and_is_empty : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "state"; "address" ] in @@ -904,6 +955,9 @@ Definition account_exists_and_is_empty : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom account_exists_and_is_empty_in_globals : + IsInGlobals globals "account_exists_and_is_empty" (make_function account_exists_and_is_empty). + Definition is_account_alive : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "state"; "address" ] in @@ -981,6 +1035,9 @@ Definition is_account_alive : Value.t -> Value.t -> M := )) |) in M.pure Constant.None_)). +Axiom is_account_alive_in_globals : + IsInGlobals globals "is_account_alive" (make_function is_account_alive). + Definition modify_state : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "state"; "address"; "f" ] in @@ -1013,6 +1070,9 @@ Definition modify_state : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom modify_state_in_globals : + IsInGlobals globals "modify_state" (make_function modify_state). + Definition move_ether : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "state"; "sender_address"; "recipient_address"; "amount" ] in @@ -1042,6 +1102,9 @@ Definition move_ether : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom move_ether_in_globals : + IsInGlobals globals "move_ether" (make_function move_ether). + Definition set_account_balance : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "state"; "address"; "amount" ] in @@ -1072,6 +1135,9 @@ Definition set_account_balance : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom set_account_balance_in_globals : + IsInGlobals globals "set_account_balance" (make_function set_account_balance). + Definition touch_account : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "state"; "address" ] in @@ -1116,6 +1182,9 @@ Definition touch_account : Value.t -> Value.t -> M := )) |) in M.pure Constant.None_)). +Axiom touch_account_in_globals : + IsInGlobals globals "touch_account" (make_function touch_account). + Definition increment_nonce : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "state"; "address" ] in @@ -1143,6 +1212,9 @@ Definition increment_nonce : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom increment_nonce_in_globals : + IsInGlobals globals "increment_nonce" (make_function increment_nonce). + Definition set_code : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "state"; "address"; "code" ] in @@ -1173,6 +1245,9 @@ Definition set_code : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom set_code_in_globals : + IsInGlobals globals "set_code" (make_function set_code). + Definition create_ether : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "state"; "address"; "amount" ] in @@ -1201,6 +1276,9 @@ Definition create_ether : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom create_ether_in_globals : + IsInGlobals globals "create_ether" (make_function create_ether). + Definition get_storage_original : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "state"; "address"; "key" ] in @@ -1306,3 +1384,6 @@ Definition get_storage_original : Value.t -> Value.t -> M := M.get_name (| globals, locals_stack, "original_value" |) |) in M.pure Constant.None_)). + +Axiom get_storage_original_in_globals : + IsInGlobals globals "get_storage_original" (make_function get_storage_original). diff --git a/CoqOfPython/ethereum/berlin/transactions.v b/CoqOfPython/ethereum/berlin/transactions.v index 8651cfc..7d191a8 100644 --- a/CoqOfPython/ethereum/berlin/transactions.v +++ b/CoqOfPython/ethereum/berlin/transactions.v @@ -164,6 +164,9 @@ Definition encode_transaction : Value.t -> Value.t -> M := )) |) in M.pure Constant.None_)). +Axiom encode_transaction_in_globals : + IsInGlobals globals "encode_transaction" (make_function encode_transaction). + Definition decode_transaction : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "tx" ] in @@ -222,3 +225,6 @@ Definition decode_transaction : Value.t -> Value.t -> M := M.pure Constant.None_ )) |) in M.pure Constant.None_)). + +Axiom decode_transaction_in_globals : + IsInGlobals globals "decode_transaction" (make_function decode_transaction). diff --git a/CoqOfPython/ethereum/berlin/trie.v b/CoqOfPython/ethereum/berlin/trie.v index 3390556..f5cdf46 100644 --- a/CoqOfPython/ethereum/berlin/trie.v +++ b/CoqOfPython/ethereum/berlin/trie.v @@ -371,6 +371,9 @@ Definition encode_internal_node : Value.t -> Value.t -> M := )) |) in M.pure Constant.None_)). +Axiom encode_internal_node_in_globals : + IsInGlobals globals "encode_internal_node" (make_function encode_internal_node). + Definition encode_node : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "node"; "storage_root" ] in @@ -479,6 +482,9 @@ Definition encode_node : Value.t -> Value.t -> M := )) |) in M.pure Constant.None_)). +Axiom encode_node_in_globals : + IsInGlobals globals "encode_node" (make_function encode_node). + Definition Trie : Value.t := builtins.make_klass [(* At base: unsupported node type: Subscript *)] @@ -526,6 +532,9 @@ Definition copy_trie : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom copy_trie_in_globals : + IsInGlobals globals "copy_trie" (make_function copy_trie). + Definition trie_set : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "trie"; "key"; "value" ] in @@ -586,6 +595,9 @@ Definition trie_set : Value.t -> Value.t -> M := )) |) in M.pure Constant.None_)). +Axiom trie_set_in_globals : + IsInGlobals globals "trie_set" (make_function trie_set). + Definition trie_get : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "trie"; "key" ] in @@ -619,6 +631,9 @@ Definition trie_get : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom trie_get_in_globals : + IsInGlobals globals "trie_get" (make_function trie_get). + Definition common_prefix_length : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "a"; "b" ] in @@ -697,6 +712,9 @@ Definition common_prefix_length : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom common_prefix_length_in_globals : + IsInGlobals globals "common_prefix_length" (make_function common_prefix_length). + Definition nibble_list_to_compact : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "x"; "is_leaf" ] in @@ -905,6 +923,9 @@ Definition nibble_list_to_compact : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom nibble_list_to_compact_in_globals : + IsInGlobals globals "nibble_list_to_compact" (make_function nibble_list_to_compact). + Definition bytes_to_nibble_list : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "bytes_" ] in @@ -1001,6 +1022,9 @@ Definition bytes_to_nibble_list : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom bytes_to_nibble_list_in_globals : + IsInGlobals globals "bytes_to_nibble_list" (make_function bytes_to_nibble_list). + Definition _prepare_trie : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "trie"; "get_storage_root" ] in @@ -1152,6 +1176,9 @@ Definition _prepare_trie : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom _prepare_trie_in_globals : + IsInGlobals globals "_prepare_trie" (make_function _prepare_trie). + Definition root : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "trie"; "get_storage_root" ] in @@ -1267,6 +1294,9 @@ Definition root : Value.t -> Value.t -> M := )) |) in M.pure Constant.None_)). +Axiom root_in_globals : + IsInGlobals globals "root" (make_function root). + Definition patricialize : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "obj"; "level" ] in @@ -1606,3 +1636,6 @@ Definition patricialize : Value.t -> Value.t -> M := |) |) in M.pure Constant.None_)). + +Axiom patricialize_in_globals : + IsInGlobals globals "patricialize" (make_function patricialize). diff --git a/CoqOfPython/ethereum/berlin/utils/address.v b/CoqOfPython/ethereum/berlin/utils/address.v index be75ce6..a7c13ab 100644 --- a/CoqOfPython/ethereum/berlin/utils/address.v +++ b/CoqOfPython/ethereum/berlin/utils/address.v @@ -79,6 +79,9 @@ Definition to_address : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom to_address_in_globals : + IsInGlobals globals "to_address" (make_function to_address). + Definition compute_contract_address : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "address"; "nonce" ] in @@ -149,6 +152,9 @@ Definition compute_contract_address : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom compute_contract_address_in_globals : + IsInGlobals globals "compute_contract_address" (make_function compute_contract_address). + Definition compute_create2_contract_address : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "address"; "salt"; "call_data" ] in @@ -230,3 +236,6 @@ Definition compute_create2_contract_address : Value.t -> Value.t -> M := |) |) in M.pure Constant.None_)). + +Axiom compute_create2_contract_address_in_globals : + IsInGlobals globals "compute_create2_contract_address" (make_function compute_create2_contract_address). diff --git a/CoqOfPython/ethereum/berlin/utils/hexadecimal.v b/CoqOfPython/ethereum/berlin/utils/hexadecimal.v index 11e9b6e..976af54 100644 --- a/CoqOfPython/ethereum/berlin/utils/hexadecimal.v +++ b/CoqOfPython/ethereum/berlin/utils/hexadecimal.v @@ -70,6 +70,9 @@ Definition hex_to_root : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom hex_to_root_in_globals : + IsInGlobals globals "hex_to_root" (make_function hex_to_root). + Definition hex_to_bloom : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "hex_string" ] in @@ -110,6 +113,9 @@ Definition hex_to_bloom : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom hex_to_bloom_in_globals : + IsInGlobals globals "hex_to_bloom" (make_function hex_to_bloom). + Definition hex_to_address : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "hex_string" ] in @@ -156,3 +162,6 @@ Definition hex_to_address : Value.t -> Value.t -> M := |) |) in M.pure Constant.None_)). + +Axiom hex_to_address_in_globals : + IsInGlobals globals "hex_to_address" (make_function hex_to_address). diff --git a/CoqOfPython/ethereum/berlin/utils/message.v b/CoqOfPython/ethereum/berlin/utils/message.v index 1b6ccca..c20ec61 100644 --- a/CoqOfPython/ethereum/berlin/utils/message.v +++ b/CoqOfPython/ethereum/berlin/utils/message.v @@ -267,3 +267,6 @@ Definition prepare_message : Value.t -> Value.t -> M := |) |) in M.pure Constant.None_)). + +Axiom prepare_message_in_globals : + IsInGlobals globals "prepare_message" (make_function prepare_message). diff --git a/CoqOfPython/ethereum/berlin/vm/__init__.v b/CoqOfPython/ethereum/berlin/vm/__init__.v index eb756e2..8448361 100644 --- a/CoqOfPython/ethereum/berlin/vm/__init__.v +++ b/CoqOfPython/ethereum/berlin/vm/__init__.v @@ -182,6 +182,9 @@ Definition incorporate_child_on_success : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom incorporate_child_on_success_in_globals : + IsInGlobals globals "incorporate_child_on_success" (make_function incorporate_child_on_success). + Definition incorporate_child_on_error : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm"; "child_evm" ] in @@ -262,3 +265,6 @@ Definition incorporate_child_on_error : Value.t -> Value.t -> M := M.get_field (| M.get_name (| globals, locals_stack, "child_evm" |), "gas_left" |) |) in M.pure Constant.None_)). + +Axiom incorporate_child_on_error_in_globals : + IsInGlobals globals "incorporate_child_on_error" (make_function incorporate_child_on_error). diff --git a/CoqOfPython/ethereum/berlin/vm/gas.v b/CoqOfPython/ethereum/berlin/vm/gas.v index 9a59f10..b180144 100644 --- a/CoqOfPython/ethereum/berlin/vm/gas.v +++ b/CoqOfPython/ethereum/berlin/vm/gas.v @@ -533,6 +533,9 @@ Definition charge_gas : Value.t -> Value.t -> M := )) |) in M.pure Constant.None_)). +Axiom charge_gas_in_globals : + IsInGlobals globals "charge_gas" (make_function charge_gas). + Definition calculate_memory_gas_cost : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "size_in_bytes" ] in @@ -592,6 +595,9 @@ Definition calculate_memory_gas_cost : Value.t -> Value.t -> M := (* At stmt: unsupported node type: Try *) M.pure Constant.None_)). +Axiom calculate_memory_gas_cost_in_globals : + IsInGlobals globals "calculate_memory_gas_cost" (make_function calculate_memory_gas_cost). + Definition calculate_gas_extend_memory : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "memory"; "extensions" ] in @@ -775,6 +781,9 @@ Definition calculate_gas_extend_memory : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom calculate_gas_extend_memory_in_globals : + IsInGlobals globals "calculate_gas_extend_memory" (make_function calculate_gas_extend_memory). + Definition calculate_message_call_gas : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "value"; "gas"; "gas_left"; "memory_cost"; "extra_gas"; "call_stipend" ] in @@ -900,6 +909,9 @@ M.get_name (| globals, locals_stack, "call_stipend" |) |) in M.pure Constant.None_)). +Axiom calculate_message_call_gas_in_globals : + IsInGlobals globals "calculate_message_call_gas" (make_function calculate_message_call_gas). + Definition max_message_call_gas : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "gas" ] in @@ -927,3 +939,6 @@ Definition max_message_call_gas : Value.t -> Value.t -> M := |) |) in M.pure Constant.None_)). + +Axiom max_message_call_gas_in_globals : + IsInGlobals globals "max_message_call_gas" (make_function max_message_call_gas). diff --git a/CoqOfPython/ethereum/berlin/vm/instructions/arithmetic.v b/CoqOfPython/ethereum/berlin/vm/instructions/arithmetic.v index 44f4156..d98fd50 100644 --- a/CoqOfPython/ethereum/berlin/vm/instructions/arithmetic.v +++ b/CoqOfPython/ethereum/berlin/vm/instructions/arithmetic.v @@ -119,6 +119,9 @@ Definition add : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom add_in_globals : + IsInGlobals globals "add" (make_function add). + Definition sub : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -186,6 +189,9 @@ Definition sub : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom sub_in_globals : + IsInGlobals globals "sub" (make_function sub). + Definition mul : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -253,6 +259,9 @@ Definition mul : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom mul_in_globals : + IsInGlobals globals "mul" (make_function mul). + Definition div : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -341,6 +350,9 @@ Definition div : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom div_in_globals : + IsInGlobals globals "div" (make_function div). + Definition sdiv : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -491,6 +503,9 @@ Definition sdiv : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom sdiv_in_globals : + IsInGlobals globals "sdiv" (make_function sdiv). + Definition mod_ : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -579,6 +594,9 @@ Definition mod_ : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom mod__in_globals : + IsInGlobals globals "mod" (make_function mod_). + Definition smod : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -696,6 +714,9 @@ Definition smod : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom smod_in_globals : + IsInGlobals globals "smod" (make_function smod). + Definition addmod : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -821,6 +842,9 @@ Definition addmod : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom addmod_in_globals : + IsInGlobals globals "addmod" (make_function addmod). + Definition mulmod : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -946,6 +970,9 @@ Definition mulmod : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom mulmod_in_globals : + IsInGlobals globals "mulmod" (make_function mulmod). + Definition exp : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -1057,6 +1084,9 @@ Definition exp : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom exp_in_globals : + IsInGlobals globals "exp" (make_function exp). + Definition signextend : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -1231,3 +1261,6 @@ Definition signextend : Value.t -> Value.t -> M := Constant.int 1 |) in M.pure Constant.None_)). + +Axiom signextend_in_globals : + IsInGlobals globals "signextend" (make_function signextend). diff --git a/CoqOfPython/ethereum/berlin/vm/instructions/bitwise.v b/CoqOfPython/ethereum/berlin/vm/instructions/bitwise.v index 7ca6973..6ffa67c 100644 --- a/CoqOfPython/ethereum/berlin/vm/instructions/bitwise.v +++ b/CoqOfPython/ethereum/berlin/vm/instructions/bitwise.v @@ -97,6 +97,9 @@ Definition bitwise_and : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom bitwise_and_in_globals : + IsInGlobals globals "bitwise_and" (make_function bitwise_and). + Definition bitwise_or : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -157,6 +160,9 @@ Definition bitwise_or : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom bitwise_or_in_globals : + IsInGlobals globals "bitwise_or" (make_function bitwise_or). + Definition bitwise_xor : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -217,6 +223,9 @@ Definition bitwise_xor : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom bitwise_xor_in_globals : + IsInGlobals globals "bitwise_xor" (make_function bitwise_xor). + Definition bitwise_not : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -264,6 +273,9 @@ Definition bitwise_not : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom bitwise_not_in_globals : + IsInGlobals globals "bitwise_not" (make_function bitwise_not). + Definition get_byte : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -380,6 +392,9 @@ Definition get_byte : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom get_byte_in_globals : + IsInGlobals globals "get_byte" (make_function get_byte). + Definition bitwise_shl : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -475,6 +490,9 @@ Definition bitwise_shl : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom bitwise_shl_in_globals : + IsInGlobals globals "bitwise_shl" (make_function bitwise_shl). + Definition bitwise_shr : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -561,6 +579,9 @@ Definition bitwise_shr : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom bitwise_shr_in_globals : + IsInGlobals globals "bitwise_shr" (make_function bitwise_shr). + Definition bitwise_sar : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -674,3 +695,6 @@ Definition bitwise_sar : Value.t -> Value.t -> M := Constant.int 1 |) in M.pure Constant.None_)). + +Axiom bitwise_sar_in_globals : + IsInGlobals globals "bitwise_sar" (make_function bitwise_sar). diff --git a/CoqOfPython/ethereum/berlin/vm/instructions/block.v b/CoqOfPython/ethereum/berlin/vm/instructions/block.v index 52e5f80..0af0bfe 100644 --- a/CoqOfPython/ethereum/berlin/vm/instructions/block.v +++ b/CoqOfPython/ethereum/berlin/vm/instructions/block.v @@ -129,6 +129,9 @@ Definition block_hash : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom block_hash_in_globals : + IsInGlobals globals "block_hash" (make_function block_hash). + Definition coinbase : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -176,6 +179,9 @@ Definition coinbase : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom coinbase_in_globals : + IsInGlobals globals "coinbase" (make_function coinbase). + Definition timestamp : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -217,6 +223,9 @@ Definition timestamp : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom timestamp_in_globals : + IsInGlobals globals "timestamp" (make_function timestamp). + Definition number : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -263,6 +272,9 @@ Definition number : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom number_in_globals : + IsInGlobals globals "number" (make_function number). + Definition difficulty : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -309,6 +321,9 @@ Definition difficulty : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom difficulty_in_globals : + IsInGlobals globals "difficulty" (make_function difficulty). + Definition gas_limit : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -355,6 +370,9 @@ Definition gas_limit : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom gas_limit_in_globals : + IsInGlobals globals "gas_limit" (make_function gas_limit). + Definition chain_id : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -397,3 +415,6 @@ Definition chain_id : Value.t -> Value.t -> M := Constant.int 1 |) in M.pure Constant.None_)). + +Axiom chain_id_in_globals : + IsInGlobals globals "chain_id" (make_function chain_id). diff --git a/CoqOfPython/ethereum/berlin/vm/instructions/comparison.v b/CoqOfPython/ethereum/berlin/vm/instructions/comparison.v index 3d23118..e0d7b04 100644 --- a/CoqOfPython/ethereum/berlin/vm/instructions/comparison.v +++ b/CoqOfPython/ethereum/berlin/vm/instructions/comparison.v @@ -105,6 +105,9 @@ Definition less_than : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom less_than_in_globals : + IsInGlobals globals "less_than" (make_function less_than). + Definition signed_less_than : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -182,6 +185,9 @@ Definition signed_less_than : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom signed_less_than_in_globals : + IsInGlobals globals "signed_less_than" (make_function signed_less_than). + Definition greater_than : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -252,6 +258,9 @@ Definition greater_than : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom greater_than_in_globals : + IsInGlobals globals "greater_than" (make_function greater_than). + Definition signed_greater_than : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -329,6 +338,9 @@ Definition signed_greater_than : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom signed_greater_than_in_globals : + IsInGlobals globals "signed_greater_than" (make_function signed_greater_than). + Definition equal : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -399,6 +411,9 @@ Definition equal : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom equal_in_globals : + IsInGlobals globals "equal" (make_function equal). + Definition is_zero : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -458,3 +473,6 @@ Definition is_zero : Value.t -> Value.t -> M := Constant.int 1 |) in M.pure Constant.None_)). + +Axiom is_zero_in_globals : + IsInGlobals globals "is_zero" (make_function is_zero). diff --git a/CoqOfPython/ethereum/berlin/vm/instructions/control_flow.v b/CoqOfPython/ethereum/berlin/vm/instructions/control_flow.v index 2a53276..90e674f 100644 --- a/CoqOfPython/ethereum/berlin/vm/instructions/control_flow.v +++ b/CoqOfPython/ethereum/berlin/vm/instructions/control_flow.v @@ -71,6 +71,9 @@ Definition stop : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom stop_in_globals : + IsInGlobals globals "stop" (make_function stop). + Definition jump : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -136,6 +139,9 @@ Definition jump : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom jump_in_globals : + IsInGlobals globals "jump" (make_function jump). + Definition jumpi : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -237,6 +243,9 @@ Definition jumpi : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom jumpi_in_globals : + IsInGlobals globals "jumpi" (make_function jumpi). + Definition pc : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -281,6 +290,9 @@ Definition pc : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom pc_in_globals : + IsInGlobals globals "pc" (make_function pc). + Definition gas_left : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -325,6 +337,9 @@ Definition gas_left : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom gas_left_in_globals : + IsInGlobals globals "gas_left" (make_function gas_left). + Definition jumpdest : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -356,3 +371,6 @@ Definition jumpdest : Value.t -> Value.t -> M := Constant.int 1 |) in M.pure Constant.None_)). + +Axiom jumpdest_in_globals : + IsInGlobals globals "jumpdest" (make_function jumpdest). diff --git a/CoqOfPython/ethereum/berlin/vm/instructions/environment.v b/CoqOfPython/ethereum/berlin/vm/instructions/environment.v index 83b757d..32e395c 100644 --- a/CoqOfPython/ethereum/berlin/vm/instructions/environment.v +++ b/CoqOfPython/ethereum/berlin/vm/instructions/environment.v @@ -120,6 +120,9 @@ Definition address : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom address_in_globals : + IsInGlobals globals "address" (make_function address). + Definition balance : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -212,6 +215,9 @@ Definition balance : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom balance_in_globals : + IsInGlobals globals "balance" (make_function balance). + Definition origin : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -256,6 +262,9 @@ Definition origin : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom origin_in_globals : + IsInGlobals globals "origin" (make_function origin). + Definition caller : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -299,6 +308,9 @@ Definition caller : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom caller_in_globals : + IsInGlobals globals "caller" (make_function caller). + Definition callvalue : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -336,6 +348,9 @@ Definition callvalue : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom callvalue_in_globals : + IsInGlobals globals "callvalue" (make_function callvalue). + Definition calldataload : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -407,6 +422,9 @@ Definition calldataload : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom calldataload_in_globals : + IsInGlobals globals "calldataload" (make_function calldataload). + Definition calldatasize : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -456,6 +474,9 @@ Definition calldatasize : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom calldatasize_in_globals : + IsInGlobals globals "calldatasize" (make_function calldatasize). + Definition calldatacopy : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -591,6 +612,9 @@ Definition calldatacopy : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom calldatacopy_in_globals : + IsInGlobals globals "calldatacopy" (make_function calldatacopy). + Definition codesize : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -640,6 +664,9 @@ Definition codesize : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom codesize_in_globals : + IsInGlobals globals "codesize" (make_function codesize). + Definition codecopy : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -775,6 +802,9 @@ Definition codecopy : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom codecopy_in_globals : + IsInGlobals globals "codecopy" (make_function codecopy). + Definition gasprice : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -818,6 +848,9 @@ Definition gasprice : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom gasprice_in_globals : + IsInGlobals globals "gasprice" (make_function gasprice). + Definition extcodesize : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -922,6 +955,9 @@ Definition extcodesize : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom extcodesize_in_globals : + IsInGlobals globals "extcodesize" (make_function extcodesize). + Definition extcodecopy : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -1116,6 +1152,9 @@ Definition extcodecopy : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom extcodecopy_in_globals : + IsInGlobals globals "extcodecopy" (make_function extcodecopy). + Definition returndatasize : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -1164,6 +1203,9 @@ Definition returndatasize : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom returndatasize_in_globals : + IsInGlobals globals "returndatasize" (make_function returndatasize). + Definition returndatacopy : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -1327,6 +1369,9 @@ Definition returndatacopy : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom returndatacopy_in_globals : + IsInGlobals globals "returndatacopy" (make_function returndatacopy). + Definition extcodehash : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -1457,6 +1502,9 @@ Definition extcodehash : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom extcodehash_in_globals : + IsInGlobals globals "extcodehash" (make_function extcodehash). + Definition self_balance : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -1504,3 +1552,6 @@ Definition self_balance : Value.t -> Value.t -> M := Constant.int 1 |) in M.pure Constant.None_)). + +Axiom self_balance_in_globals : + IsInGlobals globals "self_balance" (make_function self_balance). diff --git a/CoqOfPython/ethereum/berlin/vm/instructions/keccak.v b/CoqOfPython/ethereum/berlin/vm/instructions/keccak.v index 8f94775..be4d2da 100644 --- a/CoqOfPython/ethereum/berlin/vm/instructions/keccak.v +++ b/CoqOfPython/ethereum/berlin/vm/instructions/keccak.v @@ -189,3 +189,6 @@ Definition keccak : Value.t -> Value.t -> M := Constant.int 1 |) in M.pure Constant.None_)). + +Axiom keccak_in_globals : + IsInGlobals globals "keccak" (make_function keccak). diff --git a/CoqOfPython/ethereum/berlin/vm/instructions/log.v b/CoqOfPython/ethereum/berlin/vm/instructions/log.v index 9b206aa..1337c84 100644 --- a/CoqOfPython/ethereum/berlin/vm/instructions/log.v +++ b/CoqOfPython/ethereum/berlin/vm/instructions/log.v @@ -208,6 +208,9 @@ Definition log_n : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom log_n_in_globals : + IsInGlobals globals "log_n" (make_function log_n). + Definition log0 : Value.t := M.run ltac:(M.monadic ( M.call (| M.get_name (| globals, locals_stack, "partial" |), diff --git a/CoqOfPython/ethereum/berlin/vm/instructions/memory.v b/CoqOfPython/ethereum/berlin/vm/instructions/memory.v index b0b7a2b..17bc505 100644 --- a/CoqOfPython/ethereum/berlin/vm/instructions/memory.v +++ b/CoqOfPython/ethereum/berlin/vm/instructions/memory.v @@ -145,6 +145,9 @@ Definition mstore : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom mstore_in_globals : + IsInGlobals globals "mstore" (make_function mstore). + Definition mstore8 : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -249,6 +252,9 @@ Definition mstore8 : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom mstore8_in_globals : + IsInGlobals globals "mstore8" (make_function mstore8). + Definition mload : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -349,6 +355,9 @@ Definition mload : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom mload_in_globals : + IsInGlobals globals "mload" (make_function mload). + Definition msize : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -397,3 +406,6 @@ Definition msize : Value.t -> Value.t -> M := Constant.int 1 |) in M.pure Constant.None_)). + +Axiom msize_in_globals : + IsInGlobals globals "msize" (make_function msize). diff --git a/CoqOfPython/ethereum/berlin/vm/instructions/stack.v b/CoqOfPython/ethereum/berlin/vm/instructions/stack.v index 5016b0e..278c237 100644 --- a/CoqOfPython/ethereum/berlin/vm/instructions/stack.v +++ b/CoqOfPython/ethereum/berlin/vm/instructions/stack.v @@ -82,6 +82,9 @@ Definition pop : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom pop_in_globals : + IsInGlobals globals "pop" (make_function pop). + Definition push_n : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm"; "num_bytes" ] in @@ -159,6 +162,9 @@ Definition push_n : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom push_n_in_globals : + IsInGlobals globals "push_n" (make_function push_n). + Definition dup_n : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm"; "item_number" ] in @@ -236,6 +242,9 @@ Definition dup_n : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom dup_n_in_globals : + IsInGlobals globals "dup_n" (make_function dup_n). + Definition swap_n : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm"; "item_number" ] in @@ -312,6 +321,9 @@ Definition swap_n : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom swap_n_in_globals : + IsInGlobals globals "swap_n" (make_function swap_n). + Definition push1 : Value.t := M.run ltac:(M.monadic ( M.call (| M.get_name (| globals, locals_stack, "partial" |), diff --git a/CoqOfPython/ethereum/berlin/vm/instructions/storage.v b/CoqOfPython/ethereum/berlin/vm/instructions/storage.v index 85002dc..52b350a 100644 --- a/CoqOfPython/ethereum/berlin/vm/instructions/storage.v +++ b/CoqOfPython/ethereum/berlin/vm/instructions/storage.v @@ -152,6 +152,9 @@ Definition sload : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom sload_in_globals : + IsInGlobals globals "sload" (make_function sload). + Definition sstore : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -493,3 +496,6 @@ Definition sstore : Value.t -> Value.t -> M := Constant.int 1 |) in M.pure Constant.None_)). + +Axiom sstore_in_globals : + IsInGlobals globals "sstore" (make_function sstore). diff --git a/CoqOfPython/ethereum/berlin/vm/instructions/system.v b/CoqOfPython/ethereum/berlin/vm/instructions/system.v index f1bc612..2ca2a94 100644 --- a/CoqOfPython/ethereum/berlin/vm/instructions/system.v +++ b/CoqOfPython/ethereum/berlin/vm/instructions/system.v @@ -385,6 +385,9 @@ Definition generic_create : Value.t -> Value.t -> M := )) |) in M.pure Constant.None_)). +Axiom generic_create_in_globals : + IsInGlobals globals "generic_create" (make_function generic_create). + Definition create : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -495,6 +498,9 @@ Definition create : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom create_in_globals : + IsInGlobals globals "create" (make_function create). + Definition create2 : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -649,6 +655,9 @@ Definition create2 : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom create2_in_globals : + IsInGlobals globals "create2" (make_function create2). + Definition return_ : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -732,6 +741,9 @@ Definition return_ : Value.t -> Value.t -> M := let _ := M.pass (| |) in M.pure Constant.None_)). +Axiom return__in_globals : + IsInGlobals globals "return_" (make_function return_). + Definition generic_call : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm"; "gas"; "value"; "caller"; "to"; "code_address"; "should_transfer_value"; "is_staticcall"; "memory_input_start_position"; "memory_input_size"; "memory_output_start_position"; "memory_output_size" ] in @@ -927,6 +939,9 @@ Definition generic_call : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom generic_call_in_globals : + IsInGlobals globals "generic_call" (make_function generic_call). + Definition call : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -1260,6 +1275,9 @@ M.get_name (| globals, locals_stack, "GAS_CALL_VALUE" |) |) in M.pure Constant.None_)). +Axiom call_in_globals : + IsInGlobals globals "call" (make_function call). + Definition callcode : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -1538,6 +1556,9 @@ M.get_name (| globals, locals_stack, "GAS_CALL_VALUE" |) |) in M.pure Constant.None_)). +Axiom callcode_in_globals : + IsInGlobals globals "callcode" (make_function callcode). + Definition selfdestruct : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -1793,6 +1814,9 @@ Definition selfdestruct : Value.t -> Value.t -> M := let _ := M.pass (| |) in M.pure Constant.None_)). +Axiom selfdestruct_in_globals : + IsInGlobals globals "selfdestruct" (make_function selfdestruct). + Definition delegatecall : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -1990,6 +2014,9 @@ Definition delegatecall : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom delegatecall_in_globals : + IsInGlobals globals "delegatecall" (make_function delegatecall). + Definition staticcall : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -2193,6 +2220,9 @@ Definition staticcall : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom staticcall_in_globals : + IsInGlobals globals "staticcall" (make_function staticcall). + Definition revert : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -2279,3 +2309,6 @@ Definition revert : Value.t -> Value.t -> M := let _ := M.raise (| Some (M.get_name (| globals, locals_stack, "Revert" |)) |) in let _ := M.pass (| |) in M.pure Constant.None_)). + +Axiom revert_in_globals : + IsInGlobals globals "revert" (make_function revert). diff --git a/CoqOfPython/ethereum/berlin/vm/interpreter.v b/CoqOfPython/ethereum/berlin/vm/interpreter.v index 50d490b..cbb5986 100644 --- a/CoqOfPython/ethereum/berlin/vm/interpreter.v +++ b/CoqOfPython/ethereum/berlin/vm/interpreter.v @@ -404,6 +404,9 @@ Definition process_message_call : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom process_message_call_in_globals : + IsInGlobals globals "process_message_call" (make_function process_message_call). + Definition process_create_message : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "message"; "env" ] in @@ -506,6 +509,9 @@ Definition process_create_message : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom process_create_message_in_globals : + IsInGlobals globals "process_create_message" (make_function process_create_message). + Definition process_message : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "message"; "env" ] in @@ -631,6 +637,9 @@ Definition process_message : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom process_message_in_globals : + IsInGlobals globals "process_message" (make_function process_message). + Definition execute_code : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "message"; "env" ] in @@ -677,3 +686,6 @@ Definition execute_code : Value.t -> Value.t -> M := M.get_name (| globals, locals_stack, "evm" |) |) in M.pure Constant.None_)). + +Axiom execute_code_in_globals : + IsInGlobals globals "execute_code" (make_function execute_code). diff --git a/CoqOfPython/ethereum/berlin/vm/memory.v b/CoqOfPython/ethereum/berlin/vm/memory.v index d953a23..2d44d17 100644 --- a/CoqOfPython/ethereum/berlin/vm/memory.v +++ b/CoqOfPython/ethereum/berlin/vm/memory.v @@ -71,6 +71,9 @@ Definition memory_write : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom memory_write_in_globals : + IsInGlobals globals "memory_write" (make_function memory_write). + Definition memory_read_bytes : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "memory"; "start_position"; "size" ] in @@ -117,6 +120,9 @@ Definition memory_read_bytes : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom memory_read_bytes_in_globals : + IsInGlobals globals "memory_read_bytes" (make_function memory_read_bytes). + Definition buffer_read : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "buffer"; "start_position"; "size" ] in @@ -169,3 +175,6 @@ Definition buffer_read : Value.t -> Value.t -> M := |) |) in M.pure Constant.None_)). + +Axiom buffer_read_in_globals : + IsInGlobals globals "buffer_read" (make_function buffer_read). diff --git a/CoqOfPython/ethereum/berlin/vm/precompiled_contracts/alt_bn128.v b/CoqOfPython/ethereum/berlin/vm/precompiled_contracts/alt_bn128.v index 50f80e6..e1e1dcd 100644 --- a/CoqOfPython/ethereum/berlin/vm/precompiled_contracts/alt_bn128.v +++ b/CoqOfPython/ethereum/berlin/vm/precompiled_contracts/alt_bn128.v @@ -273,6 +273,9 @@ Definition alt_bn128_add : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom alt_bn128_add_in_globals : + IsInGlobals globals "alt_bn128_add" (make_function alt_bn128_add). + Definition alt_bn128_mul : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -455,6 +458,9 @@ Definition alt_bn128_mul : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom alt_bn128_mul_in_globals : + IsInGlobals globals "alt_bn128_mul" (make_function alt_bn128_mul). + Definition alt_bn128_pairing_check : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -781,3 +787,6 @@ Definition alt_bn128_pairing_check : Value.t -> Value.t -> M := M.pure Constant.None_ )) |) in M.pure Constant.None_)). + +Axiom alt_bn128_pairing_check_in_globals : + IsInGlobals globals "alt_bn128_pairing_check" (make_function alt_bn128_pairing_check). diff --git a/CoqOfPython/ethereum/berlin/vm/precompiled_contracts/blake2f.v b/CoqOfPython/ethereum/berlin/vm/precompiled_contracts/blake2f.v index 3cdd347..341c3dd 100644 --- a/CoqOfPython/ethereum/berlin/vm/precompiled_contracts/blake2f.v +++ b/CoqOfPython/ethereum/berlin/vm/precompiled_contracts/blake2f.v @@ -128,3 +128,6 @@ Definition blake2f : Value.t -> Value.t -> M := |) |) in M.pure Constant.None_)). + +Axiom blake2f_in_globals : + IsInGlobals globals "blake2f" (make_function blake2f). diff --git a/CoqOfPython/ethereum/berlin/vm/precompiled_contracts/ecrecover.v b/CoqOfPython/ethereum/berlin/vm/precompiled_contracts/ecrecover.v index 1769bb3..e51683a 100644 --- a/CoqOfPython/ethereum/berlin/vm/precompiled_contracts/ecrecover.v +++ b/CoqOfPython/ethereum/berlin/vm/precompiled_contracts/ecrecover.v @@ -302,3 +302,6 @@ Definition ecrecover : Value.t -> Value.t -> M := M.get_name (| globals, locals_stack, "padded_address" |) |) in M.pure Constant.None_)). + +Axiom ecrecover_in_globals : + IsInGlobals globals "ecrecover" (make_function ecrecover). diff --git a/CoqOfPython/ethereum/berlin/vm/precompiled_contracts/identity.v b/CoqOfPython/ethereum/berlin/vm/precompiled_contracts/identity.v index 86058e6..bd90030 100644 --- a/CoqOfPython/ethereum/berlin/vm/precompiled_contracts/identity.v +++ b/CoqOfPython/ethereum/berlin/vm/precompiled_contracts/identity.v @@ -95,3 +95,6 @@ Definition identity : Value.t -> Value.t -> M := M.get_name (| globals, locals_stack, "data" |) |) in M.pure Constant.None_)). + +Axiom identity_in_globals : + IsInGlobals globals "identity" (make_function identity). diff --git a/CoqOfPython/ethereum/berlin/vm/precompiled_contracts/modexp.v b/CoqOfPython/ethereum/berlin/vm/precompiled_contracts/modexp.v index 70888f6..8f12ad6 100644 --- a/CoqOfPython/ethereum/berlin/vm/precompiled_contracts/modexp.v +++ b/CoqOfPython/ethereum/berlin/vm/precompiled_contracts/modexp.v @@ -356,6 +356,9 @@ Definition modexp : Value.t -> Value.t -> M := )) |) in M.pure Constant.None_)). +Axiom modexp_in_globals : + IsInGlobals globals "modexp" (make_function modexp). + Definition complexity : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "base_length"; "modulus_length" ] in @@ -419,6 +422,9 @@ Definition complexity : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom complexity_in_globals : + IsInGlobals globals "complexity" (make_function complexity). + Definition iterations : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "exponent_length"; "exponent_head" ] in @@ -600,6 +606,9 @@ Definition iterations : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom iterations_in_globals : + IsInGlobals globals "iterations" (make_function iterations). + Definition gas_cost : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "base_length"; "modulus_length"; "exponent_length"; "exponent_head" ] in @@ -680,3 +689,6 @@ Definition gas_cost : Value.t -> Value.t -> M := |) |) in M.pure Constant.None_)). + +Axiom gas_cost_in_globals : + IsInGlobals globals "gas_cost" (make_function gas_cost). diff --git a/CoqOfPython/ethereum/berlin/vm/precompiled_contracts/ripemd160.v b/CoqOfPython/ethereum/berlin/vm/precompiled_contracts/ripemd160.v index 01feab1..0e00faa 100644 --- a/CoqOfPython/ethereum/berlin/vm/precompiled_contracts/ripemd160.v +++ b/CoqOfPython/ethereum/berlin/vm/precompiled_contracts/ripemd160.v @@ -126,3 +126,6 @@ Definition ripemd160 : Value.t -> Value.t -> M := M.get_name (| globals, locals_stack, "padded_hash" |) |) in M.pure Constant.None_)). + +Axiom ripemd160_in_globals : + IsInGlobals globals "ripemd160" (make_function ripemd160). diff --git a/CoqOfPython/ethereum/berlin/vm/precompiled_contracts/sha256.v b/CoqOfPython/ethereum/berlin/vm/precompiled_contracts/sha256.v index d672ada..1d539b2 100644 --- a/CoqOfPython/ethereum/berlin/vm/precompiled_contracts/sha256.v +++ b/CoqOfPython/ethereum/berlin/vm/precompiled_contracts/sha256.v @@ -107,3 +107,6 @@ Definition sha256 : Value.t -> Value.t -> M := |) |) in M.pure Constant.None_)). + +Axiom sha256_in_globals : + IsInGlobals globals "sha256" (make_function sha256). diff --git a/CoqOfPython/ethereum/berlin/vm/runtime.v b/CoqOfPython/ethereum/berlin/vm/runtime.v index 48203e5..5926a15 100644 --- a/CoqOfPython/ethereum/berlin/vm/runtime.v +++ b/CoqOfPython/ethereum/berlin/vm/runtime.v @@ -158,3 +158,6 @@ Definition get_valid_jump_destinations : Value.t -> Value.t -> M := M.get_name (| globals, locals_stack, "valid_jump_destinations" |) |) in M.pure Constant.None_)). + +Axiom get_valid_jump_destinations_in_globals : + IsInGlobals globals "get_valid_jump_destinations" (make_function get_valid_jump_destinations). diff --git a/CoqOfPython/ethereum/berlin/vm/stack.v b/CoqOfPython/ethereum/berlin/vm/stack.v index 1788fe7..9a9bda0 100644 --- a/CoqOfPython/ethereum/berlin/vm/stack.v +++ b/CoqOfPython/ethereum/berlin/vm/stack.v @@ -78,6 +78,9 @@ Definition pop : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom pop_in_globals : + IsInGlobals globals "pop" (make_function pop). + Definition push : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "stack"; "value" ] in @@ -125,3 +128,6 @@ Definition push : Value.t -> Value.t -> M := |) |) in M.pure Constant.None_)). + +Axiom push_in_globals : + IsInGlobals globals "push" (make_function push). diff --git a/CoqOfPython/ethereum/byzantium/bloom.v b/CoqOfPython/ethereum/byzantium/bloom.v index b643468..766de3d 100644 --- a/CoqOfPython/ethereum/byzantium/bloom.v +++ b/CoqOfPython/ethereum/byzantium/bloom.v @@ -140,6 +140,9 @@ Definition add_to_bloom : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom add_to_bloom_in_globals : + IsInGlobals globals "add_to_bloom" (make_function add_to_bloom). + Definition logs_bloom : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "logs" ] in @@ -209,3 +212,6 @@ Definition logs_bloom : Value.t -> Value.t -> M := |) |) in M.pure Constant.None_)). + +Axiom logs_bloom_in_globals : + IsInGlobals globals "logs_bloom" (make_function logs_bloom). diff --git a/CoqOfPython/ethereum/byzantium/fork.v b/CoqOfPython/ethereum/byzantium/fork.v index cf7386a..570d90e 100644 --- a/CoqOfPython/ethereum/byzantium/fork.v +++ b/CoqOfPython/ethereum/byzantium/fork.v @@ -229,6 +229,9 @@ Definition apply_fork : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom apply_fork_in_globals : + IsInGlobals globals "apply_fork" (make_function apply_fork). + Definition get_last_256_block_hashes : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "chain" ] in @@ -341,6 +344,9 @@ Definition get_last_256_block_hashes : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom get_last_256_block_hashes_in_globals : + IsInGlobals globals "get_last_256_block_hashes" (make_function get_last_256_block_hashes). + Definition state_transition : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "chain"; "block" ] in @@ -508,6 +514,9 @@ Definition state_transition : Value.t -> Value.t -> M := )) |) in M.pure Constant.None_)). +Axiom state_transition_in_globals : + IsInGlobals globals "state_transition" (make_function state_transition). + Definition validate_header : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "header"; "parent_header" ] in @@ -654,6 +663,9 @@ Definition validate_header : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom validate_header_in_globals : + IsInGlobals globals "validate_header" (make_function validate_header). + Definition generate_header_hash_for_pow : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "header" ] in @@ -709,6 +721,9 @@ Definition generate_header_hash_for_pow : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom generate_header_hash_for_pow_in_globals : + IsInGlobals globals "generate_header_hash_for_pow" (make_function generate_header_hash_for_pow). + Definition validate_proof_of_work : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "header" ] in @@ -799,6 +814,9 @@ Definition validate_proof_of_work : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom validate_proof_of_work_in_globals : + IsInGlobals globals "validate_proof_of_work" (make_function validate_proof_of_work). + Definition check_transaction : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "tx"; "gas_available"; "chain_id" ] in @@ -852,6 +870,9 @@ Definition check_transaction : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom check_transaction_in_globals : + IsInGlobals globals "check_transaction" (make_function check_transaction). + Definition make_receipt : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "tx"; "error"; "cumulative_gas_used"; "logs" ] in @@ -889,6 +910,9 @@ Definition make_receipt : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom make_receipt_in_globals : + IsInGlobals globals "make_receipt" (make_function make_receipt). + Definition ApplyBodyOutput : Value.t := builtins.make_klass [] @@ -1126,6 +1150,9 @@ Definition apply_body : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom apply_body_in_globals : + IsInGlobals globals "apply_body" (make_function apply_body). + Definition validate_ommers : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "ommers"; "block_header"; "chain" ] in @@ -1447,6 +1474,9 @@ Definition validate_ommers : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom validate_ommers_in_globals : + IsInGlobals globals "validate_ommers" (make_function validate_ommers). + Definition pay_rewards : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "state"; "block_number"; "coinbase"; "ommers" ] in @@ -1552,6 +1582,9 @@ Definition pay_rewards : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom pay_rewards_in_globals : + IsInGlobals globals "pay_rewards" (make_function pay_rewards). + Definition process_transaction : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "env"; "tx" ] in @@ -1919,6 +1952,9 @@ Definition process_transaction : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom process_transaction_in_globals : + IsInGlobals globals "process_transaction" (make_function process_transaction). + Definition validate_transaction : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "tx" ] in @@ -1975,6 +2011,9 @@ Definition validate_transaction : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom validate_transaction_in_globals : + IsInGlobals globals "validate_transaction" (make_function validate_transaction). + Definition calculate_intrinsic_cost : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "tx" ] in @@ -2085,6 +2124,9 @@ Definition calculate_intrinsic_cost : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom calculate_intrinsic_cost_in_globals : + IsInGlobals globals "calculate_intrinsic_cost" (make_function calculate_intrinsic_cost). + Definition recover_sender : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "chain_id"; "tx" ] in @@ -2281,6 +2323,9 @@ Definition recover_sender : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom recover_sender_in_globals : + IsInGlobals globals "recover_sender" (make_function recover_sender). + Definition signing_hash_pre155 : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "tx" ] in @@ -2315,6 +2360,9 @@ Definition signing_hash_pre155 : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom signing_hash_pre155_in_globals : + IsInGlobals globals "signing_hash_pre155" (make_function signing_hash_pre155). + Definition signing_hash_155 : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "tx"; "chain_id" ] in @@ -2363,6 +2411,9 @@ Definition signing_hash_155 : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom signing_hash_155_in_globals : + IsInGlobals globals "signing_hash_155" (make_function signing_hash_155). + Definition compute_header_hash : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "header" ] in @@ -2415,6 +2466,9 @@ Definition compute_header_hash : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom compute_header_hash_in_globals : + IsInGlobals globals "compute_header_hash" (make_function compute_header_hash). + Definition check_gas_limit : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "gas_limit"; "parent_gas_limit" ] in @@ -2515,6 +2569,9 @@ Definition check_gas_limit : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom check_gas_limit_in_globals : + IsInGlobals globals "check_gas_limit" (make_function check_gas_limit). + Definition calculate_block_difficulty : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "block_number"; "block_timestamp"; "parent_timestamp"; "parent_difficulty"; "parent_has_ommers" ] in @@ -2675,3 +2732,6 @@ Constant.int 1 |) |) in M.pure Constant.None_)). + +Axiom calculate_block_difficulty_in_globals : + IsInGlobals globals "calculate_block_difficulty" (make_function calculate_block_difficulty). diff --git a/CoqOfPython/ethereum/byzantium/fork_types.v b/CoqOfPython/ethereum/byzantium/fork_types.v index bf20981..ee6d634 100644 --- a/CoqOfPython/ethereum/byzantium/fork_types.v +++ b/CoqOfPython/ethereum/byzantium/fork_types.v @@ -99,3 +99,6 @@ Definition encode_account : Value.t -> Value.t -> M := |) |) in M.pure Constant.None_)). + +Axiom encode_account_in_globals : + IsInGlobals globals "encode_account" (make_function encode_account). diff --git a/CoqOfPython/ethereum/byzantium/state.v b/CoqOfPython/ethereum/byzantium/state.v index a202e2d..f8f1c3f 100644 --- a/CoqOfPython/ethereum/byzantium/state.v +++ b/CoqOfPython/ethereum/byzantium/state.v @@ -97,6 +97,9 @@ Definition close_state : Value.t -> Value.t -> M := let _ := M.delete (| M.get_field (| M.get_name (| globals, locals_stack, "state" |), "_snapshots" |) |) in M.pure Constant.None_)). +Axiom close_state_in_globals : + IsInGlobals globals "close_state" (make_function close_state). + Definition begin_transaction : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "state" ] in @@ -127,6 +130,9 @@ Definition begin_transaction : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom begin_transaction_in_globals : + IsInGlobals globals "begin_transaction" (make_function begin_transaction). + Definition commit_transaction : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "state" ] in @@ -146,6 +152,9 @@ Definition commit_transaction : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom commit_transaction_in_globals : + IsInGlobals globals "commit_transaction" (make_function commit_transaction). + Definition rollback_transaction : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "state" ] in @@ -169,6 +178,9 @@ Definition rollback_transaction : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom rollback_transaction_in_globals : + IsInGlobals globals "rollback_transaction" (make_function rollback_transaction). + Definition get_account : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "state"; "address" ] in @@ -229,6 +241,9 @@ Definition get_account : Value.t -> Value.t -> M := )) |) in M.pure Constant.None_)). +Axiom get_account_in_globals : + IsInGlobals globals "get_account" (make_function get_account). + Definition get_account_optional : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "state"; "address" ] in @@ -265,6 +280,9 @@ Definition get_account_optional : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom get_account_optional_in_globals : + IsInGlobals globals "get_account_optional" (make_function get_account_optional). + Definition set_account : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "state"; "address"; "account" ] in @@ -293,6 +311,9 @@ Definition set_account : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom set_account_in_globals : + IsInGlobals globals "set_account" (make_function set_account). + Definition destroy_account : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "state"; "address" ] in @@ -330,6 +351,9 @@ Definition destroy_account : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom destroy_account_in_globals : + IsInGlobals globals "destroy_account" (make_function destroy_account). + Definition destroy_storage : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "state"; "address" ] in @@ -364,6 +388,9 @@ Definition destroy_storage : Value.t -> Value.t -> M := )) |) in M.pure Constant.None_)). +Axiom destroy_storage_in_globals : + IsInGlobals globals "destroy_storage" (make_function destroy_storage). + Definition get_storage : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "state"; "address"; "key" ] in @@ -443,6 +470,9 @@ Definition get_storage : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom get_storage_in_globals : + IsInGlobals globals "get_storage" (make_function get_storage). + Definition set_storage : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "state"; "address"; "key"; "value" ] in @@ -541,6 +571,9 @@ Definition set_storage : Value.t -> Value.t -> M := )) |) in M.pure Constant.None_)). +Axiom set_storage_in_globals : + IsInGlobals globals "set_storage" (make_function set_storage). + Definition storage_root : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "state"; "address" ] in @@ -592,6 +625,9 @@ Definition storage_root : Value.t -> Value.t -> M := )) |) in M.pure Constant.None_)). +Axiom storage_root_in_globals : + IsInGlobals globals "storage_root" (make_function storage_root). + Definition state_root : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "state" ] in @@ -622,6 +658,9 @@ Definition state_root : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom state_root_in_globals : + IsInGlobals globals "state_root" (make_function state_root). + Definition account_exists : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "state"; "address" ] in @@ -656,6 +695,9 @@ Definition account_exists : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom account_exists_in_globals : + IsInGlobals globals "account_exists" (make_function account_exists). + Definition account_has_code_or_nonce : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "state"; "address" ] in @@ -709,6 +751,9 @@ Definition account_has_code_or_nonce : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom account_has_code_or_nonce_in_globals : + IsInGlobals globals "account_has_code_or_nonce" (make_function account_has_code_or_nonce). + Definition is_account_empty : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "state"; "address" ] in @@ -770,6 +815,9 @@ Definition is_account_empty : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom is_account_empty_in_globals : + IsInGlobals globals "is_account_empty" (make_function is_account_empty). + Definition account_exists_and_is_empty : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "state"; "address" ] in @@ -840,6 +888,9 @@ Definition account_exists_and_is_empty : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom account_exists_and_is_empty_in_globals : + IsInGlobals globals "account_exists_and_is_empty" (make_function account_exists_and_is_empty). + Definition is_account_alive : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "state"; "address" ] in @@ -917,6 +968,9 @@ Definition is_account_alive : Value.t -> Value.t -> M := )) |) in M.pure Constant.None_)). +Axiom is_account_alive_in_globals : + IsInGlobals globals "is_account_alive" (make_function is_account_alive). + Definition modify_state : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "state"; "address"; "f" ] in @@ -949,6 +1003,9 @@ Definition modify_state : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom modify_state_in_globals : + IsInGlobals globals "modify_state" (make_function modify_state). + Definition move_ether : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "state"; "sender_address"; "recipient_address"; "amount" ] in @@ -978,6 +1035,9 @@ Definition move_ether : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom move_ether_in_globals : + IsInGlobals globals "move_ether" (make_function move_ether). + Definition set_account_balance : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "state"; "address"; "amount" ] in @@ -1008,6 +1068,9 @@ Definition set_account_balance : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom set_account_balance_in_globals : + IsInGlobals globals "set_account_balance" (make_function set_account_balance). + Definition touch_account : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "state"; "address" ] in @@ -1052,6 +1115,9 @@ Definition touch_account : Value.t -> Value.t -> M := )) |) in M.pure Constant.None_)). +Axiom touch_account_in_globals : + IsInGlobals globals "touch_account" (make_function touch_account). + Definition increment_nonce : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "state"; "address" ] in @@ -1079,6 +1145,9 @@ Definition increment_nonce : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom increment_nonce_in_globals : + IsInGlobals globals "increment_nonce" (make_function increment_nonce). + Definition set_code : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "state"; "address"; "code" ] in @@ -1109,6 +1178,9 @@ Definition set_code : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom set_code_in_globals : + IsInGlobals globals "set_code" (make_function set_code). + Definition create_ether : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "state"; "address"; "amount" ] in @@ -1136,3 +1208,6 @@ Definition create_ether : Value.t -> Value.t -> M := make_dict [] |) in M.pure Constant.None_)). + +Axiom create_ether_in_globals : + IsInGlobals globals "create_ether" (make_function create_ether). diff --git a/CoqOfPython/ethereum/byzantium/trie.v b/CoqOfPython/ethereum/byzantium/trie.v index 8253548..8b87007 100644 --- a/CoqOfPython/ethereum/byzantium/trie.v +++ b/CoqOfPython/ethereum/byzantium/trie.v @@ -365,6 +365,9 @@ Definition encode_internal_node : Value.t -> Value.t -> M := )) |) in M.pure Constant.None_)). +Axiom encode_internal_node_in_globals : + IsInGlobals globals "encode_internal_node" (make_function encode_internal_node). + Definition encode_node : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "node"; "storage_root" ] in @@ -473,6 +476,9 @@ Definition encode_node : Value.t -> Value.t -> M := )) |) in M.pure Constant.None_)). +Axiom encode_node_in_globals : + IsInGlobals globals "encode_node" (make_function encode_node). + Definition Trie : Value.t := builtins.make_klass [(* At base: unsupported node type: Subscript *)] @@ -520,6 +526,9 @@ Definition copy_trie : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom copy_trie_in_globals : + IsInGlobals globals "copy_trie" (make_function copy_trie). + Definition trie_set : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "trie"; "key"; "value" ] in @@ -580,6 +589,9 @@ Definition trie_set : Value.t -> Value.t -> M := )) |) in M.pure Constant.None_)). +Axiom trie_set_in_globals : + IsInGlobals globals "trie_set" (make_function trie_set). + Definition trie_get : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "trie"; "key" ] in @@ -613,6 +625,9 @@ Definition trie_get : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom trie_get_in_globals : + IsInGlobals globals "trie_get" (make_function trie_get). + Definition common_prefix_length : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "a"; "b" ] in @@ -691,6 +706,9 @@ Definition common_prefix_length : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom common_prefix_length_in_globals : + IsInGlobals globals "common_prefix_length" (make_function common_prefix_length). + Definition nibble_list_to_compact : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "x"; "is_leaf" ] in @@ -899,6 +917,9 @@ Definition nibble_list_to_compact : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom nibble_list_to_compact_in_globals : + IsInGlobals globals "nibble_list_to_compact" (make_function nibble_list_to_compact). + Definition bytes_to_nibble_list : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "bytes_" ] in @@ -995,6 +1016,9 @@ Definition bytes_to_nibble_list : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom bytes_to_nibble_list_in_globals : + IsInGlobals globals "bytes_to_nibble_list" (make_function bytes_to_nibble_list). + Definition _prepare_trie : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "trie"; "get_storage_root" ] in @@ -1146,6 +1170,9 @@ Definition _prepare_trie : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom _prepare_trie_in_globals : + IsInGlobals globals "_prepare_trie" (make_function _prepare_trie). + Definition root : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "trie"; "get_storage_root" ] in @@ -1261,6 +1288,9 @@ Definition root : Value.t -> Value.t -> M := )) |) in M.pure Constant.None_)). +Axiom root_in_globals : + IsInGlobals globals "root" (make_function root). + Definition patricialize : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "obj"; "level" ] in @@ -1600,3 +1630,6 @@ Definition patricialize : Value.t -> Value.t -> M := |) |) in M.pure Constant.None_)). + +Axiom patricialize_in_globals : + IsInGlobals globals "patricialize" (make_function patricialize). diff --git a/CoqOfPython/ethereum/byzantium/utils/address.v b/CoqOfPython/ethereum/byzantium/utils/address.v index 0ba31e5..4c54ef9 100644 --- a/CoqOfPython/ethereum/byzantium/utils/address.v +++ b/CoqOfPython/ethereum/byzantium/utils/address.v @@ -77,6 +77,9 @@ Definition to_address : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom to_address_in_globals : + IsInGlobals globals "to_address" (make_function to_address). + Definition compute_contract_address : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "address"; "nonce" ] in @@ -146,3 +149,6 @@ Definition compute_contract_address : Value.t -> Value.t -> M := |) |) in M.pure Constant.None_)). + +Axiom compute_contract_address_in_globals : + IsInGlobals globals "compute_contract_address" (make_function compute_contract_address). diff --git a/CoqOfPython/ethereum/byzantium/utils/hexadecimal.v b/CoqOfPython/ethereum/byzantium/utils/hexadecimal.v index 6424c2a..3bee25c 100644 --- a/CoqOfPython/ethereum/byzantium/utils/hexadecimal.v +++ b/CoqOfPython/ethereum/byzantium/utils/hexadecimal.v @@ -70,6 +70,9 @@ Definition hex_to_root : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom hex_to_root_in_globals : + IsInGlobals globals "hex_to_root" (make_function hex_to_root). + Definition hex_to_bloom : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "hex_string" ] in @@ -110,6 +113,9 @@ Definition hex_to_bloom : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom hex_to_bloom_in_globals : + IsInGlobals globals "hex_to_bloom" (make_function hex_to_bloom). + Definition hex_to_address : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "hex_string" ] in @@ -156,3 +162,6 @@ Definition hex_to_address : Value.t -> Value.t -> M := |) |) in M.pure Constant.None_)). + +Axiom hex_to_address_in_globals : + IsInGlobals globals "hex_to_address" (make_function hex_to_address). diff --git a/CoqOfPython/ethereum/byzantium/utils/message.v b/CoqOfPython/ethereum/byzantium/utils/message.v index 195323c..1a7768a 100644 --- a/CoqOfPython/ethereum/byzantium/utils/message.v +++ b/CoqOfPython/ethereum/byzantium/utils/message.v @@ -213,3 +213,6 @@ Definition prepare_message : Value.t -> Value.t -> M := |) |) in M.pure Constant.None_)). + +Axiom prepare_message_in_globals : + IsInGlobals globals "prepare_message" (make_function prepare_message). diff --git a/CoqOfPython/ethereum/byzantium/vm/__init__.v b/CoqOfPython/ethereum/byzantium/vm/__init__.v index 34ff2a1..9a3bc28 100644 --- a/CoqOfPython/ethereum/byzantium/vm/__init__.v +++ b/CoqOfPython/ethereum/byzantium/vm/__init__.v @@ -164,6 +164,9 @@ Definition incorporate_child_on_success : Value.t -> Value.t -> M := )) |) in M.pure Constant.None_)). +Axiom incorporate_child_on_success_in_globals : + IsInGlobals globals "incorporate_child_on_success" (make_function incorporate_child_on_success). + Definition incorporate_child_on_error : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm"; "child_evm" ] in @@ -244,3 +247,6 @@ Definition incorporate_child_on_error : Value.t -> Value.t -> M := M.get_field (| M.get_name (| globals, locals_stack, "child_evm" |), "gas_left" |) |) in M.pure Constant.None_)). + +Axiom incorporate_child_on_error_in_globals : + IsInGlobals globals "incorporate_child_on_error" (make_function incorporate_child_on_error). diff --git a/CoqOfPython/ethereum/byzantium/vm/gas.v b/CoqOfPython/ethereum/byzantium/vm/gas.v index bf9d020..d732e54 100644 --- a/CoqOfPython/ethereum/byzantium/vm/gas.v +++ b/CoqOfPython/ethereum/byzantium/vm/gas.v @@ -523,6 +523,9 @@ Definition charge_gas : Value.t -> Value.t -> M := )) |) in M.pure Constant.None_)). +Axiom charge_gas_in_globals : + IsInGlobals globals "charge_gas" (make_function charge_gas). + Definition calculate_memory_gas_cost : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "size_in_bytes" ] in @@ -582,6 +585,9 @@ Definition calculate_memory_gas_cost : Value.t -> Value.t -> M := (* At stmt: unsupported node type: Try *) M.pure Constant.None_)). +Axiom calculate_memory_gas_cost_in_globals : + IsInGlobals globals "calculate_memory_gas_cost" (make_function calculate_memory_gas_cost). + Definition calculate_gas_extend_memory : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "memory"; "extensions" ] in @@ -765,6 +771,9 @@ Definition calculate_gas_extend_memory : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom calculate_gas_extend_memory_in_globals : + IsInGlobals globals "calculate_gas_extend_memory" (make_function calculate_gas_extend_memory). + Definition calculate_message_call_gas : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "value"; "gas"; "gas_left"; "memory_cost"; "extra_gas"; "call_stipend" ] in @@ -890,6 +899,9 @@ M.get_name (| globals, locals_stack, "call_stipend" |) |) in M.pure Constant.None_)). +Axiom calculate_message_call_gas_in_globals : + IsInGlobals globals "calculate_message_call_gas" (make_function calculate_message_call_gas). + Definition max_message_call_gas : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "gas" ] in @@ -917,3 +929,6 @@ Definition max_message_call_gas : Value.t -> Value.t -> M := |) |) in M.pure Constant.None_)). + +Axiom max_message_call_gas_in_globals : + IsInGlobals globals "max_message_call_gas" (make_function max_message_call_gas). diff --git a/CoqOfPython/ethereum/byzantium/vm/instructions/arithmetic.v b/CoqOfPython/ethereum/byzantium/vm/instructions/arithmetic.v index 3a47aa4..41905ef 100644 --- a/CoqOfPython/ethereum/byzantium/vm/instructions/arithmetic.v +++ b/CoqOfPython/ethereum/byzantium/vm/instructions/arithmetic.v @@ -119,6 +119,9 @@ Definition add : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom add_in_globals : + IsInGlobals globals "add" (make_function add). + Definition sub : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -186,6 +189,9 @@ Definition sub : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom sub_in_globals : + IsInGlobals globals "sub" (make_function sub). + Definition mul : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -253,6 +259,9 @@ Definition mul : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom mul_in_globals : + IsInGlobals globals "mul" (make_function mul). + Definition div : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -341,6 +350,9 @@ Definition div : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom div_in_globals : + IsInGlobals globals "div" (make_function div). + Definition sdiv : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -491,6 +503,9 @@ Definition sdiv : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom sdiv_in_globals : + IsInGlobals globals "sdiv" (make_function sdiv). + Definition mod_ : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -579,6 +594,9 @@ Definition mod_ : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom mod__in_globals : + IsInGlobals globals "mod" (make_function mod_). + Definition smod : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -696,6 +714,9 @@ Definition smod : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom smod_in_globals : + IsInGlobals globals "smod" (make_function smod). + Definition addmod : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -821,6 +842,9 @@ Definition addmod : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom addmod_in_globals : + IsInGlobals globals "addmod" (make_function addmod). + Definition mulmod : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -946,6 +970,9 @@ Definition mulmod : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom mulmod_in_globals : + IsInGlobals globals "mulmod" (make_function mulmod). + Definition exp : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -1057,6 +1084,9 @@ Definition exp : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom exp_in_globals : + IsInGlobals globals "exp" (make_function exp). + Definition signextend : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -1231,3 +1261,6 @@ Definition signextend : Value.t -> Value.t -> M := Constant.int 1 |) in M.pure Constant.None_)). + +Axiom signextend_in_globals : + IsInGlobals globals "signextend" (make_function signextend). diff --git a/CoqOfPython/ethereum/byzantium/vm/instructions/bitwise.v b/CoqOfPython/ethereum/byzantium/vm/instructions/bitwise.v index 1ceeb8c..c7c229f 100644 --- a/CoqOfPython/ethereum/byzantium/vm/instructions/bitwise.v +++ b/CoqOfPython/ethereum/byzantium/vm/instructions/bitwise.v @@ -95,6 +95,9 @@ Definition bitwise_and : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom bitwise_and_in_globals : + IsInGlobals globals "bitwise_and" (make_function bitwise_and). + Definition bitwise_or : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -155,6 +158,9 @@ Definition bitwise_or : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom bitwise_or_in_globals : + IsInGlobals globals "bitwise_or" (make_function bitwise_or). + Definition bitwise_xor : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -215,6 +221,9 @@ Definition bitwise_xor : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom bitwise_xor_in_globals : + IsInGlobals globals "bitwise_xor" (make_function bitwise_xor). + Definition bitwise_not : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -262,6 +271,9 @@ Definition bitwise_not : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom bitwise_not_in_globals : + IsInGlobals globals "bitwise_not" (make_function bitwise_not). + Definition get_byte : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -377,3 +389,6 @@ Definition get_byte : Value.t -> Value.t -> M := Constant.int 1 |) in M.pure Constant.None_)). + +Axiom get_byte_in_globals : + IsInGlobals globals "get_byte" (make_function get_byte). diff --git a/CoqOfPython/ethereum/byzantium/vm/instructions/block.v b/CoqOfPython/ethereum/byzantium/vm/instructions/block.v index e750866..337f3bb 100644 --- a/CoqOfPython/ethereum/byzantium/vm/instructions/block.v +++ b/CoqOfPython/ethereum/byzantium/vm/instructions/block.v @@ -129,6 +129,9 @@ Definition block_hash : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom block_hash_in_globals : + IsInGlobals globals "block_hash" (make_function block_hash). + Definition coinbase : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -176,6 +179,9 @@ Definition coinbase : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom coinbase_in_globals : + IsInGlobals globals "coinbase" (make_function coinbase). + Definition timestamp : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -217,6 +223,9 @@ Definition timestamp : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom timestamp_in_globals : + IsInGlobals globals "timestamp" (make_function timestamp). + Definition number : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -263,6 +272,9 @@ Definition number : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom number_in_globals : + IsInGlobals globals "number" (make_function number). + Definition difficulty : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -309,6 +321,9 @@ Definition difficulty : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom difficulty_in_globals : + IsInGlobals globals "difficulty" (make_function difficulty). + Definition gas_limit : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -354,3 +369,6 @@ Definition gas_limit : Value.t -> Value.t -> M := Constant.int 1 |) in M.pure Constant.None_)). + +Axiom gas_limit_in_globals : + IsInGlobals globals "gas_limit" (make_function gas_limit). diff --git a/CoqOfPython/ethereum/byzantium/vm/instructions/comparison.v b/CoqOfPython/ethereum/byzantium/vm/instructions/comparison.v index 0a28fba..faf19f6 100644 --- a/CoqOfPython/ethereum/byzantium/vm/instructions/comparison.v +++ b/CoqOfPython/ethereum/byzantium/vm/instructions/comparison.v @@ -105,6 +105,9 @@ Definition less_than : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom less_than_in_globals : + IsInGlobals globals "less_than" (make_function less_than). + Definition signed_less_than : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -182,6 +185,9 @@ Definition signed_less_than : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom signed_less_than_in_globals : + IsInGlobals globals "signed_less_than" (make_function signed_less_than). + Definition greater_than : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -252,6 +258,9 @@ Definition greater_than : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom greater_than_in_globals : + IsInGlobals globals "greater_than" (make_function greater_than). + Definition signed_greater_than : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -329,6 +338,9 @@ Definition signed_greater_than : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom signed_greater_than_in_globals : + IsInGlobals globals "signed_greater_than" (make_function signed_greater_than). + Definition equal : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -399,6 +411,9 @@ Definition equal : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom equal_in_globals : + IsInGlobals globals "equal" (make_function equal). + Definition is_zero : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -458,3 +473,6 @@ Definition is_zero : Value.t -> Value.t -> M := Constant.int 1 |) in M.pure Constant.None_)). + +Axiom is_zero_in_globals : + IsInGlobals globals "is_zero" (make_function is_zero). diff --git a/CoqOfPython/ethereum/byzantium/vm/instructions/control_flow.v b/CoqOfPython/ethereum/byzantium/vm/instructions/control_flow.v index 1cca22a..1555545 100644 --- a/CoqOfPython/ethereum/byzantium/vm/instructions/control_flow.v +++ b/CoqOfPython/ethereum/byzantium/vm/instructions/control_flow.v @@ -71,6 +71,9 @@ Definition stop : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom stop_in_globals : + IsInGlobals globals "stop" (make_function stop). + Definition jump : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -136,6 +139,9 @@ Definition jump : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom jump_in_globals : + IsInGlobals globals "jump" (make_function jump). + Definition jumpi : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -237,6 +243,9 @@ Definition jumpi : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom jumpi_in_globals : + IsInGlobals globals "jumpi" (make_function jumpi). + Definition pc : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -281,6 +290,9 @@ Definition pc : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom pc_in_globals : + IsInGlobals globals "pc" (make_function pc). + Definition gas_left : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -325,6 +337,9 @@ Definition gas_left : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom gas_left_in_globals : + IsInGlobals globals "gas_left" (make_function gas_left). + Definition jumpdest : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -356,3 +371,6 @@ Definition jumpdest : Value.t -> Value.t -> M := Constant.int 1 |) in M.pure Constant.None_)). + +Axiom jumpdest_in_globals : + IsInGlobals globals "jumpdest" (make_function jumpdest). diff --git a/CoqOfPython/ethereum/byzantium/vm/instructions/environment.v b/CoqOfPython/ethereum/byzantium/vm/instructions/environment.v index 03bc9e7..3434f92 100644 --- a/CoqOfPython/ethereum/byzantium/vm/instructions/environment.v +++ b/CoqOfPython/ethereum/byzantium/vm/instructions/environment.v @@ -112,6 +112,9 @@ Definition address : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom address_in_globals : + IsInGlobals globals "address" (make_function address). + Definition balance : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -175,6 +178,9 @@ Definition balance : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom balance_in_globals : + IsInGlobals globals "balance" (make_function balance). + Definition origin : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -219,6 +225,9 @@ Definition origin : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom origin_in_globals : + IsInGlobals globals "origin" (make_function origin). + Definition caller : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -262,6 +271,9 @@ Definition caller : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom caller_in_globals : + IsInGlobals globals "caller" (make_function caller). + Definition callvalue : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -299,6 +311,9 @@ Definition callvalue : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom callvalue_in_globals : + IsInGlobals globals "callvalue" (make_function callvalue). + Definition calldataload : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -370,6 +385,9 @@ Definition calldataload : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom calldataload_in_globals : + IsInGlobals globals "calldataload" (make_function calldataload). + Definition calldatasize : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -419,6 +437,9 @@ Definition calldatasize : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom calldatasize_in_globals : + IsInGlobals globals "calldatasize" (make_function calldatasize). + Definition calldatacopy : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -554,6 +575,9 @@ Definition calldatacopy : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom calldatacopy_in_globals : + IsInGlobals globals "calldatacopy" (make_function calldatacopy). + Definition codesize : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -603,6 +627,9 @@ Definition codesize : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom codesize_in_globals : + IsInGlobals globals "codesize" (make_function codesize). + Definition codecopy : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -738,6 +765,9 @@ Definition codecopy : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom codecopy_in_globals : + IsInGlobals globals "codecopy" (make_function codecopy). + Definition gasprice : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -781,6 +811,9 @@ Definition gasprice : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom gasprice_in_globals : + IsInGlobals globals "gasprice" (make_function gasprice). + Definition extcodesize : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -856,6 +889,9 @@ Definition extcodesize : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom extcodesize_in_globals : + IsInGlobals globals "extcodesize" (make_function extcodesize). + Definition extcodecopy : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -1015,6 +1051,9 @@ Definition extcodecopy : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom extcodecopy_in_globals : + IsInGlobals globals "extcodecopy" (make_function extcodecopy). + Definition returndatasize : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -1063,6 +1102,9 @@ Definition returndatasize : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom returndatasize_in_globals : + IsInGlobals globals "returndatasize" (make_function returndatasize). + Definition returndatacopy : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -1225,3 +1267,6 @@ Definition returndatacopy : Value.t -> Value.t -> M := Constant.int 1 |) in M.pure Constant.None_)). + +Axiom returndatacopy_in_globals : + IsInGlobals globals "returndatacopy" (make_function returndatacopy). diff --git a/CoqOfPython/ethereum/byzantium/vm/instructions/keccak.v b/CoqOfPython/ethereum/byzantium/vm/instructions/keccak.v index c95d552..ad3b449 100644 --- a/CoqOfPython/ethereum/byzantium/vm/instructions/keccak.v +++ b/CoqOfPython/ethereum/byzantium/vm/instructions/keccak.v @@ -189,3 +189,6 @@ Definition keccak : Value.t -> Value.t -> M := Constant.int 1 |) in M.pure Constant.None_)). + +Axiom keccak_in_globals : + IsInGlobals globals "keccak" (make_function keccak). diff --git a/CoqOfPython/ethereum/byzantium/vm/instructions/log.v b/CoqOfPython/ethereum/byzantium/vm/instructions/log.v index 31233e1..a41ebb4 100644 --- a/CoqOfPython/ethereum/byzantium/vm/instructions/log.v +++ b/CoqOfPython/ethereum/byzantium/vm/instructions/log.v @@ -208,6 +208,9 @@ Definition log_n : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom log_n_in_globals : + IsInGlobals globals "log_n" (make_function log_n). + Definition log0 : Value.t := M.run ltac:(M.monadic ( M.call (| M.get_name (| globals, locals_stack, "partial" |), diff --git a/CoqOfPython/ethereum/byzantium/vm/instructions/memory.v b/CoqOfPython/ethereum/byzantium/vm/instructions/memory.v index 92f11c5..57ff054 100644 --- a/CoqOfPython/ethereum/byzantium/vm/instructions/memory.v +++ b/CoqOfPython/ethereum/byzantium/vm/instructions/memory.v @@ -145,6 +145,9 @@ Definition mstore : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom mstore_in_globals : + IsInGlobals globals "mstore" (make_function mstore). + Definition mstore8 : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -249,6 +252,9 @@ Definition mstore8 : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom mstore8_in_globals : + IsInGlobals globals "mstore8" (make_function mstore8). + Definition mload : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -349,6 +355,9 @@ Definition mload : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom mload_in_globals : + IsInGlobals globals "mload" (make_function mload). + Definition msize : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -397,3 +406,6 @@ Definition msize : Value.t -> Value.t -> M := Constant.int 1 |) in M.pure Constant.None_)). + +Axiom msize_in_globals : + IsInGlobals globals "msize" (make_function msize). diff --git a/CoqOfPython/ethereum/byzantium/vm/instructions/stack.v b/CoqOfPython/ethereum/byzantium/vm/instructions/stack.v index 9d68ac8..03bb7ed 100644 --- a/CoqOfPython/ethereum/byzantium/vm/instructions/stack.v +++ b/CoqOfPython/ethereum/byzantium/vm/instructions/stack.v @@ -82,6 +82,9 @@ Definition pop : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom pop_in_globals : + IsInGlobals globals "pop" (make_function pop). + Definition push_n : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm"; "num_bytes" ] in @@ -159,6 +162,9 @@ Definition push_n : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom push_n_in_globals : + IsInGlobals globals "push_n" (make_function push_n). + Definition dup_n : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm"; "item_number" ] in @@ -236,6 +242,9 @@ Definition dup_n : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom dup_n_in_globals : + IsInGlobals globals "dup_n" (make_function dup_n). + Definition swap_n : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm"; "item_number" ] in @@ -312,6 +321,9 @@ Definition swap_n : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom swap_n_in_globals : + IsInGlobals globals "swap_n" (make_function swap_n). + Definition push1 : Value.t := M.run ltac:(M.monadic ( M.call (| M.get_name (| globals, locals_stack, "partial" |), diff --git a/CoqOfPython/ethereum/byzantium/vm/instructions/storage.v b/CoqOfPython/ethereum/byzantium/vm/instructions/storage.v index a14dbd9..b33b714 100644 --- a/CoqOfPython/ethereum/byzantium/vm/instructions/storage.v +++ b/CoqOfPython/ethereum/byzantium/vm/instructions/storage.v @@ -112,6 +112,9 @@ Definition sload : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom sload_in_globals : + IsInGlobals globals "sload" (make_function sload). + Definition sstore : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -250,3 +253,6 @@ Definition sstore : Value.t -> Value.t -> M := Constant.int 1 |) in M.pure Constant.None_)). + +Axiom sstore_in_globals : + IsInGlobals globals "sstore" (make_function sstore). diff --git a/CoqOfPython/ethereum/byzantium/vm/instructions/system.v b/CoqOfPython/ethereum/byzantium/vm/instructions/system.v index 4cbca10..f4ae8dc 100644 --- a/CoqOfPython/ethereum/byzantium/vm/instructions/system.v +++ b/CoqOfPython/ethereum/byzantium/vm/instructions/system.v @@ -453,6 +453,9 @@ Definition create : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom create_in_globals : + IsInGlobals globals "create" (make_function create). + Definition return_ : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -536,6 +539,9 @@ Definition return_ : Value.t -> Value.t -> M := let _ := M.pass (| |) in M.pure Constant.None_)). +Axiom return__in_globals : + IsInGlobals globals "return_" (make_function return_). + Definition generic_call : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm"; "gas"; "value"; "caller"; "to"; "code_address"; "should_transfer_value"; "is_staticcall"; "memory_input_start_position"; "memory_input_size"; "memory_output_start_position"; "memory_output_size" ] in @@ -731,6 +737,9 @@ Definition generic_call : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom generic_call_in_globals : + IsInGlobals globals "generic_call" (make_function generic_call). + Definition call : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -1035,6 +1044,9 @@ M.get_name (| globals, locals_stack, "GAS_CALL_VALUE" |) |) in M.pure Constant.None_)). +Axiom call_in_globals : + IsInGlobals globals "call" (make_function call). + Definition callcode : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -1284,6 +1296,9 @@ M.get_name (| globals, locals_stack, "GAS_CALL_VALUE" |) |) in M.pure Constant.None_)). +Axiom callcode_in_globals : + IsInGlobals globals "callcode" (make_function callcode). + Definition selfdestruct : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -1513,6 +1528,9 @@ Definition selfdestruct : Value.t -> Value.t -> M := let _ := M.pass (| |) in M.pure Constant.None_)). +Axiom selfdestruct_in_globals : + IsInGlobals globals "selfdestruct" (make_function selfdestruct). + Definition delegatecall : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -1681,6 +1699,9 @@ Definition delegatecall : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom delegatecall_in_globals : + IsInGlobals globals "delegatecall" (make_function delegatecall). + Definition staticcall : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -1855,6 +1876,9 @@ Definition staticcall : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom staticcall_in_globals : + IsInGlobals globals "staticcall" (make_function staticcall). + Definition revert : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -1941,3 +1965,6 @@ Definition revert : Value.t -> Value.t -> M := let _ := M.raise (| Some (M.get_name (| globals, locals_stack, "Revert" |)) |) in let _ := M.pass (| |) in M.pure Constant.None_)). + +Axiom revert_in_globals : + IsInGlobals globals "revert" (make_function revert). diff --git a/CoqOfPython/ethereum/byzantium/vm/interpreter.v b/CoqOfPython/ethereum/byzantium/vm/interpreter.v index 1c71f79..e0984a8 100644 --- a/CoqOfPython/ethereum/byzantium/vm/interpreter.v +++ b/CoqOfPython/ethereum/byzantium/vm/interpreter.v @@ -396,6 +396,9 @@ Definition process_message_call : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom process_message_call_in_globals : + IsInGlobals globals "process_message_call" (make_function process_message_call). + Definition process_create_message : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "message"; "env" ] in @@ -490,6 +493,9 @@ Definition process_create_message : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom process_create_message_in_globals : + IsInGlobals globals "process_create_message" (make_function process_create_message). + Definition process_message : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "message"; "env" ] in @@ -615,6 +621,9 @@ Definition process_message : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom process_message_in_globals : + IsInGlobals globals "process_message" (make_function process_message). + Definition execute_code : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "message"; "env" ] in @@ -661,3 +670,6 @@ Definition execute_code : Value.t -> Value.t -> M := M.get_name (| globals, locals_stack, "evm" |) |) in M.pure Constant.None_)). + +Axiom execute_code_in_globals : + IsInGlobals globals "execute_code" (make_function execute_code). diff --git a/CoqOfPython/ethereum/byzantium/vm/memory.v b/CoqOfPython/ethereum/byzantium/vm/memory.v index 20c1f88..370ded0 100644 --- a/CoqOfPython/ethereum/byzantium/vm/memory.v +++ b/CoqOfPython/ethereum/byzantium/vm/memory.v @@ -71,6 +71,9 @@ Definition memory_write : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom memory_write_in_globals : + IsInGlobals globals "memory_write" (make_function memory_write). + Definition memory_read_bytes : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "memory"; "start_position"; "size" ] in @@ -117,6 +120,9 @@ Definition memory_read_bytes : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom memory_read_bytes_in_globals : + IsInGlobals globals "memory_read_bytes" (make_function memory_read_bytes). + Definition buffer_read : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "buffer"; "start_position"; "size" ] in @@ -169,3 +175,6 @@ Definition buffer_read : Value.t -> Value.t -> M := |) |) in M.pure Constant.None_)). + +Axiom buffer_read_in_globals : + IsInGlobals globals "buffer_read" (make_function buffer_read). diff --git a/CoqOfPython/ethereum/byzantium/vm/precompiled_contracts/alt_bn128.v b/CoqOfPython/ethereum/byzantium/vm/precompiled_contracts/alt_bn128.v index f90e2a8..397d62e 100644 --- a/CoqOfPython/ethereum/byzantium/vm/precompiled_contracts/alt_bn128.v +++ b/CoqOfPython/ethereum/byzantium/vm/precompiled_contracts/alt_bn128.v @@ -273,6 +273,9 @@ Definition alt_bn128_add : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom alt_bn128_add_in_globals : + IsInGlobals globals "alt_bn128_add" (make_function alt_bn128_add). + Definition alt_bn128_mul : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -455,6 +458,9 @@ Definition alt_bn128_mul : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom alt_bn128_mul_in_globals : + IsInGlobals globals "alt_bn128_mul" (make_function alt_bn128_mul). + Definition alt_bn128_pairing_check : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -781,3 +787,6 @@ Definition alt_bn128_pairing_check : Value.t -> Value.t -> M := M.pure Constant.None_ )) |) in M.pure Constant.None_)). + +Axiom alt_bn128_pairing_check_in_globals : + IsInGlobals globals "alt_bn128_pairing_check" (make_function alt_bn128_pairing_check). diff --git a/CoqOfPython/ethereum/byzantium/vm/precompiled_contracts/ecrecover.v b/CoqOfPython/ethereum/byzantium/vm/precompiled_contracts/ecrecover.v index 1da26e6..f2100ff 100644 --- a/CoqOfPython/ethereum/byzantium/vm/precompiled_contracts/ecrecover.v +++ b/CoqOfPython/ethereum/byzantium/vm/precompiled_contracts/ecrecover.v @@ -302,3 +302,6 @@ Definition ecrecover : Value.t -> Value.t -> M := M.get_name (| globals, locals_stack, "padded_address" |) |) in M.pure Constant.None_)). + +Axiom ecrecover_in_globals : + IsInGlobals globals "ecrecover" (make_function ecrecover). diff --git a/CoqOfPython/ethereum/byzantium/vm/precompiled_contracts/identity.v b/CoqOfPython/ethereum/byzantium/vm/precompiled_contracts/identity.v index be43993..047ea61 100644 --- a/CoqOfPython/ethereum/byzantium/vm/precompiled_contracts/identity.v +++ b/CoqOfPython/ethereum/byzantium/vm/precompiled_contracts/identity.v @@ -95,3 +95,6 @@ Definition identity : Value.t -> Value.t -> M := M.get_name (| globals, locals_stack, "data" |) |) in M.pure Constant.None_)). + +Axiom identity_in_globals : + IsInGlobals globals "identity" (make_function identity). diff --git a/CoqOfPython/ethereum/byzantium/vm/precompiled_contracts/modexp.v b/CoqOfPython/ethereum/byzantium/vm/precompiled_contracts/modexp.v index aa931ce..bf8b0a4 100644 --- a/CoqOfPython/ethereum/byzantium/vm/precompiled_contracts/modexp.v +++ b/CoqOfPython/ethereum/byzantium/vm/precompiled_contracts/modexp.v @@ -468,6 +468,9 @@ Definition modexp : Value.t -> Value.t -> M := )) |) in M.pure Constant.None_)). +Axiom modexp_in_globals : + IsInGlobals globals "modexp" (make_function modexp). + Definition get_mult_complexity : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "x" ] in @@ -546,3 +549,6 @@ Definition get_mult_complexity : Value.t -> Value.t -> M := M.pure Constant.None_ )) |) in M.pure Constant.None_)). + +Axiom get_mult_complexity_in_globals : + IsInGlobals globals "get_mult_complexity" (make_function get_mult_complexity). diff --git a/CoqOfPython/ethereum/byzantium/vm/precompiled_contracts/ripemd160.v b/CoqOfPython/ethereum/byzantium/vm/precompiled_contracts/ripemd160.v index d405920..536f04c 100644 --- a/CoqOfPython/ethereum/byzantium/vm/precompiled_contracts/ripemd160.v +++ b/CoqOfPython/ethereum/byzantium/vm/precompiled_contracts/ripemd160.v @@ -126,3 +126,6 @@ Definition ripemd160 : Value.t -> Value.t -> M := M.get_name (| globals, locals_stack, "padded_hash" |) |) in M.pure Constant.None_)). + +Axiom ripemd160_in_globals : + IsInGlobals globals "ripemd160" (make_function ripemd160). diff --git a/CoqOfPython/ethereum/byzantium/vm/precompiled_contracts/sha256.v b/CoqOfPython/ethereum/byzantium/vm/precompiled_contracts/sha256.v index 7669a50..1557b96 100644 --- a/CoqOfPython/ethereum/byzantium/vm/precompiled_contracts/sha256.v +++ b/CoqOfPython/ethereum/byzantium/vm/precompiled_contracts/sha256.v @@ -107,3 +107,6 @@ Definition sha256 : Value.t -> Value.t -> M := |) |) in M.pure Constant.None_)). + +Axiom sha256_in_globals : + IsInGlobals globals "sha256" (make_function sha256). diff --git a/CoqOfPython/ethereum/byzantium/vm/runtime.v b/CoqOfPython/ethereum/byzantium/vm/runtime.v index e5b4870..7932b6d 100644 --- a/CoqOfPython/ethereum/byzantium/vm/runtime.v +++ b/CoqOfPython/ethereum/byzantium/vm/runtime.v @@ -158,3 +158,6 @@ Definition get_valid_jump_destinations : Value.t -> Value.t -> M := M.get_name (| globals, locals_stack, "valid_jump_destinations" |) |) in M.pure Constant.None_)). + +Axiom get_valid_jump_destinations_in_globals : + IsInGlobals globals "get_valid_jump_destinations" (make_function get_valid_jump_destinations). diff --git a/CoqOfPython/ethereum/byzantium/vm/stack.v b/CoqOfPython/ethereum/byzantium/vm/stack.v index b368020..c205989 100644 --- a/CoqOfPython/ethereum/byzantium/vm/stack.v +++ b/CoqOfPython/ethereum/byzantium/vm/stack.v @@ -78,6 +78,9 @@ Definition pop : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom pop_in_globals : + IsInGlobals globals "pop" (make_function pop). + Definition push : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "stack"; "value" ] in @@ -125,3 +128,6 @@ Definition push : Value.t -> Value.t -> M := |) |) in M.pure Constant.None_)). + +Axiom push_in_globals : + IsInGlobals globals "push" (make_function push). diff --git a/CoqOfPython/ethereum/cancun/bloom.v b/CoqOfPython/ethereum/cancun/bloom.v index 0836db3..86cc7ae 100644 --- a/CoqOfPython/ethereum/cancun/bloom.v +++ b/CoqOfPython/ethereum/cancun/bloom.v @@ -140,6 +140,9 @@ Definition add_to_bloom : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom add_to_bloom_in_globals : + IsInGlobals globals "add_to_bloom" (make_function add_to_bloom). + Definition logs_bloom : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "logs" ] in @@ -209,3 +212,6 @@ Definition logs_bloom : Value.t -> Value.t -> M := |) |) in M.pure Constant.None_)). + +Axiom logs_bloom_in_globals : + IsInGlobals globals "logs_bloom" (make_function logs_bloom). diff --git a/CoqOfPython/ethereum/cancun/fork.v b/CoqOfPython/ethereum/cancun/fork.v index be9035f..ddfc829 100644 --- a/CoqOfPython/ethereum/cancun/fork.v +++ b/CoqOfPython/ethereum/cancun/fork.v @@ -277,6 +277,9 @@ Definition apply_fork : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom apply_fork_in_globals : + IsInGlobals globals "apply_fork" (make_function apply_fork). + Definition get_last_256_block_hashes : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "chain" ] in @@ -389,6 +392,9 @@ Definition get_last_256_block_hashes : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom get_last_256_block_hashes_in_globals : + IsInGlobals globals "get_last_256_block_hashes" (make_function get_last_256_block_hashes). + Definition state_transition : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "chain"; "block" ] in @@ -604,6 +610,9 @@ Definition state_transition : Value.t -> Value.t -> M := )) |) in M.pure Constant.None_)). +Axiom state_transition_in_globals : + IsInGlobals globals "state_transition" (make_function state_transition). + Definition calculate_base_fee_per_gas : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "block_gas_limit"; "parent_gas_limit"; "parent_gas_used"; "parent_base_fee_per_gas" ] in @@ -769,6 +778,9 @@ Definition calculate_base_fee_per_gas : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom calculate_base_fee_per_gas_in_globals : + IsInGlobals globals "calculate_base_fee_per_gas" (make_function calculate_base_fee_per_gas). + Definition validate_header : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "header"; "parent_header" ] in @@ -929,6 +941,9 @@ Definition validate_header : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom validate_header_in_globals : + IsInGlobals globals "validate_header" (make_function validate_header). + Definition check_transaction : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "state"; "tx"; "gas_available"; "chain_id"; "base_fee_per_gas"; "excess_blob_gas" ] in @@ -1361,6 +1376,9 @@ Definition check_transaction : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom check_transaction_in_globals : + IsInGlobals globals "check_transaction" (make_function check_transaction). + Definition make_receipt : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "tx"; "error"; "cumulative_gas_used"; "logs" ] in @@ -1488,6 +1506,9 @@ Definition make_receipt : Value.t -> Value.t -> M := )) |) in M.pure Constant.None_)). +Axiom make_receipt_in_globals : + IsInGlobals globals "make_receipt" (make_function make_receipt). + Definition ApplyBodyOutput : Value.t := builtins.make_klass [] @@ -1904,6 +1925,9 @@ Definition apply_body : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom apply_body_in_globals : + IsInGlobals globals "apply_body" (make_function apply_body). + Definition process_transaction : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "env"; "tx" ] in @@ -2314,6 +2338,9 @@ Definition process_transaction : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom process_transaction_in_globals : + IsInGlobals globals "process_transaction" (make_function process_transaction). + Definition calculate_intrinsic_cost : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "tx" ] in @@ -2506,6 +2533,9 @@ Definition calculate_intrinsic_cost : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom calculate_intrinsic_cost_in_globals : + IsInGlobals globals "calculate_intrinsic_cost" (make_function calculate_intrinsic_cost). + Definition recover_sender : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "chain_id"; "tx" ] in @@ -2835,6 +2865,9 @@ Definition recover_sender : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom recover_sender_in_globals : + IsInGlobals globals "recover_sender" (make_function recover_sender). + Definition signing_hash_pre155 : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "tx" ] in @@ -2869,6 +2902,9 @@ Definition signing_hash_pre155 : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom signing_hash_pre155_in_globals : + IsInGlobals globals "signing_hash_pre155" (make_function signing_hash_pre155). + Definition signing_hash_155 : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "tx"; "chain_id" ] in @@ -2917,6 +2953,9 @@ Definition signing_hash_155 : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom signing_hash_155_in_globals : + IsInGlobals globals "signing_hash_155" (make_function signing_hash_155). + Definition signing_hash_2930 : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "tx" ] in @@ -2954,6 +2993,9 @@ Definition signing_hash_2930 : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom signing_hash_2930_in_globals : + IsInGlobals globals "signing_hash_2930" (make_function signing_hash_2930). + Definition signing_hash_1559 : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "tx" ] in @@ -2991,6 +3033,9 @@ Definition signing_hash_1559 : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom signing_hash_1559_in_globals : + IsInGlobals globals "signing_hash_1559" (make_function signing_hash_1559). + Definition signing_hash_4844 : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "tx" ] in @@ -3028,6 +3073,9 @@ Definition signing_hash_4844 : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom signing_hash_4844_in_globals : + IsInGlobals globals "signing_hash_4844" (make_function signing_hash_4844). + Definition compute_header_hash : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "header" ] in @@ -3080,6 +3128,9 @@ Definition compute_header_hash : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom compute_header_hash_in_globals : + IsInGlobals globals "compute_header_hash" (make_function compute_header_hash). + Definition check_gas_limit : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "gas_limit"; "parent_gas_limit" ] in @@ -3179,3 +3230,6 @@ Definition check_gas_limit : Value.t -> Value.t -> M := Constant.bool true |) in M.pure Constant.None_)). + +Axiom check_gas_limit_in_globals : + IsInGlobals globals "check_gas_limit" (make_function check_gas_limit). diff --git a/CoqOfPython/ethereum/cancun/fork_types.v b/CoqOfPython/ethereum/cancun/fork_types.v index 306871b..8eb2521 100644 --- a/CoqOfPython/ethereum/cancun/fork_types.v +++ b/CoqOfPython/ethereum/cancun/fork_types.v @@ -103,3 +103,6 @@ Definition encode_account : Value.t -> Value.t -> M := |) |) in M.pure Constant.None_)). + +Axiom encode_account_in_globals : + IsInGlobals globals "encode_account" (make_function encode_account). diff --git a/CoqOfPython/ethereum/cancun/state.v b/CoqOfPython/ethereum/cancun/state.v index 26b9a8e..b0b40c3 100644 --- a/CoqOfPython/ethereum/cancun/state.v +++ b/CoqOfPython/ethereum/cancun/state.v @@ -115,6 +115,9 @@ Definition close_state : Value.t -> Value.t -> M := let _ := M.delete (| M.get_field (| M.get_name (| globals, locals_stack, "state" |), "created_accounts" |) |) in M.pure Constant.None_)). +Axiom close_state_in_globals : + IsInGlobals globals "close_state" (make_function close_state). + Definition begin_transaction : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "state"; "transient_storage" ] in @@ -154,6 +157,9 @@ Definition begin_transaction : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom begin_transaction_in_globals : + IsInGlobals globals "begin_transaction" (make_function begin_transaction). + Definition commit_transaction : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "state"; "transient_storage" ] in @@ -196,6 +202,9 @@ Definition commit_transaction : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom commit_transaction_in_globals : + IsInGlobals globals "commit_transaction" (make_function commit_transaction). + Definition rollback_transaction : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "state"; "transient_storage" ] in @@ -245,6 +254,9 @@ Definition rollback_transaction : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom rollback_transaction_in_globals : + IsInGlobals globals "rollback_transaction" (make_function rollback_transaction). + Definition get_account : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "state"; "address" ] in @@ -305,6 +317,9 @@ Definition get_account : Value.t -> Value.t -> M := )) |) in M.pure Constant.None_)). +Axiom get_account_in_globals : + IsInGlobals globals "get_account" (make_function get_account). + Definition get_account_optional : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "state"; "address" ] in @@ -341,6 +356,9 @@ Definition get_account_optional : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom get_account_optional_in_globals : + IsInGlobals globals "get_account_optional" (make_function get_account_optional). + Definition set_account : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "state"; "address"; "account" ] in @@ -369,6 +387,9 @@ Definition set_account : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom set_account_in_globals : + IsInGlobals globals "set_account" (make_function set_account). + Definition destroy_account : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "state"; "address" ] in @@ -406,6 +427,9 @@ Definition destroy_account : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom destroy_account_in_globals : + IsInGlobals globals "destroy_account" (make_function destroy_account). + Definition destroy_storage : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "state"; "address" ] in @@ -440,6 +464,9 @@ Definition destroy_storage : Value.t -> Value.t -> M := )) |) in M.pure Constant.None_)). +Axiom destroy_storage_in_globals : + IsInGlobals globals "destroy_storage" (make_function destroy_storage). + Definition mark_account_created : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "state"; "address" ] in @@ -469,6 +496,9 @@ Definition mark_account_created : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom mark_account_created_in_globals : + IsInGlobals globals "mark_account_created" (make_function mark_account_created). + Definition get_storage : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "state"; "address"; "key" ] in @@ -548,6 +578,9 @@ Definition get_storage : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom get_storage_in_globals : + IsInGlobals globals "get_storage" (make_function get_storage). + Definition set_storage : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "state"; "address"; "key"; "value" ] in @@ -646,6 +679,9 @@ Definition set_storage : Value.t -> Value.t -> M := )) |) in M.pure Constant.None_)). +Axiom set_storage_in_globals : + IsInGlobals globals "set_storage" (make_function set_storage). + Definition storage_root : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "state"; "address" ] in @@ -697,6 +733,9 @@ Definition storage_root : Value.t -> Value.t -> M := )) |) in M.pure Constant.None_)). +Axiom storage_root_in_globals : + IsInGlobals globals "storage_root" (make_function storage_root). + Definition state_root : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "state" ] in @@ -727,6 +766,9 @@ Definition state_root : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom state_root_in_globals : + IsInGlobals globals "state_root" (make_function state_root). + Definition account_exists : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "state"; "address" ] in @@ -761,6 +803,9 @@ Definition account_exists : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom account_exists_in_globals : + IsInGlobals globals "account_exists" (make_function account_exists). + Definition account_has_code_or_nonce : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "state"; "address" ] in @@ -814,6 +859,9 @@ Definition account_has_code_or_nonce : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom account_has_code_or_nonce_in_globals : + IsInGlobals globals "account_has_code_or_nonce" (make_function account_has_code_or_nonce). + Definition is_account_empty : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "state"; "address" ] in @@ -875,6 +923,9 @@ Definition is_account_empty : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom is_account_empty_in_globals : + IsInGlobals globals "is_account_empty" (make_function is_account_empty). + Definition account_exists_and_is_empty : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "state"; "address" ] in @@ -945,6 +996,9 @@ Definition account_exists_and_is_empty : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom account_exists_and_is_empty_in_globals : + IsInGlobals globals "account_exists_and_is_empty" (make_function account_exists_and_is_empty). + Definition is_account_alive : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "state"; "address" ] in @@ -1022,6 +1076,9 @@ Definition is_account_alive : Value.t -> Value.t -> M := )) |) in M.pure Constant.None_)). +Axiom is_account_alive_in_globals : + IsInGlobals globals "is_account_alive" (make_function is_account_alive). + Definition modify_state : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "state"; "address"; "f" ] in @@ -1054,6 +1111,9 @@ Definition modify_state : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom modify_state_in_globals : + IsInGlobals globals "modify_state" (make_function modify_state). + Definition move_ether : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "state"; "sender_address"; "recipient_address"; "amount" ] in @@ -1083,6 +1143,9 @@ Definition move_ether : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom move_ether_in_globals : + IsInGlobals globals "move_ether" (make_function move_ether). + Definition process_withdrawal : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "state"; "wd" ] in @@ -1102,6 +1165,9 @@ Definition process_withdrawal : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom process_withdrawal_in_globals : + IsInGlobals globals "process_withdrawal" (make_function process_withdrawal). + Definition set_account_balance : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "state"; "address"; "amount" ] in @@ -1132,6 +1198,9 @@ Definition set_account_balance : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom set_account_balance_in_globals : + IsInGlobals globals "set_account_balance" (make_function set_account_balance). + Definition touch_account : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "state"; "address" ] in @@ -1176,6 +1245,9 @@ Definition touch_account : Value.t -> Value.t -> M := )) |) in M.pure Constant.None_)). +Axiom touch_account_in_globals : + IsInGlobals globals "touch_account" (make_function touch_account). + Definition increment_nonce : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "state"; "address" ] in @@ -1203,6 +1275,9 @@ Definition increment_nonce : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom increment_nonce_in_globals : + IsInGlobals globals "increment_nonce" (make_function increment_nonce). + Definition set_code : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "state"; "address"; "code" ] in @@ -1233,6 +1308,9 @@ Definition set_code : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom set_code_in_globals : + IsInGlobals globals "set_code" (make_function set_code). + Definition get_storage_original : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "state"; "address"; "key" ] in @@ -1339,6 +1417,9 @@ Definition get_storage_original : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom get_storage_original_in_globals : + IsInGlobals globals "get_storage_original" (make_function get_storage_original). + Definition get_transient_storage : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "transient_storage"; "address"; "key" ] in @@ -1416,6 +1497,9 @@ Definition get_transient_storage : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom get_transient_storage_in_globals : + IsInGlobals globals "get_transient_storage" (make_function get_transient_storage). + Definition set_transient_storage : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "transient_storage"; "address"; "key"; "value" ] in @@ -1502,6 +1586,9 @@ Definition set_transient_storage : Value.t -> Value.t -> M := )) |) in M.pure Constant.None_)). +Axiom set_transient_storage_in_globals : + IsInGlobals globals "set_transient_storage" (make_function set_transient_storage). + Definition destroy_touched_empty_accounts : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "state"; "touched_accounts" ] in @@ -1553,3 +1640,6 @@ Definition destroy_touched_empty_accounts : Value.t -> Value.t -> M := )) |) in M.pure Constant.None_)). + +Axiom destroy_touched_empty_accounts_in_globals : + IsInGlobals globals "destroy_touched_empty_accounts" (make_function destroy_touched_empty_accounts). diff --git a/CoqOfPython/ethereum/cancun/transactions.v b/CoqOfPython/ethereum/cancun/transactions.v index 960718c..bb800fe 100644 --- a/CoqOfPython/ethereum/cancun/transactions.v +++ b/CoqOfPython/ethereum/cancun/transactions.v @@ -243,6 +243,9 @@ Definition encode_transaction : Value.t -> Value.t -> M := )) |) in M.pure Constant.None_)). +Axiom encode_transaction_in_globals : + IsInGlobals globals "encode_transaction" (make_function encode_transaction). + Definition decode_transaction : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "tx" ] in @@ -369,3 +372,6 @@ Definition decode_transaction : Value.t -> Value.t -> M := M.pure Constant.None_ )) |) in M.pure Constant.None_)). + +Axiom decode_transaction_in_globals : + IsInGlobals globals "decode_transaction" (make_function decode_transaction). diff --git a/CoqOfPython/ethereum/cancun/trie.v b/CoqOfPython/ethereum/cancun/trie.v index 45253b2..6b003d3 100644 --- a/CoqOfPython/ethereum/cancun/trie.v +++ b/CoqOfPython/ethereum/cancun/trie.v @@ -380,6 +380,9 @@ Definition encode_internal_node : Value.t -> Value.t -> M := )) |) in M.pure Constant.None_)). +Axiom encode_internal_node_in_globals : + IsInGlobals globals "encode_internal_node" (make_function encode_internal_node). + Definition encode_node : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "node"; "storage_root" ] in @@ -488,6 +491,9 @@ Definition encode_node : Value.t -> Value.t -> M := )) |) in M.pure Constant.None_)). +Axiom encode_node_in_globals : + IsInGlobals globals "encode_node" (make_function encode_node). + Definition Trie : Value.t := builtins.make_klass [(* At base: unsupported node type: Subscript *)] @@ -535,6 +541,9 @@ Definition copy_trie : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom copy_trie_in_globals : + IsInGlobals globals "copy_trie" (make_function copy_trie). + Definition trie_set : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "trie"; "key"; "value" ] in @@ -595,6 +604,9 @@ Definition trie_set : Value.t -> Value.t -> M := )) |) in M.pure Constant.None_)). +Axiom trie_set_in_globals : + IsInGlobals globals "trie_set" (make_function trie_set). + Definition trie_get : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "trie"; "key" ] in @@ -628,6 +640,9 @@ Definition trie_get : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom trie_get_in_globals : + IsInGlobals globals "trie_get" (make_function trie_get). + Definition common_prefix_length : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "a"; "b" ] in @@ -706,6 +721,9 @@ Definition common_prefix_length : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom common_prefix_length_in_globals : + IsInGlobals globals "common_prefix_length" (make_function common_prefix_length). + Definition nibble_list_to_compact : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "x"; "is_leaf" ] in @@ -914,6 +932,9 @@ Definition nibble_list_to_compact : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom nibble_list_to_compact_in_globals : + IsInGlobals globals "nibble_list_to_compact" (make_function nibble_list_to_compact). + Definition bytes_to_nibble_list : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "bytes_" ] in @@ -1010,6 +1031,9 @@ Definition bytes_to_nibble_list : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom bytes_to_nibble_list_in_globals : + IsInGlobals globals "bytes_to_nibble_list" (make_function bytes_to_nibble_list). + Definition _prepare_trie : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "trie"; "get_storage_root" ] in @@ -1161,6 +1185,9 @@ Definition _prepare_trie : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom _prepare_trie_in_globals : + IsInGlobals globals "_prepare_trie" (make_function _prepare_trie). + Definition root : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "trie"; "get_storage_root" ] in @@ -1276,6 +1303,9 @@ Definition root : Value.t -> Value.t -> M := )) |) in M.pure Constant.None_)). +Axiom root_in_globals : + IsInGlobals globals "root" (make_function root). + Definition patricialize : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "obj"; "level" ] in @@ -1615,3 +1645,6 @@ Definition patricialize : Value.t -> Value.t -> M := |) |) in M.pure Constant.None_)). + +Axiom patricialize_in_globals : + IsInGlobals globals "patricialize" (make_function patricialize). diff --git a/CoqOfPython/ethereum/cancun/utils/address.v b/CoqOfPython/ethereum/cancun/utils/address.v index 4cc1454..755eaa3 100644 --- a/CoqOfPython/ethereum/cancun/utils/address.v +++ b/CoqOfPython/ethereum/cancun/utils/address.v @@ -79,6 +79,9 @@ Definition to_address : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom to_address_in_globals : + IsInGlobals globals "to_address" (make_function to_address). + Definition compute_contract_address : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "address"; "nonce" ] in @@ -149,6 +152,9 @@ Definition compute_contract_address : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom compute_contract_address_in_globals : + IsInGlobals globals "compute_contract_address" (make_function compute_contract_address). + Definition compute_create2_contract_address : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "address"; "salt"; "call_data" ] in @@ -230,3 +236,6 @@ Definition compute_create2_contract_address : Value.t -> Value.t -> M := |) |) in M.pure Constant.None_)). + +Axiom compute_create2_contract_address_in_globals : + IsInGlobals globals "compute_create2_contract_address" (make_function compute_create2_contract_address). diff --git a/CoqOfPython/ethereum/cancun/utils/hexadecimal.v b/CoqOfPython/ethereum/cancun/utils/hexadecimal.v index dd5a681..dd2c591 100644 --- a/CoqOfPython/ethereum/cancun/utils/hexadecimal.v +++ b/CoqOfPython/ethereum/cancun/utils/hexadecimal.v @@ -70,6 +70,9 @@ Definition hex_to_root : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom hex_to_root_in_globals : + IsInGlobals globals "hex_to_root" (make_function hex_to_root). + Definition hex_to_bloom : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "hex_string" ] in @@ -110,6 +113,9 @@ Definition hex_to_bloom : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom hex_to_bloom_in_globals : + IsInGlobals globals "hex_to_bloom" (make_function hex_to_bloom). + Definition hex_to_address : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "hex_string" ] in @@ -156,3 +162,6 @@ Definition hex_to_address : Value.t -> Value.t -> M := |) |) in M.pure Constant.None_)). + +Axiom hex_to_address_in_globals : + IsInGlobals globals "hex_to_address" (make_function hex_to_address). diff --git a/CoqOfPython/ethereum/cancun/utils/message.v b/CoqOfPython/ethereum/cancun/utils/message.v index b55ae28..6ba9b0f 100644 --- a/CoqOfPython/ethereum/cancun/utils/message.v +++ b/CoqOfPython/ethereum/cancun/utils/message.v @@ -267,3 +267,6 @@ Definition prepare_message : Value.t -> Value.t -> M := |) |) in M.pure Constant.None_)). + +Axiom prepare_message_in_globals : + IsInGlobals globals "prepare_message" (make_function prepare_message). diff --git a/CoqOfPython/ethereum/cancun/vm/__init__.v b/CoqOfPython/ethereum/cancun/vm/__init__.v index c02cc0a..f7252b0 100644 --- a/CoqOfPython/ethereum/cancun/vm/__init__.v +++ b/CoqOfPython/ethereum/cancun/vm/__init__.v @@ -186,6 +186,9 @@ Definition incorporate_child_on_success : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom incorporate_child_on_success_in_globals : + IsInGlobals globals "incorporate_child_on_success" (make_function incorporate_child_on_success). + Definition incorporate_child_on_error : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm"; "child_evm" ] in @@ -266,3 +269,6 @@ Definition incorporate_child_on_error : Value.t -> Value.t -> M := M.get_field (| M.get_name (| globals, locals_stack, "child_evm" |), "gas_left" |) |) in M.pure Constant.None_)). + +Axiom incorporate_child_on_error_in_globals : + IsInGlobals globals "incorporate_child_on_error" (make_function incorporate_child_on_error). diff --git a/CoqOfPython/ethereum/cancun/vm/gas.v b/CoqOfPython/ethereum/cancun/vm/gas.v index e2a9141..6f4bc91 100644 --- a/CoqOfPython/ethereum/cancun/vm/gas.v +++ b/CoqOfPython/ethereum/cancun/vm/gas.v @@ -602,6 +602,9 @@ Definition charge_gas : Value.t -> Value.t -> M := )) |) in M.pure Constant.None_)). +Axiom charge_gas_in_globals : + IsInGlobals globals "charge_gas" (make_function charge_gas). + Definition calculate_memory_gas_cost : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "size_in_bytes" ] in @@ -661,6 +664,9 @@ Definition calculate_memory_gas_cost : Value.t -> Value.t -> M := (* At stmt: unsupported node type: Try *) M.pure Constant.None_)). +Axiom calculate_memory_gas_cost_in_globals : + IsInGlobals globals "calculate_memory_gas_cost" (make_function calculate_memory_gas_cost). + Definition calculate_gas_extend_memory : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "memory"; "extensions" ] in @@ -844,6 +850,9 @@ Definition calculate_gas_extend_memory : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom calculate_gas_extend_memory_in_globals : + IsInGlobals globals "calculate_gas_extend_memory" (make_function calculate_gas_extend_memory). + Definition calculate_message_call_gas : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "value"; "gas"; "gas_left"; "memory_cost"; "extra_gas"; "call_stipend" ] in @@ -969,6 +978,9 @@ M.get_name (| globals, locals_stack, "call_stipend" |) |) in M.pure Constant.None_)). +Axiom calculate_message_call_gas_in_globals : + IsInGlobals globals "calculate_message_call_gas" (make_function calculate_message_call_gas). + Definition max_message_call_gas : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "gas" ] in @@ -997,6 +1009,9 @@ Definition max_message_call_gas : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom max_message_call_gas_in_globals : + IsInGlobals globals "max_message_call_gas" (make_function max_message_call_gas). + Definition init_code_cost : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "init_code_length" ] in @@ -1033,6 +1048,9 @@ Definition init_code_cost : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom init_code_cost_in_globals : + IsInGlobals globals "init_code_cost" (make_function init_code_cost). + Definition calculate_excess_blob_gas : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "parent_header" ] in @@ -1089,6 +1107,9 @@ Definition calculate_excess_blob_gas : Value.t -> Value.t -> M := )) |) in M.pure Constant.None_)). +Axiom calculate_excess_blob_gas_in_globals : + IsInGlobals globals "calculate_excess_blob_gas" (make_function calculate_excess_blob_gas). + Definition calculate_total_blob_gas : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "tx" ] in @@ -1147,6 +1168,9 @@ Definition calculate_total_blob_gas : Value.t -> Value.t -> M := )) |) in M.pure Constant.None_)). +Axiom calculate_total_blob_gas_in_globals : + IsInGlobals globals "calculate_total_blob_gas" (make_function calculate_total_blob_gas). + Definition calculate_blob_gas_price : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "excess_blob_gas" ] in @@ -1183,6 +1207,9 @@ Definition calculate_blob_gas_price : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom calculate_blob_gas_price_in_globals : + IsInGlobals globals "calculate_blob_gas_price" (make_function calculate_blob_gas_price). + Definition calculate_data_fee : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "excess_blob_gas"; "tx" ] in @@ -1221,3 +1248,6 @@ Definition calculate_data_fee : Value.t -> Value.t -> M := |) |) in M.pure Constant.None_)). + +Axiom calculate_data_fee_in_globals : + IsInGlobals globals "calculate_data_fee" (make_function calculate_data_fee). diff --git a/CoqOfPython/ethereum/cancun/vm/instructions/arithmetic.v b/CoqOfPython/ethereum/cancun/vm/instructions/arithmetic.v index 841636b..eab2807 100644 --- a/CoqOfPython/ethereum/cancun/vm/instructions/arithmetic.v +++ b/CoqOfPython/ethereum/cancun/vm/instructions/arithmetic.v @@ -119,6 +119,9 @@ Definition add : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom add_in_globals : + IsInGlobals globals "add" (make_function add). + Definition sub : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -186,6 +189,9 @@ Definition sub : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom sub_in_globals : + IsInGlobals globals "sub" (make_function sub). + Definition mul : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -253,6 +259,9 @@ Definition mul : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom mul_in_globals : + IsInGlobals globals "mul" (make_function mul). + Definition div : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -341,6 +350,9 @@ Definition div : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom div_in_globals : + IsInGlobals globals "div" (make_function div). + Definition sdiv : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -491,6 +503,9 @@ Definition sdiv : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom sdiv_in_globals : + IsInGlobals globals "sdiv" (make_function sdiv). + Definition mod_ : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -579,6 +594,9 @@ Definition mod_ : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom mod__in_globals : + IsInGlobals globals "mod" (make_function mod_). + Definition smod : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -696,6 +714,9 @@ Definition smod : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom smod_in_globals : + IsInGlobals globals "smod" (make_function smod). + Definition addmod : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -821,6 +842,9 @@ Definition addmod : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom addmod_in_globals : + IsInGlobals globals "addmod" (make_function addmod). + Definition mulmod : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -946,6 +970,9 @@ Definition mulmod : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom mulmod_in_globals : + IsInGlobals globals "mulmod" (make_function mulmod). + Definition exp : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -1057,6 +1084,9 @@ Definition exp : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom exp_in_globals : + IsInGlobals globals "exp" (make_function exp). + Definition signextend : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -1231,3 +1261,6 @@ Definition signextend : Value.t -> Value.t -> M := Constant.int 1 |) in M.pure Constant.None_)). + +Axiom signextend_in_globals : + IsInGlobals globals "signextend" (make_function signextend). diff --git a/CoqOfPython/ethereum/cancun/vm/instructions/bitwise.v b/CoqOfPython/ethereum/cancun/vm/instructions/bitwise.v index 63df69c..c6b1c96 100644 --- a/CoqOfPython/ethereum/cancun/vm/instructions/bitwise.v +++ b/CoqOfPython/ethereum/cancun/vm/instructions/bitwise.v @@ -97,6 +97,9 @@ Definition bitwise_and : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom bitwise_and_in_globals : + IsInGlobals globals "bitwise_and" (make_function bitwise_and). + Definition bitwise_or : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -157,6 +160,9 @@ Definition bitwise_or : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom bitwise_or_in_globals : + IsInGlobals globals "bitwise_or" (make_function bitwise_or). + Definition bitwise_xor : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -217,6 +223,9 @@ Definition bitwise_xor : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom bitwise_xor_in_globals : + IsInGlobals globals "bitwise_xor" (make_function bitwise_xor). + Definition bitwise_not : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -264,6 +273,9 @@ Definition bitwise_not : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom bitwise_not_in_globals : + IsInGlobals globals "bitwise_not" (make_function bitwise_not). + Definition get_byte : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -380,6 +392,9 @@ Definition get_byte : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom get_byte_in_globals : + IsInGlobals globals "get_byte" (make_function get_byte). + Definition bitwise_shl : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -475,6 +490,9 @@ Definition bitwise_shl : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom bitwise_shl_in_globals : + IsInGlobals globals "bitwise_shl" (make_function bitwise_shl). + Definition bitwise_shr : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -561,6 +579,9 @@ Definition bitwise_shr : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom bitwise_shr_in_globals : + IsInGlobals globals "bitwise_shr" (make_function bitwise_shr). + Definition bitwise_sar : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -674,3 +695,6 @@ Definition bitwise_sar : Value.t -> Value.t -> M := Constant.int 1 |) in M.pure Constant.None_)). + +Axiom bitwise_sar_in_globals : + IsInGlobals globals "bitwise_sar" (make_function bitwise_sar). diff --git a/CoqOfPython/ethereum/cancun/vm/instructions/block.v b/CoqOfPython/ethereum/cancun/vm/instructions/block.v index 7c09d92..5a6e0f6 100644 --- a/CoqOfPython/ethereum/cancun/vm/instructions/block.v +++ b/CoqOfPython/ethereum/cancun/vm/instructions/block.v @@ -135,6 +135,9 @@ Definition block_hash : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom block_hash_in_globals : + IsInGlobals globals "block_hash" (make_function block_hash). + Definition coinbase : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -188,6 +191,9 @@ Definition coinbase : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom coinbase_in_globals : + IsInGlobals globals "coinbase" (make_function coinbase). + Definition timestamp : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -235,6 +241,9 @@ Definition timestamp : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom timestamp_in_globals : + IsInGlobals globals "timestamp" (make_function timestamp). + Definition number : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -287,6 +296,9 @@ Definition number : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom number_in_globals : + IsInGlobals globals "number" (make_function number). + Definition prev_randao : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -339,6 +351,9 @@ Definition prev_randao : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom prev_randao_in_globals : + IsInGlobals globals "prev_randao" (make_function prev_randao). + Definition gas_limit : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -391,6 +406,9 @@ Definition gas_limit : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom gas_limit_in_globals : + IsInGlobals globals "gas_limit" (make_function gas_limit). + Definition chain_id : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -439,3 +457,6 @@ Definition chain_id : Value.t -> Value.t -> M := Constant.int 1 |) in M.pure Constant.None_)). + +Axiom chain_id_in_globals : + IsInGlobals globals "chain_id" (make_function chain_id). diff --git a/CoqOfPython/ethereum/cancun/vm/instructions/comparison.v b/CoqOfPython/ethereum/cancun/vm/instructions/comparison.v index 645ec45..956efa8 100644 --- a/CoqOfPython/ethereum/cancun/vm/instructions/comparison.v +++ b/CoqOfPython/ethereum/cancun/vm/instructions/comparison.v @@ -105,6 +105,9 @@ Definition less_than : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom less_than_in_globals : + IsInGlobals globals "less_than" (make_function less_than). + Definition signed_less_than : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -182,6 +185,9 @@ Definition signed_less_than : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom signed_less_than_in_globals : + IsInGlobals globals "signed_less_than" (make_function signed_less_than). + Definition greater_than : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -252,6 +258,9 @@ Definition greater_than : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom greater_than_in_globals : + IsInGlobals globals "greater_than" (make_function greater_than). + Definition signed_greater_than : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -329,6 +338,9 @@ Definition signed_greater_than : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom signed_greater_than_in_globals : + IsInGlobals globals "signed_greater_than" (make_function signed_greater_than). + Definition equal : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -399,6 +411,9 @@ Definition equal : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom equal_in_globals : + IsInGlobals globals "equal" (make_function equal). + Definition is_zero : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -458,3 +473,6 @@ Definition is_zero : Value.t -> Value.t -> M := Constant.int 1 |) in M.pure Constant.None_)). + +Axiom is_zero_in_globals : + IsInGlobals globals "is_zero" (make_function is_zero). diff --git a/CoqOfPython/ethereum/cancun/vm/instructions/control_flow.v b/CoqOfPython/ethereum/cancun/vm/instructions/control_flow.v index b659a5e..a584fa2 100644 --- a/CoqOfPython/ethereum/cancun/vm/instructions/control_flow.v +++ b/CoqOfPython/ethereum/cancun/vm/instructions/control_flow.v @@ -71,6 +71,9 @@ Definition stop : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom stop_in_globals : + IsInGlobals globals "stop" (make_function stop). + Definition jump : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -136,6 +139,9 @@ Definition jump : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom jump_in_globals : + IsInGlobals globals "jump" (make_function jump). + Definition jumpi : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -237,6 +243,9 @@ Definition jumpi : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom jumpi_in_globals : + IsInGlobals globals "jumpi" (make_function jumpi). + Definition pc : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -281,6 +290,9 @@ Definition pc : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom pc_in_globals : + IsInGlobals globals "pc" (make_function pc). + Definition gas_left : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -325,6 +337,9 @@ Definition gas_left : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom gas_left_in_globals : + IsInGlobals globals "gas_left" (make_function gas_left). + Definition jumpdest : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -356,3 +371,6 @@ Definition jumpdest : Value.t -> Value.t -> M := Constant.int 1 |) in M.pure Constant.None_)). + +Axiom jumpdest_in_globals : + IsInGlobals globals "jumpdest" (make_function jumpdest). diff --git a/CoqOfPython/ethereum/cancun/vm/instructions/environment.v b/CoqOfPython/ethereum/cancun/vm/instructions/environment.v index abac4b4..0532a10 100644 --- a/CoqOfPython/ethereum/cancun/vm/instructions/environment.v +++ b/CoqOfPython/ethereum/cancun/vm/instructions/environment.v @@ -126,6 +126,9 @@ Definition address : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom address_in_globals : + IsInGlobals globals "address" (make_function address). + Definition balance : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -218,6 +221,9 @@ Definition balance : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom balance_in_globals : + IsInGlobals globals "balance" (make_function balance). + Definition origin : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -262,6 +268,9 @@ Definition origin : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom origin_in_globals : + IsInGlobals globals "origin" (make_function origin). + Definition caller : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -305,6 +314,9 @@ Definition caller : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom caller_in_globals : + IsInGlobals globals "caller" (make_function caller). + Definition callvalue : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -342,6 +354,9 @@ Definition callvalue : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom callvalue_in_globals : + IsInGlobals globals "callvalue" (make_function callvalue). + Definition calldataload : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -413,6 +428,9 @@ Definition calldataload : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom calldataload_in_globals : + IsInGlobals globals "calldataload" (make_function calldataload). + Definition calldatasize : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -462,6 +480,9 @@ Definition calldatasize : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom calldatasize_in_globals : + IsInGlobals globals "calldatasize" (make_function calldatasize). + Definition calldatacopy : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -597,6 +618,9 @@ Definition calldatacopy : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom calldatacopy_in_globals : + IsInGlobals globals "calldatacopy" (make_function calldatacopy). + Definition codesize : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -646,6 +670,9 @@ Definition codesize : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom codesize_in_globals : + IsInGlobals globals "codesize" (make_function codesize). + Definition codecopy : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -781,6 +808,9 @@ Definition codecopy : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom codecopy_in_globals : + IsInGlobals globals "codecopy" (make_function codecopy). + Definition gasprice : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -824,6 +854,9 @@ Definition gasprice : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom gasprice_in_globals : + IsInGlobals globals "gasprice" (make_function gasprice). + Definition extcodesize : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -928,6 +961,9 @@ Definition extcodesize : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom extcodesize_in_globals : + IsInGlobals globals "extcodesize" (make_function extcodesize). + Definition extcodecopy : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -1122,6 +1158,9 @@ Definition extcodecopy : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom extcodecopy_in_globals : + IsInGlobals globals "extcodecopy" (make_function extcodecopy). + Definition returndatasize : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -1170,6 +1209,9 @@ Definition returndatasize : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom returndatasize_in_globals : + IsInGlobals globals "returndatasize" (make_function returndatasize). + Definition returndatacopy : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -1333,6 +1375,9 @@ Definition returndatacopy : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom returndatacopy_in_globals : + IsInGlobals globals "returndatacopy" (make_function returndatacopy). + Definition extcodehash : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -1463,6 +1508,9 @@ Definition extcodehash : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom extcodehash_in_globals : + IsInGlobals globals "extcodehash" (make_function extcodehash). + Definition self_balance : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -1511,6 +1559,9 @@ Definition self_balance : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom self_balance_in_globals : + IsInGlobals globals "self_balance" (make_function self_balance). + Definition base_fee : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -1554,6 +1605,9 @@ Definition base_fee : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom base_fee_in_globals : + IsInGlobals globals "base_fee" (make_function base_fee). + Definition blob_hash : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -1646,6 +1700,9 @@ Definition blob_hash : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom blob_hash_in_globals : + IsInGlobals globals "blob_hash" (make_function blob_hash). + Definition blob_base_fee : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -1698,3 +1755,6 @@ Definition blob_base_fee : Value.t -> Value.t -> M := Constant.int 1 |) in M.pure Constant.None_)). + +Axiom blob_base_fee_in_globals : + IsInGlobals globals "blob_base_fee" (make_function blob_base_fee). diff --git a/CoqOfPython/ethereum/cancun/vm/instructions/keccak.v b/CoqOfPython/ethereum/cancun/vm/instructions/keccak.v index 4951ae6..2a607d9 100644 --- a/CoqOfPython/ethereum/cancun/vm/instructions/keccak.v +++ b/CoqOfPython/ethereum/cancun/vm/instructions/keccak.v @@ -189,3 +189,6 @@ Definition keccak : Value.t -> Value.t -> M := Constant.int 1 |) in M.pure Constant.None_)). + +Axiom keccak_in_globals : + IsInGlobals globals "keccak" (make_function keccak). diff --git a/CoqOfPython/ethereum/cancun/vm/instructions/log.v b/CoqOfPython/ethereum/cancun/vm/instructions/log.v index 21566ee..7239f6e 100644 --- a/CoqOfPython/ethereum/cancun/vm/instructions/log.v +++ b/CoqOfPython/ethereum/cancun/vm/instructions/log.v @@ -208,6 +208,9 @@ Definition log_n : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom log_n_in_globals : + IsInGlobals globals "log_n" (make_function log_n). + Definition log0 : Value.t := M.run ltac:(M.monadic ( M.call (| M.get_name (| globals, locals_stack, "partial" |), diff --git a/CoqOfPython/ethereum/cancun/vm/instructions/memory.v b/CoqOfPython/ethereum/cancun/vm/instructions/memory.v index 876eba1..bd766f7 100644 --- a/CoqOfPython/ethereum/cancun/vm/instructions/memory.v +++ b/CoqOfPython/ethereum/cancun/vm/instructions/memory.v @@ -152,6 +152,9 @@ Definition mstore : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom mstore_in_globals : + IsInGlobals globals "mstore" (make_function mstore). + Definition mstore8 : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -256,6 +259,9 @@ Definition mstore8 : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom mstore8_in_globals : + IsInGlobals globals "mstore8" (make_function mstore8). + Definition mload : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -356,6 +362,9 @@ Definition mload : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom mload_in_globals : + IsInGlobals globals "mload" (make_function mload). + Definition msize : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -405,6 +414,9 @@ Definition msize : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom msize_in_globals : + IsInGlobals globals "msize" (make_function msize). + Definition mcopy : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -537,3 +549,6 @@ Definition mcopy : Value.t -> Value.t -> M := Constant.int 1 |) in M.pure Constant.None_)). + +Axiom mcopy_in_globals : + IsInGlobals globals "mcopy" (make_function mcopy). diff --git a/CoqOfPython/ethereum/cancun/vm/instructions/stack.v b/CoqOfPython/ethereum/cancun/vm/instructions/stack.v index 6cf72ee..0507859 100644 --- a/CoqOfPython/ethereum/cancun/vm/instructions/stack.v +++ b/CoqOfPython/ethereum/cancun/vm/instructions/stack.v @@ -82,6 +82,9 @@ Definition pop : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom pop_in_globals : + IsInGlobals globals "pop" (make_function pop). + Definition push_n : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm"; "num_bytes" ] in @@ -181,6 +184,9 @@ Definition push_n : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom push_n_in_globals : + IsInGlobals globals "push_n" (make_function push_n). + Definition dup_n : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm"; "item_number" ] in @@ -258,6 +264,9 @@ Definition dup_n : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom dup_n_in_globals : + IsInGlobals globals "dup_n" (make_function dup_n). + Definition swap_n : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm"; "item_number" ] in @@ -334,6 +343,9 @@ Definition swap_n : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom swap_n_in_globals : + IsInGlobals globals "swap_n" (make_function swap_n). + Definition push0 : Value.t := M.run ltac:(M.monadic ( M.call (| M.get_name (| globals, locals_stack, "partial" |), diff --git a/CoqOfPython/ethereum/cancun/vm/instructions/storage.v b/CoqOfPython/ethereum/cancun/vm/instructions/storage.v index 1043ae7..b6f29ff 100644 --- a/CoqOfPython/ethereum/cancun/vm/instructions/storage.v +++ b/CoqOfPython/ethereum/cancun/vm/instructions/storage.v @@ -156,6 +156,9 @@ Definition sload : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom sload_in_globals : + IsInGlobals globals "sload" (make_function sload). + Definition sstore : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -498,6 +501,9 @@ Definition sstore : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom sstore_in_globals : + IsInGlobals globals "sstore" (make_function sstore). + Definition tload : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -559,6 +565,9 @@ Definition tload : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom tload_in_globals : + IsInGlobals globals "tload" (make_function tload). + Definition tstore : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -626,3 +635,6 @@ Definition tstore : Value.t -> Value.t -> M := Constant.int 1 |) in M.pure Constant.None_)). + +Axiom tstore_in_globals : + IsInGlobals globals "tstore" (make_function tstore). diff --git a/CoqOfPython/ethereum/cancun/vm/instructions/system.v b/CoqOfPython/ethereum/cancun/vm/instructions/system.v index 3ef8d6f..ccd8b32 100644 --- a/CoqOfPython/ethereum/cancun/vm/instructions/system.v +++ b/CoqOfPython/ethereum/cancun/vm/instructions/system.v @@ -409,6 +409,9 @@ Definition generic_create : Value.t -> Value.t -> M := )) |) in M.pure Constant.None_)). +Axiom generic_create_in_globals : + IsInGlobals globals "generic_create" (make_function generic_create). + Definition create : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -539,6 +542,9 @@ Definition create : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom create_in_globals : + IsInGlobals globals "create" (make_function create). + Definition create2 : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -713,6 +719,9 @@ Definition create2 : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom create2_in_globals : + IsInGlobals globals "create2" (make_function create2). + Definition return_ : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -796,6 +805,9 @@ Definition return_ : Value.t -> Value.t -> M := let _ := M.pass (| |) in M.pure Constant.None_)). +Axiom return__in_globals : + IsInGlobals globals "return_" (make_function return_). + Definition generic_call : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm"; "gas"; "value"; "caller"; "to"; "code_address"; "should_transfer_value"; "is_staticcall"; "memory_input_start_position"; "memory_input_size"; "memory_output_start_position"; "memory_output_size" ] in @@ -991,6 +1003,9 @@ Definition generic_call : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom generic_call_in_globals : + IsInGlobals globals "generic_call" (make_function generic_call). + Definition call : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -1324,6 +1339,9 @@ M.get_name (| globals, locals_stack, "GAS_CALL_VALUE" |) |) in M.pure Constant.None_)). +Axiom call_in_globals : + IsInGlobals globals "call" (make_function call). + Definition callcode : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -1602,6 +1620,9 @@ M.get_name (| globals, locals_stack, "GAS_CALL_VALUE" |) |) in M.pure Constant.None_)). +Axiom callcode_in_globals : + IsInGlobals globals "callcode" (make_function callcode). + Definition selfdestruct : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -1807,6 +1828,9 @@ Definition selfdestruct : Value.t -> Value.t -> M := let _ := M.pass (| |) in M.pure Constant.None_)). +Axiom selfdestruct_in_globals : + IsInGlobals globals "selfdestruct" (make_function selfdestruct). + Definition delegatecall : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -2004,6 +2028,9 @@ Definition delegatecall : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom delegatecall_in_globals : + IsInGlobals globals "delegatecall" (make_function delegatecall). + Definition staticcall : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -2207,6 +2234,9 @@ Definition staticcall : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom staticcall_in_globals : + IsInGlobals globals "staticcall" (make_function staticcall). + Definition revert : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -2293,3 +2323,6 @@ Definition revert : Value.t -> Value.t -> M := let _ := M.raise (| Some (M.get_name (| globals, locals_stack, "Revert" |)) |) in let _ := M.pass (| |) in M.pure Constant.None_)). + +Axiom revert_in_globals : + IsInGlobals globals "revert" (make_function revert). diff --git a/CoqOfPython/ethereum/cancun/vm/interpreter.v b/CoqOfPython/ethereum/cancun/vm/interpreter.v index cb7f0df..897386b 100644 --- a/CoqOfPython/ethereum/cancun/vm/interpreter.v +++ b/CoqOfPython/ethereum/cancun/vm/interpreter.v @@ -408,6 +408,9 @@ Definition process_message_call : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom process_message_call_in_globals : + IsInGlobals globals "process_message_call" (make_function process_message_call). + Definition process_create_message : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "message"; "env" ] in @@ -512,6 +515,9 @@ Definition process_create_message : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom process_create_message_in_globals : + IsInGlobals globals "process_create_message" (make_function process_create_message). + Definition process_message : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "message"; "env" ] in @@ -640,6 +646,9 @@ Definition process_message : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom process_message_in_globals : + IsInGlobals globals "process_message" (make_function process_message). + Definition execute_code : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "message"; "env" ] in @@ -686,3 +695,6 @@ Definition execute_code : Value.t -> Value.t -> M := M.get_name (| globals, locals_stack, "evm" |) |) in M.pure Constant.None_)). + +Axiom execute_code_in_globals : + IsInGlobals globals "execute_code" (make_function execute_code). diff --git a/CoqOfPython/ethereum/cancun/vm/memory.v b/CoqOfPython/ethereum/cancun/vm/memory.v index 8c8d7b2..e34222c 100644 --- a/CoqOfPython/ethereum/cancun/vm/memory.v +++ b/CoqOfPython/ethereum/cancun/vm/memory.v @@ -71,6 +71,9 @@ Definition memory_write : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom memory_write_in_globals : + IsInGlobals globals "memory_write" (make_function memory_write). + Definition memory_read_bytes : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "memory"; "start_position"; "size" ] in @@ -117,6 +120,9 @@ Definition memory_read_bytes : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom memory_read_bytes_in_globals : + IsInGlobals globals "memory_read_bytes" (make_function memory_read_bytes). + Definition buffer_read : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "buffer"; "start_position"; "size" ] in @@ -169,3 +175,6 @@ Definition buffer_read : Value.t -> Value.t -> M := |) |) in M.pure Constant.None_)). + +Axiom buffer_read_in_globals : + IsInGlobals globals "buffer_read" (make_function buffer_read). diff --git a/CoqOfPython/ethereum/cancun/vm/precompiled_contracts/alt_bn128.v b/CoqOfPython/ethereum/cancun/vm/precompiled_contracts/alt_bn128.v index 53fc9cd..704b817 100644 --- a/CoqOfPython/ethereum/cancun/vm/precompiled_contracts/alt_bn128.v +++ b/CoqOfPython/ethereum/cancun/vm/precompiled_contracts/alt_bn128.v @@ -273,6 +273,9 @@ Definition alt_bn128_add : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom alt_bn128_add_in_globals : + IsInGlobals globals "alt_bn128_add" (make_function alt_bn128_add). + Definition alt_bn128_mul : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -455,6 +458,9 @@ Definition alt_bn128_mul : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom alt_bn128_mul_in_globals : + IsInGlobals globals "alt_bn128_mul" (make_function alt_bn128_mul). + Definition alt_bn128_pairing_check : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -781,3 +787,6 @@ Definition alt_bn128_pairing_check : Value.t -> Value.t -> M := M.pure Constant.None_ )) |) in M.pure Constant.None_)). + +Axiom alt_bn128_pairing_check_in_globals : + IsInGlobals globals "alt_bn128_pairing_check" (make_function alt_bn128_pairing_check). diff --git a/CoqOfPython/ethereum/cancun/vm/precompiled_contracts/blake2f.v b/CoqOfPython/ethereum/cancun/vm/precompiled_contracts/blake2f.v index cf7db0e..49bba15 100644 --- a/CoqOfPython/ethereum/cancun/vm/precompiled_contracts/blake2f.v +++ b/CoqOfPython/ethereum/cancun/vm/precompiled_contracts/blake2f.v @@ -128,3 +128,6 @@ Definition blake2f : Value.t -> Value.t -> M := |) |) in M.pure Constant.None_)). + +Axiom blake2f_in_globals : + IsInGlobals globals "blake2f" (make_function blake2f). diff --git a/CoqOfPython/ethereum/cancun/vm/precompiled_contracts/ecrecover.v b/CoqOfPython/ethereum/cancun/vm/precompiled_contracts/ecrecover.v index 399b13b..d240c77 100644 --- a/CoqOfPython/ethereum/cancun/vm/precompiled_contracts/ecrecover.v +++ b/CoqOfPython/ethereum/cancun/vm/precompiled_contracts/ecrecover.v @@ -302,3 +302,6 @@ Definition ecrecover : Value.t -> Value.t -> M := M.get_name (| globals, locals_stack, "padded_address" |) |) in M.pure Constant.None_)). + +Axiom ecrecover_in_globals : + IsInGlobals globals "ecrecover" (make_function ecrecover). diff --git a/CoqOfPython/ethereum/cancun/vm/precompiled_contracts/identity.v b/CoqOfPython/ethereum/cancun/vm/precompiled_contracts/identity.v index 8289b55..2bb9e6d 100644 --- a/CoqOfPython/ethereum/cancun/vm/precompiled_contracts/identity.v +++ b/CoqOfPython/ethereum/cancun/vm/precompiled_contracts/identity.v @@ -95,3 +95,6 @@ Definition identity : Value.t -> Value.t -> M := M.get_name (| globals, locals_stack, "data" |) |) in M.pure Constant.None_)). + +Axiom identity_in_globals : + IsInGlobals globals "identity" (make_function identity). diff --git a/CoqOfPython/ethereum/cancun/vm/precompiled_contracts/modexp.v b/CoqOfPython/ethereum/cancun/vm/precompiled_contracts/modexp.v index aa48ec1..01942b6 100644 --- a/CoqOfPython/ethereum/cancun/vm/precompiled_contracts/modexp.v +++ b/CoqOfPython/ethereum/cancun/vm/precompiled_contracts/modexp.v @@ -356,6 +356,9 @@ Definition modexp : Value.t -> Value.t -> M := )) |) in M.pure Constant.None_)). +Axiom modexp_in_globals : + IsInGlobals globals "modexp" (make_function modexp). + Definition complexity : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "base_length"; "modulus_length" ] in @@ -419,6 +422,9 @@ Definition complexity : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom complexity_in_globals : + IsInGlobals globals "complexity" (make_function complexity). + Definition iterations : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "exponent_length"; "exponent_head" ] in @@ -600,6 +606,9 @@ Definition iterations : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom iterations_in_globals : + IsInGlobals globals "iterations" (make_function iterations). + Definition gas_cost : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "base_length"; "modulus_length"; "exponent_length"; "exponent_head" ] in @@ -680,3 +689,6 @@ Definition gas_cost : Value.t -> Value.t -> M := |) |) in M.pure Constant.None_)). + +Axiom gas_cost_in_globals : + IsInGlobals globals "gas_cost" (make_function gas_cost). diff --git a/CoqOfPython/ethereum/cancun/vm/precompiled_contracts/point_evaluation.v b/CoqOfPython/ethereum/cancun/vm/precompiled_contracts/point_evaluation.v index 857f687..ff9e10f 100644 --- a/CoqOfPython/ethereum/cancun/vm/precompiled_contracts/point_evaluation.v +++ b/CoqOfPython/ethereum/cancun/vm/precompiled_contracts/point_evaluation.v @@ -211,3 +211,6 @@ Definition point_evaluation : Value.t -> Value.t -> M := |) |) in M.pure Constant.None_)). + +Axiom point_evaluation_in_globals : + IsInGlobals globals "point_evaluation" (make_function point_evaluation). diff --git a/CoqOfPython/ethereum/cancun/vm/precompiled_contracts/ripemd160.v b/CoqOfPython/ethereum/cancun/vm/precompiled_contracts/ripemd160.v index 9b8920d..55e0f84 100644 --- a/CoqOfPython/ethereum/cancun/vm/precompiled_contracts/ripemd160.v +++ b/CoqOfPython/ethereum/cancun/vm/precompiled_contracts/ripemd160.v @@ -126,3 +126,6 @@ Definition ripemd160 : Value.t -> Value.t -> M := M.get_name (| globals, locals_stack, "padded_hash" |) |) in M.pure Constant.None_)). + +Axiom ripemd160_in_globals : + IsInGlobals globals "ripemd160" (make_function ripemd160). diff --git a/CoqOfPython/ethereum/cancun/vm/precompiled_contracts/sha256.v b/CoqOfPython/ethereum/cancun/vm/precompiled_contracts/sha256.v index 383000d..fb06664 100644 --- a/CoqOfPython/ethereum/cancun/vm/precompiled_contracts/sha256.v +++ b/CoqOfPython/ethereum/cancun/vm/precompiled_contracts/sha256.v @@ -107,3 +107,6 @@ Definition sha256 : Value.t -> Value.t -> M := |) |) in M.pure Constant.None_)). + +Axiom sha256_in_globals : + IsInGlobals globals "sha256" (make_function sha256). diff --git a/CoqOfPython/ethereum/cancun/vm/runtime.v b/CoqOfPython/ethereum/cancun/vm/runtime.v index 1b9c307..4890074 100644 --- a/CoqOfPython/ethereum/cancun/vm/runtime.v +++ b/CoqOfPython/ethereum/cancun/vm/runtime.v @@ -158,3 +158,6 @@ Definition get_valid_jump_destinations : Value.t -> Value.t -> M := M.get_name (| globals, locals_stack, "valid_jump_destinations" |) |) in M.pure Constant.None_)). + +Axiom get_valid_jump_destinations_in_globals : + IsInGlobals globals "get_valid_jump_destinations" (make_function get_valid_jump_destinations). diff --git a/CoqOfPython/ethereum/cancun/vm/stack.v b/CoqOfPython/ethereum/cancun/vm/stack.v index d284bd8..1c3da90 100644 --- a/CoqOfPython/ethereum/cancun/vm/stack.v +++ b/CoqOfPython/ethereum/cancun/vm/stack.v @@ -78,6 +78,9 @@ Definition pop : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom pop_in_globals : + IsInGlobals globals "pop" (make_function pop). + Definition push : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "stack"; "value" ] in @@ -125,3 +128,6 @@ Definition push : Value.t -> Value.t -> M := |) |) in M.pure Constant.None_)). + +Axiom push_in_globals : + IsInGlobals globals "push" (make_function push). diff --git a/CoqOfPython/ethereum/constantinople/bloom.v b/CoqOfPython/ethereum/constantinople/bloom.v index a7f9abc..c13e296 100644 --- a/CoqOfPython/ethereum/constantinople/bloom.v +++ b/CoqOfPython/ethereum/constantinople/bloom.v @@ -140,6 +140,9 @@ Definition add_to_bloom : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom add_to_bloom_in_globals : + IsInGlobals globals "add_to_bloom" (make_function add_to_bloom). + Definition logs_bloom : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "logs" ] in @@ -209,3 +212,6 @@ Definition logs_bloom : Value.t -> Value.t -> M := |) |) in M.pure Constant.None_)). + +Axiom logs_bloom_in_globals : + IsInGlobals globals "logs_bloom" (make_function logs_bloom). diff --git a/CoqOfPython/ethereum/constantinople/fork.v b/CoqOfPython/ethereum/constantinople/fork.v index 7459441..245bd87 100644 --- a/CoqOfPython/ethereum/constantinople/fork.v +++ b/CoqOfPython/ethereum/constantinople/fork.v @@ -229,6 +229,9 @@ Definition apply_fork : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom apply_fork_in_globals : + IsInGlobals globals "apply_fork" (make_function apply_fork). + Definition get_last_256_block_hashes : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "chain" ] in @@ -341,6 +344,9 @@ Definition get_last_256_block_hashes : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom get_last_256_block_hashes_in_globals : + IsInGlobals globals "get_last_256_block_hashes" (make_function get_last_256_block_hashes). + Definition state_transition : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "chain"; "block" ] in @@ -508,6 +514,9 @@ Definition state_transition : Value.t -> Value.t -> M := )) |) in M.pure Constant.None_)). +Axiom state_transition_in_globals : + IsInGlobals globals "state_transition" (make_function state_transition). + Definition validate_header : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "header"; "parent_header" ] in @@ -654,6 +663,9 @@ Definition validate_header : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom validate_header_in_globals : + IsInGlobals globals "validate_header" (make_function validate_header). + Definition generate_header_hash_for_pow : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "header" ] in @@ -709,6 +721,9 @@ Definition generate_header_hash_for_pow : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom generate_header_hash_for_pow_in_globals : + IsInGlobals globals "generate_header_hash_for_pow" (make_function generate_header_hash_for_pow). + Definition validate_proof_of_work : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "header" ] in @@ -799,6 +814,9 @@ Definition validate_proof_of_work : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom validate_proof_of_work_in_globals : + IsInGlobals globals "validate_proof_of_work" (make_function validate_proof_of_work). + Definition check_transaction : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "tx"; "gas_available"; "chain_id" ] in @@ -852,6 +870,9 @@ Definition check_transaction : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom check_transaction_in_globals : + IsInGlobals globals "check_transaction" (make_function check_transaction). + Definition make_receipt : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "tx"; "error"; "cumulative_gas_used"; "logs" ] in @@ -889,6 +910,9 @@ Definition make_receipt : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom make_receipt_in_globals : + IsInGlobals globals "make_receipt" (make_function make_receipt). + Definition ApplyBodyOutput : Value.t := builtins.make_klass [] @@ -1126,6 +1150,9 @@ Definition apply_body : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom apply_body_in_globals : + IsInGlobals globals "apply_body" (make_function apply_body). + Definition validate_ommers : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "ommers"; "block_header"; "chain" ] in @@ -1447,6 +1474,9 @@ Definition validate_ommers : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom validate_ommers_in_globals : + IsInGlobals globals "validate_ommers" (make_function validate_ommers). + Definition pay_rewards : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "state"; "block_number"; "coinbase"; "ommers" ] in @@ -1552,6 +1582,9 @@ Definition pay_rewards : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom pay_rewards_in_globals : + IsInGlobals globals "pay_rewards" (make_function pay_rewards). + Definition process_transaction : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "env"; "tx" ] in @@ -1919,6 +1952,9 @@ Definition process_transaction : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom process_transaction_in_globals : + IsInGlobals globals "process_transaction" (make_function process_transaction). + Definition validate_transaction : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "tx" ] in @@ -1975,6 +2011,9 @@ Definition validate_transaction : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom validate_transaction_in_globals : + IsInGlobals globals "validate_transaction" (make_function validate_transaction). + Definition calculate_intrinsic_cost : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "tx" ] in @@ -2085,6 +2124,9 @@ Definition calculate_intrinsic_cost : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom calculate_intrinsic_cost_in_globals : + IsInGlobals globals "calculate_intrinsic_cost" (make_function calculate_intrinsic_cost). + Definition recover_sender : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "chain_id"; "tx" ] in @@ -2281,6 +2323,9 @@ Definition recover_sender : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom recover_sender_in_globals : + IsInGlobals globals "recover_sender" (make_function recover_sender). + Definition signing_hash_pre155 : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "tx" ] in @@ -2315,6 +2360,9 @@ Definition signing_hash_pre155 : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom signing_hash_pre155_in_globals : + IsInGlobals globals "signing_hash_pre155" (make_function signing_hash_pre155). + Definition signing_hash_155 : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "tx"; "chain_id" ] in @@ -2363,6 +2411,9 @@ Definition signing_hash_155 : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom signing_hash_155_in_globals : + IsInGlobals globals "signing_hash_155" (make_function signing_hash_155). + Definition compute_header_hash : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "header" ] in @@ -2415,6 +2466,9 @@ Definition compute_header_hash : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom compute_header_hash_in_globals : + IsInGlobals globals "compute_header_hash" (make_function compute_header_hash). + Definition check_gas_limit : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "gas_limit"; "parent_gas_limit" ] in @@ -2515,6 +2569,9 @@ Definition check_gas_limit : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom check_gas_limit_in_globals : + IsInGlobals globals "check_gas_limit" (make_function check_gas_limit). + Definition calculate_block_difficulty : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "block_number"; "block_timestamp"; "parent_timestamp"; "parent_difficulty"; "parent_has_ommers" ] in @@ -2675,3 +2732,6 @@ Constant.int 1 |) |) in M.pure Constant.None_)). + +Axiom calculate_block_difficulty_in_globals : + IsInGlobals globals "calculate_block_difficulty" (make_function calculate_block_difficulty). diff --git a/CoqOfPython/ethereum/constantinople/fork_types.v b/CoqOfPython/ethereum/constantinople/fork_types.v index b0fd4d6..269cc60 100644 --- a/CoqOfPython/ethereum/constantinople/fork_types.v +++ b/CoqOfPython/ethereum/constantinople/fork_types.v @@ -99,3 +99,6 @@ Definition encode_account : Value.t -> Value.t -> M := |) |) in M.pure Constant.None_)). + +Axiom encode_account_in_globals : + IsInGlobals globals "encode_account" (make_function encode_account). diff --git a/CoqOfPython/ethereum/constantinople/state.v b/CoqOfPython/ethereum/constantinople/state.v index c3780db..74dc7a7 100644 --- a/CoqOfPython/ethereum/constantinople/state.v +++ b/CoqOfPython/ethereum/constantinople/state.v @@ -97,6 +97,9 @@ Definition close_state : Value.t -> Value.t -> M := let _ := M.delete (| M.get_field (| M.get_name (| globals, locals_stack, "state" |), "_snapshots" |) |) in M.pure Constant.None_)). +Axiom close_state_in_globals : + IsInGlobals globals "close_state" (make_function close_state). + Definition begin_transaction : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "state" ] in @@ -127,6 +130,9 @@ Definition begin_transaction : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom begin_transaction_in_globals : + IsInGlobals globals "begin_transaction" (make_function begin_transaction). + Definition commit_transaction : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "state" ] in @@ -146,6 +152,9 @@ Definition commit_transaction : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom commit_transaction_in_globals : + IsInGlobals globals "commit_transaction" (make_function commit_transaction). + Definition rollback_transaction : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "state" ] in @@ -169,6 +178,9 @@ Definition rollback_transaction : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom rollback_transaction_in_globals : + IsInGlobals globals "rollback_transaction" (make_function rollback_transaction). + Definition get_account : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "state"; "address" ] in @@ -229,6 +241,9 @@ Definition get_account : Value.t -> Value.t -> M := )) |) in M.pure Constant.None_)). +Axiom get_account_in_globals : + IsInGlobals globals "get_account" (make_function get_account). + Definition get_account_optional : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "state"; "address" ] in @@ -265,6 +280,9 @@ Definition get_account_optional : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom get_account_optional_in_globals : + IsInGlobals globals "get_account_optional" (make_function get_account_optional). + Definition set_account : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "state"; "address"; "account" ] in @@ -293,6 +311,9 @@ Definition set_account : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom set_account_in_globals : + IsInGlobals globals "set_account" (make_function set_account). + Definition destroy_account : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "state"; "address" ] in @@ -330,6 +351,9 @@ Definition destroy_account : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom destroy_account_in_globals : + IsInGlobals globals "destroy_account" (make_function destroy_account). + Definition destroy_storage : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "state"; "address" ] in @@ -364,6 +388,9 @@ Definition destroy_storage : Value.t -> Value.t -> M := )) |) in M.pure Constant.None_)). +Axiom destroy_storage_in_globals : + IsInGlobals globals "destroy_storage" (make_function destroy_storage). + Definition get_storage : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "state"; "address"; "key" ] in @@ -443,6 +470,9 @@ Definition get_storage : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom get_storage_in_globals : + IsInGlobals globals "get_storage" (make_function get_storage). + Definition set_storage : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "state"; "address"; "key"; "value" ] in @@ -541,6 +571,9 @@ Definition set_storage : Value.t -> Value.t -> M := )) |) in M.pure Constant.None_)). +Axiom set_storage_in_globals : + IsInGlobals globals "set_storage" (make_function set_storage). + Definition storage_root : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "state"; "address" ] in @@ -592,6 +625,9 @@ Definition storage_root : Value.t -> Value.t -> M := )) |) in M.pure Constant.None_)). +Axiom storage_root_in_globals : + IsInGlobals globals "storage_root" (make_function storage_root). + Definition state_root : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "state" ] in @@ -622,6 +658,9 @@ Definition state_root : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom state_root_in_globals : + IsInGlobals globals "state_root" (make_function state_root). + Definition account_exists : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "state"; "address" ] in @@ -656,6 +695,9 @@ Definition account_exists : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom account_exists_in_globals : + IsInGlobals globals "account_exists" (make_function account_exists). + Definition account_has_code_or_nonce : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "state"; "address" ] in @@ -709,6 +751,9 @@ Definition account_has_code_or_nonce : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom account_has_code_or_nonce_in_globals : + IsInGlobals globals "account_has_code_or_nonce" (make_function account_has_code_or_nonce). + Definition is_account_empty : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "state"; "address" ] in @@ -770,6 +815,9 @@ Definition is_account_empty : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom is_account_empty_in_globals : + IsInGlobals globals "is_account_empty" (make_function is_account_empty). + Definition account_exists_and_is_empty : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "state"; "address" ] in @@ -840,6 +888,9 @@ Definition account_exists_and_is_empty : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom account_exists_and_is_empty_in_globals : + IsInGlobals globals "account_exists_and_is_empty" (make_function account_exists_and_is_empty). + Definition is_account_alive : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "state"; "address" ] in @@ -917,6 +968,9 @@ Definition is_account_alive : Value.t -> Value.t -> M := )) |) in M.pure Constant.None_)). +Axiom is_account_alive_in_globals : + IsInGlobals globals "is_account_alive" (make_function is_account_alive). + Definition modify_state : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "state"; "address"; "f" ] in @@ -949,6 +1003,9 @@ Definition modify_state : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom modify_state_in_globals : + IsInGlobals globals "modify_state" (make_function modify_state). + Definition move_ether : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "state"; "sender_address"; "recipient_address"; "amount" ] in @@ -978,6 +1035,9 @@ Definition move_ether : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom move_ether_in_globals : + IsInGlobals globals "move_ether" (make_function move_ether). + Definition set_account_balance : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "state"; "address"; "amount" ] in @@ -1008,6 +1068,9 @@ Definition set_account_balance : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom set_account_balance_in_globals : + IsInGlobals globals "set_account_balance" (make_function set_account_balance). + Definition touch_account : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "state"; "address" ] in @@ -1052,6 +1115,9 @@ Definition touch_account : Value.t -> Value.t -> M := )) |) in M.pure Constant.None_)). +Axiom touch_account_in_globals : + IsInGlobals globals "touch_account" (make_function touch_account). + Definition increment_nonce : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "state"; "address" ] in @@ -1079,6 +1145,9 @@ Definition increment_nonce : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom increment_nonce_in_globals : + IsInGlobals globals "increment_nonce" (make_function increment_nonce). + Definition set_code : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "state"; "address"; "code" ] in @@ -1109,6 +1178,9 @@ Definition set_code : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom set_code_in_globals : + IsInGlobals globals "set_code" (make_function set_code). + Definition create_ether : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "state"; "address"; "amount" ] in @@ -1136,3 +1208,6 @@ Definition create_ether : Value.t -> Value.t -> M := make_dict [] |) in M.pure Constant.None_)). + +Axiom create_ether_in_globals : + IsInGlobals globals "create_ether" (make_function create_ether). diff --git a/CoqOfPython/ethereum/constantinople/trie.v b/CoqOfPython/ethereum/constantinople/trie.v index 61ed486..44509df 100644 --- a/CoqOfPython/ethereum/constantinople/trie.v +++ b/CoqOfPython/ethereum/constantinople/trie.v @@ -365,6 +365,9 @@ Definition encode_internal_node : Value.t -> Value.t -> M := )) |) in M.pure Constant.None_)). +Axiom encode_internal_node_in_globals : + IsInGlobals globals "encode_internal_node" (make_function encode_internal_node). + Definition encode_node : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "node"; "storage_root" ] in @@ -473,6 +476,9 @@ Definition encode_node : Value.t -> Value.t -> M := )) |) in M.pure Constant.None_)). +Axiom encode_node_in_globals : + IsInGlobals globals "encode_node" (make_function encode_node). + Definition Trie : Value.t := builtins.make_klass [(* At base: unsupported node type: Subscript *)] @@ -520,6 +526,9 @@ Definition copy_trie : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom copy_trie_in_globals : + IsInGlobals globals "copy_trie" (make_function copy_trie). + Definition trie_set : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "trie"; "key"; "value" ] in @@ -580,6 +589,9 @@ Definition trie_set : Value.t -> Value.t -> M := )) |) in M.pure Constant.None_)). +Axiom trie_set_in_globals : + IsInGlobals globals "trie_set" (make_function trie_set). + Definition trie_get : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "trie"; "key" ] in @@ -613,6 +625,9 @@ Definition trie_get : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom trie_get_in_globals : + IsInGlobals globals "trie_get" (make_function trie_get). + Definition common_prefix_length : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "a"; "b" ] in @@ -691,6 +706,9 @@ Definition common_prefix_length : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom common_prefix_length_in_globals : + IsInGlobals globals "common_prefix_length" (make_function common_prefix_length). + Definition nibble_list_to_compact : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "x"; "is_leaf" ] in @@ -899,6 +917,9 @@ Definition nibble_list_to_compact : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom nibble_list_to_compact_in_globals : + IsInGlobals globals "nibble_list_to_compact" (make_function nibble_list_to_compact). + Definition bytes_to_nibble_list : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "bytes_" ] in @@ -995,6 +1016,9 @@ Definition bytes_to_nibble_list : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom bytes_to_nibble_list_in_globals : + IsInGlobals globals "bytes_to_nibble_list" (make_function bytes_to_nibble_list). + Definition _prepare_trie : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "trie"; "get_storage_root" ] in @@ -1146,6 +1170,9 @@ Definition _prepare_trie : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom _prepare_trie_in_globals : + IsInGlobals globals "_prepare_trie" (make_function _prepare_trie). + Definition root : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "trie"; "get_storage_root" ] in @@ -1261,6 +1288,9 @@ Definition root : Value.t -> Value.t -> M := )) |) in M.pure Constant.None_)). +Axiom root_in_globals : + IsInGlobals globals "root" (make_function root). + Definition patricialize : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "obj"; "level" ] in @@ -1600,3 +1630,6 @@ Definition patricialize : Value.t -> Value.t -> M := |) |) in M.pure Constant.None_)). + +Axiom patricialize_in_globals : + IsInGlobals globals "patricialize" (make_function patricialize). diff --git a/CoqOfPython/ethereum/constantinople/utils/address.v b/CoqOfPython/ethereum/constantinople/utils/address.v index d255ebe..d795e50 100644 --- a/CoqOfPython/ethereum/constantinople/utils/address.v +++ b/CoqOfPython/ethereum/constantinople/utils/address.v @@ -79,6 +79,9 @@ Definition to_address : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom to_address_in_globals : + IsInGlobals globals "to_address" (make_function to_address). + Definition compute_contract_address : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "address"; "nonce" ] in @@ -149,6 +152,9 @@ Definition compute_contract_address : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom compute_contract_address_in_globals : + IsInGlobals globals "compute_contract_address" (make_function compute_contract_address). + Definition compute_create2_contract_address : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "address"; "salt"; "call_data" ] in @@ -230,3 +236,6 @@ Definition compute_create2_contract_address : Value.t -> Value.t -> M := |) |) in M.pure Constant.None_)). + +Axiom compute_create2_contract_address_in_globals : + IsInGlobals globals "compute_create2_contract_address" (make_function compute_create2_contract_address). diff --git a/CoqOfPython/ethereum/constantinople/utils/hexadecimal.v b/CoqOfPython/ethereum/constantinople/utils/hexadecimal.v index 04eb76a..87a236a 100644 --- a/CoqOfPython/ethereum/constantinople/utils/hexadecimal.v +++ b/CoqOfPython/ethereum/constantinople/utils/hexadecimal.v @@ -70,6 +70,9 @@ Definition hex_to_root : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom hex_to_root_in_globals : + IsInGlobals globals "hex_to_root" (make_function hex_to_root). + Definition hex_to_bloom : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "hex_string" ] in @@ -110,6 +113,9 @@ Definition hex_to_bloom : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom hex_to_bloom_in_globals : + IsInGlobals globals "hex_to_bloom" (make_function hex_to_bloom). + Definition hex_to_address : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "hex_string" ] in @@ -156,3 +162,6 @@ Definition hex_to_address : Value.t -> Value.t -> M := |) |) in M.pure Constant.None_)). + +Axiom hex_to_address_in_globals : + IsInGlobals globals "hex_to_address" (make_function hex_to_address). diff --git a/CoqOfPython/ethereum/constantinople/utils/message.v b/CoqOfPython/ethereum/constantinople/utils/message.v index 6c0733c..730d879 100644 --- a/CoqOfPython/ethereum/constantinople/utils/message.v +++ b/CoqOfPython/ethereum/constantinople/utils/message.v @@ -213,3 +213,6 @@ Definition prepare_message : Value.t -> Value.t -> M := |) |) in M.pure Constant.None_)). + +Axiom prepare_message_in_globals : + IsInGlobals globals "prepare_message" (make_function prepare_message). diff --git a/CoqOfPython/ethereum/constantinople/vm/__init__.v b/CoqOfPython/ethereum/constantinople/vm/__init__.v index c15b0e0..abac4a2 100644 --- a/CoqOfPython/ethereum/constantinople/vm/__init__.v +++ b/CoqOfPython/ethereum/constantinople/vm/__init__.v @@ -164,6 +164,9 @@ Definition incorporate_child_on_success : Value.t -> Value.t -> M := )) |) in M.pure Constant.None_)). +Axiom incorporate_child_on_success_in_globals : + IsInGlobals globals "incorporate_child_on_success" (make_function incorporate_child_on_success). + Definition incorporate_child_on_error : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm"; "child_evm" ] in @@ -244,3 +247,6 @@ Definition incorporate_child_on_error : Value.t -> Value.t -> M := M.get_field (| M.get_name (| globals, locals_stack, "child_evm" |), "gas_left" |) |) in M.pure Constant.None_)). + +Axiom incorporate_child_on_error_in_globals : + IsInGlobals globals "incorporate_child_on_error" (make_function incorporate_child_on_error). diff --git a/CoqOfPython/ethereum/constantinople/vm/gas.v b/CoqOfPython/ethereum/constantinople/vm/gas.v index a06b70c..c08c6d4 100644 --- a/CoqOfPython/ethereum/constantinople/vm/gas.v +++ b/CoqOfPython/ethereum/constantinople/vm/gas.v @@ -533,6 +533,9 @@ Definition charge_gas : Value.t -> Value.t -> M := )) |) in M.pure Constant.None_)). +Axiom charge_gas_in_globals : + IsInGlobals globals "charge_gas" (make_function charge_gas). + Definition calculate_memory_gas_cost : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "size_in_bytes" ] in @@ -592,6 +595,9 @@ Definition calculate_memory_gas_cost : Value.t -> Value.t -> M := (* At stmt: unsupported node type: Try *) M.pure Constant.None_)). +Axiom calculate_memory_gas_cost_in_globals : + IsInGlobals globals "calculate_memory_gas_cost" (make_function calculate_memory_gas_cost). + Definition calculate_gas_extend_memory : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "memory"; "extensions" ] in @@ -775,6 +781,9 @@ Definition calculate_gas_extend_memory : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom calculate_gas_extend_memory_in_globals : + IsInGlobals globals "calculate_gas_extend_memory" (make_function calculate_gas_extend_memory). + Definition calculate_message_call_gas : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "value"; "gas"; "gas_left"; "memory_cost"; "extra_gas"; "call_stipend" ] in @@ -900,6 +909,9 @@ M.get_name (| globals, locals_stack, "call_stipend" |) |) in M.pure Constant.None_)). +Axiom calculate_message_call_gas_in_globals : + IsInGlobals globals "calculate_message_call_gas" (make_function calculate_message_call_gas). + Definition max_message_call_gas : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "gas" ] in @@ -927,3 +939,6 @@ Definition max_message_call_gas : Value.t -> Value.t -> M := |) |) in M.pure Constant.None_)). + +Axiom max_message_call_gas_in_globals : + IsInGlobals globals "max_message_call_gas" (make_function max_message_call_gas). diff --git a/CoqOfPython/ethereum/constantinople/vm/instructions/arithmetic.v b/CoqOfPython/ethereum/constantinople/vm/instructions/arithmetic.v index e315e63..2759a37 100644 --- a/CoqOfPython/ethereum/constantinople/vm/instructions/arithmetic.v +++ b/CoqOfPython/ethereum/constantinople/vm/instructions/arithmetic.v @@ -119,6 +119,9 @@ Definition add : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom add_in_globals : + IsInGlobals globals "add" (make_function add). + Definition sub : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -186,6 +189,9 @@ Definition sub : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom sub_in_globals : + IsInGlobals globals "sub" (make_function sub). + Definition mul : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -253,6 +259,9 @@ Definition mul : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom mul_in_globals : + IsInGlobals globals "mul" (make_function mul). + Definition div : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -341,6 +350,9 @@ Definition div : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom div_in_globals : + IsInGlobals globals "div" (make_function div). + Definition sdiv : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -491,6 +503,9 @@ Definition sdiv : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom sdiv_in_globals : + IsInGlobals globals "sdiv" (make_function sdiv). + Definition mod_ : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -579,6 +594,9 @@ Definition mod_ : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom mod__in_globals : + IsInGlobals globals "mod" (make_function mod_). + Definition smod : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -696,6 +714,9 @@ Definition smod : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom smod_in_globals : + IsInGlobals globals "smod" (make_function smod). + Definition addmod : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -821,6 +842,9 @@ Definition addmod : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom addmod_in_globals : + IsInGlobals globals "addmod" (make_function addmod). + Definition mulmod : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -946,6 +970,9 @@ Definition mulmod : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom mulmod_in_globals : + IsInGlobals globals "mulmod" (make_function mulmod). + Definition exp : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -1057,6 +1084,9 @@ Definition exp : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom exp_in_globals : + IsInGlobals globals "exp" (make_function exp). + Definition signextend : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -1231,3 +1261,6 @@ Definition signextend : Value.t -> Value.t -> M := Constant.int 1 |) in M.pure Constant.None_)). + +Axiom signextend_in_globals : + IsInGlobals globals "signextend" (make_function signextend). diff --git a/CoqOfPython/ethereum/constantinople/vm/instructions/bitwise.v b/CoqOfPython/ethereum/constantinople/vm/instructions/bitwise.v index c0984ab..9fd6727 100644 --- a/CoqOfPython/ethereum/constantinople/vm/instructions/bitwise.v +++ b/CoqOfPython/ethereum/constantinople/vm/instructions/bitwise.v @@ -97,6 +97,9 @@ Definition bitwise_and : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom bitwise_and_in_globals : + IsInGlobals globals "bitwise_and" (make_function bitwise_and). + Definition bitwise_or : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -157,6 +160,9 @@ Definition bitwise_or : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom bitwise_or_in_globals : + IsInGlobals globals "bitwise_or" (make_function bitwise_or). + Definition bitwise_xor : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -217,6 +223,9 @@ Definition bitwise_xor : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom bitwise_xor_in_globals : + IsInGlobals globals "bitwise_xor" (make_function bitwise_xor). + Definition bitwise_not : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -264,6 +273,9 @@ Definition bitwise_not : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom bitwise_not_in_globals : + IsInGlobals globals "bitwise_not" (make_function bitwise_not). + Definition get_byte : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -380,6 +392,9 @@ Definition get_byte : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom get_byte_in_globals : + IsInGlobals globals "get_byte" (make_function get_byte). + Definition bitwise_shl : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -475,6 +490,9 @@ Definition bitwise_shl : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom bitwise_shl_in_globals : + IsInGlobals globals "bitwise_shl" (make_function bitwise_shl). + Definition bitwise_shr : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -561,6 +579,9 @@ Definition bitwise_shr : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom bitwise_shr_in_globals : + IsInGlobals globals "bitwise_shr" (make_function bitwise_shr). + Definition bitwise_sar : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -674,3 +695,6 @@ Definition bitwise_sar : Value.t -> Value.t -> M := Constant.int 1 |) in M.pure Constant.None_)). + +Axiom bitwise_sar_in_globals : + IsInGlobals globals "bitwise_sar" (make_function bitwise_sar). diff --git a/CoqOfPython/ethereum/constantinople/vm/instructions/block.v b/CoqOfPython/ethereum/constantinople/vm/instructions/block.v index ddc60b7..01c5de4 100644 --- a/CoqOfPython/ethereum/constantinople/vm/instructions/block.v +++ b/CoqOfPython/ethereum/constantinople/vm/instructions/block.v @@ -129,6 +129,9 @@ Definition block_hash : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom block_hash_in_globals : + IsInGlobals globals "block_hash" (make_function block_hash). + Definition coinbase : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -176,6 +179,9 @@ Definition coinbase : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom coinbase_in_globals : + IsInGlobals globals "coinbase" (make_function coinbase). + Definition timestamp : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -217,6 +223,9 @@ Definition timestamp : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom timestamp_in_globals : + IsInGlobals globals "timestamp" (make_function timestamp). + Definition number : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -263,6 +272,9 @@ Definition number : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom number_in_globals : + IsInGlobals globals "number" (make_function number). + Definition difficulty : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -309,6 +321,9 @@ Definition difficulty : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom difficulty_in_globals : + IsInGlobals globals "difficulty" (make_function difficulty). + Definition gas_limit : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -354,3 +369,6 @@ Definition gas_limit : Value.t -> Value.t -> M := Constant.int 1 |) in M.pure Constant.None_)). + +Axiom gas_limit_in_globals : + IsInGlobals globals "gas_limit" (make_function gas_limit). diff --git a/CoqOfPython/ethereum/constantinople/vm/instructions/comparison.v b/CoqOfPython/ethereum/constantinople/vm/instructions/comparison.v index f4c2799..1683a24 100644 --- a/CoqOfPython/ethereum/constantinople/vm/instructions/comparison.v +++ b/CoqOfPython/ethereum/constantinople/vm/instructions/comparison.v @@ -105,6 +105,9 @@ Definition less_than : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom less_than_in_globals : + IsInGlobals globals "less_than" (make_function less_than). + Definition signed_less_than : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -182,6 +185,9 @@ Definition signed_less_than : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom signed_less_than_in_globals : + IsInGlobals globals "signed_less_than" (make_function signed_less_than). + Definition greater_than : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -252,6 +258,9 @@ Definition greater_than : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom greater_than_in_globals : + IsInGlobals globals "greater_than" (make_function greater_than). + Definition signed_greater_than : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -329,6 +338,9 @@ Definition signed_greater_than : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom signed_greater_than_in_globals : + IsInGlobals globals "signed_greater_than" (make_function signed_greater_than). + Definition equal : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -399,6 +411,9 @@ Definition equal : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom equal_in_globals : + IsInGlobals globals "equal" (make_function equal). + Definition is_zero : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -458,3 +473,6 @@ Definition is_zero : Value.t -> Value.t -> M := Constant.int 1 |) in M.pure Constant.None_)). + +Axiom is_zero_in_globals : + IsInGlobals globals "is_zero" (make_function is_zero). diff --git a/CoqOfPython/ethereum/constantinople/vm/instructions/control_flow.v b/CoqOfPython/ethereum/constantinople/vm/instructions/control_flow.v index 4363bee..57b0c3d 100644 --- a/CoqOfPython/ethereum/constantinople/vm/instructions/control_flow.v +++ b/CoqOfPython/ethereum/constantinople/vm/instructions/control_flow.v @@ -71,6 +71,9 @@ Definition stop : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom stop_in_globals : + IsInGlobals globals "stop" (make_function stop). + Definition jump : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -136,6 +139,9 @@ Definition jump : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom jump_in_globals : + IsInGlobals globals "jump" (make_function jump). + Definition jumpi : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -237,6 +243,9 @@ Definition jumpi : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom jumpi_in_globals : + IsInGlobals globals "jumpi" (make_function jumpi). + Definition pc : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -281,6 +290,9 @@ Definition pc : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom pc_in_globals : + IsInGlobals globals "pc" (make_function pc). + Definition gas_left : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -325,6 +337,9 @@ Definition gas_left : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom gas_left_in_globals : + IsInGlobals globals "gas_left" (make_function gas_left). + Definition jumpdest : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -356,3 +371,6 @@ Definition jumpdest : Value.t -> Value.t -> M := Constant.int 1 |) in M.pure Constant.None_)). + +Axiom jumpdest_in_globals : + IsInGlobals globals "jumpdest" (make_function jumpdest). diff --git a/CoqOfPython/ethereum/constantinople/vm/instructions/environment.v b/CoqOfPython/ethereum/constantinople/vm/instructions/environment.v index 6d28976..7cdb3c9 100644 --- a/CoqOfPython/ethereum/constantinople/vm/instructions/environment.v +++ b/CoqOfPython/ethereum/constantinople/vm/instructions/environment.v @@ -120,6 +120,9 @@ Definition address : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom address_in_globals : + IsInGlobals globals "address" (make_function address). + Definition balance : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -183,6 +186,9 @@ Definition balance : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom balance_in_globals : + IsInGlobals globals "balance" (make_function balance). + Definition origin : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -227,6 +233,9 @@ Definition origin : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom origin_in_globals : + IsInGlobals globals "origin" (make_function origin). + Definition caller : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -270,6 +279,9 @@ Definition caller : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom caller_in_globals : + IsInGlobals globals "caller" (make_function caller). + Definition callvalue : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -307,6 +319,9 @@ Definition callvalue : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom callvalue_in_globals : + IsInGlobals globals "callvalue" (make_function callvalue). + Definition calldataload : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -378,6 +393,9 @@ Definition calldataload : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom calldataload_in_globals : + IsInGlobals globals "calldataload" (make_function calldataload). + Definition calldatasize : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -427,6 +445,9 @@ Definition calldatasize : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom calldatasize_in_globals : + IsInGlobals globals "calldatasize" (make_function calldatasize). + Definition calldatacopy : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -562,6 +583,9 @@ Definition calldatacopy : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom calldatacopy_in_globals : + IsInGlobals globals "calldatacopy" (make_function calldatacopy). + Definition codesize : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -611,6 +635,9 @@ Definition codesize : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom codesize_in_globals : + IsInGlobals globals "codesize" (make_function codesize). + Definition codecopy : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -746,6 +773,9 @@ Definition codecopy : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom codecopy_in_globals : + IsInGlobals globals "codecopy" (make_function codecopy). + Definition gasprice : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -789,6 +819,9 @@ Definition gasprice : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom gasprice_in_globals : + IsInGlobals globals "gasprice" (make_function gasprice). + Definition extcodesize : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -864,6 +897,9 @@ Definition extcodesize : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom extcodesize_in_globals : + IsInGlobals globals "extcodesize" (make_function extcodesize). + Definition extcodecopy : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -1023,6 +1059,9 @@ Definition extcodecopy : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom extcodecopy_in_globals : + IsInGlobals globals "extcodecopy" (make_function extcodecopy). + Definition returndatasize : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -1071,6 +1110,9 @@ Definition returndatasize : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom returndatasize_in_globals : + IsInGlobals globals "returndatasize" (make_function returndatasize). + Definition returndatacopy : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -1234,6 +1276,9 @@ Definition returndatacopy : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom returndatacopy_in_globals : + IsInGlobals globals "returndatacopy" (make_function returndatacopy). + Definition extcodehash : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -1334,3 +1379,6 @@ Definition extcodehash : Value.t -> Value.t -> M := Constant.int 1 |) in M.pure Constant.None_)). + +Axiom extcodehash_in_globals : + IsInGlobals globals "extcodehash" (make_function extcodehash). diff --git a/CoqOfPython/ethereum/constantinople/vm/instructions/keccak.v b/CoqOfPython/ethereum/constantinople/vm/instructions/keccak.v index c5502bf..9329af1 100644 --- a/CoqOfPython/ethereum/constantinople/vm/instructions/keccak.v +++ b/CoqOfPython/ethereum/constantinople/vm/instructions/keccak.v @@ -189,3 +189,6 @@ Definition keccak : Value.t -> Value.t -> M := Constant.int 1 |) in M.pure Constant.None_)). + +Axiom keccak_in_globals : + IsInGlobals globals "keccak" (make_function keccak). diff --git a/CoqOfPython/ethereum/constantinople/vm/instructions/log.v b/CoqOfPython/ethereum/constantinople/vm/instructions/log.v index b0555a1..2f5f39c 100644 --- a/CoqOfPython/ethereum/constantinople/vm/instructions/log.v +++ b/CoqOfPython/ethereum/constantinople/vm/instructions/log.v @@ -208,6 +208,9 @@ Definition log_n : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom log_n_in_globals : + IsInGlobals globals "log_n" (make_function log_n). + Definition log0 : Value.t := M.run ltac:(M.monadic ( M.call (| M.get_name (| globals, locals_stack, "partial" |), diff --git a/CoqOfPython/ethereum/constantinople/vm/instructions/memory.v b/CoqOfPython/ethereum/constantinople/vm/instructions/memory.v index 627e26f..0b699a4 100644 --- a/CoqOfPython/ethereum/constantinople/vm/instructions/memory.v +++ b/CoqOfPython/ethereum/constantinople/vm/instructions/memory.v @@ -145,6 +145,9 @@ Definition mstore : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom mstore_in_globals : + IsInGlobals globals "mstore" (make_function mstore). + Definition mstore8 : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -249,6 +252,9 @@ Definition mstore8 : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom mstore8_in_globals : + IsInGlobals globals "mstore8" (make_function mstore8). + Definition mload : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -349,6 +355,9 @@ Definition mload : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom mload_in_globals : + IsInGlobals globals "mload" (make_function mload). + Definition msize : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -397,3 +406,6 @@ Definition msize : Value.t -> Value.t -> M := Constant.int 1 |) in M.pure Constant.None_)). + +Axiom msize_in_globals : + IsInGlobals globals "msize" (make_function msize). diff --git a/CoqOfPython/ethereum/constantinople/vm/instructions/stack.v b/CoqOfPython/ethereum/constantinople/vm/instructions/stack.v index a6d509e..d9af9a4 100644 --- a/CoqOfPython/ethereum/constantinople/vm/instructions/stack.v +++ b/CoqOfPython/ethereum/constantinople/vm/instructions/stack.v @@ -82,6 +82,9 @@ Definition pop : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom pop_in_globals : + IsInGlobals globals "pop" (make_function pop). + Definition push_n : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm"; "num_bytes" ] in @@ -159,6 +162,9 @@ Definition push_n : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom push_n_in_globals : + IsInGlobals globals "push_n" (make_function push_n). + Definition dup_n : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm"; "item_number" ] in @@ -236,6 +242,9 @@ Definition dup_n : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom dup_n_in_globals : + IsInGlobals globals "dup_n" (make_function dup_n). + Definition swap_n : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm"; "item_number" ] in @@ -312,6 +321,9 @@ Definition swap_n : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom swap_n_in_globals : + IsInGlobals globals "swap_n" (make_function swap_n). + Definition push1 : Value.t := M.run ltac:(M.monadic ( M.call (| M.get_name (| globals, locals_stack, "partial" |), diff --git a/CoqOfPython/ethereum/constantinople/vm/instructions/storage.v b/CoqOfPython/ethereum/constantinople/vm/instructions/storage.v index 3a891f8..b00ab11 100644 --- a/CoqOfPython/ethereum/constantinople/vm/instructions/storage.v +++ b/CoqOfPython/ethereum/constantinople/vm/instructions/storage.v @@ -112,6 +112,9 @@ Definition sload : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom sload_in_globals : + IsInGlobals globals "sload" (make_function sload). + Definition sstore : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -250,3 +253,6 @@ Definition sstore : Value.t -> Value.t -> M := Constant.int 1 |) in M.pure Constant.None_)). + +Axiom sstore_in_globals : + IsInGlobals globals "sstore" (make_function sstore). diff --git a/CoqOfPython/ethereum/constantinople/vm/instructions/system.v b/CoqOfPython/ethereum/constantinople/vm/instructions/system.v index 6e22c0a..658f239 100644 --- a/CoqOfPython/ethereum/constantinople/vm/instructions/system.v +++ b/CoqOfPython/ethereum/constantinople/vm/instructions/system.v @@ -376,6 +376,9 @@ Definition generic_create : Value.t -> Value.t -> M := )) |) in M.pure Constant.None_)). +Axiom generic_create_in_globals : + IsInGlobals globals "generic_create" (make_function generic_create). + Definition create : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -486,6 +489,9 @@ Definition create : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom create_in_globals : + IsInGlobals globals "create" (make_function create). + Definition create2 : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -640,6 +646,9 @@ Definition create2 : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom create2_in_globals : + IsInGlobals globals "create2" (make_function create2). + Definition return_ : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -723,6 +732,9 @@ Definition return_ : Value.t -> Value.t -> M := let _ := M.pass (| |) in M.pure Constant.None_)). +Axiom return__in_globals : + IsInGlobals globals "return_" (make_function return_). + Definition generic_call : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm"; "gas"; "value"; "caller"; "to"; "code_address"; "should_transfer_value"; "is_staticcall"; "memory_input_start_position"; "memory_input_size"; "memory_output_start_position"; "memory_output_size" ] in @@ -918,6 +930,9 @@ Definition generic_call : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom generic_call_in_globals : + IsInGlobals globals "generic_call" (make_function generic_call). + Definition call : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -1222,6 +1237,9 @@ M.get_name (| globals, locals_stack, "GAS_CALL_VALUE" |) |) in M.pure Constant.None_)). +Axiom call_in_globals : + IsInGlobals globals "call" (make_function call). + Definition callcode : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -1471,6 +1489,9 @@ M.get_name (| globals, locals_stack, "GAS_CALL_VALUE" |) |) in M.pure Constant.None_)). +Axiom callcode_in_globals : + IsInGlobals globals "callcode" (make_function callcode). + Definition selfdestruct : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -1700,6 +1721,9 @@ Definition selfdestruct : Value.t -> Value.t -> M := let _ := M.pass (| |) in M.pure Constant.None_)). +Axiom selfdestruct_in_globals : + IsInGlobals globals "selfdestruct" (make_function selfdestruct). + Definition delegatecall : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -1868,6 +1892,9 @@ Definition delegatecall : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom delegatecall_in_globals : + IsInGlobals globals "delegatecall" (make_function delegatecall). + Definition staticcall : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -2042,6 +2069,9 @@ Definition staticcall : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom staticcall_in_globals : + IsInGlobals globals "staticcall" (make_function staticcall). + Definition revert : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -2128,3 +2158,6 @@ Definition revert : Value.t -> Value.t -> M := let _ := M.raise (| Some (M.get_name (| globals, locals_stack, "Revert" |)) |) in let _ := M.pass (| |) in M.pure Constant.None_)). + +Axiom revert_in_globals : + IsInGlobals globals "revert" (make_function revert). diff --git a/CoqOfPython/ethereum/constantinople/vm/interpreter.v b/CoqOfPython/ethereum/constantinople/vm/interpreter.v index 61036bd..183898c 100644 --- a/CoqOfPython/ethereum/constantinople/vm/interpreter.v +++ b/CoqOfPython/ethereum/constantinople/vm/interpreter.v @@ -396,6 +396,9 @@ Definition process_message_call : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom process_message_call_in_globals : + IsInGlobals globals "process_message_call" (make_function process_message_call). + Definition process_create_message : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "message"; "env" ] in @@ -490,6 +493,9 @@ Definition process_create_message : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom process_create_message_in_globals : + IsInGlobals globals "process_create_message" (make_function process_create_message). + Definition process_message : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "message"; "env" ] in @@ -615,6 +621,9 @@ Definition process_message : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom process_message_in_globals : + IsInGlobals globals "process_message" (make_function process_message). + Definition execute_code : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "message"; "env" ] in @@ -661,3 +670,6 @@ Definition execute_code : Value.t -> Value.t -> M := M.get_name (| globals, locals_stack, "evm" |) |) in M.pure Constant.None_)). + +Axiom execute_code_in_globals : + IsInGlobals globals "execute_code" (make_function execute_code). diff --git a/CoqOfPython/ethereum/constantinople/vm/memory.v b/CoqOfPython/ethereum/constantinople/vm/memory.v index 0c92e48..80d3f91 100644 --- a/CoqOfPython/ethereum/constantinople/vm/memory.v +++ b/CoqOfPython/ethereum/constantinople/vm/memory.v @@ -71,6 +71,9 @@ Definition memory_write : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom memory_write_in_globals : + IsInGlobals globals "memory_write" (make_function memory_write). + Definition memory_read_bytes : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "memory"; "start_position"; "size" ] in @@ -117,6 +120,9 @@ Definition memory_read_bytes : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom memory_read_bytes_in_globals : + IsInGlobals globals "memory_read_bytes" (make_function memory_read_bytes). + Definition buffer_read : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "buffer"; "start_position"; "size" ] in @@ -169,3 +175,6 @@ Definition buffer_read : Value.t -> Value.t -> M := |) |) in M.pure Constant.None_)). + +Axiom buffer_read_in_globals : + IsInGlobals globals "buffer_read" (make_function buffer_read). diff --git a/CoqOfPython/ethereum/constantinople/vm/precompiled_contracts/alt_bn128.v b/CoqOfPython/ethereum/constantinople/vm/precompiled_contracts/alt_bn128.v index 38dc21f..a1fc47d 100644 --- a/CoqOfPython/ethereum/constantinople/vm/precompiled_contracts/alt_bn128.v +++ b/CoqOfPython/ethereum/constantinople/vm/precompiled_contracts/alt_bn128.v @@ -273,6 +273,9 @@ Definition alt_bn128_add : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom alt_bn128_add_in_globals : + IsInGlobals globals "alt_bn128_add" (make_function alt_bn128_add). + Definition alt_bn128_mul : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -455,6 +458,9 @@ Definition alt_bn128_mul : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom alt_bn128_mul_in_globals : + IsInGlobals globals "alt_bn128_mul" (make_function alt_bn128_mul). + Definition alt_bn128_pairing_check : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -781,3 +787,6 @@ Definition alt_bn128_pairing_check : Value.t -> Value.t -> M := M.pure Constant.None_ )) |) in M.pure Constant.None_)). + +Axiom alt_bn128_pairing_check_in_globals : + IsInGlobals globals "alt_bn128_pairing_check" (make_function alt_bn128_pairing_check). diff --git a/CoqOfPython/ethereum/constantinople/vm/precompiled_contracts/ecrecover.v b/CoqOfPython/ethereum/constantinople/vm/precompiled_contracts/ecrecover.v index 2f6ff0d..0ea7a05 100644 --- a/CoqOfPython/ethereum/constantinople/vm/precompiled_contracts/ecrecover.v +++ b/CoqOfPython/ethereum/constantinople/vm/precompiled_contracts/ecrecover.v @@ -302,3 +302,6 @@ Definition ecrecover : Value.t -> Value.t -> M := M.get_name (| globals, locals_stack, "padded_address" |) |) in M.pure Constant.None_)). + +Axiom ecrecover_in_globals : + IsInGlobals globals "ecrecover" (make_function ecrecover). diff --git a/CoqOfPython/ethereum/constantinople/vm/precompiled_contracts/identity.v b/CoqOfPython/ethereum/constantinople/vm/precompiled_contracts/identity.v index 7f3e322..baa4bc2 100644 --- a/CoqOfPython/ethereum/constantinople/vm/precompiled_contracts/identity.v +++ b/CoqOfPython/ethereum/constantinople/vm/precompiled_contracts/identity.v @@ -95,3 +95,6 @@ Definition identity : Value.t -> Value.t -> M := M.get_name (| globals, locals_stack, "data" |) |) in M.pure Constant.None_)). + +Axiom identity_in_globals : + IsInGlobals globals "identity" (make_function identity). diff --git a/CoqOfPython/ethereum/constantinople/vm/precompiled_contracts/modexp.v b/CoqOfPython/ethereum/constantinople/vm/precompiled_contracts/modexp.v index 1b10eee..ed2c639 100644 --- a/CoqOfPython/ethereum/constantinople/vm/precompiled_contracts/modexp.v +++ b/CoqOfPython/ethereum/constantinople/vm/precompiled_contracts/modexp.v @@ -468,6 +468,9 @@ Definition modexp : Value.t -> Value.t -> M := )) |) in M.pure Constant.None_)). +Axiom modexp_in_globals : + IsInGlobals globals "modexp" (make_function modexp). + Definition get_mult_complexity : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "x" ] in @@ -546,3 +549,6 @@ Definition get_mult_complexity : Value.t -> Value.t -> M := M.pure Constant.None_ )) |) in M.pure Constant.None_)). + +Axiom get_mult_complexity_in_globals : + IsInGlobals globals "get_mult_complexity" (make_function get_mult_complexity). diff --git a/CoqOfPython/ethereum/constantinople/vm/precompiled_contracts/ripemd160.v b/CoqOfPython/ethereum/constantinople/vm/precompiled_contracts/ripemd160.v index afa96a2..d368a06 100644 --- a/CoqOfPython/ethereum/constantinople/vm/precompiled_contracts/ripemd160.v +++ b/CoqOfPython/ethereum/constantinople/vm/precompiled_contracts/ripemd160.v @@ -126,3 +126,6 @@ Definition ripemd160 : Value.t -> Value.t -> M := M.get_name (| globals, locals_stack, "padded_hash" |) |) in M.pure Constant.None_)). + +Axiom ripemd160_in_globals : + IsInGlobals globals "ripemd160" (make_function ripemd160). diff --git a/CoqOfPython/ethereum/constantinople/vm/precompiled_contracts/sha256.v b/CoqOfPython/ethereum/constantinople/vm/precompiled_contracts/sha256.v index d5c505c..af035df 100644 --- a/CoqOfPython/ethereum/constantinople/vm/precompiled_contracts/sha256.v +++ b/CoqOfPython/ethereum/constantinople/vm/precompiled_contracts/sha256.v @@ -107,3 +107,6 @@ Definition sha256 : Value.t -> Value.t -> M := |) |) in M.pure Constant.None_)). + +Axiom sha256_in_globals : + IsInGlobals globals "sha256" (make_function sha256). diff --git a/CoqOfPython/ethereum/constantinople/vm/runtime.v b/CoqOfPython/ethereum/constantinople/vm/runtime.v index 4afd430..cdfe19a 100644 --- a/CoqOfPython/ethereum/constantinople/vm/runtime.v +++ b/CoqOfPython/ethereum/constantinople/vm/runtime.v @@ -158,3 +158,6 @@ Definition get_valid_jump_destinations : Value.t -> Value.t -> M := M.get_name (| globals, locals_stack, "valid_jump_destinations" |) |) in M.pure Constant.None_)). + +Axiom get_valid_jump_destinations_in_globals : + IsInGlobals globals "get_valid_jump_destinations" (make_function get_valid_jump_destinations). diff --git a/CoqOfPython/ethereum/constantinople/vm/stack.v b/CoqOfPython/ethereum/constantinople/vm/stack.v index efd76ba..95538af 100644 --- a/CoqOfPython/ethereum/constantinople/vm/stack.v +++ b/CoqOfPython/ethereum/constantinople/vm/stack.v @@ -78,6 +78,9 @@ Definition pop : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom pop_in_globals : + IsInGlobals globals "pop" (make_function pop). + Definition push : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "stack"; "value" ] in @@ -125,3 +128,6 @@ Definition push : Value.t -> Value.t -> M := |) |) in M.pure Constant.None_)). + +Axiom push_in_globals : + IsInGlobals globals "push" (make_function push). diff --git a/CoqOfPython/ethereum/crypto/alt_bn128.v b/CoqOfPython/ethereum/crypto/alt_bn128.v index beec945..29ed360 100644 --- a/CoqOfPython/ethereum/crypto/alt_bn128.v +++ b/CoqOfPython/ethereum/crypto/alt_bn128.v @@ -306,6 +306,9 @@ Definition bnf2_to_bnf12 : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom bnf2_to_bnf12_in_globals : + IsInGlobals globals "bnf2_to_bnf12" (make_function bnf2_to_bnf12). + Definition bnp_to_bnp12 : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "p" ] in @@ -349,6 +352,9 @@ Definition bnp_to_bnp12 : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom bnp_to_bnp12_in_globals : + IsInGlobals globals "bnp_to_bnp12" (make_function bnp_to_bnp12). + Definition twist : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "p" ] in @@ -392,6 +398,9 @@ Definition twist : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom twist_in_globals : + IsInGlobals globals "twist" (make_function twist). + Definition linefunc : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "p1"; "p2"; "t" ] in @@ -512,6 +521,9 @@ Definition linefunc : Value.t -> Value.t -> M := )) |) in M.pure Constant.None_)). +Axiom linefunc_in_globals : + IsInGlobals globals "linefunc" (make_function linefunc). + Definition miller_loop : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "q"; "p" ] in @@ -764,6 +776,9 @@ Definition miller_loop : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom miller_loop_in_globals : + IsInGlobals globals "miller_loop" (make_function miller_loop). + Definition pairing : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "q"; "p" ] in @@ -794,3 +809,6 @@ Definition pairing : Value.t -> Value.t -> M := |) |) in M.pure Constant.None_)). + +Axiom pairing_in_globals : + IsInGlobals globals "pairing" (make_function pairing). diff --git a/CoqOfPython/ethereum/crypto/blake2.v b/CoqOfPython/ethereum/crypto/blake2.v index 6363258..07372e6 100644 --- a/CoqOfPython/ethereum/crypto/blake2.v +++ b/CoqOfPython/ethereum/crypto/blake2.v @@ -96,6 +96,9 @@ Definition spit_le_to_uint : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom spit_le_to_uint_in_globals : + IsInGlobals globals "spit_le_to_uint" (make_function spit_le_to_uint). + Definition Blake2 : Value.t := builtins.make_klass [] diff --git a/CoqOfPython/ethereum/crypto/elliptic_curve.v b/CoqOfPython/ethereum/crypto/elliptic_curve.v index c8adbad..2a9343a 100644 --- a/CoqOfPython/ethereum/crypto/elliptic_curve.v +++ b/CoqOfPython/ethereum/crypto/elliptic_curve.v @@ -186,6 +186,9 @@ Definition secp256k1_recover : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom secp256k1_recover_in_globals : + IsInGlobals globals "secp256k1_recover" (make_function secp256k1_recover). + Definition EllipticCurve : Value.t := builtins.make_klass [(* At base: unsupported node type: Subscript *)] diff --git a/CoqOfPython/ethereum/crypto/hash.v b/CoqOfPython/ethereum/crypto/hash.v index 9f684cc..1bb2108 100644 --- a/CoqOfPython/ethereum/crypto/hash.v +++ b/CoqOfPython/ethereum/crypto/hash.v @@ -83,6 +83,9 @@ Definition keccak256 : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom keccak256_in_globals : + IsInGlobals globals "keccak256" (make_function keccak256). + Definition keccak512 : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "buffer" ] in @@ -128,3 +131,6 @@ Definition keccak512 : Value.t -> Value.t -> M := |) |) in M.pure Constant.None_)). + +Axiom keccak512_in_globals : + IsInGlobals globals "keccak512" (make_function keccak512). diff --git a/CoqOfPython/ethereum/dao_fork/bloom.v b/CoqOfPython/ethereum/dao_fork/bloom.v index 59b1869..f6b720d 100644 --- a/CoqOfPython/ethereum/dao_fork/bloom.v +++ b/CoqOfPython/ethereum/dao_fork/bloom.v @@ -140,6 +140,9 @@ Definition add_to_bloom : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom add_to_bloom_in_globals : + IsInGlobals globals "add_to_bloom" (make_function add_to_bloom). + Definition logs_bloom : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "logs" ] in @@ -209,3 +212,6 @@ Definition logs_bloom : Value.t -> Value.t -> M := |) |) in M.pure Constant.None_)). + +Axiom logs_bloom_in_globals : + IsInGlobals globals "logs_bloom" (make_function logs_bloom). diff --git a/CoqOfPython/ethereum/dao_fork/dao.v b/CoqOfPython/ethereum/dao_fork/dao.v index 434d57c..82d3ff0 100644 --- a/CoqOfPython/ethereum/dao_fork/dao.v +++ b/CoqOfPython/ethereum/dao_fork/dao.v @@ -91,3 +91,6 @@ Definition apply_dao : Value.t -> Value.t -> M := )) |) in M.pure Constant.None_)). + +Axiom apply_dao_in_globals : + IsInGlobals globals "apply_dao" (make_function apply_dao). diff --git a/CoqOfPython/ethereum/dao_fork/fork.v b/CoqOfPython/ethereum/dao_fork/fork.v index 4f769f4..c21ef9d 100644 --- a/CoqOfPython/ethereum/dao_fork/fork.v +++ b/CoqOfPython/ethereum/dao_fork/fork.v @@ -230,6 +230,9 @@ Definition apply_fork : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom apply_fork_in_globals : + IsInGlobals globals "apply_fork" (make_function apply_fork). + Definition get_last_256_block_hashes : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "chain" ] in @@ -342,6 +345,9 @@ Definition get_last_256_block_hashes : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom get_last_256_block_hashes_in_globals : + IsInGlobals globals "get_last_256_block_hashes" (make_function get_last_256_block_hashes). + Definition state_transition : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "chain"; "block" ] in @@ -508,6 +514,9 @@ Definition state_transition : Value.t -> Value.t -> M := )) |) in M.pure Constant.None_)). +Axiom state_transition_in_globals : + IsInGlobals globals "state_transition" (make_function state_transition). + Definition validate_header : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "header"; "parent_header" ] in @@ -682,6 +691,9 @@ Definition validate_header : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom validate_header_in_globals : + IsInGlobals globals "validate_header" (make_function validate_header). + Definition generate_header_hash_for_pow : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "header" ] in @@ -737,6 +749,9 @@ Definition generate_header_hash_for_pow : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom generate_header_hash_for_pow_in_globals : + IsInGlobals globals "generate_header_hash_for_pow" (make_function generate_header_hash_for_pow). + Definition validate_proof_of_work : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "header" ] in @@ -827,6 +842,9 @@ Definition validate_proof_of_work : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom validate_proof_of_work_in_globals : + IsInGlobals globals "validate_proof_of_work" (make_function validate_proof_of_work). + Definition check_transaction : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "tx"; "gas_available" ] in @@ -877,6 +895,9 @@ Definition check_transaction : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom check_transaction_in_globals : + IsInGlobals globals "check_transaction" (make_function check_transaction). + Definition make_receipt : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "tx"; "post_state"; "cumulative_gas_used"; "logs" ] in @@ -914,6 +935,9 @@ Definition make_receipt : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom make_receipt_in_globals : + IsInGlobals globals "make_receipt" (make_function make_receipt). + Definition ApplyBodyOutput : Value.t := builtins.make_klass [] @@ -1154,6 +1178,9 @@ Definition apply_body : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom apply_body_in_globals : + IsInGlobals globals "apply_body" (make_function apply_body). + Definition validate_ommers : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "ommers"; "block_header"; "chain" ] in @@ -1475,6 +1502,9 @@ Definition validate_ommers : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom validate_ommers_in_globals : + IsInGlobals globals "validate_ommers" (make_function validate_ommers). + Definition pay_rewards : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "state"; "block_number"; "coinbase"; "ommers" ] in @@ -1580,6 +1610,9 @@ Definition pay_rewards : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom pay_rewards_in_globals : + IsInGlobals globals "pay_rewards" (make_function pay_rewards). + Definition process_transaction : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "env"; "tx" ] in @@ -1870,6 +1903,9 @@ Definition process_transaction : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom process_transaction_in_globals : + IsInGlobals globals "process_transaction" (make_function process_transaction). + Definition validate_transaction : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "tx" ] in @@ -1926,6 +1962,9 @@ Definition validate_transaction : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom validate_transaction_in_globals : + IsInGlobals globals "validate_transaction" (make_function validate_transaction). + Definition calculate_intrinsic_cost : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "tx" ] in @@ -2036,6 +2075,9 @@ Definition calculate_intrinsic_cost : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom calculate_intrinsic_cost_in_globals : + IsInGlobals globals "calculate_intrinsic_cost" (make_function calculate_intrinsic_cost). + Definition recover_sender : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "tx" ] in @@ -2167,6 +2209,9 @@ Definition recover_sender : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom recover_sender_in_globals : + IsInGlobals globals "recover_sender" (make_function recover_sender). + Definition signing_hash : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "tx" ] in @@ -2205,6 +2250,9 @@ Definition signing_hash : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom signing_hash_in_globals : + IsInGlobals globals "signing_hash" (make_function signing_hash). + Definition compute_header_hash : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "header" ] in @@ -2257,6 +2305,9 @@ Definition compute_header_hash : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom compute_header_hash_in_globals : + IsInGlobals globals "compute_header_hash" (make_function compute_header_hash). + Definition check_gas_limit : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "gas_limit"; "parent_gas_limit" ] in @@ -2357,6 +2408,9 @@ Definition check_gas_limit : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom check_gas_limit_in_globals : + IsInGlobals globals "check_gas_limit" (make_function check_gas_limit). + Definition calculate_block_difficulty : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "block_number"; "block_timestamp"; "parent_timestamp"; "parent_difficulty" ] in @@ -2503,3 +2557,6 @@ Definition calculate_block_difficulty : Value.t -> Value.t -> M := |) |) in M.pure Constant.None_)). + +Axiom calculate_block_difficulty_in_globals : + IsInGlobals globals "calculate_block_difficulty" (make_function calculate_block_difficulty). diff --git a/CoqOfPython/ethereum/dao_fork/fork_types.v b/CoqOfPython/ethereum/dao_fork/fork_types.v index b3f985f..0a9b4d5 100644 --- a/CoqOfPython/ethereum/dao_fork/fork_types.v +++ b/CoqOfPython/ethereum/dao_fork/fork_types.v @@ -99,3 +99,6 @@ Definition encode_account : Value.t -> Value.t -> M := |) |) in M.pure Constant.None_)). + +Axiom encode_account_in_globals : + IsInGlobals globals "encode_account" (make_function encode_account). diff --git a/CoqOfPython/ethereum/dao_fork/state.v b/CoqOfPython/ethereum/dao_fork/state.v index 5204480..51f8471 100644 --- a/CoqOfPython/ethereum/dao_fork/state.v +++ b/CoqOfPython/ethereum/dao_fork/state.v @@ -97,6 +97,9 @@ Definition close_state : Value.t -> Value.t -> M := let _ := M.delete (| M.get_field (| M.get_name (| globals, locals_stack, "state" |), "_snapshots" |) |) in M.pure Constant.None_)). +Axiom close_state_in_globals : + IsInGlobals globals "close_state" (make_function close_state). + Definition begin_transaction : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "state" ] in @@ -127,6 +130,9 @@ Definition begin_transaction : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom begin_transaction_in_globals : + IsInGlobals globals "begin_transaction" (make_function begin_transaction). + Definition commit_transaction : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "state" ] in @@ -146,6 +152,9 @@ Definition commit_transaction : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom commit_transaction_in_globals : + IsInGlobals globals "commit_transaction" (make_function commit_transaction). + Definition rollback_transaction : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "state" ] in @@ -169,6 +178,9 @@ Definition rollback_transaction : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom rollback_transaction_in_globals : + IsInGlobals globals "rollback_transaction" (make_function rollback_transaction). + Definition get_account : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "state"; "address" ] in @@ -229,6 +241,9 @@ Definition get_account : Value.t -> Value.t -> M := )) |) in M.pure Constant.None_)). +Axiom get_account_in_globals : + IsInGlobals globals "get_account" (make_function get_account). + Definition get_account_optional : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "state"; "address" ] in @@ -265,6 +280,9 @@ Definition get_account_optional : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom get_account_optional_in_globals : + IsInGlobals globals "get_account_optional" (make_function get_account_optional). + Definition set_account : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "state"; "address"; "account" ] in @@ -293,6 +311,9 @@ Definition set_account : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom set_account_in_globals : + IsInGlobals globals "set_account" (make_function set_account). + Definition destroy_account : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "state"; "address" ] in @@ -330,6 +351,9 @@ Definition destroy_account : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom destroy_account_in_globals : + IsInGlobals globals "destroy_account" (make_function destroy_account). + Definition destroy_storage : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "state"; "address" ] in @@ -364,6 +388,9 @@ Definition destroy_storage : Value.t -> Value.t -> M := )) |) in M.pure Constant.None_)). +Axiom destroy_storage_in_globals : + IsInGlobals globals "destroy_storage" (make_function destroy_storage). + Definition get_storage : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "state"; "address"; "key" ] in @@ -443,6 +470,9 @@ Definition get_storage : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom get_storage_in_globals : + IsInGlobals globals "get_storage" (make_function get_storage). + Definition set_storage : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "state"; "address"; "key"; "value" ] in @@ -541,6 +571,9 @@ Definition set_storage : Value.t -> Value.t -> M := )) |) in M.pure Constant.None_)). +Axiom set_storage_in_globals : + IsInGlobals globals "set_storage" (make_function set_storage). + Definition storage_root : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "state"; "address" ] in @@ -592,6 +625,9 @@ Definition storage_root : Value.t -> Value.t -> M := )) |) in M.pure Constant.None_)). +Axiom storage_root_in_globals : + IsInGlobals globals "storage_root" (make_function storage_root). + Definition state_root : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "state" ] in @@ -622,6 +658,9 @@ Definition state_root : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom state_root_in_globals : + IsInGlobals globals "state_root" (make_function state_root). + Definition account_exists : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "state"; "address" ] in @@ -656,6 +695,9 @@ Definition account_exists : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom account_exists_in_globals : + IsInGlobals globals "account_exists" (make_function account_exists). + Definition account_has_code_or_nonce : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "state"; "address" ] in @@ -709,6 +751,9 @@ Definition account_has_code_or_nonce : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom account_has_code_or_nonce_in_globals : + IsInGlobals globals "account_has_code_or_nonce" (make_function account_has_code_or_nonce). + Definition modify_state : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "state"; "address"; "f" ] in @@ -741,6 +786,9 @@ Definition modify_state : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom modify_state_in_globals : + IsInGlobals globals "modify_state" (make_function modify_state). + Definition move_ether : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "state"; "sender_address"; "recipient_address"; "amount" ] in @@ -770,6 +818,9 @@ Definition move_ether : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom move_ether_in_globals : + IsInGlobals globals "move_ether" (make_function move_ether). + Definition set_account_balance : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "state"; "address"; "amount" ] in @@ -800,6 +851,9 @@ Definition set_account_balance : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom set_account_balance_in_globals : + IsInGlobals globals "set_account_balance" (make_function set_account_balance). + Definition touch_account : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "state"; "address" ] in @@ -844,6 +898,9 @@ Definition touch_account : Value.t -> Value.t -> M := )) |) in M.pure Constant.None_)). +Axiom touch_account_in_globals : + IsInGlobals globals "touch_account" (make_function touch_account). + Definition increment_nonce : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "state"; "address" ] in @@ -871,6 +928,9 @@ Definition increment_nonce : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom increment_nonce_in_globals : + IsInGlobals globals "increment_nonce" (make_function increment_nonce). + Definition set_code : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "state"; "address"; "code" ] in @@ -901,6 +961,9 @@ Definition set_code : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom set_code_in_globals : + IsInGlobals globals "set_code" (make_function set_code). + Definition create_ether : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "state"; "address"; "amount" ] in @@ -928,3 +991,6 @@ Definition create_ether : Value.t -> Value.t -> M := make_dict [] |) in M.pure Constant.None_)). + +Axiom create_ether_in_globals : + IsInGlobals globals "create_ether" (make_function create_ether). diff --git a/CoqOfPython/ethereum/dao_fork/trie.v b/CoqOfPython/ethereum/dao_fork/trie.v index b30178b..876db76 100644 --- a/CoqOfPython/ethereum/dao_fork/trie.v +++ b/CoqOfPython/ethereum/dao_fork/trie.v @@ -365,6 +365,9 @@ Definition encode_internal_node : Value.t -> Value.t -> M := )) |) in M.pure Constant.None_)). +Axiom encode_internal_node_in_globals : + IsInGlobals globals "encode_internal_node" (make_function encode_internal_node). + Definition encode_node : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "node"; "storage_root" ] in @@ -473,6 +476,9 @@ Definition encode_node : Value.t -> Value.t -> M := )) |) in M.pure Constant.None_)). +Axiom encode_node_in_globals : + IsInGlobals globals "encode_node" (make_function encode_node). + Definition Trie : Value.t := builtins.make_klass [(* At base: unsupported node type: Subscript *)] @@ -520,6 +526,9 @@ Definition copy_trie : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom copy_trie_in_globals : + IsInGlobals globals "copy_trie" (make_function copy_trie). + Definition trie_set : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "trie"; "key"; "value" ] in @@ -580,6 +589,9 @@ Definition trie_set : Value.t -> Value.t -> M := )) |) in M.pure Constant.None_)). +Axiom trie_set_in_globals : + IsInGlobals globals "trie_set" (make_function trie_set). + Definition trie_get : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "trie"; "key" ] in @@ -613,6 +625,9 @@ Definition trie_get : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom trie_get_in_globals : + IsInGlobals globals "trie_get" (make_function trie_get). + Definition common_prefix_length : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "a"; "b" ] in @@ -691,6 +706,9 @@ Definition common_prefix_length : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom common_prefix_length_in_globals : + IsInGlobals globals "common_prefix_length" (make_function common_prefix_length). + Definition nibble_list_to_compact : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "x"; "is_leaf" ] in @@ -899,6 +917,9 @@ Definition nibble_list_to_compact : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom nibble_list_to_compact_in_globals : + IsInGlobals globals "nibble_list_to_compact" (make_function nibble_list_to_compact). + Definition bytes_to_nibble_list : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "bytes_" ] in @@ -995,6 +1016,9 @@ Definition bytes_to_nibble_list : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom bytes_to_nibble_list_in_globals : + IsInGlobals globals "bytes_to_nibble_list" (make_function bytes_to_nibble_list). + Definition _prepare_trie : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "trie"; "get_storage_root" ] in @@ -1146,6 +1170,9 @@ Definition _prepare_trie : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom _prepare_trie_in_globals : + IsInGlobals globals "_prepare_trie" (make_function _prepare_trie). + Definition root : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "trie"; "get_storage_root" ] in @@ -1261,6 +1288,9 @@ Definition root : Value.t -> Value.t -> M := )) |) in M.pure Constant.None_)). +Axiom root_in_globals : + IsInGlobals globals "root" (make_function root). + Definition patricialize : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "obj"; "level" ] in @@ -1600,3 +1630,6 @@ Definition patricialize : Value.t -> Value.t -> M := |) |) in M.pure Constant.None_)). + +Axiom patricialize_in_globals : + IsInGlobals globals "patricialize" (make_function patricialize). diff --git a/CoqOfPython/ethereum/dao_fork/utils/address.v b/CoqOfPython/ethereum/dao_fork/utils/address.v index eb0718c..0517c6b 100644 --- a/CoqOfPython/ethereum/dao_fork/utils/address.v +++ b/CoqOfPython/ethereum/dao_fork/utils/address.v @@ -76,6 +76,9 @@ Definition to_address : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom to_address_in_globals : + IsInGlobals globals "to_address" (make_function to_address). + Definition compute_contract_address : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "address"; "nonce" ] in @@ -145,3 +148,6 @@ Definition compute_contract_address : Value.t -> Value.t -> M := |) |) in M.pure Constant.None_)). + +Axiom compute_contract_address_in_globals : + IsInGlobals globals "compute_contract_address" (make_function compute_contract_address). diff --git a/CoqOfPython/ethereum/dao_fork/utils/hexadecimal.v b/CoqOfPython/ethereum/dao_fork/utils/hexadecimal.v index c421859..5231002 100644 --- a/CoqOfPython/ethereum/dao_fork/utils/hexadecimal.v +++ b/CoqOfPython/ethereum/dao_fork/utils/hexadecimal.v @@ -70,6 +70,9 @@ Definition hex_to_root : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom hex_to_root_in_globals : + IsInGlobals globals "hex_to_root" (make_function hex_to_root). + Definition hex_to_bloom : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "hex_string" ] in @@ -110,6 +113,9 @@ Definition hex_to_bloom : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom hex_to_bloom_in_globals : + IsInGlobals globals "hex_to_bloom" (make_function hex_to_bloom). + Definition hex_to_address : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "hex_string" ] in @@ -156,3 +162,6 @@ Definition hex_to_address : Value.t -> Value.t -> M := |) |) in M.pure Constant.None_)). + +Axiom hex_to_address_in_globals : + IsInGlobals globals "hex_to_address" (make_function hex_to_address). diff --git a/CoqOfPython/ethereum/dao_fork/utils/message.v b/CoqOfPython/ethereum/dao_fork/utils/message.v index c21cee2..17c9100 100644 --- a/CoqOfPython/ethereum/dao_fork/utils/message.v +++ b/CoqOfPython/ethereum/dao_fork/utils/message.v @@ -209,3 +209,6 @@ Definition prepare_message : Value.t -> Value.t -> M := |) |) in M.pure Constant.None_)). + +Axiom prepare_message_in_globals : + IsInGlobals globals "prepare_message" (make_function prepare_message). diff --git a/CoqOfPython/ethereum/dao_fork/vm/__init__.v b/CoqOfPython/ethereum/dao_fork/vm/__init__.v index 26cdbbe..e084d76 100644 --- a/CoqOfPython/ethereum/dao_fork/vm/__init__.v +++ b/CoqOfPython/ethereum/dao_fork/vm/__init__.v @@ -120,6 +120,9 @@ Definition incorporate_child_on_success : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom incorporate_child_on_success_in_globals : + IsInGlobals globals "incorporate_child_on_success" (make_function incorporate_child_on_success). + Definition incorporate_child_on_error : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm"; "child_evm" ] in @@ -140,3 +143,6 @@ Definition incorporate_child_on_error : Value.t -> Value.t -> M := M.get_field (| M.get_name (| globals, locals_stack, "child_evm" |), "gas_left" |) |) in M.pure Constant.None_)). + +Axiom incorporate_child_on_error_in_globals : + IsInGlobals globals "incorporate_child_on_error" (make_function incorporate_child_on_error). diff --git a/CoqOfPython/ethereum/dao_fork/vm/gas.v b/CoqOfPython/ethereum/dao_fork/vm/gas.v index 5fa4e93..e234492 100644 --- a/CoqOfPython/ethereum/dao_fork/vm/gas.v +++ b/CoqOfPython/ethereum/dao_fork/vm/gas.v @@ -501,6 +501,9 @@ Definition charge_gas : Value.t -> Value.t -> M := )) |) in M.pure Constant.None_)). +Axiom charge_gas_in_globals : + IsInGlobals globals "charge_gas" (make_function charge_gas). + Definition calculate_memory_gas_cost : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "size_in_bytes" ] in @@ -560,6 +563,9 @@ Definition calculate_memory_gas_cost : Value.t -> Value.t -> M := (* At stmt: unsupported node type: Try *) M.pure Constant.None_)). +Axiom calculate_memory_gas_cost_in_globals : + IsInGlobals globals "calculate_memory_gas_cost" (make_function calculate_memory_gas_cost). + Definition calculate_gas_extend_memory : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "memory"; "extensions" ] in @@ -743,6 +749,9 @@ Definition calculate_gas_extend_memory : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom calculate_gas_extend_memory_in_globals : + IsInGlobals globals "calculate_gas_extend_memory" (make_function calculate_gas_extend_memory). + Definition calculate_message_call_gas : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "state"; "gas"; "to"; "value" ] in @@ -856,3 +865,6 @@ BinOp.add (| |) |) in M.pure Constant.None_)). + +Axiom calculate_message_call_gas_in_globals : + IsInGlobals globals "calculate_message_call_gas" (make_function calculate_message_call_gas). diff --git a/CoqOfPython/ethereum/dao_fork/vm/instructions/arithmetic.v b/CoqOfPython/ethereum/dao_fork/vm/instructions/arithmetic.v index df4766a..cc23957 100644 --- a/CoqOfPython/ethereum/dao_fork/vm/instructions/arithmetic.v +++ b/CoqOfPython/ethereum/dao_fork/vm/instructions/arithmetic.v @@ -119,6 +119,9 @@ Definition add : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom add_in_globals : + IsInGlobals globals "add" (make_function add). + Definition sub : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -186,6 +189,9 @@ Definition sub : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom sub_in_globals : + IsInGlobals globals "sub" (make_function sub). + Definition mul : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -253,6 +259,9 @@ Definition mul : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom mul_in_globals : + IsInGlobals globals "mul" (make_function mul). + Definition div : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -341,6 +350,9 @@ Definition div : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom div_in_globals : + IsInGlobals globals "div" (make_function div). + Definition sdiv : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -491,6 +503,9 @@ Definition sdiv : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom sdiv_in_globals : + IsInGlobals globals "sdiv" (make_function sdiv). + Definition mod_ : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -579,6 +594,9 @@ Definition mod_ : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom mod__in_globals : + IsInGlobals globals "mod" (make_function mod_). + Definition smod : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -696,6 +714,9 @@ Definition smod : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom smod_in_globals : + IsInGlobals globals "smod" (make_function smod). + Definition addmod : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -821,6 +842,9 @@ Definition addmod : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom addmod_in_globals : + IsInGlobals globals "addmod" (make_function addmod). + Definition mulmod : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -946,6 +970,9 @@ Definition mulmod : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom mulmod_in_globals : + IsInGlobals globals "mulmod" (make_function mulmod). + Definition exp : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -1057,6 +1084,9 @@ Definition exp : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom exp_in_globals : + IsInGlobals globals "exp" (make_function exp). + Definition signextend : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -1231,3 +1261,6 @@ Definition signextend : Value.t -> Value.t -> M := Constant.int 1 |) in M.pure Constant.None_)). + +Axiom signextend_in_globals : + IsInGlobals globals "signextend" (make_function signextend). diff --git a/CoqOfPython/ethereum/dao_fork/vm/instructions/bitwise.v b/CoqOfPython/ethereum/dao_fork/vm/instructions/bitwise.v index 4e056ea..f96bb48 100644 --- a/CoqOfPython/ethereum/dao_fork/vm/instructions/bitwise.v +++ b/CoqOfPython/ethereum/dao_fork/vm/instructions/bitwise.v @@ -95,6 +95,9 @@ Definition bitwise_and : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom bitwise_and_in_globals : + IsInGlobals globals "bitwise_and" (make_function bitwise_and). + Definition bitwise_or : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -155,6 +158,9 @@ Definition bitwise_or : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom bitwise_or_in_globals : + IsInGlobals globals "bitwise_or" (make_function bitwise_or). + Definition bitwise_xor : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -215,6 +221,9 @@ Definition bitwise_xor : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom bitwise_xor_in_globals : + IsInGlobals globals "bitwise_xor" (make_function bitwise_xor). + Definition bitwise_not : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -262,6 +271,9 @@ Definition bitwise_not : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom bitwise_not_in_globals : + IsInGlobals globals "bitwise_not" (make_function bitwise_not). + Definition get_byte : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -377,3 +389,6 @@ Definition get_byte : Value.t -> Value.t -> M := Constant.int 1 |) in M.pure Constant.None_)). + +Axiom get_byte_in_globals : + IsInGlobals globals "get_byte" (make_function get_byte). diff --git a/CoqOfPython/ethereum/dao_fork/vm/instructions/block.v b/CoqOfPython/ethereum/dao_fork/vm/instructions/block.v index 6cf1947..6c3a4f0 100644 --- a/CoqOfPython/ethereum/dao_fork/vm/instructions/block.v +++ b/CoqOfPython/ethereum/dao_fork/vm/instructions/block.v @@ -129,6 +129,9 @@ Definition block_hash : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom block_hash_in_globals : + IsInGlobals globals "block_hash" (make_function block_hash). + Definition coinbase : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -176,6 +179,9 @@ Definition coinbase : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom coinbase_in_globals : + IsInGlobals globals "coinbase" (make_function coinbase). + Definition timestamp : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -217,6 +223,9 @@ Definition timestamp : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom timestamp_in_globals : + IsInGlobals globals "timestamp" (make_function timestamp). + Definition number : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -263,6 +272,9 @@ Definition number : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom number_in_globals : + IsInGlobals globals "number" (make_function number). + Definition difficulty : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -309,6 +321,9 @@ Definition difficulty : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom difficulty_in_globals : + IsInGlobals globals "difficulty" (make_function difficulty). + Definition gas_limit : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -354,3 +369,6 @@ Definition gas_limit : Value.t -> Value.t -> M := Constant.int 1 |) in M.pure Constant.None_)). + +Axiom gas_limit_in_globals : + IsInGlobals globals "gas_limit" (make_function gas_limit). diff --git a/CoqOfPython/ethereum/dao_fork/vm/instructions/comparison.v b/CoqOfPython/ethereum/dao_fork/vm/instructions/comparison.v index d8563d6..4c240e8 100644 --- a/CoqOfPython/ethereum/dao_fork/vm/instructions/comparison.v +++ b/CoqOfPython/ethereum/dao_fork/vm/instructions/comparison.v @@ -105,6 +105,9 @@ Definition less_than : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom less_than_in_globals : + IsInGlobals globals "less_than" (make_function less_than). + Definition signed_less_than : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -182,6 +185,9 @@ Definition signed_less_than : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom signed_less_than_in_globals : + IsInGlobals globals "signed_less_than" (make_function signed_less_than). + Definition greater_than : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -252,6 +258,9 @@ Definition greater_than : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom greater_than_in_globals : + IsInGlobals globals "greater_than" (make_function greater_than). + Definition signed_greater_than : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -329,6 +338,9 @@ Definition signed_greater_than : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom signed_greater_than_in_globals : + IsInGlobals globals "signed_greater_than" (make_function signed_greater_than). + Definition equal : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -399,6 +411,9 @@ Definition equal : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom equal_in_globals : + IsInGlobals globals "equal" (make_function equal). + Definition is_zero : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -458,3 +473,6 @@ Definition is_zero : Value.t -> Value.t -> M := Constant.int 1 |) in M.pure Constant.None_)). + +Axiom is_zero_in_globals : + IsInGlobals globals "is_zero" (make_function is_zero). diff --git a/CoqOfPython/ethereum/dao_fork/vm/instructions/control_flow.v b/CoqOfPython/ethereum/dao_fork/vm/instructions/control_flow.v index 9eaff64..b2ee0b4 100644 --- a/CoqOfPython/ethereum/dao_fork/vm/instructions/control_flow.v +++ b/CoqOfPython/ethereum/dao_fork/vm/instructions/control_flow.v @@ -71,6 +71,9 @@ Definition stop : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom stop_in_globals : + IsInGlobals globals "stop" (make_function stop). + Definition jump : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -136,6 +139,9 @@ Definition jump : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom jump_in_globals : + IsInGlobals globals "jump" (make_function jump). + Definition jumpi : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -237,6 +243,9 @@ Definition jumpi : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom jumpi_in_globals : + IsInGlobals globals "jumpi" (make_function jumpi). + Definition pc : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -281,6 +290,9 @@ Definition pc : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom pc_in_globals : + IsInGlobals globals "pc" (make_function pc). + Definition gas_left : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -325,6 +337,9 @@ Definition gas_left : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom gas_left_in_globals : + IsInGlobals globals "gas_left" (make_function gas_left). + Definition jumpdest : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -356,3 +371,6 @@ Definition jumpdest : Value.t -> Value.t -> M := Constant.int 1 |) in M.pure Constant.None_)). + +Axiom jumpdest_in_globals : + IsInGlobals globals "jumpdest" (make_function jumpdest). diff --git a/CoqOfPython/ethereum/dao_fork/vm/instructions/environment.v b/CoqOfPython/ethereum/dao_fork/vm/instructions/environment.v index 9c28d5a..b5e32ef 100644 --- a/CoqOfPython/ethereum/dao_fork/vm/instructions/environment.v +++ b/CoqOfPython/ethereum/dao_fork/vm/instructions/environment.v @@ -104,6 +104,9 @@ Definition address : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom address_in_globals : + IsInGlobals globals "address" (make_function address). + Definition balance : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -167,6 +170,9 @@ Definition balance : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom balance_in_globals : + IsInGlobals globals "balance" (make_function balance). + Definition origin : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -211,6 +217,9 @@ Definition origin : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom origin_in_globals : + IsInGlobals globals "origin" (make_function origin). + Definition caller : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -254,6 +263,9 @@ Definition caller : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom caller_in_globals : + IsInGlobals globals "caller" (make_function caller). + Definition callvalue : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -291,6 +303,9 @@ Definition callvalue : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom callvalue_in_globals : + IsInGlobals globals "callvalue" (make_function callvalue). + Definition calldataload : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -362,6 +377,9 @@ Definition calldataload : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom calldataload_in_globals : + IsInGlobals globals "calldataload" (make_function calldataload). + Definition calldatasize : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -411,6 +429,9 @@ Definition calldatasize : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom calldatasize_in_globals : + IsInGlobals globals "calldatasize" (make_function calldatasize). + Definition calldatacopy : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -546,6 +567,9 @@ Definition calldatacopy : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom calldatacopy_in_globals : + IsInGlobals globals "calldatacopy" (make_function calldatacopy). + Definition codesize : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -595,6 +619,9 @@ Definition codesize : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom codesize_in_globals : + IsInGlobals globals "codesize" (make_function codesize). + Definition codecopy : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -730,6 +757,9 @@ Definition codecopy : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom codecopy_in_globals : + IsInGlobals globals "codecopy" (make_function codecopy). + Definition gasprice : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -773,6 +803,9 @@ Definition gasprice : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom gasprice_in_globals : + IsInGlobals globals "gasprice" (make_function gasprice). + Definition extcodesize : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -848,6 +881,9 @@ Definition extcodesize : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom extcodesize_in_globals : + IsInGlobals globals "extcodesize" (make_function extcodesize). + Definition extcodecopy : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -1006,3 +1042,6 @@ Definition extcodecopy : Value.t -> Value.t -> M := Constant.int 1 |) in M.pure Constant.None_)). + +Axiom extcodecopy_in_globals : + IsInGlobals globals "extcodecopy" (make_function extcodecopy). diff --git a/CoqOfPython/ethereum/dao_fork/vm/instructions/keccak.v b/CoqOfPython/ethereum/dao_fork/vm/instructions/keccak.v index 5d1d7bb..fc54a83 100644 --- a/CoqOfPython/ethereum/dao_fork/vm/instructions/keccak.v +++ b/CoqOfPython/ethereum/dao_fork/vm/instructions/keccak.v @@ -189,3 +189,6 @@ Definition keccak : Value.t -> Value.t -> M := Constant.int 1 |) in M.pure Constant.None_)). + +Axiom keccak_in_globals : + IsInGlobals globals "keccak" (make_function keccak). diff --git a/CoqOfPython/ethereum/dao_fork/vm/instructions/log.v b/CoqOfPython/ethereum/dao_fork/vm/instructions/log.v index 04aa853..2f2410d 100644 --- a/CoqOfPython/ethereum/dao_fork/vm/instructions/log.v +++ b/CoqOfPython/ethereum/dao_fork/vm/instructions/log.v @@ -194,6 +194,9 @@ Definition log_n : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom log_n_in_globals : + IsInGlobals globals "log_n" (make_function log_n). + Definition log0 : Value.t := M.run ltac:(M.monadic ( M.call (| M.get_name (| globals, locals_stack, "partial" |), diff --git a/CoqOfPython/ethereum/dao_fork/vm/instructions/memory.v b/CoqOfPython/ethereum/dao_fork/vm/instructions/memory.v index 7d3e36c..22655f0 100644 --- a/CoqOfPython/ethereum/dao_fork/vm/instructions/memory.v +++ b/CoqOfPython/ethereum/dao_fork/vm/instructions/memory.v @@ -145,6 +145,9 @@ Definition mstore : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom mstore_in_globals : + IsInGlobals globals "mstore" (make_function mstore). + Definition mstore8 : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -249,6 +252,9 @@ Definition mstore8 : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom mstore8_in_globals : + IsInGlobals globals "mstore8" (make_function mstore8). + Definition mload : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -349,6 +355,9 @@ Definition mload : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom mload_in_globals : + IsInGlobals globals "mload" (make_function mload). + Definition msize : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -397,3 +406,6 @@ Definition msize : Value.t -> Value.t -> M := Constant.int 1 |) in M.pure Constant.None_)). + +Axiom msize_in_globals : + IsInGlobals globals "msize" (make_function msize). diff --git a/CoqOfPython/ethereum/dao_fork/vm/instructions/stack.v b/CoqOfPython/ethereum/dao_fork/vm/instructions/stack.v index c196941..1501cfc 100644 --- a/CoqOfPython/ethereum/dao_fork/vm/instructions/stack.v +++ b/CoqOfPython/ethereum/dao_fork/vm/instructions/stack.v @@ -82,6 +82,9 @@ Definition pop : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom pop_in_globals : + IsInGlobals globals "pop" (make_function pop). + Definition push_n : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm"; "num_bytes" ] in @@ -159,6 +162,9 @@ Definition push_n : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom push_n_in_globals : + IsInGlobals globals "push_n" (make_function push_n). + Definition dup_n : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm"; "item_number" ] in @@ -236,6 +242,9 @@ Definition dup_n : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom dup_n_in_globals : + IsInGlobals globals "dup_n" (make_function dup_n). + Definition swap_n : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm"; "item_number" ] in @@ -312,6 +321,9 @@ Definition swap_n : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom swap_n_in_globals : + IsInGlobals globals "swap_n" (make_function swap_n). + Definition push1 : Value.t := M.run ltac:(M.monadic ( M.call (| M.get_name (| globals, locals_stack, "partial" |), diff --git a/CoqOfPython/ethereum/dao_fork/vm/instructions/storage.v b/CoqOfPython/ethereum/dao_fork/vm/instructions/storage.v index 7039b79..97ec87f 100644 --- a/CoqOfPython/ethereum/dao_fork/vm/instructions/storage.v +++ b/CoqOfPython/ethereum/dao_fork/vm/instructions/storage.v @@ -106,6 +106,9 @@ Definition sload : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom sload_in_globals : + IsInGlobals globals "sload" (make_function sload). + Definition sstore : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -236,3 +239,6 @@ Definition sstore : Value.t -> Value.t -> M := Constant.int 1 |) in M.pure Constant.None_)). + +Axiom sstore_in_globals : + IsInGlobals globals "sstore" (make_function sstore). diff --git a/CoqOfPython/ethereum/dao_fork/vm/instructions/system.v b/CoqOfPython/ethereum/dao_fork/vm/instructions/system.v index c356eeb..0d87df4 100644 --- a/CoqOfPython/ethereum/dao_fork/vm/instructions/system.v +++ b/CoqOfPython/ethereum/dao_fork/vm/instructions/system.v @@ -404,6 +404,9 @@ Definition create : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom create_in_globals : + IsInGlobals globals "create" (make_function create). + Definition return_ : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -487,6 +490,9 @@ Definition return_ : Value.t -> Value.t -> M := let _ := M.pass (| |) in M.pure Constant.None_)). +Axiom return__in_globals : + IsInGlobals globals "return_" (make_function return_). + Definition generic_call : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm"; "gas"; "value"; "caller"; "to"; "code_address"; "should_transfer_value"; "memory_input_start_position"; "memory_input_size"; "memory_output_start_position"; "memory_output_size" ] in @@ -670,6 +676,9 @@ Definition generic_call : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom generic_call_in_globals : + IsInGlobals globals "generic_call" (make_function generic_call). + Definition call : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -878,6 +887,9 @@ Definition call : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom call_in_globals : + IsInGlobals globals "call" (make_function call). + Definition callcode : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -1090,6 +1102,9 @@ Definition callcode : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom callcode_in_globals : + IsInGlobals globals "callcode" (make_function callcode). + Definition selfdestruct : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -1248,6 +1263,9 @@ Definition selfdestruct : Value.t -> Value.t -> M := let _ := M.pass (| |) in M.pure Constant.None_)). +Axiom selfdestruct_in_globals : + IsInGlobals globals "selfdestruct" (make_function selfdestruct). + Definition delegatecall : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -1391,3 +1409,6 @@ Definition delegatecall : Value.t -> Value.t -> M := Constant.int 1 |) in M.pure Constant.None_)). + +Axiom delegatecall_in_globals : + IsInGlobals globals "delegatecall" (make_function delegatecall). diff --git a/CoqOfPython/ethereum/dao_fork/vm/interpreter.v b/CoqOfPython/ethereum/dao_fork/vm/interpreter.v index 1c5a366..fa172b4 100644 --- a/CoqOfPython/ethereum/dao_fork/vm/interpreter.v +++ b/CoqOfPython/ethereum/dao_fork/vm/interpreter.v @@ -325,6 +325,9 @@ Definition process_message_call : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom process_message_call_in_globals : + IsInGlobals globals "process_message_call" (make_function process_message_call). + Definition process_create_message : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "message"; "env" ] in @@ -403,6 +406,9 @@ Definition process_create_message : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom process_create_message_in_globals : + IsInGlobals globals "process_create_message" (make_function process_create_message). + Definition process_message : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "message"; "env" ] in @@ -528,6 +534,9 @@ Definition process_message : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom process_message_in_globals : + IsInGlobals globals "process_message" (make_function process_message). + Definition execute_code : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "message"; "env" ] in @@ -574,3 +583,6 @@ Definition execute_code : Value.t -> Value.t -> M := M.get_name (| globals, locals_stack, "evm" |) |) in M.pure Constant.None_)). + +Axiom execute_code_in_globals : + IsInGlobals globals "execute_code" (make_function execute_code). diff --git a/CoqOfPython/ethereum/dao_fork/vm/memory.v b/CoqOfPython/ethereum/dao_fork/vm/memory.v index ea3e10e..574da65 100644 --- a/CoqOfPython/ethereum/dao_fork/vm/memory.v +++ b/CoqOfPython/ethereum/dao_fork/vm/memory.v @@ -71,6 +71,9 @@ Definition memory_write : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom memory_write_in_globals : + IsInGlobals globals "memory_write" (make_function memory_write). + Definition memory_read_bytes : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "memory"; "start_position"; "size" ] in @@ -117,6 +120,9 @@ Definition memory_read_bytes : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom memory_read_bytes_in_globals : + IsInGlobals globals "memory_read_bytes" (make_function memory_read_bytes). + Definition buffer_read : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "buffer"; "start_position"; "size" ] in @@ -169,3 +175,6 @@ Definition buffer_read : Value.t -> Value.t -> M := |) |) in M.pure Constant.None_)). + +Axiom buffer_read_in_globals : + IsInGlobals globals "buffer_read" (make_function buffer_read). diff --git a/CoqOfPython/ethereum/dao_fork/vm/precompiled_contracts/ecrecover.v b/CoqOfPython/ethereum/dao_fork/vm/precompiled_contracts/ecrecover.v index 48739c7..b474dad 100644 --- a/CoqOfPython/ethereum/dao_fork/vm/precompiled_contracts/ecrecover.v +++ b/CoqOfPython/ethereum/dao_fork/vm/precompiled_contracts/ecrecover.v @@ -302,3 +302,6 @@ Definition ecrecover : Value.t -> Value.t -> M := M.get_name (| globals, locals_stack, "padded_address" |) |) in M.pure Constant.None_)). + +Axiom ecrecover_in_globals : + IsInGlobals globals "ecrecover" (make_function ecrecover). diff --git a/CoqOfPython/ethereum/dao_fork/vm/precompiled_contracts/identity.v b/CoqOfPython/ethereum/dao_fork/vm/precompiled_contracts/identity.v index 1355def..da65952 100644 --- a/CoqOfPython/ethereum/dao_fork/vm/precompiled_contracts/identity.v +++ b/CoqOfPython/ethereum/dao_fork/vm/precompiled_contracts/identity.v @@ -95,3 +95,6 @@ Definition identity : Value.t -> Value.t -> M := M.get_name (| globals, locals_stack, "data" |) |) in M.pure Constant.None_)). + +Axiom identity_in_globals : + IsInGlobals globals "identity" (make_function identity). diff --git a/CoqOfPython/ethereum/dao_fork/vm/precompiled_contracts/ripemd160.v b/CoqOfPython/ethereum/dao_fork/vm/precompiled_contracts/ripemd160.v index df73567..8a204e9 100644 --- a/CoqOfPython/ethereum/dao_fork/vm/precompiled_contracts/ripemd160.v +++ b/CoqOfPython/ethereum/dao_fork/vm/precompiled_contracts/ripemd160.v @@ -126,3 +126,6 @@ Definition ripemd160 : Value.t -> Value.t -> M := M.get_name (| globals, locals_stack, "padded_hash" |) |) in M.pure Constant.None_)). + +Axiom ripemd160_in_globals : + IsInGlobals globals "ripemd160" (make_function ripemd160). diff --git a/CoqOfPython/ethereum/dao_fork/vm/precompiled_contracts/sha256.v b/CoqOfPython/ethereum/dao_fork/vm/precompiled_contracts/sha256.v index db2377c..5e98bdf 100644 --- a/CoqOfPython/ethereum/dao_fork/vm/precompiled_contracts/sha256.v +++ b/CoqOfPython/ethereum/dao_fork/vm/precompiled_contracts/sha256.v @@ -107,3 +107,6 @@ Definition sha256 : Value.t -> Value.t -> M := |) |) in M.pure Constant.None_)). + +Axiom sha256_in_globals : + IsInGlobals globals "sha256" (make_function sha256). diff --git a/CoqOfPython/ethereum/dao_fork/vm/runtime.v b/CoqOfPython/ethereum/dao_fork/vm/runtime.v index acf2069..fb5f199 100644 --- a/CoqOfPython/ethereum/dao_fork/vm/runtime.v +++ b/CoqOfPython/ethereum/dao_fork/vm/runtime.v @@ -158,3 +158,6 @@ Definition get_valid_jump_destinations : Value.t -> Value.t -> M := M.get_name (| globals, locals_stack, "valid_jump_destinations" |) |) in M.pure Constant.None_)). + +Axiom get_valid_jump_destinations_in_globals : + IsInGlobals globals "get_valid_jump_destinations" (make_function get_valid_jump_destinations). diff --git a/CoqOfPython/ethereum/dao_fork/vm/stack.v b/CoqOfPython/ethereum/dao_fork/vm/stack.v index 67bc666..efabefe 100644 --- a/CoqOfPython/ethereum/dao_fork/vm/stack.v +++ b/CoqOfPython/ethereum/dao_fork/vm/stack.v @@ -78,6 +78,9 @@ Definition pop : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom pop_in_globals : + IsInGlobals globals "pop" (make_function pop). + Definition push : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "stack"; "value" ] in @@ -125,3 +128,6 @@ Definition push : Value.t -> Value.t -> M := |) |) in M.pure Constant.None_)). + +Axiom push_in_globals : + IsInGlobals globals "push" (make_function push). diff --git a/CoqOfPython/ethereum/ethash.v b/CoqOfPython/ethereum/ethash.v index 92b7c5f..6ad780f 100644 --- a/CoqOfPython/ethereum/ethash.v +++ b/CoqOfPython/ethereum/ethash.v @@ -218,6 +218,9 @@ Definition epoch : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom epoch_in_globals : + IsInGlobals globals "epoch" (make_function epoch). + Definition cache_size : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "block_number" ] in @@ -292,6 +295,9 @@ Definition cache_size : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom cache_size_in_globals : + IsInGlobals globals "cache_size" (make_function cache_size). + Definition dataset_size : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "block_number" ] in @@ -368,6 +374,9 @@ Definition dataset_size : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom dataset_size_in_globals : + IsInGlobals globals "dataset_size" (make_function dataset_size). + Definition generate_seed : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "block_number" ] in @@ -434,6 +443,9 @@ Definition generate_seed : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom generate_seed_in_globals : + IsInGlobals globals "generate_seed" (make_function generate_seed). + Definition generate_cache : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "block_number" ] in @@ -644,6 +656,9 @@ Definition generate_cache : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom generate_cache_in_globals : + IsInGlobals globals "generate_cache" (make_function generate_cache). + Definition fnv : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "a"; "b" ] in @@ -699,6 +714,9 @@ Definition fnv : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom fnv_in_globals : + IsInGlobals globals "fnv" (make_function fnv). + Definition fnv_hash : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "mix_integers"; "data" ] in @@ -722,6 +740,9 @@ Definition fnv_hash : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom fnv_hash_in_globals : + IsInGlobals globals "fnv_hash" (make_function fnv_hash). + Definition generate_dataset_item : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "cache"; "index" ] in @@ -869,6 +890,9 @@ Definition generate_dataset_item : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom generate_dataset_item_in_globals : + IsInGlobals globals "generate_dataset_item" (make_function generate_dataset_item). + Definition generate_dataset : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "block_number" ] in @@ -892,6 +916,9 @@ Definition generate_dataset : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom generate_dataset_in_globals : + IsInGlobals globals "generate_dataset" (make_function generate_dataset). + Definition hashimoto : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "header_hash"; "nonce"; "dataset_size"; "fetch_dataset_item" ] in @@ -1191,6 +1218,9 @@ Definition hashimoto : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom hashimoto_in_globals : + IsInGlobals globals "hashimoto" (make_function hashimoto). + Definition hashimoto_light : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "header_hash"; "nonce"; "cache"; "dataset_size" ] in @@ -1231,3 +1261,6 @@ Definition hashimoto_light : Value.t -> Value.t -> M := |) |) in M.pure Constant.None_)). + +Axiom hashimoto_light_in_globals : + IsInGlobals globals "hashimoto_light" (make_function hashimoto_light). diff --git a/CoqOfPython/ethereum/frontier/bloom.v b/CoqOfPython/ethereum/frontier/bloom.v index 9450670..09ced28 100644 --- a/CoqOfPython/ethereum/frontier/bloom.v +++ b/CoqOfPython/ethereum/frontier/bloom.v @@ -140,6 +140,9 @@ Definition add_to_bloom : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom add_to_bloom_in_globals : + IsInGlobals globals "add_to_bloom" (make_function add_to_bloom). + Definition logs_bloom : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "logs" ] in @@ -209,3 +212,6 @@ Definition logs_bloom : Value.t -> Value.t -> M := |) |) in M.pure Constant.None_)). + +Axiom logs_bloom_in_globals : + IsInGlobals globals "logs_bloom" (make_function logs_bloom). diff --git a/CoqOfPython/ethereum/frontier/fork.v b/CoqOfPython/ethereum/frontier/fork.v index 2468924..3050de5 100644 --- a/CoqOfPython/ethereum/frontier/fork.v +++ b/CoqOfPython/ethereum/frontier/fork.v @@ -204,6 +204,9 @@ Definition apply_fork : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom apply_fork_in_globals : + IsInGlobals globals "apply_fork" (make_function apply_fork). + Definition get_last_256_block_hashes : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "chain" ] in @@ -316,6 +319,9 @@ Definition get_last_256_block_hashes : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom get_last_256_block_hashes_in_globals : + IsInGlobals globals "get_last_256_block_hashes" (make_function get_last_256_block_hashes). + Definition state_transition : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "chain"; "block" ] in @@ -482,6 +488,9 @@ Definition state_transition : Value.t -> Value.t -> M := )) |) in M.pure Constant.None_)). +Axiom state_transition_in_globals : + IsInGlobals globals "state_transition" (make_function state_transition). + Definition validate_header : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "header"; "parent_header" ] in @@ -620,6 +629,9 @@ Definition validate_header : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom validate_header_in_globals : + IsInGlobals globals "validate_header" (make_function validate_header). + Definition generate_header_hash_for_pow : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "header" ] in @@ -675,6 +687,9 @@ Definition generate_header_hash_for_pow : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom generate_header_hash_for_pow_in_globals : + IsInGlobals globals "generate_header_hash_for_pow" (make_function generate_header_hash_for_pow). + Definition validate_proof_of_work : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "header" ] in @@ -765,6 +780,9 @@ Definition validate_proof_of_work : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom validate_proof_of_work_in_globals : + IsInGlobals globals "validate_proof_of_work" (make_function validate_proof_of_work). + Definition check_transaction : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "tx"; "gas_available" ] in @@ -815,6 +833,9 @@ Definition check_transaction : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom check_transaction_in_globals : + IsInGlobals globals "check_transaction" (make_function check_transaction). + Definition make_receipt : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "tx"; "post_state"; "cumulative_gas_used"; "logs" ] in @@ -852,6 +873,9 @@ Definition make_receipt : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom make_receipt_in_globals : + IsInGlobals globals "make_receipt" (make_function make_receipt). + Definition ApplyBodyOutput : Value.t := builtins.make_klass [] @@ -1092,6 +1116,9 @@ Definition apply_body : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom apply_body_in_globals : + IsInGlobals globals "apply_body" (make_function apply_body). + Definition validate_ommers : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "ommers"; "block_header"; "chain" ] in @@ -1413,6 +1440,9 @@ Definition validate_ommers : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom validate_ommers_in_globals : + IsInGlobals globals "validate_ommers" (make_function validate_ommers). + Definition pay_rewards : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "state"; "block_number"; "coinbase"; "ommers" ] in @@ -1518,6 +1548,9 @@ Definition pay_rewards : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom pay_rewards_in_globals : + IsInGlobals globals "pay_rewards" (make_function pay_rewards). + Definition process_transaction : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "env"; "tx" ] in @@ -1808,6 +1841,9 @@ Definition process_transaction : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom process_transaction_in_globals : + IsInGlobals globals "process_transaction" (make_function process_transaction). + Definition validate_transaction : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "tx" ] in @@ -1864,6 +1900,9 @@ Definition validate_transaction : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom validate_transaction_in_globals : + IsInGlobals globals "validate_transaction" (make_function validate_transaction). + Definition calculate_intrinsic_cost : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "tx" ] in @@ -1943,6 +1982,9 @@ Definition calculate_intrinsic_cost : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom calculate_intrinsic_cost_in_globals : + IsInGlobals globals "calculate_intrinsic_cost" (make_function calculate_intrinsic_cost). + Definition recover_sender : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "tx" ] in @@ -2071,6 +2113,9 @@ Definition recover_sender : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom recover_sender_in_globals : + IsInGlobals globals "recover_sender" (make_function recover_sender). + Definition signing_hash : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "tx" ] in @@ -2109,6 +2154,9 @@ Definition signing_hash : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom signing_hash_in_globals : + IsInGlobals globals "signing_hash" (make_function signing_hash). + Definition compute_header_hash : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "header" ] in @@ -2161,6 +2209,9 @@ Definition compute_header_hash : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom compute_header_hash_in_globals : + IsInGlobals globals "compute_header_hash" (make_function compute_header_hash). + Definition check_gas_limit : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "gas_limit"; "parent_gas_limit" ] in @@ -2261,6 +2312,9 @@ Definition check_gas_limit : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom check_gas_limit_in_globals : + IsInGlobals globals "check_gas_limit" (make_function check_gas_limit). + Definition calculate_block_difficulty : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "block_number"; "block_timestamp"; "parent_timestamp"; "parent_difficulty" ] in @@ -2387,3 +2441,6 @@ Definition calculate_block_difficulty : Value.t -> Value.t -> M := |) |) in M.pure Constant.None_)). + +Axiom calculate_block_difficulty_in_globals : + IsInGlobals globals "calculate_block_difficulty" (make_function calculate_block_difficulty). diff --git a/CoqOfPython/ethereum/frontier/fork_types.v b/CoqOfPython/ethereum/frontier/fork_types.v index 5da50e8..36db524 100644 --- a/CoqOfPython/ethereum/frontier/fork_types.v +++ b/CoqOfPython/ethereum/frontier/fork_types.v @@ -99,3 +99,6 @@ Definition encode_account : Value.t -> Value.t -> M := |) |) in M.pure Constant.None_)). + +Axiom encode_account_in_globals : + IsInGlobals globals "encode_account" (make_function encode_account). diff --git a/CoqOfPython/ethereum/frontier/state.v b/CoqOfPython/ethereum/frontier/state.v index 442525b..bafaf00 100644 --- a/CoqOfPython/ethereum/frontier/state.v +++ b/CoqOfPython/ethereum/frontier/state.v @@ -97,6 +97,9 @@ Definition close_state : Value.t -> Value.t -> M := let _ := M.delete (| M.get_field (| M.get_name (| globals, locals_stack, "state" |), "_snapshots" |) |) in M.pure Constant.None_)). +Axiom close_state_in_globals : + IsInGlobals globals "close_state" (make_function close_state). + Definition begin_transaction : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "state" ] in @@ -127,6 +130,9 @@ Definition begin_transaction : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom begin_transaction_in_globals : + IsInGlobals globals "begin_transaction" (make_function begin_transaction). + Definition commit_transaction : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "state" ] in @@ -146,6 +152,9 @@ Definition commit_transaction : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom commit_transaction_in_globals : + IsInGlobals globals "commit_transaction" (make_function commit_transaction). + Definition rollback_transaction : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "state" ] in @@ -169,6 +178,9 @@ Definition rollback_transaction : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom rollback_transaction_in_globals : + IsInGlobals globals "rollback_transaction" (make_function rollback_transaction). + Definition get_account : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "state"; "address" ] in @@ -229,6 +241,9 @@ Definition get_account : Value.t -> Value.t -> M := )) |) in M.pure Constant.None_)). +Axiom get_account_in_globals : + IsInGlobals globals "get_account" (make_function get_account). + Definition get_account_optional : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "state"; "address" ] in @@ -265,6 +280,9 @@ Definition get_account_optional : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom get_account_optional_in_globals : + IsInGlobals globals "get_account_optional" (make_function get_account_optional). + Definition set_account : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "state"; "address"; "account" ] in @@ -293,6 +311,9 @@ Definition set_account : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom set_account_in_globals : + IsInGlobals globals "set_account" (make_function set_account). + Definition destroy_account : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "state"; "address" ] in @@ -330,6 +351,9 @@ Definition destroy_account : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom destroy_account_in_globals : + IsInGlobals globals "destroy_account" (make_function destroy_account). + Definition destroy_storage : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "state"; "address" ] in @@ -364,6 +388,9 @@ Definition destroy_storage : Value.t -> Value.t -> M := )) |) in M.pure Constant.None_)). +Axiom destroy_storage_in_globals : + IsInGlobals globals "destroy_storage" (make_function destroy_storage). + Definition get_storage : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "state"; "address"; "key" ] in @@ -443,6 +470,9 @@ Definition get_storage : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom get_storage_in_globals : + IsInGlobals globals "get_storage" (make_function get_storage). + Definition set_storage : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "state"; "address"; "key"; "value" ] in @@ -541,6 +571,9 @@ Definition set_storage : Value.t -> Value.t -> M := )) |) in M.pure Constant.None_)). +Axiom set_storage_in_globals : + IsInGlobals globals "set_storage" (make_function set_storage). + Definition storage_root : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "state"; "address" ] in @@ -592,6 +625,9 @@ Definition storage_root : Value.t -> Value.t -> M := )) |) in M.pure Constant.None_)). +Axiom storage_root_in_globals : + IsInGlobals globals "storage_root" (make_function storage_root). + Definition state_root : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "state" ] in @@ -622,6 +658,9 @@ Definition state_root : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom state_root_in_globals : + IsInGlobals globals "state_root" (make_function state_root). + Definition account_exists : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "state"; "address" ] in @@ -656,6 +695,9 @@ Definition account_exists : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom account_exists_in_globals : + IsInGlobals globals "account_exists" (make_function account_exists). + Definition account_has_code_or_nonce : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "state"; "address" ] in @@ -709,6 +751,9 @@ Definition account_has_code_or_nonce : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom account_has_code_or_nonce_in_globals : + IsInGlobals globals "account_has_code_or_nonce" (make_function account_has_code_or_nonce). + Definition modify_state : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "state"; "address"; "f" ] in @@ -741,6 +786,9 @@ Definition modify_state : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom modify_state_in_globals : + IsInGlobals globals "modify_state" (make_function modify_state). + Definition move_ether : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "state"; "sender_address"; "recipient_address"; "amount" ] in @@ -770,6 +818,9 @@ Definition move_ether : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom move_ether_in_globals : + IsInGlobals globals "move_ether" (make_function move_ether). + Definition set_account_balance : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "state"; "address"; "amount" ] in @@ -800,6 +851,9 @@ Definition set_account_balance : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom set_account_balance_in_globals : + IsInGlobals globals "set_account_balance" (make_function set_account_balance). + Definition touch_account : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "state"; "address" ] in @@ -844,6 +898,9 @@ Definition touch_account : Value.t -> Value.t -> M := )) |) in M.pure Constant.None_)). +Axiom touch_account_in_globals : + IsInGlobals globals "touch_account" (make_function touch_account). + Definition increment_nonce : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "state"; "address" ] in @@ -871,6 +928,9 @@ Definition increment_nonce : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom increment_nonce_in_globals : + IsInGlobals globals "increment_nonce" (make_function increment_nonce). + Definition set_code : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "state"; "address"; "code" ] in @@ -901,6 +961,9 @@ Definition set_code : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom set_code_in_globals : + IsInGlobals globals "set_code" (make_function set_code). + Definition create_ether : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "state"; "address"; "amount" ] in @@ -928,3 +991,6 @@ Definition create_ether : Value.t -> Value.t -> M := make_dict [] |) in M.pure Constant.None_)). + +Axiom create_ether_in_globals : + IsInGlobals globals "create_ether" (make_function create_ether). diff --git a/CoqOfPython/ethereum/frontier/trie.v b/CoqOfPython/ethereum/frontier/trie.v index a8b7741..ddc6426 100644 --- a/CoqOfPython/ethereum/frontier/trie.v +++ b/CoqOfPython/ethereum/frontier/trie.v @@ -362,6 +362,9 @@ Definition encode_internal_node : Value.t -> Value.t -> M := )) |) in M.pure Constant.None_)). +Axiom encode_internal_node_in_globals : + IsInGlobals globals "encode_internal_node" (make_function encode_internal_node). + Definition encode_node : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "node"; "storage_root" ] in @@ -467,6 +470,9 @@ Definition encode_node : Value.t -> Value.t -> M := )) |) in M.pure Constant.None_)). +Axiom encode_node_in_globals : + IsInGlobals globals "encode_node" (make_function encode_node). + Definition Trie : Value.t := builtins.make_klass [(* At base: unsupported node type: Subscript *)] @@ -514,6 +520,9 @@ Definition copy_trie : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom copy_trie_in_globals : + IsInGlobals globals "copy_trie" (make_function copy_trie). + Definition trie_set : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "trie"; "key"; "value" ] in @@ -574,6 +583,9 @@ Definition trie_set : Value.t -> Value.t -> M := )) |) in M.pure Constant.None_)). +Axiom trie_set_in_globals : + IsInGlobals globals "trie_set" (make_function trie_set). + Definition trie_get : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "trie"; "key" ] in @@ -607,6 +619,9 @@ Definition trie_get : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom trie_get_in_globals : + IsInGlobals globals "trie_get" (make_function trie_get). + Definition common_prefix_length : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "a"; "b" ] in @@ -685,6 +700,9 @@ Definition common_prefix_length : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom common_prefix_length_in_globals : + IsInGlobals globals "common_prefix_length" (make_function common_prefix_length). + Definition nibble_list_to_compact : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "x"; "is_leaf" ] in @@ -893,6 +911,9 @@ Definition nibble_list_to_compact : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom nibble_list_to_compact_in_globals : + IsInGlobals globals "nibble_list_to_compact" (make_function nibble_list_to_compact). + Definition bytes_to_nibble_list : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "bytes_" ] in @@ -989,6 +1010,9 @@ Definition bytes_to_nibble_list : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom bytes_to_nibble_list_in_globals : + IsInGlobals globals "bytes_to_nibble_list" (make_function bytes_to_nibble_list). + Definition _prepare_trie : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "trie"; "get_storage_root" ] in @@ -1140,6 +1164,9 @@ Definition _prepare_trie : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom _prepare_trie_in_globals : + IsInGlobals globals "_prepare_trie" (make_function _prepare_trie). + Definition root : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "trie"; "get_storage_root" ] in @@ -1255,6 +1282,9 @@ Definition root : Value.t -> Value.t -> M := )) |) in M.pure Constant.None_)). +Axiom root_in_globals : + IsInGlobals globals "root" (make_function root). + Definition patricialize : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "obj"; "level" ] in @@ -1594,3 +1624,6 @@ Definition patricialize : Value.t -> Value.t -> M := |) |) in M.pure Constant.None_)). + +Axiom patricialize_in_globals : + IsInGlobals globals "patricialize" (make_function patricialize). diff --git a/CoqOfPython/ethereum/frontier/utils/address.v b/CoqOfPython/ethereum/frontier/utils/address.v index e45d41c..fea0b1e 100644 --- a/CoqOfPython/ethereum/frontier/utils/address.v +++ b/CoqOfPython/ethereum/frontier/utils/address.v @@ -76,6 +76,9 @@ Definition to_address : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom to_address_in_globals : + IsInGlobals globals "to_address" (make_function to_address). + Definition compute_contract_address : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "address"; "nonce" ] in @@ -145,3 +148,6 @@ Definition compute_contract_address : Value.t -> Value.t -> M := |) |) in M.pure Constant.None_)). + +Axiom compute_contract_address_in_globals : + IsInGlobals globals "compute_contract_address" (make_function compute_contract_address). diff --git a/CoqOfPython/ethereum/frontier/utils/hexadecimal.v b/CoqOfPython/ethereum/frontier/utils/hexadecimal.v index 8a7d1dc..ed0b2d0 100644 --- a/CoqOfPython/ethereum/frontier/utils/hexadecimal.v +++ b/CoqOfPython/ethereum/frontier/utils/hexadecimal.v @@ -70,6 +70,9 @@ Definition hex_to_root : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom hex_to_root_in_globals : + IsInGlobals globals "hex_to_root" (make_function hex_to_root). + Definition hex_to_bloom : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "hex_string" ] in @@ -110,6 +113,9 @@ Definition hex_to_bloom : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom hex_to_bloom_in_globals : + IsInGlobals globals "hex_to_bloom" (make_function hex_to_bloom). + Definition hex_to_address : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "hex_string" ] in @@ -156,3 +162,6 @@ Definition hex_to_address : Value.t -> Value.t -> M := |) |) in M.pure Constant.None_)). + +Axiom hex_to_address_in_globals : + IsInGlobals globals "hex_to_address" (make_function hex_to_address). diff --git a/CoqOfPython/ethereum/frontier/utils/message.v b/CoqOfPython/ethereum/frontier/utils/message.v index 910cde2..9a0e79c 100644 --- a/CoqOfPython/ethereum/frontier/utils/message.v +++ b/CoqOfPython/ethereum/frontier/utils/message.v @@ -207,3 +207,6 @@ Definition prepare_message : Value.t -> Value.t -> M := |) |) in M.pure Constant.None_)). + +Axiom prepare_message_in_globals : + IsInGlobals globals "prepare_message" (make_function prepare_message). diff --git a/CoqOfPython/ethereum/frontier/vm/__init__.v b/CoqOfPython/ethereum/frontier/vm/__init__.v index c7dd433..8324117 100644 --- a/CoqOfPython/ethereum/frontier/vm/__init__.v +++ b/CoqOfPython/ethereum/frontier/vm/__init__.v @@ -127,6 +127,9 @@ Definition incorporate_child_on_success : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom incorporate_child_on_success_in_globals : + IsInGlobals globals "incorporate_child_on_success" (make_function incorporate_child_on_success). + Definition incorporate_child_on_error : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm"; "child_evm" ] in @@ -147,3 +150,6 @@ Definition incorporate_child_on_error : Value.t -> Value.t -> M := M.get_field (| M.get_name (| globals, locals_stack, "child_evm" |), "gas_left" |) |) in M.pure Constant.None_)). + +Axiom incorporate_child_on_error_in_globals : + IsInGlobals globals "incorporate_child_on_error" (make_function incorporate_child_on_error). diff --git a/CoqOfPython/ethereum/frontier/vm/gas.v b/CoqOfPython/ethereum/frontier/vm/gas.v index 43ac4d4..8a4c58b 100644 --- a/CoqOfPython/ethereum/frontier/vm/gas.v +++ b/CoqOfPython/ethereum/frontier/vm/gas.v @@ -501,6 +501,9 @@ Definition charge_gas : Value.t -> Value.t -> M := )) |) in M.pure Constant.None_)). +Axiom charge_gas_in_globals : + IsInGlobals globals "charge_gas" (make_function charge_gas). + Definition calculate_memory_gas_cost : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "size_in_bytes" ] in @@ -560,6 +563,9 @@ Definition calculate_memory_gas_cost : Value.t -> Value.t -> M := (* At stmt: unsupported node type: Try *) M.pure Constant.None_)). +Axiom calculate_memory_gas_cost_in_globals : + IsInGlobals globals "calculate_memory_gas_cost" (make_function calculate_memory_gas_cost). + Definition calculate_gas_extend_memory : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "memory"; "extensions" ] in @@ -743,6 +749,9 @@ Definition calculate_gas_extend_memory : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom calculate_gas_extend_memory_in_globals : + IsInGlobals globals "calculate_gas_extend_memory" (make_function calculate_gas_extend_memory). + Definition calculate_message_call_gas : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "state"; "gas"; "to"; "value" ] in @@ -856,3 +865,6 @@ BinOp.add (| |) |) in M.pure Constant.None_)). + +Axiom calculate_message_call_gas_in_globals : + IsInGlobals globals "calculate_message_call_gas" (make_function calculate_message_call_gas). diff --git a/CoqOfPython/ethereum/frontier/vm/instructions/arithmetic.v b/CoqOfPython/ethereum/frontier/vm/instructions/arithmetic.v index e6bde37..3139f74 100644 --- a/CoqOfPython/ethereum/frontier/vm/instructions/arithmetic.v +++ b/CoqOfPython/ethereum/frontier/vm/instructions/arithmetic.v @@ -119,6 +119,9 @@ Definition add : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom add_in_globals : + IsInGlobals globals "add" (make_function add). + Definition sub : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -186,6 +189,9 @@ Definition sub : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom sub_in_globals : + IsInGlobals globals "sub" (make_function sub). + Definition mul : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -253,6 +259,9 @@ Definition mul : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom mul_in_globals : + IsInGlobals globals "mul" (make_function mul). + Definition div : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -341,6 +350,9 @@ Definition div : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom div_in_globals : + IsInGlobals globals "div" (make_function div). + Definition sdiv : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -491,6 +503,9 @@ Definition sdiv : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom sdiv_in_globals : + IsInGlobals globals "sdiv" (make_function sdiv). + Definition mod_ : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -579,6 +594,9 @@ Definition mod_ : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom mod__in_globals : + IsInGlobals globals "mod" (make_function mod_). + Definition smod : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -696,6 +714,9 @@ Definition smod : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom smod_in_globals : + IsInGlobals globals "smod" (make_function smod). + Definition addmod : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -821,6 +842,9 @@ Definition addmod : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom addmod_in_globals : + IsInGlobals globals "addmod" (make_function addmod). + Definition mulmod : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -946,6 +970,9 @@ Definition mulmod : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom mulmod_in_globals : + IsInGlobals globals "mulmod" (make_function mulmod). + Definition exp : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -1057,6 +1084,9 @@ Definition exp : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom exp_in_globals : + IsInGlobals globals "exp" (make_function exp). + Definition signextend : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -1231,3 +1261,6 @@ Definition signextend : Value.t -> Value.t -> M := Constant.int 1 |) in M.pure Constant.None_)). + +Axiom signextend_in_globals : + IsInGlobals globals "signextend" (make_function signextend). diff --git a/CoqOfPython/ethereum/frontier/vm/instructions/bitwise.v b/CoqOfPython/ethereum/frontier/vm/instructions/bitwise.v index 88a91e5..e4c6555 100644 --- a/CoqOfPython/ethereum/frontier/vm/instructions/bitwise.v +++ b/CoqOfPython/ethereum/frontier/vm/instructions/bitwise.v @@ -95,6 +95,9 @@ Definition bitwise_and : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom bitwise_and_in_globals : + IsInGlobals globals "bitwise_and" (make_function bitwise_and). + Definition bitwise_or : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -155,6 +158,9 @@ Definition bitwise_or : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom bitwise_or_in_globals : + IsInGlobals globals "bitwise_or" (make_function bitwise_or). + Definition bitwise_xor : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -215,6 +221,9 @@ Definition bitwise_xor : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom bitwise_xor_in_globals : + IsInGlobals globals "bitwise_xor" (make_function bitwise_xor). + Definition bitwise_not : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -262,6 +271,9 @@ Definition bitwise_not : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom bitwise_not_in_globals : + IsInGlobals globals "bitwise_not" (make_function bitwise_not). + Definition get_byte : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -377,3 +389,6 @@ Definition get_byte : Value.t -> Value.t -> M := Constant.int 1 |) in M.pure Constant.None_)). + +Axiom get_byte_in_globals : + IsInGlobals globals "get_byte" (make_function get_byte). diff --git a/CoqOfPython/ethereum/frontier/vm/instructions/block.v b/CoqOfPython/ethereum/frontier/vm/instructions/block.v index 0439581..15ed6e0 100644 --- a/CoqOfPython/ethereum/frontier/vm/instructions/block.v +++ b/CoqOfPython/ethereum/frontier/vm/instructions/block.v @@ -129,6 +129,9 @@ Definition block_hash : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom block_hash_in_globals : + IsInGlobals globals "block_hash" (make_function block_hash). + Definition coinbase : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -176,6 +179,9 @@ Definition coinbase : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom coinbase_in_globals : + IsInGlobals globals "coinbase" (make_function coinbase). + Definition timestamp : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -217,6 +223,9 @@ Definition timestamp : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom timestamp_in_globals : + IsInGlobals globals "timestamp" (make_function timestamp). + Definition number : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -263,6 +272,9 @@ Definition number : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom number_in_globals : + IsInGlobals globals "number" (make_function number). + Definition difficulty : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -309,6 +321,9 @@ Definition difficulty : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom difficulty_in_globals : + IsInGlobals globals "difficulty" (make_function difficulty). + Definition gas_limit : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -354,3 +369,6 @@ Definition gas_limit : Value.t -> Value.t -> M := Constant.int 1 |) in M.pure Constant.None_)). + +Axiom gas_limit_in_globals : + IsInGlobals globals "gas_limit" (make_function gas_limit). diff --git a/CoqOfPython/ethereum/frontier/vm/instructions/comparison.v b/CoqOfPython/ethereum/frontier/vm/instructions/comparison.v index 5b7be6f..1c313d1 100644 --- a/CoqOfPython/ethereum/frontier/vm/instructions/comparison.v +++ b/CoqOfPython/ethereum/frontier/vm/instructions/comparison.v @@ -105,6 +105,9 @@ Definition less_than : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom less_than_in_globals : + IsInGlobals globals "less_than" (make_function less_than). + Definition signed_less_than : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -182,6 +185,9 @@ Definition signed_less_than : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom signed_less_than_in_globals : + IsInGlobals globals "signed_less_than" (make_function signed_less_than). + Definition greater_than : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -252,6 +258,9 @@ Definition greater_than : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom greater_than_in_globals : + IsInGlobals globals "greater_than" (make_function greater_than). + Definition signed_greater_than : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -329,6 +338,9 @@ Definition signed_greater_than : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom signed_greater_than_in_globals : + IsInGlobals globals "signed_greater_than" (make_function signed_greater_than). + Definition equal : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -399,6 +411,9 @@ Definition equal : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom equal_in_globals : + IsInGlobals globals "equal" (make_function equal). + Definition is_zero : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -458,3 +473,6 @@ Definition is_zero : Value.t -> Value.t -> M := Constant.int 1 |) in M.pure Constant.None_)). + +Axiom is_zero_in_globals : + IsInGlobals globals "is_zero" (make_function is_zero). diff --git a/CoqOfPython/ethereum/frontier/vm/instructions/control_flow.v b/CoqOfPython/ethereum/frontier/vm/instructions/control_flow.v index 4f1d4d7..ea50ac4 100644 --- a/CoqOfPython/ethereum/frontier/vm/instructions/control_flow.v +++ b/CoqOfPython/ethereum/frontier/vm/instructions/control_flow.v @@ -71,6 +71,9 @@ Definition stop : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom stop_in_globals : + IsInGlobals globals "stop" (make_function stop). + Definition jump : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -136,6 +139,9 @@ Definition jump : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom jump_in_globals : + IsInGlobals globals "jump" (make_function jump). + Definition jumpi : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -237,6 +243,9 @@ Definition jumpi : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom jumpi_in_globals : + IsInGlobals globals "jumpi" (make_function jumpi). + Definition pc : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -281,6 +290,9 @@ Definition pc : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom pc_in_globals : + IsInGlobals globals "pc" (make_function pc). + Definition gas_left : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -325,6 +337,9 @@ Definition gas_left : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom gas_left_in_globals : + IsInGlobals globals "gas_left" (make_function gas_left). + Definition jumpdest : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -356,3 +371,6 @@ Definition jumpdest : Value.t -> Value.t -> M := Constant.int 1 |) in M.pure Constant.None_)). + +Axiom jumpdest_in_globals : + IsInGlobals globals "jumpdest" (make_function jumpdest). diff --git a/CoqOfPython/ethereum/frontier/vm/instructions/environment.v b/CoqOfPython/ethereum/frontier/vm/instructions/environment.v index c859e7a..3c9ee1c 100644 --- a/CoqOfPython/ethereum/frontier/vm/instructions/environment.v +++ b/CoqOfPython/ethereum/frontier/vm/instructions/environment.v @@ -104,6 +104,9 @@ Definition address : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom address_in_globals : + IsInGlobals globals "address" (make_function address). + Definition balance : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -167,6 +170,9 @@ Definition balance : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom balance_in_globals : + IsInGlobals globals "balance" (make_function balance). + Definition origin : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -211,6 +217,9 @@ Definition origin : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom origin_in_globals : + IsInGlobals globals "origin" (make_function origin). + Definition caller : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -254,6 +263,9 @@ Definition caller : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom caller_in_globals : + IsInGlobals globals "caller" (make_function caller). + Definition callvalue : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -291,6 +303,9 @@ Definition callvalue : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom callvalue_in_globals : + IsInGlobals globals "callvalue" (make_function callvalue). + Definition calldataload : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -362,6 +377,9 @@ Definition calldataload : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom calldataload_in_globals : + IsInGlobals globals "calldataload" (make_function calldataload). + Definition calldatasize : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -411,6 +429,9 @@ Definition calldatasize : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom calldatasize_in_globals : + IsInGlobals globals "calldatasize" (make_function calldatasize). + Definition calldatacopy : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -546,6 +567,9 @@ Definition calldatacopy : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom calldatacopy_in_globals : + IsInGlobals globals "calldatacopy" (make_function calldatacopy). + Definition codesize : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -595,6 +619,9 @@ Definition codesize : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom codesize_in_globals : + IsInGlobals globals "codesize" (make_function codesize). + Definition codecopy : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -730,6 +757,9 @@ Definition codecopy : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom codecopy_in_globals : + IsInGlobals globals "codecopy" (make_function codecopy). + Definition gasprice : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -773,6 +803,9 @@ Definition gasprice : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom gasprice_in_globals : + IsInGlobals globals "gasprice" (make_function gasprice). + Definition extcodesize : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -848,6 +881,9 @@ Definition extcodesize : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom extcodesize_in_globals : + IsInGlobals globals "extcodesize" (make_function extcodesize). + Definition extcodecopy : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -1006,3 +1042,6 @@ Definition extcodecopy : Value.t -> Value.t -> M := Constant.int 1 |) in M.pure Constant.None_)). + +Axiom extcodecopy_in_globals : + IsInGlobals globals "extcodecopy" (make_function extcodecopy). diff --git a/CoqOfPython/ethereum/frontier/vm/instructions/keccak.v b/CoqOfPython/ethereum/frontier/vm/instructions/keccak.v index 58e84e0..61beca2 100644 --- a/CoqOfPython/ethereum/frontier/vm/instructions/keccak.v +++ b/CoqOfPython/ethereum/frontier/vm/instructions/keccak.v @@ -189,3 +189,6 @@ Definition keccak : Value.t -> Value.t -> M := Constant.int 1 |) in M.pure Constant.None_)). + +Axiom keccak_in_globals : + IsInGlobals globals "keccak" (make_function keccak). diff --git a/CoqOfPython/ethereum/frontier/vm/instructions/log.v b/CoqOfPython/ethereum/frontier/vm/instructions/log.v index 937f587..5383374 100644 --- a/CoqOfPython/ethereum/frontier/vm/instructions/log.v +++ b/CoqOfPython/ethereum/frontier/vm/instructions/log.v @@ -194,6 +194,9 @@ Definition log_n : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom log_n_in_globals : + IsInGlobals globals "log_n" (make_function log_n). + Definition log0 : Value.t := M.run ltac:(M.monadic ( M.call (| M.get_name (| globals, locals_stack, "partial" |), diff --git a/CoqOfPython/ethereum/frontier/vm/instructions/memory.v b/CoqOfPython/ethereum/frontier/vm/instructions/memory.v index e3aea6b..74ff960 100644 --- a/CoqOfPython/ethereum/frontier/vm/instructions/memory.v +++ b/CoqOfPython/ethereum/frontier/vm/instructions/memory.v @@ -145,6 +145,9 @@ Definition mstore : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom mstore_in_globals : + IsInGlobals globals "mstore" (make_function mstore). + Definition mstore8 : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -249,6 +252,9 @@ Definition mstore8 : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom mstore8_in_globals : + IsInGlobals globals "mstore8" (make_function mstore8). + Definition mload : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -349,6 +355,9 @@ Definition mload : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom mload_in_globals : + IsInGlobals globals "mload" (make_function mload). + Definition msize : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -397,3 +406,6 @@ Definition msize : Value.t -> Value.t -> M := Constant.int 1 |) in M.pure Constant.None_)). + +Axiom msize_in_globals : + IsInGlobals globals "msize" (make_function msize). diff --git a/CoqOfPython/ethereum/frontier/vm/instructions/stack.v b/CoqOfPython/ethereum/frontier/vm/instructions/stack.v index 2bd56d1..ce27daa 100644 --- a/CoqOfPython/ethereum/frontier/vm/instructions/stack.v +++ b/CoqOfPython/ethereum/frontier/vm/instructions/stack.v @@ -82,6 +82,9 @@ Definition pop : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom pop_in_globals : + IsInGlobals globals "pop" (make_function pop). + Definition push_n : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm"; "num_bytes" ] in @@ -159,6 +162,9 @@ Definition push_n : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom push_n_in_globals : + IsInGlobals globals "push_n" (make_function push_n). + Definition dup_n : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm"; "item_number" ] in @@ -236,6 +242,9 @@ Definition dup_n : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom dup_n_in_globals : + IsInGlobals globals "dup_n" (make_function dup_n). + Definition swap_n : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm"; "item_number" ] in @@ -312,6 +321,9 @@ Definition swap_n : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom swap_n_in_globals : + IsInGlobals globals "swap_n" (make_function swap_n). + Definition push1 : Value.t := M.run ltac:(M.monadic ( M.call (| M.get_name (| globals, locals_stack, "partial" |), diff --git a/CoqOfPython/ethereum/frontier/vm/instructions/storage.v b/CoqOfPython/ethereum/frontier/vm/instructions/storage.v index 1fd54fb..969c599 100644 --- a/CoqOfPython/ethereum/frontier/vm/instructions/storage.v +++ b/CoqOfPython/ethereum/frontier/vm/instructions/storage.v @@ -106,6 +106,9 @@ Definition sload : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom sload_in_globals : + IsInGlobals globals "sload" (make_function sload). + Definition sstore : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -236,3 +239,6 @@ Definition sstore : Value.t -> Value.t -> M := Constant.int 1 |) in M.pure Constant.None_)). + +Axiom sstore_in_globals : + IsInGlobals globals "sstore" (make_function sstore). diff --git a/CoqOfPython/ethereum/frontier/vm/instructions/system.v b/CoqOfPython/ethereum/frontier/vm/instructions/system.v index 83f8c79..b6e9295 100644 --- a/CoqOfPython/ethereum/frontier/vm/instructions/system.v +++ b/CoqOfPython/ethereum/frontier/vm/instructions/system.v @@ -402,6 +402,9 @@ Definition create : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom create_in_globals : + IsInGlobals globals "create" (make_function create). + Definition return_ : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -485,6 +488,9 @@ Definition return_ : Value.t -> Value.t -> M := let _ := M.pass (| |) in M.pure Constant.None_)). +Axiom return__in_globals : + IsInGlobals globals "return_" (make_function return_). + Definition generic_call : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm"; "gas"; "value"; "caller"; "to"; "code_address"; "memory_input_start_position"; "memory_input_size"; "memory_output_start_position"; "memory_output_size" ] in @@ -668,6 +674,9 @@ Definition generic_call : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom generic_call_in_globals : + IsInGlobals globals "generic_call" (make_function generic_call). + Definition call : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -875,6 +884,9 @@ Definition call : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom call_in_globals : + IsInGlobals globals "call" (make_function call). + Definition callcode : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -1086,6 +1098,9 @@ Definition callcode : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom callcode_in_globals : + IsInGlobals globals "callcode" (make_function callcode). + Definition selfdestruct : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -1243,3 +1258,6 @@ Definition selfdestruct : Value.t -> Value.t -> M := |) in let _ := M.pass (| |) in M.pure Constant.None_)). + +Axiom selfdestruct_in_globals : + IsInGlobals globals "selfdestruct" (make_function selfdestruct). diff --git a/CoqOfPython/ethereum/frontier/vm/interpreter.v b/CoqOfPython/ethereum/frontier/vm/interpreter.v index e3c5c81..09c24c0 100644 --- a/CoqOfPython/ethereum/frontier/vm/interpreter.v +++ b/CoqOfPython/ethereum/frontier/vm/interpreter.v @@ -325,6 +325,9 @@ Definition process_message_call : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom process_message_call_in_globals : + IsInGlobals globals "process_message_call" (make_function process_message_call). + Definition process_create_message : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "message"; "env" ] in @@ -418,6 +421,9 @@ Definition process_create_message : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom process_create_message_in_globals : + IsInGlobals globals "process_create_message" (make_function process_create_message). + Definition process_message : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "message"; "env" ] in @@ -538,6 +544,9 @@ Definition process_message : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom process_message_in_globals : + IsInGlobals globals "process_message" (make_function process_message). + Definition execute_code : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "message"; "env" ] in @@ -584,3 +593,6 @@ Definition execute_code : Value.t -> Value.t -> M := M.get_name (| globals, locals_stack, "evm" |) |) in M.pure Constant.None_)). + +Axiom execute_code_in_globals : + IsInGlobals globals "execute_code" (make_function execute_code). diff --git a/CoqOfPython/ethereum/frontier/vm/memory.v b/CoqOfPython/ethereum/frontier/vm/memory.v index b065d71..c9d3bd4 100644 --- a/CoqOfPython/ethereum/frontier/vm/memory.v +++ b/CoqOfPython/ethereum/frontier/vm/memory.v @@ -71,6 +71,9 @@ Definition memory_write : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom memory_write_in_globals : + IsInGlobals globals "memory_write" (make_function memory_write). + Definition memory_read_bytes : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "memory"; "start_position"; "size" ] in @@ -117,6 +120,9 @@ Definition memory_read_bytes : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom memory_read_bytes_in_globals : + IsInGlobals globals "memory_read_bytes" (make_function memory_read_bytes). + Definition buffer_read : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "buffer"; "start_position"; "size" ] in @@ -169,3 +175,6 @@ Definition buffer_read : Value.t -> Value.t -> M := |) |) in M.pure Constant.None_)). + +Axiom buffer_read_in_globals : + IsInGlobals globals "buffer_read" (make_function buffer_read). diff --git a/CoqOfPython/ethereum/frontier/vm/precompiled_contracts/ecrecover.v b/CoqOfPython/ethereum/frontier/vm/precompiled_contracts/ecrecover.v index 5f49475..cb13e4c 100644 --- a/CoqOfPython/ethereum/frontier/vm/precompiled_contracts/ecrecover.v +++ b/CoqOfPython/ethereum/frontier/vm/precompiled_contracts/ecrecover.v @@ -302,3 +302,6 @@ Definition ecrecover : Value.t -> Value.t -> M := M.get_name (| globals, locals_stack, "padded_address" |) |) in M.pure Constant.None_)). + +Axiom ecrecover_in_globals : + IsInGlobals globals "ecrecover" (make_function ecrecover). diff --git a/CoqOfPython/ethereum/frontier/vm/precompiled_contracts/identity.v b/CoqOfPython/ethereum/frontier/vm/precompiled_contracts/identity.v index e032154..e611e45 100644 --- a/CoqOfPython/ethereum/frontier/vm/precompiled_contracts/identity.v +++ b/CoqOfPython/ethereum/frontier/vm/precompiled_contracts/identity.v @@ -95,3 +95,6 @@ Definition identity : Value.t -> Value.t -> M := M.get_name (| globals, locals_stack, "data" |) |) in M.pure Constant.None_)). + +Axiom identity_in_globals : + IsInGlobals globals "identity" (make_function identity). diff --git a/CoqOfPython/ethereum/frontier/vm/precompiled_contracts/ripemd160.v b/CoqOfPython/ethereum/frontier/vm/precompiled_contracts/ripemd160.v index a49f853..ec22e49 100644 --- a/CoqOfPython/ethereum/frontier/vm/precompiled_contracts/ripemd160.v +++ b/CoqOfPython/ethereum/frontier/vm/precompiled_contracts/ripemd160.v @@ -126,3 +126,6 @@ Definition ripemd160 : Value.t -> Value.t -> M := M.get_name (| globals, locals_stack, "padded_hash" |) |) in M.pure Constant.None_)). + +Axiom ripemd160_in_globals : + IsInGlobals globals "ripemd160" (make_function ripemd160). diff --git a/CoqOfPython/ethereum/frontier/vm/precompiled_contracts/sha256.v b/CoqOfPython/ethereum/frontier/vm/precompiled_contracts/sha256.v index b7ef0c6..ea40c15 100644 --- a/CoqOfPython/ethereum/frontier/vm/precompiled_contracts/sha256.v +++ b/CoqOfPython/ethereum/frontier/vm/precompiled_contracts/sha256.v @@ -107,3 +107,6 @@ Definition sha256 : Value.t -> Value.t -> M := |) |) in M.pure Constant.None_)). + +Axiom sha256_in_globals : + IsInGlobals globals "sha256" (make_function sha256). diff --git a/CoqOfPython/ethereum/frontier/vm/runtime.v b/CoqOfPython/ethereum/frontier/vm/runtime.v index 47407c6..2a0d31e 100644 --- a/CoqOfPython/ethereum/frontier/vm/runtime.v +++ b/CoqOfPython/ethereum/frontier/vm/runtime.v @@ -158,3 +158,6 @@ Definition get_valid_jump_destinations : Value.t -> Value.t -> M := M.get_name (| globals, locals_stack, "valid_jump_destinations" |) |) in M.pure Constant.None_)). + +Axiom get_valid_jump_destinations_in_globals : + IsInGlobals globals "get_valid_jump_destinations" (make_function get_valid_jump_destinations). diff --git a/CoqOfPython/ethereum/frontier/vm/stack.v b/CoqOfPython/ethereum/frontier/vm/stack.v index 8345b56..9e5804e 100644 --- a/CoqOfPython/ethereum/frontier/vm/stack.v +++ b/CoqOfPython/ethereum/frontier/vm/stack.v @@ -78,6 +78,9 @@ Definition pop : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom pop_in_globals : + IsInGlobals globals "pop" (make_function pop). + Definition push : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "stack"; "value" ] in @@ -125,3 +128,6 @@ Definition push : Value.t -> Value.t -> M := |) |) in M.pure Constant.None_)). + +Axiom push_in_globals : + IsInGlobals globals "push" (make_function push). diff --git a/CoqOfPython/ethereum/genesis.v b/CoqOfPython/ethereum/genesis.v index 522d754..0110c66 100644 --- a/CoqOfPython/ethereum/genesis.v +++ b/CoqOfPython/ethereum/genesis.v @@ -138,6 +138,9 @@ Definition get_genesis_configuration : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom get_genesis_configuration_in_globals : + IsInGlobals globals "get_genesis_configuration" (make_function get_genesis_configuration). + Definition hex_or_base_10_str_to_u256 : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "balance" ] in @@ -189,6 +192,9 @@ Definition hex_or_base_10_str_to_u256 : Value.t -> Value.t -> M := )) |) in M.pure Constant.None_)). +Axiom hex_or_base_10_str_to_u256_in_globals : + IsInGlobals globals "hex_or_base_10_str_to_u256" (make_function hex_or_base_10_str_to_u256). + Definition add_genesis_block : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "hardfork"; "chain"; "genesis" ] in @@ -484,3 +490,6 @@ Definition add_genesis_block : Value.t -> Value.t -> M := M.get_field (| M.get_name (| globals, locals_stack, "genesis" |), "chain_id" |) |) in M.pure Constant.None_)). + +Axiom add_genesis_block_in_globals : + IsInGlobals globals "add_genesis_block" (make_function add_genesis_block). diff --git a/CoqOfPython/ethereum/gray_glacier/bloom.v b/CoqOfPython/ethereum/gray_glacier/bloom.v index 7e0e09e..34a2883 100644 --- a/CoqOfPython/ethereum/gray_glacier/bloom.v +++ b/CoqOfPython/ethereum/gray_glacier/bloom.v @@ -140,6 +140,9 @@ Definition add_to_bloom : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom add_to_bloom_in_globals : + IsInGlobals globals "add_to_bloom" (make_function add_to_bloom). + Definition logs_bloom : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "logs" ] in @@ -209,3 +212,6 @@ Definition logs_bloom : Value.t -> Value.t -> M := |) |) in M.pure Constant.None_)). + +Axiom logs_bloom_in_globals : + IsInGlobals globals "logs_bloom" (make_function logs_bloom). diff --git a/CoqOfPython/ethereum/gray_glacier/fork.v b/CoqOfPython/ethereum/gray_glacier/fork.v index d29fe9d..2ef29ca 100644 --- a/CoqOfPython/ethereum/gray_glacier/fork.v +++ b/CoqOfPython/ethereum/gray_glacier/fork.v @@ -253,6 +253,9 @@ Definition apply_fork : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom apply_fork_in_globals : + IsInGlobals globals "apply_fork" (make_function apply_fork). + Definition get_last_256_block_hashes : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "chain" ] in @@ -365,6 +368,9 @@ Definition get_last_256_block_hashes : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom get_last_256_block_hashes_in_globals : + IsInGlobals globals "get_last_256_block_hashes" (make_function get_last_256_block_hashes). + Definition state_transition : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "chain"; "block" ] in @@ -533,6 +539,9 @@ Definition state_transition : Value.t -> Value.t -> M := )) |) in M.pure Constant.None_)). +Axiom state_transition_in_globals : + IsInGlobals globals "state_transition" (make_function state_transition). + Definition calculate_base_fee_per_gas : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "block_gas_limit"; "parent_gas_limit"; "parent_gas_used"; "parent_base_fee_per_gas" ] in @@ -698,6 +707,9 @@ Definition calculate_base_fee_per_gas : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom calculate_base_fee_per_gas_in_globals : + IsInGlobals globals "calculate_base_fee_per_gas" (make_function calculate_base_fee_per_gas). + Definition validate_header : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "header"; "parent_header" ] in @@ -864,6 +876,9 @@ Definition validate_header : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom validate_header_in_globals : + IsInGlobals globals "validate_header" (make_function validate_header). + Definition generate_header_hash_for_pow : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "header" ] in @@ -920,6 +935,9 @@ Definition generate_header_hash_for_pow : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom generate_header_hash_for_pow_in_globals : + IsInGlobals globals "generate_header_hash_for_pow" (make_function generate_header_hash_for_pow). + Definition validate_proof_of_work : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "header" ] in @@ -1010,6 +1028,9 @@ Definition validate_proof_of_work : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom validate_proof_of_work_in_globals : + IsInGlobals globals "validate_proof_of_work" (make_function validate_proof_of_work). + Definition check_transaction : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "tx"; "base_fee_per_gas"; "gas_available"; "chain_id" ] in @@ -1143,6 +1164,9 @@ Definition check_transaction : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom check_transaction_in_globals : + IsInGlobals globals "check_transaction" (make_function check_transaction). + Definition make_receipt : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "tx"; "error"; "cumulative_gas_used"; "logs" ] in @@ -1240,6 +1264,9 @@ Definition make_receipt : Value.t -> Value.t -> M := )) |) in M.pure Constant.None_)). +Axiom make_receipt_in_globals : + IsInGlobals globals "make_receipt" (make_function make_receipt). + Definition ApplyBodyOutput : Value.t := builtins.make_klass [] @@ -1493,6 +1520,9 @@ Definition apply_body : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom apply_body_in_globals : + IsInGlobals globals "apply_body" (make_function apply_body). + Definition validate_ommers : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "ommers"; "block_header"; "chain" ] in @@ -1814,6 +1844,9 @@ Definition validate_ommers : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom validate_ommers_in_globals : + IsInGlobals globals "validate_ommers" (make_function validate_ommers). + Definition pay_rewards : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "state"; "block_number"; "coinbase"; "ommers" ] in @@ -1919,6 +1952,9 @@ Definition pay_rewards : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom pay_rewards_in_globals : + IsInGlobals globals "pay_rewards" (make_function pay_rewards). + Definition process_transaction : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "env"; "tx" ] in @@ -2395,6 +2431,9 @@ Definition process_transaction : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom process_transaction_in_globals : + IsInGlobals globals "process_transaction" (make_function process_transaction). + Definition validate_transaction : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "tx" ] in @@ -2451,6 +2490,9 @@ Definition validate_transaction : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom validate_transaction_in_globals : + IsInGlobals globals "validate_transaction" (make_function validate_transaction). + Definition calculate_intrinsic_cost : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "tx" ] in @@ -2616,6 +2658,9 @@ Definition calculate_intrinsic_cost : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom calculate_intrinsic_cost_in_globals : + IsInGlobals globals "calculate_intrinsic_cost" (make_function calculate_intrinsic_cost). + Definition recover_sender : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "chain_id"; "tx" ] in @@ -2908,6 +2953,9 @@ Definition recover_sender : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom recover_sender_in_globals : + IsInGlobals globals "recover_sender" (make_function recover_sender). + Definition signing_hash_pre155 : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "tx" ] in @@ -2942,6 +2990,9 @@ Definition signing_hash_pre155 : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom signing_hash_pre155_in_globals : + IsInGlobals globals "signing_hash_pre155" (make_function signing_hash_pre155). + Definition signing_hash_155 : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "tx"; "chain_id" ] in @@ -2990,6 +3041,9 @@ Definition signing_hash_155 : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom signing_hash_155_in_globals : + IsInGlobals globals "signing_hash_155" (make_function signing_hash_155). + Definition signing_hash_2930 : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "tx" ] in @@ -3027,6 +3081,9 @@ Definition signing_hash_2930 : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom signing_hash_2930_in_globals : + IsInGlobals globals "signing_hash_2930" (make_function signing_hash_2930). + Definition signing_hash_1559 : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "tx" ] in @@ -3064,6 +3121,9 @@ Definition signing_hash_1559 : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom signing_hash_1559_in_globals : + IsInGlobals globals "signing_hash_1559" (make_function signing_hash_1559). + Definition compute_header_hash : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "header" ] in @@ -3116,6 +3176,9 @@ Definition compute_header_hash : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom compute_header_hash_in_globals : + IsInGlobals globals "compute_header_hash" (make_function compute_header_hash). + Definition check_gas_limit : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "gas_limit"; "parent_gas_limit" ] in @@ -3216,6 +3279,9 @@ Definition check_gas_limit : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom check_gas_limit_in_globals : + IsInGlobals globals "check_gas_limit" (make_function check_gas_limit). + Definition calculate_block_difficulty : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "block_number"; "block_timestamp"; "parent_timestamp"; "parent_difficulty"; "parent_has_ommers" ] in @@ -3376,3 +3442,6 @@ Constant.int 1 |) |) in M.pure Constant.None_)). + +Axiom calculate_block_difficulty_in_globals : + IsInGlobals globals "calculate_block_difficulty" (make_function calculate_block_difficulty). diff --git a/CoqOfPython/ethereum/gray_glacier/fork_types.v b/CoqOfPython/ethereum/gray_glacier/fork_types.v index 783edf8..75bf012 100644 --- a/CoqOfPython/ethereum/gray_glacier/fork_types.v +++ b/CoqOfPython/ethereum/gray_glacier/fork_types.v @@ -99,3 +99,6 @@ Definition encode_account : Value.t -> Value.t -> M := |) |) in M.pure Constant.None_)). + +Axiom encode_account_in_globals : + IsInGlobals globals "encode_account" (make_function encode_account). diff --git a/CoqOfPython/ethereum/gray_glacier/state.v b/CoqOfPython/ethereum/gray_glacier/state.v index a514f26..17cb1ef 100644 --- a/CoqOfPython/ethereum/gray_glacier/state.v +++ b/CoqOfPython/ethereum/gray_glacier/state.v @@ -100,6 +100,9 @@ Definition close_state : Value.t -> Value.t -> M := let _ := M.delete (| M.get_field (| M.get_name (| globals, locals_stack, "state" |), "_created_accounts" |) |) in M.pure Constant.None_)). +Axiom close_state_in_globals : + IsInGlobals globals "close_state" (make_function close_state). + Definition begin_transaction : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "state" ] in @@ -130,6 +133,9 @@ Definition begin_transaction : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom begin_transaction_in_globals : + IsInGlobals globals "begin_transaction" (make_function begin_transaction). + Definition commit_transaction : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "state" ] in @@ -165,6 +171,9 @@ Definition commit_transaction : Value.t -> Value.t -> M := )) |) in M.pure Constant.None_)). +Axiom commit_transaction_in_globals : + IsInGlobals globals "commit_transaction" (make_function commit_transaction). + Definition rollback_transaction : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "state" ] in @@ -204,6 +213,9 @@ Definition rollback_transaction : Value.t -> Value.t -> M := )) |) in M.pure Constant.None_)). +Axiom rollback_transaction_in_globals : + IsInGlobals globals "rollback_transaction" (make_function rollback_transaction). + Definition get_account : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "state"; "address" ] in @@ -264,6 +276,9 @@ Definition get_account : Value.t -> Value.t -> M := )) |) in M.pure Constant.None_)). +Axiom get_account_in_globals : + IsInGlobals globals "get_account" (make_function get_account). + Definition get_account_optional : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "state"; "address" ] in @@ -300,6 +315,9 @@ Definition get_account_optional : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom get_account_optional_in_globals : + IsInGlobals globals "get_account_optional" (make_function get_account_optional). + Definition set_account : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "state"; "address"; "account" ] in @@ -328,6 +346,9 @@ Definition set_account : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom set_account_in_globals : + IsInGlobals globals "set_account" (make_function set_account). + Definition destroy_account : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "state"; "address" ] in @@ -365,6 +386,9 @@ Definition destroy_account : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom destroy_account_in_globals : + IsInGlobals globals "destroy_account" (make_function destroy_account). + Definition destroy_storage : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "state"; "address" ] in @@ -399,6 +423,9 @@ Definition destroy_storage : Value.t -> Value.t -> M := )) |) in M.pure Constant.None_)). +Axiom destroy_storage_in_globals : + IsInGlobals globals "destroy_storage" (make_function destroy_storage). + Definition mark_account_created : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "state"; "address" ] in @@ -428,6 +455,9 @@ Definition mark_account_created : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom mark_account_created_in_globals : + IsInGlobals globals "mark_account_created" (make_function mark_account_created). + Definition get_storage : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "state"; "address"; "key" ] in @@ -507,6 +537,9 @@ Definition get_storage : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom get_storage_in_globals : + IsInGlobals globals "get_storage" (make_function get_storage). + Definition set_storage : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "state"; "address"; "key"; "value" ] in @@ -605,6 +638,9 @@ Definition set_storage : Value.t -> Value.t -> M := )) |) in M.pure Constant.None_)). +Axiom set_storage_in_globals : + IsInGlobals globals "set_storage" (make_function set_storage). + Definition storage_root : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "state"; "address" ] in @@ -656,6 +692,9 @@ Definition storage_root : Value.t -> Value.t -> M := )) |) in M.pure Constant.None_)). +Axiom storage_root_in_globals : + IsInGlobals globals "storage_root" (make_function storage_root). + Definition state_root : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "state" ] in @@ -686,6 +725,9 @@ Definition state_root : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom state_root_in_globals : + IsInGlobals globals "state_root" (make_function state_root). + Definition account_exists : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "state"; "address" ] in @@ -720,6 +762,9 @@ Definition account_exists : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom account_exists_in_globals : + IsInGlobals globals "account_exists" (make_function account_exists). + Definition account_has_code_or_nonce : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "state"; "address" ] in @@ -773,6 +818,9 @@ Definition account_has_code_or_nonce : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom account_has_code_or_nonce_in_globals : + IsInGlobals globals "account_has_code_or_nonce" (make_function account_has_code_or_nonce). + Definition is_account_empty : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "state"; "address" ] in @@ -834,6 +882,9 @@ Definition is_account_empty : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom is_account_empty_in_globals : + IsInGlobals globals "is_account_empty" (make_function is_account_empty). + Definition account_exists_and_is_empty : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "state"; "address" ] in @@ -904,6 +955,9 @@ Definition account_exists_and_is_empty : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom account_exists_and_is_empty_in_globals : + IsInGlobals globals "account_exists_and_is_empty" (make_function account_exists_and_is_empty). + Definition is_account_alive : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "state"; "address" ] in @@ -981,6 +1035,9 @@ Definition is_account_alive : Value.t -> Value.t -> M := )) |) in M.pure Constant.None_)). +Axiom is_account_alive_in_globals : + IsInGlobals globals "is_account_alive" (make_function is_account_alive). + Definition modify_state : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "state"; "address"; "f" ] in @@ -1013,6 +1070,9 @@ Definition modify_state : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom modify_state_in_globals : + IsInGlobals globals "modify_state" (make_function modify_state). + Definition move_ether : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "state"; "sender_address"; "recipient_address"; "amount" ] in @@ -1042,6 +1102,9 @@ Definition move_ether : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom move_ether_in_globals : + IsInGlobals globals "move_ether" (make_function move_ether). + Definition set_account_balance : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "state"; "address"; "amount" ] in @@ -1072,6 +1135,9 @@ Definition set_account_balance : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom set_account_balance_in_globals : + IsInGlobals globals "set_account_balance" (make_function set_account_balance). + Definition touch_account : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "state"; "address" ] in @@ -1116,6 +1182,9 @@ Definition touch_account : Value.t -> Value.t -> M := )) |) in M.pure Constant.None_)). +Axiom touch_account_in_globals : + IsInGlobals globals "touch_account" (make_function touch_account). + Definition increment_nonce : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "state"; "address" ] in @@ -1143,6 +1212,9 @@ Definition increment_nonce : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom increment_nonce_in_globals : + IsInGlobals globals "increment_nonce" (make_function increment_nonce). + Definition set_code : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "state"; "address"; "code" ] in @@ -1173,6 +1245,9 @@ Definition set_code : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom set_code_in_globals : + IsInGlobals globals "set_code" (make_function set_code). + Definition create_ether : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "state"; "address"; "amount" ] in @@ -1201,6 +1276,9 @@ Definition create_ether : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom create_ether_in_globals : + IsInGlobals globals "create_ether" (make_function create_ether). + Definition get_storage_original : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "state"; "address"; "key" ] in @@ -1306,3 +1384,6 @@ Definition get_storage_original : Value.t -> Value.t -> M := M.get_name (| globals, locals_stack, "original_value" |) |) in M.pure Constant.None_)). + +Axiom get_storage_original_in_globals : + IsInGlobals globals "get_storage_original" (make_function get_storage_original). diff --git a/CoqOfPython/ethereum/gray_glacier/transactions.v b/CoqOfPython/ethereum/gray_glacier/transactions.v index ac2e6ac..89d391d 100644 --- a/CoqOfPython/ethereum/gray_glacier/transactions.v +++ b/CoqOfPython/ethereum/gray_glacier/transactions.v @@ -201,6 +201,9 @@ Definition encode_transaction : Value.t -> Value.t -> M := )) |) in M.pure Constant.None_)). +Axiom encode_transaction_in_globals : + IsInGlobals globals "encode_transaction" (make_function encode_transaction). + Definition decode_transaction : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "tx" ] in @@ -295,3 +298,6 @@ Definition decode_transaction : Value.t -> Value.t -> M := M.pure Constant.None_ )) |) in M.pure Constant.None_)). + +Axiom decode_transaction_in_globals : + IsInGlobals globals "decode_transaction" (make_function decode_transaction). diff --git a/CoqOfPython/ethereum/gray_glacier/trie.v b/CoqOfPython/ethereum/gray_glacier/trie.v index a3a2fcc..001f2f3 100644 --- a/CoqOfPython/ethereum/gray_glacier/trie.v +++ b/CoqOfPython/ethereum/gray_glacier/trie.v @@ -371,6 +371,9 @@ Definition encode_internal_node : Value.t -> Value.t -> M := )) |) in M.pure Constant.None_)). +Axiom encode_internal_node_in_globals : + IsInGlobals globals "encode_internal_node" (make_function encode_internal_node). + Definition encode_node : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "node"; "storage_root" ] in @@ -479,6 +482,9 @@ Definition encode_node : Value.t -> Value.t -> M := )) |) in M.pure Constant.None_)). +Axiom encode_node_in_globals : + IsInGlobals globals "encode_node" (make_function encode_node). + Definition Trie : Value.t := builtins.make_klass [(* At base: unsupported node type: Subscript *)] @@ -526,6 +532,9 @@ Definition copy_trie : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom copy_trie_in_globals : + IsInGlobals globals "copy_trie" (make_function copy_trie). + Definition trie_set : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "trie"; "key"; "value" ] in @@ -586,6 +595,9 @@ Definition trie_set : Value.t -> Value.t -> M := )) |) in M.pure Constant.None_)). +Axiom trie_set_in_globals : + IsInGlobals globals "trie_set" (make_function trie_set). + Definition trie_get : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "trie"; "key" ] in @@ -619,6 +631,9 @@ Definition trie_get : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom trie_get_in_globals : + IsInGlobals globals "trie_get" (make_function trie_get). + Definition common_prefix_length : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "a"; "b" ] in @@ -697,6 +712,9 @@ Definition common_prefix_length : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom common_prefix_length_in_globals : + IsInGlobals globals "common_prefix_length" (make_function common_prefix_length). + Definition nibble_list_to_compact : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "x"; "is_leaf" ] in @@ -905,6 +923,9 @@ Definition nibble_list_to_compact : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom nibble_list_to_compact_in_globals : + IsInGlobals globals "nibble_list_to_compact" (make_function nibble_list_to_compact). + Definition bytes_to_nibble_list : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "bytes_" ] in @@ -1001,6 +1022,9 @@ Definition bytes_to_nibble_list : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom bytes_to_nibble_list_in_globals : + IsInGlobals globals "bytes_to_nibble_list" (make_function bytes_to_nibble_list). + Definition _prepare_trie : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "trie"; "get_storage_root" ] in @@ -1152,6 +1176,9 @@ Definition _prepare_trie : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom _prepare_trie_in_globals : + IsInGlobals globals "_prepare_trie" (make_function _prepare_trie). + Definition root : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "trie"; "get_storage_root" ] in @@ -1267,6 +1294,9 @@ Definition root : Value.t -> Value.t -> M := )) |) in M.pure Constant.None_)). +Axiom root_in_globals : + IsInGlobals globals "root" (make_function root). + Definition patricialize : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "obj"; "level" ] in @@ -1606,3 +1636,6 @@ Definition patricialize : Value.t -> Value.t -> M := |) |) in M.pure Constant.None_)). + +Axiom patricialize_in_globals : + IsInGlobals globals "patricialize" (make_function patricialize). diff --git a/CoqOfPython/ethereum/gray_glacier/utils/address.v b/CoqOfPython/ethereum/gray_glacier/utils/address.v index 4709a6e..e363578 100644 --- a/CoqOfPython/ethereum/gray_glacier/utils/address.v +++ b/CoqOfPython/ethereum/gray_glacier/utils/address.v @@ -79,6 +79,9 @@ Definition to_address : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom to_address_in_globals : + IsInGlobals globals "to_address" (make_function to_address). + Definition compute_contract_address : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "address"; "nonce" ] in @@ -149,6 +152,9 @@ Definition compute_contract_address : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom compute_contract_address_in_globals : + IsInGlobals globals "compute_contract_address" (make_function compute_contract_address). + Definition compute_create2_contract_address : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "address"; "salt"; "call_data" ] in @@ -230,3 +236,6 @@ Definition compute_create2_contract_address : Value.t -> Value.t -> M := |) |) in M.pure Constant.None_)). + +Axiom compute_create2_contract_address_in_globals : + IsInGlobals globals "compute_create2_contract_address" (make_function compute_create2_contract_address). diff --git a/CoqOfPython/ethereum/gray_glacier/utils/hexadecimal.v b/CoqOfPython/ethereum/gray_glacier/utils/hexadecimal.v index 28d1537..7ac934e 100644 --- a/CoqOfPython/ethereum/gray_glacier/utils/hexadecimal.v +++ b/CoqOfPython/ethereum/gray_glacier/utils/hexadecimal.v @@ -70,6 +70,9 @@ Definition hex_to_root : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom hex_to_root_in_globals : + IsInGlobals globals "hex_to_root" (make_function hex_to_root). + Definition hex_to_bloom : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "hex_string" ] in @@ -110,6 +113,9 @@ Definition hex_to_bloom : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom hex_to_bloom_in_globals : + IsInGlobals globals "hex_to_bloom" (make_function hex_to_bloom). + Definition hex_to_address : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "hex_string" ] in @@ -156,3 +162,6 @@ Definition hex_to_address : Value.t -> Value.t -> M := |) |) in M.pure Constant.None_)). + +Axiom hex_to_address_in_globals : + IsInGlobals globals "hex_to_address" (make_function hex_to_address). diff --git a/CoqOfPython/ethereum/gray_glacier/utils/message.v b/CoqOfPython/ethereum/gray_glacier/utils/message.v index 964fc28..a37f4ae 100644 --- a/CoqOfPython/ethereum/gray_glacier/utils/message.v +++ b/CoqOfPython/ethereum/gray_glacier/utils/message.v @@ -267,3 +267,6 @@ Definition prepare_message : Value.t -> Value.t -> M := |) |) in M.pure Constant.None_)). + +Axiom prepare_message_in_globals : + IsInGlobals globals "prepare_message" (make_function prepare_message). diff --git a/CoqOfPython/ethereum/gray_glacier/vm/__init__.v b/CoqOfPython/ethereum/gray_glacier/vm/__init__.v index f29ae97..fcf36c9 100644 --- a/CoqOfPython/ethereum/gray_glacier/vm/__init__.v +++ b/CoqOfPython/ethereum/gray_glacier/vm/__init__.v @@ -182,6 +182,9 @@ Definition incorporate_child_on_success : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom incorporate_child_on_success_in_globals : + IsInGlobals globals "incorporate_child_on_success" (make_function incorporate_child_on_success). + Definition incorporate_child_on_error : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm"; "child_evm" ] in @@ -262,3 +265,6 @@ Definition incorporate_child_on_error : Value.t -> Value.t -> M := M.get_field (| M.get_name (| globals, locals_stack, "child_evm" |), "gas_left" |) |) in M.pure Constant.None_)). + +Axiom incorporate_child_on_error_in_globals : + IsInGlobals globals "incorporate_child_on_error" (make_function incorporate_child_on_error). diff --git a/CoqOfPython/ethereum/gray_glacier/vm/gas.v b/CoqOfPython/ethereum/gray_glacier/vm/gas.v index c641090..6691103 100644 --- a/CoqOfPython/ethereum/gray_glacier/vm/gas.v +++ b/CoqOfPython/ethereum/gray_glacier/vm/gas.v @@ -523,6 +523,9 @@ Definition charge_gas : Value.t -> Value.t -> M := )) |) in M.pure Constant.None_)). +Axiom charge_gas_in_globals : + IsInGlobals globals "charge_gas" (make_function charge_gas). + Definition calculate_memory_gas_cost : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "size_in_bytes" ] in @@ -582,6 +585,9 @@ Definition calculate_memory_gas_cost : Value.t -> Value.t -> M := (* At stmt: unsupported node type: Try *) M.pure Constant.None_)). +Axiom calculate_memory_gas_cost_in_globals : + IsInGlobals globals "calculate_memory_gas_cost" (make_function calculate_memory_gas_cost). + Definition calculate_gas_extend_memory : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "memory"; "extensions" ] in @@ -765,6 +771,9 @@ Definition calculate_gas_extend_memory : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom calculate_gas_extend_memory_in_globals : + IsInGlobals globals "calculate_gas_extend_memory" (make_function calculate_gas_extend_memory). + Definition calculate_message_call_gas : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "value"; "gas"; "gas_left"; "memory_cost"; "extra_gas"; "call_stipend" ] in @@ -890,6 +899,9 @@ M.get_name (| globals, locals_stack, "call_stipend" |) |) in M.pure Constant.None_)). +Axiom calculate_message_call_gas_in_globals : + IsInGlobals globals "calculate_message_call_gas" (make_function calculate_message_call_gas). + Definition max_message_call_gas : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "gas" ] in @@ -917,3 +929,6 @@ Definition max_message_call_gas : Value.t -> Value.t -> M := |) |) in M.pure Constant.None_)). + +Axiom max_message_call_gas_in_globals : + IsInGlobals globals "max_message_call_gas" (make_function max_message_call_gas). diff --git a/CoqOfPython/ethereum/gray_glacier/vm/instructions/arithmetic.v b/CoqOfPython/ethereum/gray_glacier/vm/instructions/arithmetic.v index 6362212..ac9377b 100644 --- a/CoqOfPython/ethereum/gray_glacier/vm/instructions/arithmetic.v +++ b/CoqOfPython/ethereum/gray_glacier/vm/instructions/arithmetic.v @@ -119,6 +119,9 @@ Definition add : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom add_in_globals : + IsInGlobals globals "add" (make_function add). + Definition sub : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -186,6 +189,9 @@ Definition sub : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom sub_in_globals : + IsInGlobals globals "sub" (make_function sub). + Definition mul : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -253,6 +259,9 @@ Definition mul : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom mul_in_globals : + IsInGlobals globals "mul" (make_function mul). + Definition div : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -341,6 +350,9 @@ Definition div : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom div_in_globals : + IsInGlobals globals "div" (make_function div). + Definition sdiv : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -491,6 +503,9 @@ Definition sdiv : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom sdiv_in_globals : + IsInGlobals globals "sdiv" (make_function sdiv). + Definition mod_ : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -579,6 +594,9 @@ Definition mod_ : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom mod__in_globals : + IsInGlobals globals "mod" (make_function mod_). + Definition smod : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -696,6 +714,9 @@ Definition smod : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom smod_in_globals : + IsInGlobals globals "smod" (make_function smod). + Definition addmod : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -821,6 +842,9 @@ Definition addmod : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom addmod_in_globals : + IsInGlobals globals "addmod" (make_function addmod). + Definition mulmod : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -946,6 +970,9 @@ Definition mulmod : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom mulmod_in_globals : + IsInGlobals globals "mulmod" (make_function mulmod). + Definition exp : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -1057,6 +1084,9 @@ Definition exp : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom exp_in_globals : + IsInGlobals globals "exp" (make_function exp). + Definition signextend : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -1231,3 +1261,6 @@ Definition signextend : Value.t -> Value.t -> M := Constant.int 1 |) in M.pure Constant.None_)). + +Axiom signextend_in_globals : + IsInGlobals globals "signextend" (make_function signextend). diff --git a/CoqOfPython/ethereum/gray_glacier/vm/instructions/bitwise.v b/CoqOfPython/ethereum/gray_glacier/vm/instructions/bitwise.v index dc375db..4a1862b 100644 --- a/CoqOfPython/ethereum/gray_glacier/vm/instructions/bitwise.v +++ b/CoqOfPython/ethereum/gray_glacier/vm/instructions/bitwise.v @@ -97,6 +97,9 @@ Definition bitwise_and : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom bitwise_and_in_globals : + IsInGlobals globals "bitwise_and" (make_function bitwise_and). + Definition bitwise_or : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -157,6 +160,9 @@ Definition bitwise_or : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom bitwise_or_in_globals : + IsInGlobals globals "bitwise_or" (make_function bitwise_or). + Definition bitwise_xor : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -217,6 +223,9 @@ Definition bitwise_xor : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom bitwise_xor_in_globals : + IsInGlobals globals "bitwise_xor" (make_function bitwise_xor). + Definition bitwise_not : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -264,6 +273,9 @@ Definition bitwise_not : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom bitwise_not_in_globals : + IsInGlobals globals "bitwise_not" (make_function bitwise_not). + Definition get_byte : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -380,6 +392,9 @@ Definition get_byte : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom get_byte_in_globals : + IsInGlobals globals "get_byte" (make_function get_byte). + Definition bitwise_shl : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -475,6 +490,9 @@ Definition bitwise_shl : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom bitwise_shl_in_globals : + IsInGlobals globals "bitwise_shl" (make_function bitwise_shl). + Definition bitwise_shr : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -561,6 +579,9 @@ Definition bitwise_shr : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom bitwise_shr_in_globals : + IsInGlobals globals "bitwise_shr" (make_function bitwise_shr). + Definition bitwise_sar : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -674,3 +695,6 @@ Definition bitwise_sar : Value.t -> Value.t -> M := Constant.int 1 |) in M.pure Constant.None_)). + +Axiom bitwise_sar_in_globals : + IsInGlobals globals "bitwise_sar" (make_function bitwise_sar). diff --git a/CoqOfPython/ethereum/gray_glacier/vm/instructions/block.v b/CoqOfPython/ethereum/gray_glacier/vm/instructions/block.v index b511399..b090776 100644 --- a/CoqOfPython/ethereum/gray_glacier/vm/instructions/block.v +++ b/CoqOfPython/ethereum/gray_glacier/vm/instructions/block.v @@ -129,6 +129,9 @@ Definition block_hash : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom block_hash_in_globals : + IsInGlobals globals "block_hash" (make_function block_hash). + Definition coinbase : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -176,6 +179,9 @@ Definition coinbase : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom coinbase_in_globals : + IsInGlobals globals "coinbase" (make_function coinbase). + Definition timestamp : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -217,6 +223,9 @@ Definition timestamp : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom timestamp_in_globals : + IsInGlobals globals "timestamp" (make_function timestamp). + Definition number : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -263,6 +272,9 @@ Definition number : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom number_in_globals : + IsInGlobals globals "number" (make_function number). + Definition difficulty : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -309,6 +321,9 @@ Definition difficulty : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom difficulty_in_globals : + IsInGlobals globals "difficulty" (make_function difficulty). + Definition gas_limit : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -355,6 +370,9 @@ Definition gas_limit : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom gas_limit_in_globals : + IsInGlobals globals "gas_limit" (make_function gas_limit). + Definition chain_id : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -397,3 +415,6 @@ Definition chain_id : Value.t -> Value.t -> M := Constant.int 1 |) in M.pure Constant.None_)). + +Axiom chain_id_in_globals : + IsInGlobals globals "chain_id" (make_function chain_id). diff --git a/CoqOfPython/ethereum/gray_glacier/vm/instructions/comparison.v b/CoqOfPython/ethereum/gray_glacier/vm/instructions/comparison.v index c003eff..a82d223 100644 --- a/CoqOfPython/ethereum/gray_glacier/vm/instructions/comparison.v +++ b/CoqOfPython/ethereum/gray_glacier/vm/instructions/comparison.v @@ -105,6 +105,9 @@ Definition less_than : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom less_than_in_globals : + IsInGlobals globals "less_than" (make_function less_than). + Definition signed_less_than : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -182,6 +185,9 @@ Definition signed_less_than : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom signed_less_than_in_globals : + IsInGlobals globals "signed_less_than" (make_function signed_less_than). + Definition greater_than : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -252,6 +258,9 @@ Definition greater_than : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom greater_than_in_globals : + IsInGlobals globals "greater_than" (make_function greater_than). + Definition signed_greater_than : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -329,6 +338,9 @@ Definition signed_greater_than : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom signed_greater_than_in_globals : + IsInGlobals globals "signed_greater_than" (make_function signed_greater_than). + Definition equal : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -399,6 +411,9 @@ Definition equal : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom equal_in_globals : + IsInGlobals globals "equal" (make_function equal). + Definition is_zero : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -458,3 +473,6 @@ Definition is_zero : Value.t -> Value.t -> M := Constant.int 1 |) in M.pure Constant.None_)). + +Axiom is_zero_in_globals : + IsInGlobals globals "is_zero" (make_function is_zero). diff --git a/CoqOfPython/ethereum/gray_glacier/vm/instructions/control_flow.v b/CoqOfPython/ethereum/gray_glacier/vm/instructions/control_flow.v index 5c7b1a5..bb1671c 100644 --- a/CoqOfPython/ethereum/gray_glacier/vm/instructions/control_flow.v +++ b/CoqOfPython/ethereum/gray_glacier/vm/instructions/control_flow.v @@ -71,6 +71,9 @@ Definition stop : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom stop_in_globals : + IsInGlobals globals "stop" (make_function stop). + Definition jump : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -136,6 +139,9 @@ Definition jump : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom jump_in_globals : + IsInGlobals globals "jump" (make_function jump). + Definition jumpi : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -237,6 +243,9 @@ Definition jumpi : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom jumpi_in_globals : + IsInGlobals globals "jumpi" (make_function jumpi). + Definition pc : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -281,6 +290,9 @@ Definition pc : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom pc_in_globals : + IsInGlobals globals "pc" (make_function pc). + Definition gas_left : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -325,6 +337,9 @@ Definition gas_left : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom gas_left_in_globals : + IsInGlobals globals "gas_left" (make_function gas_left). + Definition jumpdest : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -356,3 +371,6 @@ Definition jumpdest : Value.t -> Value.t -> M := Constant.int 1 |) in M.pure Constant.None_)). + +Axiom jumpdest_in_globals : + IsInGlobals globals "jumpdest" (make_function jumpdest). diff --git a/CoqOfPython/ethereum/gray_glacier/vm/instructions/environment.v b/CoqOfPython/ethereum/gray_glacier/vm/instructions/environment.v index 3bb0ad5..bf909cc 100644 --- a/CoqOfPython/ethereum/gray_glacier/vm/instructions/environment.v +++ b/CoqOfPython/ethereum/gray_glacier/vm/instructions/environment.v @@ -120,6 +120,9 @@ Definition address : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom address_in_globals : + IsInGlobals globals "address" (make_function address). + Definition balance : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -212,6 +215,9 @@ Definition balance : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom balance_in_globals : + IsInGlobals globals "balance" (make_function balance). + Definition origin : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -256,6 +262,9 @@ Definition origin : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom origin_in_globals : + IsInGlobals globals "origin" (make_function origin). + Definition caller : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -299,6 +308,9 @@ Definition caller : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom caller_in_globals : + IsInGlobals globals "caller" (make_function caller). + Definition callvalue : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -336,6 +348,9 @@ Definition callvalue : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom callvalue_in_globals : + IsInGlobals globals "callvalue" (make_function callvalue). + Definition calldataload : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -407,6 +422,9 @@ Definition calldataload : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom calldataload_in_globals : + IsInGlobals globals "calldataload" (make_function calldataload). + Definition calldatasize : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -456,6 +474,9 @@ Definition calldatasize : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom calldatasize_in_globals : + IsInGlobals globals "calldatasize" (make_function calldatasize). + Definition calldatacopy : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -591,6 +612,9 @@ Definition calldatacopy : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom calldatacopy_in_globals : + IsInGlobals globals "calldatacopy" (make_function calldatacopy). + Definition codesize : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -640,6 +664,9 @@ Definition codesize : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom codesize_in_globals : + IsInGlobals globals "codesize" (make_function codesize). + Definition codecopy : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -775,6 +802,9 @@ Definition codecopy : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom codecopy_in_globals : + IsInGlobals globals "codecopy" (make_function codecopy). + Definition gasprice : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -818,6 +848,9 @@ Definition gasprice : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom gasprice_in_globals : + IsInGlobals globals "gasprice" (make_function gasprice). + Definition extcodesize : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -922,6 +955,9 @@ Definition extcodesize : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom extcodesize_in_globals : + IsInGlobals globals "extcodesize" (make_function extcodesize). + Definition extcodecopy : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -1116,6 +1152,9 @@ Definition extcodecopy : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom extcodecopy_in_globals : + IsInGlobals globals "extcodecopy" (make_function extcodecopy). + Definition returndatasize : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -1164,6 +1203,9 @@ Definition returndatasize : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom returndatasize_in_globals : + IsInGlobals globals "returndatasize" (make_function returndatasize). + Definition returndatacopy : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -1327,6 +1369,9 @@ Definition returndatacopy : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom returndatacopy_in_globals : + IsInGlobals globals "returndatacopy" (make_function returndatacopy). + Definition extcodehash : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -1457,6 +1502,9 @@ Definition extcodehash : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom extcodehash_in_globals : + IsInGlobals globals "extcodehash" (make_function extcodehash). + Definition self_balance : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -1505,6 +1553,9 @@ Definition self_balance : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom self_balance_in_globals : + IsInGlobals globals "self_balance" (make_function self_balance). + Definition base_fee : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -1547,3 +1598,6 @@ Definition base_fee : Value.t -> Value.t -> M := Constant.int 1 |) in M.pure Constant.None_)). + +Axiom base_fee_in_globals : + IsInGlobals globals "base_fee" (make_function base_fee). diff --git a/CoqOfPython/ethereum/gray_glacier/vm/instructions/keccak.v b/CoqOfPython/ethereum/gray_glacier/vm/instructions/keccak.v index ea84567..134bdf7 100644 --- a/CoqOfPython/ethereum/gray_glacier/vm/instructions/keccak.v +++ b/CoqOfPython/ethereum/gray_glacier/vm/instructions/keccak.v @@ -189,3 +189,6 @@ Definition keccak : Value.t -> Value.t -> M := Constant.int 1 |) in M.pure Constant.None_)). + +Axiom keccak_in_globals : + IsInGlobals globals "keccak" (make_function keccak). diff --git a/CoqOfPython/ethereum/gray_glacier/vm/instructions/log.v b/CoqOfPython/ethereum/gray_glacier/vm/instructions/log.v index 971c211..9121fcd 100644 --- a/CoqOfPython/ethereum/gray_glacier/vm/instructions/log.v +++ b/CoqOfPython/ethereum/gray_glacier/vm/instructions/log.v @@ -208,6 +208,9 @@ Definition log_n : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom log_n_in_globals : + IsInGlobals globals "log_n" (make_function log_n). + Definition log0 : Value.t := M.run ltac:(M.monadic ( M.call (| M.get_name (| globals, locals_stack, "partial" |), diff --git a/CoqOfPython/ethereum/gray_glacier/vm/instructions/memory.v b/CoqOfPython/ethereum/gray_glacier/vm/instructions/memory.v index 1f20979..b73e42c 100644 --- a/CoqOfPython/ethereum/gray_glacier/vm/instructions/memory.v +++ b/CoqOfPython/ethereum/gray_glacier/vm/instructions/memory.v @@ -145,6 +145,9 @@ Definition mstore : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom mstore_in_globals : + IsInGlobals globals "mstore" (make_function mstore). + Definition mstore8 : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -249,6 +252,9 @@ Definition mstore8 : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom mstore8_in_globals : + IsInGlobals globals "mstore8" (make_function mstore8). + Definition mload : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -349,6 +355,9 @@ Definition mload : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom mload_in_globals : + IsInGlobals globals "mload" (make_function mload). + Definition msize : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -397,3 +406,6 @@ Definition msize : Value.t -> Value.t -> M := Constant.int 1 |) in M.pure Constant.None_)). + +Axiom msize_in_globals : + IsInGlobals globals "msize" (make_function msize). diff --git a/CoqOfPython/ethereum/gray_glacier/vm/instructions/stack.v b/CoqOfPython/ethereum/gray_glacier/vm/instructions/stack.v index 5afb343..80ee75e 100644 --- a/CoqOfPython/ethereum/gray_glacier/vm/instructions/stack.v +++ b/CoqOfPython/ethereum/gray_glacier/vm/instructions/stack.v @@ -82,6 +82,9 @@ Definition pop : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom pop_in_globals : + IsInGlobals globals "pop" (make_function pop). + Definition push_n : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm"; "num_bytes" ] in @@ -159,6 +162,9 @@ Definition push_n : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom push_n_in_globals : + IsInGlobals globals "push_n" (make_function push_n). + Definition dup_n : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm"; "item_number" ] in @@ -236,6 +242,9 @@ Definition dup_n : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom dup_n_in_globals : + IsInGlobals globals "dup_n" (make_function dup_n). + Definition swap_n : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm"; "item_number" ] in @@ -312,6 +321,9 @@ Definition swap_n : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom swap_n_in_globals : + IsInGlobals globals "swap_n" (make_function swap_n). + Definition push1 : Value.t := M.run ltac:(M.monadic ( M.call (| M.get_name (| globals, locals_stack, "partial" |), diff --git a/CoqOfPython/ethereum/gray_glacier/vm/instructions/storage.v b/CoqOfPython/ethereum/gray_glacier/vm/instructions/storage.v index d897e28..3597d53 100644 --- a/CoqOfPython/ethereum/gray_glacier/vm/instructions/storage.v +++ b/CoqOfPython/ethereum/gray_glacier/vm/instructions/storage.v @@ -152,6 +152,9 @@ Definition sload : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom sload_in_globals : + IsInGlobals globals "sload" (make_function sload). + Definition sstore : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -493,3 +496,6 @@ Definition sstore : Value.t -> Value.t -> M := Constant.int 1 |) in M.pure Constant.None_)). + +Axiom sstore_in_globals : + IsInGlobals globals "sstore" (make_function sstore). diff --git a/CoqOfPython/ethereum/gray_glacier/vm/instructions/system.v b/CoqOfPython/ethereum/gray_glacier/vm/instructions/system.v index 016e5bb..77ef2f4 100644 --- a/CoqOfPython/ethereum/gray_glacier/vm/instructions/system.v +++ b/CoqOfPython/ethereum/gray_glacier/vm/instructions/system.v @@ -383,6 +383,9 @@ Definition generic_create : Value.t -> Value.t -> M := )) |) in M.pure Constant.None_)). +Axiom generic_create_in_globals : + IsInGlobals globals "generic_create" (make_function generic_create). + Definition create : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -493,6 +496,9 @@ Definition create : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom create_in_globals : + IsInGlobals globals "create" (make_function create). + Definition create2 : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -647,6 +653,9 @@ Definition create2 : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom create2_in_globals : + IsInGlobals globals "create2" (make_function create2). + Definition return_ : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -730,6 +739,9 @@ Definition return_ : Value.t -> Value.t -> M := let _ := M.pass (| |) in M.pure Constant.None_)). +Axiom return__in_globals : + IsInGlobals globals "return_" (make_function return_). + Definition generic_call : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm"; "gas"; "value"; "caller"; "to"; "code_address"; "should_transfer_value"; "is_staticcall"; "memory_input_start_position"; "memory_input_size"; "memory_output_start_position"; "memory_output_size" ] in @@ -925,6 +937,9 @@ Definition generic_call : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom generic_call_in_globals : + IsInGlobals globals "generic_call" (make_function generic_call). + Definition call : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -1258,6 +1273,9 @@ M.get_name (| globals, locals_stack, "GAS_CALL_VALUE" |) |) in M.pure Constant.None_)). +Axiom call_in_globals : + IsInGlobals globals "call" (make_function call). + Definition callcode : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -1536,6 +1554,9 @@ M.get_name (| globals, locals_stack, "GAS_CALL_VALUE" |) |) in M.pure Constant.None_)). +Axiom callcode_in_globals : + IsInGlobals globals "callcode" (make_function callcode). + Definition selfdestruct : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -1740,6 +1761,9 @@ Definition selfdestruct : Value.t -> Value.t -> M := let _ := M.pass (| |) in M.pure Constant.None_)). +Axiom selfdestruct_in_globals : + IsInGlobals globals "selfdestruct" (make_function selfdestruct). + Definition delegatecall : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -1937,6 +1961,9 @@ Definition delegatecall : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom delegatecall_in_globals : + IsInGlobals globals "delegatecall" (make_function delegatecall). + Definition staticcall : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -2140,6 +2167,9 @@ Definition staticcall : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom staticcall_in_globals : + IsInGlobals globals "staticcall" (make_function staticcall). + Definition revert : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -2226,3 +2256,6 @@ Definition revert : Value.t -> Value.t -> M := let _ := M.raise (| Some (M.get_name (| globals, locals_stack, "Revert" |)) |) in let _ := M.pass (| |) in M.pure Constant.None_)). + +Axiom revert_in_globals : + IsInGlobals globals "revert" (make_function revert). diff --git a/CoqOfPython/ethereum/gray_glacier/vm/interpreter.v b/CoqOfPython/ethereum/gray_glacier/vm/interpreter.v index 1aa54db..3227434 100644 --- a/CoqOfPython/ethereum/gray_glacier/vm/interpreter.v +++ b/CoqOfPython/ethereum/gray_glacier/vm/interpreter.v @@ -406,6 +406,9 @@ Definition process_message_call : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom process_message_call_in_globals : + IsInGlobals globals "process_message_call" (make_function process_message_call). + Definition process_create_message : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "message"; "env" ] in @@ -508,6 +511,9 @@ Definition process_create_message : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom process_create_message_in_globals : + IsInGlobals globals "process_create_message" (make_function process_create_message). + Definition process_message : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "message"; "env" ] in @@ -633,6 +639,9 @@ Definition process_message : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom process_message_in_globals : + IsInGlobals globals "process_message" (make_function process_message). + Definition execute_code : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "message"; "env" ] in @@ -679,3 +688,6 @@ Definition execute_code : Value.t -> Value.t -> M := M.get_name (| globals, locals_stack, "evm" |) |) in M.pure Constant.None_)). + +Axiom execute_code_in_globals : + IsInGlobals globals "execute_code" (make_function execute_code). diff --git a/CoqOfPython/ethereum/gray_glacier/vm/memory.v b/CoqOfPython/ethereum/gray_glacier/vm/memory.v index c3869cf..4dafbe3 100644 --- a/CoqOfPython/ethereum/gray_glacier/vm/memory.v +++ b/CoqOfPython/ethereum/gray_glacier/vm/memory.v @@ -71,6 +71,9 @@ Definition memory_write : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom memory_write_in_globals : + IsInGlobals globals "memory_write" (make_function memory_write). + Definition memory_read_bytes : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "memory"; "start_position"; "size" ] in @@ -117,6 +120,9 @@ Definition memory_read_bytes : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom memory_read_bytes_in_globals : + IsInGlobals globals "memory_read_bytes" (make_function memory_read_bytes). + Definition buffer_read : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "buffer"; "start_position"; "size" ] in @@ -169,3 +175,6 @@ Definition buffer_read : Value.t -> Value.t -> M := |) |) in M.pure Constant.None_)). + +Axiom buffer_read_in_globals : + IsInGlobals globals "buffer_read" (make_function buffer_read). diff --git a/CoqOfPython/ethereum/gray_glacier/vm/precompiled_contracts/alt_bn128.v b/CoqOfPython/ethereum/gray_glacier/vm/precompiled_contracts/alt_bn128.v index a2214fe..58291d3 100644 --- a/CoqOfPython/ethereum/gray_glacier/vm/precompiled_contracts/alt_bn128.v +++ b/CoqOfPython/ethereum/gray_glacier/vm/precompiled_contracts/alt_bn128.v @@ -273,6 +273,9 @@ Definition alt_bn128_add : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom alt_bn128_add_in_globals : + IsInGlobals globals "alt_bn128_add" (make_function alt_bn128_add). + Definition alt_bn128_mul : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -455,6 +458,9 @@ Definition alt_bn128_mul : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom alt_bn128_mul_in_globals : + IsInGlobals globals "alt_bn128_mul" (make_function alt_bn128_mul). + Definition alt_bn128_pairing_check : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -781,3 +787,6 @@ Definition alt_bn128_pairing_check : Value.t -> Value.t -> M := M.pure Constant.None_ )) |) in M.pure Constant.None_)). + +Axiom alt_bn128_pairing_check_in_globals : + IsInGlobals globals "alt_bn128_pairing_check" (make_function alt_bn128_pairing_check). diff --git a/CoqOfPython/ethereum/gray_glacier/vm/precompiled_contracts/blake2f.v b/CoqOfPython/ethereum/gray_glacier/vm/precompiled_contracts/blake2f.v index c52e464..905ec42 100644 --- a/CoqOfPython/ethereum/gray_glacier/vm/precompiled_contracts/blake2f.v +++ b/CoqOfPython/ethereum/gray_glacier/vm/precompiled_contracts/blake2f.v @@ -128,3 +128,6 @@ Definition blake2f : Value.t -> Value.t -> M := |) |) in M.pure Constant.None_)). + +Axiom blake2f_in_globals : + IsInGlobals globals "blake2f" (make_function blake2f). diff --git a/CoqOfPython/ethereum/gray_glacier/vm/precompiled_contracts/ecrecover.v b/CoqOfPython/ethereum/gray_glacier/vm/precompiled_contracts/ecrecover.v index ed99d82..5dc97d5 100644 --- a/CoqOfPython/ethereum/gray_glacier/vm/precompiled_contracts/ecrecover.v +++ b/CoqOfPython/ethereum/gray_glacier/vm/precompiled_contracts/ecrecover.v @@ -302,3 +302,6 @@ Definition ecrecover : Value.t -> Value.t -> M := M.get_name (| globals, locals_stack, "padded_address" |) |) in M.pure Constant.None_)). + +Axiom ecrecover_in_globals : + IsInGlobals globals "ecrecover" (make_function ecrecover). diff --git a/CoqOfPython/ethereum/gray_glacier/vm/precompiled_contracts/identity.v b/CoqOfPython/ethereum/gray_glacier/vm/precompiled_contracts/identity.v index 52e89a2..20d4cb3 100644 --- a/CoqOfPython/ethereum/gray_glacier/vm/precompiled_contracts/identity.v +++ b/CoqOfPython/ethereum/gray_glacier/vm/precompiled_contracts/identity.v @@ -95,3 +95,6 @@ Definition identity : Value.t -> Value.t -> M := M.get_name (| globals, locals_stack, "data" |) |) in M.pure Constant.None_)). + +Axiom identity_in_globals : + IsInGlobals globals "identity" (make_function identity). diff --git a/CoqOfPython/ethereum/gray_glacier/vm/precompiled_contracts/modexp.v b/CoqOfPython/ethereum/gray_glacier/vm/precompiled_contracts/modexp.v index 49c54b1..56471af 100644 --- a/CoqOfPython/ethereum/gray_glacier/vm/precompiled_contracts/modexp.v +++ b/CoqOfPython/ethereum/gray_glacier/vm/precompiled_contracts/modexp.v @@ -356,6 +356,9 @@ Definition modexp : Value.t -> Value.t -> M := )) |) in M.pure Constant.None_)). +Axiom modexp_in_globals : + IsInGlobals globals "modexp" (make_function modexp). + Definition complexity : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "base_length"; "modulus_length" ] in @@ -419,6 +422,9 @@ Definition complexity : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom complexity_in_globals : + IsInGlobals globals "complexity" (make_function complexity). + Definition iterations : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "exponent_length"; "exponent_head" ] in @@ -600,6 +606,9 @@ Definition iterations : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom iterations_in_globals : + IsInGlobals globals "iterations" (make_function iterations). + Definition gas_cost : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "base_length"; "modulus_length"; "exponent_length"; "exponent_head" ] in @@ -680,3 +689,6 @@ Definition gas_cost : Value.t -> Value.t -> M := |) |) in M.pure Constant.None_)). + +Axiom gas_cost_in_globals : + IsInGlobals globals "gas_cost" (make_function gas_cost). diff --git a/CoqOfPython/ethereum/gray_glacier/vm/precompiled_contracts/ripemd160.v b/CoqOfPython/ethereum/gray_glacier/vm/precompiled_contracts/ripemd160.v index 9e6da29..2fdf05a 100644 --- a/CoqOfPython/ethereum/gray_glacier/vm/precompiled_contracts/ripemd160.v +++ b/CoqOfPython/ethereum/gray_glacier/vm/precompiled_contracts/ripemd160.v @@ -126,3 +126,6 @@ Definition ripemd160 : Value.t -> Value.t -> M := M.get_name (| globals, locals_stack, "padded_hash" |) |) in M.pure Constant.None_)). + +Axiom ripemd160_in_globals : + IsInGlobals globals "ripemd160" (make_function ripemd160). diff --git a/CoqOfPython/ethereum/gray_glacier/vm/precompiled_contracts/sha256.v b/CoqOfPython/ethereum/gray_glacier/vm/precompiled_contracts/sha256.v index 85a0889..f88bcc2 100644 --- a/CoqOfPython/ethereum/gray_glacier/vm/precompiled_contracts/sha256.v +++ b/CoqOfPython/ethereum/gray_glacier/vm/precompiled_contracts/sha256.v @@ -107,3 +107,6 @@ Definition sha256 : Value.t -> Value.t -> M := |) |) in M.pure Constant.None_)). + +Axiom sha256_in_globals : + IsInGlobals globals "sha256" (make_function sha256). diff --git a/CoqOfPython/ethereum/gray_glacier/vm/runtime.v b/CoqOfPython/ethereum/gray_glacier/vm/runtime.v index 9bcce8b..f1bf432 100644 --- a/CoqOfPython/ethereum/gray_glacier/vm/runtime.v +++ b/CoqOfPython/ethereum/gray_glacier/vm/runtime.v @@ -158,3 +158,6 @@ Definition get_valid_jump_destinations : Value.t -> Value.t -> M := M.get_name (| globals, locals_stack, "valid_jump_destinations" |) |) in M.pure Constant.None_)). + +Axiom get_valid_jump_destinations_in_globals : + IsInGlobals globals "get_valid_jump_destinations" (make_function get_valid_jump_destinations). diff --git a/CoqOfPython/ethereum/gray_glacier/vm/stack.v b/CoqOfPython/ethereum/gray_glacier/vm/stack.v index eb37711..e52ebd2 100644 --- a/CoqOfPython/ethereum/gray_glacier/vm/stack.v +++ b/CoqOfPython/ethereum/gray_glacier/vm/stack.v @@ -78,6 +78,9 @@ Definition pop : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom pop_in_globals : + IsInGlobals globals "pop" (make_function pop). + Definition push : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "stack"; "value" ] in @@ -125,3 +128,6 @@ Definition push : Value.t -> Value.t -> M := |) |) in M.pure Constant.None_)). + +Axiom push_in_globals : + IsInGlobals globals "push" (make_function push). diff --git a/CoqOfPython/ethereum/homestead/bloom.v b/CoqOfPython/ethereum/homestead/bloom.v index 251dad4..d9a23bd 100644 --- a/CoqOfPython/ethereum/homestead/bloom.v +++ b/CoqOfPython/ethereum/homestead/bloom.v @@ -140,6 +140,9 @@ Definition add_to_bloom : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom add_to_bloom_in_globals : + IsInGlobals globals "add_to_bloom" (make_function add_to_bloom). + Definition logs_bloom : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "logs" ] in @@ -209,3 +212,6 @@ Definition logs_bloom : Value.t -> Value.t -> M := |) |) in M.pure Constant.None_)). + +Axiom logs_bloom_in_globals : + IsInGlobals globals "logs_bloom" (make_function logs_bloom). diff --git a/CoqOfPython/ethereum/homestead/fork.v b/CoqOfPython/ethereum/homestead/fork.v index d156e8e..4f70853 100644 --- a/CoqOfPython/ethereum/homestead/fork.v +++ b/CoqOfPython/ethereum/homestead/fork.v @@ -209,6 +209,9 @@ Definition apply_fork : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom apply_fork_in_globals : + IsInGlobals globals "apply_fork" (make_function apply_fork). + Definition get_last_256_block_hashes : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "chain" ] in @@ -321,6 +324,9 @@ Definition get_last_256_block_hashes : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom get_last_256_block_hashes_in_globals : + IsInGlobals globals "get_last_256_block_hashes" (make_function get_last_256_block_hashes). + Definition state_transition : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "chain"; "block" ] in @@ -487,6 +493,9 @@ Definition state_transition : Value.t -> Value.t -> M := )) |) in M.pure Constant.None_)). +Axiom state_transition_in_globals : + IsInGlobals globals "state_transition" (make_function state_transition). + Definition validate_header : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "header"; "parent_header" ] in @@ -625,6 +634,9 @@ Definition validate_header : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom validate_header_in_globals : + IsInGlobals globals "validate_header" (make_function validate_header). + Definition generate_header_hash_for_pow : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "header" ] in @@ -680,6 +692,9 @@ Definition generate_header_hash_for_pow : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom generate_header_hash_for_pow_in_globals : + IsInGlobals globals "generate_header_hash_for_pow" (make_function generate_header_hash_for_pow). + Definition validate_proof_of_work : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "header" ] in @@ -770,6 +785,9 @@ Definition validate_proof_of_work : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom validate_proof_of_work_in_globals : + IsInGlobals globals "validate_proof_of_work" (make_function validate_proof_of_work). + Definition check_transaction : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "tx"; "gas_available" ] in @@ -820,6 +838,9 @@ Definition check_transaction : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom check_transaction_in_globals : + IsInGlobals globals "check_transaction" (make_function check_transaction). + Definition make_receipt : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "tx"; "post_state"; "cumulative_gas_used"; "logs" ] in @@ -857,6 +878,9 @@ Definition make_receipt : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom make_receipt_in_globals : + IsInGlobals globals "make_receipt" (make_function make_receipt). + Definition ApplyBodyOutput : Value.t := builtins.make_klass [] @@ -1097,6 +1121,9 @@ Definition apply_body : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom apply_body_in_globals : + IsInGlobals globals "apply_body" (make_function apply_body). + Definition validate_ommers : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "ommers"; "block_header"; "chain" ] in @@ -1418,6 +1445,9 @@ Definition validate_ommers : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom validate_ommers_in_globals : + IsInGlobals globals "validate_ommers" (make_function validate_ommers). + Definition pay_rewards : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "state"; "block_number"; "coinbase"; "ommers" ] in @@ -1523,6 +1553,9 @@ Definition pay_rewards : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom pay_rewards_in_globals : + IsInGlobals globals "pay_rewards" (make_function pay_rewards). + Definition process_transaction : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "env"; "tx" ] in @@ -1813,6 +1846,9 @@ Definition process_transaction : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom process_transaction_in_globals : + IsInGlobals globals "process_transaction" (make_function process_transaction). + Definition validate_transaction : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "tx" ] in @@ -1869,6 +1905,9 @@ Definition validate_transaction : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom validate_transaction_in_globals : + IsInGlobals globals "validate_transaction" (make_function validate_transaction). + Definition calculate_intrinsic_cost : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "tx" ] in @@ -1979,6 +2018,9 @@ Definition calculate_intrinsic_cost : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom calculate_intrinsic_cost_in_globals : + IsInGlobals globals "calculate_intrinsic_cost" (make_function calculate_intrinsic_cost). + Definition recover_sender : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "tx" ] in @@ -2110,6 +2152,9 @@ Definition recover_sender : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom recover_sender_in_globals : + IsInGlobals globals "recover_sender" (make_function recover_sender). + Definition signing_hash : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "tx" ] in @@ -2148,6 +2193,9 @@ Definition signing_hash : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom signing_hash_in_globals : + IsInGlobals globals "signing_hash" (make_function signing_hash). + Definition compute_header_hash : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "header" ] in @@ -2200,6 +2248,9 @@ Definition compute_header_hash : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom compute_header_hash_in_globals : + IsInGlobals globals "compute_header_hash" (make_function compute_header_hash). + Definition check_gas_limit : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "gas_limit"; "parent_gas_limit" ] in @@ -2300,6 +2351,9 @@ Definition check_gas_limit : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom check_gas_limit_in_globals : + IsInGlobals globals "check_gas_limit" (make_function check_gas_limit). + Definition calculate_block_difficulty : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "block_number"; "block_timestamp"; "parent_timestamp"; "parent_difficulty" ] in @@ -2446,3 +2500,6 @@ Definition calculate_block_difficulty : Value.t -> Value.t -> M := |) |) in M.pure Constant.None_)). + +Axiom calculate_block_difficulty_in_globals : + IsInGlobals globals "calculate_block_difficulty" (make_function calculate_block_difficulty). diff --git a/CoqOfPython/ethereum/homestead/fork_types.v b/CoqOfPython/ethereum/homestead/fork_types.v index acb8202..59ba66d 100644 --- a/CoqOfPython/ethereum/homestead/fork_types.v +++ b/CoqOfPython/ethereum/homestead/fork_types.v @@ -99,3 +99,6 @@ Definition encode_account : Value.t -> Value.t -> M := |) |) in M.pure Constant.None_)). + +Axiom encode_account_in_globals : + IsInGlobals globals "encode_account" (make_function encode_account). diff --git a/CoqOfPython/ethereum/homestead/state.v b/CoqOfPython/ethereum/homestead/state.v index 3fa3723..cfc2954 100644 --- a/CoqOfPython/ethereum/homestead/state.v +++ b/CoqOfPython/ethereum/homestead/state.v @@ -97,6 +97,9 @@ Definition close_state : Value.t -> Value.t -> M := let _ := M.delete (| M.get_field (| M.get_name (| globals, locals_stack, "state" |), "_snapshots" |) |) in M.pure Constant.None_)). +Axiom close_state_in_globals : + IsInGlobals globals "close_state" (make_function close_state). + Definition begin_transaction : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "state" ] in @@ -127,6 +130,9 @@ Definition begin_transaction : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom begin_transaction_in_globals : + IsInGlobals globals "begin_transaction" (make_function begin_transaction). + Definition commit_transaction : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "state" ] in @@ -146,6 +152,9 @@ Definition commit_transaction : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom commit_transaction_in_globals : + IsInGlobals globals "commit_transaction" (make_function commit_transaction). + Definition rollback_transaction : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "state" ] in @@ -169,6 +178,9 @@ Definition rollback_transaction : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom rollback_transaction_in_globals : + IsInGlobals globals "rollback_transaction" (make_function rollback_transaction). + Definition get_account : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "state"; "address" ] in @@ -229,6 +241,9 @@ Definition get_account : Value.t -> Value.t -> M := )) |) in M.pure Constant.None_)). +Axiom get_account_in_globals : + IsInGlobals globals "get_account" (make_function get_account). + Definition get_account_optional : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "state"; "address" ] in @@ -265,6 +280,9 @@ Definition get_account_optional : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom get_account_optional_in_globals : + IsInGlobals globals "get_account_optional" (make_function get_account_optional). + Definition set_account : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "state"; "address"; "account" ] in @@ -293,6 +311,9 @@ Definition set_account : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom set_account_in_globals : + IsInGlobals globals "set_account" (make_function set_account). + Definition destroy_account : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "state"; "address" ] in @@ -330,6 +351,9 @@ Definition destroy_account : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom destroy_account_in_globals : + IsInGlobals globals "destroy_account" (make_function destroy_account). + Definition destroy_storage : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "state"; "address" ] in @@ -364,6 +388,9 @@ Definition destroy_storage : Value.t -> Value.t -> M := )) |) in M.pure Constant.None_)). +Axiom destroy_storage_in_globals : + IsInGlobals globals "destroy_storage" (make_function destroy_storage). + Definition get_storage : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "state"; "address"; "key" ] in @@ -443,6 +470,9 @@ Definition get_storage : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom get_storage_in_globals : + IsInGlobals globals "get_storage" (make_function get_storage). + Definition set_storage : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "state"; "address"; "key"; "value" ] in @@ -541,6 +571,9 @@ Definition set_storage : Value.t -> Value.t -> M := )) |) in M.pure Constant.None_)). +Axiom set_storage_in_globals : + IsInGlobals globals "set_storage" (make_function set_storage). + Definition storage_root : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "state"; "address" ] in @@ -592,6 +625,9 @@ Definition storage_root : Value.t -> Value.t -> M := )) |) in M.pure Constant.None_)). +Axiom storage_root_in_globals : + IsInGlobals globals "storage_root" (make_function storage_root). + Definition state_root : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "state" ] in @@ -622,6 +658,9 @@ Definition state_root : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom state_root_in_globals : + IsInGlobals globals "state_root" (make_function state_root). + Definition account_exists : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "state"; "address" ] in @@ -656,6 +695,9 @@ Definition account_exists : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom account_exists_in_globals : + IsInGlobals globals "account_exists" (make_function account_exists). + Definition account_has_code_or_nonce : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "state"; "address" ] in @@ -709,6 +751,9 @@ Definition account_has_code_or_nonce : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom account_has_code_or_nonce_in_globals : + IsInGlobals globals "account_has_code_or_nonce" (make_function account_has_code_or_nonce). + Definition modify_state : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "state"; "address"; "f" ] in @@ -741,6 +786,9 @@ Definition modify_state : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom modify_state_in_globals : + IsInGlobals globals "modify_state" (make_function modify_state). + Definition move_ether : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "state"; "sender_address"; "recipient_address"; "amount" ] in @@ -770,6 +818,9 @@ Definition move_ether : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom move_ether_in_globals : + IsInGlobals globals "move_ether" (make_function move_ether). + Definition set_account_balance : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "state"; "address"; "amount" ] in @@ -800,6 +851,9 @@ Definition set_account_balance : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom set_account_balance_in_globals : + IsInGlobals globals "set_account_balance" (make_function set_account_balance). + Definition touch_account : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "state"; "address" ] in @@ -844,6 +898,9 @@ Definition touch_account : Value.t -> Value.t -> M := )) |) in M.pure Constant.None_)). +Axiom touch_account_in_globals : + IsInGlobals globals "touch_account" (make_function touch_account). + Definition increment_nonce : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "state"; "address" ] in @@ -871,6 +928,9 @@ Definition increment_nonce : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom increment_nonce_in_globals : + IsInGlobals globals "increment_nonce" (make_function increment_nonce). + Definition set_code : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "state"; "address"; "code" ] in @@ -901,6 +961,9 @@ Definition set_code : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom set_code_in_globals : + IsInGlobals globals "set_code" (make_function set_code). + Definition create_ether : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "state"; "address"; "amount" ] in @@ -928,3 +991,6 @@ Definition create_ether : Value.t -> Value.t -> M := make_dict [] |) in M.pure Constant.None_)). + +Axiom create_ether_in_globals : + IsInGlobals globals "create_ether" (make_function create_ether). diff --git a/CoqOfPython/ethereum/homestead/trie.v b/CoqOfPython/ethereum/homestead/trie.v index 60e2f90..6cc6e14 100644 --- a/CoqOfPython/ethereum/homestead/trie.v +++ b/CoqOfPython/ethereum/homestead/trie.v @@ -365,6 +365,9 @@ Definition encode_internal_node : Value.t -> Value.t -> M := )) |) in M.pure Constant.None_)). +Axiom encode_internal_node_in_globals : + IsInGlobals globals "encode_internal_node" (make_function encode_internal_node). + Definition encode_node : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "node"; "storage_root" ] in @@ -473,6 +476,9 @@ Definition encode_node : Value.t -> Value.t -> M := )) |) in M.pure Constant.None_)). +Axiom encode_node_in_globals : + IsInGlobals globals "encode_node" (make_function encode_node). + Definition Trie : Value.t := builtins.make_klass [(* At base: unsupported node type: Subscript *)] @@ -520,6 +526,9 @@ Definition copy_trie : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom copy_trie_in_globals : + IsInGlobals globals "copy_trie" (make_function copy_trie). + Definition trie_set : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "trie"; "key"; "value" ] in @@ -580,6 +589,9 @@ Definition trie_set : Value.t -> Value.t -> M := )) |) in M.pure Constant.None_)). +Axiom trie_set_in_globals : + IsInGlobals globals "trie_set" (make_function trie_set). + Definition trie_get : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "trie"; "key" ] in @@ -613,6 +625,9 @@ Definition trie_get : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom trie_get_in_globals : + IsInGlobals globals "trie_get" (make_function trie_get). + Definition common_prefix_length : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "a"; "b" ] in @@ -691,6 +706,9 @@ Definition common_prefix_length : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom common_prefix_length_in_globals : + IsInGlobals globals "common_prefix_length" (make_function common_prefix_length). + Definition nibble_list_to_compact : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "x"; "is_leaf" ] in @@ -899,6 +917,9 @@ Definition nibble_list_to_compact : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom nibble_list_to_compact_in_globals : + IsInGlobals globals "nibble_list_to_compact" (make_function nibble_list_to_compact). + Definition bytes_to_nibble_list : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "bytes_" ] in @@ -995,6 +1016,9 @@ Definition bytes_to_nibble_list : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom bytes_to_nibble_list_in_globals : + IsInGlobals globals "bytes_to_nibble_list" (make_function bytes_to_nibble_list). + Definition _prepare_trie : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "trie"; "get_storage_root" ] in @@ -1146,6 +1170,9 @@ Definition _prepare_trie : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom _prepare_trie_in_globals : + IsInGlobals globals "_prepare_trie" (make_function _prepare_trie). + Definition root : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "trie"; "get_storage_root" ] in @@ -1261,6 +1288,9 @@ Definition root : Value.t -> Value.t -> M := )) |) in M.pure Constant.None_)). +Axiom root_in_globals : + IsInGlobals globals "root" (make_function root). + Definition patricialize : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "obj"; "level" ] in @@ -1600,3 +1630,6 @@ Definition patricialize : Value.t -> Value.t -> M := |) |) in M.pure Constant.None_)). + +Axiom patricialize_in_globals : + IsInGlobals globals "patricialize" (make_function patricialize). diff --git a/CoqOfPython/ethereum/homestead/utils/address.v b/CoqOfPython/ethereum/homestead/utils/address.v index 9acdf08..109a89e 100644 --- a/CoqOfPython/ethereum/homestead/utils/address.v +++ b/CoqOfPython/ethereum/homestead/utils/address.v @@ -76,6 +76,9 @@ Definition to_address : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom to_address_in_globals : + IsInGlobals globals "to_address" (make_function to_address). + Definition compute_contract_address : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "address"; "nonce" ] in @@ -145,3 +148,6 @@ Definition compute_contract_address : Value.t -> Value.t -> M := |) |) in M.pure Constant.None_)). + +Axiom compute_contract_address_in_globals : + IsInGlobals globals "compute_contract_address" (make_function compute_contract_address). diff --git a/CoqOfPython/ethereum/homestead/utils/hexadecimal.v b/CoqOfPython/ethereum/homestead/utils/hexadecimal.v index 2b34614..2eed645 100644 --- a/CoqOfPython/ethereum/homestead/utils/hexadecimal.v +++ b/CoqOfPython/ethereum/homestead/utils/hexadecimal.v @@ -70,6 +70,9 @@ Definition hex_to_root : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom hex_to_root_in_globals : + IsInGlobals globals "hex_to_root" (make_function hex_to_root). + Definition hex_to_bloom : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "hex_string" ] in @@ -110,6 +113,9 @@ Definition hex_to_bloom : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom hex_to_bloom_in_globals : + IsInGlobals globals "hex_to_bloom" (make_function hex_to_bloom). + Definition hex_to_address : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "hex_string" ] in @@ -156,3 +162,6 @@ Definition hex_to_address : Value.t -> Value.t -> M := |) |) in M.pure Constant.None_)). + +Axiom hex_to_address_in_globals : + IsInGlobals globals "hex_to_address" (make_function hex_to_address). diff --git a/CoqOfPython/ethereum/homestead/utils/message.v b/CoqOfPython/ethereum/homestead/utils/message.v index 08c3b9b..41090a1 100644 --- a/CoqOfPython/ethereum/homestead/utils/message.v +++ b/CoqOfPython/ethereum/homestead/utils/message.v @@ -209,3 +209,6 @@ Definition prepare_message : Value.t -> Value.t -> M := |) |) in M.pure Constant.None_)). + +Axiom prepare_message_in_globals : + IsInGlobals globals "prepare_message" (make_function prepare_message). diff --git a/CoqOfPython/ethereum/homestead/vm/__init__.v b/CoqOfPython/ethereum/homestead/vm/__init__.v index 4199afd..4b090d3 100644 --- a/CoqOfPython/ethereum/homestead/vm/__init__.v +++ b/CoqOfPython/ethereum/homestead/vm/__init__.v @@ -127,6 +127,9 @@ Definition incorporate_child_on_success : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom incorporate_child_on_success_in_globals : + IsInGlobals globals "incorporate_child_on_success" (make_function incorporate_child_on_success). + Definition incorporate_child_on_error : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm"; "child_evm" ] in @@ -147,3 +150,6 @@ Definition incorporate_child_on_error : Value.t -> Value.t -> M := M.get_field (| M.get_name (| globals, locals_stack, "child_evm" |), "gas_left" |) |) in M.pure Constant.None_)). + +Axiom incorporate_child_on_error_in_globals : + IsInGlobals globals "incorporate_child_on_error" (make_function incorporate_child_on_error). diff --git a/CoqOfPython/ethereum/homestead/vm/gas.v b/CoqOfPython/ethereum/homestead/vm/gas.v index b99150c..51339bb 100644 --- a/CoqOfPython/ethereum/homestead/vm/gas.v +++ b/CoqOfPython/ethereum/homestead/vm/gas.v @@ -501,6 +501,9 @@ Definition charge_gas : Value.t -> Value.t -> M := )) |) in M.pure Constant.None_)). +Axiom charge_gas_in_globals : + IsInGlobals globals "charge_gas" (make_function charge_gas). + Definition calculate_memory_gas_cost : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "size_in_bytes" ] in @@ -560,6 +563,9 @@ Definition calculate_memory_gas_cost : Value.t -> Value.t -> M := (* At stmt: unsupported node type: Try *) M.pure Constant.None_)). +Axiom calculate_memory_gas_cost_in_globals : + IsInGlobals globals "calculate_memory_gas_cost" (make_function calculate_memory_gas_cost). + Definition calculate_gas_extend_memory : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "memory"; "extensions" ] in @@ -743,6 +749,9 @@ Definition calculate_gas_extend_memory : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom calculate_gas_extend_memory_in_globals : + IsInGlobals globals "calculate_gas_extend_memory" (make_function calculate_gas_extend_memory). + Definition calculate_message_call_gas : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "state"; "gas"; "to"; "value" ] in @@ -856,3 +865,6 @@ BinOp.add (| |) |) in M.pure Constant.None_)). + +Axiom calculate_message_call_gas_in_globals : + IsInGlobals globals "calculate_message_call_gas" (make_function calculate_message_call_gas). diff --git a/CoqOfPython/ethereum/homestead/vm/instructions/arithmetic.v b/CoqOfPython/ethereum/homestead/vm/instructions/arithmetic.v index ae67ed4..b96ac43 100644 --- a/CoqOfPython/ethereum/homestead/vm/instructions/arithmetic.v +++ b/CoqOfPython/ethereum/homestead/vm/instructions/arithmetic.v @@ -119,6 +119,9 @@ Definition add : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom add_in_globals : + IsInGlobals globals "add" (make_function add). + Definition sub : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -186,6 +189,9 @@ Definition sub : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom sub_in_globals : + IsInGlobals globals "sub" (make_function sub). + Definition mul : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -253,6 +259,9 @@ Definition mul : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom mul_in_globals : + IsInGlobals globals "mul" (make_function mul). + Definition div : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -341,6 +350,9 @@ Definition div : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom div_in_globals : + IsInGlobals globals "div" (make_function div). + Definition sdiv : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -491,6 +503,9 @@ Definition sdiv : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom sdiv_in_globals : + IsInGlobals globals "sdiv" (make_function sdiv). + Definition mod_ : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -579,6 +594,9 @@ Definition mod_ : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom mod__in_globals : + IsInGlobals globals "mod" (make_function mod_). + Definition smod : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -696,6 +714,9 @@ Definition smod : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom smod_in_globals : + IsInGlobals globals "smod" (make_function smod). + Definition addmod : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -821,6 +842,9 @@ Definition addmod : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom addmod_in_globals : + IsInGlobals globals "addmod" (make_function addmod). + Definition mulmod : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -946,6 +970,9 @@ Definition mulmod : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom mulmod_in_globals : + IsInGlobals globals "mulmod" (make_function mulmod). + Definition exp : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -1057,6 +1084,9 @@ Definition exp : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom exp_in_globals : + IsInGlobals globals "exp" (make_function exp). + Definition signextend : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -1231,3 +1261,6 @@ Definition signextend : Value.t -> Value.t -> M := Constant.int 1 |) in M.pure Constant.None_)). + +Axiom signextend_in_globals : + IsInGlobals globals "signextend" (make_function signextend). diff --git a/CoqOfPython/ethereum/homestead/vm/instructions/bitwise.v b/CoqOfPython/ethereum/homestead/vm/instructions/bitwise.v index 9e98ba0..5500094 100644 --- a/CoqOfPython/ethereum/homestead/vm/instructions/bitwise.v +++ b/CoqOfPython/ethereum/homestead/vm/instructions/bitwise.v @@ -95,6 +95,9 @@ Definition bitwise_and : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom bitwise_and_in_globals : + IsInGlobals globals "bitwise_and" (make_function bitwise_and). + Definition bitwise_or : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -155,6 +158,9 @@ Definition bitwise_or : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom bitwise_or_in_globals : + IsInGlobals globals "bitwise_or" (make_function bitwise_or). + Definition bitwise_xor : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -215,6 +221,9 @@ Definition bitwise_xor : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom bitwise_xor_in_globals : + IsInGlobals globals "bitwise_xor" (make_function bitwise_xor). + Definition bitwise_not : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -262,6 +271,9 @@ Definition bitwise_not : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom bitwise_not_in_globals : + IsInGlobals globals "bitwise_not" (make_function bitwise_not). + Definition get_byte : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -377,3 +389,6 @@ Definition get_byte : Value.t -> Value.t -> M := Constant.int 1 |) in M.pure Constant.None_)). + +Axiom get_byte_in_globals : + IsInGlobals globals "get_byte" (make_function get_byte). diff --git a/CoqOfPython/ethereum/homestead/vm/instructions/block.v b/CoqOfPython/ethereum/homestead/vm/instructions/block.v index b6515f4..7ce01f6 100644 --- a/CoqOfPython/ethereum/homestead/vm/instructions/block.v +++ b/CoqOfPython/ethereum/homestead/vm/instructions/block.v @@ -129,6 +129,9 @@ Definition block_hash : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom block_hash_in_globals : + IsInGlobals globals "block_hash" (make_function block_hash). + Definition coinbase : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -176,6 +179,9 @@ Definition coinbase : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom coinbase_in_globals : + IsInGlobals globals "coinbase" (make_function coinbase). + Definition timestamp : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -217,6 +223,9 @@ Definition timestamp : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom timestamp_in_globals : + IsInGlobals globals "timestamp" (make_function timestamp). + Definition number : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -263,6 +272,9 @@ Definition number : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom number_in_globals : + IsInGlobals globals "number" (make_function number). + Definition difficulty : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -309,6 +321,9 @@ Definition difficulty : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom difficulty_in_globals : + IsInGlobals globals "difficulty" (make_function difficulty). + Definition gas_limit : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -354,3 +369,6 @@ Definition gas_limit : Value.t -> Value.t -> M := Constant.int 1 |) in M.pure Constant.None_)). + +Axiom gas_limit_in_globals : + IsInGlobals globals "gas_limit" (make_function gas_limit). diff --git a/CoqOfPython/ethereum/homestead/vm/instructions/comparison.v b/CoqOfPython/ethereum/homestead/vm/instructions/comparison.v index 927a6e9..423aafc 100644 --- a/CoqOfPython/ethereum/homestead/vm/instructions/comparison.v +++ b/CoqOfPython/ethereum/homestead/vm/instructions/comparison.v @@ -105,6 +105,9 @@ Definition less_than : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom less_than_in_globals : + IsInGlobals globals "less_than" (make_function less_than). + Definition signed_less_than : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -182,6 +185,9 @@ Definition signed_less_than : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom signed_less_than_in_globals : + IsInGlobals globals "signed_less_than" (make_function signed_less_than). + Definition greater_than : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -252,6 +258,9 @@ Definition greater_than : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom greater_than_in_globals : + IsInGlobals globals "greater_than" (make_function greater_than). + Definition signed_greater_than : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -329,6 +338,9 @@ Definition signed_greater_than : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom signed_greater_than_in_globals : + IsInGlobals globals "signed_greater_than" (make_function signed_greater_than). + Definition equal : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -399,6 +411,9 @@ Definition equal : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom equal_in_globals : + IsInGlobals globals "equal" (make_function equal). + Definition is_zero : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -458,3 +473,6 @@ Definition is_zero : Value.t -> Value.t -> M := Constant.int 1 |) in M.pure Constant.None_)). + +Axiom is_zero_in_globals : + IsInGlobals globals "is_zero" (make_function is_zero). diff --git a/CoqOfPython/ethereum/homestead/vm/instructions/control_flow.v b/CoqOfPython/ethereum/homestead/vm/instructions/control_flow.v index 836cb75..ff2af0f 100644 --- a/CoqOfPython/ethereum/homestead/vm/instructions/control_flow.v +++ b/CoqOfPython/ethereum/homestead/vm/instructions/control_flow.v @@ -71,6 +71,9 @@ Definition stop : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom stop_in_globals : + IsInGlobals globals "stop" (make_function stop). + Definition jump : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -136,6 +139,9 @@ Definition jump : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom jump_in_globals : + IsInGlobals globals "jump" (make_function jump). + Definition jumpi : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -237,6 +243,9 @@ Definition jumpi : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom jumpi_in_globals : + IsInGlobals globals "jumpi" (make_function jumpi). + Definition pc : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -281,6 +290,9 @@ Definition pc : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom pc_in_globals : + IsInGlobals globals "pc" (make_function pc). + Definition gas_left : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -325,6 +337,9 @@ Definition gas_left : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom gas_left_in_globals : + IsInGlobals globals "gas_left" (make_function gas_left). + Definition jumpdest : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -356,3 +371,6 @@ Definition jumpdest : Value.t -> Value.t -> M := Constant.int 1 |) in M.pure Constant.None_)). + +Axiom jumpdest_in_globals : + IsInGlobals globals "jumpdest" (make_function jumpdest). diff --git a/CoqOfPython/ethereum/homestead/vm/instructions/environment.v b/CoqOfPython/ethereum/homestead/vm/instructions/environment.v index 54bf6fe..fadd295 100644 --- a/CoqOfPython/ethereum/homestead/vm/instructions/environment.v +++ b/CoqOfPython/ethereum/homestead/vm/instructions/environment.v @@ -104,6 +104,9 @@ Definition address : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom address_in_globals : + IsInGlobals globals "address" (make_function address). + Definition balance : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -167,6 +170,9 @@ Definition balance : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom balance_in_globals : + IsInGlobals globals "balance" (make_function balance). + Definition origin : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -211,6 +217,9 @@ Definition origin : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom origin_in_globals : + IsInGlobals globals "origin" (make_function origin). + Definition caller : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -254,6 +263,9 @@ Definition caller : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom caller_in_globals : + IsInGlobals globals "caller" (make_function caller). + Definition callvalue : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -291,6 +303,9 @@ Definition callvalue : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom callvalue_in_globals : + IsInGlobals globals "callvalue" (make_function callvalue). + Definition calldataload : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -362,6 +377,9 @@ Definition calldataload : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom calldataload_in_globals : + IsInGlobals globals "calldataload" (make_function calldataload). + Definition calldatasize : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -411,6 +429,9 @@ Definition calldatasize : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom calldatasize_in_globals : + IsInGlobals globals "calldatasize" (make_function calldatasize). + Definition calldatacopy : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -546,6 +567,9 @@ Definition calldatacopy : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom calldatacopy_in_globals : + IsInGlobals globals "calldatacopy" (make_function calldatacopy). + Definition codesize : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -595,6 +619,9 @@ Definition codesize : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom codesize_in_globals : + IsInGlobals globals "codesize" (make_function codesize). + Definition codecopy : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -730,6 +757,9 @@ Definition codecopy : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom codecopy_in_globals : + IsInGlobals globals "codecopy" (make_function codecopy). + Definition gasprice : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -773,6 +803,9 @@ Definition gasprice : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom gasprice_in_globals : + IsInGlobals globals "gasprice" (make_function gasprice). + Definition extcodesize : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -848,6 +881,9 @@ Definition extcodesize : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom extcodesize_in_globals : + IsInGlobals globals "extcodesize" (make_function extcodesize). + Definition extcodecopy : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -1006,3 +1042,6 @@ Definition extcodecopy : Value.t -> Value.t -> M := Constant.int 1 |) in M.pure Constant.None_)). + +Axiom extcodecopy_in_globals : + IsInGlobals globals "extcodecopy" (make_function extcodecopy). diff --git a/CoqOfPython/ethereum/homestead/vm/instructions/keccak.v b/CoqOfPython/ethereum/homestead/vm/instructions/keccak.v index 635558c..f902ec9 100644 --- a/CoqOfPython/ethereum/homestead/vm/instructions/keccak.v +++ b/CoqOfPython/ethereum/homestead/vm/instructions/keccak.v @@ -189,3 +189,6 @@ Definition keccak : Value.t -> Value.t -> M := Constant.int 1 |) in M.pure Constant.None_)). + +Axiom keccak_in_globals : + IsInGlobals globals "keccak" (make_function keccak). diff --git a/CoqOfPython/ethereum/homestead/vm/instructions/log.v b/CoqOfPython/ethereum/homestead/vm/instructions/log.v index aed85db..2b5c526 100644 --- a/CoqOfPython/ethereum/homestead/vm/instructions/log.v +++ b/CoqOfPython/ethereum/homestead/vm/instructions/log.v @@ -194,6 +194,9 @@ Definition log_n : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom log_n_in_globals : + IsInGlobals globals "log_n" (make_function log_n). + Definition log0 : Value.t := M.run ltac:(M.monadic ( M.call (| M.get_name (| globals, locals_stack, "partial" |), diff --git a/CoqOfPython/ethereum/homestead/vm/instructions/memory.v b/CoqOfPython/ethereum/homestead/vm/instructions/memory.v index 7724229..7017c45 100644 --- a/CoqOfPython/ethereum/homestead/vm/instructions/memory.v +++ b/CoqOfPython/ethereum/homestead/vm/instructions/memory.v @@ -145,6 +145,9 @@ Definition mstore : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom mstore_in_globals : + IsInGlobals globals "mstore" (make_function mstore). + Definition mstore8 : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -249,6 +252,9 @@ Definition mstore8 : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom mstore8_in_globals : + IsInGlobals globals "mstore8" (make_function mstore8). + Definition mload : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -349,6 +355,9 @@ Definition mload : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom mload_in_globals : + IsInGlobals globals "mload" (make_function mload). + Definition msize : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -397,3 +406,6 @@ Definition msize : Value.t -> Value.t -> M := Constant.int 1 |) in M.pure Constant.None_)). + +Axiom msize_in_globals : + IsInGlobals globals "msize" (make_function msize). diff --git a/CoqOfPython/ethereum/homestead/vm/instructions/stack.v b/CoqOfPython/ethereum/homestead/vm/instructions/stack.v index 59c7c5f..2e5cf75 100644 --- a/CoqOfPython/ethereum/homestead/vm/instructions/stack.v +++ b/CoqOfPython/ethereum/homestead/vm/instructions/stack.v @@ -82,6 +82,9 @@ Definition pop : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom pop_in_globals : + IsInGlobals globals "pop" (make_function pop). + Definition push_n : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm"; "num_bytes" ] in @@ -159,6 +162,9 @@ Definition push_n : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom push_n_in_globals : + IsInGlobals globals "push_n" (make_function push_n). + Definition dup_n : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm"; "item_number" ] in @@ -236,6 +242,9 @@ Definition dup_n : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom dup_n_in_globals : + IsInGlobals globals "dup_n" (make_function dup_n). + Definition swap_n : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm"; "item_number" ] in @@ -312,6 +321,9 @@ Definition swap_n : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom swap_n_in_globals : + IsInGlobals globals "swap_n" (make_function swap_n). + Definition push1 : Value.t := M.run ltac:(M.monadic ( M.call (| M.get_name (| globals, locals_stack, "partial" |), diff --git a/CoqOfPython/ethereum/homestead/vm/instructions/storage.v b/CoqOfPython/ethereum/homestead/vm/instructions/storage.v index 28827a1..7576f9a 100644 --- a/CoqOfPython/ethereum/homestead/vm/instructions/storage.v +++ b/CoqOfPython/ethereum/homestead/vm/instructions/storage.v @@ -106,6 +106,9 @@ Definition sload : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom sload_in_globals : + IsInGlobals globals "sload" (make_function sload). + Definition sstore : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -236,3 +239,6 @@ Definition sstore : Value.t -> Value.t -> M := Constant.int 1 |) in M.pure Constant.None_)). + +Axiom sstore_in_globals : + IsInGlobals globals "sstore" (make_function sstore). diff --git a/CoqOfPython/ethereum/homestead/vm/instructions/system.v b/CoqOfPython/ethereum/homestead/vm/instructions/system.v index 6bf54d2..9855b4d 100644 --- a/CoqOfPython/ethereum/homestead/vm/instructions/system.v +++ b/CoqOfPython/ethereum/homestead/vm/instructions/system.v @@ -404,6 +404,9 @@ Definition create : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom create_in_globals : + IsInGlobals globals "create" (make_function create). + Definition return_ : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -487,6 +490,9 @@ Definition return_ : Value.t -> Value.t -> M := let _ := M.pass (| |) in M.pure Constant.None_)). +Axiom return__in_globals : + IsInGlobals globals "return_" (make_function return_). + Definition generic_call : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm"; "gas"; "value"; "caller"; "to"; "code_address"; "should_transfer_value"; "memory_input_start_position"; "memory_input_size"; "memory_output_start_position"; "memory_output_size" ] in @@ -670,6 +676,9 @@ Definition generic_call : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom generic_call_in_globals : + IsInGlobals globals "generic_call" (make_function generic_call). + Definition call : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -878,6 +887,9 @@ Definition call : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom call_in_globals : + IsInGlobals globals "call" (make_function call). + Definition callcode : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -1090,6 +1102,9 @@ Definition callcode : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom callcode_in_globals : + IsInGlobals globals "callcode" (make_function callcode). + Definition selfdestruct : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -1248,6 +1263,9 @@ Definition selfdestruct : Value.t -> Value.t -> M := let _ := M.pass (| |) in M.pure Constant.None_)). +Axiom selfdestruct_in_globals : + IsInGlobals globals "selfdestruct" (make_function selfdestruct). + Definition delegatecall : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -1391,3 +1409,6 @@ Definition delegatecall : Value.t -> Value.t -> M := Constant.int 1 |) in M.pure Constant.None_)). + +Axiom delegatecall_in_globals : + IsInGlobals globals "delegatecall" (make_function delegatecall). diff --git a/CoqOfPython/ethereum/homestead/vm/interpreter.v b/CoqOfPython/ethereum/homestead/vm/interpreter.v index 9f1e4f6..3bca6f2 100644 --- a/CoqOfPython/ethereum/homestead/vm/interpreter.v +++ b/CoqOfPython/ethereum/homestead/vm/interpreter.v @@ -325,6 +325,9 @@ Definition process_message_call : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom process_message_call_in_globals : + IsInGlobals globals "process_message_call" (make_function process_message_call). + Definition process_create_message : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "message"; "env" ] in @@ -411,6 +414,9 @@ Definition process_create_message : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom process_create_message_in_globals : + IsInGlobals globals "process_create_message" (make_function process_create_message). + Definition process_message : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "message"; "env" ] in @@ -536,6 +542,9 @@ Definition process_message : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom process_message_in_globals : + IsInGlobals globals "process_message" (make_function process_message). + Definition execute_code : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "message"; "env" ] in @@ -582,3 +591,6 @@ Definition execute_code : Value.t -> Value.t -> M := M.get_name (| globals, locals_stack, "evm" |) |) in M.pure Constant.None_)). + +Axiom execute_code_in_globals : + IsInGlobals globals "execute_code" (make_function execute_code). diff --git a/CoqOfPython/ethereum/homestead/vm/memory.v b/CoqOfPython/ethereum/homestead/vm/memory.v index a6a5e4e..183261e 100644 --- a/CoqOfPython/ethereum/homestead/vm/memory.v +++ b/CoqOfPython/ethereum/homestead/vm/memory.v @@ -71,6 +71,9 @@ Definition memory_write : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom memory_write_in_globals : + IsInGlobals globals "memory_write" (make_function memory_write). + Definition memory_read_bytes : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "memory"; "start_position"; "size" ] in @@ -117,6 +120,9 @@ Definition memory_read_bytes : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom memory_read_bytes_in_globals : + IsInGlobals globals "memory_read_bytes" (make_function memory_read_bytes). + Definition buffer_read : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "buffer"; "start_position"; "size" ] in @@ -169,3 +175,6 @@ Definition buffer_read : Value.t -> Value.t -> M := |) |) in M.pure Constant.None_)). + +Axiom buffer_read_in_globals : + IsInGlobals globals "buffer_read" (make_function buffer_read). diff --git a/CoqOfPython/ethereum/homestead/vm/precompiled_contracts/ecrecover.v b/CoqOfPython/ethereum/homestead/vm/precompiled_contracts/ecrecover.v index d702154..4ddac39 100644 --- a/CoqOfPython/ethereum/homestead/vm/precompiled_contracts/ecrecover.v +++ b/CoqOfPython/ethereum/homestead/vm/precompiled_contracts/ecrecover.v @@ -302,3 +302,6 @@ Definition ecrecover : Value.t -> Value.t -> M := M.get_name (| globals, locals_stack, "padded_address" |) |) in M.pure Constant.None_)). + +Axiom ecrecover_in_globals : + IsInGlobals globals "ecrecover" (make_function ecrecover). diff --git a/CoqOfPython/ethereum/homestead/vm/precompiled_contracts/identity.v b/CoqOfPython/ethereum/homestead/vm/precompiled_contracts/identity.v index afb4248..c380947 100644 --- a/CoqOfPython/ethereum/homestead/vm/precompiled_contracts/identity.v +++ b/CoqOfPython/ethereum/homestead/vm/precompiled_contracts/identity.v @@ -95,3 +95,6 @@ Definition identity : Value.t -> Value.t -> M := M.get_name (| globals, locals_stack, "data" |) |) in M.pure Constant.None_)). + +Axiom identity_in_globals : + IsInGlobals globals "identity" (make_function identity). diff --git a/CoqOfPython/ethereum/homestead/vm/precompiled_contracts/ripemd160.v b/CoqOfPython/ethereum/homestead/vm/precompiled_contracts/ripemd160.v index 051f03f..32ae58f 100644 --- a/CoqOfPython/ethereum/homestead/vm/precompiled_contracts/ripemd160.v +++ b/CoqOfPython/ethereum/homestead/vm/precompiled_contracts/ripemd160.v @@ -126,3 +126,6 @@ Definition ripemd160 : Value.t -> Value.t -> M := M.get_name (| globals, locals_stack, "padded_hash" |) |) in M.pure Constant.None_)). + +Axiom ripemd160_in_globals : + IsInGlobals globals "ripemd160" (make_function ripemd160). diff --git a/CoqOfPython/ethereum/homestead/vm/precompiled_contracts/sha256.v b/CoqOfPython/ethereum/homestead/vm/precompiled_contracts/sha256.v index 992b73b..f836102 100644 --- a/CoqOfPython/ethereum/homestead/vm/precompiled_contracts/sha256.v +++ b/CoqOfPython/ethereum/homestead/vm/precompiled_contracts/sha256.v @@ -107,3 +107,6 @@ Definition sha256 : Value.t -> Value.t -> M := |) |) in M.pure Constant.None_)). + +Axiom sha256_in_globals : + IsInGlobals globals "sha256" (make_function sha256). diff --git a/CoqOfPython/ethereum/homestead/vm/runtime.v b/CoqOfPython/ethereum/homestead/vm/runtime.v index fc59d58..49cdd3a 100644 --- a/CoqOfPython/ethereum/homestead/vm/runtime.v +++ b/CoqOfPython/ethereum/homestead/vm/runtime.v @@ -158,3 +158,6 @@ Definition get_valid_jump_destinations : Value.t -> Value.t -> M := M.get_name (| globals, locals_stack, "valid_jump_destinations" |) |) in M.pure Constant.None_)). + +Axiom get_valid_jump_destinations_in_globals : + IsInGlobals globals "get_valid_jump_destinations" (make_function get_valid_jump_destinations). diff --git a/CoqOfPython/ethereum/homestead/vm/stack.v b/CoqOfPython/ethereum/homestead/vm/stack.v index d6366fc..1ac9f42 100644 --- a/CoqOfPython/ethereum/homestead/vm/stack.v +++ b/CoqOfPython/ethereum/homestead/vm/stack.v @@ -78,6 +78,9 @@ Definition pop : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom pop_in_globals : + IsInGlobals globals "pop" (make_function pop). + Definition push : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "stack"; "value" ] in @@ -125,3 +128,6 @@ Definition push : Value.t -> Value.t -> M := |) |) in M.pure Constant.None_)). + +Axiom push_in_globals : + IsInGlobals globals "push" (make_function push). diff --git a/CoqOfPython/ethereum/istanbul/bloom.v b/CoqOfPython/ethereum/istanbul/bloom.v index 0093baa..9ebcc5a 100644 --- a/CoqOfPython/ethereum/istanbul/bloom.v +++ b/CoqOfPython/ethereum/istanbul/bloom.v @@ -140,6 +140,9 @@ Definition add_to_bloom : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom add_to_bloom_in_globals : + IsInGlobals globals "add_to_bloom" (make_function add_to_bloom). + Definition logs_bloom : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "logs" ] in @@ -209,3 +212,6 @@ Definition logs_bloom : Value.t -> Value.t -> M := |) |) in M.pure Constant.None_)). + +Axiom logs_bloom_in_globals : + IsInGlobals globals "logs_bloom" (make_function logs_bloom). diff --git a/CoqOfPython/ethereum/istanbul/fork.v b/CoqOfPython/ethereum/istanbul/fork.v index 3090be9..cfe8967 100644 --- a/CoqOfPython/ethereum/istanbul/fork.v +++ b/CoqOfPython/ethereum/istanbul/fork.v @@ -229,6 +229,9 @@ Definition apply_fork : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom apply_fork_in_globals : + IsInGlobals globals "apply_fork" (make_function apply_fork). + Definition get_last_256_block_hashes : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "chain" ] in @@ -341,6 +344,9 @@ Definition get_last_256_block_hashes : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom get_last_256_block_hashes_in_globals : + IsInGlobals globals "get_last_256_block_hashes" (make_function get_last_256_block_hashes). + Definition state_transition : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "chain"; "block" ] in @@ -508,6 +514,9 @@ Definition state_transition : Value.t -> Value.t -> M := )) |) in M.pure Constant.None_)). +Axiom state_transition_in_globals : + IsInGlobals globals "state_transition" (make_function state_transition). + Definition validate_header : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "header"; "parent_header" ] in @@ -654,6 +663,9 @@ Definition validate_header : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom validate_header_in_globals : + IsInGlobals globals "validate_header" (make_function validate_header). + Definition generate_header_hash_for_pow : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "header" ] in @@ -709,6 +721,9 @@ Definition generate_header_hash_for_pow : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom generate_header_hash_for_pow_in_globals : + IsInGlobals globals "generate_header_hash_for_pow" (make_function generate_header_hash_for_pow). + Definition validate_proof_of_work : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "header" ] in @@ -799,6 +814,9 @@ Definition validate_proof_of_work : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom validate_proof_of_work_in_globals : + IsInGlobals globals "validate_proof_of_work" (make_function validate_proof_of_work). + Definition check_transaction : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "tx"; "gas_available"; "chain_id" ] in @@ -852,6 +870,9 @@ Definition check_transaction : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom check_transaction_in_globals : + IsInGlobals globals "check_transaction" (make_function check_transaction). + Definition make_receipt : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "tx"; "error"; "cumulative_gas_used"; "logs" ] in @@ -889,6 +910,9 @@ Definition make_receipt : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom make_receipt_in_globals : + IsInGlobals globals "make_receipt" (make_function make_receipt). + Definition ApplyBodyOutput : Value.t := builtins.make_klass [] @@ -1126,6 +1150,9 @@ Definition apply_body : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom apply_body_in_globals : + IsInGlobals globals "apply_body" (make_function apply_body). + Definition validate_ommers : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "ommers"; "block_header"; "chain" ] in @@ -1447,6 +1474,9 @@ Definition validate_ommers : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom validate_ommers_in_globals : + IsInGlobals globals "validate_ommers" (make_function validate_ommers). + Definition pay_rewards : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "state"; "block_number"; "coinbase"; "ommers" ] in @@ -1552,6 +1582,9 @@ Definition pay_rewards : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom pay_rewards_in_globals : + IsInGlobals globals "pay_rewards" (make_function pay_rewards). + Definition process_transaction : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "env"; "tx" ] in @@ -1919,6 +1952,9 @@ Definition process_transaction : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom process_transaction_in_globals : + IsInGlobals globals "process_transaction" (make_function process_transaction). + Definition validate_transaction : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "tx" ] in @@ -1975,6 +2011,9 @@ Definition validate_transaction : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom validate_transaction_in_globals : + IsInGlobals globals "validate_transaction" (make_function validate_transaction). + Definition calculate_intrinsic_cost : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "tx" ] in @@ -2085,6 +2124,9 @@ Definition calculate_intrinsic_cost : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom calculate_intrinsic_cost_in_globals : + IsInGlobals globals "calculate_intrinsic_cost" (make_function calculate_intrinsic_cost). + Definition recover_sender : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "chain_id"; "tx" ] in @@ -2281,6 +2323,9 @@ Definition recover_sender : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom recover_sender_in_globals : + IsInGlobals globals "recover_sender" (make_function recover_sender). + Definition signing_hash_pre155 : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "tx" ] in @@ -2315,6 +2360,9 @@ Definition signing_hash_pre155 : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom signing_hash_pre155_in_globals : + IsInGlobals globals "signing_hash_pre155" (make_function signing_hash_pre155). + Definition signing_hash_155 : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "tx"; "chain_id" ] in @@ -2363,6 +2411,9 @@ Definition signing_hash_155 : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom signing_hash_155_in_globals : + IsInGlobals globals "signing_hash_155" (make_function signing_hash_155). + Definition compute_header_hash : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "header" ] in @@ -2415,6 +2466,9 @@ Definition compute_header_hash : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom compute_header_hash_in_globals : + IsInGlobals globals "compute_header_hash" (make_function compute_header_hash). + Definition check_gas_limit : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "gas_limit"; "parent_gas_limit" ] in @@ -2515,6 +2569,9 @@ Definition check_gas_limit : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom check_gas_limit_in_globals : + IsInGlobals globals "check_gas_limit" (make_function check_gas_limit). + Definition calculate_block_difficulty : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "block_number"; "block_timestamp"; "parent_timestamp"; "parent_difficulty"; "parent_has_ommers" ] in @@ -2675,3 +2732,6 @@ Constant.int 1 |) |) in M.pure Constant.None_)). + +Axiom calculate_block_difficulty_in_globals : + IsInGlobals globals "calculate_block_difficulty" (make_function calculate_block_difficulty). diff --git a/CoqOfPython/ethereum/istanbul/fork_types.v b/CoqOfPython/ethereum/istanbul/fork_types.v index c223ec3..028fcf9 100644 --- a/CoqOfPython/ethereum/istanbul/fork_types.v +++ b/CoqOfPython/ethereum/istanbul/fork_types.v @@ -99,3 +99,6 @@ Definition encode_account : Value.t -> Value.t -> M := |) |) in M.pure Constant.None_)). + +Axiom encode_account_in_globals : + IsInGlobals globals "encode_account" (make_function encode_account). diff --git a/CoqOfPython/ethereum/istanbul/state.v b/CoqOfPython/ethereum/istanbul/state.v index 1cdbfcb..2ac67fd 100644 --- a/CoqOfPython/ethereum/istanbul/state.v +++ b/CoqOfPython/ethereum/istanbul/state.v @@ -100,6 +100,9 @@ Definition close_state : Value.t -> Value.t -> M := let _ := M.delete (| M.get_field (| M.get_name (| globals, locals_stack, "state" |), "_created_accounts" |) |) in M.pure Constant.None_)). +Axiom close_state_in_globals : + IsInGlobals globals "close_state" (make_function close_state). + Definition begin_transaction : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "state" ] in @@ -130,6 +133,9 @@ Definition begin_transaction : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom begin_transaction_in_globals : + IsInGlobals globals "begin_transaction" (make_function begin_transaction). + Definition commit_transaction : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "state" ] in @@ -165,6 +171,9 @@ Definition commit_transaction : Value.t -> Value.t -> M := )) |) in M.pure Constant.None_)). +Axiom commit_transaction_in_globals : + IsInGlobals globals "commit_transaction" (make_function commit_transaction). + Definition rollback_transaction : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "state" ] in @@ -204,6 +213,9 @@ Definition rollback_transaction : Value.t -> Value.t -> M := )) |) in M.pure Constant.None_)). +Axiom rollback_transaction_in_globals : + IsInGlobals globals "rollback_transaction" (make_function rollback_transaction). + Definition get_account : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "state"; "address" ] in @@ -264,6 +276,9 @@ Definition get_account : Value.t -> Value.t -> M := )) |) in M.pure Constant.None_)). +Axiom get_account_in_globals : + IsInGlobals globals "get_account" (make_function get_account). + Definition get_account_optional : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "state"; "address" ] in @@ -300,6 +315,9 @@ Definition get_account_optional : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom get_account_optional_in_globals : + IsInGlobals globals "get_account_optional" (make_function get_account_optional). + Definition set_account : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "state"; "address"; "account" ] in @@ -328,6 +346,9 @@ Definition set_account : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom set_account_in_globals : + IsInGlobals globals "set_account" (make_function set_account). + Definition destroy_account : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "state"; "address" ] in @@ -365,6 +386,9 @@ Definition destroy_account : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom destroy_account_in_globals : + IsInGlobals globals "destroy_account" (make_function destroy_account). + Definition destroy_storage : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "state"; "address" ] in @@ -399,6 +423,9 @@ Definition destroy_storage : Value.t -> Value.t -> M := )) |) in M.pure Constant.None_)). +Axiom destroy_storage_in_globals : + IsInGlobals globals "destroy_storage" (make_function destroy_storage). + Definition mark_account_created : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "state"; "address" ] in @@ -428,6 +455,9 @@ Definition mark_account_created : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom mark_account_created_in_globals : + IsInGlobals globals "mark_account_created" (make_function mark_account_created). + Definition get_storage : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "state"; "address"; "key" ] in @@ -507,6 +537,9 @@ Definition get_storage : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom get_storage_in_globals : + IsInGlobals globals "get_storage" (make_function get_storage). + Definition set_storage : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "state"; "address"; "key"; "value" ] in @@ -605,6 +638,9 @@ Definition set_storage : Value.t -> Value.t -> M := )) |) in M.pure Constant.None_)). +Axiom set_storage_in_globals : + IsInGlobals globals "set_storage" (make_function set_storage). + Definition storage_root : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "state"; "address" ] in @@ -656,6 +692,9 @@ Definition storage_root : Value.t -> Value.t -> M := )) |) in M.pure Constant.None_)). +Axiom storage_root_in_globals : + IsInGlobals globals "storage_root" (make_function storage_root). + Definition state_root : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "state" ] in @@ -686,6 +725,9 @@ Definition state_root : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom state_root_in_globals : + IsInGlobals globals "state_root" (make_function state_root). + Definition account_exists : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "state"; "address" ] in @@ -720,6 +762,9 @@ Definition account_exists : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom account_exists_in_globals : + IsInGlobals globals "account_exists" (make_function account_exists). + Definition account_has_code_or_nonce : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "state"; "address" ] in @@ -773,6 +818,9 @@ Definition account_has_code_or_nonce : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom account_has_code_or_nonce_in_globals : + IsInGlobals globals "account_has_code_or_nonce" (make_function account_has_code_or_nonce). + Definition is_account_empty : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "state"; "address" ] in @@ -834,6 +882,9 @@ Definition is_account_empty : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom is_account_empty_in_globals : + IsInGlobals globals "is_account_empty" (make_function is_account_empty). + Definition account_exists_and_is_empty : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "state"; "address" ] in @@ -904,6 +955,9 @@ Definition account_exists_and_is_empty : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom account_exists_and_is_empty_in_globals : + IsInGlobals globals "account_exists_and_is_empty" (make_function account_exists_and_is_empty). + Definition is_account_alive : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "state"; "address" ] in @@ -981,6 +1035,9 @@ Definition is_account_alive : Value.t -> Value.t -> M := )) |) in M.pure Constant.None_)). +Axiom is_account_alive_in_globals : + IsInGlobals globals "is_account_alive" (make_function is_account_alive). + Definition modify_state : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "state"; "address"; "f" ] in @@ -1013,6 +1070,9 @@ Definition modify_state : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom modify_state_in_globals : + IsInGlobals globals "modify_state" (make_function modify_state). + Definition move_ether : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "state"; "sender_address"; "recipient_address"; "amount" ] in @@ -1042,6 +1102,9 @@ Definition move_ether : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom move_ether_in_globals : + IsInGlobals globals "move_ether" (make_function move_ether). + Definition set_account_balance : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "state"; "address"; "amount" ] in @@ -1072,6 +1135,9 @@ Definition set_account_balance : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom set_account_balance_in_globals : + IsInGlobals globals "set_account_balance" (make_function set_account_balance). + Definition touch_account : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "state"; "address" ] in @@ -1116,6 +1182,9 @@ Definition touch_account : Value.t -> Value.t -> M := )) |) in M.pure Constant.None_)). +Axiom touch_account_in_globals : + IsInGlobals globals "touch_account" (make_function touch_account). + Definition increment_nonce : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "state"; "address" ] in @@ -1143,6 +1212,9 @@ Definition increment_nonce : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom increment_nonce_in_globals : + IsInGlobals globals "increment_nonce" (make_function increment_nonce). + Definition set_code : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "state"; "address"; "code" ] in @@ -1173,6 +1245,9 @@ Definition set_code : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom set_code_in_globals : + IsInGlobals globals "set_code" (make_function set_code). + Definition create_ether : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "state"; "address"; "amount" ] in @@ -1201,6 +1276,9 @@ Definition create_ether : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom create_ether_in_globals : + IsInGlobals globals "create_ether" (make_function create_ether). + Definition get_storage_original : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "state"; "address"; "key" ] in @@ -1306,3 +1384,6 @@ Definition get_storage_original : Value.t -> Value.t -> M := M.get_name (| globals, locals_stack, "original_value" |) |) in M.pure Constant.None_)). + +Axiom get_storage_original_in_globals : + IsInGlobals globals "get_storage_original" (make_function get_storage_original). diff --git a/CoqOfPython/ethereum/istanbul/trie.v b/CoqOfPython/ethereum/istanbul/trie.v index 9a208c8..ad14cf0 100644 --- a/CoqOfPython/ethereum/istanbul/trie.v +++ b/CoqOfPython/ethereum/istanbul/trie.v @@ -365,6 +365,9 @@ Definition encode_internal_node : Value.t -> Value.t -> M := )) |) in M.pure Constant.None_)). +Axiom encode_internal_node_in_globals : + IsInGlobals globals "encode_internal_node" (make_function encode_internal_node). + Definition encode_node : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "node"; "storage_root" ] in @@ -473,6 +476,9 @@ Definition encode_node : Value.t -> Value.t -> M := )) |) in M.pure Constant.None_)). +Axiom encode_node_in_globals : + IsInGlobals globals "encode_node" (make_function encode_node). + Definition Trie : Value.t := builtins.make_klass [(* At base: unsupported node type: Subscript *)] @@ -520,6 +526,9 @@ Definition copy_trie : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom copy_trie_in_globals : + IsInGlobals globals "copy_trie" (make_function copy_trie). + Definition trie_set : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "trie"; "key"; "value" ] in @@ -580,6 +589,9 @@ Definition trie_set : Value.t -> Value.t -> M := )) |) in M.pure Constant.None_)). +Axiom trie_set_in_globals : + IsInGlobals globals "trie_set" (make_function trie_set). + Definition trie_get : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "trie"; "key" ] in @@ -613,6 +625,9 @@ Definition trie_get : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom trie_get_in_globals : + IsInGlobals globals "trie_get" (make_function trie_get). + Definition common_prefix_length : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "a"; "b" ] in @@ -691,6 +706,9 @@ Definition common_prefix_length : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom common_prefix_length_in_globals : + IsInGlobals globals "common_prefix_length" (make_function common_prefix_length). + Definition nibble_list_to_compact : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "x"; "is_leaf" ] in @@ -899,6 +917,9 @@ Definition nibble_list_to_compact : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom nibble_list_to_compact_in_globals : + IsInGlobals globals "nibble_list_to_compact" (make_function nibble_list_to_compact). + Definition bytes_to_nibble_list : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "bytes_" ] in @@ -995,6 +1016,9 @@ Definition bytes_to_nibble_list : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom bytes_to_nibble_list_in_globals : + IsInGlobals globals "bytes_to_nibble_list" (make_function bytes_to_nibble_list). + Definition _prepare_trie : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "trie"; "get_storage_root" ] in @@ -1146,6 +1170,9 @@ Definition _prepare_trie : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom _prepare_trie_in_globals : + IsInGlobals globals "_prepare_trie" (make_function _prepare_trie). + Definition root : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "trie"; "get_storage_root" ] in @@ -1261,6 +1288,9 @@ Definition root : Value.t -> Value.t -> M := )) |) in M.pure Constant.None_)). +Axiom root_in_globals : + IsInGlobals globals "root" (make_function root). + Definition patricialize : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "obj"; "level" ] in @@ -1600,3 +1630,6 @@ Definition patricialize : Value.t -> Value.t -> M := |) |) in M.pure Constant.None_)). + +Axiom patricialize_in_globals : + IsInGlobals globals "patricialize" (make_function patricialize). diff --git a/CoqOfPython/ethereum/istanbul/utils/address.v b/CoqOfPython/ethereum/istanbul/utils/address.v index 6d4b32f..59c1885 100644 --- a/CoqOfPython/ethereum/istanbul/utils/address.v +++ b/CoqOfPython/ethereum/istanbul/utils/address.v @@ -79,6 +79,9 @@ Definition to_address : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom to_address_in_globals : + IsInGlobals globals "to_address" (make_function to_address). + Definition compute_contract_address : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "address"; "nonce" ] in @@ -149,6 +152,9 @@ Definition compute_contract_address : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom compute_contract_address_in_globals : + IsInGlobals globals "compute_contract_address" (make_function compute_contract_address). + Definition compute_create2_contract_address : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "address"; "salt"; "call_data" ] in @@ -230,3 +236,6 @@ Definition compute_create2_contract_address : Value.t -> Value.t -> M := |) |) in M.pure Constant.None_)). + +Axiom compute_create2_contract_address_in_globals : + IsInGlobals globals "compute_create2_contract_address" (make_function compute_create2_contract_address). diff --git a/CoqOfPython/ethereum/istanbul/utils/hexadecimal.v b/CoqOfPython/ethereum/istanbul/utils/hexadecimal.v index 326dbeb..f771db6 100644 --- a/CoqOfPython/ethereum/istanbul/utils/hexadecimal.v +++ b/CoqOfPython/ethereum/istanbul/utils/hexadecimal.v @@ -70,6 +70,9 @@ Definition hex_to_root : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom hex_to_root_in_globals : + IsInGlobals globals "hex_to_root" (make_function hex_to_root). + Definition hex_to_bloom : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "hex_string" ] in @@ -110,6 +113,9 @@ Definition hex_to_bloom : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom hex_to_bloom_in_globals : + IsInGlobals globals "hex_to_bloom" (make_function hex_to_bloom). + Definition hex_to_address : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "hex_string" ] in @@ -156,3 +162,6 @@ Definition hex_to_address : Value.t -> Value.t -> M := |) |) in M.pure Constant.None_)). + +Axiom hex_to_address_in_globals : + IsInGlobals globals "hex_to_address" (make_function hex_to_address). diff --git a/CoqOfPython/ethereum/istanbul/utils/message.v b/CoqOfPython/ethereum/istanbul/utils/message.v index 764c0cc..3be5f95 100644 --- a/CoqOfPython/ethereum/istanbul/utils/message.v +++ b/CoqOfPython/ethereum/istanbul/utils/message.v @@ -213,3 +213,6 @@ Definition prepare_message : Value.t -> Value.t -> M := |) |) in M.pure Constant.None_)). + +Axiom prepare_message_in_globals : + IsInGlobals globals "prepare_message" (make_function prepare_message). diff --git a/CoqOfPython/ethereum/istanbul/vm/__init__.v b/CoqOfPython/ethereum/istanbul/vm/__init__.v index 130d65d..d1881e2 100644 --- a/CoqOfPython/ethereum/istanbul/vm/__init__.v +++ b/CoqOfPython/ethereum/istanbul/vm/__init__.v @@ -166,6 +166,9 @@ Definition incorporate_child_on_success : Value.t -> Value.t -> M := )) |) in M.pure Constant.None_)). +Axiom incorporate_child_on_success_in_globals : + IsInGlobals globals "incorporate_child_on_success" (make_function incorporate_child_on_success). + Definition incorporate_child_on_error : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm"; "child_evm" ] in @@ -246,3 +249,6 @@ Definition incorporate_child_on_error : Value.t -> Value.t -> M := M.get_field (| M.get_name (| globals, locals_stack, "child_evm" |), "gas_left" |) |) in M.pure Constant.None_)). + +Axiom incorporate_child_on_error_in_globals : + IsInGlobals globals "incorporate_child_on_error" (make_function incorporate_child_on_error). diff --git a/CoqOfPython/ethereum/istanbul/vm/gas.v b/CoqOfPython/ethereum/istanbul/vm/gas.v index ec6291f..cab2efc 100644 --- a/CoqOfPython/ethereum/istanbul/vm/gas.v +++ b/CoqOfPython/ethereum/istanbul/vm/gas.v @@ -553,6 +553,9 @@ Definition charge_gas : Value.t -> Value.t -> M := )) |) in M.pure Constant.None_)). +Axiom charge_gas_in_globals : + IsInGlobals globals "charge_gas" (make_function charge_gas). + Definition calculate_memory_gas_cost : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "size_in_bytes" ] in @@ -612,6 +615,9 @@ Definition calculate_memory_gas_cost : Value.t -> Value.t -> M := (* At stmt: unsupported node type: Try *) M.pure Constant.None_)). +Axiom calculate_memory_gas_cost_in_globals : + IsInGlobals globals "calculate_memory_gas_cost" (make_function calculate_memory_gas_cost). + Definition calculate_gas_extend_memory : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "memory"; "extensions" ] in @@ -795,6 +801,9 @@ Definition calculate_gas_extend_memory : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom calculate_gas_extend_memory_in_globals : + IsInGlobals globals "calculate_gas_extend_memory" (make_function calculate_gas_extend_memory). + Definition calculate_message_call_gas : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "value"; "gas"; "gas_left"; "memory_cost"; "extra_gas"; "call_stipend" ] in @@ -920,6 +929,9 @@ M.get_name (| globals, locals_stack, "call_stipend" |) |) in M.pure Constant.None_)). +Axiom calculate_message_call_gas_in_globals : + IsInGlobals globals "calculate_message_call_gas" (make_function calculate_message_call_gas). + Definition max_message_call_gas : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "gas" ] in @@ -947,3 +959,6 @@ Definition max_message_call_gas : Value.t -> Value.t -> M := |) |) in M.pure Constant.None_)). + +Axiom max_message_call_gas_in_globals : + IsInGlobals globals "max_message_call_gas" (make_function max_message_call_gas). diff --git a/CoqOfPython/ethereum/istanbul/vm/instructions/arithmetic.v b/CoqOfPython/ethereum/istanbul/vm/instructions/arithmetic.v index 24ded16..c25a6ad 100644 --- a/CoqOfPython/ethereum/istanbul/vm/instructions/arithmetic.v +++ b/CoqOfPython/ethereum/istanbul/vm/instructions/arithmetic.v @@ -119,6 +119,9 @@ Definition add : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom add_in_globals : + IsInGlobals globals "add" (make_function add). + Definition sub : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -186,6 +189,9 @@ Definition sub : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom sub_in_globals : + IsInGlobals globals "sub" (make_function sub). + Definition mul : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -253,6 +259,9 @@ Definition mul : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom mul_in_globals : + IsInGlobals globals "mul" (make_function mul). + Definition div : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -341,6 +350,9 @@ Definition div : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom div_in_globals : + IsInGlobals globals "div" (make_function div). + Definition sdiv : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -491,6 +503,9 @@ Definition sdiv : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom sdiv_in_globals : + IsInGlobals globals "sdiv" (make_function sdiv). + Definition mod_ : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -579,6 +594,9 @@ Definition mod_ : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom mod__in_globals : + IsInGlobals globals "mod" (make_function mod_). + Definition smod : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -696,6 +714,9 @@ Definition smod : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom smod_in_globals : + IsInGlobals globals "smod" (make_function smod). + Definition addmod : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -821,6 +842,9 @@ Definition addmod : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom addmod_in_globals : + IsInGlobals globals "addmod" (make_function addmod). + Definition mulmod : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -946,6 +970,9 @@ Definition mulmod : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom mulmod_in_globals : + IsInGlobals globals "mulmod" (make_function mulmod). + Definition exp : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -1057,6 +1084,9 @@ Definition exp : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom exp_in_globals : + IsInGlobals globals "exp" (make_function exp). + Definition signextend : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -1231,3 +1261,6 @@ Definition signextend : Value.t -> Value.t -> M := Constant.int 1 |) in M.pure Constant.None_)). + +Axiom signextend_in_globals : + IsInGlobals globals "signextend" (make_function signextend). diff --git a/CoqOfPython/ethereum/istanbul/vm/instructions/bitwise.v b/CoqOfPython/ethereum/istanbul/vm/instructions/bitwise.v index 9d39653..1cf990b 100644 --- a/CoqOfPython/ethereum/istanbul/vm/instructions/bitwise.v +++ b/CoqOfPython/ethereum/istanbul/vm/instructions/bitwise.v @@ -97,6 +97,9 @@ Definition bitwise_and : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom bitwise_and_in_globals : + IsInGlobals globals "bitwise_and" (make_function bitwise_and). + Definition bitwise_or : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -157,6 +160,9 @@ Definition bitwise_or : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom bitwise_or_in_globals : + IsInGlobals globals "bitwise_or" (make_function bitwise_or). + Definition bitwise_xor : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -217,6 +223,9 @@ Definition bitwise_xor : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom bitwise_xor_in_globals : + IsInGlobals globals "bitwise_xor" (make_function bitwise_xor). + Definition bitwise_not : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -264,6 +273,9 @@ Definition bitwise_not : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom bitwise_not_in_globals : + IsInGlobals globals "bitwise_not" (make_function bitwise_not). + Definition get_byte : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -380,6 +392,9 @@ Definition get_byte : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom get_byte_in_globals : + IsInGlobals globals "get_byte" (make_function get_byte). + Definition bitwise_shl : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -475,6 +490,9 @@ Definition bitwise_shl : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom bitwise_shl_in_globals : + IsInGlobals globals "bitwise_shl" (make_function bitwise_shl). + Definition bitwise_shr : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -561,6 +579,9 @@ Definition bitwise_shr : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom bitwise_shr_in_globals : + IsInGlobals globals "bitwise_shr" (make_function bitwise_shr). + Definition bitwise_sar : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -674,3 +695,6 @@ Definition bitwise_sar : Value.t -> Value.t -> M := Constant.int 1 |) in M.pure Constant.None_)). + +Axiom bitwise_sar_in_globals : + IsInGlobals globals "bitwise_sar" (make_function bitwise_sar). diff --git a/CoqOfPython/ethereum/istanbul/vm/instructions/block.v b/CoqOfPython/ethereum/istanbul/vm/instructions/block.v index 73b1cf4..e7d0a11 100644 --- a/CoqOfPython/ethereum/istanbul/vm/instructions/block.v +++ b/CoqOfPython/ethereum/istanbul/vm/instructions/block.v @@ -129,6 +129,9 @@ Definition block_hash : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom block_hash_in_globals : + IsInGlobals globals "block_hash" (make_function block_hash). + Definition coinbase : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -176,6 +179,9 @@ Definition coinbase : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom coinbase_in_globals : + IsInGlobals globals "coinbase" (make_function coinbase). + Definition timestamp : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -217,6 +223,9 @@ Definition timestamp : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom timestamp_in_globals : + IsInGlobals globals "timestamp" (make_function timestamp). + Definition number : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -263,6 +272,9 @@ Definition number : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom number_in_globals : + IsInGlobals globals "number" (make_function number). + Definition difficulty : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -309,6 +321,9 @@ Definition difficulty : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom difficulty_in_globals : + IsInGlobals globals "difficulty" (make_function difficulty). + Definition gas_limit : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -355,6 +370,9 @@ Definition gas_limit : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom gas_limit_in_globals : + IsInGlobals globals "gas_limit" (make_function gas_limit). + Definition chain_id : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -397,3 +415,6 @@ Definition chain_id : Value.t -> Value.t -> M := Constant.int 1 |) in M.pure Constant.None_)). + +Axiom chain_id_in_globals : + IsInGlobals globals "chain_id" (make_function chain_id). diff --git a/CoqOfPython/ethereum/istanbul/vm/instructions/comparison.v b/CoqOfPython/ethereum/istanbul/vm/instructions/comparison.v index 9841d35..f4841e3 100644 --- a/CoqOfPython/ethereum/istanbul/vm/instructions/comparison.v +++ b/CoqOfPython/ethereum/istanbul/vm/instructions/comparison.v @@ -105,6 +105,9 @@ Definition less_than : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom less_than_in_globals : + IsInGlobals globals "less_than" (make_function less_than). + Definition signed_less_than : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -182,6 +185,9 @@ Definition signed_less_than : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom signed_less_than_in_globals : + IsInGlobals globals "signed_less_than" (make_function signed_less_than). + Definition greater_than : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -252,6 +258,9 @@ Definition greater_than : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom greater_than_in_globals : + IsInGlobals globals "greater_than" (make_function greater_than). + Definition signed_greater_than : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -329,6 +338,9 @@ Definition signed_greater_than : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom signed_greater_than_in_globals : + IsInGlobals globals "signed_greater_than" (make_function signed_greater_than). + Definition equal : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -399,6 +411,9 @@ Definition equal : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom equal_in_globals : + IsInGlobals globals "equal" (make_function equal). + Definition is_zero : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -458,3 +473,6 @@ Definition is_zero : Value.t -> Value.t -> M := Constant.int 1 |) in M.pure Constant.None_)). + +Axiom is_zero_in_globals : + IsInGlobals globals "is_zero" (make_function is_zero). diff --git a/CoqOfPython/ethereum/istanbul/vm/instructions/control_flow.v b/CoqOfPython/ethereum/istanbul/vm/instructions/control_flow.v index dc7875f..183df31 100644 --- a/CoqOfPython/ethereum/istanbul/vm/instructions/control_flow.v +++ b/CoqOfPython/ethereum/istanbul/vm/instructions/control_flow.v @@ -71,6 +71,9 @@ Definition stop : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom stop_in_globals : + IsInGlobals globals "stop" (make_function stop). + Definition jump : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -136,6 +139,9 @@ Definition jump : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom jump_in_globals : + IsInGlobals globals "jump" (make_function jump). + Definition jumpi : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -237,6 +243,9 @@ Definition jumpi : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom jumpi_in_globals : + IsInGlobals globals "jumpi" (make_function jumpi). + Definition pc : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -281,6 +290,9 @@ Definition pc : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom pc_in_globals : + IsInGlobals globals "pc" (make_function pc). + Definition gas_left : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -325,6 +337,9 @@ Definition gas_left : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom gas_left_in_globals : + IsInGlobals globals "gas_left" (make_function gas_left). + Definition jumpdest : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -356,3 +371,6 @@ Definition jumpdest : Value.t -> Value.t -> M := Constant.int 1 |) in M.pure Constant.None_)). + +Axiom jumpdest_in_globals : + IsInGlobals globals "jumpdest" (make_function jumpdest). diff --git a/CoqOfPython/ethereum/istanbul/vm/instructions/environment.v b/CoqOfPython/ethereum/istanbul/vm/instructions/environment.v index 6d95393..6b79690 100644 --- a/CoqOfPython/ethereum/istanbul/vm/instructions/environment.v +++ b/CoqOfPython/ethereum/istanbul/vm/instructions/environment.v @@ -122,6 +122,9 @@ Definition address : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom address_in_globals : + IsInGlobals globals "address" (make_function address). + Definition balance : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -185,6 +188,9 @@ Definition balance : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom balance_in_globals : + IsInGlobals globals "balance" (make_function balance). + Definition origin : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -229,6 +235,9 @@ Definition origin : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom origin_in_globals : + IsInGlobals globals "origin" (make_function origin). + Definition caller : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -272,6 +281,9 @@ Definition caller : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom caller_in_globals : + IsInGlobals globals "caller" (make_function caller). + Definition callvalue : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -309,6 +321,9 @@ Definition callvalue : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom callvalue_in_globals : + IsInGlobals globals "callvalue" (make_function callvalue). + Definition calldataload : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -380,6 +395,9 @@ Definition calldataload : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom calldataload_in_globals : + IsInGlobals globals "calldataload" (make_function calldataload). + Definition calldatasize : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -429,6 +447,9 @@ Definition calldatasize : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom calldatasize_in_globals : + IsInGlobals globals "calldatasize" (make_function calldatasize). + Definition calldatacopy : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -564,6 +585,9 @@ Definition calldatacopy : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom calldatacopy_in_globals : + IsInGlobals globals "calldatacopy" (make_function calldatacopy). + Definition codesize : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -613,6 +637,9 @@ Definition codesize : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom codesize_in_globals : + IsInGlobals globals "codesize" (make_function codesize). + Definition codecopy : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -748,6 +775,9 @@ Definition codecopy : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom codecopy_in_globals : + IsInGlobals globals "codecopy" (make_function codecopy). + Definition gasprice : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -791,6 +821,9 @@ Definition gasprice : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom gasprice_in_globals : + IsInGlobals globals "gasprice" (make_function gasprice). + Definition extcodesize : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -866,6 +899,9 @@ Definition extcodesize : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom extcodesize_in_globals : + IsInGlobals globals "extcodesize" (make_function extcodesize). + Definition extcodecopy : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -1025,6 +1061,9 @@ Definition extcodecopy : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom extcodecopy_in_globals : + IsInGlobals globals "extcodecopy" (make_function extcodecopy). + Definition returndatasize : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -1073,6 +1112,9 @@ Definition returndatasize : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom returndatasize_in_globals : + IsInGlobals globals "returndatasize" (make_function returndatasize). + Definition returndatacopy : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -1236,6 +1278,9 @@ Definition returndatacopy : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom returndatacopy_in_globals : + IsInGlobals globals "returndatacopy" (make_function returndatacopy). + Definition extcodehash : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -1337,6 +1382,9 @@ Definition extcodehash : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom extcodehash_in_globals : + IsInGlobals globals "extcodehash" (make_function extcodehash). + Definition self_balance : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -1384,3 +1432,6 @@ Definition self_balance : Value.t -> Value.t -> M := Constant.int 1 |) in M.pure Constant.None_)). + +Axiom self_balance_in_globals : + IsInGlobals globals "self_balance" (make_function self_balance). diff --git a/CoqOfPython/ethereum/istanbul/vm/instructions/keccak.v b/CoqOfPython/ethereum/istanbul/vm/instructions/keccak.v index f4f52cd..cee728f 100644 --- a/CoqOfPython/ethereum/istanbul/vm/instructions/keccak.v +++ b/CoqOfPython/ethereum/istanbul/vm/instructions/keccak.v @@ -189,3 +189,6 @@ Definition keccak : Value.t -> Value.t -> M := Constant.int 1 |) in M.pure Constant.None_)). + +Axiom keccak_in_globals : + IsInGlobals globals "keccak" (make_function keccak). diff --git a/CoqOfPython/ethereum/istanbul/vm/instructions/log.v b/CoqOfPython/ethereum/istanbul/vm/instructions/log.v index aa83110..e8134cc 100644 --- a/CoqOfPython/ethereum/istanbul/vm/instructions/log.v +++ b/CoqOfPython/ethereum/istanbul/vm/instructions/log.v @@ -208,6 +208,9 @@ Definition log_n : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom log_n_in_globals : + IsInGlobals globals "log_n" (make_function log_n). + Definition log0 : Value.t := M.run ltac:(M.monadic ( M.call (| M.get_name (| globals, locals_stack, "partial" |), diff --git a/CoqOfPython/ethereum/istanbul/vm/instructions/memory.v b/CoqOfPython/ethereum/istanbul/vm/instructions/memory.v index 813908d..3f0ce1e 100644 --- a/CoqOfPython/ethereum/istanbul/vm/instructions/memory.v +++ b/CoqOfPython/ethereum/istanbul/vm/instructions/memory.v @@ -145,6 +145,9 @@ Definition mstore : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom mstore_in_globals : + IsInGlobals globals "mstore" (make_function mstore). + Definition mstore8 : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -249,6 +252,9 @@ Definition mstore8 : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom mstore8_in_globals : + IsInGlobals globals "mstore8" (make_function mstore8). + Definition mload : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -349,6 +355,9 @@ Definition mload : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom mload_in_globals : + IsInGlobals globals "mload" (make_function mload). + Definition msize : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -397,3 +406,6 @@ Definition msize : Value.t -> Value.t -> M := Constant.int 1 |) in M.pure Constant.None_)). + +Axiom msize_in_globals : + IsInGlobals globals "msize" (make_function msize). diff --git a/CoqOfPython/ethereum/istanbul/vm/instructions/stack.v b/CoqOfPython/ethereum/istanbul/vm/instructions/stack.v index f654b54..9a94bcc 100644 --- a/CoqOfPython/ethereum/istanbul/vm/instructions/stack.v +++ b/CoqOfPython/ethereum/istanbul/vm/instructions/stack.v @@ -82,6 +82,9 @@ Definition pop : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom pop_in_globals : + IsInGlobals globals "pop" (make_function pop). + Definition push_n : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm"; "num_bytes" ] in @@ -159,6 +162,9 @@ Definition push_n : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom push_n_in_globals : + IsInGlobals globals "push_n" (make_function push_n). + Definition dup_n : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm"; "item_number" ] in @@ -236,6 +242,9 @@ Definition dup_n : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom dup_n_in_globals : + IsInGlobals globals "dup_n" (make_function dup_n). + Definition swap_n : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm"; "item_number" ] in @@ -312,6 +321,9 @@ Definition swap_n : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom swap_n_in_globals : + IsInGlobals globals "swap_n" (make_function swap_n). + Definition push1 : Value.t := M.run ltac:(M.monadic ( M.call (| M.get_name (| globals, locals_stack, "partial" |), diff --git a/CoqOfPython/ethereum/istanbul/vm/instructions/storage.v b/CoqOfPython/ethereum/istanbul/vm/instructions/storage.v index 19cb686..b9cffe3 100644 --- a/CoqOfPython/ethereum/istanbul/vm/instructions/storage.v +++ b/CoqOfPython/ethereum/istanbul/vm/instructions/storage.v @@ -118,6 +118,9 @@ Definition sload : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom sload_in_globals : + IsInGlobals globals "sload" (make_function sload). + Definition sstore : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -414,3 +417,6 @@ Definition sstore : Value.t -> Value.t -> M := Constant.int 1 |) in M.pure Constant.None_)). + +Axiom sstore_in_globals : + IsInGlobals globals "sstore" (make_function sstore). diff --git a/CoqOfPython/ethereum/istanbul/vm/instructions/system.v b/CoqOfPython/ethereum/istanbul/vm/instructions/system.v index c384f87..08cec11 100644 --- a/CoqOfPython/ethereum/istanbul/vm/instructions/system.v +++ b/CoqOfPython/ethereum/istanbul/vm/instructions/system.v @@ -376,6 +376,9 @@ Definition generic_create : Value.t -> Value.t -> M := )) |) in M.pure Constant.None_)). +Axiom generic_create_in_globals : + IsInGlobals globals "generic_create" (make_function generic_create). + Definition create : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -486,6 +489,9 @@ Definition create : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom create_in_globals : + IsInGlobals globals "create" (make_function create). + Definition create2 : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -640,6 +646,9 @@ Definition create2 : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom create2_in_globals : + IsInGlobals globals "create2" (make_function create2). + Definition return_ : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -723,6 +732,9 @@ Definition return_ : Value.t -> Value.t -> M := let _ := M.pass (| |) in M.pure Constant.None_)). +Axiom return__in_globals : + IsInGlobals globals "return_" (make_function return_). + Definition generic_call : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm"; "gas"; "value"; "caller"; "to"; "code_address"; "should_transfer_value"; "is_staticcall"; "memory_input_start_position"; "memory_input_size"; "memory_output_start_position"; "memory_output_size" ] in @@ -918,6 +930,9 @@ Definition generic_call : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom generic_call_in_globals : + IsInGlobals globals "generic_call" (make_function generic_call). + Definition call : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -1222,6 +1237,9 @@ M.get_name (| globals, locals_stack, "GAS_CALL_VALUE" |) |) in M.pure Constant.None_)). +Axiom call_in_globals : + IsInGlobals globals "call" (make_function call). + Definition callcode : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -1471,6 +1489,9 @@ M.get_name (| globals, locals_stack, "GAS_CALL_VALUE" |) |) in M.pure Constant.None_)). +Axiom callcode_in_globals : + IsInGlobals globals "callcode" (make_function callcode). + Definition selfdestruct : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -1700,6 +1721,9 @@ Definition selfdestruct : Value.t -> Value.t -> M := let _ := M.pass (| |) in M.pure Constant.None_)). +Axiom selfdestruct_in_globals : + IsInGlobals globals "selfdestruct" (make_function selfdestruct). + Definition delegatecall : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -1868,6 +1892,9 @@ Definition delegatecall : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom delegatecall_in_globals : + IsInGlobals globals "delegatecall" (make_function delegatecall). + Definition staticcall : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -2042,6 +2069,9 @@ Definition staticcall : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom staticcall_in_globals : + IsInGlobals globals "staticcall" (make_function staticcall). + Definition revert : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -2128,3 +2158,6 @@ Definition revert : Value.t -> Value.t -> M := let _ := M.raise (| Some (M.get_name (| globals, locals_stack, "Revert" |)) |) in let _ := M.pass (| |) in M.pure Constant.None_)). + +Axiom revert_in_globals : + IsInGlobals globals "revert" (make_function revert). diff --git a/CoqOfPython/ethereum/istanbul/vm/interpreter.v b/CoqOfPython/ethereum/istanbul/vm/interpreter.v index c35bb38..1bd4026 100644 --- a/CoqOfPython/ethereum/istanbul/vm/interpreter.v +++ b/CoqOfPython/ethereum/istanbul/vm/interpreter.v @@ -404,6 +404,9 @@ Definition process_message_call : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom process_message_call_in_globals : + IsInGlobals globals "process_message_call" (make_function process_message_call). + Definition process_create_message : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "message"; "env" ] in @@ -506,6 +509,9 @@ Definition process_create_message : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom process_create_message_in_globals : + IsInGlobals globals "process_create_message" (make_function process_create_message). + Definition process_message : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "message"; "env" ] in @@ -631,6 +637,9 @@ Definition process_message : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom process_message_in_globals : + IsInGlobals globals "process_message" (make_function process_message). + Definition execute_code : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "message"; "env" ] in @@ -677,3 +686,6 @@ Definition execute_code : Value.t -> Value.t -> M := M.get_name (| globals, locals_stack, "evm" |) |) in M.pure Constant.None_)). + +Axiom execute_code_in_globals : + IsInGlobals globals "execute_code" (make_function execute_code). diff --git a/CoqOfPython/ethereum/istanbul/vm/memory.v b/CoqOfPython/ethereum/istanbul/vm/memory.v index a1df5bc..abdd86a 100644 --- a/CoqOfPython/ethereum/istanbul/vm/memory.v +++ b/CoqOfPython/ethereum/istanbul/vm/memory.v @@ -71,6 +71,9 @@ Definition memory_write : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom memory_write_in_globals : + IsInGlobals globals "memory_write" (make_function memory_write). + Definition memory_read_bytes : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "memory"; "start_position"; "size" ] in @@ -117,6 +120,9 @@ Definition memory_read_bytes : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom memory_read_bytes_in_globals : + IsInGlobals globals "memory_read_bytes" (make_function memory_read_bytes). + Definition buffer_read : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "buffer"; "start_position"; "size" ] in @@ -169,3 +175,6 @@ Definition buffer_read : Value.t -> Value.t -> M := |) |) in M.pure Constant.None_)). + +Axiom buffer_read_in_globals : + IsInGlobals globals "buffer_read" (make_function buffer_read). diff --git a/CoqOfPython/ethereum/istanbul/vm/precompiled_contracts/alt_bn128.v b/CoqOfPython/ethereum/istanbul/vm/precompiled_contracts/alt_bn128.v index 3827717..e1a15d2 100644 --- a/CoqOfPython/ethereum/istanbul/vm/precompiled_contracts/alt_bn128.v +++ b/CoqOfPython/ethereum/istanbul/vm/precompiled_contracts/alt_bn128.v @@ -273,6 +273,9 @@ Definition alt_bn128_add : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom alt_bn128_add_in_globals : + IsInGlobals globals "alt_bn128_add" (make_function alt_bn128_add). + Definition alt_bn128_mul : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -455,6 +458,9 @@ Definition alt_bn128_mul : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom alt_bn128_mul_in_globals : + IsInGlobals globals "alt_bn128_mul" (make_function alt_bn128_mul). + Definition alt_bn128_pairing_check : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -781,3 +787,6 @@ Definition alt_bn128_pairing_check : Value.t -> Value.t -> M := M.pure Constant.None_ )) |) in M.pure Constant.None_)). + +Axiom alt_bn128_pairing_check_in_globals : + IsInGlobals globals "alt_bn128_pairing_check" (make_function alt_bn128_pairing_check). diff --git a/CoqOfPython/ethereum/istanbul/vm/precompiled_contracts/blake2f.v b/CoqOfPython/ethereum/istanbul/vm/precompiled_contracts/blake2f.v index 61318dc..2d516d0 100644 --- a/CoqOfPython/ethereum/istanbul/vm/precompiled_contracts/blake2f.v +++ b/CoqOfPython/ethereum/istanbul/vm/precompiled_contracts/blake2f.v @@ -128,3 +128,6 @@ Definition blake2f : Value.t -> Value.t -> M := |) |) in M.pure Constant.None_)). + +Axiom blake2f_in_globals : + IsInGlobals globals "blake2f" (make_function blake2f). diff --git a/CoqOfPython/ethereum/istanbul/vm/precompiled_contracts/ecrecover.v b/CoqOfPython/ethereum/istanbul/vm/precompiled_contracts/ecrecover.v index 1cee0f2..237f3fd 100644 --- a/CoqOfPython/ethereum/istanbul/vm/precompiled_contracts/ecrecover.v +++ b/CoqOfPython/ethereum/istanbul/vm/precompiled_contracts/ecrecover.v @@ -302,3 +302,6 @@ Definition ecrecover : Value.t -> Value.t -> M := M.get_name (| globals, locals_stack, "padded_address" |) |) in M.pure Constant.None_)). + +Axiom ecrecover_in_globals : + IsInGlobals globals "ecrecover" (make_function ecrecover). diff --git a/CoqOfPython/ethereum/istanbul/vm/precompiled_contracts/identity.v b/CoqOfPython/ethereum/istanbul/vm/precompiled_contracts/identity.v index 2387288..71f453d 100644 --- a/CoqOfPython/ethereum/istanbul/vm/precompiled_contracts/identity.v +++ b/CoqOfPython/ethereum/istanbul/vm/precompiled_contracts/identity.v @@ -95,3 +95,6 @@ Definition identity : Value.t -> Value.t -> M := M.get_name (| globals, locals_stack, "data" |) |) in M.pure Constant.None_)). + +Axiom identity_in_globals : + IsInGlobals globals "identity" (make_function identity). diff --git a/CoqOfPython/ethereum/istanbul/vm/precompiled_contracts/modexp.v b/CoqOfPython/ethereum/istanbul/vm/precompiled_contracts/modexp.v index 575a5b6..424039f 100644 --- a/CoqOfPython/ethereum/istanbul/vm/precompiled_contracts/modexp.v +++ b/CoqOfPython/ethereum/istanbul/vm/precompiled_contracts/modexp.v @@ -468,6 +468,9 @@ Definition modexp : Value.t -> Value.t -> M := )) |) in M.pure Constant.None_)). +Axiom modexp_in_globals : + IsInGlobals globals "modexp" (make_function modexp). + Definition get_mult_complexity : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "x" ] in @@ -546,3 +549,6 @@ Definition get_mult_complexity : Value.t -> Value.t -> M := M.pure Constant.None_ )) |) in M.pure Constant.None_)). + +Axiom get_mult_complexity_in_globals : + IsInGlobals globals "get_mult_complexity" (make_function get_mult_complexity). diff --git a/CoqOfPython/ethereum/istanbul/vm/precompiled_contracts/ripemd160.v b/CoqOfPython/ethereum/istanbul/vm/precompiled_contracts/ripemd160.v index 5e50193..786548a 100644 --- a/CoqOfPython/ethereum/istanbul/vm/precompiled_contracts/ripemd160.v +++ b/CoqOfPython/ethereum/istanbul/vm/precompiled_contracts/ripemd160.v @@ -126,3 +126,6 @@ Definition ripemd160 : Value.t -> Value.t -> M := M.get_name (| globals, locals_stack, "padded_hash" |) |) in M.pure Constant.None_)). + +Axiom ripemd160_in_globals : + IsInGlobals globals "ripemd160" (make_function ripemd160). diff --git a/CoqOfPython/ethereum/istanbul/vm/precompiled_contracts/sha256.v b/CoqOfPython/ethereum/istanbul/vm/precompiled_contracts/sha256.v index e2ba3ba..0a28866 100644 --- a/CoqOfPython/ethereum/istanbul/vm/precompiled_contracts/sha256.v +++ b/CoqOfPython/ethereum/istanbul/vm/precompiled_contracts/sha256.v @@ -107,3 +107,6 @@ Definition sha256 : Value.t -> Value.t -> M := |) |) in M.pure Constant.None_)). + +Axiom sha256_in_globals : + IsInGlobals globals "sha256" (make_function sha256). diff --git a/CoqOfPython/ethereum/istanbul/vm/runtime.v b/CoqOfPython/ethereum/istanbul/vm/runtime.v index d074968..c035a24 100644 --- a/CoqOfPython/ethereum/istanbul/vm/runtime.v +++ b/CoqOfPython/ethereum/istanbul/vm/runtime.v @@ -158,3 +158,6 @@ Definition get_valid_jump_destinations : Value.t -> Value.t -> M := M.get_name (| globals, locals_stack, "valid_jump_destinations" |) |) in M.pure Constant.None_)). + +Axiom get_valid_jump_destinations_in_globals : + IsInGlobals globals "get_valid_jump_destinations" (make_function get_valid_jump_destinations). diff --git a/CoqOfPython/ethereum/istanbul/vm/stack.v b/CoqOfPython/ethereum/istanbul/vm/stack.v index 5e0db23..3b662c0 100644 --- a/CoqOfPython/ethereum/istanbul/vm/stack.v +++ b/CoqOfPython/ethereum/istanbul/vm/stack.v @@ -78,6 +78,9 @@ Definition pop : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom pop_in_globals : + IsInGlobals globals "pop" (make_function pop). + Definition push : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "stack"; "value" ] in @@ -125,3 +128,6 @@ Definition push : Value.t -> Value.t -> M := |) |) in M.pure Constant.None_)). + +Axiom push_in_globals : + IsInGlobals globals "push" (make_function push). diff --git a/CoqOfPython/ethereum/london/bloom.v b/CoqOfPython/ethereum/london/bloom.v index 8048cd3..406ed55 100644 --- a/CoqOfPython/ethereum/london/bloom.v +++ b/CoqOfPython/ethereum/london/bloom.v @@ -140,6 +140,9 @@ Definition add_to_bloom : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom add_to_bloom_in_globals : + IsInGlobals globals "add_to_bloom" (make_function add_to_bloom). + Definition logs_bloom : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "logs" ] in @@ -209,3 +212,6 @@ Definition logs_bloom : Value.t -> Value.t -> M := |) |) in M.pure Constant.None_)). + +Axiom logs_bloom_in_globals : + IsInGlobals globals "logs_bloom" (make_function logs_bloom). diff --git a/CoqOfPython/ethereum/london/fork.v b/CoqOfPython/ethereum/london/fork.v index 0213a39..1ffb61f 100644 --- a/CoqOfPython/ethereum/london/fork.v +++ b/CoqOfPython/ethereum/london/fork.v @@ -259,6 +259,9 @@ Definition apply_fork : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom apply_fork_in_globals : + IsInGlobals globals "apply_fork" (make_function apply_fork). + Definition get_last_256_block_hashes : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "chain" ] in @@ -371,6 +374,9 @@ Definition get_last_256_block_hashes : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom get_last_256_block_hashes_in_globals : + IsInGlobals globals "get_last_256_block_hashes" (make_function get_last_256_block_hashes). + Definition state_transition : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "chain"; "block" ] in @@ -539,6 +545,9 @@ Definition state_transition : Value.t -> Value.t -> M := )) |) in M.pure Constant.None_)). +Axiom state_transition_in_globals : + IsInGlobals globals "state_transition" (make_function state_transition). + Definition calculate_base_fee_per_gas : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "block_gas_limit"; "parent_gas_limit"; "parent_gas_used"; "parent_base_fee_per_gas"; "is_fork_block" ] in @@ -726,6 +735,9 @@ Definition calculate_base_fee_per_gas : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom calculate_base_fee_per_gas_in_globals : + IsInGlobals globals "calculate_base_fee_per_gas" (make_function calculate_base_fee_per_gas). + Definition validate_header : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "header"; "parent_header" ] in @@ -900,6 +912,9 @@ Definition validate_header : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom validate_header_in_globals : + IsInGlobals globals "validate_header" (make_function validate_header). + Definition generate_header_hash_for_pow : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "header" ] in @@ -956,6 +971,9 @@ Definition generate_header_hash_for_pow : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom generate_header_hash_for_pow_in_globals : + IsInGlobals globals "generate_header_hash_for_pow" (make_function generate_header_hash_for_pow). + Definition validate_proof_of_work : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "header" ] in @@ -1046,6 +1064,9 @@ Definition validate_proof_of_work : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom validate_proof_of_work_in_globals : + IsInGlobals globals "validate_proof_of_work" (make_function validate_proof_of_work). + Definition check_transaction : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "tx"; "base_fee_per_gas"; "gas_available"; "chain_id" ] in @@ -1179,6 +1200,9 @@ Definition check_transaction : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom check_transaction_in_globals : + IsInGlobals globals "check_transaction" (make_function check_transaction). + Definition make_receipt : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "tx"; "error"; "cumulative_gas_used"; "logs" ] in @@ -1276,6 +1300,9 @@ Definition make_receipt : Value.t -> Value.t -> M := )) |) in M.pure Constant.None_)). +Axiom make_receipt_in_globals : + IsInGlobals globals "make_receipt" (make_function make_receipt). + Definition ApplyBodyOutput : Value.t := builtins.make_klass [] @@ -1529,6 +1556,9 @@ Definition apply_body : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom apply_body_in_globals : + IsInGlobals globals "apply_body" (make_function apply_body). + Definition validate_ommers : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "ommers"; "block_header"; "chain" ] in @@ -1850,6 +1880,9 @@ Definition validate_ommers : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom validate_ommers_in_globals : + IsInGlobals globals "validate_ommers" (make_function validate_ommers). + Definition pay_rewards : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "state"; "block_number"; "coinbase"; "ommers" ] in @@ -1955,6 +1988,9 @@ Definition pay_rewards : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom pay_rewards_in_globals : + IsInGlobals globals "pay_rewards" (make_function pay_rewards). + Definition process_transaction : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "env"; "tx" ] in @@ -2431,6 +2467,9 @@ Definition process_transaction : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom process_transaction_in_globals : + IsInGlobals globals "process_transaction" (make_function process_transaction). + Definition validate_transaction : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "tx" ] in @@ -2487,6 +2526,9 @@ Definition validate_transaction : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom validate_transaction_in_globals : + IsInGlobals globals "validate_transaction" (make_function validate_transaction). + Definition calculate_intrinsic_cost : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "tx" ] in @@ -2652,6 +2694,9 @@ Definition calculate_intrinsic_cost : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom calculate_intrinsic_cost_in_globals : + IsInGlobals globals "calculate_intrinsic_cost" (make_function calculate_intrinsic_cost). + Definition recover_sender : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "chain_id"; "tx" ] in @@ -2944,6 +2989,9 @@ Definition recover_sender : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom recover_sender_in_globals : + IsInGlobals globals "recover_sender" (make_function recover_sender). + Definition signing_hash_pre155 : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "tx" ] in @@ -2978,6 +3026,9 @@ Definition signing_hash_pre155 : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom signing_hash_pre155_in_globals : + IsInGlobals globals "signing_hash_pre155" (make_function signing_hash_pre155). + Definition signing_hash_155 : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "tx"; "chain_id" ] in @@ -3026,6 +3077,9 @@ Definition signing_hash_155 : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom signing_hash_155_in_globals : + IsInGlobals globals "signing_hash_155" (make_function signing_hash_155). + Definition signing_hash_2930 : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "tx" ] in @@ -3063,6 +3117,9 @@ Definition signing_hash_2930 : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom signing_hash_2930_in_globals : + IsInGlobals globals "signing_hash_2930" (make_function signing_hash_2930). + Definition signing_hash_1559 : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "tx" ] in @@ -3100,6 +3157,9 @@ Definition signing_hash_1559 : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom signing_hash_1559_in_globals : + IsInGlobals globals "signing_hash_1559" (make_function signing_hash_1559). + Definition compute_header_hash : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "header" ] in @@ -3152,6 +3212,9 @@ Definition compute_header_hash : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom compute_header_hash_in_globals : + IsInGlobals globals "compute_header_hash" (make_function compute_header_hash). + Definition check_gas_limit : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "gas_limit"; "parent_gas_limit" ] in @@ -3252,6 +3315,9 @@ Definition check_gas_limit : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom check_gas_limit_in_globals : + IsInGlobals globals "check_gas_limit" (make_function check_gas_limit). + Definition calculate_block_difficulty : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "block_number"; "block_timestamp"; "parent_timestamp"; "parent_difficulty"; "parent_has_ommers" ] in @@ -3412,3 +3478,6 @@ Constant.int 1 |) |) in M.pure Constant.None_)). + +Axiom calculate_block_difficulty_in_globals : + IsInGlobals globals "calculate_block_difficulty" (make_function calculate_block_difficulty). diff --git a/CoqOfPython/ethereum/london/fork_types.v b/CoqOfPython/ethereum/london/fork_types.v index 2dbc932..7a3b0ad 100644 --- a/CoqOfPython/ethereum/london/fork_types.v +++ b/CoqOfPython/ethereum/london/fork_types.v @@ -99,3 +99,6 @@ Definition encode_account : Value.t -> Value.t -> M := |) |) in M.pure Constant.None_)). + +Axiom encode_account_in_globals : + IsInGlobals globals "encode_account" (make_function encode_account). diff --git a/CoqOfPython/ethereum/london/state.v b/CoqOfPython/ethereum/london/state.v index 4eab149..0a2ceac 100644 --- a/CoqOfPython/ethereum/london/state.v +++ b/CoqOfPython/ethereum/london/state.v @@ -100,6 +100,9 @@ Definition close_state : Value.t -> Value.t -> M := let _ := M.delete (| M.get_field (| M.get_name (| globals, locals_stack, "state" |), "_created_accounts" |) |) in M.pure Constant.None_)). +Axiom close_state_in_globals : + IsInGlobals globals "close_state" (make_function close_state). + Definition begin_transaction : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "state" ] in @@ -130,6 +133,9 @@ Definition begin_transaction : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom begin_transaction_in_globals : + IsInGlobals globals "begin_transaction" (make_function begin_transaction). + Definition commit_transaction : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "state" ] in @@ -165,6 +171,9 @@ Definition commit_transaction : Value.t -> Value.t -> M := )) |) in M.pure Constant.None_)). +Axiom commit_transaction_in_globals : + IsInGlobals globals "commit_transaction" (make_function commit_transaction). + Definition rollback_transaction : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "state" ] in @@ -204,6 +213,9 @@ Definition rollback_transaction : Value.t -> Value.t -> M := )) |) in M.pure Constant.None_)). +Axiom rollback_transaction_in_globals : + IsInGlobals globals "rollback_transaction" (make_function rollback_transaction). + Definition get_account : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "state"; "address" ] in @@ -264,6 +276,9 @@ Definition get_account : Value.t -> Value.t -> M := )) |) in M.pure Constant.None_)). +Axiom get_account_in_globals : + IsInGlobals globals "get_account" (make_function get_account). + Definition get_account_optional : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "state"; "address" ] in @@ -300,6 +315,9 @@ Definition get_account_optional : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom get_account_optional_in_globals : + IsInGlobals globals "get_account_optional" (make_function get_account_optional). + Definition set_account : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "state"; "address"; "account" ] in @@ -328,6 +346,9 @@ Definition set_account : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom set_account_in_globals : + IsInGlobals globals "set_account" (make_function set_account). + Definition destroy_account : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "state"; "address" ] in @@ -365,6 +386,9 @@ Definition destroy_account : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom destroy_account_in_globals : + IsInGlobals globals "destroy_account" (make_function destroy_account). + Definition destroy_storage : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "state"; "address" ] in @@ -399,6 +423,9 @@ Definition destroy_storage : Value.t -> Value.t -> M := )) |) in M.pure Constant.None_)). +Axiom destroy_storage_in_globals : + IsInGlobals globals "destroy_storage" (make_function destroy_storage). + Definition mark_account_created : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "state"; "address" ] in @@ -428,6 +455,9 @@ Definition mark_account_created : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom mark_account_created_in_globals : + IsInGlobals globals "mark_account_created" (make_function mark_account_created). + Definition get_storage : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "state"; "address"; "key" ] in @@ -507,6 +537,9 @@ Definition get_storage : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom get_storage_in_globals : + IsInGlobals globals "get_storage" (make_function get_storage). + Definition set_storage : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "state"; "address"; "key"; "value" ] in @@ -605,6 +638,9 @@ Definition set_storage : Value.t -> Value.t -> M := )) |) in M.pure Constant.None_)). +Axiom set_storage_in_globals : + IsInGlobals globals "set_storage" (make_function set_storage). + Definition storage_root : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "state"; "address" ] in @@ -656,6 +692,9 @@ Definition storage_root : Value.t -> Value.t -> M := )) |) in M.pure Constant.None_)). +Axiom storage_root_in_globals : + IsInGlobals globals "storage_root" (make_function storage_root). + Definition state_root : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "state" ] in @@ -686,6 +725,9 @@ Definition state_root : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom state_root_in_globals : + IsInGlobals globals "state_root" (make_function state_root). + Definition account_exists : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "state"; "address" ] in @@ -720,6 +762,9 @@ Definition account_exists : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom account_exists_in_globals : + IsInGlobals globals "account_exists" (make_function account_exists). + Definition account_has_code_or_nonce : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "state"; "address" ] in @@ -773,6 +818,9 @@ Definition account_has_code_or_nonce : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom account_has_code_or_nonce_in_globals : + IsInGlobals globals "account_has_code_or_nonce" (make_function account_has_code_or_nonce). + Definition is_account_empty : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "state"; "address" ] in @@ -834,6 +882,9 @@ Definition is_account_empty : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom is_account_empty_in_globals : + IsInGlobals globals "is_account_empty" (make_function is_account_empty). + Definition account_exists_and_is_empty : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "state"; "address" ] in @@ -904,6 +955,9 @@ Definition account_exists_and_is_empty : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom account_exists_and_is_empty_in_globals : + IsInGlobals globals "account_exists_and_is_empty" (make_function account_exists_and_is_empty). + Definition is_account_alive : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "state"; "address" ] in @@ -981,6 +1035,9 @@ Definition is_account_alive : Value.t -> Value.t -> M := )) |) in M.pure Constant.None_)). +Axiom is_account_alive_in_globals : + IsInGlobals globals "is_account_alive" (make_function is_account_alive). + Definition modify_state : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "state"; "address"; "f" ] in @@ -1013,6 +1070,9 @@ Definition modify_state : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom modify_state_in_globals : + IsInGlobals globals "modify_state" (make_function modify_state). + Definition move_ether : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "state"; "sender_address"; "recipient_address"; "amount" ] in @@ -1042,6 +1102,9 @@ Definition move_ether : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom move_ether_in_globals : + IsInGlobals globals "move_ether" (make_function move_ether). + Definition set_account_balance : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "state"; "address"; "amount" ] in @@ -1072,6 +1135,9 @@ Definition set_account_balance : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom set_account_balance_in_globals : + IsInGlobals globals "set_account_balance" (make_function set_account_balance). + Definition touch_account : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "state"; "address" ] in @@ -1116,6 +1182,9 @@ Definition touch_account : Value.t -> Value.t -> M := )) |) in M.pure Constant.None_)). +Axiom touch_account_in_globals : + IsInGlobals globals "touch_account" (make_function touch_account). + Definition increment_nonce : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "state"; "address" ] in @@ -1143,6 +1212,9 @@ Definition increment_nonce : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom increment_nonce_in_globals : + IsInGlobals globals "increment_nonce" (make_function increment_nonce). + Definition set_code : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "state"; "address"; "code" ] in @@ -1173,6 +1245,9 @@ Definition set_code : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom set_code_in_globals : + IsInGlobals globals "set_code" (make_function set_code). + Definition create_ether : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "state"; "address"; "amount" ] in @@ -1201,6 +1276,9 @@ Definition create_ether : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom create_ether_in_globals : + IsInGlobals globals "create_ether" (make_function create_ether). + Definition get_storage_original : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "state"; "address"; "key" ] in @@ -1306,3 +1384,6 @@ Definition get_storage_original : Value.t -> Value.t -> M := M.get_name (| globals, locals_stack, "original_value" |) |) in M.pure Constant.None_)). + +Axiom get_storage_original_in_globals : + IsInGlobals globals "get_storage_original" (make_function get_storage_original). diff --git a/CoqOfPython/ethereum/london/transactions.v b/CoqOfPython/ethereum/london/transactions.v index bf51ad0..fad63b0 100644 --- a/CoqOfPython/ethereum/london/transactions.v +++ b/CoqOfPython/ethereum/london/transactions.v @@ -201,6 +201,9 @@ Definition encode_transaction : Value.t -> Value.t -> M := )) |) in M.pure Constant.None_)). +Axiom encode_transaction_in_globals : + IsInGlobals globals "encode_transaction" (make_function encode_transaction). + Definition decode_transaction : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "tx" ] in @@ -295,3 +298,6 @@ Definition decode_transaction : Value.t -> Value.t -> M := M.pure Constant.None_ )) |) in M.pure Constant.None_)). + +Axiom decode_transaction_in_globals : + IsInGlobals globals "decode_transaction" (make_function decode_transaction). diff --git a/CoqOfPython/ethereum/london/trie.v b/CoqOfPython/ethereum/london/trie.v index ba27f23..f53ebf4 100644 --- a/CoqOfPython/ethereum/london/trie.v +++ b/CoqOfPython/ethereum/london/trie.v @@ -371,6 +371,9 @@ Definition encode_internal_node : Value.t -> Value.t -> M := )) |) in M.pure Constant.None_)). +Axiom encode_internal_node_in_globals : + IsInGlobals globals "encode_internal_node" (make_function encode_internal_node). + Definition encode_node : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "node"; "storage_root" ] in @@ -479,6 +482,9 @@ Definition encode_node : Value.t -> Value.t -> M := )) |) in M.pure Constant.None_)). +Axiom encode_node_in_globals : + IsInGlobals globals "encode_node" (make_function encode_node). + Definition Trie : Value.t := builtins.make_klass [(* At base: unsupported node type: Subscript *)] @@ -526,6 +532,9 @@ Definition copy_trie : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom copy_trie_in_globals : + IsInGlobals globals "copy_trie" (make_function copy_trie). + Definition trie_set : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "trie"; "key"; "value" ] in @@ -586,6 +595,9 @@ Definition trie_set : Value.t -> Value.t -> M := )) |) in M.pure Constant.None_)). +Axiom trie_set_in_globals : + IsInGlobals globals "trie_set" (make_function trie_set). + Definition trie_get : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "trie"; "key" ] in @@ -619,6 +631,9 @@ Definition trie_get : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom trie_get_in_globals : + IsInGlobals globals "trie_get" (make_function trie_get). + Definition common_prefix_length : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "a"; "b" ] in @@ -697,6 +712,9 @@ Definition common_prefix_length : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom common_prefix_length_in_globals : + IsInGlobals globals "common_prefix_length" (make_function common_prefix_length). + Definition nibble_list_to_compact : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "x"; "is_leaf" ] in @@ -905,6 +923,9 @@ Definition nibble_list_to_compact : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom nibble_list_to_compact_in_globals : + IsInGlobals globals "nibble_list_to_compact" (make_function nibble_list_to_compact). + Definition bytes_to_nibble_list : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "bytes_" ] in @@ -1001,6 +1022,9 @@ Definition bytes_to_nibble_list : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom bytes_to_nibble_list_in_globals : + IsInGlobals globals "bytes_to_nibble_list" (make_function bytes_to_nibble_list). + Definition _prepare_trie : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "trie"; "get_storage_root" ] in @@ -1152,6 +1176,9 @@ Definition _prepare_trie : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom _prepare_trie_in_globals : + IsInGlobals globals "_prepare_trie" (make_function _prepare_trie). + Definition root : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "trie"; "get_storage_root" ] in @@ -1267,6 +1294,9 @@ Definition root : Value.t -> Value.t -> M := )) |) in M.pure Constant.None_)). +Axiom root_in_globals : + IsInGlobals globals "root" (make_function root). + Definition patricialize : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "obj"; "level" ] in @@ -1606,3 +1636,6 @@ Definition patricialize : Value.t -> Value.t -> M := |) |) in M.pure Constant.None_)). + +Axiom patricialize_in_globals : + IsInGlobals globals "patricialize" (make_function patricialize). diff --git a/CoqOfPython/ethereum/london/utils/address.v b/CoqOfPython/ethereum/london/utils/address.v index 89e5262..0e31d5b 100644 --- a/CoqOfPython/ethereum/london/utils/address.v +++ b/CoqOfPython/ethereum/london/utils/address.v @@ -79,6 +79,9 @@ Definition to_address : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom to_address_in_globals : + IsInGlobals globals "to_address" (make_function to_address). + Definition compute_contract_address : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "address"; "nonce" ] in @@ -149,6 +152,9 @@ Definition compute_contract_address : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom compute_contract_address_in_globals : + IsInGlobals globals "compute_contract_address" (make_function compute_contract_address). + Definition compute_create2_contract_address : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "address"; "salt"; "call_data" ] in @@ -230,3 +236,6 @@ Definition compute_create2_contract_address : Value.t -> Value.t -> M := |) |) in M.pure Constant.None_)). + +Axiom compute_create2_contract_address_in_globals : + IsInGlobals globals "compute_create2_contract_address" (make_function compute_create2_contract_address). diff --git a/CoqOfPython/ethereum/london/utils/hexadecimal.v b/CoqOfPython/ethereum/london/utils/hexadecimal.v index c646db7..f45cbb1 100644 --- a/CoqOfPython/ethereum/london/utils/hexadecimal.v +++ b/CoqOfPython/ethereum/london/utils/hexadecimal.v @@ -70,6 +70,9 @@ Definition hex_to_root : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom hex_to_root_in_globals : + IsInGlobals globals "hex_to_root" (make_function hex_to_root). + Definition hex_to_bloom : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "hex_string" ] in @@ -110,6 +113,9 @@ Definition hex_to_bloom : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom hex_to_bloom_in_globals : + IsInGlobals globals "hex_to_bloom" (make_function hex_to_bloom). + Definition hex_to_address : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "hex_string" ] in @@ -156,3 +162,6 @@ Definition hex_to_address : Value.t -> Value.t -> M := |) |) in M.pure Constant.None_)). + +Axiom hex_to_address_in_globals : + IsInGlobals globals "hex_to_address" (make_function hex_to_address). diff --git a/CoqOfPython/ethereum/london/utils/message.v b/CoqOfPython/ethereum/london/utils/message.v index 3c0fb98..a7f388b 100644 --- a/CoqOfPython/ethereum/london/utils/message.v +++ b/CoqOfPython/ethereum/london/utils/message.v @@ -267,3 +267,6 @@ Definition prepare_message : Value.t -> Value.t -> M := |) |) in M.pure Constant.None_)). + +Axiom prepare_message_in_globals : + IsInGlobals globals "prepare_message" (make_function prepare_message). diff --git a/CoqOfPython/ethereum/london/vm/__init__.v b/CoqOfPython/ethereum/london/vm/__init__.v index e177f5b..b37bda2 100644 --- a/CoqOfPython/ethereum/london/vm/__init__.v +++ b/CoqOfPython/ethereum/london/vm/__init__.v @@ -182,6 +182,9 @@ Definition incorporate_child_on_success : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom incorporate_child_on_success_in_globals : + IsInGlobals globals "incorporate_child_on_success" (make_function incorporate_child_on_success). + Definition incorporate_child_on_error : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm"; "child_evm" ] in @@ -262,3 +265,6 @@ Definition incorporate_child_on_error : Value.t -> Value.t -> M := M.get_field (| M.get_name (| globals, locals_stack, "child_evm" |), "gas_left" |) |) in M.pure Constant.None_)). + +Axiom incorporate_child_on_error_in_globals : + IsInGlobals globals "incorporate_child_on_error" (make_function incorporate_child_on_error). diff --git a/CoqOfPython/ethereum/london/vm/gas.v b/CoqOfPython/ethereum/london/vm/gas.v index 5e6fbd5..43df28d 100644 --- a/CoqOfPython/ethereum/london/vm/gas.v +++ b/CoqOfPython/ethereum/london/vm/gas.v @@ -523,6 +523,9 @@ Definition charge_gas : Value.t -> Value.t -> M := )) |) in M.pure Constant.None_)). +Axiom charge_gas_in_globals : + IsInGlobals globals "charge_gas" (make_function charge_gas). + Definition calculate_memory_gas_cost : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "size_in_bytes" ] in @@ -582,6 +585,9 @@ Definition calculate_memory_gas_cost : Value.t -> Value.t -> M := (* At stmt: unsupported node type: Try *) M.pure Constant.None_)). +Axiom calculate_memory_gas_cost_in_globals : + IsInGlobals globals "calculate_memory_gas_cost" (make_function calculate_memory_gas_cost). + Definition calculate_gas_extend_memory : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "memory"; "extensions" ] in @@ -765,6 +771,9 @@ Definition calculate_gas_extend_memory : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom calculate_gas_extend_memory_in_globals : + IsInGlobals globals "calculate_gas_extend_memory" (make_function calculate_gas_extend_memory). + Definition calculate_message_call_gas : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "value"; "gas"; "gas_left"; "memory_cost"; "extra_gas"; "call_stipend" ] in @@ -890,6 +899,9 @@ M.get_name (| globals, locals_stack, "call_stipend" |) |) in M.pure Constant.None_)). +Axiom calculate_message_call_gas_in_globals : + IsInGlobals globals "calculate_message_call_gas" (make_function calculate_message_call_gas). + Definition max_message_call_gas : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "gas" ] in @@ -917,3 +929,6 @@ Definition max_message_call_gas : Value.t -> Value.t -> M := |) |) in M.pure Constant.None_)). + +Axiom max_message_call_gas_in_globals : + IsInGlobals globals "max_message_call_gas" (make_function max_message_call_gas). diff --git a/CoqOfPython/ethereum/london/vm/instructions/arithmetic.v b/CoqOfPython/ethereum/london/vm/instructions/arithmetic.v index ce2405b..dbef5bc 100644 --- a/CoqOfPython/ethereum/london/vm/instructions/arithmetic.v +++ b/CoqOfPython/ethereum/london/vm/instructions/arithmetic.v @@ -119,6 +119,9 @@ Definition add : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom add_in_globals : + IsInGlobals globals "add" (make_function add). + Definition sub : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -186,6 +189,9 @@ Definition sub : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom sub_in_globals : + IsInGlobals globals "sub" (make_function sub). + Definition mul : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -253,6 +259,9 @@ Definition mul : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom mul_in_globals : + IsInGlobals globals "mul" (make_function mul). + Definition div : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -341,6 +350,9 @@ Definition div : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom div_in_globals : + IsInGlobals globals "div" (make_function div). + Definition sdiv : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -491,6 +503,9 @@ Definition sdiv : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom sdiv_in_globals : + IsInGlobals globals "sdiv" (make_function sdiv). + Definition mod_ : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -579,6 +594,9 @@ Definition mod_ : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom mod__in_globals : + IsInGlobals globals "mod" (make_function mod_). + Definition smod : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -696,6 +714,9 @@ Definition smod : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom smod_in_globals : + IsInGlobals globals "smod" (make_function smod). + Definition addmod : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -821,6 +842,9 @@ Definition addmod : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom addmod_in_globals : + IsInGlobals globals "addmod" (make_function addmod). + Definition mulmod : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -946,6 +970,9 @@ Definition mulmod : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom mulmod_in_globals : + IsInGlobals globals "mulmod" (make_function mulmod). + Definition exp : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -1057,6 +1084,9 @@ Definition exp : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom exp_in_globals : + IsInGlobals globals "exp" (make_function exp). + Definition signextend : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -1231,3 +1261,6 @@ Definition signextend : Value.t -> Value.t -> M := Constant.int 1 |) in M.pure Constant.None_)). + +Axiom signextend_in_globals : + IsInGlobals globals "signextend" (make_function signextend). diff --git a/CoqOfPython/ethereum/london/vm/instructions/bitwise.v b/CoqOfPython/ethereum/london/vm/instructions/bitwise.v index dfc49eb..fab1f1d 100644 --- a/CoqOfPython/ethereum/london/vm/instructions/bitwise.v +++ b/CoqOfPython/ethereum/london/vm/instructions/bitwise.v @@ -97,6 +97,9 @@ Definition bitwise_and : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom bitwise_and_in_globals : + IsInGlobals globals "bitwise_and" (make_function bitwise_and). + Definition bitwise_or : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -157,6 +160,9 @@ Definition bitwise_or : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom bitwise_or_in_globals : + IsInGlobals globals "bitwise_or" (make_function bitwise_or). + Definition bitwise_xor : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -217,6 +223,9 @@ Definition bitwise_xor : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom bitwise_xor_in_globals : + IsInGlobals globals "bitwise_xor" (make_function bitwise_xor). + Definition bitwise_not : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -264,6 +273,9 @@ Definition bitwise_not : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom bitwise_not_in_globals : + IsInGlobals globals "bitwise_not" (make_function bitwise_not). + Definition get_byte : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -380,6 +392,9 @@ Definition get_byte : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom get_byte_in_globals : + IsInGlobals globals "get_byte" (make_function get_byte). + Definition bitwise_shl : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -475,6 +490,9 @@ Definition bitwise_shl : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom bitwise_shl_in_globals : + IsInGlobals globals "bitwise_shl" (make_function bitwise_shl). + Definition bitwise_shr : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -561,6 +579,9 @@ Definition bitwise_shr : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom bitwise_shr_in_globals : + IsInGlobals globals "bitwise_shr" (make_function bitwise_shr). + Definition bitwise_sar : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -674,3 +695,6 @@ Definition bitwise_sar : Value.t -> Value.t -> M := Constant.int 1 |) in M.pure Constant.None_)). + +Axiom bitwise_sar_in_globals : + IsInGlobals globals "bitwise_sar" (make_function bitwise_sar). diff --git a/CoqOfPython/ethereum/london/vm/instructions/block.v b/CoqOfPython/ethereum/london/vm/instructions/block.v index a61620f..5da1c59 100644 --- a/CoqOfPython/ethereum/london/vm/instructions/block.v +++ b/CoqOfPython/ethereum/london/vm/instructions/block.v @@ -129,6 +129,9 @@ Definition block_hash : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom block_hash_in_globals : + IsInGlobals globals "block_hash" (make_function block_hash). + Definition coinbase : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -176,6 +179,9 @@ Definition coinbase : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom coinbase_in_globals : + IsInGlobals globals "coinbase" (make_function coinbase). + Definition timestamp : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -217,6 +223,9 @@ Definition timestamp : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom timestamp_in_globals : + IsInGlobals globals "timestamp" (make_function timestamp). + Definition number : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -263,6 +272,9 @@ Definition number : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom number_in_globals : + IsInGlobals globals "number" (make_function number). + Definition difficulty : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -309,6 +321,9 @@ Definition difficulty : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom difficulty_in_globals : + IsInGlobals globals "difficulty" (make_function difficulty). + Definition gas_limit : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -355,6 +370,9 @@ Definition gas_limit : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom gas_limit_in_globals : + IsInGlobals globals "gas_limit" (make_function gas_limit). + Definition chain_id : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -397,3 +415,6 @@ Definition chain_id : Value.t -> Value.t -> M := Constant.int 1 |) in M.pure Constant.None_)). + +Axiom chain_id_in_globals : + IsInGlobals globals "chain_id" (make_function chain_id). diff --git a/CoqOfPython/ethereum/london/vm/instructions/comparison.v b/CoqOfPython/ethereum/london/vm/instructions/comparison.v index 75c4043..f4b3c57 100644 --- a/CoqOfPython/ethereum/london/vm/instructions/comparison.v +++ b/CoqOfPython/ethereum/london/vm/instructions/comparison.v @@ -105,6 +105,9 @@ Definition less_than : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom less_than_in_globals : + IsInGlobals globals "less_than" (make_function less_than). + Definition signed_less_than : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -182,6 +185,9 @@ Definition signed_less_than : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom signed_less_than_in_globals : + IsInGlobals globals "signed_less_than" (make_function signed_less_than). + Definition greater_than : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -252,6 +258,9 @@ Definition greater_than : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom greater_than_in_globals : + IsInGlobals globals "greater_than" (make_function greater_than). + Definition signed_greater_than : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -329,6 +338,9 @@ Definition signed_greater_than : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom signed_greater_than_in_globals : + IsInGlobals globals "signed_greater_than" (make_function signed_greater_than). + Definition equal : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -399,6 +411,9 @@ Definition equal : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom equal_in_globals : + IsInGlobals globals "equal" (make_function equal). + Definition is_zero : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -458,3 +473,6 @@ Definition is_zero : Value.t -> Value.t -> M := Constant.int 1 |) in M.pure Constant.None_)). + +Axiom is_zero_in_globals : + IsInGlobals globals "is_zero" (make_function is_zero). diff --git a/CoqOfPython/ethereum/london/vm/instructions/control_flow.v b/CoqOfPython/ethereum/london/vm/instructions/control_flow.v index b27e30e..700624e 100644 --- a/CoqOfPython/ethereum/london/vm/instructions/control_flow.v +++ b/CoqOfPython/ethereum/london/vm/instructions/control_flow.v @@ -71,6 +71,9 @@ Definition stop : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom stop_in_globals : + IsInGlobals globals "stop" (make_function stop). + Definition jump : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -136,6 +139,9 @@ Definition jump : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom jump_in_globals : + IsInGlobals globals "jump" (make_function jump). + Definition jumpi : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -237,6 +243,9 @@ Definition jumpi : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom jumpi_in_globals : + IsInGlobals globals "jumpi" (make_function jumpi). + Definition pc : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -281,6 +290,9 @@ Definition pc : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom pc_in_globals : + IsInGlobals globals "pc" (make_function pc). + Definition gas_left : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -325,6 +337,9 @@ Definition gas_left : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom gas_left_in_globals : + IsInGlobals globals "gas_left" (make_function gas_left). + Definition jumpdest : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -356,3 +371,6 @@ Definition jumpdest : Value.t -> Value.t -> M := Constant.int 1 |) in M.pure Constant.None_)). + +Axiom jumpdest_in_globals : + IsInGlobals globals "jumpdest" (make_function jumpdest). diff --git a/CoqOfPython/ethereum/london/vm/instructions/environment.v b/CoqOfPython/ethereum/london/vm/instructions/environment.v index 69d9988..ec5c90b 100644 --- a/CoqOfPython/ethereum/london/vm/instructions/environment.v +++ b/CoqOfPython/ethereum/london/vm/instructions/environment.v @@ -120,6 +120,9 @@ Definition address : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom address_in_globals : + IsInGlobals globals "address" (make_function address). + Definition balance : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -212,6 +215,9 @@ Definition balance : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom balance_in_globals : + IsInGlobals globals "balance" (make_function balance). + Definition origin : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -256,6 +262,9 @@ Definition origin : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom origin_in_globals : + IsInGlobals globals "origin" (make_function origin). + Definition caller : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -299,6 +308,9 @@ Definition caller : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom caller_in_globals : + IsInGlobals globals "caller" (make_function caller). + Definition callvalue : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -336,6 +348,9 @@ Definition callvalue : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom callvalue_in_globals : + IsInGlobals globals "callvalue" (make_function callvalue). + Definition calldataload : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -407,6 +422,9 @@ Definition calldataload : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom calldataload_in_globals : + IsInGlobals globals "calldataload" (make_function calldataload). + Definition calldatasize : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -456,6 +474,9 @@ Definition calldatasize : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom calldatasize_in_globals : + IsInGlobals globals "calldatasize" (make_function calldatasize). + Definition calldatacopy : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -591,6 +612,9 @@ Definition calldatacopy : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom calldatacopy_in_globals : + IsInGlobals globals "calldatacopy" (make_function calldatacopy). + Definition codesize : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -640,6 +664,9 @@ Definition codesize : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom codesize_in_globals : + IsInGlobals globals "codesize" (make_function codesize). + Definition codecopy : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -775,6 +802,9 @@ Definition codecopy : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom codecopy_in_globals : + IsInGlobals globals "codecopy" (make_function codecopy). + Definition gasprice : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -818,6 +848,9 @@ Definition gasprice : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom gasprice_in_globals : + IsInGlobals globals "gasprice" (make_function gasprice). + Definition extcodesize : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -922,6 +955,9 @@ Definition extcodesize : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom extcodesize_in_globals : + IsInGlobals globals "extcodesize" (make_function extcodesize). + Definition extcodecopy : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -1116,6 +1152,9 @@ Definition extcodecopy : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom extcodecopy_in_globals : + IsInGlobals globals "extcodecopy" (make_function extcodecopy). + Definition returndatasize : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -1164,6 +1203,9 @@ Definition returndatasize : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom returndatasize_in_globals : + IsInGlobals globals "returndatasize" (make_function returndatasize). + Definition returndatacopy : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -1327,6 +1369,9 @@ Definition returndatacopy : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom returndatacopy_in_globals : + IsInGlobals globals "returndatacopy" (make_function returndatacopy). + Definition extcodehash : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -1457,6 +1502,9 @@ Definition extcodehash : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom extcodehash_in_globals : + IsInGlobals globals "extcodehash" (make_function extcodehash). + Definition self_balance : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -1505,6 +1553,9 @@ Definition self_balance : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom self_balance_in_globals : + IsInGlobals globals "self_balance" (make_function self_balance). + Definition base_fee : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -1547,3 +1598,6 @@ Definition base_fee : Value.t -> Value.t -> M := Constant.int 1 |) in M.pure Constant.None_)). + +Axiom base_fee_in_globals : + IsInGlobals globals "base_fee" (make_function base_fee). diff --git a/CoqOfPython/ethereum/london/vm/instructions/keccak.v b/CoqOfPython/ethereum/london/vm/instructions/keccak.v index 6f443d1..a1f9eef 100644 --- a/CoqOfPython/ethereum/london/vm/instructions/keccak.v +++ b/CoqOfPython/ethereum/london/vm/instructions/keccak.v @@ -189,3 +189,6 @@ Definition keccak : Value.t -> Value.t -> M := Constant.int 1 |) in M.pure Constant.None_)). + +Axiom keccak_in_globals : + IsInGlobals globals "keccak" (make_function keccak). diff --git a/CoqOfPython/ethereum/london/vm/instructions/log.v b/CoqOfPython/ethereum/london/vm/instructions/log.v index 24b0aa1..24c46c8 100644 --- a/CoqOfPython/ethereum/london/vm/instructions/log.v +++ b/CoqOfPython/ethereum/london/vm/instructions/log.v @@ -208,6 +208,9 @@ Definition log_n : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom log_n_in_globals : + IsInGlobals globals "log_n" (make_function log_n). + Definition log0 : Value.t := M.run ltac:(M.monadic ( M.call (| M.get_name (| globals, locals_stack, "partial" |), diff --git a/CoqOfPython/ethereum/london/vm/instructions/memory.v b/CoqOfPython/ethereum/london/vm/instructions/memory.v index 35a385e..2333506 100644 --- a/CoqOfPython/ethereum/london/vm/instructions/memory.v +++ b/CoqOfPython/ethereum/london/vm/instructions/memory.v @@ -145,6 +145,9 @@ Definition mstore : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom mstore_in_globals : + IsInGlobals globals "mstore" (make_function mstore). + Definition mstore8 : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -249,6 +252,9 @@ Definition mstore8 : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom mstore8_in_globals : + IsInGlobals globals "mstore8" (make_function mstore8). + Definition mload : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -349,6 +355,9 @@ Definition mload : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom mload_in_globals : + IsInGlobals globals "mload" (make_function mload). + Definition msize : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -397,3 +406,6 @@ Definition msize : Value.t -> Value.t -> M := Constant.int 1 |) in M.pure Constant.None_)). + +Axiom msize_in_globals : + IsInGlobals globals "msize" (make_function msize). diff --git a/CoqOfPython/ethereum/london/vm/instructions/stack.v b/CoqOfPython/ethereum/london/vm/instructions/stack.v index 8bc2b0c..64b63d7 100644 --- a/CoqOfPython/ethereum/london/vm/instructions/stack.v +++ b/CoqOfPython/ethereum/london/vm/instructions/stack.v @@ -82,6 +82,9 @@ Definition pop : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom pop_in_globals : + IsInGlobals globals "pop" (make_function pop). + Definition push_n : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm"; "num_bytes" ] in @@ -159,6 +162,9 @@ Definition push_n : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom push_n_in_globals : + IsInGlobals globals "push_n" (make_function push_n). + Definition dup_n : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm"; "item_number" ] in @@ -236,6 +242,9 @@ Definition dup_n : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom dup_n_in_globals : + IsInGlobals globals "dup_n" (make_function dup_n). + Definition swap_n : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm"; "item_number" ] in @@ -312,6 +321,9 @@ Definition swap_n : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom swap_n_in_globals : + IsInGlobals globals "swap_n" (make_function swap_n). + Definition push1 : Value.t := M.run ltac:(M.monadic ( M.call (| M.get_name (| globals, locals_stack, "partial" |), diff --git a/CoqOfPython/ethereum/london/vm/instructions/storage.v b/CoqOfPython/ethereum/london/vm/instructions/storage.v index e8cbac7..e7c06d7 100644 --- a/CoqOfPython/ethereum/london/vm/instructions/storage.v +++ b/CoqOfPython/ethereum/london/vm/instructions/storage.v @@ -152,6 +152,9 @@ Definition sload : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom sload_in_globals : + IsInGlobals globals "sload" (make_function sload). + Definition sstore : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -493,3 +496,6 @@ Definition sstore : Value.t -> Value.t -> M := Constant.int 1 |) in M.pure Constant.None_)). + +Axiom sstore_in_globals : + IsInGlobals globals "sstore" (make_function sstore). diff --git a/CoqOfPython/ethereum/london/vm/instructions/system.v b/CoqOfPython/ethereum/london/vm/instructions/system.v index 2cc7d6e..acf71d7 100644 --- a/CoqOfPython/ethereum/london/vm/instructions/system.v +++ b/CoqOfPython/ethereum/london/vm/instructions/system.v @@ -383,6 +383,9 @@ Definition generic_create : Value.t -> Value.t -> M := )) |) in M.pure Constant.None_)). +Axiom generic_create_in_globals : + IsInGlobals globals "generic_create" (make_function generic_create). + Definition create : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -493,6 +496,9 @@ Definition create : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom create_in_globals : + IsInGlobals globals "create" (make_function create). + Definition create2 : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -647,6 +653,9 @@ Definition create2 : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom create2_in_globals : + IsInGlobals globals "create2" (make_function create2). + Definition return_ : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -730,6 +739,9 @@ Definition return_ : Value.t -> Value.t -> M := let _ := M.pass (| |) in M.pure Constant.None_)). +Axiom return__in_globals : + IsInGlobals globals "return_" (make_function return_). + Definition generic_call : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm"; "gas"; "value"; "caller"; "to"; "code_address"; "should_transfer_value"; "is_staticcall"; "memory_input_start_position"; "memory_input_size"; "memory_output_start_position"; "memory_output_size" ] in @@ -925,6 +937,9 @@ Definition generic_call : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom generic_call_in_globals : + IsInGlobals globals "generic_call" (make_function generic_call). + Definition call : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -1258,6 +1273,9 @@ M.get_name (| globals, locals_stack, "GAS_CALL_VALUE" |) |) in M.pure Constant.None_)). +Axiom call_in_globals : + IsInGlobals globals "call" (make_function call). + Definition callcode : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -1536,6 +1554,9 @@ M.get_name (| globals, locals_stack, "GAS_CALL_VALUE" |) |) in M.pure Constant.None_)). +Axiom callcode_in_globals : + IsInGlobals globals "callcode" (make_function callcode). + Definition selfdestruct : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -1740,6 +1761,9 @@ Definition selfdestruct : Value.t -> Value.t -> M := let _ := M.pass (| |) in M.pure Constant.None_)). +Axiom selfdestruct_in_globals : + IsInGlobals globals "selfdestruct" (make_function selfdestruct). + Definition delegatecall : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -1937,6 +1961,9 @@ Definition delegatecall : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom delegatecall_in_globals : + IsInGlobals globals "delegatecall" (make_function delegatecall). + Definition staticcall : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -2140,6 +2167,9 @@ Definition staticcall : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom staticcall_in_globals : + IsInGlobals globals "staticcall" (make_function staticcall). + Definition revert : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -2226,3 +2256,6 @@ Definition revert : Value.t -> Value.t -> M := let _ := M.raise (| Some (M.get_name (| globals, locals_stack, "Revert" |)) |) in let _ := M.pass (| |) in M.pure Constant.None_)). + +Axiom revert_in_globals : + IsInGlobals globals "revert" (make_function revert). diff --git a/CoqOfPython/ethereum/london/vm/interpreter.v b/CoqOfPython/ethereum/london/vm/interpreter.v index 01a4ef3..ef00b6b 100644 --- a/CoqOfPython/ethereum/london/vm/interpreter.v +++ b/CoqOfPython/ethereum/london/vm/interpreter.v @@ -406,6 +406,9 @@ Definition process_message_call : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom process_message_call_in_globals : + IsInGlobals globals "process_message_call" (make_function process_message_call). + Definition process_create_message : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "message"; "env" ] in @@ -508,6 +511,9 @@ Definition process_create_message : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom process_create_message_in_globals : + IsInGlobals globals "process_create_message" (make_function process_create_message). + Definition process_message : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "message"; "env" ] in @@ -633,6 +639,9 @@ Definition process_message : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom process_message_in_globals : + IsInGlobals globals "process_message" (make_function process_message). + Definition execute_code : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "message"; "env" ] in @@ -679,3 +688,6 @@ Definition execute_code : Value.t -> Value.t -> M := M.get_name (| globals, locals_stack, "evm" |) |) in M.pure Constant.None_)). + +Axiom execute_code_in_globals : + IsInGlobals globals "execute_code" (make_function execute_code). diff --git a/CoqOfPython/ethereum/london/vm/memory.v b/CoqOfPython/ethereum/london/vm/memory.v index 84e2145..cf4ab24 100644 --- a/CoqOfPython/ethereum/london/vm/memory.v +++ b/CoqOfPython/ethereum/london/vm/memory.v @@ -71,6 +71,9 @@ Definition memory_write : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom memory_write_in_globals : + IsInGlobals globals "memory_write" (make_function memory_write). + Definition memory_read_bytes : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "memory"; "start_position"; "size" ] in @@ -117,6 +120,9 @@ Definition memory_read_bytes : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom memory_read_bytes_in_globals : + IsInGlobals globals "memory_read_bytes" (make_function memory_read_bytes). + Definition buffer_read : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "buffer"; "start_position"; "size" ] in @@ -169,3 +175,6 @@ Definition buffer_read : Value.t -> Value.t -> M := |) |) in M.pure Constant.None_)). + +Axiom buffer_read_in_globals : + IsInGlobals globals "buffer_read" (make_function buffer_read). diff --git a/CoqOfPython/ethereum/london/vm/precompiled_contracts/alt_bn128.v b/CoqOfPython/ethereum/london/vm/precompiled_contracts/alt_bn128.v index 5026931..46f439d 100644 --- a/CoqOfPython/ethereum/london/vm/precompiled_contracts/alt_bn128.v +++ b/CoqOfPython/ethereum/london/vm/precompiled_contracts/alt_bn128.v @@ -273,6 +273,9 @@ Definition alt_bn128_add : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom alt_bn128_add_in_globals : + IsInGlobals globals "alt_bn128_add" (make_function alt_bn128_add). + Definition alt_bn128_mul : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -455,6 +458,9 @@ Definition alt_bn128_mul : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom alt_bn128_mul_in_globals : + IsInGlobals globals "alt_bn128_mul" (make_function alt_bn128_mul). + Definition alt_bn128_pairing_check : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -781,3 +787,6 @@ Definition alt_bn128_pairing_check : Value.t -> Value.t -> M := M.pure Constant.None_ )) |) in M.pure Constant.None_)). + +Axiom alt_bn128_pairing_check_in_globals : + IsInGlobals globals "alt_bn128_pairing_check" (make_function alt_bn128_pairing_check). diff --git a/CoqOfPython/ethereum/london/vm/precompiled_contracts/blake2f.v b/CoqOfPython/ethereum/london/vm/precompiled_contracts/blake2f.v index 3cbabcc..79a4508 100644 --- a/CoqOfPython/ethereum/london/vm/precompiled_contracts/blake2f.v +++ b/CoqOfPython/ethereum/london/vm/precompiled_contracts/blake2f.v @@ -128,3 +128,6 @@ Definition blake2f : Value.t -> Value.t -> M := |) |) in M.pure Constant.None_)). + +Axiom blake2f_in_globals : + IsInGlobals globals "blake2f" (make_function blake2f). diff --git a/CoqOfPython/ethereum/london/vm/precompiled_contracts/ecrecover.v b/CoqOfPython/ethereum/london/vm/precompiled_contracts/ecrecover.v index cae6267..8165705 100644 --- a/CoqOfPython/ethereum/london/vm/precompiled_contracts/ecrecover.v +++ b/CoqOfPython/ethereum/london/vm/precompiled_contracts/ecrecover.v @@ -302,3 +302,6 @@ Definition ecrecover : Value.t -> Value.t -> M := M.get_name (| globals, locals_stack, "padded_address" |) |) in M.pure Constant.None_)). + +Axiom ecrecover_in_globals : + IsInGlobals globals "ecrecover" (make_function ecrecover). diff --git a/CoqOfPython/ethereum/london/vm/precompiled_contracts/identity.v b/CoqOfPython/ethereum/london/vm/precompiled_contracts/identity.v index 421b701..5bcd95c 100644 --- a/CoqOfPython/ethereum/london/vm/precompiled_contracts/identity.v +++ b/CoqOfPython/ethereum/london/vm/precompiled_contracts/identity.v @@ -95,3 +95,6 @@ Definition identity : Value.t -> Value.t -> M := M.get_name (| globals, locals_stack, "data" |) |) in M.pure Constant.None_)). + +Axiom identity_in_globals : + IsInGlobals globals "identity" (make_function identity). diff --git a/CoqOfPython/ethereum/london/vm/precompiled_contracts/modexp.v b/CoqOfPython/ethereum/london/vm/precompiled_contracts/modexp.v index 9c7c360..2c42ccd 100644 --- a/CoqOfPython/ethereum/london/vm/precompiled_contracts/modexp.v +++ b/CoqOfPython/ethereum/london/vm/precompiled_contracts/modexp.v @@ -356,6 +356,9 @@ Definition modexp : Value.t -> Value.t -> M := )) |) in M.pure Constant.None_)). +Axiom modexp_in_globals : + IsInGlobals globals "modexp" (make_function modexp). + Definition complexity : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "base_length"; "modulus_length" ] in @@ -419,6 +422,9 @@ Definition complexity : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom complexity_in_globals : + IsInGlobals globals "complexity" (make_function complexity). + Definition iterations : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "exponent_length"; "exponent_head" ] in @@ -600,6 +606,9 @@ Definition iterations : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom iterations_in_globals : + IsInGlobals globals "iterations" (make_function iterations). + Definition gas_cost : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "base_length"; "modulus_length"; "exponent_length"; "exponent_head" ] in @@ -680,3 +689,6 @@ Definition gas_cost : Value.t -> Value.t -> M := |) |) in M.pure Constant.None_)). + +Axiom gas_cost_in_globals : + IsInGlobals globals "gas_cost" (make_function gas_cost). diff --git a/CoqOfPython/ethereum/london/vm/precompiled_contracts/ripemd160.v b/CoqOfPython/ethereum/london/vm/precompiled_contracts/ripemd160.v index 6a3952c..6706caf 100644 --- a/CoqOfPython/ethereum/london/vm/precompiled_contracts/ripemd160.v +++ b/CoqOfPython/ethereum/london/vm/precompiled_contracts/ripemd160.v @@ -126,3 +126,6 @@ Definition ripemd160 : Value.t -> Value.t -> M := M.get_name (| globals, locals_stack, "padded_hash" |) |) in M.pure Constant.None_)). + +Axiom ripemd160_in_globals : + IsInGlobals globals "ripemd160" (make_function ripemd160). diff --git a/CoqOfPython/ethereum/london/vm/precompiled_contracts/sha256.v b/CoqOfPython/ethereum/london/vm/precompiled_contracts/sha256.v index f1b4b78..0641623 100644 --- a/CoqOfPython/ethereum/london/vm/precompiled_contracts/sha256.v +++ b/CoqOfPython/ethereum/london/vm/precompiled_contracts/sha256.v @@ -107,3 +107,6 @@ Definition sha256 : Value.t -> Value.t -> M := |) |) in M.pure Constant.None_)). + +Axiom sha256_in_globals : + IsInGlobals globals "sha256" (make_function sha256). diff --git a/CoqOfPython/ethereum/london/vm/runtime.v b/CoqOfPython/ethereum/london/vm/runtime.v index 431534c..2bf0238 100644 --- a/CoqOfPython/ethereum/london/vm/runtime.v +++ b/CoqOfPython/ethereum/london/vm/runtime.v @@ -158,3 +158,6 @@ Definition get_valid_jump_destinations : Value.t -> Value.t -> M := M.get_name (| globals, locals_stack, "valid_jump_destinations" |) |) in M.pure Constant.None_)). + +Axiom get_valid_jump_destinations_in_globals : + IsInGlobals globals "get_valid_jump_destinations" (make_function get_valid_jump_destinations). diff --git a/CoqOfPython/ethereum/london/vm/stack.v b/CoqOfPython/ethereum/london/vm/stack.v index 4a1ee77..76e9986 100644 --- a/CoqOfPython/ethereum/london/vm/stack.v +++ b/CoqOfPython/ethereum/london/vm/stack.v @@ -78,6 +78,9 @@ Definition pop : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom pop_in_globals : + IsInGlobals globals "pop" (make_function pop). + Definition push : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "stack"; "value" ] in @@ -125,3 +128,6 @@ Definition push : Value.t -> Value.t -> M := |) |) in M.pure Constant.None_)). + +Axiom push_in_globals : + IsInGlobals globals "push" (make_function push). diff --git a/CoqOfPython/ethereum/muir_glacier/bloom.v b/CoqOfPython/ethereum/muir_glacier/bloom.v index 0b50d31..9ea5960 100644 --- a/CoqOfPython/ethereum/muir_glacier/bloom.v +++ b/CoqOfPython/ethereum/muir_glacier/bloom.v @@ -140,6 +140,9 @@ Definition add_to_bloom : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom add_to_bloom_in_globals : + IsInGlobals globals "add_to_bloom" (make_function add_to_bloom). + Definition logs_bloom : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "logs" ] in @@ -209,3 +212,6 @@ Definition logs_bloom : Value.t -> Value.t -> M := |) |) in M.pure Constant.None_)). + +Axiom logs_bloom_in_globals : + IsInGlobals globals "logs_bloom" (make_function logs_bloom). diff --git a/CoqOfPython/ethereum/muir_glacier/fork.v b/CoqOfPython/ethereum/muir_glacier/fork.v index 1e7076d..4b82429 100644 --- a/CoqOfPython/ethereum/muir_glacier/fork.v +++ b/CoqOfPython/ethereum/muir_glacier/fork.v @@ -229,6 +229,9 @@ Definition apply_fork : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom apply_fork_in_globals : + IsInGlobals globals "apply_fork" (make_function apply_fork). + Definition get_last_256_block_hashes : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "chain" ] in @@ -341,6 +344,9 @@ Definition get_last_256_block_hashes : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom get_last_256_block_hashes_in_globals : + IsInGlobals globals "get_last_256_block_hashes" (make_function get_last_256_block_hashes). + Definition state_transition : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "chain"; "block" ] in @@ -508,6 +514,9 @@ Definition state_transition : Value.t -> Value.t -> M := )) |) in M.pure Constant.None_)). +Axiom state_transition_in_globals : + IsInGlobals globals "state_transition" (make_function state_transition). + Definition validate_header : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "header"; "parent_header" ] in @@ -654,6 +663,9 @@ Definition validate_header : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom validate_header_in_globals : + IsInGlobals globals "validate_header" (make_function validate_header). + Definition generate_header_hash_for_pow : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "header" ] in @@ -709,6 +721,9 @@ Definition generate_header_hash_for_pow : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom generate_header_hash_for_pow_in_globals : + IsInGlobals globals "generate_header_hash_for_pow" (make_function generate_header_hash_for_pow). + Definition validate_proof_of_work : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "header" ] in @@ -799,6 +814,9 @@ Definition validate_proof_of_work : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom validate_proof_of_work_in_globals : + IsInGlobals globals "validate_proof_of_work" (make_function validate_proof_of_work). + Definition check_transaction : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "tx"; "gas_available"; "chain_id" ] in @@ -852,6 +870,9 @@ Definition check_transaction : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom check_transaction_in_globals : + IsInGlobals globals "check_transaction" (make_function check_transaction). + Definition make_receipt : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "tx"; "error"; "cumulative_gas_used"; "logs" ] in @@ -889,6 +910,9 @@ Definition make_receipt : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom make_receipt_in_globals : + IsInGlobals globals "make_receipt" (make_function make_receipt). + Definition ApplyBodyOutput : Value.t := builtins.make_klass [] @@ -1126,6 +1150,9 @@ Definition apply_body : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom apply_body_in_globals : + IsInGlobals globals "apply_body" (make_function apply_body). + Definition validate_ommers : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "ommers"; "block_header"; "chain" ] in @@ -1447,6 +1474,9 @@ Definition validate_ommers : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom validate_ommers_in_globals : + IsInGlobals globals "validate_ommers" (make_function validate_ommers). + Definition pay_rewards : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "state"; "block_number"; "coinbase"; "ommers" ] in @@ -1552,6 +1582,9 @@ Definition pay_rewards : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom pay_rewards_in_globals : + IsInGlobals globals "pay_rewards" (make_function pay_rewards). + Definition process_transaction : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "env"; "tx" ] in @@ -1919,6 +1952,9 @@ Definition process_transaction : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom process_transaction_in_globals : + IsInGlobals globals "process_transaction" (make_function process_transaction). + Definition validate_transaction : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "tx" ] in @@ -1975,6 +2011,9 @@ Definition validate_transaction : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom validate_transaction_in_globals : + IsInGlobals globals "validate_transaction" (make_function validate_transaction). + Definition calculate_intrinsic_cost : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "tx" ] in @@ -2085,6 +2124,9 @@ Definition calculate_intrinsic_cost : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom calculate_intrinsic_cost_in_globals : + IsInGlobals globals "calculate_intrinsic_cost" (make_function calculate_intrinsic_cost). + Definition recover_sender : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "chain_id"; "tx" ] in @@ -2281,6 +2323,9 @@ Definition recover_sender : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom recover_sender_in_globals : + IsInGlobals globals "recover_sender" (make_function recover_sender). + Definition signing_hash_pre155 : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "tx" ] in @@ -2315,6 +2360,9 @@ Definition signing_hash_pre155 : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom signing_hash_pre155_in_globals : + IsInGlobals globals "signing_hash_pre155" (make_function signing_hash_pre155). + Definition signing_hash_155 : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "tx"; "chain_id" ] in @@ -2363,6 +2411,9 @@ Definition signing_hash_155 : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom signing_hash_155_in_globals : + IsInGlobals globals "signing_hash_155" (make_function signing_hash_155). + Definition compute_header_hash : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "header" ] in @@ -2415,6 +2466,9 @@ Definition compute_header_hash : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom compute_header_hash_in_globals : + IsInGlobals globals "compute_header_hash" (make_function compute_header_hash). + Definition check_gas_limit : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "gas_limit"; "parent_gas_limit" ] in @@ -2515,6 +2569,9 @@ Definition check_gas_limit : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom check_gas_limit_in_globals : + IsInGlobals globals "check_gas_limit" (make_function check_gas_limit). + Definition calculate_block_difficulty : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "block_number"; "block_timestamp"; "parent_timestamp"; "parent_difficulty"; "parent_has_ommers" ] in @@ -2675,3 +2732,6 @@ Constant.int 1 |) |) in M.pure Constant.None_)). + +Axiom calculate_block_difficulty_in_globals : + IsInGlobals globals "calculate_block_difficulty" (make_function calculate_block_difficulty). diff --git a/CoqOfPython/ethereum/muir_glacier/fork_types.v b/CoqOfPython/ethereum/muir_glacier/fork_types.v index 54e2920..f598da2 100644 --- a/CoqOfPython/ethereum/muir_glacier/fork_types.v +++ b/CoqOfPython/ethereum/muir_glacier/fork_types.v @@ -99,3 +99,6 @@ Definition encode_account : Value.t -> Value.t -> M := |) |) in M.pure Constant.None_)). + +Axiom encode_account_in_globals : + IsInGlobals globals "encode_account" (make_function encode_account). diff --git a/CoqOfPython/ethereum/muir_glacier/state.v b/CoqOfPython/ethereum/muir_glacier/state.v index a29a84b..f13b998 100644 --- a/CoqOfPython/ethereum/muir_glacier/state.v +++ b/CoqOfPython/ethereum/muir_glacier/state.v @@ -100,6 +100,9 @@ Definition close_state : Value.t -> Value.t -> M := let _ := M.delete (| M.get_field (| M.get_name (| globals, locals_stack, "state" |), "_created_accounts" |) |) in M.pure Constant.None_)). +Axiom close_state_in_globals : + IsInGlobals globals "close_state" (make_function close_state). + Definition begin_transaction : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "state" ] in @@ -130,6 +133,9 @@ Definition begin_transaction : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom begin_transaction_in_globals : + IsInGlobals globals "begin_transaction" (make_function begin_transaction). + Definition commit_transaction : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "state" ] in @@ -165,6 +171,9 @@ Definition commit_transaction : Value.t -> Value.t -> M := )) |) in M.pure Constant.None_)). +Axiom commit_transaction_in_globals : + IsInGlobals globals "commit_transaction" (make_function commit_transaction). + Definition rollback_transaction : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "state" ] in @@ -204,6 +213,9 @@ Definition rollback_transaction : Value.t -> Value.t -> M := )) |) in M.pure Constant.None_)). +Axiom rollback_transaction_in_globals : + IsInGlobals globals "rollback_transaction" (make_function rollback_transaction). + Definition get_account : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "state"; "address" ] in @@ -264,6 +276,9 @@ Definition get_account : Value.t -> Value.t -> M := )) |) in M.pure Constant.None_)). +Axiom get_account_in_globals : + IsInGlobals globals "get_account" (make_function get_account). + Definition get_account_optional : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "state"; "address" ] in @@ -300,6 +315,9 @@ Definition get_account_optional : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom get_account_optional_in_globals : + IsInGlobals globals "get_account_optional" (make_function get_account_optional). + Definition set_account : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "state"; "address"; "account" ] in @@ -328,6 +346,9 @@ Definition set_account : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom set_account_in_globals : + IsInGlobals globals "set_account" (make_function set_account). + Definition destroy_account : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "state"; "address" ] in @@ -365,6 +386,9 @@ Definition destroy_account : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom destroy_account_in_globals : + IsInGlobals globals "destroy_account" (make_function destroy_account). + Definition destroy_storage : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "state"; "address" ] in @@ -399,6 +423,9 @@ Definition destroy_storage : Value.t -> Value.t -> M := )) |) in M.pure Constant.None_)). +Axiom destroy_storage_in_globals : + IsInGlobals globals "destroy_storage" (make_function destroy_storage). + Definition mark_account_created : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "state"; "address" ] in @@ -428,6 +455,9 @@ Definition mark_account_created : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom mark_account_created_in_globals : + IsInGlobals globals "mark_account_created" (make_function mark_account_created). + Definition get_storage : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "state"; "address"; "key" ] in @@ -507,6 +537,9 @@ Definition get_storage : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom get_storage_in_globals : + IsInGlobals globals "get_storage" (make_function get_storage). + Definition set_storage : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "state"; "address"; "key"; "value" ] in @@ -605,6 +638,9 @@ Definition set_storage : Value.t -> Value.t -> M := )) |) in M.pure Constant.None_)). +Axiom set_storage_in_globals : + IsInGlobals globals "set_storage" (make_function set_storage). + Definition storage_root : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "state"; "address" ] in @@ -656,6 +692,9 @@ Definition storage_root : Value.t -> Value.t -> M := )) |) in M.pure Constant.None_)). +Axiom storage_root_in_globals : + IsInGlobals globals "storage_root" (make_function storage_root). + Definition state_root : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "state" ] in @@ -686,6 +725,9 @@ Definition state_root : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom state_root_in_globals : + IsInGlobals globals "state_root" (make_function state_root). + Definition account_exists : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "state"; "address" ] in @@ -720,6 +762,9 @@ Definition account_exists : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom account_exists_in_globals : + IsInGlobals globals "account_exists" (make_function account_exists). + Definition account_has_code_or_nonce : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "state"; "address" ] in @@ -773,6 +818,9 @@ Definition account_has_code_or_nonce : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom account_has_code_or_nonce_in_globals : + IsInGlobals globals "account_has_code_or_nonce" (make_function account_has_code_or_nonce). + Definition is_account_empty : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "state"; "address" ] in @@ -834,6 +882,9 @@ Definition is_account_empty : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom is_account_empty_in_globals : + IsInGlobals globals "is_account_empty" (make_function is_account_empty). + Definition account_exists_and_is_empty : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "state"; "address" ] in @@ -904,6 +955,9 @@ Definition account_exists_and_is_empty : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom account_exists_and_is_empty_in_globals : + IsInGlobals globals "account_exists_and_is_empty" (make_function account_exists_and_is_empty). + Definition is_account_alive : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "state"; "address" ] in @@ -981,6 +1035,9 @@ Definition is_account_alive : Value.t -> Value.t -> M := )) |) in M.pure Constant.None_)). +Axiom is_account_alive_in_globals : + IsInGlobals globals "is_account_alive" (make_function is_account_alive). + Definition modify_state : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "state"; "address"; "f" ] in @@ -1013,6 +1070,9 @@ Definition modify_state : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom modify_state_in_globals : + IsInGlobals globals "modify_state" (make_function modify_state). + Definition move_ether : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "state"; "sender_address"; "recipient_address"; "amount" ] in @@ -1042,6 +1102,9 @@ Definition move_ether : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom move_ether_in_globals : + IsInGlobals globals "move_ether" (make_function move_ether). + Definition set_account_balance : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "state"; "address"; "amount" ] in @@ -1072,6 +1135,9 @@ Definition set_account_balance : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom set_account_balance_in_globals : + IsInGlobals globals "set_account_balance" (make_function set_account_balance). + Definition touch_account : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "state"; "address" ] in @@ -1116,6 +1182,9 @@ Definition touch_account : Value.t -> Value.t -> M := )) |) in M.pure Constant.None_)). +Axiom touch_account_in_globals : + IsInGlobals globals "touch_account" (make_function touch_account). + Definition increment_nonce : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "state"; "address" ] in @@ -1143,6 +1212,9 @@ Definition increment_nonce : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom increment_nonce_in_globals : + IsInGlobals globals "increment_nonce" (make_function increment_nonce). + Definition set_code : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "state"; "address"; "code" ] in @@ -1173,6 +1245,9 @@ Definition set_code : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom set_code_in_globals : + IsInGlobals globals "set_code" (make_function set_code). + Definition create_ether : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "state"; "address"; "amount" ] in @@ -1201,6 +1276,9 @@ Definition create_ether : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom create_ether_in_globals : + IsInGlobals globals "create_ether" (make_function create_ether). + Definition get_storage_original : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "state"; "address"; "key" ] in @@ -1306,3 +1384,6 @@ Definition get_storage_original : Value.t -> Value.t -> M := M.get_name (| globals, locals_stack, "original_value" |) |) in M.pure Constant.None_)). + +Axiom get_storage_original_in_globals : + IsInGlobals globals "get_storage_original" (make_function get_storage_original). diff --git a/CoqOfPython/ethereum/muir_glacier/trie.v b/CoqOfPython/ethereum/muir_glacier/trie.v index 864cfc2..9c7cc58 100644 --- a/CoqOfPython/ethereum/muir_glacier/trie.v +++ b/CoqOfPython/ethereum/muir_glacier/trie.v @@ -365,6 +365,9 @@ Definition encode_internal_node : Value.t -> Value.t -> M := )) |) in M.pure Constant.None_)). +Axiom encode_internal_node_in_globals : + IsInGlobals globals "encode_internal_node" (make_function encode_internal_node). + Definition encode_node : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "node"; "storage_root" ] in @@ -473,6 +476,9 @@ Definition encode_node : Value.t -> Value.t -> M := )) |) in M.pure Constant.None_)). +Axiom encode_node_in_globals : + IsInGlobals globals "encode_node" (make_function encode_node). + Definition Trie : Value.t := builtins.make_klass [(* At base: unsupported node type: Subscript *)] @@ -520,6 +526,9 @@ Definition copy_trie : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom copy_trie_in_globals : + IsInGlobals globals "copy_trie" (make_function copy_trie). + Definition trie_set : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "trie"; "key"; "value" ] in @@ -580,6 +589,9 @@ Definition trie_set : Value.t -> Value.t -> M := )) |) in M.pure Constant.None_)). +Axiom trie_set_in_globals : + IsInGlobals globals "trie_set" (make_function trie_set). + Definition trie_get : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "trie"; "key" ] in @@ -613,6 +625,9 @@ Definition trie_get : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom trie_get_in_globals : + IsInGlobals globals "trie_get" (make_function trie_get). + Definition common_prefix_length : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "a"; "b" ] in @@ -691,6 +706,9 @@ Definition common_prefix_length : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom common_prefix_length_in_globals : + IsInGlobals globals "common_prefix_length" (make_function common_prefix_length). + Definition nibble_list_to_compact : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "x"; "is_leaf" ] in @@ -899,6 +917,9 @@ Definition nibble_list_to_compact : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom nibble_list_to_compact_in_globals : + IsInGlobals globals "nibble_list_to_compact" (make_function nibble_list_to_compact). + Definition bytes_to_nibble_list : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "bytes_" ] in @@ -995,6 +1016,9 @@ Definition bytes_to_nibble_list : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom bytes_to_nibble_list_in_globals : + IsInGlobals globals "bytes_to_nibble_list" (make_function bytes_to_nibble_list). + Definition _prepare_trie : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "trie"; "get_storage_root" ] in @@ -1146,6 +1170,9 @@ Definition _prepare_trie : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom _prepare_trie_in_globals : + IsInGlobals globals "_prepare_trie" (make_function _prepare_trie). + Definition root : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "trie"; "get_storage_root" ] in @@ -1261,6 +1288,9 @@ Definition root : Value.t -> Value.t -> M := )) |) in M.pure Constant.None_)). +Axiom root_in_globals : + IsInGlobals globals "root" (make_function root). + Definition patricialize : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "obj"; "level" ] in @@ -1600,3 +1630,6 @@ Definition patricialize : Value.t -> Value.t -> M := |) |) in M.pure Constant.None_)). + +Axiom patricialize_in_globals : + IsInGlobals globals "patricialize" (make_function patricialize). diff --git a/CoqOfPython/ethereum/muir_glacier/utils/address.v b/CoqOfPython/ethereum/muir_glacier/utils/address.v index eb42dd0..275f807 100644 --- a/CoqOfPython/ethereum/muir_glacier/utils/address.v +++ b/CoqOfPython/ethereum/muir_glacier/utils/address.v @@ -79,6 +79,9 @@ Definition to_address : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom to_address_in_globals : + IsInGlobals globals "to_address" (make_function to_address). + Definition compute_contract_address : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "address"; "nonce" ] in @@ -149,6 +152,9 @@ Definition compute_contract_address : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom compute_contract_address_in_globals : + IsInGlobals globals "compute_contract_address" (make_function compute_contract_address). + Definition compute_create2_contract_address : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "address"; "salt"; "call_data" ] in @@ -230,3 +236,6 @@ Definition compute_create2_contract_address : Value.t -> Value.t -> M := |) |) in M.pure Constant.None_)). + +Axiom compute_create2_contract_address_in_globals : + IsInGlobals globals "compute_create2_contract_address" (make_function compute_create2_contract_address). diff --git a/CoqOfPython/ethereum/muir_glacier/utils/hexadecimal.v b/CoqOfPython/ethereum/muir_glacier/utils/hexadecimal.v index 42f88f5..0fa7a6c 100644 --- a/CoqOfPython/ethereum/muir_glacier/utils/hexadecimal.v +++ b/CoqOfPython/ethereum/muir_glacier/utils/hexadecimal.v @@ -70,6 +70,9 @@ Definition hex_to_root : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom hex_to_root_in_globals : + IsInGlobals globals "hex_to_root" (make_function hex_to_root). + Definition hex_to_bloom : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "hex_string" ] in @@ -110,6 +113,9 @@ Definition hex_to_bloom : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom hex_to_bloom_in_globals : + IsInGlobals globals "hex_to_bloom" (make_function hex_to_bloom). + Definition hex_to_address : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "hex_string" ] in @@ -156,3 +162,6 @@ Definition hex_to_address : Value.t -> Value.t -> M := |) |) in M.pure Constant.None_)). + +Axiom hex_to_address_in_globals : + IsInGlobals globals "hex_to_address" (make_function hex_to_address). diff --git a/CoqOfPython/ethereum/muir_glacier/utils/message.v b/CoqOfPython/ethereum/muir_glacier/utils/message.v index 4f9fc3a..9b0e933 100644 --- a/CoqOfPython/ethereum/muir_glacier/utils/message.v +++ b/CoqOfPython/ethereum/muir_glacier/utils/message.v @@ -213,3 +213,6 @@ Definition prepare_message : Value.t -> Value.t -> M := |) |) in M.pure Constant.None_)). + +Axiom prepare_message_in_globals : + IsInGlobals globals "prepare_message" (make_function prepare_message). diff --git a/CoqOfPython/ethereum/muir_glacier/vm/__init__.v b/CoqOfPython/ethereum/muir_glacier/vm/__init__.v index 937f07b..39dd981 100644 --- a/CoqOfPython/ethereum/muir_glacier/vm/__init__.v +++ b/CoqOfPython/ethereum/muir_glacier/vm/__init__.v @@ -166,6 +166,9 @@ Definition incorporate_child_on_success : Value.t -> Value.t -> M := )) |) in M.pure Constant.None_)). +Axiom incorporate_child_on_success_in_globals : + IsInGlobals globals "incorporate_child_on_success" (make_function incorporate_child_on_success). + Definition incorporate_child_on_error : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm"; "child_evm" ] in @@ -246,3 +249,6 @@ Definition incorporate_child_on_error : Value.t -> Value.t -> M := M.get_field (| M.get_name (| globals, locals_stack, "child_evm" |), "gas_left" |) |) in M.pure Constant.None_)). + +Axiom incorporate_child_on_error_in_globals : + IsInGlobals globals "incorporate_child_on_error" (make_function incorporate_child_on_error). diff --git a/CoqOfPython/ethereum/muir_glacier/vm/gas.v b/CoqOfPython/ethereum/muir_glacier/vm/gas.v index 66a408e..3bd7267 100644 --- a/CoqOfPython/ethereum/muir_glacier/vm/gas.v +++ b/CoqOfPython/ethereum/muir_glacier/vm/gas.v @@ -553,6 +553,9 @@ Definition charge_gas : Value.t -> Value.t -> M := )) |) in M.pure Constant.None_)). +Axiom charge_gas_in_globals : + IsInGlobals globals "charge_gas" (make_function charge_gas). + Definition calculate_memory_gas_cost : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "size_in_bytes" ] in @@ -612,6 +615,9 @@ Definition calculate_memory_gas_cost : Value.t -> Value.t -> M := (* At stmt: unsupported node type: Try *) M.pure Constant.None_)). +Axiom calculate_memory_gas_cost_in_globals : + IsInGlobals globals "calculate_memory_gas_cost" (make_function calculate_memory_gas_cost). + Definition calculate_gas_extend_memory : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "memory"; "extensions" ] in @@ -795,6 +801,9 @@ Definition calculate_gas_extend_memory : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom calculate_gas_extend_memory_in_globals : + IsInGlobals globals "calculate_gas_extend_memory" (make_function calculate_gas_extend_memory). + Definition calculate_message_call_gas : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "value"; "gas"; "gas_left"; "memory_cost"; "extra_gas"; "call_stipend" ] in @@ -920,6 +929,9 @@ M.get_name (| globals, locals_stack, "call_stipend" |) |) in M.pure Constant.None_)). +Axiom calculate_message_call_gas_in_globals : + IsInGlobals globals "calculate_message_call_gas" (make_function calculate_message_call_gas). + Definition max_message_call_gas : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "gas" ] in @@ -947,3 +959,6 @@ Definition max_message_call_gas : Value.t -> Value.t -> M := |) |) in M.pure Constant.None_)). + +Axiom max_message_call_gas_in_globals : + IsInGlobals globals "max_message_call_gas" (make_function max_message_call_gas). diff --git a/CoqOfPython/ethereum/muir_glacier/vm/instructions/arithmetic.v b/CoqOfPython/ethereum/muir_glacier/vm/instructions/arithmetic.v index e1e2fbf..dfc2032 100644 --- a/CoqOfPython/ethereum/muir_glacier/vm/instructions/arithmetic.v +++ b/CoqOfPython/ethereum/muir_glacier/vm/instructions/arithmetic.v @@ -119,6 +119,9 @@ Definition add : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom add_in_globals : + IsInGlobals globals "add" (make_function add). + Definition sub : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -186,6 +189,9 @@ Definition sub : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom sub_in_globals : + IsInGlobals globals "sub" (make_function sub). + Definition mul : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -253,6 +259,9 @@ Definition mul : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom mul_in_globals : + IsInGlobals globals "mul" (make_function mul). + Definition div : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -341,6 +350,9 @@ Definition div : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom div_in_globals : + IsInGlobals globals "div" (make_function div). + Definition sdiv : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -491,6 +503,9 @@ Definition sdiv : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom sdiv_in_globals : + IsInGlobals globals "sdiv" (make_function sdiv). + Definition mod_ : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -579,6 +594,9 @@ Definition mod_ : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom mod__in_globals : + IsInGlobals globals "mod" (make_function mod_). + Definition smod : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -696,6 +714,9 @@ Definition smod : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom smod_in_globals : + IsInGlobals globals "smod" (make_function smod). + Definition addmod : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -821,6 +842,9 @@ Definition addmod : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom addmod_in_globals : + IsInGlobals globals "addmod" (make_function addmod). + Definition mulmod : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -946,6 +970,9 @@ Definition mulmod : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom mulmod_in_globals : + IsInGlobals globals "mulmod" (make_function mulmod). + Definition exp : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -1057,6 +1084,9 @@ Definition exp : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom exp_in_globals : + IsInGlobals globals "exp" (make_function exp). + Definition signextend : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -1231,3 +1261,6 @@ Definition signextend : Value.t -> Value.t -> M := Constant.int 1 |) in M.pure Constant.None_)). + +Axiom signextend_in_globals : + IsInGlobals globals "signextend" (make_function signextend). diff --git a/CoqOfPython/ethereum/muir_glacier/vm/instructions/bitwise.v b/CoqOfPython/ethereum/muir_glacier/vm/instructions/bitwise.v index 218ede8..140acc7 100644 --- a/CoqOfPython/ethereum/muir_glacier/vm/instructions/bitwise.v +++ b/CoqOfPython/ethereum/muir_glacier/vm/instructions/bitwise.v @@ -97,6 +97,9 @@ Definition bitwise_and : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom bitwise_and_in_globals : + IsInGlobals globals "bitwise_and" (make_function bitwise_and). + Definition bitwise_or : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -157,6 +160,9 @@ Definition bitwise_or : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom bitwise_or_in_globals : + IsInGlobals globals "bitwise_or" (make_function bitwise_or). + Definition bitwise_xor : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -217,6 +223,9 @@ Definition bitwise_xor : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom bitwise_xor_in_globals : + IsInGlobals globals "bitwise_xor" (make_function bitwise_xor). + Definition bitwise_not : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -264,6 +273,9 @@ Definition bitwise_not : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom bitwise_not_in_globals : + IsInGlobals globals "bitwise_not" (make_function bitwise_not). + Definition get_byte : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -380,6 +392,9 @@ Definition get_byte : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom get_byte_in_globals : + IsInGlobals globals "get_byte" (make_function get_byte). + Definition bitwise_shl : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -475,6 +490,9 @@ Definition bitwise_shl : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom bitwise_shl_in_globals : + IsInGlobals globals "bitwise_shl" (make_function bitwise_shl). + Definition bitwise_shr : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -561,6 +579,9 @@ Definition bitwise_shr : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom bitwise_shr_in_globals : + IsInGlobals globals "bitwise_shr" (make_function bitwise_shr). + Definition bitwise_sar : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -674,3 +695,6 @@ Definition bitwise_sar : Value.t -> Value.t -> M := Constant.int 1 |) in M.pure Constant.None_)). + +Axiom bitwise_sar_in_globals : + IsInGlobals globals "bitwise_sar" (make_function bitwise_sar). diff --git a/CoqOfPython/ethereum/muir_glacier/vm/instructions/block.v b/CoqOfPython/ethereum/muir_glacier/vm/instructions/block.v index 3e5efa5..f55baab 100644 --- a/CoqOfPython/ethereum/muir_glacier/vm/instructions/block.v +++ b/CoqOfPython/ethereum/muir_glacier/vm/instructions/block.v @@ -129,6 +129,9 @@ Definition block_hash : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom block_hash_in_globals : + IsInGlobals globals "block_hash" (make_function block_hash). + Definition coinbase : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -176,6 +179,9 @@ Definition coinbase : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom coinbase_in_globals : + IsInGlobals globals "coinbase" (make_function coinbase). + Definition timestamp : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -217,6 +223,9 @@ Definition timestamp : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom timestamp_in_globals : + IsInGlobals globals "timestamp" (make_function timestamp). + Definition number : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -263,6 +272,9 @@ Definition number : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom number_in_globals : + IsInGlobals globals "number" (make_function number). + Definition difficulty : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -309,6 +321,9 @@ Definition difficulty : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom difficulty_in_globals : + IsInGlobals globals "difficulty" (make_function difficulty). + Definition gas_limit : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -355,6 +370,9 @@ Definition gas_limit : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom gas_limit_in_globals : + IsInGlobals globals "gas_limit" (make_function gas_limit). + Definition chain_id : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -397,3 +415,6 @@ Definition chain_id : Value.t -> Value.t -> M := Constant.int 1 |) in M.pure Constant.None_)). + +Axiom chain_id_in_globals : + IsInGlobals globals "chain_id" (make_function chain_id). diff --git a/CoqOfPython/ethereum/muir_glacier/vm/instructions/comparison.v b/CoqOfPython/ethereum/muir_glacier/vm/instructions/comparison.v index 9c05bcd..17604c1 100644 --- a/CoqOfPython/ethereum/muir_glacier/vm/instructions/comparison.v +++ b/CoqOfPython/ethereum/muir_glacier/vm/instructions/comparison.v @@ -105,6 +105,9 @@ Definition less_than : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom less_than_in_globals : + IsInGlobals globals "less_than" (make_function less_than). + Definition signed_less_than : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -182,6 +185,9 @@ Definition signed_less_than : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom signed_less_than_in_globals : + IsInGlobals globals "signed_less_than" (make_function signed_less_than). + Definition greater_than : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -252,6 +258,9 @@ Definition greater_than : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom greater_than_in_globals : + IsInGlobals globals "greater_than" (make_function greater_than). + Definition signed_greater_than : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -329,6 +338,9 @@ Definition signed_greater_than : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom signed_greater_than_in_globals : + IsInGlobals globals "signed_greater_than" (make_function signed_greater_than). + Definition equal : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -399,6 +411,9 @@ Definition equal : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom equal_in_globals : + IsInGlobals globals "equal" (make_function equal). + Definition is_zero : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -458,3 +473,6 @@ Definition is_zero : Value.t -> Value.t -> M := Constant.int 1 |) in M.pure Constant.None_)). + +Axiom is_zero_in_globals : + IsInGlobals globals "is_zero" (make_function is_zero). diff --git a/CoqOfPython/ethereum/muir_glacier/vm/instructions/control_flow.v b/CoqOfPython/ethereum/muir_glacier/vm/instructions/control_flow.v index f7bab8a..45bac6b 100644 --- a/CoqOfPython/ethereum/muir_glacier/vm/instructions/control_flow.v +++ b/CoqOfPython/ethereum/muir_glacier/vm/instructions/control_flow.v @@ -71,6 +71,9 @@ Definition stop : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom stop_in_globals : + IsInGlobals globals "stop" (make_function stop). + Definition jump : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -136,6 +139,9 @@ Definition jump : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom jump_in_globals : + IsInGlobals globals "jump" (make_function jump). + Definition jumpi : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -237,6 +243,9 @@ Definition jumpi : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom jumpi_in_globals : + IsInGlobals globals "jumpi" (make_function jumpi). + Definition pc : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -281,6 +290,9 @@ Definition pc : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom pc_in_globals : + IsInGlobals globals "pc" (make_function pc). + Definition gas_left : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -325,6 +337,9 @@ Definition gas_left : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom gas_left_in_globals : + IsInGlobals globals "gas_left" (make_function gas_left). + Definition jumpdest : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -356,3 +371,6 @@ Definition jumpdest : Value.t -> Value.t -> M := Constant.int 1 |) in M.pure Constant.None_)). + +Axiom jumpdest_in_globals : + IsInGlobals globals "jumpdest" (make_function jumpdest). diff --git a/CoqOfPython/ethereum/muir_glacier/vm/instructions/environment.v b/CoqOfPython/ethereum/muir_glacier/vm/instructions/environment.v index e783002..33eaba1 100644 --- a/CoqOfPython/ethereum/muir_glacier/vm/instructions/environment.v +++ b/CoqOfPython/ethereum/muir_glacier/vm/instructions/environment.v @@ -122,6 +122,9 @@ Definition address : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom address_in_globals : + IsInGlobals globals "address" (make_function address). + Definition balance : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -185,6 +188,9 @@ Definition balance : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom balance_in_globals : + IsInGlobals globals "balance" (make_function balance). + Definition origin : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -229,6 +235,9 @@ Definition origin : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom origin_in_globals : + IsInGlobals globals "origin" (make_function origin). + Definition caller : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -272,6 +281,9 @@ Definition caller : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom caller_in_globals : + IsInGlobals globals "caller" (make_function caller). + Definition callvalue : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -309,6 +321,9 @@ Definition callvalue : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom callvalue_in_globals : + IsInGlobals globals "callvalue" (make_function callvalue). + Definition calldataload : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -380,6 +395,9 @@ Definition calldataload : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom calldataload_in_globals : + IsInGlobals globals "calldataload" (make_function calldataload). + Definition calldatasize : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -429,6 +447,9 @@ Definition calldatasize : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom calldatasize_in_globals : + IsInGlobals globals "calldatasize" (make_function calldatasize). + Definition calldatacopy : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -564,6 +585,9 @@ Definition calldatacopy : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom calldatacopy_in_globals : + IsInGlobals globals "calldatacopy" (make_function calldatacopy). + Definition codesize : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -613,6 +637,9 @@ Definition codesize : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom codesize_in_globals : + IsInGlobals globals "codesize" (make_function codesize). + Definition codecopy : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -748,6 +775,9 @@ Definition codecopy : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom codecopy_in_globals : + IsInGlobals globals "codecopy" (make_function codecopy). + Definition gasprice : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -791,6 +821,9 @@ Definition gasprice : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom gasprice_in_globals : + IsInGlobals globals "gasprice" (make_function gasprice). + Definition extcodesize : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -866,6 +899,9 @@ Definition extcodesize : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom extcodesize_in_globals : + IsInGlobals globals "extcodesize" (make_function extcodesize). + Definition extcodecopy : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -1025,6 +1061,9 @@ Definition extcodecopy : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom extcodecopy_in_globals : + IsInGlobals globals "extcodecopy" (make_function extcodecopy). + Definition returndatasize : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -1073,6 +1112,9 @@ Definition returndatasize : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom returndatasize_in_globals : + IsInGlobals globals "returndatasize" (make_function returndatasize). + Definition returndatacopy : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -1236,6 +1278,9 @@ Definition returndatacopy : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom returndatacopy_in_globals : + IsInGlobals globals "returndatacopy" (make_function returndatacopy). + Definition extcodehash : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -1337,6 +1382,9 @@ Definition extcodehash : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom extcodehash_in_globals : + IsInGlobals globals "extcodehash" (make_function extcodehash). + Definition self_balance : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -1384,3 +1432,6 @@ Definition self_balance : Value.t -> Value.t -> M := Constant.int 1 |) in M.pure Constant.None_)). + +Axiom self_balance_in_globals : + IsInGlobals globals "self_balance" (make_function self_balance). diff --git a/CoqOfPython/ethereum/muir_glacier/vm/instructions/keccak.v b/CoqOfPython/ethereum/muir_glacier/vm/instructions/keccak.v index 3a872ed..6d4acbb 100644 --- a/CoqOfPython/ethereum/muir_glacier/vm/instructions/keccak.v +++ b/CoqOfPython/ethereum/muir_glacier/vm/instructions/keccak.v @@ -189,3 +189,6 @@ Definition keccak : Value.t -> Value.t -> M := Constant.int 1 |) in M.pure Constant.None_)). + +Axiom keccak_in_globals : + IsInGlobals globals "keccak" (make_function keccak). diff --git a/CoqOfPython/ethereum/muir_glacier/vm/instructions/log.v b/CoqOfPython/ethereum/muir_glacier/vm/instructions/log.v index 378ef42..fc48be4 100644 --- a/CoqOfPython/ethereum/muir_glacier/vm/instructions/log.v +++ b/CoqOfPython/ethereum/muir_glacier/vm/instructions/log.v @@ -208,6 +208,9 @@ Definition log_n : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom log_n_in_globals : + IsInGlobals globals "log_n" (make_function log_n). + Definition log0 : Value.t := M.run ltac:(M.monadic ( M.call (| M.get_name (| globals, locals_stack, "partial" |), diff --git a/CoqOfPython/ethereum/muir_glacier/vm/instructions/memory.v b/CoqOfPython/ethereum/muir_glacier/vm/instructions/memory.v index deda339..eb2d25b 100644 --- a/CoqOfPython/ethereum/muir_glacier/vm/instructions/memory.v +++ b/CoqOfPython/ethereum/muir_glacier/vm/instructions/memory.v @@ -145,6 +145,9 @@ Definition mstore : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom mstore_in_globals : + IsInGlobals globals "mstore" (make_function mstore). + Definition mstore8 : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -249,6 +252,9 @@ Definition mstore8 : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom mstore8_in_globals : + IsInGlobals globals "mstore8" (make_function mstore8). + Definition mload : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -349,6 +355,9 @@ Definition mload : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom mload_in_globals : + IsInGlobals globals "mload" (make_function mload). + Definition msize : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -397,3 +406,6 @@ Definition msize : Value.t -> Value.t -> M := Constant.int 1 |) in M.pure Constant.None_)). + +Axiom msize_in_globals : + IsInGlobals globals "msize" (make_function msize). diff --git a/CoqOfPython/ethereum/muir_glacier/vm/instructions/stack.v b/CoqOfPython/ethereum/muir_glacier/vm/instructions/stack.v index 6b1c23c..2a82584 100644 --- a/CoqOfPython/ethereum/muir_glacier/vm/instructions/stack.v +++ b/CoqOfPython/ethereum/muir_glacier/vm/instructions/stack.v @@ -82,6 +82,9 @@ Definition pop : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom pop_in_globals : + IsInGlobals globals "pop" (make_function pop). + Definition push_n : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm"; "num_bytes" ] in @@ -159,6 +162,9 @@ Definition push_n : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom push_n_in_globals : + IsInGlobals globals "push_n" (make_function push_n). + Definition dup_n : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm"; "item_number" ] in @@ -236,6 +242,9 @@ Definition dup_n : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom dup_n_in_globals : + IsInGlobals globals "dup_n" (make_function dup_n). + Definition swap_n : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm"; "item_number" ] in @@ -312,6 +321,9 @@ Definition swap_n : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom swap_n_in_globals : + IsInGlobals globals "swap_n" (make_function swap_n). + Definition push1 : Value.t := M.run ltac:(M.monadic ( M.call (| M.get_name (| globals, locals_stack, "partial" |), diff --git a/CoqOfPython/ethereum/muir_glacier/vm/instructions/storage.v b/CoqOfPython/ethereum/muir_glacier/vm/instructions/storage.v index f8cea22..8f9a00f 100644 --- a/CoqOfPython/ethereum/muir_glacier/vm/instructions/storage.v +++ b/CoqOfPython/ethereum/muir_glacier/vm/instructions/storage.v @@ -118,6 +118,9 @@ Definition sload : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom sload_in_globals : + IsInGlobals globals "sload" (make_function sload). + Definition sstore : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -414,3 +417,6 @@ Definition sstore : Value.t -> Value.t -> M := Constant.int 1 |) in M.pure Constant.None_)). + +Axiom sstore_in_globals : + IsInGlobals globals "sstore" (make_function sstore). diff --git a/CoqOfPython/ethereum/muir_glacier/vm/instructions/system.v b/CoqOfPython/ethereum/muir_glacier/vm/instructions/system.v index 25f3e39..6e297e5 100644 --- a/CoqOfPython/ethereum/muir_glacier/vm/instructions/system.v +++ b/CoqOfPython/ethereum/muir_glacier/vm/instructions/system.v @@ -376,6 +376,9 @@ Definition generic_create : Value.t -> Value.t -> M := )) |) in M.pure Constant.None_)). +Axiom generic_create_in_globals : + IsInGlobals globals "generic_create" (make_function generic_create). + Definition create : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -486,6 +489,9 @@ Definition create : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom create_in_globals : + IsInGlobals globals "create" (make_function create). + Definition create2 : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -640,6 +646,9 @@ Definition create2 : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom create2_in_globals : + IsInGlobals globals "create2" (make_function create2). + Definition return_ : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -723,6 +732,9 @@ Definition return_ : Value.t -> Value.t -> M := let _ := M.pass (| |) in M.pure Constant.None_)). +Axiom return__in_globals : + IsInGlobals globals "return_" (make_function return_). + Definition generic_call : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm"; "gas"; "value"; "caller"; "to"; "code_address"; "should_transfer_value"; "is_staticcall"; "memory_input_start_position"; "memory_input_size"; "memory_output_start_position"; "memory_output_size" ] in @@ -918,6 +930,9 @@ Definition generic_call : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom generic_call_in_globals : + IsInGlobals globals "generic_call" (make_function generic_call). + Definition call : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -1222,6 +1237,9 @@ M.get_name (| globals, locals_stack, "GAS_CALL_VALUE" |) |) in M.pure Constant.None_)). +Axiom call_in_globals : + IsInGlobals globals "call" (make_function call). + Definition callcode : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -1471,6 +1489,9 @@ M.get_name (| globals, locals_stack, "GAS_CALL_VALUE" |) |) in M.pure Constant.None_)). +Axiom callcode_in_globals : + IsInGlobals globals "callcode" (make_function callcode). + Definition selfdestruct : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -1700,6 +1721,9 @@ Definition selfdestruct : Value.t -> Value.t -> M := let _ := M.pass (| |) in M.pure Constant.None_)). +Axiom selfdestruct_in_globals : + IsInGlobals globals "selfdestruct" (make_function selfdestruct). + Definition delegatecall : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -1868,6 +1892,9 @@ Definition delegatecall : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom delegatecall_in_globals : + IsInGlobals globals "delegatecall" (make_function delegatecall). + Definition staticcall : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -2042,6 +2069,9 @@ Definition staticcall : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom staticcall_in_globals : + IsInGlobals globals "staticcall" (make_function staticcall). + Definition revert : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -2128,3 +2158,6 @@ Definition revert : Value.t -> Value.t -> M := let _ := M.raise (| Some (M.get_name (| globals, locals_stack, "Revert" |)) |) in let _ := M.pass (| |) in M.pure Constant.None_)). + +Axiom revert_in_globals : + IsInGlobals globals "revert" (make_function revert). diff --git a/CoqOfPython/ethereum/muir_glacier/vm/interpreter.v b/CoqOfPython/ethereum/muir_glacier/vm/interpreter.v index 6f75fab..5edf264 100644 --- a/CoqOfPython/ethereum/muir_glacier/vm/interpreter.v +++ b/CoqOfPython/ethereum/muir_glacier/vm/interpreter.v @@ -404,6 +404,9 @@ Definition process_message_call : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom process_message_call_in_globals : + IsInGlobals globals "process_message_call" (make_function process_message_call). + Definition process_create_message : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "message"; "env" ] in @@ -506,6 +509,9 @@ Definition process_create_message : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom process_create_message_in_globals : + IsInGlobals globals "process_create_message" (make_function process_create_message). + Definition process_message : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "message"; "env" ] in @@ -631,6 +637,9 @@ Definition process_message : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom process_message_in_globals : + IsInGlobals globals "process_message" (make_function process_message). + Definition execute_code : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "message"; "env" ] in @@ -677,3 +686,6 @@ Definition execute_code : Value.t -> Value.t -> M := M.get_name (| globals, locals_stack, "evm" |) |) in M.pure Constant.None_)). + +Axiom execute_code_in_globals : + IsInGlobals globals "execute_code" (make_function execute_code). diff --git a/CoqOfPython/ethereum/muir_glacier/vm/memory.v b/CoqOfPython/ethereum/muir_glacier/vm/memory.v index a751b41..de930d2 100644 --- a/CoqOfPython/ethereum/muir_glacier/vm/memory.v +++ b/CoqOfPython/ethereum/muir_glacier/vm/memory.v @@ -71,6 +71,9 @@ Definition memory_write : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom memory_write_in_globals : + IsInGlobals globals "memory_write" (make_function memory_write). + Definition memory_read_bytes : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "memory"; "start_position"; "size" ] in @@ -117,6 +120,9 @@ Definition memory_read_bytes : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom memory_read_bytes_in_globals : + IsInGlobals globals "memory_read_bytes" (make_function memory_read_bytes). + Definition buffer_read : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "buffer"; "start_position"; "size" ] in @@ -169,3 +175,6 @@ Definition buffer_read : Value.t -> Value.t -> M := |) |) in M.pure Constant.None_)). + +Axiom buffer_read_in_globals : + IsInGlobals globals "buffer_read" (make_function buffer_read). diff --git a/CoqOfPython/ethereum/muir_glacier/vm/precompiled_contracts/alt_bn128.v b/CoqOfPython/ethereum/muir_glacier/vm/precompiled_contracts/alt_bn128.v index b97dd68..ebc0707 100644 --- a/CoqOfPython/ethereum/muir_glacier/vm/precompiled_contracts/alt_bn128.v +++ b/CoqOfPython/ethereum/muir_glacier/vm/precompiled_contracts/alt_bn128.v @@ -273,6 +273,9 @@ Definition alt_bn128_add : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom alt_bn128_add_in_globals : + IsInGlobals globals "alt_bn128_add" (make_function alt_bn128_add). + Definition alt_bn128_mul : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -455,6 +458,9 @@ Definition alt_bn128_mul : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom alt_bn128_mul_in_globals : + IsInGlobals globals "alt_bn128_mul" (make_function alt_bn128_mul). + Definition alt_bn128_pairing_check : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -781,3 +787,6 @@ Definition alt_bn128_pairing_check : Value.t -> Value.t -> M := M.pure Constant.None_ )) |) in M.pure Constant.None_)). + +Axiom alt_bn128_pairing_check_in_globals : + IsInGlobals globals "alt_bn128_pairing_check" (make_function alt_bn128_pairing_check). diff --git a/CoqOfPython/ethereum/muir_glacier/vm/precompiled_contracts/blake2f.v b/CoqOfPython/ethereum/muir_glacier/vm/precompiled_contracts/blake2f.v index 2317e98..942ab47 100644 --- a/CoqOfPython/ethereum/muir_glacier/vm/precompiled_contracts/blake2f.v +++ b/CoqOfPython/ethereum/muir_glacier/vm/precompiled_contracts/blake2f.v @@ -128,3 +128,6 @@ Definition blake2f : Value.t -> Value.t -> M := |) |) in M.pure Constant.None_)). + +Axiom blake2f_in_globals : + IsInGlobals globals "blake2f" (make_function blake2f). diff --git a/CoqOfPython/ethereum/muir_glacier/vm/precompiled_contracts/ecrecover.v b/CoqOfPython/ethereum/muir_glacier/vm/precompiled_contracts/ecrecover.v index 39ccd83..1c8ed18 100644 --- a/CoqOfPython/ethereum/muir_glacier/vm/precompiled_contracts/ecrecover.v +++ b/CoqOfPython/ethereum/muir_glacier/vm/precompiled_contracts/ecrecover.v @@ -302,3 +302,6 @@ Definition ecrecover : Value.t -> Value.t -> M := M.get_name (| globals, locals_stack, "padded_address" |) |) in M.pure Constant.None_)). + +Axiom ecrecover_in_globals : + IsInGlobals globals "ecrecover" (make_function ecrecover). diff --git a/CoqOfPython/ethereum/muir_glacier/vm/precompiled_contracts/identity.v b/CoqOfPython/ethereum/muir_glacier/vm/precompiled_contracts/identity.v index 26780a0..368eaf7 100644 --- a/CoqOfPython/ethereum/muir_glacier/vm/precompiled_contracts/identity.v +++ b/CoqOfPython/ethereum/muir_glacier/vm/precompiled_contracts/identity.v @@ -95,3 +95,6 @@ Definition identity : Value.t -> Value.t -> M := M.get_name (| globals, locals_stack, "data" |) |) in M.pure Constant.None_)). + +Axiom identity_in_globals : + IsInGlobals globals "identity" (make_function identity). diff --git a/CoqOfPython/ethereum/muir_glacier/vm/precompiled_contracts/modexp.v b/CoqOfPython/ethereum/muir_glacier/vm/precompiled_contracts/modexp.v index a5cd08f..581f8db 100644 --- a/CoqOfPython/ethereum/muir_glacier/vm/precompiled_contracts/modexp.v +++ b/CoqOfPython/ethereum/muir_glacier/vm/precompiled_contracts/modexp.v @@ -468,6 +468,9 @@ Definition modexp : Value.t -> Value.t -> M := )) |) in M.pure Constant.None_)). +Axiom modexp_in_globals : + IsInGlobals globals "modexp" (make_function modexp). + Definition get_mult_complexity : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "x" ] in @@ -546,3 +549,6 @@ Definition get_mult_complexity : Value.t -> Value.t -> M := M.pure Constant.None_ )) |) in M.pure Constant.None_)). + +Axiom get_mult_complexity_in_globals : + IsInGlobals globals "get_mult_complexity" (make_function get_mult_complexity). diff --git a/CoqOfPython/ethereum/muir_glacier/vm/precompiled_contracts/ripemd160.v b/CoqOfPython/ethereum/muir_glacier/vm/precompiled_contracts/ripemd160.v index c989eeb..6d5ceb2 100644 --- a/CoqOfPython/ethereum/muir_glacier/vm/precompiled_contracts/ripemd160.v +++ b/CoqOfPython/ethereum/muir_glacier/vm/precompiled_contracts/ripemd160.v @@ -126,3 +126,6 @@ Definition ripemd160 : Value.t -> Value.t -> M := M.get_name (| globals, locals_stack, "padded_hash" |) |) in M.pure Constant.None_)). + +Axiom ripemd160_in_globals : + IsInGlobals globals "ripemd160" (make_function ripemd160). diff --git a/CoqOfPython/ethereum/muir_glacier/vm/precompiled_contracts/sha256.v b/CoqOfPython/ethereum/muir_glacier/vm/precompiled_contracts/sha256.v index 3d61480..84b471c 100644 --- a/CoqOfPython/ethereum/muir_glacier/vm/precompiled_contracts/sha256.v +++ b/CoqOfPython/ethereum/muir_glacier/vm/precompiled_contracts/sha256.v @@ -107,3 +107,6 @@ Definition sha256 : Value.t -> Value.t -> M := |) |) in M.pure Constant.None_)). + +Axiom sha256_in_globals : + IsInGlobals globals "sha256" (make_function sha256). diff --git a/CoqOfPython/ethereum/muir_glacier/vm/runtime.v b/CoqOfPython/ethereum/muir_glacier/vm/runtime.v index 604a265..ba36585 100644 --- a/CoqOfPython/ethereum/muir_glacier/vm/runtime.v +++ b/CoqOfPython/ethereum/muir_glacier/vm/runtime.v @@ -158,3 +158,6 @@ Definition get_valid_jump_destinations : Value.t -> Value.t -> M := M.get_name (| globals, locals_stack, "valid_jump_destinations" |) |) in M.pure Constant.None_)). + +Axiom get_valid_jump_destinations_in_globals : + IsInGlobals globals "get_valid_jump_destinations" (make_function get_valid_jump_destinations). diff --git a/CoqOfPython/ethereum/muir_glacier/vm/stack.v b/CoqOfPython/ethereum/muir_glacier/vm/stack.v index 39e785f..b5b48da 100644 --- a/CoqOfPython/ethereum/muir_glacier/vm/stack.v +++ b/CoqOfPython/ethereum/muir_glacier/vm/stack.v @@ -78,6 +78,9 @@ Definition pop : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom pop_in_globals : + IsInGlobals globals "pop" (make_function pop). + Definition push : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "stack"; "value" ] in @@ -125,3 +128,6 @@ Definition push : Value.t -> Value.t -> M := |) |) in M.pure Constant.None_)). + +Axiom push_in_globals : + IsInGlobals globals "push" (make_function push). diff --git a/CoqOfPython/ethereum/paris/bloom.v b/CoqOfPython/ethereum/paris/bloom.v index 8ed3f2c..6baf0ea 100644 --- a/CoqOfPython/ethereum/paris/bloom.v +++ b/CoqOfPython/ethereum/paris/bloom.v @@ -140,6 +140,9 @@ Definition add_to_bloom : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom add_to_bloom_in_globals : + IsInGlobals globals "add_to_bloom" (make_function add_to_bloom). + Definition logs_bloom : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "logs" ] in @@ -209,3 +212,6 @@ Definition logs_bloom : Value.t -> Value.t -> M := |) |) in M.pure Constant.None_)). + +Axiom logs_bloom_in_globals : + IsInGlobals globals "logs_bloom" (make_function logs_bloom). diff --git a/CoqOfPython/ethereum/paris/fork.v b/CoqOfPython/ethereum/paris/fork.v index 8bef456..1c063d1 100644 --- a/CoqOfPython/ethereum/paris/fork.v +++ b/CoqOfPython/ethereum/paris/fork.v @@ -208,6 +208,9 @@ Definition apply_fork : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom apply_fork_in_globals : + IsInGlobals globals "apply_fork" (make_function apply_fork). + Definition get_last_256_block_hashes : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "chain" ] in @@ -320,6 +323,9 @@ Definition get_last_256_block_hashes : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom get_last_256_block_hashes_in_globals : + IsInGlobals globals "get_last_256_block_hashes" (make_function get_last_256_block_hashes). + Definition state_transition : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "chain"; "block" ] in @@ -489,6 +495,9 @@ Definition state_transition : Value.t -> Value.t -> M := )) |) in M.pure Constant.None_)). +Axiom state_transition_in_globals : + IsInGlobals globals "state_transition" (make_function state_transition). + Definition calculate_base_fee_per_gas : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "block_gas_limit"; "parent_gas_limit"; "parent_gas_used"; "parent_base_fee_per_gas" ] in @@ -654,6 +663,9 @@ Definition calculate_base_fee_per_gas : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom calculate_base_fee_per_gas_in_globals : + IsInGlobals globals "calculate_base_fee_per_gas" (make_function calculate_base_fee_per_gas). + Definition validate_header : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "header"; "parent_header" ] in @@ -814,6 +826,9 @@ Definition validate_header : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom validate_header_in_globals : + IsInGlobals globals "validate_header" (make_function validate_header). + Definition check_transaction : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "tx"; "base_fee_per_gas"; "gas_available"; "chain_id" ] in @@ -947,6 +962,9 @@ Definition check_transaction : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom check_transaction_in_globals : + IsInGlobals globals "check_transaction" (make_function check_transaction). + Definition make_receipt : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "tx"; "error"; "cumulative_gas_used"; "logs" ] in @@ -1044,6 +1062,9 @@ Definition make_receipt : Value.t -> Value.t -> M := )) |) in M.pure Constant.None_)). +Axiom make_receipt_in_globals : + IsInGlobals globals "make_receipt" (make_function make_receipt). + Definition ApplyBodyOutput : Value.t := builtins.make_klass [] @@ -1287,6 +1308,9 @@ Definition apply_body : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom apply_body_in_globals : + IsInGlobals globals "apply_body" (make_function apply_body). + Definition process_transaction : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "env"; "tx" ] in @@ -1763,6 +1787,9 @@ Definition process_transaction : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom process_transaction_in_globals : + IsInGlobals globals "process_transaction" (make_function process_transaction). + Definition validate_transaction : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "tx" ] in @@ -1819,6 +1846,9 @@ Definition validate_transaction : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom validate_transaction_in_globals : + IsInGlobals globals "validate_transaction" (make_function validate_transaction). + Definition calculate_intrinsic_cost : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "tx" ] in @@ -1984,6 +2014,9 @@ Definition calculate_intrinsic_cost : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom calculate_intrinsic_cost_in_globals : + IsInGlobals globals "calculate_intrinsic_cost" (make_function calculate_intrinsic_cost). + Definition recover_sender : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "chain_id"; "tx" ] in @@ -2276,6 +2309,9 @@ Definition recover_sender : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom recover_sender_in_globals : + IsInGlobals globals "recover_sender" (make_function recover_sender). + Definition signing_hash_pre155 : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "tx" ] in @@ -2310,6 +2346,9 @@ Definition signing_hash_pre155 : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom signing_hash_pre155_in_globals : + IsInGlobals globals "signing_hash_pre155" (make_function signing_hash_pre155). + Definition signing_hash_155 : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "tx"; "chain_id" ] in @@ -2358,6 +2397,9 @@ Definition signing_hash_155 : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom signing_hash_155_in_globals : + IsInGlobals globals "signing_hash_155" (make_function signing_hash_155). + Definition signing_hash_2930 : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "tx" ] in @@ -2395,6 +2437,9 @@ Definition signing_hash_2930 : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom signing_hash_2930_in_globals : + IsInGlobals globals "signing_hash_2930" (make_function signing_hash_2930). + Definition signing_hash_1559 : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "tx" ] in @@ -2432,6 +2477,9 @@ Definition signing_hash_1559 : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom signing_hash_1559_in_globals : + IsInGlobals globals "signing_hash_1559" (make_function signing_hash_1559). + Definition compute_header_hash : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "header" ] in @@ -2484,6 +2532,9 @@ Definition compute_header_hash : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom compute_header_hash_in_globals : + IsInGlobals globals "compute_header_hash" (make_function compute_header_hash). + Definition check_gas_limit : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "gas_limit"; "parent_gas_limit" ] in @@ -2583,3 +2634,6 @@ Definition check_gas_limit : Value.t -> Value.t -> M := Constant.bool true |) in M.pure Constant.None_)). + +Axiom check_gas_limit_in_globals : + IsInGlobals globals "check_gas_limit" (make_function check_gas_limit). diff --git a/CoqOfPython/ethereum/paris/fork_types.v b/CoqOfPython/ethereum/paris/fork_types.v index b5a9c85..993db55 100644 --- a/CoqOfPython/ethereum/paris/fork_types.v +++ b/CoqOfPython/ethereum/paris/fork_types.v @@ -99,3 +99,6 @@ Definition encode_account : Value.t -> Value.t -> M := |) |) in M.pure Constant.None_)). + +Axiom encode_account_in_globals : + IsInGlobals globals "encode_account" (make_function encode_account). diff --git a/CoqOfPython/ethereum/paris/state.v b/CoqOfPython/ethereum/paris/state.v index b08baae..031eed2 100644 --- a/CoqOfPython/ethereum/paris/state.v +++ b/CoqOfPython/ethereum/paris/state.v @@ -100,6 +100,9 @@ Definition close_state : Value.t -> Value.t -> M := let _ := M.delete (| M.get_field (| M.get_name (| globals, locals_stack, "state" |), "_created_accounts" |) |) in M.pure Constant.None_)). +Axiom close_state_in_globals : + IsInGlobals globals "close_state" (make_function close_state). + Definition begin_transaction : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "state" ] in @@ -130,6 +133,9 @@ Definition begin_transaction : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom begin_transaction_in_globals : + IsInGlobals globals "begin_transaction" (make_function begin_transaction). + Definition commit_transaction : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "state" ] in @@ -165,6 +171,9 @@ Definition commit_transaction : Value.t -> Value.t -> M := )) |) in M.pure Constant.None_)). +Axiom commit_transaction_in_globals : + IsInGlobals globals "commit_transaction" (make_function commit_transaction). + Definition rollback_transaction : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "state" ] in @@ -204,6 +213,9 @@ Definition rollback_transaction : Value.t -> Value.t -> M := )) |) in M.pure Constant.None_)). +Axiom rollback_transaction_in_globals : + IsInGlobals globals "rollback_transaction" (make_function rollback_transaction). + Definition get_account : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "state"; "address" ] in @@ -264,6 +276,9 @@ Definition get_account : Value.t -> Value.t -> M := )) |) in M.pure Constant.None_)). +Axiom get_account_in_globals : + IsInGlobals globals "get_account" (make_function get_account). + Definition get_account_optional : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "state"; "address" ] in @@ -300,6 +315,9 @@ Definition get_account_optional : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom get_account_optional_in_globals : + IsInGlobals globals "get_account_optional" (make_function get_account_optional). + Definition set_account : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "state"; "address"; "account" ] in @@ -328,6 +346,9 @@ Definition set_account : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom set_account_in_globals : + IsInGlobals globals "set_account" (make_function set_account). + Definition destroy_account : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "state"; "address" ] in @@ -365,6 +386,9 @@ Definition destroy_account : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom destroy_account_in_globals : + IsInGlobals globals "destroy_account" (make_function destroy_account). + Definition destroy_storage : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "state"; "address" ] in @@ -399,6 +423,9 @@ Definition destroy_storage : Value.t -> Value.t -> M := )) |) in M.pure Constant.None_)). +Axiom destroy_storage_in_globals : + IsInGlobals globals "destroy_storage" (make_function destroy_storage). + Definition mark_account_created : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "state"; "address" ] in @@ -428,6 +455,9 @@ Definition mark_account_created : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom mark_account_created_in_globals : + IsInGlobals globals "mark_account_created" (make_function mark_account_created). + Definition get_storage : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "state"; "address"; "key" ] in @@ -507,6 +537,9 @@ Definition get_storage : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom get_storage_in_globals : + IsInGlobals globals "get_storage" (make_function get_storage). + Definition set_storage : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "state"; "address"; "key"; "value" ] in @@ -605,6 +638,9 @@ Definition set_storage : Value.t -> Value.t -> M := )) |) in M.pure Constant.None_)). +Axiom set_storage_in_globals : + IsInGlobals globals "set_storage" (make_function set_storage). + Definition storage_root : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "state"; "address" ] in @@ -656,6 +692,9 @@ Definition storage_root : Value.t -> Value.t -> M := )) |) in M.pure Constant.None_)). +Axiom storage_root_in_globals : + IsInGlobals globals "storage_root" (make_function storage_root). + Definition state_root : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "state" ] in @@ -686,6 +725,9 @@ Definition state_root : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom state_root_in_globals : + IsInGlobals globals "state_root" (make_function state_root). + Definition account_exists : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "state"; "address" ] in @@ -720,6 +762,9 @@ Definition account_exists : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom account_exists_in_globals : + IsInGlobals globals "account_exists" (make_function account_exists). + Definition account_has_code_or_nonce : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "state"; "address" ] in @@ -773,6 +818,9 @@ Definition account_has_code_or_nonce : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom account_has_code_or_nonce_in_globals : + IsInGlobals globals "account_has_code_or_nonce" (make_function account_has_code_or_nonce). + Definition is_account_empty : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "state"; "address" ] in @@ -834,6 +882,9 @@ Definition is_account_empty : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom is_account_empty_in_globals : + IsInGlobals globals "is_account_empty" (make_function is_account_empty). + Definition account_exists_and_is_empty : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "state"; "address" ] in @@ -904,6 +955,9 @@ Definition account_exists_and_is_empty : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom account_exists_and_is_empty_in_globals : + IsInGlobals globals "account_exists_and_is_empty" (make_function account_exists_and_is_empty). + Definition is_account_alive : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "state"; "address" ] in @@ -981,6 +1035,9 @@ Definition is_account_alive : Value.t -> Value.t -> M := )) |) in M.pure Constant.None_)). +Axiom is_account_alive_in_globals : + IsInGlobals globals "is_account_alive" (make_function is_account_alive). + Definition modify_state : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "state"; "address"; "f" ] in @@ -1013,6 +1070,9 @@ Definition modify_state : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom modify_state_in_globals : + IsInGlobals globals "modify_state" (make_function modify_state). + Definition move_ether : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "state"; "sender_address"; "recipient_address"; "amount" ] in @@ -1042,6 +1102,9 @@ Definition move_ether : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom move_ether_in_globals : + IsInGlobals globals "move_ether" (make_function move_ether). + Definition set_account_balance : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "state"; "address"; "amount" ] in @@ -1072,6 +1135,9 @@ Definition set_account_balance : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom set_account_balance_in_globals : + IsInGlobals globals "set_account_balance" (make_function set_account_balance). + Definition touch_account : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "state"; "address" ] in @@ -1116,6 +1182,9 @@ Definition touch_account : Value.t -> Value.t -> M := )) |) in M.pure Constant.None_)). +Axiom touch_account_in_globals : + IsInGlobals globals "touch_account" (make_function touch_account). + Definition increment_nonce : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "state"; "address" ] in @@ -1143,6 +1212,9 @@ Definition increment_nonce : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom increment_nonce_in_globals : + IsInGlobals globals "increment_nonce" (make_function increment_nonce). + Definition set_code : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "state"; "address"; "code" ] in @@ -1173,6 +1245,9 @@ Definition set_code : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom set_code_in_globals : + IsInGlobals globals "set_code" (make_function set_code). + Definition get_storage_original : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "state"; "address"; "key" ] in @@ -1278,3 +1353,6 @@ Definition get_storage_original : Value.t -> Value.t -> M := M.get_name (| globals, locals_stack, "original_value" |) |) in M.pure Constant.None_)). + +Axiom get_storage_original_in_globals : + IsInGlobals globals "get_storage_original" (make_function get_storage_original). diff --git a/CoqOfPython/ethereum/paris/transactions.v b/CoqOfPython/ethereum/paris/transactions.v index dd65a12..bd79adc 100644 --- a/CoqOfPython/ethereum/paris/transactions.v +++ b/CoqOfPython/ethereum/paris/transactions.v @@ -201,6 +201,9 @@ Definition encode_transaction : Value.t -> Value.t -> M := )) |) in M.pure Constant.None_)). +Axiom encode_transaction_in_globals : + IsInGlobals globals "encode_transaction" (make_function encode_transaction). + Definition decode_transaction : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "tx" ] in @@ -295,3 +298,6 @@ Definition decode_transaction : Value.t -> Value.t -> M := M.pure Constant.None_ )) |) in M.pure Constant.None_)). + +Axiom decode_transaction_in_globals : + IsInGlobals globals "decode_transaction" (make_function decode_transaction). diff --git a/CoqOfPython/ethereum/paris/trie.v b/CoqOfPython/ethereum/paris/trie.v index 7f7d685..3366830 100644 --- a/CoqOfPython/ethereum/paris/trie.v +++ b/CoqOfPython/ethereum/paris/trie.v @@ -371,6 +371,9 @@ Definition encode_internal_node : Value.t -> Value.t -> M := )) |) in M.pure Constant.None_)). +Axiom encode_internal_node_in_globals : + IsInGlobals globals "encode_internal_node" (make_function encode_internal_node). + Definition encode_node : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "node"; "storage_root" ] in @@ -479,6 +482,9 @@ Definition encode_node : Value.t -> Value.t -> M := )) |) in M.pure Constant.None_)). +Axiom encode_node_in_globals : + IsInGlobals globals "encode_node" (make_function encode_node). + Definition Trie : Value.t := builtins.make_klass [(* At base: unsupported node type: Subscript *)] @@ -526,6 +532,9 @@ Definition copy_trie : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom copy_trie_in_globals : + IsInGlobals globals "copy_trie" (make_function copy_trie). + Definition trie_set : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "trie"; "key"; "value" ] in @@ -586,6 +595,9 @@ Definition trie_set : Value.t -> Value.t -> M := )) |) in M.pure Constant.None_)). +Axiom trie_set_in_globals : + IsInGlobals globals "trie_set" (make_function trie_set). + Definition trie_get : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "trie"; "key" ] in @@ -619,6 +631,9 @@ Definition trie_get : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom trie_get_in_globals : + IsInGlobals globals "trie_get" (make_function trie_get). + Definition common_prefix_length : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "a"; "b" ] in @@ -697,6 +712,9 @@ Definition common_prefix_length : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom common_prefix_length_in_globals : + IsInGlobals globals "common_prefix_length" (make_function common_prefix_length). + Definition nibble_list_to_compact : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "x"; "is_leaf" ] in @@ -905,6 +923,9 @@ Definition nibble_list_to_compact : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom nibble_list_to_compact_in_globals : + IsInGlobals globals "nibble_list_to_compact" (make_function nibble_list_to_compact). + Definition bytes_to_nibble_list : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "bytes_" ] in @@ -1001,6 +1022,9 @@ Definition bytes_to_nibble_list : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom bytes_to_nibble_list_in_globals : + IsInGlobals globals "bytes_to_nibble_list" (make_function bytes_to_nibble_list). + Definition _prepare_trie : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "trie"; "get_storage_root" ] in @@ -1152,6 +1176,9 @@ Definition _prepare_trie : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom _prepare_trie_in_globals : + IsInGlobals globals "_prepare_trie" (make_function _prepare_trie). + Definition root : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "trie"; "get_storage_root" ] in @@ -1267,6 +1294,9 @@ Definition root : Value.t -> Value.t -> M := )) |) in M.pure Constant.None_)). +Axiom root_in_globals : + IsInGlobals globals "root" (make_function root). + Definition patricialize : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "obj"; "level" ] in @@ -1606,3 +1636,6 @@ Definition patricialize : Value.t -> Value.t -> M := |) |) in M.pure Constant.None_)). + +Axiom patricialize_in_globals : + IsInGlobals globals "patricialize" (make_function patricialize). diff --git a/CoqOfPython/ethereum/paris/utils/address.v b/CoqOfPython/ethereum/paris/utils/address.v index c397529..e95a366 100644 --- a/CoqOfPython/ethereum/paris/utils/address.v +++ b/CoqOfPython/ethereum/paris/utils/address.v @@ -79,6 +79,9 @@ Definition to_address : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom to_address_in_globals : + IsInGlobals globals "to_address" (make_function to_address). + Definition compute_contract_address : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "address"; "nonce" ] in @@ -149,6 +152,9 @@ Definition compute_contract_address : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom compute_contract_address_in_globals : + IsInGlobals globals "compute_contract_address" (make_function compute_contract_address). + Definition compute_create2_contract_address : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "address"; "salt"; "call_data" ] in @@ -230,3 +236,6 @@ Definition compute_create2_contract_address : Value.t -> Value.t -> M := |) |) in M.pure Constant.None_)). + +Axiom compute_create2_contract_address_in_globals : + IsInGlobals globals "compute_create2_contract_address" (make_function compute_create2_contract_address). diff --git a/CoqOfPython/ethereum/paris/utils/hexadecimal.v b/CoqOfPython/ethereum/paris/utils/hexadecimal.v index 2d6e655..6e8d277 100644 --- a/CoqOfPython/ethereum/paris/utils/hexadecimal.v +++ b/CoqOfPython/ethereum/paris/utils/hexadecimal.v @@ -70,6 +70,9 @@ Definition hex_to_root : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom hex_to_root_in_globals : + IsInGlobals globals "hex_to_root" (make_function hex_to_root). + Definition hex_to_bloom : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "hex_string" ] in @@ -110,6 +113,9 @@ Definition hex_to_bloom : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom hex_to_bloom_in_globals : + IsInGlobals globals "hex_to_bloom" (make_function hex_to_bloom). + Definition hex_to_address : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "hex_string" ] in @@ -156,3 +162,6 @@ Definition hex_to_address : Value.t -> Value.t -> M := |) |) in M.pure Constant.None_)). + +Axiom hex_to_address_in_globals : + IsInGlobals globals "hex_to_address" (make_function hex_to_address). diff --git a/CoqOfPython/ethereum/paris/utils/message.v b/CoqOfPython/ethereum/paris/utils/message.v index 7260c46..d83b15a 100644 --- a/CoqOfPython/ethereum/paris/utils/message.v +++ b/CoqOfPython/ethereum/paris/utils/message.v @@ -267,3 +267,6 @@ Definition prepare_message : Value.t -> Value.t -> M := |) |) in M.pure Constant.None_)). + +Axiom prepare_message_in_globals : + IsInGlobals globals "prepare_message" (make_function prepare_message). diff --git a/CoqOfPython/ethereum/paris/vm/__init__.v b/CoqOfPython/ethereum/paris/vm/__init__.v index eb698f5..5c7b2c3 100644 --- a/CoqOfPython/ethereum/paris/vm/__init__.v +++ b/CoqOfPython/ethereum/paris/vm/__init__.v @@ -182,6 +182,9 @@ Definition incorporate_child_on_success : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom incorporate_child_on_success_in_globals : + IsInGlobals globals "incorporate_child_on_success" (make_function incorporate_child_on_success). + Definition incorporate_child_on_error : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm"; "child_evm" ] in @@ -262,3 +265,6 @@ Definition incorporate_child_on_error : Value.t -> Value.t -> M := M.get_field (| M.get_name (| globals, locals_stack, "child_evm" |), "gas_left" |) |) in M.pure Constant.None_)). + +Axiom incorporate_child_on_error_in_globals : + IsInGlobals globals "incorporate_child_on_error" (make_function incorporate_child_on_error). diff --git a/CoqOfPython/ethereum/paris/vm/gas.v b/CoqOfPython/ethereum/paris/vm/gas.v index a43a94d..b900f56 100644 --- a/CoqOfPython/ethereum/paris/vm/gas.v +++ b/CoqOfPython/ethereum/paris/vm/gas.v @@ -523,6 +523,9 @@ Definition charge_gas : Value.t -> Value.t -> M := )) |) in M.pure Constant.None_)). +Axiom charge_gas_in_globals : + IsInGlobals globals "charge_gas" (make_function charge_gas). + Definition calculate_memory_gas_cost : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "size_in_bytes" ] in @@ -582,6 +585,9 @@ Definition calculate_memory_gas_cost : Value.t -> Value.t -> M := (* At stmt: unsupported node type: Try *) M.pure Constant.None_)). +Axiom calculate_memory_gas_cost_in_globals : + IsInGlobals globals "calculate_memory_gas_cost" (make_function calculate_memory_gas_cost). + Definition calculate_gas_extend_memory : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "memory"; "extensions" ] in @@ -765,6 +771,9 @@ Definition calculate_gas_extend_memory : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom calculate_gas_extend_memory_in_globals : + IsInGlobals globals "calculate_gas_extend_memory" (make_function calculate_gas_extend_memory). + Definition calculate_message_call_gas : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "value"; "gas"; "gas_left"; "memory_cost"; "extra_gas"; "call_stipend" ] in @@ -890,6 +899,9 @@ M.get_name (| globals, locals_stack, "call_stipend" |) |) in M.pure Constant.None_)). +Axiom calculate_message_call_gas_in_globals : + IsInGlobals globals "calculate_message_call_gas" (make_function calculate_message_call_gas). + Definition max_message_call_gas : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "gas" ] in @@ -917,3 +929,6 @@ Definition max_message_call_gas : Value.t -> Value.t -> M := |) |) in M.pure Constant.None_)). + +Axiom max_message_call_gas_in_globals : + IsInGlobals globals "max_message_call_gas" (make_function max_message_call_gas). diff --git a/CoqOfPython/ethereum/paris/vm/instructions/arithmetic.v b/CoqOfPython/ethereum/paris/vm/instructions/arithmetic.v index bac5812..fc04fdf 100644 --- a/CoqOfPython/ethereum/paris/vm/instructions/arithmetic.v +++ b/CoqOfPython/ethereum/paris/vm/instructions/arithmetic.v @@ -119,6 +119,9 @@ Definition add : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom add_in_globals : + IsInGlobals globals "add" (make_function add). + Definition sub : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -186,6 +189,9 @@ Definition sub : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom sub_in_globals : + IsInGlobals globals "sub" (make_function sub). + Definition mul : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -253,6 +259,9 @@ Definition mul : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom mul_in_globals : + IsInGlobals globals "mul" (make_function mul). + Definition div : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -341,6 +350,9 @@ Definition div : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom div_in_globals : + IsInGlobals globals "div" (make_function div). + Definition sdiv : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -491,6 +503,9 @@ Definition sdiv : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom sdiv_in_globals : + IsInGlobals globals "sdiv" (make_function sdiv). + Definition mod_ : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -579,6 +594,9 @@ Definition mod_ : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom mod__in_globals : + IsInGlobals globals "mod" (make_function mod_). + Definition smod : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -696,6 +714,9 @@ Definition smod : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom smod_in_globals : + IsInGlobals globals "smod" (make_function smod). + Definition addmod : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -821,6 +842,9 @@ Definition addmod : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom addmod_in_globals : + IsInGlobals globals "addmod" (make_function addmod). + Definition mulmod : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -946,6 +970,9 @@ Definition mulmod : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom mulmod_in_globals : + IsInGlobals globals "mulmod" (make_function mulmod). + Definition exp : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -1057,6 +1084,9 @@ Definition exp : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom exp_in_globals : + IsInGlobals globals "exp" (make_function exp). + Definition signextend : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -1231,3 +1261,6 @@ Definition signextend : Value.t -> Value.t -> M := Constant.int 1 |) in M.pure Constant.None_)). + +Axiom signextend_in_globals : + IsInGlobals globals "signextend" (make_function signextend). diff --git a/CoqOfPython/ethereum/paris/vm/instructions/bitwise.v b/CoqOfPython/ethereum/paris/vm/instructions/bitwise.v index 929ae9e..f22415d 100644 --- a/CoqOfPython/ethereum/paris/vm/instructions/bitwise.v +++ b/CoqOfPython/ethereum/paris/vm/instructions/bitwise.v @@ -97,6 +97,9 @@ Definition bitwise_and : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom bitwise_and_in_globals : + IsInGlobals globals "bitwise_and" (make_function bitwise_and). + Definition bitwise_or : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -157,6 +160,9 @@ Definition bitwise_or : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom bitwise_or_in_globals : + IsInGlobals globals "bitwise_or" (make_function bitwise_or). + Definition bitwise_xor : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -217,6 +223,9 @@ Definition bitwise_xor : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom bitwise_xor_in_globals : + IsInGlobals globals "bitwise_xor" (make_function bitwise_xor). + Definition bitwise_not : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -264,6 +273,9 @@ Definition bitwise_not : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom bitwise_not_in_globals : + IsInGlobals globals "bitwise_not" (make_function bitwise_not). + Definition get_byte : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -380,6 +392,9 @@ Definition get_byte : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom get_byte_in_globals : + IsInGlobals globals "get_byte" (make_function get_byte). + Definition bitwise_shl : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -475,6 +490,9 @@ Definition bitwise_shl : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom bitwise_shl_in_globals : + IsInGlobals globals "bitwise_shl" (make_function bitwise_shl). + Definition bitwise_shr : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -561,6 +579,9 @@ Definition bitwise_shr : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom bitwise_shr_in_globals : + IsInGlobals globals "bitwise_shr" (make_function bitwise_shr). + Definition bitwise_sar : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -674,3 +695,6 @@ Definition bitwise_sar : Value.t -> Value.t -> M := Constant.int 1 |) in M.pure Constant.None_)). + +Axiom bitwise_sar_in_globals : + IsInGlobals globals "bitwise_sar" (make_function bitwise_sar). diff --git a/CoqOfPython/ethereum/paris/vm/instructions/block.v b/CoqOfPython/ethereum/paris/vm/instructions/block.v index e351ba7..9623782 100644 --- a/CoqOfPython/ethereum/paris/vm/instructions/block.v +++ b/CoqOfPython/ethereum/paris/vm/instructions/block.v @@ -135,6 +135,9 @@ Definition block_hash : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom block_hash_in_globals : + IsInGlobals globals "block_hash" (make_function block_hash). + Definition coinbase : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -188,6 +191,9 @@ Definition coinbase : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom coinbase_in_globals : + IsInGlobals globals "coinbase" (make_function coinbase). + Definition timestamp : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -235,6 +241,9 @@ Definition timestamp : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom timestamp_in_globals : + IsInGlobals globals "timestamp" (make_function timestamp). + Definition number : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -287,6 +296,9 @@ Definition number : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom number_in_globals : + IsInGlobals globals "number" (make_function number). + Definition prev_randao : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -339,6 +351,9 @@ Definition prev_randao : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom prev_randao_in_globals : + IsInGlobals globals "prev_randao" (make_function prev_randao). + Definition gas_limit : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -391,6 +406,9 @@ Definition gas_limit : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom gas_limit_in_globals : + IsInGlobals globals "gas_limit" (make_function gas_limit). + Definition chain_id : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -439,3 +457,6 @@ Definition chain_id : Value.t -> Value.t -> M := Constant.int 1 |) in M.pure Constant.None_)). + +Axiom chain_id_in_globals : + IsInGlobals globals "chain_id" (make_function chain_id). diff --git a/CoqOfPython/ethereum/paris/vm/instructions/comparison.v b/CoqOfPython/ethereum/paris/vm/instructions/comparison.v index 6a1ee53..4336257 100644 --- a/CoqOfPython/ethereum/paris/vm/instructions/comparison.v +++ b/CoqOfPython/ethereum/paris/vm/instructions/comparison.v @@ -105,6 +105,9 @@ Definition less_than : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom less_than_in_globals : + IsInGlobals globals "less_than" (make_function less_than). + Definition signed_less_than : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -182,6 +185,9 @@ Definition signed_less_than : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom signed_less_than_in_globals : + IsInGlobals globals "signed_less_than" (make_function signed_less_than). + Definition greater_than : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -252,6 +258,9 @@ Definition greater_than : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom greater_than_in_globals : + IsInGlobals globals "greater_than" (make_function greater_than). + Definition signed_greater_than : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -329,6 +338,9 @@ Definition signed_greater_than : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom signed_greater_than_in_globals : + IsInGlobals globals "signed_greater_than" (make_function signed_greater_than). + Definition equal : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -399,6 +411,9 @@ Definition equal : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom equal_in_globals : + IsInGlobals globals "equal" (make_function equal). + Definition is_zero : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -458,3 +473,6 @@ Definition is_zero : Value.t -> Value.t -> M := Constant.int 1 |) in M.pure Constant.None_)). + +Axiom is_zero_in_globals : + IsInGlobals globals "is_zero" (make_function is_zero). diff --git a/CoqOfPython/ethereum/paris/vm/instructions/control_flow.v b/CoqOfPython/ethereum/paris/vm/instructions/control_flow.v index d3d5774..65e5510 100644 --- a/CoqOfPython/ethereum/paris/vm/instructions/control_flow.v +++ b/CoqOfPython/ethereum/paris/vm/instructions/control_flow.v @@ -71,6 +71,9 @@ Definition stop : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom stop_in_globals : + IsInGlobals globals "stop" (make_function stop). + Definition jump : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -136,6 +139,9 @@ Definition jump : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom jump_in_globals : + IsInGlobals globals "jump" (make_function jump). + Definition jumpi : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -237,6 +243,9 @@ Definition jumpi : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom jumpi_in_globals : + IsInGlobals globals "jumpi" (make_function jumpi). + Definition pc : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -281,6 +290,9 @@ Definition pc : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom pc_in_globals : + IsInGlobals globals "pc" (make_function pc). + Definition gas_left : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -325,6 +337,9 @@ Definition gas_left : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom gas_left_in_globals : + IsInGlobals globals "gas_left" (make_function gas_left). + Definition jumpdest : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -356,3 +371,6 @@ Definition jumpdest : Value.t -> Value.t -> M := Constant.int 1 |) in M.pure Constant.None_)). + +Axiom jumpdest_in_globals : + IsInGlobals globals "jumpdest" (make_function jumpdest). diff --git a/CoqOfPython/ethereum/paris/vm/instructions/environment.v b/CoqOfPython/ethereum/paris/vm/instructions/environment.v index fddea67..a8f141e 100644 --- a/CoqOfPython/ethereum/paris/vm/instructions/environment.v +++ b/CoqOfPython/ethereum/paris/vm/instructions/environment.v @@ -120,6 +120,9 @@ Definition address : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom address_in_globals : + IsInGlobals globals "address" (make_function address). + Definition balance : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -212,6 +215,9 @@ Definition balance : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom balance_in_globals : + IsInGlobals globals "balance" (make_function balance). + Definition origin : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -256,6 +262,9 @@ Definition origin : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom origin_in_globals : + IsInGlobals globals "origin" (make_function origin). + Definition caller : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -299,6 +308,9 @@ Definition caller : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom caller_in_globals : + IsInGlobals globals "caller" (make_function caller). + Definition callvalue : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -336,6 +348,9 @@ Definition callvalue : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom callvalue_in_globals : + IsInGlobals globals "callvalue" (make_function callvalue). + Definition calldataload : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -407,6 +422,9 @@ Definition calldataload : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom calldataload_in_globals : + IsInGlobals globals "calldataload" (make_function calldataload). + Definition calldatasize : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -456,6 +474,9 @@ Definition calldatasize : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom calldatasize_in_globals : + IsInGlobals globals "calldatasize" (make_function calldatasize). + Definition calldatacopy : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -591,6 +612,9 @@ Definition calldatacopy : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom calldatacopy_in_globals : + IsInGlobals globals "calldatacopy" (make_function calldatacopy). + Definition codesize : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -640,6 +664,9 @@ Definition codesize : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom codesize_in_globals : + IsInGlobals globals "codesize" (make_function codesize). + Definition codecopy : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -775,6 +802,9 @@ Definition codecopy : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom codecopy_in_globals : + IsInGlobals globals "codecopy" (make_function codecopy). + Definition gasprice : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -818,6 +848,9 @@ Definition gasprice : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom gasprice_in_globals : + IsInGlobals globals "gasprice" (make_function gasprice). + Definition extcodesize : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -922,6 +955,9 @@ Definition extcodesize : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom extcodesize_in_globals : + IsInGlobals globals "extcodesize" (make_function extcodesize). + Definition extcodecopy : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -1116,6 +1152,9 @@ Definition extcodecopy : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom extcodecopy_in_globals : + IsInGlobals globals "extcodecopy" (make_function extcodecopy). + Definition returndatasize : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -1164,6 +1203,9 @@ Definition returndatasize : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom returndatasize_in_globals : + IsInGlobals globals "returndatasize" (make_function returndatasize). + Definition returndatacopy : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -1327,6 +1369,9 @@ Definition returndatacopy : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom returndatacopy_in_globals : + IsInGlobals globals "returndatacopy" (make_function returndatacopy). + Definition extcodehash : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -1457,6 +1502,9 @@ Definition extcodehash : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom extcodehash_in_globals : + IsInGlobals globals "extcodehash" (make_function extcodehash). + Definition self_balance : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -1505,6 +1553,9 @@ Definition self_balance : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom self_balance_in_globals : + IsInGlobals globals "self_balance" (make_function self_balance). + Definition base_fee : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -1547,3 +1598,6 @@ Definition base_fee : Value.t -> Value.t -> M := Constant.int 1 |) in M.pure Constant.None_)). + +Axiom base_fee_in_globals : + IsInGlobals globals "base_fee" (make_function base_fee). diff --git a/CoqOfPython/ethereum/paris/vm/instructions/keccak.v b/CoqOfPython/ethereum/paris/vm/instructions/keccak.v index 03d7f72..503e0ca 100644 --- a/CoqOfPython/ethereum/paris/vm/instructions/keccak.v +++ b/CoqOfPython/ethereum/paris/vm/instructions/keccak.v @@ -189,3 +189,6 @@ Definition keccak : Value.t -> Value.t -> M := Constant.int 1 |) in M.pure Constant.None_)). + +Axiom keccak_in_globals : + IsInGlobals globals "keccak" (make_function keccak). diff --git a/CoqOfPython/ethereum/paris/vm/instructions/log.v b/CoqOfPython/ethereum/paris/vm/instructions/log.v index 025ff79..4b6aeec 100644 --- a/CoqOfPython/ethereum/paris/vm/instructions/log.v +++ b/CoqOfPython/ethereum/paris/vm/instructions/log.v @@ -208,6 +208,9 @@ Definition log_n : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom log_n_in_globals : + IsInGlobals globals "log_n" (make_function log_n). + Definition log0 : Value.t := M.run ltac:(M.monadic ( M.call (| M.get_name (| globals, locals_stack, "partial" |), diff --git a/CoqOfPython/ethereum/paris/vm/instructions/memory.v b/CoqOfPython/ethereum/paris/vm/instructions/memory.v index d54e1e1..3c3ec64 100644 --- a/CoqOfPython/ethereum/paris/vm/instructions/memory.v +++ b/CoqOfPython/ethereum/paris/vm/instructions/memory.v @@ -145,6 +145,9 @@ Definition mstore : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom mstore_in_globals : + IsInGlobals globals "mstore" (make_function mstore). + Definition mstore8 : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -249,6 +252,9 @@ Definition mstore8 : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom mstore8_in_globals : + IsInGlobals globals "mstore8" (make_function mstore8). + Definition mload : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -349,6 +355,9 @@ Definition mload : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom mload_in_globals : + IsInGlobals globals "mload" (make_function mload). + Definition msize : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -397,3 +406,6 @@ Definition msize : Value.t -> Value.t -> M := Constant.int 1 |) in M.pure Constant.None_)). + +Axiom msize_in_globals : + IsInGlobals globals "msize" (make_function msize). diff --git a/CoqOfPython/ethereum/paris/vm/instructions/proofs/arithmetic.v b/CoqOfPython/ethereum/paris/vm/instructions/proofs/arithmetic.v index bd9d4ee..053fffc 100644 --- a/CoqOfPython/ethereum/paris/vm/instructions/proofs/arithmetic.v +++ b/CoqOfPython/ethereum/paris/vm/instructions/proofs/arithmetic.v @@ -5,6 +5,7 @@ Require Import proofs.heap. Require ethereum.paris.vm.instructions.simulations.arithmetic. Require ethereum.paris.vm.instructions.arithmetic. +Require ethereum.paris.vm.stack. Require ethereum.simulations.base_types. Module U256 := base_types.U256. @@ -64,6 +65,10 @@ Proof. eapply Run.CallPrimitiveStateReadStack. { now erewrite Stack.read_length_eq. } { cbn. - admit. + eapply Run.CallPrimitiveGetInGlobals. + { apply arithmetic.ethereum_paris_vm_stack_imports_pop. + apply stack.pop_in_globals. + } + { admit. } } Admitted. diff --git a/CoqOfPython/ethereum/paris/vm/instructions/stack.v b/CoqOfPython/ethereum/paris/vm/instructions/stack.v index 02d0f18..01fe256 100644 --- a/CoqOfPython/ethereum/paris/vm/instructions/stack.v +++ b/CoqOfPython/ethereum/paris/vm/instructions/stack.v @@ -82,6 +82,9 @@ Definition pop : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom pop_in_globals : + IsInGlobals globals "pop" (make_function pop). + Definition push_n : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm"; "num_bytes" ] in @@ -159,6 +162,9 @@ Definition push_n : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom push_n_in_globals : + IsInGlobals globals "push_n" (make_function push_n). + Definition dup_n : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm"; "item_number" ] in @@ -236,6 +242,9 @@ Definition dup_n : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom dup_n_in_globals : + IsInGlobals globals "dup_n" (make_function dup_n). + Definition swap_n : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm"; "item_number" ] in @@ -312,6 +321,9 @@ Definition swap_n : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom swap_n_in_globals : + IsInGlobals globals "swap_n" (make_function swap_n). + Definition push1 : Value.t := M.run ltac:(M.monadic ( M.call (| M.get_name (| globals, locals_stack, "partial" |), diff --git a/CoqOfPython/ethereum/paris/vm/instructions/storage.v b/CoqOfPython/ethereum/paris/vm/instructions/storage.v index 0abe74e..917c30e 100644 --- a/CoqOfPython/ethereum/paris/vm/instructions/storage.v +++ b/CoqOfPython/ethereum/paris/vm/instructions/storage.v @@ -152,6 +152,9 @@ Definition sload : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom sload_in_globals : + IsInGlobals globals "sload" (make_function sload). + Definition sstore : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -493,3 +496,6 @@ Definition sstore : Value.t -> Value.t -> M := Constant.int 1 |) in M.pure Constant.None_)). + +Axiom sstore_in_globals : + IsInGlobals globals "sstore" (make_function sstore). diff --git a/CoqOfPython/ethereum/paris/vm/instructions/system.v b/CoqOfPython/ethereum/paris/vm/instructions/system.v index 42d8e78..a544734 100644 --- a/CoqOfPython/ethereum/paris/vm/instructions/system.v +++ b/CoqOfPython/ethereum/paris/vm/instructions/system.v @@ -383,6 +383,9 @@ Definition generic_create : Value.t -> Value.t -> M := )) |) in M.pure Constant.None_)). +Axiom generic_create_in_globals : + IsInGlobals globals "generic_create" (make_function generic_create). + Definition create : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -493,6 +496,9 @@ Definition create : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom create_in_globals : + IsInGlobals globals "create" (make_function create). + Definition create2 : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -647,6 +653,9 @@ Definition create2 : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom create2_in_globals : + IsInGlobals globals "create2" (make_function create2). + Definition return_ : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -730,6 +739,9 @@ Definition return_ : Value.t -> Value.t -> M := let _ := M.pass (| |) in M.pure Constant.None_)). +Axiom return__in_globals : + IsInGlobals globals "return_" (make_function return_). + Definition generic_call : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm"; "gas"; "value"; "caller"; "to"; "code_address"; "should_transfer_value"; "is_staticcall"; "memory_input_start_position"; "memory_input_size"; "memory_output_start_position"; "memory_output_size" ] in @@ -925,6 +937,9 @@ Definition generic_call : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom generic_call_in_globals : + IsInGlobals globals "generic_call" (make_function generic_call). + Definition call : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -1258,6 +1273,9 @@ M.get_name (| globals, locals_stack, "GAS_CALL_VALUE" |) |) in M.pure Constant.None_)). +Axiom call_in_globals : + IsInGlobals globals "call" (make_function call). + Definition callcode : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -1536,6 +1554,9 @@ M.get_name (| globals, locals_stack, "GAS_CALL_VALUE" |) |) in M.pure Constant.None_)). +Axiom callcode_in_globals : + IsInGlobals globals "callcode" (make_function callcode). + Definition selfdestruct : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -1740,6 +1761,9 @@ Definition selfdestruct : Value.t -> Value.t -> M := let _ := M.pass (| |) in M.pure Constant.None_)). +Axiom selfdestruct_in_globals : + IsInGlobals globals "selfdestruct" (make_function selfdestruct). + Definition delegatecall : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -1937,6 +1961,9 @@ Definition delegatecall : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom delegatecall_in_globals : + IsInGlobals globals "delegatecall" (make_function delegatecall). + Definition staticcall : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -2140,6 +2167,9 @@ Definition staticcall : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom staticcall_in_globals : + IsInGlobals globals "staticcall" (make_function staticcall). + Definition revert : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -2226,3 +2256,6 @@ Definition revert : Value.t -> Value.t -> M := let _ := M.raise (| Some (M.get_name (| globals, locals_stack, "Revert" |)) |) in let _ := M.pass (| |) in M.pure Constant.None_)). + +Axiom revert_in_globals : + IsInGlobals globals "revert" (make_function revert). diff --git a/CoqOfPython/ethereum/paris/vm/interpreter.v b/CoqOfPython/ethereum/paris/vm/interpreter.v index 57a5930..77362be 100644 --- a/CoqOfPython/ethereum/paris/vm/interpreter.v +++ b/CoqOfPython/ethereum/paris/vm/interpreter.v @@ -408,6 +408,9 @@ Definition process_message_call : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom process_message_call_in_globals : + IsInGlobals globals "process_message_call" (make_function process_message_call). + Definition process_create_message : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "message"; "env" ] in @@ -510,6 +513,9 @@ Definition process_create_message : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom process_create_message_in_globals : + IsInGlobals globals "process_create_message" (make_function process_create_message). + Definition process_message : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "message"; "env" ] in @@ -635,6 +641,9 @@ Definition process_message : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom process_message_in_globals : + IsInGlobals globals "process_message" (make_function process_message). + Definition execute_code : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "message"; "env" ] in @@ -681,3 +690,6 @@ Definition execute_code : Value.t -> Value.t -> M := M.get_name (| globals, locals_stack, "evm" |) |) in M.pure Constant.None_)). + +Axiom execute_code_in_globals : + IsInGlobals globals "execute_code" (make_function execute_code). diff --git a/CoqOfPython/ethereum/paris/vm/memory.v b/CoqOfPython/ethereum/paris/vm/memory.v index 5ebc425..35a81df 100644 --- a/CoqOfPython/ethereum/paris/vm/memory.v +++ b/CoqOfPython/ethereum/paris/vm/memory.v @@ -71,6 +71,9 @@ Definition memory_write : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom memory_write_in_globals : + IsInGlobals globals "memory_write" (make_function memory_write). + Definition memory_read_bytes : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "memory"; "start_position"; "size" ] in @@ -117,6 +120,9 @@ Definition memory_read_bytes : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom memory_read_bytes_in_globals : + IsInGlobals globals "memory_read_bytes" (make_function memory_read_bytes). + Definition buffer_read : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "buffer"; "start_position"; "size" ] in @@ -169,3 +175,6 @@ Definition buffer_read : Value.t -> Value.t -> M := |) |) in M.pure Constant.None_)). + +Axiom buffer_read_in_globals : + IsInGlobals globals "buffer_read" (make_function buffer_read). diff --git a/CoqOfPython/ethereum/paris/vm/precompiled_contracts/alt_bn128.v b/CoqOfPython/ethereum/paris/vm/precompiled_contracts/alt_bn128.v index 37c3636..60bdf74 100644 --- a/CoqOfPython/ethereum/paris/vm/precompiled_contracts/alt_bn128.v +++ b/CoqOfPython/ethereum/paris/vm/precompiled_contracts/alt_bn128.v @@ -273,6 +273,9 @@ Definition alt_bn128_add : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom alt_bn128_add_in_globals : + IsInGlobals globals "alt_bn128_add" (make_function alt_bn128_add). + Definition alt_bn128_mul : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -455,6 +458,9 @@ Definition alt_bn128_mul : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom alt_bn128_mul_in_globals : + IsInGlobals globals "alt_bn128_mul" (make_function alt_bn128_mul). + Definition alt_bn128_pairing_check : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -781,3 +787,6 @@ Definition alt_bn128_pairing_check : Value.t -> Value.t -> M := M.pure Constant.None_ )) |) in M.pure Constant.None_)). + +Axiom alt_bn128_pairing_check_in_globals : + IsInGlobals globals "alt_bn128_pairing_check" (make_function alt_bn128_pairing_check). diff --git a/CoqOfPython/ethereum/paris/vm/precompiled_contracts/blake2f.v b/CoqOfPython/ethereum/paris/vm/precompiled_contracts/blake2f.v index a565bf1..55830a7 100644 --- a/CoqOfPython/ethereum/paris/vm/precompiled_contracts/blake2f.v +++ b/CoqOfPython/ethereum/paris/vm/precompiled_contracts/blake2f.v @@ -128,3 +128,6 @@ Definition blake2f : Value.t -> Value.t -> M := |) |) in M.pure Constant.None_)). + +Axiom blake2f_in_globals : + IsInGlobals globals "blake2f" (make_function blake2f). diff --git a/CoqOfPython/ethereum/paris/vm/precompiled_contracts/ecrecover.v b/CoqOfPython/ethereum/paris/vm/precompiled_contracts/ecrecover.v index 4ff4a3c..2484a2c 100644 --- a/CoqOfPython/ethereum/paris/vm/precompiled_contracts/ecrecover.v +++ b/CoqOfPython/ethereum/paris/vm/precompiled_contracts/ecrecover.v @@ -302,3 +302,6 @@ Definition ecrecover : Value.t -> Value.t -> M := M.get_name (| globals, locals_stack, "padded_address" |) |) in M.pure Constant.None_)). + +Axiom ecrecover_in_globals : + IsInGlobals globals "ecrecover" (make_function ecrecover). diff --git a/CoqOfPython/ethereum/paris/vm/precompiled_contracts/identity.v b/CoqOfPython/ethereum/paris/vm/precompiled_contracts/identity.v index fec619f..011de7a 100644 --- a/CoqOfPython/ethereum/paris/vm/precompiled_contracts/identity.v +++ b/CoqOfPython/ethereum/paris/vm/precompiled_contracts/identity.v @@ -95,3 +95,6 @@ Definition identity : Value.t -> Value.t -> M := M.get_name (| globals, locals_stack, "data" |) |) in M.pure Constant.None_)). + +Axiom identity_in_globals : + IsInGlobals globals "identity" (make_function identity). diff --git a/CoqOfPython/ethereum/paris/vm/precompiled_contracts/modexp.v b/CoqOfPython/ethereum/paris/vm/precompiled_contracts/modexp.v index b7ef5f2..b3a59fd 100644 --- a/CoqOfPython/ethereum/paris/vm/precompiled_contracts/modexp.v +++ b/CoqOfPython/ethereum/paris/vm/precompiled_contracts/modexp.v @@ -356,6 +356,9 @@ Definition modexp : Value.t -> Value.t -> M := )) |) in M.pure Constant.None_)). +Axiom modexp_in_globals : + IsInGlobals globals "modexp" (make_function modexp). + Definition complexity : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "base_length"; "modulus_length" ] in @@ -419,6 +422,9 @@ Definition complexity : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom complexity_in_globals : + IsInGlobals globals "complexity" (make_function complexity). + Definition iterations : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "exponent_length"; "exponent_head" ] in @@ -600,6 +606,9 @@ Definition iterations : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom iterations_in_globals : + IsInGlobals globals "iterations" (make_function iterations). + Definition gas_cost : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "base_length"; "modulus_length"; "exponent_length"; "exponent_head" ] in @@ -680,3 +689,6 @@ Definition gas_cost : Value.t -> Value.t -> M := |) |) in M.pure Constant.None_)). + +Axiom gas_cost_in_globals : + IsInGlobals globals "gas_cost" (make_function gas_cost). diff --git a/CoqOfPython/ethereum/paris/vm/precompiled_contracts/ripemd160.v b/CoqOfPython/ethereum/paris/vm/precompiled_contracts/ripemd160.v index b5edc19..38b14b7 100644 --- a/CoqOfPython/ethereum/paris/vm/precompiled_contracts/ripemd160.v +++ b/CoqOfPython/ethereum/paris/vm/precompiled_contracts/ripemd160.v @@ -126,3 +126,6 @@ Definition ripemd160 : Value.t -> Value.t -> M := M.get_name (| globals, locals_stack, "padded_hash" |) |) in M.pure Constant.None_)). + +Axiom ripemd160_in_globals : + IsInGlobals globals "ripemd160" (make_function ripemd160). diff --git a/CoqOfPython/ethereum/paris/vm/precompiled_contracts/sha256.v b/CoqOfPython/ethereum/paris/vm/precompiled_contracts/sha256.v index 33c4215..baa41bf 100644 --- a/CoqOfPython/ethereum/paris/vm/precompiled_contracts/sha256.v +++ b/CoqOfPython/ethereum/paris/vm/precompiled_contracts/sha256.v @@ -107,3 +107,6 @@ Definition sha256 : Value.t -> Value.t -> M := |) |) in M.pure Constant.None_)). + +Axiom sha256_in_globals : + IsInGlobals globals "sha256" (make_function sha256). diff --git a/CoqOfPython/ethereum/paris/vm/proofs/stack.v b/CoqOfPython/ethereum/paris/vm/proofs/stack.v new file mode 100644 index 0000000..cb12120 --- /dev/null +++ b/CoqOfPython/ethereum/paris/vm/proofs/stack.v @@ -0,0 +1,33 @@ +Require Import CoqOfPython.CoqOfPython. +Require Import proofs.CoqOfPython. +Require Import simulations.CoqOfPython. +Require Import proofs.heap. + +Require ethereum.paris.vm.simulations.stack. +Require ethereum.paris.vm.stack. + +Require ethereum.paris.vm.simulations.__init__. +Module Evm := __init__.Evm. + +Import Run. + +Lemma run_pop (stack : Stack.t) (heap : Heap.t) : + let '(result, evm') := + StateError.lift_lens Evm.Lens.stack simulations.stack.pop heap.(Heap.evm) in + let result := + match result with + | inl s' => inl Constant.None_ + | inr exn => inr (Exception.Raise (Some Constant.None_)) + end in + let heap' := heap <| Heap.evm := evm' |> in + exists fresh_stack, + {{ stack, heap | + stack.pop (make_list []) (make_dict []) ⇓ + result + | stack ++ fresh_stack, heap' }}. +Proof. + destruct StateError.lift_lens as [result evm'] eqn:?. + unfold stack.pop, simulations.stack.pop in *. + cbn in *. + eexists. +Admitted. diff --git a/CoqOfPython/ethereum/paris/vm/runtime.v b/CoqOfPython/ethereum/paris/vm/runtime.v index d53167e..6a7faa3 100644 --- a/CoqOfPython/ethereum/paris/vm/runtime.v +++ b/CoqOfPython/ethereum/paris/vm/runtime.v @@ -158,3 +158,6 @@ Definition get_valid_jump_destinations : Value.t -> Value.t -> M := M.get_name (| globals, locals_stack, "valid_jump_destinations" |) |) in M.pure Constant.None_)). + +Axiom get_valid_jump_destinations_in_globals : + IsInGlobals globals "get_valid_jump_destinations" (make_function get_valid_jump_destinations). diff --git a/CoqOfPython/ethereum/paris/vm/stack.v b/CoqOfPython/ethereum/paris/vm/stack.v index fc25118..de85d0f 100644 --- a/CoqOfPython/ethereum/paris/vm/stack.v +++ b/CoqOfPython/ethereum/paris/vm/stack.v @@ -78,6 +78,9 @@ Definition pop : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom pop_in_globals : + IsInGlobals globals "pop" (make_function pop). + Definition push : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "stack"; "value" ] in @@ -125,3 +128,6 @@ Definition push : Value.t -> Value.t -> M := |) |) in M.pure Constant.None_)). + +Axiom push_in_globals : + IsInGlobals globals "push" (make_function push). diff --git a/CoqOfPython/ethereum/rlp.v b/CoqOfPython/ethereum/rlp.v index 3a9bf15..2c81b45 100644 --- a/CoqOfPython/ethereum/rlp.v +++ b/CoqOfPython/ethereum/rlp.v @@ -309,6 +309,9 @@ Definition encode : Value.t -> Value.t -> M := )) |) in M.pure Constant.None_)). +Axiom encode_in_globals : + IsInGlobals globals "encode" (make_function encode). + Definition encode_bytes : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "raw_bytes" ] in @@ -437,6 +440,9 @@ Definition encode_bytes : Value.t -> Value.t -> M := )) |) in M.pure Constant.None_)). +Axiom encode_bytes_in_globals : + IsInGlobals globals "encode_bytes" (make_function encode_bytes). + Definition encode_sequence : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "raw_sequence" ] in @@ -547,6 +553,9 @@ Definition encode_sequence : Value.t -> Value.t -> M := )) |) in M.pure Constant.None_)). +Axiom encode_sequence_in_globals : + IsInGlobals globals "encode_sequence" (make_function encode_sequence). + Definition get_joined_encodings : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "raw_sequence" ] in @@ -577,6 +586,9 @@ Definition get_joined_encodings : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom get_joined_encodings_in_globals : + IsInGlobals globals "get_joined_encodings" (make_function get_joined_encodings). + Definition decode : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "encoded_data" ] in @@ -655,6 +667,9 @@ Definition decode : Value.t -> Value.t -> M := )) |) in M.pure Constant.None_)). +Axiom decode_in_globals : + IsInGlobals globals "decode" (make_function decode). + Definition T : Value.t := M.run ltac:(M.monadic ( M.call (| M.get_name (| globals, locals_stack, "TypeVar" |), @@ -703,6 +718,9 @@ Definition decode_to : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom decode_to_in_globals : + IsInGlobals globals "decode_to" (make_function decode_to). + Definition _decode_to : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "cls"; "raw_rlp" ] in @@ -1582,6 +1600,9 @@ Definition _decode_to : Value.t -> Value.t -> M := )) |) in M.pure Constant.None_)). +Axiom _decode_to_in_globals : + IsInGlobals globals "_decode_to" (make_function _decode_to). + Definition decode_to_bytes : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "encoded_bytes" ] in @@ -1825,6 +1846,9 @@ Definition decode_to_bytes : Value.t -> Value.t -> M := )) |) in M.pure Constant.None_)). +Axiom decode_to_bytes_in_globals : + IsInGlobals globals "decode_to_bytes" (make_function decode_to_bytes). + Definition decode_to_sequence : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "encoded_sequence" ] in @@ -2019,6 +2043,9 @@ Definition decode_to_sequence : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom decode_to_sequence_in_globals : + IsInGlobals globals "decode_to_sequence" (make_function decode_to_sequence). + Definition decode_joined_encodings : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "joined_encodings" ] in @@ -2137,6 +2164,9 @@ Definition decode_joined_encodings : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom decode_joined_encodings_in_globals : + IsInGlobals globals "decode_joined_encodings" (make_function decode_joined_encodings). + Definition decode_item_length : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "encoded_data" ] in @@ -2414,6 +2444,9 @@ Definition decode_item_length : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom decode_item_length_in_globals : + IsInGlobals globals "decode_item_length" (make_function decode_item_length). + Definition rlp_hash : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "data" ] in @@ -2447,3 +2480,6 @@ Definition rlp_hash : Value.t -> Value.t -> M := |) |) in M.pure Constant.None_)). + +Axiom rlp_hash_in_globals : + IsInGlobals globals "rlp_hash" (make_function rlp_hash). diff --git a/CoqOfPython/ethereum/shanghai/bloom.v b/CoqOfPython/ethereum/shanghai/bloom.v index 65cd312..f3e7346 100644 --- a/CoqOfPython/ethereum/shanghai/bloom.v +++ b/CoqOfPython/ethereum/shanghai/bloom.v @@ -140,6 +140,9 @@ Definition add_to_bloom : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom add_to_bloom_in_globals : + IsInGlobals globals "add_to_bloom" (make_function add_to_bloom). + Definition logs_bloom : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "logs" ] in @@ -209,3 +212,6 @@ Definition logs_bloom : Value.t -> Value.t -> M := |) |) in M.pure Constant.None_)). + +Axiom logs_bloom_in_globals : + IsInGlobals globals "logs_bloom" (make_function logs_bloom). diff --git a/CoqOfPython/ethereum/shanghai/fork.v b/CoqOfPython/ethereum/shanghai/fork.v index 1444e28..beccf17 100644 --- a/CoqOfPython/ethereum/shanghai/fork.v +++ b/CoqOfPython/ethereum/shanghai/fork.v @@ -217,6 +217,9 @@ Definition apply_fork : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom apply_fork_in_globals : + IsInGlobals globals "apply_fork" (make_function apply_fork). + Definition get_last_256_block_hashes : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "chain" ] in @@ -329,6 +332,9 @@ Definition get_last_256_block_hashes : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom get_last_256_block_hashes_in_globals : + IsInGlobals globals "get_last_256_block_hashes" (make_function get_last_256_block_hashes). + Definition state_transition : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "chain"; "block" ] in @@ -510,6 +516,9 @@ Definition state_transition : Value.t -> Value.t -> M := )) |) in M.pure Constant.None_)). +Axiom state_transition_in_globals : + IsInGlobals globals "state_transition" (make_function state_transition). + Definition calculate_base_fee_per_gas : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "block_gas_limit"; "parent_gas_limit"; "parent_gas_used"; "parent_base_fee_per_gas" ] in @@ -675,6 +684,9 @@ Definition calculate_base_fee_per_gas : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom calculate_base_fee_per_gas_in_globals : + IsInGlobals globals "calculate_base_fee_per_gas" (make_function calculate_base_fee_per_gas). + Definition validate_header : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "header"; "parent_header" ] in @@ -835,6 +847,9 @@ Definition validate_header : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom validate_header_in_globals : + IsInGlobals globals "validate_header" (make_function validate_header). + Definition check_transaction : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "tx"; "base_fee_per_gas"; "gas_available"; "chain_id" ] in @@ -968,6 +983,9 @@ Definition check_transaction : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom check_transaction_in_globals : + IsInGlobals globals "check_transaction" (make_function check_transaction). + Definition make_receipt : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "tx"; "error"; "cumulative_gas_used"; "logs" ] in @@ -1065,6 +1083,9 @@ Definition make_receipt : Value.t -> Value.t -> M := )) |) in M.pure Constant.None_)). +Axiom make_receipt_in_globals : + IsInGlobals globals "make_receipt" (make_function make_receipt). + Definition ApplyBodyOutput : Value.t := builtins.make_klass [] @@ -1396,6 +1417,9 @@ Definition apply_body : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom apply_body_in_globals : + IsInGlobals globals "apply_body" (make_function apply_body). + Definition process_transaction : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "env"; "tx" ] in @@ -1879,6 +1903,9 @@ Definition process_transaction : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom process_transaction_in_globals : + IsInGlobals globals "process_transaction" (make_function process_transaction). + Definition validate_transaction : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "tx" ] in @@ -1998,6 +2025,9 @@ Definition validate_transaction : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom validate_transaction_in_globals : + IsInGlobals globals "validate_transaction" (make_function validate_transaction). + Definition calculate_intrinsic_cost : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "tx" ] in @@ -2190,6 +2220,9 @@ Definition calculate_intrinsic_cost : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom calculate_intrinsic_cost_in_globals : + IsInGlobals globals "calculate_intrinsic_cost" (make_function calculate_intrinsic_cost). + Definition recover_sender : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "chain_id"; "tx" ] in @@ -2482,6 +2515,9 @@ Definition recover_sender : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom recover_sender_in_globals : + IsInGlobals globals "recover_sender" (make_function recover_sender). + Definition signing_hash_pre155 : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "tx" ] in @@ -2516,6 +2552,9 @@ Definition signing_hash_pre155 : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom signing_hash_pre155_in_globals : + IsInGlobals globals "signing_hash_pre155" (make_function signing_hash_pre155). + Definition signing_hash_155 : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "tx"; "chain_id" ] in @@ -2564,6 +2603,9 @@ Definition signing_hash_155 : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom signing_hash_155_in_globals : + IsInGlobals globals "signing_hash_155" (make_function signing_hash_155). + Definition signing_hash_2930 : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "tx" ] in @@ -2601,6 +2643,9 @@ Definition signing_hash_2930 : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom signing_hash_2930_in_globals : + IsInGlobals globals "signing_hash_2930" (make_function signing_hash_2930). + Definition signing_hash_1559 : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "tx" ] in @@ -2638,6 +2683,9 @@ Definition signing_hash_1559 : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom signing_hash_1559_in_globals : + IsInGlobals globals "signing_hash_1559" (make_function signing_hash_1559). + Definition compute_header_hash : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "header" ] in @@ -2690,6 +2738,9 @@ Definition compute_header_hash : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom compute_header_hash_in_globals : + IsInGlobals globals "compute_header_hash" (make_function compute_header_hash). + Definition check_gas_limit : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "gas_limit"; "parent_gas_limit" ] in @@ -2789,3 +2840,6 @@ Definition check_gas_limit : Value.t -> Value.t -> M := Constant.bool true |) in M.pure Constant.None_)). + +Axiom check_gas_limit_in_globals : + IsInGlobals globals "check_gas_limit" (make_function check_gas_limit). diff --git a/CoqOfPython/ethereum/shanghai/fork_types.v b/CoqOfPython/ethereum/shanghai/fork_types.v index e9b6291..79ab0bb 100644 --- a/CoqOfPython/ethereum/shanghai/fork_types.v +++ b/CoqOfPython/ethereum/shanghai/fork_types.v @@ -99,3 +99,6 @@ Definition encode_account : Value.t -> Value.t -> M := |) |) in M.pure Constant.None_)). + +Axiom encode_account_in_globals : + IsInGlobals globals "encode_account" (make_function encode_account). diff --git a/CoqOfPython/ethereum/shanghai/state.v b/CoqOfPython/ethereum/shanghai/state.v index 18226ab..2ff575b 100644 --- a/CoqOfPython/ethereum/shanghai/state.v +++ b/CoqOfPython/ethereum/shanghai/state.v @@ -103,6 +103,9 @@ Definition close_state : Value.t -> Value.t -> M := let _ := M.delete (| M.get_field (| M.get_name (| globals, locals_stack, "state" |), "_created_accounts" |) |) in M.pure Constant.None_)). +Axiom close_state_in_globals : + IsInGlobals globals "close_state" (make_function close_state). + Definition begin_transaction : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "state" ] in @@ -133,6 +136,9 @@ Definition begin_transaction : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom begin_transaction_in_globals : + IsInGlobals globals "begin_transaction" (make_function begin_transaction). + Definition commit_transaction : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "state" ] in @@ -168,6 +174,9 @@ Definition commit_transaction : Value.t -> Value.t -> M := )) |) in M.pure Constant.None_)). +Axiom commit_transaction_in_globals : + IsInGlobals globals "commit_transaction" (make_function commit_transaction). + Definition rollback_transaction : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "state" ] in @@ -207,6 +216,9 @@ Definition rollback_transaction : Value.t -> Value.t -> M := )) |) in M.pure Constant.None_)). +Axiom rollback_transaction_in_globals : + IsInGlobals globals "rollback_transaction" (make_function rollback_transaction). + Definition get_account : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "state"; "address" ] in @@ -267,6 +279,9 @@ Definition get_account : Value.t -> Value.t -> M := )) |) in M.pure Constant.None_)). +Axiom get_account_in_globals : + IsInGlobals globals "get_account" (make_function get_account). + Definition get_account_optional : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "state"; "address" ] in @@ -303,6 +318,9 @@ Definition get_account_optional : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom get_account_optional_in_globals : + IsInGlobals globals "get_account_optional" (make_function get_account_optional). + Definition set_account : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "state"; "address"; "account" ] in @@ -331,6 +349,9 @@ Definition set_account : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom set_account_in_globals : + IsInGlobals globals "set_account" (make_function set_account). + Definition destroy_account : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "state"; "address" ] in @@ -368,6 +389,9 @@ Definition destroy_account : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom destroy_account_in_globals : + IsInGlobals globals "destroy_account" (make_function destroy_account). + Definition destroy_storage : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "state"; "address" ] in @@ -402,6 +426,9 @@ Definition destroy_storage : Value.t -> Value.t -> M := )) |) in M.pure Constant.None_)). +Axiom destroy_storage_in_globals : + IsInGlobals globals "destroy_storage" (make_function destroy_storage). + Definition mark_account_created : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "state"; "address" ] in @@ -431,6 +458,9 @@ Definition mark_account_created : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom mark_account_created_in_globals : + IsInGlobals globals "mark_account_created" (make_function mark_account_created). + Definition get_storage : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "state"; "address"; "key" ] in @@ -510,6 +540,9 @@ Definition get_storage : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom get_storage_in_globals : + IsInGlobals globals "get_storage" (make_function get_storage). + Definition set_storage : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "state"; "address"; "key"; "value" ] in @@ -608,6 +641,9 @@ Definition set_storage : Value.t -> Value.t -> M := )) |) in M.pure Constant.None_)). +Axiom set_storage_in_globals : + IsInGlobals globals "set_storage" (make_function set_storage). + Definition storage_root : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "state"; "address" ] in @@ -659,6 +695,9 @@ Definition storage_root : Value.t -> Value.t -> M := )) |) in M.pure Constant.None_)). +Axiom storage_root_in_globals : + IsInGlobals globals "storage_root" (make_function storage_root). + Definition state_root : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "state" ] in @@ -689,6 +728,9 @@ Definition state_root : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom state_root_in_globals : + IsInGlobals globals "state_root" (make_function state_root). + Definition account_exists : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "state"; "address" ] in @@ -723,6 +765,9 @@ Definition account_exists : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom account_exists_in_globals : + IsInGlobals globals "account_exists" (make_function account_exists). + Definition account_has_code_or_nonce : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "state"; "address" ] in @@ -776,6 +821,9 @@ Definition account_has_code_or_nonce : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom account_has_code_or_nonce_in_globals : + IsInGlobals globals "account_has_code_or_nonce" (make_function account_has_code_or_nonce). + Definition is_account_empty : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "state"; "address" ] in @@ -837,6 +885,9 @@ Definition is_account_empty : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom is_account_empty_in_globals : + IsInGlobals globals "is_account_empty" (make_function is_account_empty). + Definition account_exists_and_is_empty : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "state"; "address" ] in @@ -907,6 +958,9 @@ Definition account_exists_and_is_empty : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom account_exists_and_is_empty_in_globals : + IsInGlobals globals "account_exists_and_is_empty" (make_function account_exists_and_is_empty). + Definition is_account_alive : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "state"; "address" ] in @@ -984,6 +1038,9 @@ Definition is_account_alive : Value.t -> Value.t -> M := )) |) in M.pure Constant.None_)). +Axiom is_account_alive_in_globals : + IsInGlobals globals "is_account_alive" (make_function is_account_alive). + Definition modify_state : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "state"; "address"; "f" ] in @@ -1016,6 +1073,9 @@ Definition modify_state : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom modify_state_in_globals : + IsInGlobals globals "modify_state" (make_function modify_state). + Definition move_ether : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "state"; "sender_address"; "recipient_address"; "amount" ] in @@ -1045,6 +1105,9 @@ Definition move_ether : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom move_ether_in_globals : + IsInGlobals globals "move_ether" (make_function move_ether). + Definition process_withdrawal : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "state"; "wd" ] in @@ -1064,6 +1127,9 @@ Definition process_withdrawal : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom process_withdrawal_in_globals : + IsInGlobals globals "process_withdrawal" (make_function process_withdrawal). + Definition set_account_balance : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "state"; "address"; "amount" ] in @@ -1094,6 +1160,9 @@ Definition set_account_balance : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom set_account_balance_in_globals : + IsInGlobals globals "set_account_balance" (make_function set_account_balance). + Definition touch_account : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "state"; "address" ] in @@ -1138,6 +1207,9 @@ Definition touch_account : Value.t -> Value.t -> M := )) |) in M.pure Constant.None_)). +Axiom touch_account_in_globals : + IsInGlobals globals "touch_account" (make_function touch_account). + Definition increment_nonce : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "state"; "address" ] in @@ -1165,6 +1237,9 @@ Definition increment_nonce : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom increment_nonce_in_globals : + IsInGlobals globals "increment_nonce" (make_function increment_nonce). + Definition set_code : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "state"; "address"; "code" ] in @@ -1195,6 +1270,9 @@ Definition set_code : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom set_code_in_globals : + IsInGlobals globals "set_code" (make_function set_code). + Definition get_storage_original : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "state"; "address"; "key" ] in @@ -1300,3 +1378,6 @@ Definition get_storage_original : Value.t -> Value.t -> M := M.get_name (| globals, locals_stack, "original_value" |) |) in M.pure Constant.None_)). + +Axiom get_storage_original_in_globals : + IsInGlobals globals "get_storage_original" (make_function get_storage_original). diff --git a/CoqOfPython/ethereum/shanghai/transactions.v b/CoqOfPython/ethereum/shanghai/transactions.v index e7408ca..d8710f6 100644 --- a/CoqOfPython/ethereum/shanghai/transactions.v +++ b/CoqOfPython/ethereum/shanghai/transactions.v @@ -201,6 +201,9 @@ Definition encode_transaction : Value.t -> Value.t -> M := )) |) in M.pure Constant.None_)). +Axiom encode_transaction_in_globals : + IsInGlobals globals "encode_transaction" (make_function encode_transaction). + Definition decode_transaction : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "tx" ] in @@ -295,3 +298,6 @@ Definition decode_transaction : Value.t -> Value.t -> M := M.pure Constant.None_ )) |) in M.pure Constant.None_)). + +Axiom decode_transaction_in_globals : + IsInGlobals globals "decode_transaction" (make_function decode_transaction). diff --git a/CoqOfPython/ethereum/shanghai/trie.v b/CoqOfPython/ethereum/shanghai/trie.v index 2a44bc7..fc4508e 100644 --- a/CoqOfPython/ethereum/shanghai/trie.v +++ b/CoqOfPython/ethereum/shanghai/trie.v @@ -380,6 +380,9 @@ Definition encode_internal_node : Value.t -> Value.t -> M := )) |) in M.pure Constant.None_)). +Axiom encode_internal_node_in_globals : + IsInGlobals globals "encode_internal_node" (make_function encode_internal_node). + Definition encode_node : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "node"; "storage_root" ] in @@ -488,6 +491,9 @@ Definition encode_node : Value.t -> Value.t -> M := )) |) in M.pure Constant.None_)). +Axiom encode_node_in_globals : + IsInGlobals globals "encode_node" (make_function encode_node). + Definition Trie : Value.t := builtins.make_klass [(* At base: unsupported node type: Subscript *)] @@ -535,6 +541,9 @@ Definition copy_trie : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom copy_trie_in_globals : + IsInGlobals globals "copy_trie" (make_function copy_trie). + Definition trie_set : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "trie"; "key"; "value" ] in @@ -595,6 +604,9 @@ Definition trie_set : Value.t -> Value.t -> M := )) |) in M.pure Constant.None_)). +Axiom trie_set_in_globals : + IsInGlobals globals "trie_set" (make_function trie_set). + Definition trie_get : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "trie"; "key" ] in @@ -628,6 +640,9 @@ Definition trie_get : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom trie_get_in_globals : + IsInGlobals globals "trie_get" (make_function trie_get). + Definition common_prefix_length : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "a"; "b" ] in @@ -706,6 +721,9 @@ Definition common_prefix_length : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom common_prefix_length_in_globals : + IsInGlobals globals "common_prefix_length" (make_function common_prefix_length). + Definition nibble_list_to_compact : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "x"; "is_leaf" ] in @@ -914,6 +932,9 @@ Definition nibble_list_to_compact : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom nibble_list_to_compact_in_globals : + IsInGlobals globals "nibble_list_to_compact" (make_function nibble_list_to_compact). + Definition bytes_to_nibble_list : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "bytes_" ] in @@ -1010,6 +1031,9 @@ Definition bytes_to_nibble_list : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom bytes_to_nibble_list_in_globals : + IsInGlobals globals "bytes_to_nibble_list" (make_function bytes_to_nibble_list). + Definition _prepare_trie : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "trie"; "get_storage_root" ] in @@ -1161,6 +1185,9 @@ Definition _prepare_trie : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom _prepare_trie_in_globals : + IsInGlobals globals "_prepare_trie" (make_function _prepare_trie). + Definition root : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "trie"; "get_storage_root" ] in @@ -1276,6 +1303,9 @@ Definition root : Value.t -> Value.t -> M := )) |) in M.pure Constant.None_)). +Axiom root_in_globals : + IsInGlobals globals "root" (make_function root). + Definition patricialize : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "obj"; "level" ] in @@ -1615,3 +1645,6 @@ Definition patricialize : Value.t -> Value.t -> M := |) |) in M.pure Constant.None_)). + +Axiom patricialize_in_globals : + IsInGlobals globals "patricialize" (make_function patricialize). diff --git a/CoqOfPython/ethereum/shanghai/utils/address.v b/CoqOfPython/ethereum/shanghai/utils/address.v index d0b9263..7af0153 100644 --- a/CoqOfPython/ethereum/shanghai/utils/address.v +++ b/CoqOfPython/ethereum/shanghai/utils/address.v @@ -79,6 +79,9 @@ Definition to_address : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom to_address_in_globals : + IsInGlobals globals "to_address" (make_function to_address). + Definition compute_contract_address : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "address"; "nonce" ] in @@ -149,6 +152,9 @@ Definition compute_contract_address : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom compute_contract_address_in_globals : + IsInGlobals globals "compute_contract_address" (make_function compute_contract_address). + Definition compute_create2_contract_address : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "address"; "salt"; "call_data" ] in @@ -230,3 +236,6 @@ Definition compute_create2_contract_address : Value.t -> Value.t -> M := |) |) in M.pure Constant.None_)). + +Axiom compute_create2_contract_address_in_globals : + IsInGlobals globals "compute_create2_contract_address" (make_function compute_create2_contract_address). diff --git a/CoqOfPython/ethereum/shanghai/utils/hexadecimal.v b/CoqOfPython/ethereum/shanghai/utils/hexadecimal.v index 460325a..9e940a6 100644 --- a/CoqOfPython/ethereum/shanghai/utils/hexadecimal.v +++ b/CoqOfPython/ethereum/shanghai/utils/hexadecimal.v @@ -70,6 +70,9 @@ Definition hex_to_root : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom hex_to_root_in_globals : + IsInGlobals globals "hex_to_root" (make_function hex_to_root). + Definition hex_to_bloom : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "hex_string" ] in @@ -110,6 +113,9 @@ Definition hex_to_bloom : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom hex_to_bloom_in_globals : + IsInGlobals globals "hex_to_bloom" (make_function hex_to_bloom). + Definition hex_to_address : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "hex_string" ] in @@ -156,3 +162,6 @@ Definition hex_to_address : Value.t -> Value.t -> M := |) |) in M.pure Constant.None_)). + +Axiom hex_to_address_in_globals : + IsInGlobals globals "hex_to_address" (make_function hex_to_address). diff --git a/CoqOfPython/ethereum/shanghai/utils/message.v b/CoqOfPython/ethereum/shanghai/utils/message.v index 918b127..e3b9bbb 100644 --- a/CoqOfPython/ethereum/shanghai/utils/message.v +++ b/CoqOfPython/ethereum/shanghai/utils/message.v @@ -267,3 +267,6 @@ Definition prepare_message : Value.t -> Value.t -> M := |) |) in M.pure Constant.None_)). + +Axiom prepare_message_in_globals : + IsInGlobals globals "prepare_message" (make_function prepare_message). diff --git a/CoqOfPython/ethereum/shanghai/vm/__init__.v b/CoqOfPython/ethereum/shanghai/vm/__init__.v index 2c94399..7d9e4eb 100644 --- a/CoqOfPython/ethereum/shanghai/vm/__init__.v +++ b/CoqOfPython/ethereum/shanghai/vm/__init__.v @@ -182,6 +182,9 @@ Definition incorporate_child_on_success : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom incorporate_child_on_success_in_globals : + IsInGlobals globals "incorporate_child_on_success" (make_function incorporate_child_on_success). + Definition incorporate_child_on_error : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm"; "child_evm" ] in @@ -262,3 +265,6 @@ Definition incorporate_child_on_error : Value.t -> Value.t -> M := M.get_field (| M.get_name (| globals, locals_stack, "child_evm" |), "gas_left" |) |) in M.pure Constant.None_)). + +Axiom incorporate_child_on_error_in_globals : + IsInGlobals globals "incorporate_child_on_error" (make_function incorporate_child_on_error). diff --git a/CoqOfPython/ethereum/shanghai/vm/gas.v b/CoqOfPython/ethereum/shanghai/vm/gas.v index 4271a86..948212e 100644 --- a/CoqOfPython/ethereum/shanghai/vm/gas.v +++ b/CoqOfPython/ethereum/shanghai/vm/gas.v @@ -527,6 +527,9 @@ Definition charge_gas : Value.t -> Value.t -> M := )) |) in M.pure Constant.None_)). +Axiom charge_gas_in_globals : + IsInGlobals globals "charge_gas" (make_function charge_gas). + Definition calculate_memory_gas_cost : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "size_in_bytes" ] in @@ -586,6 +589,9 @@ Definition calculate_memory_gas_cost : Value.t -> Value.t -> M := (* At stmt: unsupported node type: Try *) M.pure Constant.None_)). +Axiom calculate_memory_gas_cost_in_globals : + IsInGlobals globals "calculate_memory_gas_cost" (make_function calculate_memory_gas_cost). + Definition calculate_gas_extend_memory : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "memory"; "extensions" ] in @@ -769,6 +775,9 @@ Definition calculate_gas_extend_memory : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom calculate_gas_extend_memory_in_globals : + IsInGlobals globals "calculate_gas_extend_memory" (make_function calculate_gas_extend_memory). + Definition calculate_message_call_gas : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "value"; "gas"; "gas_left"; "memory_cost"; "extra_gas"; "call_stipend" ] in @@ -894,6 +903,9 @@ M.get_name (| globals, locals_stack, "call_stipend" |) |) in M.pure Constant.None_)). +Axiom calculate_message_call_gas_in_globals : + IsInGlobals globals "calculate_message_call_gas" (make_function calculate_message_call_gas). + Definition max_message_call_gas : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "gas" ] in @@ -922,6 +934,9 @@ Definition max_message_call_gas : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom max_message_call_gas_in_globals : + IsInGlobals globals "max_message_call_gas" (make_function max_message_call_gas). + Definition init_code_cost : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "init_code_length" ] in @@ -957,3 +972,6 @@ Definition init_code_cost : Value.t -> Value.t -> M := |) |) in M.pure Constant.None_)). + +Axiom init_code_cost_in_globals : + IsInGlobals globals "init_code_cost" (make_function init_code_cost). diff --git a/CoqOfPython/ethereum/shanghai/vm/instructions/arithmetic.v b/CoqOfPython/ethereum/shanghai/vm/instructions/arithmetic.v index 87c5f1b..c095194 100644 --- a/CoqOfPython/ethereum/shanghai/vm/instructions/arithmetic.v +++ b/CoqOfPython/ethereum/shanghai/vm/instructions/arithmetic.v @@ -119,6 +119,9 @@ Definition add : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom add_in_globals : + IsInGlobals globals "add" (make_function add). + Definition sub : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -186,6 +189,9 @@ Definition sub : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom sub_in_globals : + IsInGlobals globals "sub" (make_function sub). + Definition mul : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -253,6 +259,9 @@ Definition mul : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom mul_in_globals : + IsInGlobals globals "mul" (make_function mul). + Definition div : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -341,6 +350,9 @@ Definition div : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom div_in_globals : + IsInGlobals globals "div" (make_function div). + Definition sdiv : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -491,6 +503,9 @@ Definition sdiv : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom sdiv_in_globals : + IsInGlobals globals "sdiv" (make_function sdiv). + Definition mod_ : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -579,6 +594,9 @@ Definition mod_ : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom mod__in_globals : + IsInGlobals globals "mod" (make_function mod_). + Definition smod : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -696,6 +714,9 @@ Definition smod : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom smod_in_globals : + IsInGlobals globals "smod" (make_function smod). + Definition addmod : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -821,6 +842,9 @@ Definition addmod : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom addmod_in_globals : + IsInGlobals globals "addmod" (make_function addmod). + Definition mulmod : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -946,6 +970,9 @@ Definition mulmod : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom mulmod_in_globals : + IsInGlobals globals "mulmod" (make_function mulmod). + Definition exp : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -1057,6 +1084,9 @@ Definition exp : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom exp_in_globals : + IsInGlobals globals "exp" (make_function exp). + Definition signextend : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -1231,3 +1261,6 @@ Definition signextend : Value.t -> Value.t -> M := Constant.int 1 |) in M.pure Constant.None_)). + +Axiom signextend_in_globals : + IsInGlobals globals "signextend" (make_function signextend). diff --git a/CoqOfPython/ethereum/shanghai/vm/instructions/bitwise.v b/CoqOfPython/ethereum/shanghai/vm/instructions/bitwise.v index 30a1e49..2994103 100644 --- a/CoqOfPython/ethereum/shanghai/vm/instructions/bitwise.v +++ b/CoqOfPython/ethereum/shanghai/vm/instructions/bitwise.v @@ -97,6 +97,9 @@ Definition bitwise_and : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom bitwise_and_in_globals : + IsInGlobals globals "bitwise_and" (make_function bitwise_and). + Definition bitwise_or : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -157,6 +160,9 @@ Definition bitwise_or : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom bitwise_or_in_globals : + IsInGlobals globals "bitwise_or" (make_function bitwise_or). + Definition bitwise_xor : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -217,6 +223,9 @@ Definition bitwise_xor : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom bitwise_xor_in_globals : + IsInGlobals globals "bitwise_xor" (make_function bitwise_xor). + Definition bitwise_not : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -264,6 +273,9 @@ Definition bitwise_not : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom bitwise_not_in_globals : + IsInGlobals globals "bitwise_not" (make_function bitwise_not). + Definition get_byte : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -380,6 +392,9 @@ Definition get_byte : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom get_byte_in_globals : + IsInGlobals globals "get_byte" (make_function get_byte). + Definition bitwise_shl : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -475,6 +490,9 @@ Definition bitwise_shl : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom bitwise_shl_in_globals : + IsInGlobals globals "bitwise_shl" (make_function bitwise_shl). + Definition bitwise_shr : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -561,6 +579,9 @@ Definition bitwise_shr : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom bitwise_shr_in_globals : + IsInGlobals globals "bitwise_shr" (make_function bitwise_shr). + Definition bitwise_sar : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -674,3 +695,6 @@ Definition bitwise_sar : Value.t -> Value.t -> M := Constant.int 1 |) in M.pure Constant.None_)). + +Axiom bitwise_sar_in_globals : + IsInGlobals globals "bitwise_sar" (make_function bitwise_sar). diff --git a/CoqOfPython/ethereum/shanghai/vm/instructions/block.v b/CoqOfPython/ethereum/shanghai/vm/instructions/block.v index cd0188d..2db51e9 100644 --- a/CoqOfPython/ethereum/shanghai/vm/instructions/block.v +++ b/CoqOfPython/ethereum/shanghai/vm/instructions/block.v @@ -135,6 +135,9 @@ Definition block_hash : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom block_hash_in_globals : + IsInGlobals globals "block_hash" (make_function block_hash). + Definition coinbase : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -188,6 +191,9 @@ Definition coinbase : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom coinbase_in_globals : + IsInGlobals globals "coinbase" (make_function coinbase). + Definition timestamp : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -235,6 +241,9 @@ Definition timestamp : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom timestamp_in_globals : + IsInGlobals globals "timestamp" (make_function timestamp). + Definition number : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -287,6 +296,9 @@ Definition number : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom number_in_globals : + IsInGlobals globals "number" (make_function number). + Definition prev_randao : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -339,6 +351,9 @@ Definition prev_randao : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom prev_randao_in_globals : + IsInGlobals globals "prev_randao" (make_function prev_randao). + Definition gas_limit : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -391,6 +406,9 @@ Definition gas_limit : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom gas_limit_in_globals : + IsInGlobals globals "gas_limit" (make_function gas_limit). + Definition chain_id : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -439,3 +457,6 @@ Definition chain_id : Value.t -> Value.t -> M := Constant.int 1 |) in M.pure Constant.None_)). + +Axiom chain_id_in_globals : + IsInGlobals globals "chain_id" (make_function chain_id). diff --git a/CoqOfPython/ethereum/shanghai/vm/instructions/comparison.v b/CoqOfPython/ethereum/shanghai/vm/instructions/comparison.v index 121bfa8..5adf14d 100644 --- a/CoqOfPython/ethereum/shanghai/vm/instructions/comparison.v +++ b/CoqOfPython/ethereum/shanghai/vm/instructions/comparison.v @@ -105,6 +105,9 @@ Definition less_than : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom less_than_in_globals : + IsInGlobals globals "less_than" (make_function less_than). + Definition signed_less_than : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -182,6 +185,9 @@ Definition signed_less_than : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom signed_less_than_in_globals : + IsInGlobals globals "signed_less_than" (make_function signed_less_than). + Definition greater_than : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -252,6 +258,9 @@ Definition greater_than : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom greater_than_in_globals : + IsInGlobals globals "greater_than" (make_function greater_than). + Definition signed_greater_than : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -329,6 +338,9 @@ Definition signed_greater_than : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom signed_greater_than_in_globals : + IsInGlobals globals "signed_greater_than" (make_function signed_greater_than). + Definition equal : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -399,6 +411,9 @@ Definition equal : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom equal_in_globals : + IsInGlobals globals "equal" (make_function equal). + Definition is_zero : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -458,3 +473,6 @@ Definition is_zero : Value.t -> Value.t -> M := Constant.int 1 |) in M.pure Constant.None_)). + +Axiom is_zero_in_globals : + IsInGlobals globals "is_zero" (make_function is_zero). diff --git a/CoqOfPython/ethereum/shanghai/vm/instructions/control_flow.v b/CoqOfPython/ethereum/shanghai/vm/instructions/control_flow.v index 1cf5348..ab91eb9 100644 --- a/CoqOfPython/ethereum/shanghai/vm/instructions/control_flow.v +++ b/CoqOfPython/ethereum/shanghai/vm/instructions/control_flow.v @@ -71,6 +71,9 @@ Definition stop : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom stop_in_globals : + IsInGlobals globals "stop" (make_function stop). + Definition jump : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -136,6 +139,9 @@ Definition jump : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom jump_in_globals : + IsInGlobals globals "jump" (make_function jump). + Definition jumpi : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -237,6 +243,9 @@ Definition jumpi : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom jumpi_in_globals : + IsInGlobals globals "jumpi" (make_function jumpi). + Definition pc : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -281,6 +290,9 @@ Definition pc : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom pc_in_globals : + IsInGlobals globals "pc" (make_function pc). + Definition gas_left : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -325,6 +337,9 @@ Definition gas_left : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom gas_left_in_globals : + IsInGlobals globals "gas_left" (make_function gas_left). + Definition jumpdest : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -356,3 +371,6 @@ Definition jumpdest : Value.t -> Value.t -> M := Constant.int 1 |) in M.pure Constant.None_)). + +Axiom jumpdest_in_globals : + IsInGlobals globals "jumpdest" (make_function jumpdest). diff --git a/CoqOfPython/ethereum/shanghai/vm/instructions/environment.v b/CoqOfPython/ethereum/shanghai/vm/instructions/environment.v index a745422..3b5f363 100644 --- a/CoqOfPython/ethereum/shanghai/vm/instructions/environment.v +++ b/CoqOfPython/ethereum/shanghai/vm/instructions/environment.v @@ -120,6 +120,9 @@ Definition address : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom address_in_globals : + IsInGlobals globals "address" (make_function address). + Definition balance : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -212,6 +215,9 @@ Definition balance : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom balance_in_globals : + IsInGlobals globals "balance" (make_function balance). + Definition origin : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -256,6 +262,9 @@ Definition origin : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom origin_in_globals : + IsInGlobals globals "origin" (make_function origin). + Definition caller : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -299,6 +308,9 @@ Definition caller : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom caller_in_globals : + IsInGlobals globals "caller" (make_function caller). + Definition callvalue : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -336,6 +348,9 @@ Definition callvalue : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom callvalue_in_globals : + IsInGlobals globals "callvalue" (make_function callvalue). + Definition calldataload : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -407,6 +422,9 @@ Definition calldataload : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom calldataload_in_globals : + IsInGlobals globals "calldataload" (make_function calldataload). + Definition calldatasize : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -456,6 +474,9 @@ Definition calldatasize : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom calldatasize_in_globals : + IsInGlobals globals "calldatasize" (make_function calldatasize). + Definition calldatacopy : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -591,6 +612,9 @@ Definition calldatacopy : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom calldatacopy_in_globals : + IsInGlobals globals "calldatacopy" (make_function calldatacopy). + Definition codesize : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -640,6 +664,9 @@ Definition codesize : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom codesize_in_globals : + IsInGlobals globals "codesize" (make_function codesize). + Definition codecopy : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -775,6 +802,9 @@ Definition codecopy : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom codecopy_in_globals : + IsInGlobals globals "codecopy" (make_function codecopy). + Definition gasprice : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -818,6 +848,9 @@ Definition gasprice : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom gasprice_in_globals : + IsInGlobals globals "gasprice" (make_function gasprice). + Definition extcodesize : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -922,6 +955,9 @@ Definition extcodesize : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom extcodesize_in_globals : + IsInGlobals globals "extcodesize" (make_function extcodesize). + Definition extcodecopy : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -1116,6 +1152,9 @@ Definition extcodecopy : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom extcodecopy_in_globals : + IsInGlobals globals "extcodecopy" (make_function extcodecopy). + Definition returndatasize : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -1164,6 +1203,9 @@ Definition returndatasize : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom returndatasize_in_globals : + IsInGlobals globals "returndatasize" (make_function returndatasize). + Definition returndatacopy : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -1327,6 +1369,9 @@ Definition returndatacopy : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom returndatacopy_in_globals : + IsInGlobals globals "returndatacopy" (make_function returndatacopy). + Definition extcodehash : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -1457,6 +1502,9 @@ Definition extcodehash : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom extcodehash_in_globals : + IsInGlobals globals "extcodehash" (make_function extcodehash). + Definition self_balance : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -1505,6 +1553,9 @@ Definition self_balance : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom self_balance_in_globals : + IsInGlobals globals "self_balance" (make_function self_balance). + Definition base_fee : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -1547,3 +1598,6 @@ Definition base_fee : Value.t -> Value.t -> M := Constant.int 1 |) in M.pure Constant.None_)). + +Axiom base_fee_in_globals : + IsInGlobals globals "base_fee" (make_function base_fee). diff --git a/CoqOfPython/ethereum/shanghai/vm/instructions/keccak.v b/CoqOfPython/ethereum/shanghai/vm/instructions/keccak.v index 70897e7..42f0d89 100644 --- a/CoqOfPython/ethereum/shanghai/vm/instructions/keccak.v +++ b/CoqOfPython/ethereum/shanghai/vm/instructions/keccak.v @@ -189,3 +189,6 @@ Definition keccak : Value.t -> Value.t -> M := Constant.int 1 |) in M.pure Constant.None_)). + +Axiom keccak_in_globals : + IsInGlobals globals "keccak" (make_function keccak). diff --git a/CoqOfPython/ethereum/shanghai/vm/instructions/log.v b/CoqOfPython/ethereum/shanghai/vm/instructions/log.v index 4d0abf6..e038d49 100644 --- a/CoqOfPython/ethereum/shanghai/vm/instructions/log.v +++ b/CoqOfPython/ethereum/shanghai/vm/instructions/log.v @@ -208,6 +208,9 @@ Definition log_n : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom log_n_in_globals : + IsInGlobals globals "log_n" (make_function log_n). + Definition log0 : Value.t := M.run ltac:(M.monadic ( M.call (| M.get_name (| globals, locals_stack, "partial" |), diff --git a/CoqOfPython/ethereum/shanghai/vm/instructions/memory.v b/CoqOfPython/ethereum/shanghai/vm/instructions/memory.v index f195df9..ba2e82c 100644 --- a/CoqOfPython/ethereum/shanghai/vm/instructions/memory.v +++ b/CoqOfPython/ethereum/shanghai/vm/instructions/memory.v @@ -145,6 +145,9 @@ Definition mstore : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom mstore_in_globals : + IsInGlobals globals "mstore" (make_function mstore). + Definition mstore8 : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -249,6 +252,9 @@ Definition mstore8 : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom mstore8_in_globals : + IsInGlobals globals "mstore8" (make_function mstore8). + Definition mload : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -349,6 +355,9 @@ Definition mload : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom mload_in_globals : + IsInGlobals globals "mload" (make_function mload). + Definition msize : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -397,3 +406,6 @@ Definition msize : Value.t -> Value.t -> M := Constant.int 1 |) in M.pure Constant.None_)). + +Axiom msize_in_globals : + IsInGlobals globals "msize" (make_function msize). diff --git a/CoqOfPython/ethereum/shanghai/vm/instructions/stack.v b/CoqOfPython/ethereum/shanghai/vm/instructions/stack.v index e18a708..389a283 100644 --- a/CoqOfPython/ethereum/shanghai/vm/instructions/stack.v +++ b/CoqOfPython/ethereum/shanghai/vm/instructions/stack.v @@ -82,6 +82,9 @@ Definition pop : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom pop_in_globals : + IsInGlobals globals "pop" (make_function pop). + Definition push_n : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm"; "num_bytes" ] in @@ -181,6 +184,9 @@ Definition push_n : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom push_n_in_globals : + IsInGlobals globals "push_n" (make_function push_n). + Definition dup_n : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm"; "item_number" ] in @@ -258,6 +264,9 @@ Definition dup_n : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom dup_n_in_globals : + IsInGlobals globals "dup_n" (make_function dup_n). + Definition swap_n : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm"; "item_number" ] in @@ -334,6 +343,9 @@ Definition swap_n : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom swap_n_in_globals : + IsInGlobals globals "swap_n" (make_function swap_n). + Definition push0 : Value.t := M.run ltac:(M.monadic ( M.call (| M.get_name (| globals, locals_stack, "partial" |), diff --git a/CoqOfPython/ethereum/shanghai/vm/instructions/storage.v b/CoqOfPython/ethereum/shanghai/vm/instructions/storage.v index 0e9b0a7..b051f0e 100644 --- a/CoqOfPython/ethereum/shanghai/vm/instructions/storage.v +++ b/CoqOfPython/ethereum/shanghai/vm/instructions/storage.v @@ -152,6 +152,9 @@ Definition sload : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom sload_in_globals : + IsInGlobals globals "sload" (make_function sload). + Definition sstore : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -493,3 +496,6 @@ Definition sstore : Value.t -> Value.t -> M := Constant.int 1 |) in M.pure Constant.None_)). + +Axiom sstore_in_globals : + IsInGlobals globals "sstore" (make_function sstore). diff --git a/CoqOfPython/ethereum/shanghai/vm/instructions/system.v b/CoqOfPython/ethereum/shanghai/vm/instructions/system.v index 82dbbcc..608f02c 100644 --- a/CoqOfPython/ethereum/shanghai/vm/instructions/system.v +++ b/CoqOfPython/ethereum/shanghai/vm/instructions/system.v @@ -407,6 +407,9 @@ Definition generic_create : Value.t -> Value.t -> M := )) |) in M.pure Constant.None_)). +Axiom generic_create_in_globals : + IsInGlobals globals "generic_create" (make_function generic_create). + Definition create : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -537,6 +540,9 @@ Definition create : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom create_in_globals : + IsInGlobals globals "create" (make_function create). + Definition create2 : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -711,6 +717,9 @@ Definition create2 : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom create2_in_globals : + IsInGlobals globals "create2" (make_function create2). + Definition return_ : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -794,6 +803,9 @@ Definition return_ : Value.t -> Value.t -> M := let _ := M.pass (| |) in M.pure Constant.None_)). +Axiom return__in_globals : + IsInGlobals globals "return_" (make_function return_). + Definition generic_call : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm"; "gas"; "value"; "caller"; "to"; "code_address"; "should_transfer_value"; "is_staticcall"; "memory_input_start_position"; "memory_input_size"; "memory_output_start_position"; "memory_output_size" ] in @@ -989,6 +1001,9 @@ Definition generic_call : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom generic_call_in_globals : + IsInGlobals globals "generic_call" (make_function generic_call). + Definition call : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -1322,6 +1337,9 @@ M.get_name (| globals, locals_stack, "GAS_CALL_VALUE" |) |) in M.pure Constant.None_)). +Axiom call_in_globals : + IsInGlobals globals "call" (make_function call). + Definition callcode : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -1600,6 +1618,9 @@ M.get_name (| globals, locals_stack, "GAS_CALL_VALUE" |) |) in M.pure Constant.None_)). +Axiom callcode_in_globals : + IsInGlobals globals "callcode" (make_function callcode). + Definition selfdestruct : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -1804,6 +1825,9 @@ Definition selfdestruct : Value.t -> Value.t -> M := let _ := M.pass (| |) in M.pure Constant.None_)). +Axiom selfdestruct_in_globals : + IsInGlobals globals "selfdestruct" (make_function selfdestruct). + Definition delegatecall : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -2001,6 +2025,9 @@ Definition delegatecall : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom delegatecall_in_globals : + IsInGlobals globals "delegatecall" (make_function delegatecall). + Definition staticcall : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -2204,6 +2231,9 @@ Definition staticcall : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom staticcall_in_globals : + IsInGlobals globals "staticcall" (make_function staticcall). + Definition revert : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -2290,3 +2320,6 @@ Definition revert : Value.t -> Value.t -> M := let _ := M.raise (| Some (M.get_name (| globals, locals_stack, "Revert" |)) |) in let _ := M.pass (| |) in M.pure Constant.None_)). + +Axiom revert_in_globals : + IsInGlobals globals "revert" (make_function revert). diff --git a/CoqOfPython/ethereum/shanghai/vm/interpreter.v b/CoqOfPython/ethereum/shanghai/vm/interpreter.v index 6a8a73e..5e4ca3c 100644 --- a/CoqOfPython/ethereum/shanghai/vm/interpreter.v +++ b/CoqOfPython/ethereum/shanghai/vm/interpreter.v @@ -408,6 +408,9 @@ Definition process_message_call : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom process_message_call_in_globals : + IsInGlobals globals "process_message_call" (make_function process_message_call). + Definition process_create_message : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "message"; "env" ] in @@ -510,6 +513,9 @@ Definition process_create_message : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom process_create_message_in_globals : + IsInGlobals globals "process_create_message" (make_function process_create_message). + Definition process_message : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "message"; "env" ] in @@ -635,6 +641,9 @@ Definition process_message : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom process_message_in_globals : + IsInGlobals globals "process_message" (make_function process_message). + Definition execute_code : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "message"; "env" ] in @@ -681,3 +690,6 @@ Definition execute_code : Value.t -> Value.t -> M := M.get_name (| globals, locals_stack, "evm" |) |) in M.pure Constant.None_)). + +Axiom execute_code_in_globals : + IsInGlobals globals "execute_code" (make_function execute_code). diff --git a/CoqOfPython/ethereum/shanghai/vm/memory.v b/CoqOfPython/ethereum/shanghai/vm/memory.v index a2fd291..57b0949 100644 --- a/CoqOfPython/ethereum/shanghai/vm/memory.v +++ b/CoqOfPython/ethereum/shanghai/vm/memory.v @@ -71,6 +71,9 @@ Definition memory_write : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom memory_write_in_globals : + IsInGlobals globals "memory_write" (make_function memory_write). + Definition memory_read_bytes : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "memory"; "start_position"; "size" ] in @@ -117,6 +120,9 @@ Definition memory_read_bytes : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom memory_read_bytes_in_globals : + IsInGlobals globals "memory_read_bytes" (make_function memory_read_bytes). + Definition buffer_read : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "buffer"; "start_position"; "size" ] in @@ -169,3 +175,6 @@ Definition buffer_read : Value.t -> Value.t -> M := |) |) in M.pure Constant.None_)). + +Axiom buffer_read_in_globals : + IsInGlobals globals "buffer_read" (make_function buffer_read). diff --git a/CoqOfPython/ethereum/shanghai/vm/precompiled_contracts/alt_bn128.v b/CoqOfPython/ethereum/shanghai/vm/precompiled_contracts/alt_bn128.v index 4f8ddae..c716620 100644 --- a/CoqOfPython/ethereum/shanghai/vm/precompiled_contracts/alt_bn128.v +++ b/CoqOfPython/ethereum/shanghai/vm/precompiled_contracts/alt_bn128.v @@ -273,6 +273,9 @@ Definition alt_bn128_add : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom alt_bn128_add_in_globals : + IsInGlobals globals "alt_bn128_add" (make_function alt_bn128_add). + Definition alt_bn128_mul : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -455,6 +458,9 @@ Definition alt_bn128_mul : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom alt_bn128_mul_in_globals : + IsInGlobals globals "alt_bn128_mul" (make_function alt_bn128_mul). + Definition alt_bn128_pairing_check : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -781,3 +787,6 @@ Definition alt_bn128_pairing_check : Value.t -> Value.t -> M := M.pure Constant.None_ )) |) in M.pure Constant.None_)). + +Axiom alt_bn128_pairing_check_in_globals : + IsInGlobals globals "alt_bn128_pairing_check" (make_function alt_bn128_pairing_check). diff --git a/CoqOfPython/ethereum/shanghai/vm/precompiled_contracts/blake2f.v b/CoqOfPython/ethereum/shanghai/vm/precompiled_contracts/blake2f.v index cbbac2e..75c88ab 100644 --- a/CoqOfPython/ethereum/shanghai/vm/precompiled_contracts/blake2f.v +++ b/CoqOfPython/ethereum/shanghai/vm/precompiled_contracts/blake2f.v @@ -128,3 +128,6 @@ Definition blake2f : Value.t -> Value.t -> M := |) |) in M.pure Constant.None_)). + +Axiom blake2f_in_globals : + IsInGlobals globals "blake2f" (make_function blake2f). diff --git a/CoqOfPython/ethereum/shanghai/vm/precompiled_contracts/ecrecover.v b/CoqOfPython/ethereum/shanghai/vm/precompiled_contracts/ecrecover.v index 37e81ce..0b75a6f 100644 --- a/CoqOfPython/ethereum/shanghai/vm/precompiled_contracts/ecrecover.v +++ b/CoqOfPython/ethereum/shanghai/vm/precompiled_contracts/ecrecover.v @@ -302,3 +302,6 @@ Definition ecrecover : Value.t -> Value.t -> M := M.get_name (| globals, locals_stack, "padded_address" |) |) in M.pure Constant.None_)). + +Axiom ecrecover_in_globals : + IsInGlobals globals "ecrecover" (make_function ecrecover). diff --git a/CoqOfPython/ethereum/shanghai/vm/precompiled_contracts/identity.v b/CoqOfPython/ethereum/shanghai/vm/precompiled_contracts/identity.v index eedb8c2..c03ae95 100644 --- a/CoqOfPython/ethereum/shanghai/vm/precompiled_contracts/identity.v +++ b/CoqOfPython/ethereum/shanghai/vm/precompiled_contracts/identity.v @@ -95,3 +95,6 @@ Definition identity : Value.t -> Value.t -> M := M.get_name (| globals, locals_stack, "data" |) |) in M.pure Constant.None_)). + +Axiom identity_in_globals : + IsInGlobals globals "identity" (make_function identity). diff --git a/CoqOfPython/ethereum/shanghai/vm/precompiled_contracts/modexp.v b/CoqOfPython/ethereum/shanghai/vm/precompiled_contracts/modexp.v index 8749a71..7ba465f 100644 --- a/CoqOfPython/ethereum/shanghai/vm/precompiled_contracts/modexp.v +++ b/CoqOfPython/ethereum/shanghai/vm/precompiled_contracts/modexp.v @@ -356,6 +356,9 @@ Definition modexp : Value.t -> Value.t -> M := )) |) in M.pure Constant.None_)). +Axiom modexp_in_globals : + IsInGlobals globals "modexp" (make_function modexp). + Definition complexity : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "base_length"; "modulus_length" ] in @@ -419,6 +422,9 @@ Definition complexity : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom complexity_in_globals : + IsInGlobals globals "complexity" (make_function complexity). + Definition iterations : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "exponent_length"; "exponent_head" ] in @@ -600,6 +606,9 @@ Definition iterations : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom iterations_in_globals : + IsInGlobals globals "iterations" (make_function iterations). + Definition gas_cost : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "base_length"; "modulus_length"; "exponent_length"; "exponent_head" ] in @@ -680,3 +689,6 @@ Definition gas_cost : Value.t -> Value.t -> M := |) |) in M.pure Constant.None_)). + +Axiom gas_cost_in_globals : + IsInGlobals globals "gas_cost" (make_function gas_cost). diff --git a/CoqOfPython/ethereum/shanghai/vm/precompiled_contracts/ripemd160.v b/CoqOfPython/ethereum/shanghai/vm/precompiled_contracts/ripemd160.v index 5ba441d..80f2405 100644 --- a/CoqOfPython/ethereum/shanghai/vm/precompiled_contracts/ripemd160.v +++ b/CoqOfPython/ethereum/shanghai/vm/precompiled_contracts/ripemd160.v @@ -126,3 +126,6 @@ Definition ripemd160 : Value.t -> Value.t -> M := M.get_name (| globals, locals_stack, "padded_hash" |) |) in M.pure Constant.None_)). + +Axiom ripemd160_in_globals : + IsInGlobals globals "ripemd160" (make_function ripemd160). diff --git a/CoqOfPython/ethereum/shanghai/vm/precompiled_contracts/sha256.v b/CoqOfPython/ethereum/shanghai/vm/precompiled_contracts/sha256.v index 206c822..428a1b8 100644 --- a/CoqOfPython/ethereum/shanghai/vm/precompiled_contracts/sha256.v +++ b/CoqOfPython/ethereum/shanghai/vm/precompiled_contracts/sha256.v @@ -107,3 +107,6 @@ Definition sha256 : Value.t -> Value.t -> M := |) |) in M.pure Constant.None_)). + +Axiom sha256_in_globals : + IsInGlobals globals "sha256" (make_function sha256). diff --git a/CoqOfPython/ethereum/shanghai/vm/runtime.v b/CoqOfPython/ethereum/shanghai/vm/runtime.v index e5e7231..aca6275 100644 --- a/CoqOfPython/ethereum/shanghai/vm/runtime.v +++ b/CoqOfPython/ethereum/shanghai/vm/runtime.v @@ -158,3 +158,6 @@ Definition get_valid_jump_destinations : Value.t -> Value.t -> M := M.get_name (| globals, locals_stack, "valid_jump_destinations" |) |) in M.pure Constant.None_)). + +Axiom get_valid_jump_destinations_in_globals : + IsInGlobals globals "get_valid_jump_destinations" (make_function get_valid_jump_destinations). diff --git a/CoqOfPython/ethereum/shanghai/vm/stack.v b/CoqOfPython/ethereum/shanghai/vm/stack.v index a9b9678..6b3721f 100644 --- a/CoqOfPython/ethereum/shanghai/vm/stack.v +++ b/CoqOfPython/ethereum/shanghai/vm/stack.v @@ -78,6 +78,9 @@ Definition pop : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom pop_in_globals : + IsInGlobals globals "pop" (make_function pop). + Definition push : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "stack"; "value" ] in @@ -125,3 +128,6 @@ Definition push : Value.t -> Value.t -> M := |) |) in M.pure Constant.None_)). + +Axiom push_in_globals : + IsInGlobals globals "push" (make_function push). diff --git a/CoqOfPython/ethereum/spurious_dragon/bloom.v b/CoqOfPython/ethereum/spurious_dragon/bloom.v index 3d5bc38..d9a3365 100644 --- a/CoqOfPython/ethereum/spurious_dragon/bloom.v +++ b/CoqOfPython/ethereum/spurious_dragon/bloom.v @@ -140,6 +140,9 @@ Definition add_to_bloom : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom add_to_bloom_in_globals : + IsInGlobals globals "add_to_bloom" (make_function add_to_bloom). + Definition logs_bloom : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "logs" ] in @@ -209,3 +212,6 @@ Definition logs_bloom : Value.t -> Value.t -> M := |) |) in M.pure Constant.None_)). + +Axiom logs_bloom_in_globals : + IsInGlobals globals "logs_bloom" (make_function logs_bloom). diff --git a/CoqOfPython/ethereum/spurious_dragon/fork.v b/CoqOfPython/ethereum/spurious_dragon/fork.v index a7f269c..5e200e3 100644 --- a/CoqOfPython/ethereum/spurious_dragon/fork.v +++ b/CoqOfPython/ethereum/spurious_dragon/fork.v @@ -211,6 +211,9 @@ Definition apply_fork : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom apply_fork_in_globals : + IsInGlobals globals "apply_fork" (make_function apply_fork). + Definition get_last_256_block_hashes : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "chain" ] in @@ -323,6 +326,9 @@ Definition get_last_256_block_hashes : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom get_last_256_block_hashes_in_globals : + IsInGlobals globals "get_last_256_block_hashes" (make_function get_last_256_block_hashes). + Definition state_transition : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "chain"; "block" ] in @@ -490,6 +496,9 @@ Definition state_transition : Value.t -> Value.t -> M := )) |) in M.pure Constant.None_)). +Axiom state_transition_in_globals : + IsInGlobals globals "state_transition" (make_function state_transition). + Definition validate_header : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "header"; "parent_header" ] in @@ -628,6 +637,9 @@ Definition validate_header : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom validate_header_in_globals : + IsInGlobals globals "validate_header" (make_function validate_header). + Definition generate_header_hash_for_pow : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "header" ] in @@ -683,6 +695,9 @@ Definition generate_header_hash_for_pow : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom generate_header_hash_for_pow_in_globals : + IsInGlobals globals "generate_header_hash_for_pow" (make_function generate_header_hash_for_pow). + Definition validate_proof_of_work : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "header" ] in @@ -773,6 +788,9 @@ Definition validate_proof_of_work : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom validate_proof_of_work_in_globals : + IsInGlobals globals "validate_proof_of_work" (make_function validate_proof_of_work). + Definition check_transaction : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "tx"; "gas_available"; "chain_id" ] in @@ -826,6 +844,9 @@ Definition check_transaction : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom check_transaction_in_globals : + IsInGlobals globals "check_transaction" (make_function check_transaction). + Definition make_receipt : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "tx"; "post_state"; "cumulative_gas_used"; "logs" ] in @@ -863,6 +884,9 @@ Definition make_receipt : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom make_receipt_in_globals : + IsInGlobals globals "make_receipt" (make_function make_receipt). + Definition ApplyBodyOutput : Value.t := builtins.make_klass [] @@ -1106,6 +1130,9 @@ Definition apply_body : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom apply_body_in_globals : + IsInGlobals globals "apply_body" (make_function apply_body). + Definition validate_ommers : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "ommers"; "block_header"; "chain" ] in @@ -1427,6 +1454,9 @@ Definition validate_ommers : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom validate_ommers_in_globals : + IsInGlobals globals "validate_ommers" (make_function validate_ommers). + Definition pay_rewards : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "state"; "block_number"; "coinbase"; "ommers" ] in @@ -1532,6 +1562,9 @@ Definition pay_rewards : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom pay_rewards_in_globals : + IsInGlobals globals "pay_rewards" (make_function pay_rewards). + Definition process_transaction : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "env"; "tx" ] in @@ -1899,6 +1932,9 @@ Definition process_transaction : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom process_transaction_in_globals : + IsInGlobals globals "process_transaction" (make_function process_transaction). + Definition validate_transaction : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "tx" ] in @@ -1955,6 +1991,9 @@ Definition validate_transaction : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom validate_transaction_in_globals : + IsInGlobals globals "validate_transaction" (make_function validate_transaction). + Definition calculate_intrinsic_cost : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "tx" ] in @@ -2065,6 +2104,9 @@ Definition calculate_intrinsic_cost : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom calculate_intrinsic_cost_in_globals : + IsInGlobals globals "calculate_intrinsic_cost" (make_function calculate_intrinsic_cost). + Definition recover_sender : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "chain_id"; "tx" ] in @@ -2261,6 +2303,9 @@ Definition recover_sender : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom recover_sender_in_globals : + IsInGlobals globals "recover_sender" (make_function recover_sender). + Definition signing_hash_pre155 : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "tx" ] in @@ -2295,6 +2340,9 @@ Definition signing_hash_pre155 : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom signing_hash_pre155_in_globals : + IsInGlobals globals "signing_hash_pre155" (make_function signing_hash_pre155). + Definition signing_hash_155 : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "tx"; "chain_id" ] in @@ -2343,6 +2391,9 @@ Definition signing_hash_155 : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom signing_hash_155_in_globals : + IsInGlobals globals "signing_hash_155" (make_function signing_hash_155). + Definition compute_header_hash : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "header" ] in @@ -2395,6 +2446,9 @@ Definition compute_header_hash : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom compute_header_hash_in_globals : + IsInGlobals globals "compute_header_hash" (make_function compute_header_hash). + Definition check_gas_limit : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "gas_limit"; "parent_gas_limit" ] in @@ -2495,6 +2549,9 @@ Definition check_gas_limit : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom check_gas_limit_in_globals : + IsInGlobals globals "check_gas_limit" (make_function check_gas_limit). + Definition calculate_block_difficulty : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "block_number"; "block_timestamp"; "parent_timestamp"; "parent_difficulty" ] in @@ -2641,3 +2698,6 @@ Definition calculate_block_difficulty : Value.t -> Value.t -> M := |) |) in M.pure Constant.None_)). + +Axiom calculate_block_difficulty_in_globals : + IsInGlobals globals "calculate_block_difficulty" (make_function calculate_block_difficulty). diff --git a/CoqOfPython/ethereum/spurious_dragon/fork_types.v b/CoqOfPython/ethereum/spurious_dragon/fork_types.v index a204fad..53d3315 100644 --- a/CoqOfPython/ethereum/spurious_dragon/fork_types.v +++ b/CoqOfPython/ethereum/spurious_dragon/fork_types.v @@ -99,3 +99,6 @@ Definition encode_account : Value.t -> Value.t -> M := |) |) in M.pure Constant.None_)). + +Axiom encode_account_in_globals : + IsInGlobals globals "encode_account" (make_function encode_account). diff --git a/CoqOfPython/ethereum/spurious_dragon/state.v b/CoqOfPython/ethereum/spurious_dragon/state.v index 1c27206..67e6e39 100644 --- a/CoqOfPython/ethereum/spurious_dragon/state.v +++ b/CoqOfPython/ethereum/spurious_dragon/state.v @@ -97,6 +97,9 @@ Definition close_state : Value.t -> Value.t -> M := let _ := M.delete (| M.get_field (| M.get_name (| globals, locals_stack, "state" |), "_snapshots" |) |) in M.pure Constant.None_)). +Axiom close_state_in_globals : + IsInGlobals globals "close_state" (make_function close_state). + Definition begin_transaction : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "state" ] in @@ -127,6 +130,9 @@ Definition begin_transaction : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom begin_transaction_in_globals : + IsInGlobals globals "begin_transaction" (make_function begin_transaction). + Definition commit_transaction : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "state" ] in @@ -146,6 +152,9 @@ Definition commit_transaction : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom commit_transaction_in_globals : + IsInGlobals globals "commit_transaction" (make_function commit_transaction). + Definition rollback_transaction : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "state" ] in @@ -169,6 +178,9 @@ Definition rollback_transaction : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom rollback_transaction_in_globals : + IsInGlobals globals "rollback_transaction" (make_function rollback_transaction). + Definition get_account : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "state"; "address" ] in @@ -229,6 +241,9 @@ Definition get_account : Value.t -> Value.t -> M := )) |) in M.pure Constant.None_)). +Axiom get_account_in_globals : + IsInGlobals globals "get_account" (make_function get_account). + Definition get_account_optional : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "state"; "address" ] in @@ -265,6 +280,9 @@ Definition get_account_optional : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom get_account_optional_in_globals : + IsInGlobals globals "get_account_optional" (make_function get_account_optional). + Definition set_account : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "state"; "address"; "account" ] in @@ -293,6 +311,9 @@ Definition set_account : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom set_account_in_globals : + IsInGlobals globals "set_account" (make_function set_account). + Definition destroy_account : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "state"; "address" ] in @@ -330,6 +351,9 @@ Definition destroy_account : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom destroy_account_in_globals : + IsInGlobals globals "destroy_account" (make_function destroy_account). + Definition destroy_storage : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "state"; "address" ] in @@ -364,6 +388,9 @@ Definition destroy_storage : Value.t -> Value.t -> M := )) |) in M.pure Constant.None_)). +Axiom destroy_storage_in_globals : + IsInGlobals globals "destroy_storage" (make_function destroy_storage). + Definition get_storage : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "state"; "address"; "key" ] in @@ -443,6 +470,9 @@ Definition get_storage : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom get_storage_in_globals : + IsInGlobals globals "get_storage" (make_function get_storage). + Definition set_storage : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "state"; "address"; "key"; "value" ] in @@ -541,6 +571,9 @@ Definition set_storage : Value.t -> Value.t -> M := )) |) in M.pure Constant.None_)). +Axiom set_storage_in_globals : + IsInGlobals globals "set_storage" (make_function set_storage). + Definition storage_root : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "state"; "address" ] in @@ -592,6 +625,9 @@ Definition storage_root : Value.t -> Value.t -> M := )) |) in M.pure Constant.None_)). +Axiom storage_root_in_globals : + IsInGlobals globals "storage_root" (make_function storage_root). + Definition state_root : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "state" ] in @@ -622,6 +658,9 @@ Definition state_root : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom state_root_in_globals : + IsInGlobals globals "state_root" (make_function state_root). + Definition account_exists : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "state"; "address" ] in @@ -656,6 +695,9 @@ Definition account_exists : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom account_exists_in_globals : + IsInGlobals globals "account_exists" (make_function account_exists). + Definition account_has_code_or_nonce : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "state"; "address" ] in @@ -709,6 +751,9 @@ Definition account_has_code_or_nonce : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom account_has_code_or_nonce_in_globals : + IsInGlobals globals "account_has_code_or_nonce" (make_function account_has_code_or_nonce). + Definition is_account_empty : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "state"; "address" ] in @@ -770,6 +815,9 @@ Definition is_account_empty : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom is_account_empty_in_globals : + IsInGlobals globals "is_account_empty" (make_function is_account_empty). + Definition account_exists_and_is_empty : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "state"; "address" ] in @@ -840,6 +888,9 @@ Definition account_exists_and_is_empty : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom account_exists_and_is_empty_in_globals : + IsInGlobals globals "account_exists_and_is_empty" (make_function account_exists_and_is_empty). + Definition is_account_alive : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "state"; "address" ] in @@ -917,6 +968,9 @@ Definition is_account_alive : Value.t -> Value.t -> M := )) |) in M.pure Constant.None_)). +Axiom is_account_alive_in_globals : + IsInGlobals globals "is_account_alive" (make_function is_account_alive). + Definition modify_state : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "state"; "address"; "f" ] in @@ -949,6 +1003,9 @@ Definition modify_state : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom modify_state_in_globals : + IsInGlobals globals "modify_state" (make_function modify_state). + Definition move_ether : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "state"; "sender_address"; "recipient_address"; "amount" ] in @@ -978,6 +1035,9 @@ Definition move_ether : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom move_ether_in_globals : + IsInGlobals globals "move_ether" (make_function move_ether). + Definition set_account_balance : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "state"; "address"; "amount" ] in @@ -1008,6 +1068,9 @@ Definition set_account_balance : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom set_account_balance_in_globals : + IsInGlobals globals "set_account_balance" (make_function set_account_balance). + Definition touch_account : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "state"; "address" ] in @@ -1052,6 +1115,9 @@ Definition touch_account : Value.t -> Value.t -> M := )) |) in M.pure Constant.None_)). +Axiom touch_account_in_globals : + IsInGlobals globals "touch_account" (make_function touch_account). + Definition increment_nonce : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "state"; "address" ] in @@ -1079,6 +1145,9 @@ Definition increment_nonce : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom increment_nonce_in_globals : + IsInGlobals globals "increment_nonce" (make_function increment_nonce). + Definition set_code : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "state"; "address"; "code" ] in @@ -1109,6 +1178,9 @@ Definition set_code : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom set_code_in_globals : + IsInGlobals globals "set_code" (make_function set_code). + Definition create_ether : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "state"; "address"; "amount" ] in @@ -1136,3 +1208,6 @@ Definition create_ether : Value.t -> Value.t -> M := make_dict [] |) in M.pure Constant.None_)). + +Axiom create_ether_in_globals : + IsInGlobals globals "create_ether" (make_function create_ether). diff --git a/CoqOfPython/ethereum/spurious_dragon/trie.v b/CoqOfPython/ethereum/spurious_dragon/trie.v index 308456a..8186244 100644 --- a/CoqOfPython/ethereum/spurious_dragon/trie.v +++ b/CoqOfPython/ethereum/spurious_dragon/trie.v @@ -365,6 +365,9 @@ Definition encode_internal_node : Value.t -> Value.t -> M := )) |) in M.pure Constant.None_)). +Axiom encode_internal_node_in_globals : + IsInGlobals globals "encode_internal_node" (make_function encode_internal_node). + Definition encode_node : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "node"; "storage_root" ] in @@ -473,6 +476,9 @@ Definition encode_node : Value.t -> Value.t -> M := )) |) in M.pure Constant.None_)). +Axiom encode_node_in_globals : + IsInGlobals globals "encode_node" (make_function encode_node). + Definition Trie : Value.t := builtins.make_klass [(* At base: unsupported node type: Subscript *)] @@ -520,6 +526,9 @@ Definition copy_trie : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom copy_trie_in_globals : + IsInGlobals globals "copy_trie" (make_function copy_trie). + Definition trie_set : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "trie"; "key"; "value" ] in @@ -580,6 +589,9 @@ Definition trie_set : Value.t -> Value.t -> M := )) |) in M.pure Constant.None_)). +Axiom trie_set_in_globals : + IsInGlobals globals "trie_set" (make_function trie_set). + Definition trie_get : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "trie"; "key" ] in @@ -613,6 +625,9 @@ Definition trie_get : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom trie_get_in_globals : + IsInGlobals globals "trie_get" (make_function trie_get). + Definition common_prefix_length : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "a"; "b" ] in @@ -691,6 +706,9 @@ Definition common_prefix_length : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom common_prefix_length_in_globals : + IsInGlobals globals "common_prefix_length" (make_function common_prefix_length). + Definition nibble_list_to_compact : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "x"; "is_leaf" ] in @@ -899,6 +917,9 @@ Definition nibble_list_to_compact : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom nibble_list_to_compact_in_globals : + IsInGlobals globals "nibble_list_to_compact" (make_function nibble_list_to_compact). + Definition bytes_to_nibble_list : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "bytes_" ] in @@ -995,6 +1016,9 @@ Definition bytes_to_nibble_list : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom bytes_to_nibble_list_in_globals : + IsInGlobals globals "bytes_to_nibble_list" (make_function bytes_to_nibble_list). + Definition _prepare_trie : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "trie"; "get_storage_root" ] in @@ -1146,6 +1170,9 @@ Definition _prepare_trie : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom _prepare_trie_in_globals : + IsInGlobals globals "_prepare_trie" (make_function _prepare_trie). + Definition root : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "trie"; "get_storage_root" ] in @@ -1261,6 +1288,9 @@ Definition root : Value.t -> Value.t -> M := )) |) in M.pure Constant.None_)). +Axiom root_in_globals : + IsInGlobals globals "root" (make_function root). + Definition patricialize : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "obj"; "level" ] in @@ -1600,3 +1630,6 @@ Definition patricialize : Value.t -> Value.t -> M := |) |) in M.pure Constant.None_)). + +Axiom patricialize_in_globals : + IsInGlobals globals "patricialize" (make_function patricialize). diff --git a/CoqOfPython/ethereum/spurious_dragon/utils/address.v b/CoqOfPython/ethereum/spurious_dragon/utils/address.v index cc80f3d..6c7f2fa 100644 --- a/CoqOfPython/ethereum/spurious_dragon/utils/address.v +++ b/CoqOfPython/ethereum/spurious_dragon/utils/address.v @@ -77,6 +77,9 @@ Definition to_address : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom to_address_in_globals : + IsInGlobals globals "to_address" (make_function to_address). + Definition compute_contract_address : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "address"; "nonce" ] in @@ -146,3 +149,6 @@ Definition compute_contract_address : Value.t -> Value.t -> M := |) |) in M.pure Constant.None_)). + +Axiom compute_contract_address_in_globals : + IsInGlobals globals "compute_contract_address" (make_function compute_contract_address). diff --git a/CoqOfPython/ethereum/spurious_dragon/utils/hexadecimal.v b/CoqOfPython/ethereum/spurious_dragon/utils/hexadecimal.v index 9848a7b..a05d566 100644 --- a/CoqOfPython/ethereum/spurious_dragon/utils/hexadecimal.v +++ b/CoqOfPython/ethereum/spurious_dragon/utils/hexadecimal.v @@ -70,6 +70,9 @@ Definition hex_to_root : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom hex_to_root_in_globals : + IsInGlobals globals "hex_to_root" (make_function hex_to_root). + Definition hex_to_bloom : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "hex_string" ] in @@ -110,6 +113,9 @@ Definition hex_to_bloom : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom hex_to_bloom_in_globals : + IsInGlobals globals "hex_to_bloom" (make_function hex_to_bloom). + Definition hex_to_address : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "hex_string" ] in @@ -156,3 +162,6 @@ Definition hex_to_address : Value.t -> Value.t -> M := |) |) in M.pure Constant.None_)). + +Axiom hex_to_address_in_globals : + IsInGlobals globals "hex_to_address" (make_function hex_to_address). diff --git a/CoqOfPython/ethereum/spurious_dragon/utils/message.v b/CoqOfPython/ethereum/spurious_dragon/utils/message.v index 9c1f9e7..7fca6ff 100644 --- a/CoqOfPython/ethereum/spurious_dragon/utils/message.v +++ b/CoqOfPython/ethereum/spurious_dragon/utils/message.v @@ -210,3 +210,6 @@ Definition prepare_message : Value.t -> Value.t -> M := |) |) in M.pure Constant.None_)). + +Axiom prepare_message_in_globals : + IsInGlobals globals "prepare_message" (make_function prepare_message). diff --git a/CoqOfPython/ethereum/spurious_dragon/vm/__init__.v b/CoqOfPython/ethereum/spurious_dragon/vm/__init__.v index 96afc79..9e0ded2 100644 --- a/CoqOfPython/ethereum/spurious_dragon/vm/__init__.v +++ b/CoqOfPython/ethereum/spurious_dragon/vm/__init__.v @@ -164,6 +164,9 @@ Definition incorporate_child_on_success : Value.t -> Value.t -> M := )) |) in M.pure Constant.None_)). +Axiom incorporate_child_on_success_in_globals : + IsInGlobals globals "incorporate_child_on_success" (make_function incorporate_child_on_success). + Definition incorporate_child_on_error : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm"; "child_evm" ] in @@ -244,3 +247,6 @@ Definition incorporate_child_on_error : Value.t -> Value.t -> M := M.get_field (| M.get_name (| globals, locals_stack, "child_evm" |), "gas_left" |) |) in M.pure Constant.None_)). + +Axiom incorporate_child_on_error_in_globals : + IsInGlobals globals "incorporate_child_on_error" (make_function incorporate_child_on_error). diff --git a/CoqOfPython/ethereum/spurious_dragon/vm/gas.v b/CoqOfPython/ethereum/spurious_dragon/vm/gas.v index 9462610..a9c89f9 100644 --- a/CoqOfPython/ethereum/spurious_dragon/vm/gas.v +++ b/CoqOfPython/ethereum/spurious_dragon/vm/gas.v @@ -513,6 +513,9 @@ Definition charge_gas : Value.t -> Value.t -> M := )) |) in M.pure Constant.None_)). +Axiom charge_gas_in_globals : + IsInGlobals globals "charge_gas" (make_function charge_gas). + Definition calculate_memory_gas_cost : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "size_in_bytes" ] in @@ -572,6 +575,9 @@ Definition calculate_memory_gas_cost : Value.t -> Value.t -> M := (* At stmt: unsupported node type: Try *) M.pure Constant.None_)). +Axiom calculate_memory_gas_cost_in_globals : + IsInGlobals globals "calculate_memory_gas_cost" (make_function calculate_memory_gas_cost). + Definition calculate_gas_extend_memory : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "memory"; "extensions" ] in @@ -755,6 +761,9 @@ Definition calculate_gas_extend_memory : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom calculate_gas_extend_memory_in_globals : + IsInGlobals globals "calculate_gas_extend_memory" (make_function calculate_gas_extend_memory). + Definition calculate_message_call_gas : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "value"; "gas"; "gas_left"; "memory_cost"; "extra_gas"; "call_stipend" ] in @@ -880,6 +889,9 @@ M.get_name (| globals, locals_stack, "call_stipend" |) |) in M.pure Constant.None_)). +Axiom calculate_message_call_gas_in_globals : + IsInGlobals globals "calculate_message_call_gas" (make_function calculate_message_call_gas). + Definition max_message_call_gas : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "gas" ] in @@ -907,3 +919,6 @@ Definition max_message_call_gas : Value.t -> Value.t -> M := |) |) in M.pure Constant.None_)). + +Axiom max_message_call_gas_in_globals : + IsInGlobals globals "max_message_call_gas" (make_function max_message_call_gas). diff --git a/CoqOfPython/ethereum/spurious_dragon/vm/instructions/arithmetic.v b/CoqOfPython/ethereum/spurious_dragon/vm/instructions/arithmetic.v index 1ba88bd..4288fb1 100644 --- a/CoqOfPython/ethereum/spurious_dragon/vm/instructions/arithmetic.v +++ b/CoqOfPython/ethereum/spurious_dragon/vm/instructions/arithmetic.v @@ -119,6 +119,9 @@ Definition add : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom add_in_globals : + IsInGlobals globals "add" (make_function add). + Definition sub : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -186,6 +189,9 @@ Definition sub : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom sub_in_globals : + IsInGlobals globals "sub" (make_function sub). + Definition mul : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -253,6 +259,9 @@ Definition mul : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom mul_in_globals : + IsInGlobals globals "mul" (make_function mul). + Definition div : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -341,6 +350,9 @@ Definition div : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom div_in_globals : + IsInGlobals globals "div" (make_function div). + Definition sdiv : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -491,6 +503,9 @@ Definition sdiv : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom sdiv_in_globals : + IsInGlobals globals "sdiv" (make_function sdiv). + Definition mod_ : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -579,6 +594,9 @@ Definition mod_ : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom mod__in_globals : + IsInGlobals globals "mod" (make_function mod_). + Definition smod : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -696,6 +714,9 @@ Definition smod : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom smod_in_globals : + IsInGlobals globals "smod" (make_function smod). + Definition addmod : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -821,6 +842,9 @@ Definition addmod : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom addmod_in_globals : + IsInGlobals globals "addmod" (make_function addmod). + Definition mulmod : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -946,6 +970,9 @@ Definition mulmod : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom mulmod_in_globals : + IsInGlobals globals "mulmod" (make_function mulmod). + Definition exp : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -1057,6 +1084,9 @@ Definition exp : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom exp_in_globals : + IsInGlobals globals "exp" (make_function exp). + Definition signextend : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -1231,3 +1261,6 @@ Definition signextend : Value.t -> Value.t -> M := Constant.int 1 |) in M.pure Constant.None_)). + +Axiom signextend_in_globals : + IsInGlobals globals "signextend" (make_function signextend). diff --git a/CoqOfPython/ethereum/spurious_dragon/vm/instructions/bitwise.v b/CoqOfPython/ethereum/spurious_dragon/vm/instructions/bitwise.v index 925d2d6..f35fe87 100644 --- a/CoqOfPython/ethereum/spurious_dragon/vm/instructions/bitwise.v +++ b/CoqOfPython/ethereum/spurious_dragon/vm/instructions/bitwise.v @@ -95,6 +95,9 @@ Definition bitwise_and : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom bitwise_and_in_globals : + IsInGlobals globals "bitwise_and" (make_function bitwise_and). + Definition bitwise_or : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -155,6 +158,9 @@ Definition bitwise_or : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom bitwise_or_in_globals : + IsInGlobals globals "bitwise_or" (make_function bitwise_or). + Definition bitwise_xor : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -215,6 +221,9 @@ Definition bitwise_xor : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom bitwise_xor_in_globals : + IsInGlobals globals "bitwise_xor" (make_function bitwise_xor). + Definition bitwise_not : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -262,6 +271,9 @@ Definition bitwise_not : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom bitwise_not_in_globals : + IsInGlobals globals "bitwise_not" (make_function bitwise_not). + Definition get_byte : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -377,3 +389,6 @@ Definition get_byte : Value.t -> Value.t -> M := Constant.int 1 |) in M.pure Constant.None_)). + +Axiom get_byte_in_globals : + IsInGlobals globals "get_byte" (make_function get_byte). diff --git a/CoqOfPython/ethereum/spurious_dragon/vm/instructions/block.v b/CoqOfPython/ethereum/spurious_dragon/vm/instructions/block.v index 4eaa164..a055f43 100644 --- a/CoqOfPython/ethereum/spurious_dragon/vm/instructions/block.v +++ b/CoqOfPython/ethereum/spurious_dragon/vm/instructions/block.v @@ -129,6 +129,9 @@ Definition block_hash : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom block_hash_in_globals : + IsInGlobals globals "block_hash" (make_function block_hash). + Definition coinbase : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -176,6 +179,9 @@ Definition coinbase : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom coinbase_in_globals : + IsInGlobals globals "coinbase" (make_function coinbase). + Definition timestamp : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -217,6 +223,9 @@ Definition timestamp : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom timestamp_in_globals : + IsInGlobals globals "timestamp" (make_function timestamp). + Definition number : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -263,6 +272,9 @@ Definition number : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom number_in_globals : + IsInGlobals globals "number" (make_function number). + Definition difficulty : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -309,6 +321,9 @@ Definition difficulty : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom difficulty_in_globals : + IsInGlobals globals "difficulty" (make_function difficulty). + Definition gas_limit : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -354,3 +369,6 @@ Definition gas_limit : Value.t -> Value.t -> M := Constant.int 1 |) in M.pure Constant.None_)). + +Axiom gas_limit_in_globals : + IsInGlobals globals "gas_limit" (make_function gas_limit). diff --git a/CoqOfPython/ethereum/spurious_dragon/vm/instructions/comparison.v b/CoqOfPython/ethereum/spurious_dragon/vm/instructions/comparison.v index bc0bd53..d9eb2db 100644 --- a/CoqOfPython/ethereum/spurious_dragon/vm/instructions/comparison.v +++ b/CoqOfPython/ethereum/spurious_dragon/vm/instructions/comparison.v @@ -105,6 +105,9 @@ Definition less_than : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom less_than_in_globals : + IsInGlobals globals "less_than" (make_function less_than). + Definition signed_less_than : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -182,6 +185,9 @@ Definition signed_less_than : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom signed_less_than_in_globals : + IsInGlobals globals "signed_less_than" (make_function signed_less_than). + Definition greater_than : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -252,6 +258,9 @@ Definition greater_than : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom greater_than_in_globals : + IsInGlobals globals "greater_than" (make_function greater_than). + Definition signed_greater_than : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -329,6 +338,9 @@ Definition signed_greater_than : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom signed_greater_than_in_globals : + IsInGlobals globals "signed_greater_than" (make_function signed_greater_than). + Definition equal : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -399,6 +411,9 @@ Definition equal : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom equal_in_globals : + IsInGlobals globals "equal" (make_function equal). + Definition is_zero : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -458,3 +473,6 @@ Definition is_zero : Value.t -> Value.t -> M := Constant.int 1 |) in M.pure Constant.None_)). + +Axiom is_zero_in_globals : + IsInGlobals globals "is_zero" (make_function is_zero). diff --git a/CoqOfPython/ethereum/spurious_dragon/vm/instructions/control_flow.v b/CoqOfPython/ethereum/spurious_dragon/vm/instructions/control_flow.v index 5673b3f..1b827c6 100644 --- a/CoqOfPython/ethereum/spurious_dragon/vm/instructions/control_flow.v +++ b/CoqOfPython/ethereum/spurious_dragon/vm/instructions/control_flow.v @@ -71,6 +71,9 @@ Definition stop : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom stop_in_globals : + IsInGlobals globals "stop" (make_function stop). + Definition jump : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -136,6 +139,9 @@ Definition jump : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom jump_in_globals : + IsInGlobals globals "jump" (make_function jump). + Definition jumpi : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -237,6 +243,9 @@ Definition jumpi : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom jumpi_in_globals : + IsInGlobals globals "jumpi" (make_function jumpi). + Definition pc : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -281,6 +290,9 @@ Definition pc : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom pc_in_globals : + IsInGlobals globals "pc" (make_function pc). + Definition gas_left : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -325,6 +337,9 @@ Definition gas_left : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom gas_left_in_globals : + IsInGlobals globals "gas_left" (make_function gas_left). + Definition jumpdest : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -356,3 +371,6 @@ Definition jumpdest : Value.t -> Value.t -> M := Constant.int 1 |) in M.pure Constant.None_)). + +Axiom jumpdest_in_globals : + IsInGlobals globals "jumpdest" (make_function jumpdest). diff --git a/CoqOfPython/ethereum/spurious_dragon/vm/instructions/environment.v b/CoqOfPython/ethereum/spurious_dragon/vm/instructions/environment.v index fff0fc8..9a3a6d9 100644 --- a/CoqOfPython/ethereum/spurious_dragon/vm/instructions/environment.v +++ b/CoqOfPython/ethereum/spurious_dragon/vm/instructions/environment.v @@ -104,6 +104,9 @@ Definition address : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom address_in_globals : + IsInGlobals globals "address" (make_function address). + Definition balance : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -167,6 +170,9 @@ Definition balance : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom balance_in_globals : + IsInGlobals globals "balance" (make_function balance). + Definition origin : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -211,6 +217,9 @@ Definition origin : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom origin_in_globals : + IsInGlobals globals "origin" (make_function origin). + Definition caller : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -254,6 +263,9 @@ Definition caller : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom caller_in_globals : + IsInGlobals globals "caller" (make_function caller). + Definition callvalue : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -291,6 +303,9 @@ Definition callvalue : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom callvalue_in_globals : + IsInGlobals globals "callvalue" (make_function callvalue). + Definition calldataload : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -362,6 +377,9 @@ Definition calldataload : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom calldataload_in_globals : + IsInGlobals globals "calldataload" (make_function calldataload). + Definition calldatasize : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -411,6 +429,9 @@ Definition calldatasize : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom calldatasize_in_globals : + IsInGlobals globals "calldatasize" (make_function calldatasize). + Definition calldatacopy : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -546,6 +567,9 @@ Definition calldatacopy : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom calldatacopy_in_globals : + IsInGlobals globals "calldatacopy" (make_function calldatacopy). + Definition codesize : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -595,6 +619,9 @@ Definition codesize : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom codesize_in_globals : + IsInGlobals globals "codesize" (make_function codesize). + Definition codecopy : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -730,6 +757,9 @@ Definition codecopy : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom codecopy_in_globals : + IsInGlobals globals "codecopy" (make_function codecopy). + Definition gasprice : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -773,6 +803,9 @@ Definition gasprice : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom gasprice_in_globals : + IsInGlobals globals "gasprice" (make_function gasprice). + Definition extcodesize : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -848,6 +881,9 @@ Definition extcodesize : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom extcodesize_in_globals : + IsInGlobals globals "extcodesize" (make_function extcodesize). + Definition extcodecopy : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -1006,3 +1042,6 @@ Definition extcodecopy : Value.t -> Value.t -> M := Constant.int 1 |) in M.pure Constant.None_)). + +Axiom extcodecopy_in_globals : + IsInGlobals globals "extcodecopy" (make_function extcodecopy). diff --git a/CoqOfPython/ethereum/spurious_dragon/vm/instructions/keccak.v b/CoqOfPython/ethereum/spurious_dragon/vm/instructions/keccak.v index d650183..524e469 100644 --- a/CoqOfPython/ethereum/spurious_dragon/vm/instructions/keccak.v +++ b/CoqOfPython/ethereum/spurious_dragon/vm/instructions/keccak.v @@ -189,3 +189,6 @@ Definition keccak : Value.t -> Value.t -> M := Constant.int 1 |) in M.pure Constant.None_)). + +Axiom keccak_in_globals : + IsInGlobals globals "keccak" (make_function keccak). diff --git a/CoqOfPython/ethereum/spurious_dragon/vm/instructions/log.v b/CoqOfPython/ethereum/spurious_dragon/vm/instructions/log.v index 5ac6e29..d837f42 100644 --- a/CoqOfPython/ethereum/spurious_dragon/vm/instructions/log.v +++ b/CoqOfPython/ethereum/spurious_dragon/vm/instructions/log.v @@ -194,6 +194,9 @@ Definition log_n : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom log_n_in_globals : + IsInGlobals globals "log_n" (make_function log_n). + Definition log0 : Value.t := M.run ltac:(M.monadic ( M.call (| M.get_name (| globals, locals_stack, "partial" |), diff --git a/CoqOfPython/ethereum/spurious_dragon/vm/instructions/memory.v b/CoqOfPython/ethereum/spurious_dragon/vm/instructions/memory.v index fd7b476..8dc0a77 100644 --- a/CoqOfPython/ethereum/spurious_dragon/vm/instructions/memory.v +++ b/CoqOfPython/ethereum/spurious_dragon/vm/instructions/memory.v @@ -145,6 +145,9 @@ Definition mstore : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom mstore_in_globals : + IsInGlobals globals "mstore" (make_function mstore). + Definition mstore8 : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -249,6 +252,9 @@ Definition mstore8 : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom mstore8_in_globals : + IsInGlobals globals "mstore8" (make_function mstore8). + Definition mload : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -349,6 +355,9 @@ Definition mload : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom mload_in_globals : + IsInGlobals globals "mload" (make_function mload). + Definition msize : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -397,3 +406,6 @@ Definition msize : Value.t -> Value.t -> M := Constant.int 1 |) in M.pure Constant.None_)). + +Axiom msize_in_globals : + IsInGlobals globals "msize" (make_function msize). diff --git a/CoqOfPython/ethereum/spurious_dragon/vm/instructions/stack.v b/CoqOfPython/ethereum/spurious_dragon/vm/instructions/stack.v index 89d8459..a0b8f8b 100644 --- a/CoqOfPython/ethereum/spurious_dragon/vm/instructions/stack.v +++ b/CoqOfPython/ethereum/spurious_dragon/vm/instructions/stack.v @@ -82,6 +82,9 @@ Definition pop : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom pop_in_globals : + IsInGlobals globals "pop" (make_function pop). + Definition push_n : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm"; "num_bytes" ] in @@ -159,6 +162,9 @@ Definition push_n : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom push_n_in_globals : + IsInGlobals globals "push_n" (make_function push_n). + Definition dup_n : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm"; "item_number" ] in @@ -236,6 +242,9 @@ Definition dup_n : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom dup_n_in_globals : + IsInGlobals globals "dup_n" (make_function dup_n). + Definition swap_n : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm"; "item_number" ] in @@ -312,6 +321,9 @@ Definition swap_n : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom swap_n_in_globals : + IsInGlobals globals "swap_n" (make_function swap_n). + Definition push1 : Value.t := M.run ltac:(M.monadic ( M.call (| M.get_name (| globals, locals_stack, "partial" |), diff --git a/CoqOfPython/ethereum/spurious_dragon/vm/instructions/storage.v b/CoqOfPython/ethereum/spurious_dragon/vm/instructions/storage.v index adb9427..86b368e 100644 --- a/CoqOfPython/ethereum/spurious_dragon/vm/instructions/storage.v +++ b/CoqOfPython/ethereum/spurious_dragon/vm/instructions/storage.v @@ -106,6 +106,9 @@ Definition sload : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom sload_in_globals : + IsInGlobals globals "sload" (make_function sload). + Definition sstore : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -236,3 +239,6 @@ Definition sstore : Value.t -> Value.t -> M := Constant.int 1 |) in M.pure Constant.None_)). + +Axiom sstore_in_globals : + IsInGlobals globals "sstore" (make_function sstore). diff --git a/CoqOfPython/ethereum/spurious_dragon/vm/instructions/system.v b/CoqOfPython/ethereum/spurious_dragon/vm/instructions/system.v index 0709924..a11cbca 100644 --- a/CoqOfPython/ethereum/spurious_dragon/vm/instructions/system.v +++ b/CoqOfPython/ethereum/spurious_dragon/vm/instructions/system.v @@ -425,6 +425,9 @@ Definition create : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom create_in_globals : + IsInGlobals globals "create" (make_function create). + Definition return_ : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -508,6 +511,9 @@ Definition return_ : Value.t -> Value.t -> M := let _ := M.pass (| |) in M.pure Constant.None_)). +Axiom return__in_globals : + IsInGlobals globals "return_" (make_function return_). + Definition generic_call : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm"; "gas"; "value"; "caller"; "to"; "code_address"; "should_transfer_value"; "memory_input_start_position"; "memory_input_size"; "memory_output_start_position"; "memory_output_size" ] in @@ -691,6 +697,9 @@ Definition generic_call : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom generic_call_in_globals : + IsInGlobals globals "generic_call" (make_function generic_call). + Definition call : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -968,6 +977,9 @@ M.get_name (| globals, locals_stack, "GAS_CALL_VALUE" |) |) in M.pure Constant.None_)). +Axiom call_in_globals : + IsInGlobals globals "call" (make_function call). + Definition callcode : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -1212,6 +1224,9 @@ M.get_name (| globals, locals_stack, "GAS_CALL_VALUE" |) |) in M.pure Constant.None_)). +Axiom callcode_in_globals : + IsInGlobals globals "callcode" (make_function callcode). + Definition selfdestruct : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -1433,6 +1448,9 @@ Definition selfdestruct : Value.t -> Value.t -> M := let _ := M.pass (| |) in M.pure Constant.None_)). +Axiom selfdestruct_in_globals : + IsInGlobals globals "selfdestruct" (make_function selfdestruct). + Definition delegatecall : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -1599,3 +1617,6 @@ Definition delegatecall : Value.t -> Value.t -> M := Constant.int 1 |) in M.pure Constant.None_)). + +Axiom delegatecall_in_globals : + IsInGlobals globals "delegatecall" (make_function delegatecall). diff --git a/CoqOfPython/ethereum/spurious_dragon/vm/interpreter.v b/CoqOfPython/ethereum/spurious_dragon/vm/interpreter.v index 06ea653..7491047 100644 --- a/CoqOfPython/ethereum/spurious_dragon/vm/interpreter.v +++ b/CoqOfPython/ethereum/spurious_dragon/vm/interpreter.v @@ -394,6 +394,9 @@ Definition process_message_call : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom process_message_call_in_globals : + IsInGlobals globals "process_message_call" (make_function process_message_call). + Definition process_create_message : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "message"; "env" ] in @@ -488,6 +491,9 @@ Definition process_create_message : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom process_create_message_in_globals : + IsInGlobals globals "process_create_message" (make_function process_create_message). + Definition process_message : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "message"; "env" ] in @@ -613,6 +619,9 @@ Definition process_message : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom process_message_in_globals : + IsInGlobals globals "process_message" (make_function process_message). + Definition execute_code : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "message"; "env" ] in @@ -659,3 +668,6 @@ Definition execute_code : Value.t -> Value.t -> M := M.get_name (| globals, locals_stack, "evm" |) |) in M.pure Constant.None_)). + +Axiom execute_code_in_globals : + IsInGlobals globals "execute_code" (make_function execute_code). diff --git a/CoqOfPython/ethereum/spurious_dragon/vm/memory.v b/CoqOfPython/ethereum/spurious_dragon/vm/memory.v index 6996c23..1750dc1 100644 --- a/CoqOfPython/ethereum/spurious_dragon/vm/memory.v +++ b/CoqOfPython/ethereum/spurious_dragon/vm/memory.v @@ -71,6 +71,9 @@ Definition memory_write : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom memory_write_in_globals : + IsInGlobals globals "memory_write" (make_function memory_write). + Definition memory_read_bytes : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "memory"; "start_position"; "size" ] in @@ -117,6 +120,9 @@ Definition memory_read_bytes : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom memory_read_bytes_in_globals : + IsInGlobals globals "memory_read_bytes" (make_function memory_read_bytes). + Definition buffer_read : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "buffer"; "start_position"; "size" ] in @@ -169,3 +175,6 @@ Definition buffer_read : Value.t -> Value.t -> M := |) |) in M.pure Constant.None_)). + +Axiom buffer_read_in_globals : + IsInGlobals globals "buffer_read" (make_function buffer_read). diff --git a/CoqOfPython/ethereum/spurious_dragon/vm/precompiled_contracts/ecrecover.v b/CoqOfPython/ethereum/spurious_dragon/vm/precompiled_contracts/ecrecover.v index 4c51c76..1e8e8ef 100644 --- a/CoqOfPython/ethereum/spurious_dragon/vm/precompiled_contracts/ecrecover.v +++ b/CoqOfPython/ethereum/spurious_dragon/vm/precompiled_contracts/ecrecover.v @@ -302,3 +302,6 @@ Definition ecrecover : Value.t -> Value.t -> M := M.get_name (| globals, locals_stack, "padded_address" |) |) in M.pure Constant.None_)). + +Axiom ecrecover_in_globals : + IsInGlobals globals "ecrecover" (make_function ecrecover). diff --git a/CoqOfPython/ethereum/spurious_dragon/vm/precompiled_contracts/identity.v b/CoqOfPython/ethereum/spurious_dragon/vm/precompiled_contracts/identity.v index a610f97..4818b55 100644 --- a/CoqOfPython/ethereum/spurious_dragon/vm/precompiled_contracts/identity.v +++ b/CoqOfPython/ethereum/spurious_dragon/vm/precompiled_contracts/identity.v @@ -95,3 +95,6 @@ Definition identity : Value.t -> Value.t -> M := M.get_name (| globals, locals_stack, "data" |) |) in M.pure Constant.None_)). + +Axiom identity_in_globals : + IsInGlobals globals "identity" (make_function identity). diff --git a/CoqOfPython/ethereum/spurious_dragon/vm/precompiled_contracts/ripemd160.v b/CoqOfPython/ethereum/spurious_dragon/vm/precompiled_contracts/ripemd160.v index 518a15d..c3685d4 100644 --- a/CoqOfPython/ethereum/spurious_dragon/vm/precompiled_contracts/ripemd160.v +++ b/CoqOfPython/ethereum/spurious_dragon/vm/precompiled_contracts/ripemd160.v @@ -126,3 +126,6 @@ Definition ripemd160 : Value.t -> Value.t -> M := M.get_name (| globals, locals_stack, "padded_hash" |) |) in M.pure Constant.None_)). + +Axiom ripemd160_in_globals : + IsInGlobals globals "ripemd160" (make_function ripemd160). diff --git a/CoqOfPython/ethereum/spurious_dragon/vm/precompiled_contracts/sha256.v b/CoqOfPython/ethereum/spurious_dragon/vm/precompiled_contracts/sha256.v index 19322f3..c7268c2 100644 --- a/CoqOfPython/ethereum/spurious_dragon/vm/precompiled_contracts/sha256.v +++ b/CoqOfPython/ethereum/spurious_dragon/vm/precompiled_contracts/sha256.v @@ -107,3 +107,6 @@ Definition sha256 : Value.t -> Value.t -> M := |) |) in M.pure Constant.None_)). + +Axiom sha256_in_globals : + IsInGlobals globals "sha256" (make_function sha256). diff --git a/CoqOfPython/ethereum/spurious_dragon/vm/runtime.v b/CoqOfPython/ethereum/spurious_dragon/vm/runtime.v index bf9c04b..4374122 100644 --- a/CoqOfPython/ethereum/spurious_dragon/vm/runtime.v +++ b/CoqOfPython/ethereum/spurious_dragon/vm/runtime.v @@ -158,3 +158,6 @@ Definition get_valid_jump_destinations : Value.t -> Value.t -> M := M.get_name (| globals, locals_stack, "valid_jump_destinations" |) |) in M.pure Constant.None_)). + +Axiom get_valid_jump_destinations_in_globals : + IsInGlobals globals "get_valid_jump_destinations" (make_function get_valid_jump_destinations). diff --git a/CoqOfPython/ethereum/spurious_dragon/vm/stack.v b/CoqOfPython/ethereum/spurious_dragon/vm/stack.v index 85f5983..8fb22b8 100644 --- a/CoqOfPython/ethereum/spurious_dragon/vm/stack.v +++ b/CoqOfPython/ethereum/spurious_dragon/vm/stack.v @@ -78,6 +78,9 @@ Definition pop : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom pop_in_globals : + IsInGlobals globals "pop" (make_function pop). + Definition push : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "stack"; "value" ] in @@ -125,3 +128,6 @@ Definition push : Value.t -> Value.t -> M := |) |) in M.pure Constant.None_)). + +Axiom push_in_globals : + IsInGlobals globals "push" (make_function push). diff --git a/CoqOfPython/ethereum/tangerine_whistle/bloom.v b/CoqOfPython/ethereum/tangerine_whistle/bloom.v index 263f8cb..465096e 100644 --- a/CoqOfPython/ethereum/tangerine_whistle/bloom.v +++ b/CoqOfPython/ethereum/tangerine_whistle/bloom.v @@ -140,6 +140,9 @@ Definition add_to_bloom : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom add_to_bloom_in_globals : + IsInGlobals globals "add_to_bloom" (make_function add_to_bloom). + Definition logs_bloom : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "logs" ] in @@ -209,3 +212,6 @@ Definition logs_bloom : Value.t -> Value.t -> M := |) |) in M.pure Constant.None_)). + +Axiom logs_bloom_in_globals : + IsInGlobals globals "logs_bloom" (make_function logs_bloom). diff --git a/CoqOfPython/ethereum/tangerine_whistle/fork.v b/CoqOfPython/ethereum/tangerine_whistle/fork.v index 3658e86..67fab1f 100644 --- a/CoqOfPython/ethereum/tangerine_whistle/fork.v +++ b/CoqOfPython/ethereum/tangerine_whistle/fork.v @@ -209,6 +209,9 @@ Definition apply_fork : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom apply_fork_in_globals : + IsInGlobals globals "apply_fork" (make_function apply_fork). + Definition get_last_256_block_hashes : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "chain" ] in @@ -321,6 +324,9 @@ Definition get_last_256_block_hashes : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom get_last_256_block_hashes_in_globals : + IsInGlobals globals "get_last_256_block_hashes" (make_function get_last_256_block_hashes). + Definition state_transition : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "chain"; "block" ] in @@ -487,6 +493,9 @@ Definition state_transition : Value.t -> Value.t -> M := )) |) in M.pure Constant.None_)). +Axiom state_transition_in_globals : + IsInGlobals globals "state_transition" (make_function state_transition). + Definition validate_header : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "header"; "parent_header" ] in @@ -625,6 +634,9 @@ Definition validate_header : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom validate_header_in_globals : + IsInGlobals globals "validate_header" (make_function validate_header). + Definition generate_header_hash_for_pow : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "header" ] in @@ -680,6 +692,9 @@ Definition generate_header_hash_for_pow : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom generate_header_hash_for_pow_in_globals : + IsInGlobals globals "generate_header_hash_for_pow" (make_function generate_header_hash_for_pow). + Definition validate_proof_of_work : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "header" ] in @@ -770,6 +785,9 @@ Definition validate_proof_of_work : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom validate_proof_of_work_in_globals : + IsInGlobals globals "validate_proof_of_work" (make_function validate_proof_of_work). + Definition check_transaction : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "tx"; "gas_available" ] in @@ -820,6 +838,9 @@ Definition check_transaction : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom check_transaction_in_globals : + IsInGlobals globals "check_transaction" (make_function check_transaction). + Definition make_receipt : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "tx"; "post_state"; "cumulative_gas_used"; "logs" ] in @@ -857,6 +878,9 @@ Definition make_receipt : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom make_receipt_in_globals : + IsInGlobals globals "make_receipt" (make_function make_receipt). + Definition ApplyBodyOutput : Value.t := builtins.make_klass [] @@ -1097,6 +1121,9 @@ Definition apply_body : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom apply_body_in_globals : + IsInGlobals globals "apply_body" (make_function apply_body). + Definition validate_ommers : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "ommers"; "block_header"; "chain" ] in @@ -1418,6 +1445,9 @@ Definition validate_ommers : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom validate_ommers_in_globals : + IsInGlobals globals "validate_ommers" (make_function validate_ommers). + Definition pay_rewards : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "state"; "block_number"; "coinbase"; "ommers" ] in @@ -1523,6 +1553,9 @@ Definition pay_rewards : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom pay_rewards_in_globals : + IsInGlobals globals "pay_rewards" (make_function pay_rewards). + Definition process_transaction : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "env"; "tx" ] in @@ -1813,6 +1846,9 @@ Definition process_transaction : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom process_transaction_in_globals : + IsInGlobals globals "process_transaction" (make_function process_transaction). + Definition validate_transaction : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "tx" ] in @@ -1869,6 +1905,9 @@ Definition validate_transaction : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom validate_transaction_in_globals : + IsInGlobals globals "validate_transaction" (make_function validate_transaction). + Definition calculate_intrinsic_cost : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "tx" ] in @@ -1979,6 +2018,9 @@ Definition calculate_intrinsic_cost : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom calculate_intrinsic_cost_in_globals : + IsInGlobals globals "calculate_intrinsic_cost" (make_function calculate_intrinsic_cost). + Definition recover_sender : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "tx" ] in @@ -2110,6 +2152,9 @@ Definition recover_sender : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom recover_sender_in_globals : + IsInGlobals globals "recover_sender" (make_function recover_sender). + Definition signing_hash : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "tx" ] in @@ -2148,6 +2193,9 @@ Definition signing_hash : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom signing_hash_in_globals : + IsInGlobals globals "signing_hash" (make_function signing_hash). + Definition compute_header_hash : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "header" ] in @@ -2200,6 +2248,9 @@ Definition compute_header_hash : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom compute_header_hash_in_globals : + IsInGlobals globals "compute_header_hash" (make_function compute_header_hash). + Definition check_gas_limit : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "gas_limit"; "parent_gas_limit" ] in @@ -2300,6 +2351,9 @@ Definition check_gas_limit : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom check_gas_limit_in_globals : + IsInGlobals globals "check_gas_limit" (make_function check_gas_limit). + Definition calculate_block_difficulty : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "block_number"; "block_timestamp"; "parent_timestamp"; "parent_difficulty" ] in @@ -2446,3 +2500,6 @@ Definition calculate_block_difficulty : Value.t -> Value.t -> M := |) |) in M.pure Constant.None_)). + +Axiom calculate_block_difficulty_in_globals : + IsInGlobals globals "calculate_block_difficulty" (make_function calculate_block_difficulty). diff --git a/CoqOfPython/ethereum/tangerine_whistle/fork_types.v b/CoqOfPython/ethereum/tangerine_whistle/fork_types.v index 76d92b0..eafa82a 100644 --- a/CoqOfPython/ethereum/tangerine_whistle/fork_types.v +++ b/CoqOfPython/ethereum/tangerine_whistle/fork_types.v @@ -99,3 +99,6 @@ Definition encode_account : Value.t -> Value.t -> M := |) |) in M.pure Constant.None_)). + +Axiom encode_account_in_globals : + IsInGlobals globals "encode_account" (make_function encode_account). diff --git a/CoqOfPython/ethereum/tangerine_whistle/state.v b/CoqOfPython/ethereum/tangerine_whistle/state.v index d94f612..1f1a695 100644 --- a/CoqOfPython/ethereum/tangerine_whistle/state.v +++ b/CoqOfPython/ethereum/tangerine_whistle/state.v @@ -97,6 +97,9 @@ Definition close_state : Value.t -> Value.t -> M := let _ := M.delete (| M.get_field (| M.get_name (| globals, locals_stack, "state" |), "_snapshots" |) |) in M.pure Constant.None_)). +Axiom close_state_in_globals : + IsInGlobals globals "close_state" (make_function close_state). + Definition begin_transaction : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "state" ] in @@ -127,6 +130,9 @@ Definition begin_transaction : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom begin_transaction_in_globals : + IsInGlobals globals "begin_transaction" (make_function begin_transaction). + Definition commit_transaction : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "state" ] in @@ -146,6 +152,9 @@ Definition commit_transaction : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom commit_transaction_in_globals : + IsInGlobals globals "commit_transaction" (make_function commit_transaction). + Definition rollback_transaction : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "state" ] in @@ -169,6 +178,9 @@ Definition rollback_transaction : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom rollback_transaction_in_globals : + IsInGlobals globals "rollback_transaction" (make_function rollback_transaction). + Definition get_account : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "state"; "address" ] in @@ -229,6 +241,9 @@ Definition get_account : Value.t -> Value.t -> M := )) |) in M.pure Constant.None_)). +Axiom get_account_in_globals : + IsInGlobals globals "get_account" (make_function get_account). + Definition get_account_optional : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "state"; "address" ] in @@ -265,6 +280,9 @@ Definition get_account_optional : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom get_account_optional_in_globals : + IsInGlobals globals "get_account_optional" (make_function get_account_optional). + Definition set_account : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "state"; "address"; "account" ] in @@ -293,6 +311,9 @@ Definition set_account : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom set_account_in_globals : + IsInGlobals globals "set_account" (make_function set_account). + Definition destroy_account : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "state"; "address" ] in @@ -330,6 +351,9 @@ Definition destroy_account : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom destroy_account_in_globals : + IsInGlobals globals "destroy_account" (make_function destroy_account). + Definition destroy_storage : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "state"; "address" ] in @@ -364,6 +388,9 @@ Definition destroy_storage : Value.t -> Value.t -> M := )) |) in M.pure Constant.None_)). +Axiom destroy_storage_in_globals : + IsInGlobals globals "destroy_storage" (make_function destroy_storage). + Definition get_storage : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "state"; "address"; "key" ] in @@ -443,6 +470,9 @@ Definition get_storage : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom get_storage_in_globals : + IsInGlobals globals "get_storage" (make_function get_storage). + Definition set_storage : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "state"; "address"; "key"; "value" ] in @@ -541,6 +571,9 @@ Definition set_storage : Value.t -> Value.t -> M := )) |) in M.pure Constant.None_)). +Axiom set_storage_in_globals : + IsInGlobals globals "set_storage" (make_function set_storage). + Definition storage_root : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "state"; "address" ] in @@ -592,6 +625,9 @@ Definition storage_root : Value.t -> Value.t -> M := )) |) in M.pure Constant.None_)). +Axiom storage_root_in_globals : + IsInGlobals globals "storage_root" (make_function storage_root). + Definition state_root : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "state" ] in @@ -622,6 +658,9 @@ Definition state_root : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom state_root_in_globals : + IsInGlobals globals "state_root" (make_function state_root). + Definition account_exists : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "state"; "address" ] in @@ -656,6 +695,9 @@ Definition account_exists : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom account_exists_in_globals : + IsInGlobals globals "account_exists" (make_function account_exists). + Definition account_has_code_or_nonce : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "state"; "address" ] in @@ -709,6 +751,9 @@ Definition account_has_code_or_nonce : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom account_has_code_or_nonce_in_globals : + IsInGlobals globals "account_has_code_or_nonce" (make_function account_has_code_or_nonce). + Definition modify_state : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "state"; "address"; "f" ] in @@ -741,6 +786,9 @@ Definition modify_state : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom modify_state_in_globals : + IsInGlobals globals "modify_state" (make_function modify_state). + Definition move_ether : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "state"; "sender_address"; "recipient_address"; "amount" ] in @@ -770,6 +818,9 @@ Definition move_ether : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom move_ether_in_globals : + IsInGlobals globals "move_ether" (make_function move_ether). + Definition set_account_balance : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "state"; "address"; "amount" ] in @@ -800,6 +851,9 @@ Definition set_account_balance : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom set_account_balance_in_globals : + IsInGlobals globals "set_account_balance" (make_function set_account_balance). + Definition touch_account : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "state"; "address" ] in @@ -844,6 +898,9 @@ Definition touch_account : Value.t -> Value.t -> M := )) |) in M.pure Constant.None_)). +Axiom touch_account_in_globals : + IsInGlobals globals "touch_account" (make_function touch_account). + Definition increment_nonce : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "state"; "address" ] in @@ -871,6 +928,9 @@ Definition increment_nonce : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom increment_nonce_in_globals : + IsInGlobals globals "increment_nonce" (make_function increment_nonce). + Definition set_code : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "state"; "address"; "code" ] in @@ -901,6 +961,9 @@ Definition set_code : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom set_code_in_globals : + IsInGlobals globals "set_code" (make_function set_code). + Definition create_ether : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "state"; "address"; "amount" ] in @@ -928,3 +991,6 @@ Definition create_ether : Value.t -> Value.t -> M := make_dict [] |) in M.pure Constant.None_)). + +Axiom create_ether_in_globals : + IsInGlobals globals "create_ether" (make_function create_ether). diff --git a/CoqOfPython/ethereum/tangerine_whistle/trie.v b/CoqOfPython/ethereum/tangerine_whistle/trie.v index 2e13011..cf17d7f 100644 --- a/CoqOfPython/ethereum/tangerine_whistle/trie.v +++ b/CoqOfPython/ethereum/tangerine_whistle/trie.v @@ -365,6 +365,9 @@ Definition encode_internal_node : Value.t -> Value.t -> M := )) |) in M.pure Constant.None_)). +Axiom encode_internal_node_in_globals : + IsInGlobals globals "encode_internal_node" (make_function encode_internal_node). + Definition encode_node : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "node"; "storage_root" ] in @@ -473,6 +476,9 @@ Definition encode_node : Value.t -> Value.t -> M := )) |) in M.pure Constant.None_)). +Axiom encode_node_in_globals : + IsInGlobals globals "encode_node" (make_function encode_node). + Definition Trie : Value.t := builtins.make_klass [(* At base: unsupported node type: Subscript *)] @@ -520,6 +526,9 @@ Definition copy_trie : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom copy_trie_in_globals : + IsInGlobals globals "copy_trie" (make_function copy_trie). + Definition trie_set : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "trie"; "key"; "value" ] in @@ -580,6 +589,9 @@ Definition trie_set : Value.t -> Value.t -> M := )) |) in M.pure Constant.None_)). +Axiom trie_set_in_globals : + IsInGlobals globals "trie_set" (make_function trie_set). + Definition trie_get : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "trie"; "key" ] in @@ -613,6 +625,9 @@ Definition trie_get : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom trie_get_in_globals : + IsInGlobals globals "trie_get" (make_function trie_get). + Definition common_prefix_length : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "a"; "b" ] in @@ -691,6 +706,9 @@ Definition common_prefix_length : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom common_prefix_length_in_globals : + IsInGlobals globals "common_prefix_length" (make_function common_prefix_length). + Definition nibble_list_to_compact : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "x"; "is_leaf" ] in @@ -899,6 +917,9 @@ Definition nibble_list_to_compact : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom nibble_list_to_compact_in_globals : + IsInGlobals globals "nibble_list_to_compact" (make_function nibble_list_to_compact). + Definition bytes_to_nibble_list : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "bytes_" ] in @@ -995,6 +1016,9 @@ Definition bytes_to_nibble_list : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom bytes_to_nibble_list_in_globals : + IsInGlobals globals "bytes_to_nibble_list" (make_function bytes_to_nibble_list). + Definition _prepare_trie : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "trie"; "get_storage_root" ] in @@ -1146,6 +1170,9 @@ Definition _prepare_trie : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom _prepare_trie_in_globals : + IsInGlobals globals "_prepare_trie" (make_function _prepare_trie). + Definition root : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "trie"; "get_storage_root" ] in @@ -1261,6 +1288,9 @@ Definition root : Value.t -> Value.t -> M := )) |) in M.pure Constant.None_)). +Axiom root_in_globals : + IsInGlobals globals "root" (make_function root). + Definition patricialize : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "obj"; "level" ] in @@ -1600,3 +1630,6 @@ Definition patricialize : Value.t -> Value.t -> M := |) |) in M.pure Constant.None_)). + +Axiom patricialize_in_globals : + IsInGlobals globals "patricialize" (make_function patricialize). diff --git a/CoqOfPython/ethereum/tangerine_whistle/utils/address.v b/CoqOfPython/ethereum/tangerine_whistle/utils/address.v index 53b2410..9d543a0 100644 --- a/CoqOfPython/ethereum/tangerine_whistle/utils/address.v +++ b/CoqOfPython/ethereum/tangerine_whistle/utils/address.v @@ -77,6 +77,9 @@ Definition to_address : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom to_address_in_globals : + IsInGlobals globals "to_address" (make_function to_address). + Definition compute_contract_address : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "address"; "nonce" ] in @@ -146,3 +149,6 @@ Definition compute_contract_address : Value.t -> Value.t -> M := |) |) in M.pure Constant.None_)). + +Axiom compute_contract_address_in_globals : + IsInGlobals globals "compute_contract_address" (make_function compute_contract_address). diff --git a/CoqOfPython/ethereum/tangerine_whistle/utils/hexadecimal.v b/CoqOfPython/ethereum/tangerine_whistle/utils/hexadecimal.v index d556869..5257e3a 100644 --- a/CoqOfPython/ethereum/tangerine_whistle/utils/hexadecimal.v +++ b/CoqOfPython/ethereum/tangerine_whistle/utils/hexadecimal.v @@ -70,6 +70,9 @@ Definition hex_to_root : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom hex_to_root_in_globals : + IsInGlobals globals "hex_to_root" (make_function hex_to_root). + Definition hex_to_bloom : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "hex_string" ] in @@ -110,6 +113,9 @@ Definition hex_to_bloom : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom hex_to_bloom_in_globals : + IsInGlobals globals "hex_to_bloom" (make_function hex_to_bloom). + Definition hex_to_address : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "hex_string" ] in @@ -156,3 +162,6 @@ Definition hex_to_address : Value.t -> Value.t -> M := |) |) in M.pure Constant.None_)). + +Axiom hex_to_address_in_globals : + IsInGlobals globals "hex_to_address" (make_function hex_to_address). diff --git a/CoqOfPython/ethereum/tangerine_whistle/utils/message.v b/CoqOfPython/ethereum/tangerine_whistle/utils/message.v index d1df2f2..c9ea0c5 100644 --- a/CoqOfPython/ethereum/tangerine_whistle/utils/message.v +++ b/CoqOfPython/ethereum/tangerine_whistle/utils/message.v @@ -210,3 +210,6 @@ Definition prepare_message : Value.t -> Value.t -> M := |) |) in M.pure Constant.None_)). + +Axiom prepare_message_in_globals : + IsInGlobals globals "prepare_message" (make_function prepare_message). diff --git a/CoqOfPython/ethereum/tangerine_whistle/vm/__init__.v b/CoqOfPython/ethereum/tangerine_whistle/vm/__init__.v index 27b6aff..05e2952 100644 --- a/CoqOfPython/ethereum/tangerine_whistle/vm/__init__.v +++ b/CoqOfPython/ethereum/tangerine_whistle/vm/__init__.v @@ -127,6 +127,9 @@ Definition incorporate_child_on_success : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom incorporate_child_on_success_in_globals : + IsInGlobals globals "incorporate_child_on_success" (make_function incorporate_child_on_success). + Definition incorporate_child_on_error : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm"; "child_evm" ] in @@ -147,3 +150,6 @@ Definition incorporate_child_on_error : Value.t -> Value.t -> M := M.get_field (| M.get_name (| globals, locals_stack, "child_evm" |), "gas_left" |) |) in M.pure Constant.None_)). + +Axiom incorporate_child_on_error_in_globals : + IsInGlobals globals "incorporate_child_on_error" (make_function incorporate_child_on_error). diff --git a/CoqOfPython/ethereum/tangerine_whistle/vm/gas.v b/CoqOfPython/ethereum/tangerine_whistle/vm/gas.v index 82655cc..fe39510 100644 --- a/CoqOfPython/ethereum/tangerine_whistle/vm/gas.v +++ b/CoqOfPython/ethereum/tangerine_whistle/vm/gas.v @@ -513,6 +513,9 @@ Definition charge_gas : Value.t -> Value.t -> M := )) |) in M.pure Constant.None_)). +Axiom charge_gas_in_globals : + IsInGlobals globals "charge_gas" (make_function charge_gas). + Definition calculate_memory_gas_cost : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "size_in_bytes" ] in @@ -572,6 +575,9 @@ Definition calculate_memory_gas_cost : Value.t -> Value.t -> M := (* At stmt: unsupported node type: Try *) M.pure Constant.None_)). +Axiom calculate_memory_gas_cost_in_globals : + IsInGlobals globals "calculate_memory_gas_cost" (make_function calculate_memory_gas_cost). + Definition calculate_gas_extend_memory : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "memory"; "extensions" ] in @@ -755,6 +761,9 @@ Definition calculate_gas_extend_memory : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom calculate_gas_extend_memory_in_globals : + IsInGlobals globals "calculate_gas_extend_memory" (make_function calculate_gas_extend_memory). + Definition calculate_message_call_gas : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "value"; "gas"; "gas_left"; "memory_cost"; "extra_gas"; "call_stipend" ] in @@ -880,6 +889,9 @@ M.get_name (| globals, locals_stack, "call_stipend" |) |) in M.pure Constant.None_)). +Axiom calculate_message_call_gas_in_globals : + IsInGlobals globals "calculate_message_call_gas" (make_function calculate_message_call_gas). + Definition max_message_call_gas : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "gas" ] in @@ -907,3 +919,6 @@ Definition max_message_call_gas : Value.t -> Value.t -> M := |) |) in M.pure Constant.None_)). + +Axiom max_message_call_gas_in_globals : + IsInGlobals globals "max_message_call_gas" (make_function max_message_call_gas). diff --git a/CoqOfPython/ethereum/tangerine_whistle/vm/instructions/arithmetic.v b/CoqOfPython/ethereum/tangerine_whistle/vm/instructions/arithmetic.v index ef45b8a..cd31f40 100644 --- a/CoqOfPython/ethereum/tangerine_whistle/vm/instructions/arithmetic.v +++ b/CoqOfPython/ethereum/tangerine_whistle/vm/instructions/arithmetic.v @@ -119,6 +119,9 @@ Definition add : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom add_in_globals : + IsInGlobals globals "add" (make_function add). + Definition sub : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -186,6 +189,9 @@ Definition sub : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom sub_in_globals : + IsInGlobals globals "sub" (make_function sub). + Definition mul : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -253,6 +259,9 @@ Definition mul : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom mul_in_globals : + IsInGlobals globals "mul" (make_function mul). + Definition div : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -341,6 +350,9 @@ Definition div : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom div_in_globals : + IsInGlobals globals "div" (make_function div). + Definition sdiv : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -491,6 +503,9 @@ Definition sdiv : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom sdiv_in_globals : + IsInGlobals globals "sdiv" (make_function sdiv). + Definition mod_ : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -579,6 +594,9 @@ Definition mod_ : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom mod__in_globals : + IsInGlobals globals "mod" (make_function mod_). + Definition smod : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -696,6 +714,9 @@ Definition smod : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom smod_in_globals : + IsInGlobals globals "smod" (make_function smod). + Definition addmod : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -821,6 +842,9 @@ Definition addmod : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom addmod_in_globals : + IsInGlobals globals "addmod" (make_function addmod). + Definition mulmod : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -946,6 +970,9 @@ Definition mulmod : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom mulmod_in_globals : + IsInGlobals globals "mulmod" (make_function mulmod). + Definition exp : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -1057,6 +1084,9 @@ Definition exp : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom exp_in_globals : + IsInGlobals globals "exp" (make_function exp). + Definition signextend : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -1231,3 +1261,6 @@ Definition signextend : Value.t -> Value.t -> M := Constant.int 1 |) in M.pure Constant.None_)). + +Axiom signextend_in_globals : + IsInGlobals globals "signextend" (make_function signextend). diff --git a/CoqOfPython/ethereum/tangerine_whistle/vm/instructions/bitwise.v b/CoqOfPython/ethereum/tangerine_whistle/vm/instructions/bitwise.v index e3d76aa..c191f13 100644 --- a/CoqOfPython/ethereum/tangerine_whistle/vm/instructions/bitwise.v +++ b/CoqOfPython/ethereum/tangerine_whistle/vm/instructions/bitwise.v @@ -95,6 +95,9 @@ Definition bitwise_and : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom bitwise_and_in_globals : + IsInGlobals globals "bitwise_and" (make_function bitwise_and). + Definition bitwise_or : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -155,6 +158,9 @@ Definition bitwise_or : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom bitwise_or_in_globals : + IsInGlobals globals "bitwise_or" (make_function bitwise_or). + Definition bitwise_xor : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -215,6 +221,9 @@ Definition bitwise_xor : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom bitwise_xor_in_globals : + IsInGlobals globals "bitwise_xor" (make_function bitwise_xor). + Definition bitwise_not : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -262,6 +271,9 @@ Definition bitwise_not : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom bitwise_not_in_globals : + IsInGlobals globals "bitwise_not" (make_function bitwise_not). + Definition get_byte : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -377,3 +389,6 @@ Definition get_byte : Value.t -> Value.t -> M := Constant.int 1 |) in M.pure Constant.None_)). + +Axiom get_byte_in_globals : + IsInGlobals globals "get_byte" (make_function get_byte). diff --git a/CoqOfPython/ethereum/tangerine_whistle/vm/instructions/block.v b/CoqOfPython/ethereum/tangerine_whistle/vm/instructions/block.v index 55ba480..ee8f109 100644 --- a/CoqOfPython/ethereum/tangerine_whistle/vm/instructions/block.v +++ b/CoqOfPython/ethereum/tangerine_whistle/vm/instructions/block.v @@ -129,6 +129,9 @@ Definition block_hash : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom block_hash_in_globals : + IsInGlobals globals "block_hash" (make_function block_hash). + Definition coinbase : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -176,6 +179,9 @@ Definition coinbase : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom coinbase_in_globals : + IsInGlobals globals "coinbase" (make_function coinbase). + Definition timestamp : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -217,6 +223,9 @@ Definition timestamp : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom timestamp_in_globals : + IsInGlobals globals "timestamp" (make_function timestamp). + Definition number : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -263,6 +272,9 @@ Definition number : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom number_in_globals : + IsInGlobals globals "number" (make_function number). + Definition difficulty : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -309,6 +321,9 @@ Definition difficulty : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom difficulty_in_globals : + IsInGlobals globals "difficulty" (make_function difficulty). + Definition gas_limit : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -354,3 +369,6 @@ Definition gas_limit : Value.t -> Value.t -> M := Constant.int 1 |) in M.pure Constant.None_)). + +Axiom gas_limit_in_globals : + IsInGlobals globals "gas_limit" (make_function gas_limit). diff --git a/CoqOfPython/ethereum/tangerine_whistle/vm/instructions/comparison.v b/CoqOfPython/ethereum/tangerine_whistle/vm/instructions/comparison.v index d7aaec2..25113db 100644 --- a/CoqOfPython/ethereum/tangerine_whistle/vm/instructions/comparison.v +++ b/CoqOfPython/ethereum/tangerine_whistle/vm/instructions/comparison.v @@ -105,6 +105,9 @@ Definition less_than : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom less_than_in_globals : + IsInGlobals globals "less_than" (make_function less_than). + Definition signed_less_than : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -182,6 +185,9 @@ Definition signed_less_than : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom signed_less_than_in_globals : + IsInGlobals globals "signed_less_than" (make_function signed_less_than). + Definition greater_than : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -252,6 +258,9 @@ Definition greater_than : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom greater_than_in_globals : + IsInGlobals globals "greater_than" (make_function greater_than). + Definition signed_greater_than : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -329,6 +338,9 @@ Definition signed_greater_than : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom signed_greater_than_in_globals : + IsInGlobals globals "signed_greater_than" (make_function signed_greater_than). + Definition equal : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -399,6 +411,9 @@ Definition equal : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom equal_in_globals : + IsInGlobals globals "equal" (make_function equal). + Definition is_zero : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -458,3 +473,6 @@ Definition is_zero : Value.t -> Value.t -> M := Constant.int 1 |) in M.pure Constant.None_)). + +Axiom is_zero_in_globals : + IsInGlobals globals "is_zero" (make_function is_zero). diff --git a/CoqOfPython/ethereum/tangerine_whistle/vm/instructions/control_flow.v b/CoqOfPython/ethereum/tangerine_whistle/vm/instructions/control_flow.v index bb32d47..254787e 100644 --- a/CoqOfPython/ethereum/tangerine_whistle/vm/instructions/control_flow.v +++ b/CoqOfPython/ethereum/tangerine_whistle/vm/instructions/control_flow.v @@ -71,6 +71,9 @@ Definition stop : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom stop_in_globals : + IsInGlobals globals "stop" (make_function stop). + Definition jump : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -136,6 +139,9 @@ Definition jump : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom jump_in_globals : + IsInGlobals globals "jump" (make_function jump). + Definition jumpi : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -237,6 +243,9 @@ Definition jumpi : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom jumpi_in_globals : + IsInGlobals globals "jumpi" (make_function jumpi). + Definition pc : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -281,6 +290,9 @@ Definition pc : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom pc_in_globals : + IsInGlobals globals "pc" (make_function pc). + Definition gas_left : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -325,6 +337,9 @@ Definition gas_left : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom gas_left_in_globals : + IsInGlobals globals "gas_left" (make_function gas_left). + Definition jumpdest : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -356,3 +371,6 @@ Definition jumpdest : Value.t -> Value.t -> M := Constant.int 1 |) in M.pure Constant.None_)). + +Axiom jumpdest_in_globals : + IsInGlobals globals "jumpdest" (make_function jumpdest). diff --git a/CoqOfPython/ethereum/tangerine_whistle/vm/instructions/environment.v b/CoqOfPython/ethereum/tangerine_whistle/vm/instructions/environment.v index 75c6d21..17a697c 100644 --- a/CoqOfPython/ethereum/tangerine_whistle/vm/instructions/environment.v +++ b/CoqOfPython/ethereum/tangerine_whistle/vm/instructions/environment.v @@ -104,6 +104,9 @@ Definition address : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom address_in_globals : + IsInGlobals globals "address" (make_function address). + Definition balance : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -167,6 +170,9 @@ Definition balance : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom balance_in_globals : + IsInGlobals globals "balance" (make_function balance). + Definition origin : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -211,6 +217,9 @@ Definition origin : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom origin_in_globals : + IsInGlobals globals "origin" (make_function origin). + Definition caller : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -254,6 +263,9 @@ Definition caller : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom caller_in_globals : + IsInGlobals globals "caller" (make_function caller). + Definition callvalue : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -291,6 +303,9 @@ Definition callvalue : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom callvalue_in_globals : + IsInGlobals globals "callvalue" (make_function callvalue). + Definition calldataload : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -362,6 +377,9 @@ Definition calldataload : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom calldataload_in_globals : + IsInGlobals globals "calldataload" (make_function calldataload). + Definition calldatasize : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -411,6 +429,9 @@ Definition calldatasize : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom calldatasize_in_globals : + IsInGlobals globals "calldatasize" (make_function calldatasize). + Definition calldatacopy : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -546,6 +567,9 @@ Definition calldatacopy : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom calldatacopy_in_globals : + IsInGlobals globals "calldatacopy" (make_function calldatacopy). + Definition codesize : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -595,6 +619,9 @@ Definition codesize : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom codesize_in_globals : + IsInGlobals globals "codesize" (make_function codesize). + Definition codecopy : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -730,6 +757,9 @@ Definition codecopy : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom codecopy_in_globals : + IsInGlobals globals "codecopy" (make_function codecopy). + Definition gasprice : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -773,6 +803,9 @@ Definition gasprice : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom gasprice_in_globals : + IsInGlobals globals "gasprice" (make_function gasprice). + Definition extcodesize : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -848,6 +881,9 @@ Definition extcodesize : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom extcodesize_in_globals : + IsInGlobals globals "extcodesize" (make_function extcodesize). + Definition extcodecopy : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -1006,3 +1042,6 @@ Definition extcodecopy : Value.t -> Value.t -> M := Constant.int 1 |) in M.pure Constant.None_)). + +Axiom extcodecopy_in_globals : + IsInGlobals globals "extcodecopy" (make_function extcodecopy). diff --git a/CoqOfPython/ethereum/tangerine_whistle/vm/instructions/keccak.v b/CoqOfPython/ethereum/tangerine_whistle/vm/instructions/keccak.v index 252a3f2..84a399f 100644 --- a/CoqOfPython/ethereum/tangerine_whistle/vm/instructions/keccak.v +++ b/CoqOfPython/ethereum/tangerine_whistle/vm/instructions/keccak.v @@ -189,3 +189,6 @@ Definition keccak : Value.t -> Value.t -> M := Constant.int 1 |) in M.pure Constant.None_)). + +Axiom keccak_in_globals : + IsInGlobals globals "keccak" (make_function keccak). diff --git a/CoqOfPython/ethereum/tangerine_whistle/vm/instructions/log.v b/CoqOfPython/ethereum/tangerine_whistle/vm/instructions/log.v index aa9820a..f9bbe8b 100644 --- a/CoqOfPython/ethereum/tangerine_whistle/vm/instructions/log.v +++ b/CoqOfPython/ethereum/tangerine_whistle/vm/instructions/log.v @@ -194,6 +194,9 @@ Definition log_n : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom log_n_in_globals : + IsInGlobals globals "log_n" (make_function log_n). + Definition log0 : Value.t := M.run ltac:(M.monadic ( M.call (| M.get_name (| globals, locals_stack, "partial" |), diff --git a/CoqOfPython/ethereum/tangerine_whistle/vm/instructions/memory.v b/CoqOfPython/ethereum/tangerine_whistle/vm/instructions/memory.v index f7f9ed6..bddd197 100644 --- a/CoqOfPython/ethereum/tangerine_whistle/vm/instructions/memory.v +++ b/CoqOfPython/ethereum/tangerine_whistle/vm/instructions/memory.v @@ -145,6 +145,9 @@ Definition mstore : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom mstore_in_globals : + IsInGlobals globals "mstore" (make_function mstore). + Definition mstore8 : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -249,6 +252,9 @@ Definition mstore8 : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom mstore8_in_globals : + IsInGlobals globals "mstore8" (make_function mstore8). + Definition mload : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -349,6 +355,9 @@ Definition mload : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom mload_in_globals : + IsInGlobals globals "mload" (make_function mload). + Definition msize : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -397,3 +406,6 @@ Definition msize : Value.t -> Value.t -> M := Constant.int 1 |) in M.pure Constant.None_)). + +Axiom msize_in_globals : + IsInGlobals globals "msize" (make_function msize). diff --git a/CoqOfPython/ethereum/tangerine_whistle/vm/instructions/stack.v b/CoqOfPython/ethereum/tangerine_whistle/vm/instructions/stack.v index 6dcf61d..02f3067 100644 --- a/CoqOfPython/ethereum/tangerine_whistle/vm/instructions/stack.v +++ b/CoqOfPython/ethereum/tangerine_whistle/vm/instructions/stack.v @@ -82,6 +82,9 @@ Definition pop : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom pop_in_globals : + IsInGlobals globals "pop" (make_function pop). + Definition push_n : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm"; "num_bytes" ] in @@ -159,6 +162,9 @@ Definition push_n : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom push_n_in_globals : + IsInGlobals globals "push_n" (make_function push_n). + Definition dup_n : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm"; "item_number" ] in @@ -236,6 +242,9 @@ Definition dup_n : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom dup_n_in_globals : + IsInGlobals globals "dup_n" (make_function dup_n). + Definition swap_n : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm"; "item_number" ] in @@ -312,6 +321,9 @@ Definition swap_n : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom swap_n_in_globals : + IsInGlobals globals "swap_n" (make_function swap_n). + Definition push1 : Value.t := M.run ltac:(M.monadic ( M.call (| M.get_name (| globals, locals_stack, "partial" |), diff --git a/CoqOfPython/ethereum/tangerine_whistle/vm/instructions/storage.v b/CoqOfPython/ethereum/tangerine_whistle/vm/instructions/storage.v index 3679ce4..753e1b5 100644 --- a/CoqOfPython/ethereum/tangerine_whistle/vm/instructions/storage.v +++ b/CoqOfPython/ethereum/tangerine_whistle/vm/instructions/storage.v @@ -106,6 +106,9 @@ Definition sload : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom sload_in_globals : + IsInGlobals globals "sload" (make_function sload). + Definition sstore : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -236,3 +239,6 @@ Definition sstore : Value.t -> Value.t -> M := Constant.int 1 |) in M.pure Constant.None_)). + +Axiom sstore_in_globals : + IsInGlobals globals "sstore" (make_function sstore). diff --git a/CoqOfPython/ethereum/tangerine_whistle/vm/instructions/system.v b/CoqOfPython/ethereum/tangerine_whistle/vm/instructions/system.v index 541db61..dbcd8fd 100644 --- a/CoqOfPython/ethereum/tangerine_whistle/vm/instructions/system.v +++ b/CoqOfPython/ethereum/tangerine_whistle/vm/instructions/system.v @@ -423,6 +423,9 @@ Definition create : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom create_in_globals : + IsInGlobals globals "create" (make_function create). + Definition return_ : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -506,6 +509,9 @@ Definition return_ : Value.t -> Value.t -> M := let _ := M.pass (| |) in M.pure Constant.None_)). +Axiom return__in_globals : + IsInGlobals globals "return_" (make_function return_). + Definition generic_call : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm"; "gas"; "value"; "caller"; "to"; "code_address"; "should_transfer_value"; "memory_input_start_position"; "memory_input_size"; "memory_output_start_position"; "memory_output_size" ] in @@ -689,6 +695,9 @@ Definition generic_call : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom generic_call_in_globals : + IsInGlobals globals "generic_call" (make_function generic_call). + Definition call : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -962,6 +971,9 @@ M.get_name (| globals, locals_stack, "GAS_CALL_VALUE" |) |) in M.pure Constant.None_)). +Axiom call_in_globals : + IsInGlobals globals "call" (make_function call). + Definition callcode : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -1206,6 +1218,9 @@ M.get_name (| globals, locals_stack, "GAS_CALL_VALUE" |) |) in M.pure Constant.None_)). +Axiom callcode_in_globals : + IsInGlobals globals "callcode" (make_function callcode). + Definition selfdestruct : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -1387,6 +1402,9 @@ Definition selfdestruct : Value.t -> Value.t -> M := let _ := M.pass (| |) in M.pure Constant.None_)). +Axiom selfdestruct_in_globals : + IsInGlobals globals "selfdestruct" (make_function selfdestruct). + Definition delegatecall : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "evm" ] in @@ -1553,3 +1571,6 @@ Definition delegatecall : Value.t -> Value.t -> M := Constant.int 1 |) in M.pure Constant.None_)). + +Axiom delegatecall_in_globals : + IsInGlobals globals "delegatecall" (make_function delegatecall). diff --git a/CoqOfPython/ethereum/tangerine_whistle/vm/interpreter.v b/CoqOfPython/ethereum/tangerine_whistle/vm/interpreter.v index 2179c16..9c806cb 100644 --- a/CoqOfPython/ethereum/tangerine_whistle/vm/interpreter.v +++ b/CoqOfPython/ethereum/tangerine_whistle/vm/interpreter.v @@ -325,6 +325,9 @@ Definition process_message_call : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom process_message_call_in_globals : + IsInGlobals globals "process_message_call" (make_function process_message_call). + Definition process_create_message : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "message"; "env" ] in @@ -411,6 +414,9 @@ Definition process_create_message : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom process_create_message_in_globals : + IsInGlobals globals "process_create_message" (make_function process_create_message). + Definition process_message : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "message"; "env" ] in @@ -536,6 +542,9 @@ Definition process_message : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom process_message_in_globals : + IsInGlobals globals "process_message" (make_function process_message). + Definition execute_code : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "message"; "env" ] in @@ -582,3 +591,6 @@ Definition execute_code : Value.t -> Value.t -> M := M.get_name (| globals, locals_stack, "evm" |) |) in M.pure Constant.None_)). + +Axiom execute_code_in_globals : + IsInGlobals globals "execute_code" (make_function execute_code). diff --git a/CoqOfPython/ethereum/tangerine_whistle/vm/memory.v b/CoqOfPython/ethereum/tangerine_whistle/vm/memory.v index d93ced6..07b3f59 100644 --- a/CoqOfPython/ethereum/tangerine_whistle/vm/memory.v +++ b/CoqOfPython/ethereum/tangerine_whistle/vm/memory.v @@ -71,6 +71,9 @@ Definition memory_write : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom memory_write_in_globals : + IsInGlobals globals "memory_write" (make_function memory_write). + Definition memory_read_bytes : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "memory"; "start_position"; "size" ] in @@ -117,6 +120,9 @@ Definition memory_read_bytes : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom memory_read_bytes_in_globals : + IsInGlobals globals "memory_read_bytes" (make_function memory_read_bytes). + Definition buffer_read : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "buffer"; "start_position"; "size" ] in @@ -169,3 +175,6 @@ Definition buffer_read : Value.t -> Value.t -> M := |) |) in M.pure Constant.None_)). + +Axiom buffer_read_in_globals : + IsInGlobals globals "buffer_read" (make_function buffer_read). diff --git a/CoqOfPython/ethereum/tangerine_whistle/vm/precompiled_contracts/ecrecover.v b/CoqOfPython/ethereum/tangerine_whistle/vm/precompiled_contracts/ecrecover.v index 3ffd572..81cf893 100644 --- a/CoqOfPython/ethereum/tangerine_whistle/vm/precompiled_contracts/ecrecover.v +++ b/CoqOfPython/ethereum/tangerine_whistle/vm/precompiled_contracts/ecrecover.v @@ -302,3 +302,6 @@ Definition ecrecover : Value.t -> Value.t -> M := M.get_name (| globals, locals_stack, "padded_address" |) |) in M.pure Constant.None_)). + +Axiom ecrecover_in_globals : + IsInGlobals globals "ecrecover" (make_function ecrecover). diff --git a/CoqOfPython/ethereum/tangerine_whistle/vm/precompiled_contracts/identity.v b/CoqOfPython/ethereum/tangerine_whistle/vm/precompiled_contracts/identity.v index 667269e..fecb12f 100644 --- a/CoqOfPython/ethereum/tangerine_whistle/vm/precompiled_contracts/identity.v +++ b/CoqOfPython/ethereum/tangerine_whistle/vm/precompiled_contracts/identity.v @@ -95,3 +95,6 @@ Definition identity : Value.t -> Value.t -> M := M.get_name (| globals, locals_stack, "data" |) |) in M.pure Constant.None_)). + +Axiom identity_in_globals : + IsInGlobals globals "identity" (make_function identity). diff --git a/CoqOfPython/ethereum/tangerine_whistle/vm/precompiled_contracts/ripemd160.v b/CoqOfPython/ethereum/tangerine_whistle/vm/precompiled_contracts/ripemd160.v index b907551..b7ae470 100644 --- a/CoqOfPython/ethereum/tangerine_whistle/vm/precompiled_contracts/ripemd160.v +++ b/CoqOfPython/ethereum/tangerine_whistle/vm/precompiled_contracts/ripemd160.v @@ -126,3 +126,6 @@ Definition ripemd160 : Value.t -> Value.t -> M := M.get_name (| globals, locals_stack, "padded_hash" |) |) in M.pure Constant.None_)). + +Axiom ripemd160_in_globals : + IsInGlobals globals "ripemd160" (make_function ripemd160). diff --git a/CoqOfPython/ethereum/tangerine_whistle/vm/precompiled_contracts/sha256.v b/CoqOfPython/ethereum/tangerine_whistle/vm/precompiled_contracts/sha256.v index 973a752..2b78be7 100644 --- a/CoqOfPython/ethereum/tangerine_whistle/vm/precompiled_contracts/sha256.v +++ b/CoqOfPython/ethereum/tangerine_whistle/vm/precompiled_contracts/sha256.v @@ -107,3 +107,6 @@ Definition sha256 : Value.t -> Value.t -> M := |) |) in M.pure Constant.None_)). + +Axiom sha256_in_globals : + IsInGlobals globals "sha256" (make_function sha256). diff --git a/CoqOfPython/ethereum/tangerine_whistle/vm/runtime.v b/CoqOfPython/ethereum/tangerine_whistle/vm/runtime.v index b22af1f..4611d07 100644 --- a/CoqOfPython/ethereum/tangerine_whistle/vm/runtime.v +++ b/CoqOfPython/ethereum/tangerine_whistle/vm/runtime.v @@ -158,3 +158,6 @@ Definition get_valid_jump_destinations : Value.t -> Value.t -> M := M.get_name (| globals, locals_stack, "valid_jump_destinations" |) |) in M.pure Constant.None_)). + +Axiom get_valid_jump_destinations_in_globals : + IsInGlobals globals "get_valid_jump_destinations" (make_function get_valid_jump_destinations). diff --git a/CoqOfPython/ethereum/tangerine_whistle/vm/stack.v b/CoqOfPython/ethereum/tangerine_whistle/vm/stack.v index 2a61b4d..cbebf67 100644 --- a/CoqOfPython/ethereum/tangerine_whistle/vm/stack.v +++ b/CoqOfPython/ethereum/tangerine_whistle/vm/stack.v @@ -78,6 +78,9 @@ Definition pop : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom pop_in_globals : + IsInGlobals globals "pop" (make_function pop). + Definition push : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "stack"; "value" ] in @@ -125,3 +128,6 @@ Definition push : Value.t -> Value.t -> M := |) |) in M.pure Constant.None_)). + +Axiom push_in_globals : + IsInGlobals globals "push" (make_function push). diff --git a/CoqOfPython/ethereum/trace.v b/CoqOfPython/ethereum/trace.v index 35d4510..4e1cce6 100644 --- a/CoqOfPython/ethereum/trace.v +++ b/CoqOfPython/ethereum/trace.v @@ -137,3 +137,6 @@ Definition evm_trace : Value.t -> Value.t -> M := " in let _ := M.pass (| |) in M.pure Constant.None_)). + +Axiom evm_trace_in_globals : + IsInGlobals globals "evm_trace" (make_function evm_trace). diff --git a/CoqOfPython/ethereum/utils/byte.v b/CoqOfPython/ethereum/utils/byte.v index 6f96c51..a51f2b8 100644 --- a/CoqOfPython/ethereum/utils/byte.v +++ b/CoqOfPython/ethereum/utils/byte.v @@ -53,6 +53,9 @@ Definition left_pad_zero_bytes : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom left_pad_zero_bytes_in_globals : + IsInGlobals globals "left_pad_zero_bytes" (make_function left_pad_zero_bytes). + Definition right_pad_zero_bytes : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "value"; "size" ] in @@ -83,3 +86,6 @@ Definition right_pad_zero_bytes : Value.t -> Value.t -> M := |) |) in M.pure Constant.None_)). + +Axiom right_pad_zero_bytes_in_globals : + IsInGlobals globals "right_pad_zero_bytes" (make_function right_pad_zero_bytes). diff --git a/CoqOfPython/ethereum/utils/ensure.v b/CoqOfPython/ethereum/utils/ensure.v index 23f1393..3006c4f 100644 --- a/CoqOfPython/ethereum/utils/ensure.v +++ b/CoqOfPython/ethereum/utils/ensure.v @@ -57,3 +57,6 @@ Definition ensure : Value.t -> Value.t -> M := )) |) in let _ := M.raise (| Some (M.get_name (| globals, locals_stack, "exception" |)) |) in M.pure Constant.None_)). + +Axiom ensure_in_globals : + IsInGlobals globals "ensure" (make_function ensure). diff --git a/CoqOfPython/ethereum/utils/hexadecimal.v b/CoqOfPython/ethereum/utils/hexadecimal.v index 755d10a..c24d025 100644 --- a/CoqOfPython/ethereum/utils/hexadecimal.v +++ b/CoqOfPython/ethereum/utils/hexadecimal.v @@ -67,6 +67,9 @@ Definition has_hex_prefix : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom has_hex_prefix_in_globals : + IsInGlobals globals "has_hex_prefix" (make_function has_hex_prefix). + Definition remove_hex_prefix : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "hex_string" ] in @@ -121,6 +124,9 @@ Definition remove_hex_prefix : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom remove_hex_prefix_in_globals : + IsInGlobals globals "remove_hex_prefix" (make_function remove_hex_prefix). + Definition hex_to_bytes : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "hex_string" ] in @@ -155,6 +161,9 @@ Definition hex_to_bytes : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom hex_to_bytes_in_globals : + IsInGlobals globals "hex_to_bytes" (make_function hex_to_bytes). + Definition hex_to_bytes8 : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "hex_string" ] in @@ -202,6 +211,9 @@ Definition hex_to_bytes8 : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom hex_to_bytes8_in_globals : + IsInGlobals globals "hex_to_bytes8" (make_function hex_to_bytes8). + Definition hex_to_bytes20 : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "hex_string" ] in @@ -249,6 +261,9 @@ Definition hex_to_bytes20 : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom hex_to_bytes20_in_globals : + IsInGlobals globals "hex_to_bytes20" (make_function hex_to_bytes20). + Definition hex_to_bytes32 : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "hex_string" ] in @@ -296,6 +311,9 @@ Definition hex_to_bytes32 : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom hex_to_bytes32_in_globals : + IsInGlobals globals "hex_to_bytes32" (make_function hex_to_bytes32). + Definition hex_to_bytes256 : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "hex_string" ] in @@ -343,6 +361,9 @@ Definition hex_to_bytes256 : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom hex_to_bytes256_in_globals : + IsInGlobals globals "hex_to_bytes256" (make_function hex_to_bytes256). + Definition hex_to_hash : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "hex_string" ] in @@ -383,6 +404,9 @@ Definition hex_to_hash : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom hex_to_hash_in_globals : + IsInGlobals globals "hex_to_hash" (make_function hex_to_hash). + Definition hex_to_uint : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "hex_string" ] in @@ -424,6 +448,9 @@ Definition hex_to_uint : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom hex_to_uint_in_globals : + IsInGlobals globals "hex_to_uint" (make_function hex_to_uint). + Definition hex_to_u64 : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "hex_string" ] in @@ -465,6 +492,9 @@ Definition hex_to_u64 : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom hex_to_u64_in_globals : + IsInGlobals globals "hex_to_u64" (make_function hex_to_u64). + Definition hex_to_u256 : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "hex_string" ] in @@ -505,3 +535,6 @@ Definition hex_to_u256 : Value.t -> Value.t -> M := |) |) in M.pure Constant.None_)). + +Axiom hex_to_u256_in_globals : + IsInGlobals globals "hex_to_u256" (make_function hex_to_u256). diff --git a/CoqOfPython/ethereum/utils/numeric.v b/CoqOfPython/ethereum/utils/numeric.v index d616a17..4166532 100644 --- a/CoqOfPython/ethereum/utils/numeric.v +++ b/CoqOfPython/ethereum/utils/numeric.v @@ -86,6 +86,9 @@ Definition get_sign : Value.t -> Value.t -> M := )) |) in M.pure Constant.None_)). +Axiom get_sign_in_globals : + IsInGlobals globals "get_sign" (make_function get_sign). + Definition ceil32 : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "value" ] in @@ -156,6 +159,9 @@ Definition ceil32 : Value.t -> Value.t -> M := )) |) in M.pure Constant.None_)). +Axiom ceil32_in_globals : + IsInGlobals globals "ceil32" (make_function ceil32). + Definition is_prime : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "number" ] in @@ -245,6 +251,9 @@ Definition is_prime : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom is_prime_in_globals : + IsInGlobals globals "is_prime" (make_function is_prime). + Definition le_bytes_to_uint32_sequence : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "data" ] in @@ -327,6 +336,9 @@ Definition le_bytes_to_uint32_sequence : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom le_bytes_to_uint32_sequence_in_globals : + IsInGlobals globals "le_bytes_to_uint32_sequence" (make_function le_bytes_to_uint32_sequence). + Definition le_uint32_sequence_to_bytes : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "sequence" ] in @@ -384,6 +396,9 @@ Definition le_uint32_sequence_to_bytes : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom le_uint32_sequence_to_bytes_in_globals : + IsInGlobals globals "le_uint32_sequence_to_bytes" (make_function le_uint32_sequence_to_bytes). + Definition le_uint32_sequence_to_uint : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "sequence" ] in @@ -425,6 +440,9 @@ Definition le_uint32_sequence_to_uint : Value.t -> Value.t -> M := |) in M.pure Constant.None_)). +Axiom le_uint32_sequence_to_uint_in_globals : + IsInGlobals globals "le_uint32_sequence_to_uint" (make_function le_uint32_sequence_to_uint). + Definition taylor_exponential : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ "factor"; "numerator"; "denominator" ] in @@ -506,3 +524,6 @@ Definition taylor_exponential : Value.t -> Value.t -> M := |) |) in M.pure Constant.None_)). + +Axiom taylor_exponential_in_globals : + IsInGlobals globals "taylor_exponential" (make_function taylor_exponential). diff --git a/CoqOfPython/ethereum/utils/safe_arithmetic.v b/CoqOfPython/ethereum/utils/safe_arithmetic.v index 3134fee..35cf264 100644 --- a/CoqOfPython/ethereum/utils/safe_arithmetic.v +++ b/CoqOfPython/ethereum/utils/safe_arithmetic.v @@ -63,6 +63,9 @@ Definition u256_safe_add : Value.t -> Value.t -> M := (* At stmt: unsupported node type: Try *) M.pure Constant.None_)). +Axiom u256_safe_add_in_globals : + IsInGlobals globals "u256_safe_add" (make_function u256_safe_add). + Definition u256_safe_multiply : Value.t -> Value.t -> M := fun (args kwargs : Value.t) => let- locals_stack := M.create_locals locals_stack args kwargs [ ] in @@ -101,3 +104,6 @@ Definition u256_safe_multiply : Value.t -> Value.t -> M := |) in (* At stmt: unsupported node type: Try *) M.pure Constant.None_)). + +Axiom u256_safe_multiply_in_globals : + IsInGlobals globals "u256_safe_multiply" (make_function u256_safe_multiply). diff --git a/CoqOfPython/proofs/CoqOfPython.v b/CoqOfPython/proofs/CoqOfPython.v index 474a8f2..d21c5f2 100644 --- a/CoqOfPython/proofs/CoqOfPython.v +++ b/CoqOfPython/proofs/CoqOfPython.v @@ -189,6 +189,21 @@ Module Run. LowM.CallPrimitive (Primitive.StateWrite mutable update') k ⇓ result | stack', heap' }} + | CallPrimitiveGetInGlobals + (globals : Globals.t) + (name : string) + (value : Value.t) + (stack : Stack.t) (heap : Heap) + (k : Value.t -> LowM.t A) : + IsInGlobals globals name value -> + {{ stack, heap | + k value ⇓ + result + | stack', heap' }} -> + {{ stack, heap | + LowM.CallPrimitive (Primitive.GetInGlobals globals name) k ⇓ + result + | stack', heap' }} | CallClosure (stack stack_inter : Stack.t) (heap heap_inter : Heap) (f : Value.t -> Value.t -> M) diff --git a/README.md b/README.md index 4888224..f89288f 100644 --- a/README.md +++ b/README.md @@ -13,3 +13,51 @@ print("🐓") We focus on translating the Ethereum specification, which is written in Python: https://github.com/ethereum/execution-specs The output of the translation is in [CoqOfPython/ethereum](CoqOfPython/ethereum). The generated Coq code type checks, with some holes for expressions we do not handle yet. We are now working on adding a semantics to be able to specify at least one file. + +## Run + +### Translate Python to Coq + +For now this works only on the Ethereum code. We assume you have cloned both this repository and the [Ethereum specification](https://github.com/ethereum/execution-specs) in the same folder: + +``` +├── coq-of-python +│   ├── CoqOfPython +│   ├── LICENSE +│   ├── main.py +│   └── README.md +└── execution-specs +    ├── CONTRIBUTING.md +    ├── LICENSE.md +    ├── lists +    ├── mypy.ini +    ├── network-upgrades +    ├── pyproject.toml +    ├── README.md +    ├── scripts +    ├── setup.cfg +    ├── setup.py +    ├── src +    ├── static +    ├── tests +    ├── tox.ini +    └── whitelist.txt +``` + +Go into the `execution-specs/src` folder and run the following command: + +```sh +find ethereum -name "*.py" -exec echo {} \; -exec python ../../coq-of-python/main.py {} \; +``` + +This will translate each file of the Ethereum specification to Coq and put the result in the `coq-of-python/CoqOfPython/ethereum` folder. + +### Compile the Coq + +Go into the `coq-of-python/CoqOfPython` folder and run the following command: + +```sh +make -j4 +``` + +It will compile all the Coq files, including the ones generated from the Ethereum specification and the proofs. diff --git a/main.py b/main.py index f01ed25..8254005 100644 --- a/main.py +++ b/main.py @@ -102,7 +102,10 @@ def get_globals_of_import(node: ast.ImportFrom) -> str: def generate_top_level_stmt(node: ast.stmt): if isinstance(node, ast.FunctionDef): return f"Definition {generate_name(node.name)} : Value.t -> Value.t -> M :=\n" + \ - generate_indent(1) + generate_function_def_body(1, node) + "." + generate_indent(1) + generate_function_def_body(1, node) + ".\n\n" + \ + f"Axiom {generate_name(node.name)}_in_globals :\n" +\ + generate_indent(1) + \ + f"IsInGlobals globals \"{node.name}\" (make_function {generate_name(node.name)})." elif isinstance(node, ast.AsyncFunctionDef): return generate_error("top_level_stmt", node) elif isinstance(node, ast.ClassDef):