(* Generated by coq-of-rust *)
Require Import CoqOfRust.CoqOfRust.

(* StructRecord
  {
    name := "Mapping";
    const_params := [];
    ty_params := [ "K"; "V" ];
    fields :=
      [
        ("_key", Ty.apply (Ty.path "core::marker::PhantomData") [] [ K ]);
        ("_value", Ty.apply (Ty.path "core::marker::PhantomData") [] [ V ])
      ];
  } *)

Module Impl_core_default_Default_where_core_default_Default_K_where_core_default_Default_V_for_trait_erc20_Mapping_K_V.
  Definition Self (K V : Ty.t) : Ty.t := Ty.apply (Ty.path "trait_erc20::Mapping") [] [ K; V ].
  
  Parameter default : forall (K V : Ty.t), (list Value.t) -> (list Ty.t) -> (list Value.t) -> M.
  
  Axiom Implements :
    forall (K V : Ty.t),
    M.IsTraitInstance
      "core::default::Default"
      (Self K V)
      (* Trait polymorphic types *) []
      (* Instance *) [ ("default", InstanceField.Method (default K V)) ].
End Impl_core_default_Default_where_core_default_Default_K_where_core_default_Default_V_for_trait_erc20_Mapping_K_V.

Module Impl_trait_erc20_Mapping_K_V.
  Definition Self (K V : Ty.t) : Ty.t := Ty.apply (Ty.path "trait_erc20::Mapping") [] [ K; V ].
  
  Parameter get : forall (K V : Ty.t), (list Value.t) -> (list Ty.t) -> (list Value.t) -> M.
  
  Axiom AssociatedFunction_get :
    forall (K V : Ty.t),
    M.IsAssociatedFunction (Self K V) "get" (get K V).
  
  Parameter insert : forall (K V : Ty.t), (list Value.t) -> (list Ty.t) -> (list Value.t) -> M.
  
  Axiom AssociatedFunction_insert :
    forall (K V : Ty.t),
    M.IsAssociatedFunction (Self K V) "insert" (insert K V).
End Impl_trait_erc20_Mapping_K_V.

(* StructTuple
  {
    name := "AccountId";
    const_params := [];
    ty_params := [];
    fields := [ Ty.path "u128" ];
  } *)

Module Impl_core_default_Default_for_trait_erc20_AccountId.
  Definition Self : Ty.t := Ty.path "trait_erc20::AccountId".
  
  Parameter default : (list Value.t) -> (list Ty.t) -> (list Value.t) -> M.
  
  Axiom Implements :
    M.IsTraitInstance
      "core::default::Default"
      Self
      (* Trait polymorphic types *) []
      (* Instance *) [ ("default", InstanceField.Method default) ].
End Impl_core_default_Default_for_trait_erc20_AccountId.

Module Impl_core_clone_Clone_for_trait_erc20_AccountId.
  Definition Self : Ty.t := Ty.path "trait_erc20::AccountId".
  
  Parameter clone : (list Value.t) -> (list Ty.t) -> (list Value.t) -> M.
  
  Axiom Implements :
    M.IsTraitInstance
      "core::clone::Clone"
      Self
      (* Trait polymorphic types *) []
      (* Instance *) [ ("clone", InstanceField.Method clone) ].
End Impl_core_clone_Clone_for_trait_erc20_AccountId.

Module Impl_core_marker_Copy_for_trait_erc20_AccountId.
  Definition Self : Ty.t := Ty.path "trait_erc20::AccountId".
  
  Axiom Implements :
    M.IsTraitInstance "core::marker::Copy" Self (* Trait polymorphic types *) [] (* Instance *) [].
End Impl_core_marker_Copy_for_trait_erc20_AccountId.

Axiom Balance : (Ty.path "trait_erc20::Balance") = (Ty.path "u128").

(* StructRecord
  {
    name := "Env";
    const_params := [];
    ty_params := [];
    fields := [ ("caller", Ty.path "trait_erc20::AccountId") ];
  } *)

(*
Enum Error
{
  const_params := [];
  ty_params := [];
  variants :=
    [
      {
        name := "InsufficientBalance";
        item := StructTuple [];
        discriminant := None;
      };
      {
        name := "InsufficientAllowance";
        item := StructTuple [];
        discriminant := None;
      }
    ];
}
*)

