|
46 | 46 | (begin
|
47 | 47 | (try! (is-dao-or-extension))
|
48 | 48 | (print {
|
49 |
| - event: "allow-asset", |
50 |
| - enabled: enabled, |
51 |
| - token: token |
| 49 | + notification: "allow-asset", |
| 50 | + payload: { |
| 51 | + enabled: enabled, |
| 52 | + token: token |
| 53 | + } |
52 | 54 | })
|
53 | 55 | (ok (map-set AllowedAssets token enabled))
|
54 | 56 | )
|
|
66 | 68 | (define-public (deposit-stx (amount uint))
|
67 | 69 | (begin
|
68 | 70 | (print {
|
69 |
| - event: "deposit-stx", |
70 |
| - amount: amount, |
71 |
| - caller: contract-caller, |
72 |
| - recipient: TREASURY, |
73 |
| - sender: tx-sender |
| 71 | + notification: "deposit-stx", |
| 72 | + payload: { |
| 73 | + amount: amount, |
| 74 | + caller: contract-caller, |
| 75 | + recipient: TREASURY, |
| 76 | + sender: tx-sender |
| 77 | + } |
74 | 78 | })
|
75 | 79 | (stx-transfer? amount tx-sender TREASURY)
|
76 | 80 | )
|
|
81 | 85 | (begin
|
82 | 86 | (asserts! (is-allowed (contract-of ft)) ERR_UNKNOWN_ASSSET)
|
83 | 87 | (print {
|
84 |
| - event: "deposit-ft", |
85 |
| - amount: amount, |
86 |
| - assetContract: (contract-of ft), |
87 |
| - caller: contract-caller, |
88 |
| - recipient: TREASURY, |
89 |
| - sender: tx-sender |
| 88 | + notification: "deposit-ft", |
| 89 | + payload: { |
| 90 | + amount: amount, |
| 91 | + assetContract: (contract-of ft), |
| 92 | + caller: contract-caller, |
| 93 | + recipient: TREASURY, |
| 94 | + sender: tx-sender |
| 95 | + } |
90 | 96 | })
|
91 | 97 | (contract-call? ft transfer amount tx-sender TREASURY none)
|
92 | 98 | )
|
|
97 | 103 | (begin
|
98 | 104 | (asserts! (is-allowed (contract-of nft)) ERR_UNKNOWN_ASSSET)
|
99 | 105 | (print {
|
100 |
| - event: "deposit-nft", |
101 |
| - assetContract: (contract-of nft), |
102 |
| - caller: contract-caller, |
103 |
| - recipient: TREASURY, |
104 |
| - sender: tx-sender, |
105 |
| - tokenId: id, |
| 106 | + notification: "deposit-nft", |
| 107 | + payload: { |
| 108 | + assetContract: (contract-of nft), |
| 109 | + caller: contract-caller, |
| 110 | + recipient: TREASURY, |
| 111 | + sender: tx-sender, |
| 112 | + tokenId: id |
| 113 | + } |
106 | 114 | })
|
107 | 115 | (contract-call? nft transfer id tx-sender TREASURY)
|
108 | 116 | )
|
|
113 | 121 | (begin
|
114 | 122 | (try! (is-dao-or-extension))
|
115 | 123 | (print {
|
116 |
| - event: "withdraw-stx", |
117 |
| - amount: amount, |
118 |
| - caller: contract-caller, |
119 |
| - recipient: recipient, |
120 |
| - sender: tx-sender |
| 124 | + notification: "withdraw-stx", |
| 125 | + payload: { |
| 126 | + amount: amount, |
| 127 | + caller: contract-caller, |
| 128 | + recipient: recipient, |
| 129 | + sender: tx-sender |
| 130 | + } |
121 | 131 | })
|
122 | 132 | (as-contract (stx-transfer? amount TREASURY recipient))
|
123 | 133 | )
|
|
129 | 139 | (try! (is-dao-or-extension))
|
130 | 140 | (asserts! (is-allowed (contract-of ft)) ERR_UNKNOWN_ASSSET)
|
131 | 141 | (print {
|
132 |
| - event: "withdraw-ft", |
133 |
| - assetContract: (contract-of ft), |
134 |
| - caller: contract-caller, |
135 |
| - recipient: recipient, |
136 |
| - sender: tx-sender |
| 142 | + notification: "withdraw-ft", |
| 143 | + payload: { |
| 144 | + assetContract: (contract-of ft), |
| 145 | + caller: contract-caller, |
| 146 | + recipient: recipient, |
| 147 | + sender: tx-sender |
| 148 | + } |
137 | 149 | })
|
138 | 150 | (as-contract (contract-call? ft transfer amount TREASURY recipient none))
|
139 | 151 | )
|
|
145 | 157 | (try! (is-dao-or-extension))
|
146 | 158 | (asserts! (is-allowed (contract-of nft)) ERR_UNKNOWN_ASSSET)
|
147 | 159 | (print {
|
148 |
| - event: "withdraw-nft", |
149 |
| - assetContract: (contract-of nft), |
150 |
| - caller: contract-caller, |
151 |
| - recipient: recipient, |
152 |
| - sender: tx-sender, |
153 |
| - tokenId: id |
| 160 | + notification: "withdraw-nft", |
| 161 | + payload: { |
| 162 | + assetContract: (contract-of nft), |
| 163 | + caller: contract-caller, |
| 164 | + recipient: recipient, |
| 165 | + sender: tx-sender, |
| 166 | + tokenId: id |
| 167 | + } |
154 | 168 | })
|
155 | 169 | (as-contract (contract-call? nft transfer id TREASURY recipient))
|
156 | 170 | )
|
|
161 | 175 | (begin
|
162 | 176 | (try! (is-dao-or-extension))
|
163 | 177 | (print {
|
164 |
| - event: "delegate-stx", |
165 |
| - amount: maxAmount, |
166 |
| - caller: contract-caller, |
167 |
| - delegate: to, |
168 |
| - sender: tx-sender |
| 178 | + notification: "delegate-stx", |
| 179 | + payload: { |
| 180 | + amount: maxAmount, |
| 181 | + caller: contract-caller, |
| 182 | + delegate: to, |
| 183 | + sender: tx-sender |
| 184 | + } |
169 | 185 | })
|
170 | 186 | (match (as-contract (contract-call? (var-get poxContract) delegate-stx maxAmount to none none))
|
171 | 187 | success (ok success)
|
|
179 | 195 | (begin
|
180 | 196 | (try! (is-dao-or-extension))
|
181 | 197 | (print {
|
182 |
| - event: "revoke-delegate-stx", |
183 |
| - caller: contract-caller, |
184 |
| - sender: tx-sender |
| 198 | + notification: "revoke-delegate-stx", |
| 199 | + payload: { |
| 200 | + caller: contract-caller, |
| 201 | + sender: tx-sender |
| 202 | + } |
185 | 203 | })
|
186 | 204 | (match (as-contract (contract-call? (var-get poxContract) revoke-delegate-stx))
|
187 | 205 | success (begin (print success) (ok true))
|
|
208 | 226 | (define-private (allow-assets-iter (item {token: principal, enabled: bool}))
|
209 | 227 | (begin
|
210 | 228 | (print {
|
211 |
| - event: "allow-asset", |
212 |
| - enabled: (get enabled item), |
213 |
| - token: (get token item) |
| 229 | + notification: "allow-asset", |
| 230 | + payload: { |
| 231 | + enabled: (get enabled item), |
| 232 | + token: (get token item) |
| 233 | + } |
214 | 234 | })
|
215 | 235 | (map-set AllowedAssets (get token item) (get enabled item))
|
216 | 236 | )
|
|
0 commit comments