Skip to main content

👥 Delegate_storage.v

Proofs

See code, Gitlab , OCaml

[init] is valid, i.e., outputs a valid context.
The function [set_self_delegate] is valid.
The function [set_delegate] is valid.
The function [set] is valid.
The function [fold] is valid.
Lemma fold_is_valid {A : Set} (P : A Prop) ctxt order acc f
  (H_ctxt : Raw_context.Valid.t ctxt)
  (H_acc : P acc)
  (H_f : key acc,
    P acc
    letP? acc := f key acc in
    P acc
  ) :
  letP? acc := Delegate_storage.fold ctxt order acc f in
  P acc.
Proof.
Admitted.

The function [list_value] is valid.
The function [frozen_deposits_limit] is valid.
[set_frozen_deposits_limit] is valid
[set_frozen_deposits_limit] followed by [frozen_deposits_limit] is an identity
Lemma set_frozen_deposits_limit_frozen_deposits_limit_eq
  (absolute_key : Context.key)
  (ctxt : Proto_alpha.Raw_context.t)
  (delegate : _)
  (amount : Tez_repr.t) :
  Delegate_storage.frozen_deposits_limit
    (Delegate_storage.set_frozen_deposits_limit
       ctxt delegate (Some amount)) delegate =
    Pervasives.Ok (Some amount).
Proof.
  unfold Delegate_storage.set_frozen_deposits_limit.
  (* @TODO Axiom was commented out in Storate.v *)
Admitted.

The function [frozen_deposits] is valid.
The function [spendable_balance] is valid.
The function [staking_balance] is valid.
The function [full_balance] is valid.
The function [delegated_balance] is valid.
The function [drain] is valid.