Module Impl_core_fmt_Debug_for_trait_erc20_Error.
  Definition Self : Ty.t := Ty.path "trait_erc20::Error".
  
  Parameter fmt : (list Value.t) -> (list Ty.t) -> (list Value.t) -> M.
  
  Axiom Implements :
    M.IsTraitInstance
      "core::fmt::Debug"
      Self
      (* Trait polymorphic types *) []
      (* Instance *) [ ("fmt", InstanceField.Method fmt) ].
End Impl_core_fmt_Debug_for_trait_erc20_Error.

Module Impl_core_marker_StructuralPartialEq_for_trait_erc20_Error.
  Definition Self : Ty.t := Ty.path "trait_erc20::Error".
  
  Axiom Implements :
    M.IsTraitInstance
      "core::marker::StructuralPartialEq"
      Self
      (* Trait polymorphic types *) []
      (* Instance *) [].
End Impl_core_marker_StructuralPartialEq_for_trait_erc20_Error.

Module Impl_core_cmp_PartialEq_for_trait_erc20_Error.
  Definition Self : Ty.t := Ty.path "trait_erc20::Error".
  
  Parameter eq : (list Value.t) -> (list Ty.t) -> (list Value.t) -> M.
  
  Axiom Implements :
    M.IsTraitInstance
      "core::cmp::PartialEq"
      Self
      (* Trait polymorphic types *) []
      (* Instance *) [ ("eq", InstanceField.Method eq) ].
End Impl_core_cmp_PartialEq_for_trait_erc20_Error.

Module Impl_core_cmp_Eq_for_trait_erc20_Error.
  Definition Self : Ty.t := Ty.path "trait_erc20::Error".
  
  Parameter assert_receiver_is_total_eq : (list Value.t) -> (list Ty.t) -> (list Value.t) -> M.
  
  Axiom Implements :
    M.IsTraitInstance
      "core::cmp::Eq"
      Self
      (* Trait polymorphic types *) []
      (* Instance *)
      [ ("assert_receiver_is_total_eq", InstanceField.Method assert_receiver_is_total_eq) ].
End Impl_core_cmp_Eq_for_trait_erc20_Error.

Axiom Result :
  forall (T : Ty.t),
  (Ty.apply (Ty.path "trait_erc20::Result") [] [ T ]) =
    (Ty.apply (Ty.path "core::result::Result") [] [ T; Ty.path "trait_erc20::Error" ]).

(* Trait *)
(* Empty module 'BaseErc20' *)

(* StructRecord
  {
    name := "Erc20";
    const_params := [];
    ty_params := [];
    fields :=
      [
        ("total_supply", Ty.path "u128");
        ("balances",
          Ty.apply
            (Ty.path "trait_erc20::Mapping")
            []
            [ Ty.path "trait_erc20::AccountId"; Ty.path "u128" ]);
        ("allowances",
          Ty.apply
            (Ty.path "trait_erc20::Mapping")
            []
            [
              Ty.tuple [ Ty.path "trait_erc20::AccountId"; Ty.path "trait_erc20::AccountId" ];
              Ty.path "u128"
            ])
      ];
  } *)

Module Impl_core_default_Default_for_trait_erc20_Erc20.
  Definition Self : Ty.t := Ty.path "trait_erc20::Erc20".
  
  Parameter default : (list Value.t) -> (list Ty.t) -> (list Value.t) -> M.
  
  Axiom Implements :
    M.IsTraitInstance
      "core::default::Default"
      Self
      (* Trait polymorphic types *) []
      (* Instance *) [ ("default", InstanceField.Method default) ].
End Impl_core_default_Default_for_trait_erc20_Erc20.

(* StructRecord
  {
    name := "Transfer";
    const_params := [];
    ty_params := [];
    fields :=
      [
        ("from", Ty.apply (Ty.path "core::option::Option") [] [ Ty.path "trait_erc20::AccountId" ]);
        ("to", Ty.apply (Ty.path "core::option::Option") [] [ Ty.path "trait_erc20::AccountId" ]);
        ("value", Ty.path "u128")
      ];
  } *)

