forked from tezos-checker/checker
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcheckerTypes.ml
More file actions
59 lines (49 loc) · 1.44 KB
/
checkerTypes.ml
File metadata and controls
59 lines (49 loc) · 1.44 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
open Kit
open Burrow
open CfmmTypes
open Parameters
open LiquidationAuctionTypes
open LiquidationAuctionPrimitiveTypes
open Fa2Interface
type burrow_map = (burrow_id, burrow) Ligo.big_map
type external_contracts = {
oracle : Ligo.address;
ctez : Ligo.address;
}
type checker =
{ burrows : burrow_map;
cfmm : cfmm;
parameters : parameters;
liquidation_auctions : liquidation_auctions;
last_price : Ligo.nat option;
fa2_state : fa2_state;
external_contracts : external_contracts;
}
(** Make a fresh state. *)
let initial_checker (external_contracts: external_contracts) =
{ burrows = (Ligo.Big_map.empty: (burrow_id, burrow) Ligo.big_map);
cfmm = initial_cfmm ();
parameters = initial_parameters;
liquidation_auctions = liquidation_auction_empty;
last_price = (None : Ligo.nat option);
fa2_state = initial_fa2_state;
external_contracts = external_contracts;
}
type lazy_function_id = Ligo.int
type deployment_state =
| Unsealed of Ligo.address
| Sealed of checker
type lazy_function_map = (lazy_function_id, Ligo.bytes) Ligo.big_map
type wrapper =
(* BEGIN_LIGO [@layout:comb] END_LIGO *)
{ lazy_functions : lazy_function_map
; metadata: (string, Ligo.bytes) Ligo.big_map
; deployment_state : deployment_state
}
[@@@coverage off]
type view_current_liquidation_auction_minimum_bid_result =
{ auction_id: liquidation_auction_id
; minimum_bid: kit
}
[@@deriving show]
[@@@coverage on]