-
Notifications
You must be signed in to change notification settings - Fork 1
/
extended_cmtat_single_asset.instance.mligo
107 lines (79 loc) · 2.69 KB
/
extended_cmtat_single_asset.instance.mligo
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
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
#import "../../lib/main.mligo" "CMTAT"
module Token = CMTAT.CMTAT_SINGLE_ASSET_EXTENDABLE
type extension = {
issuer : address
}
type storage = extension Token.storage
type ret = extension Token.ret
module Errors = struct
let not_issuer_nor_admin = "Not issuer not admin"
end
[@entry]
let transfer (t : Token.TZIP12.transfer) (s : storage) : ret =
Token.transfer t s
[@entry]
let balance_of (b : Token.TZIP12.balance_of) (s : storage) : ret =
Token.balance_of b s
[@entry]
let update_operators (updates : Token.TZIP12.update_operators) (s : storage) : ret =
Token.update_operators updates s
[@view]
let get_balance (p : (address * nat)) (s : storage) : nat =
Token.get_balance p s
[@view]
let total_supply (token_id : nat) (s : storage) : nat =
Token.total_supply token_id s
[@view]
let all_tokens (_ : unit) (s : storage) : nat set =
Token.all_tokens () s
[@view]
let is_operator (op : Token.TZIP12.operator) (s : storage) : bool =
Token.is_operator op s
[@view]
let token_metadata (p : nat) (s : storage) : Token.TZIP12.tokenMetadataData =
Token.token_metadata p s
// [@entry]
// let pause (t : Token.ADMINISTRATION.pause_param) (s : storage) : ret =
// Token.pause t s
// Exemple of override of pause Entrypoint
[@entry]
let pause (p : Token.ADMINISTRATION.pause_param) (s : storage) : ret =
let sender = Tezos.get_sender() in
let () = assert_with_error ((sender = s.extension.issuer) || (sender = s.administration.admin)) Errors.not_issuer_nor_admin in
[], { s with administration = Token.ADMINISTRATION.pause p s.administration }
[@entry]
let mint (p: Token.mint_param) (s: storage) : ret =
Token.mint p s
[@entry]
let burn (p: Token.burn_param) (s: storage) : ret =
Token.burn p s
[@entry]
let grantRole (p: address * Token.AUTHORIZATIONS.role) (s: storage) : ret =
Token.grantRole p s
[@entry]
let revokeRole (p: address * Token.AUTHORIZATIONS.role) (s: storage) : ret =
Token.revokeRole p s
[@entry]
let scheduleSnapshot (p: timestamp) (s: storage) : ret =
Token.scheduleSnapshot p s
[@entry]
let rescheduleSnapshot (p: timestamp * timestamp) (s: storage) : ret =
Token.rescheduleSnapshot p s
[@entry]
let unscheduleSnapshot (p: timestamp) (s: storage) : ret =
Token.unscheduleSnapshot p s
[@view]
let getNextSnapshots () (s: storage) : timestamp list =
Token.getNextSnapshots s
[@view]
let snapshotTotalsupply (p: timestamp * nat) (s: storage) : nat =
Token.snapshotTotalsupply p s
[@view]
let snapshotBalanceOf (p: timestamp * address * nat) (s: storage) : nat =
Token.snapshotBalanceOf p s
[@entry]
let setRuleEngine (p: Token.VALIDATION.rule_engine_param) (s: storage) : ret =
Token.setRuleEngine p s
[@entry]
let kill (_p: unit) (s: storage) : ret =
Token.kill () s