(* StructRecord
  {
    name := "Approval";
    const_params := [];
    ty_params := [];
    fields :=
      [
        ("owner", Ty.path "trait_erc20::AccountId");
        ("spender", Ty.path "trait_erc20::AccountId");
        ("value", Ty.path "u128")
      ];
  } *)

(*
Enum Event
{
  const_params := [];
  ty_params := [];
  variants :=
    [
      {
        name := "Transfer";
        item := StructTuple [ Ty.path "trait_erc20::Transfer" ];
        discriminant := None;
      };
      {
        name := "Approval";
        item := StructTuple [ Ty.path "trait_erc20::Approval" ];
        discriminant := None;
      }
    ];
}
*)

Module Impl_trait_erc20_Env.
  Definition Self : Ty.t := Ty.path "trait_erc20::Env".
  
  Parameter caller : (list Value.t) -> (list Ty.t) -> (list Value.t) -> M.
  
  Axiom AssociatedFunction_caller : M.IsAssociatedFunction Self "caller" caller.
  
  Parameter emit_event : (list Value.t) -> (list Ty.t) -> (list Value.t) -> M.
  
  Axiom AssociatedFunction_emit_event : M.IsAssociatedFunction Self "emit_event" emit_event.
End Impl_trait_erc20_Env.

Module Impl_trait_erc20_Erc20.
  Definition Self : Ty.t := Ty.path "trait_erc20::Erc20".
  
  Parameter init_env : (list Value.t) -> (list Ty.t) -> (list Value.t) -> M.
  
  Axiom AssociatedFunction_init_env : M.IsAssociatedFunction Self "init_env" init_env.
  
  Parameter env : (list Value.t) -> (list Ty.t) -> (list Value.t) -> M.
  
  Axiom AssociatedFunction_env : M.IsAssociatedFunction Self "env" env.
  
  Parameter new : (list Value.t) -> (list Ty.t) -> (list Value.t) -> M.
  
  Axiom AssociatedFunction_new : M.IsAssociatedFunction Self "new" new.
  
  Parameter balance_of_impl : (list Value.t) -> (list Ty.t) -> (list Value.t) -> M.
  
  Axiom AssociatedFunction_balance_of_impl :
    M.IsAssociatedFunction Self "balance_of_impl" balance_of_impl.
  
  Parameter allowance_impl : (list Value.t) -> (list Ty.t) -> (list Value.t) -> M.
  
  Axiom AssociatedFunction_allowance_impl :
    M.IsAssociatedFunction Self "allowance_impl" allowance_impl.
  
  Parameter transfer_from_to : (list Value.t) -> (list Ty.t) -> (list Value.t) -> M.
  
  Axiom AssociatedFunction_transfer_from_to :
    M.IsAssociatedFunction Self "transfer_from_to" transfer_from_to.
End Impl_trait_erc20_Erc20.

Module Impl_trait_erc20_BaseErc20_for_trait_erc20_Erc20.
  Definition Self : Ty.t := Ty.path "trait_erc20::Erc20".
  
  Parameter total_supply : (list Value.t) -> (list Ty.t) -> (list Value.t) -> M.
  
  Parameter balance_of : (list Value.t) -> (list Ty.t) -> (list Value.t) -> M.
  
  Parameter allowance : (list Value.t) -> (list Ty.t) -> (list Value.t) -> M.
  
  Parameter transfer : (list Value.t) -> (list Ty.t) -> (list Value.t) -> M.
  
  Parameter approve : (list Value.t) -> (list Ty.t) -> (list Value.t) -> M.
  
  Parameter transfer_from : (list Value.t) -> (list Ty.t) -> (list Value.t) -> M.
  
  Axiom Implements :
    M.IsTraitInstance
      "trait_erc20::BaseErc20"
      Self
      (* Trait polymorphic types *) []
      (* Instance *)
      [
        ("total_supply", InstanceField.Method total_supply);
        ("balance_of", InstanceField.Method balance_of);
        ("allowance", InstanceField.Method allowance);
        ("transfer", InstanceField.Method transfer);
        ("approve", InstanceField.Method approve);
        ("transfer_from", InstanceField.Method transfer_from)
      ].
End Impl_trait_erc20_BaseErc20_for_trait_erc20_Erc20.
