Skip to main content

✒️ Contract_manager_storage.v

Proofs

See code, Gitlab , OCaml

Require Import CoqOfOCaml.CoqOfOCaml.
Require Import CoqOfOCaml.Settings.

Require Import TezosOfOCaml.Environment.V8.
Require TezosOfOCaml.Proto_alpha.Contract_manager_storage.

Require TezosOfOCaml.Proto_alpha.Proofs.Raw_context.

The function [init_value] is valid.
The function [is_manager_key_revealed] is valid.
The function [check_public_key] is valid.
The function [reveal_manager_key] is valid.
The function [get_manager_key] is valid.
Lemma get_manager_key_is_valid error_value ctxt pkh :
  match error_value with
  | Some error_valueError.not_internal [error_value]
  | NoneTrue
  end
  Raw_context.Valid.t ctxt
  letP? _ := Contract_manager_storage.get_manager_key error_value ctxt pkh in
  True.
Proof.
Admitted.

The function [remove_existing] is valid.
@TODO commented out [axiom Storage.Eq.Contracts.Manager.eq.] from [Storage.v] used in the proof. [is_manager_key_revealed] after [reveal_manager_key] returns [Pervasives.Ok true]
@TODO commented out [axiom Storage.Eq.Contracts.Manager.eq.] from [Storage.v] used in the proof. [get_manager_key] after [reveals] returns [Pervasives.Ok]
@TODO commented out [axiom Storage.Eq.Contracts.Manager.eq.] from [Storage.v] used in the proof. [remove_existing] after [get_manager_key] success returns [Pervasives.Ok] Lemma get_manager_key_implies_remove_exists_success ctxt pkh : Storage.Contract.Manager.(Storage_sigs.Indexed_data_storage.find) ctxt (Contract_repr.Implicit pkh) <> Pervasives.Ok None -> let contract := Contract_repr.Implicit pkh in letP? pk := Contract_manager_storage.get_manager_key None ctxt pkh in Pervasives.is_ok (Contract_manager_storage.remove_existing ctxt contract). Proof. intros. unfold Contract_manager_storage.get_manager_key. Admitted.