tx · AZDJLz7wxKtzg7pwcsaDYxk2hyRjJQZgZiKeFSHtGfpk 3N22NBbCmfZkmxFSMqb9kP61WHg1xGPndQR: -0.01400000 Waves 2023.07.11 17:04 [2661343] smart account 3N22NBbCmfZkmxFSMqb9kP61WHg1xGPndQR > SELF 0.00000000 Waves
{ "type": 13, "id": "AZDJLz7wxKtzg7pwcsaDYxk2hyRjJQZgZiKeFSHtGfpk", "fee": 1400000, "feeAssetId": null, "timestamp": 1689084216294, "version": 2, "chainId": 84, "sender": "3N22NBbCmfZkmxFSMqb9kP61WHg1xGPndQR", "senderPublicKey": "EW9SXsydFphpvtoJTkGkVrHVjPwv58ToopA94BnLibNG", "proofs": [ "66X53ng2iThWLWZSqcz7jrKZs7NuX5wQ15F4mVBPVHCsdShPoaN6gLEojwTwQue8rnCgRJBy1AUtQVaT4VVUALbL" ], "script": "base64:BgI3CAISAwoBCBIECgIBCBIHCgUBCAEIARIHCgUBCAEIARIDCgEIEgMKAQgSABIAEgMKAQgSAwoBCCEACVNFUEFSQVRPUgICX18ACEtFWV9JTklUAgRJTklUAAxLRVlfTVVMVElTSUcCCE1VTFRJU0lHAApLRVlfU1RBVFVTAgZTVEFUVVMACktFWV9QQVVTRUQCBlBBVVNFRAAKS0VZX1BBVVNFUgIGUEFVU0VSAA1LRVlfQUxMT1dBTkNFAglBTExPV0FOQ0UAC0tFWV9BREFQVEVSAgdBREFQVEVSABNGVU5DX1JFTEVBU0VfVE9LRU5TAg1yZWxlYXNlVG9rZW5zABBGVU5DX01JTlRfVE9LRU5TAgptaW50VG9rZW5zAAdNQVhfSU5UAP//////////fwEQX3ZhbGlkYXRlQWRkcmVzcwIIYWRkcmVzc18EZXJyXwQHJG1hdGNoMAkApggBBQhhZGRyZXNzXwMJAAECBQckbWF0Y2gwAgdBZGRyZXNzBAFhBQckbWF0Y2gwBgkAAgEFBGVycl8BDF92YWxpZGF0ZUludAQEdmFsXw5sb3dlckJvdW5kYXJ5Xw51cHBlckJvdW5kYXJ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YWxpZCBtdWx0aXNpZwcDCQAAAgUDZXJyBQNlcnIJAJQKAgkBDV9zYXZlTXVsdGlzaWcBCQERQGV4dHJOYXRpdmUoMTA2MikBBQltdWx0aXNpZ18FBHVuaXQJAAIBAiRTdHJpY3QgdmFsdWUgaXMgbm90IGVxdWFsIHRvIGl0c2VsZi4BAnR4AQZ2ZXJpZnkABAckbWF0Y2gwCQCiCAEFDEtFWV9NVUxUSVNJRwMJAAECBQckbWF0Y2gwAgZTdHJpbmcECG11bHRpc2lnBQckbWF0Y2gwCQELdmFsdWVPckVsc2UCCQCbCAIJARFAZXh0ck5hdGl2ZSgxMDYyKQEFCG11bHRpc2lnCQC5CQIJAMwIAgUKS0VZX1NUQVRVUwkAzAgCCQClCAEFBHRoaXMJAMwIAgkA2AQBCAUCdHgCaWQFA25pbAUJU0VQQVJBVE9SBwkA9AMDCAUCdHgJYm9keUJ5dGVzCQCRAwIIBQJ0eAZwcm9vZnMAAAgFAnR4D3NlbmRlclB1YmxpY0tleQJa/bs=", "height": 2661343, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: CAU9R8xHR7gcnyCdaNY9fzdJDrfnQRfSo44FBqi6tkd1 Next: none Diff:
Old | New | Differences | |
---|---|---|---|
18 | 18 | let KEY_ADAPTER = "ADAPTER" | |
19 | 19 | ||
20 | 20 | let FUNC_RELEASE_TOKENS = "releaseTokens" | |
21 | + | ||
22 | + | let FUNC_MINT_TOKENS = "mintTokens" | |
21 | 23 | ||
22 | 24 | let MAX_INT = 9223372036854775807 | |
23 | 25 | ||
194 | 196 | ||
195 | 197 | ||
196 | 198 | @Callable(i) | |
199 | + | func mintTokens (executionChainId_,executionAsset_,amount_,recipient_,gaslessReward_) = { | |
200 | + | let err = if (if (_whenInitialized()) | |
201 | + | then _whenNotPaused() | |
202 | + | else false) | |
203 | + | then _whenAllowed(i.caller) | |
204 | + | else false | |
205 | + | if ((err == err)) | |
206 | + | then { | |
207 | + | let invocation = invoke(_loadAdapter(executionChainId_), FUNC_MINT_TOKENS, [executionChainId_, executionAsset_, amount_, recipient_, gaslessReward_], nil) | |
208 | + | if ((invocation == invocation)) | |
209 | + | then $Tuple2(nil, unit) | |
210 | + | else throw("Strict value is not equal to itself.") | |
211 | + | } | |
212 | + | else throw("Strict value is not equal to itself.") | |
213 | + | } | |
214 | + | ||
215 | + | ||
216 | + | ||
217 | + | @Callable(i) | |
197 | 218 | func allow (caller_) = { | |
198 | 219 | let err = if (if (_onlyThisContract(i.caller)) | |
199 | 220 | then _whenInitialized() | |
254 | 275 | let err = if (if (_onlyThisContract(i.caller)) | |
255 | 276 | then _whenInitialized() | |
256 | 277 | else false) | |
257 | - | then _validateAddress(pauser_, " | |
278 | + | then _validateAddress(pauser_, "updatePauser: invalid pauser") | |
258 | 279 | else false | |
259 | 280 | if ((err == err)) | |
260 | 281 | then $Tuple2(_savePauser(addressFromStringValue(pauser_)), unit) |
Old | New | Differences | |
---|---|---|---|
1 | 1 | {-# STDLIB_VERSION 6 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | 4 | let SEPARATOR = "__" | |
5 | 5 | ||
6 | 6 | let KEY_INIT = "INIT" | |
7 | 7 | ||
8 | 8 | let KEY_MULTISIG = "MULTISIG" | |
9 | 9 | ||
10 | 10 | let KEY_STATUS = "STATUS" | |
11 | 11 | ||
12 | 12 | let KEY_PAUSED = "PAUSED" | |
13 | 13 | ||
14 | 14 | let KEY_PAUSER = "PAUSER" | |
15 | 15 | ||
16 | 16 | let KEY_ALLOWANCE = "ALLOWANCE" | |
17 | 17 | ||
18 | 18 | let KEY_ADAPTER = "ADAPTER" | |
19 | 19 | ||
20 | 20 | let FUNC_RELEASE_TOKENS = "releaseTokens" | |
21 | + | ||
22 | + | let FUNC_MINT_TOKENS = "mintTokens" | |
21 | 23 | ||
22 | 24 | let MAX_INT = 9223372036854775807 | |
23 | 25 | ||
24 | 26 | func _validateAddress (address_,err_) = match addressFromString(address_) { | |
25 | 27 | case a: Address => | |
26 | 28 | true | |
27 | 29 | case _ => | |
28 | 30 | throw(err_) | |
29 | 31 | } | |
30 | 32 | ||
31 | 33 | ||
32 | 34 | func _validateInt (val_,lowerBoundary_,upperBoundary_,err_) = if (if ((lowerBoundary_ > val_)) | |
33 | 35 | then true | |
34 | 36 | else (val_ > upperBoundary_)) | |
35 | 37 | then throw(err_) | |
36 | 38 | else true | |
37 | 39 | ||
38 | 40 | ||
39 | 41 | func _loadInit () = match getBoolean(KEY_INIT) { | |
40 | 42 | case a: Boolean => | |
41 | 43 | a | |
42 | 44 | case _ => | |
43 | 45 | false | |
44 | 46 | } | |
45 | 47 | ||
46 | 48 | ||
47 | 49 | func _saveInit (isInit_) = [BooleanEntry(KEY_INIT, isInit_)] | |
48 | 50 | ||
49 | 51 | ||
50 | 52 | func _loadPause () = match getBoolean(KEY_PAUSED) { | |
51 | 53 | case a: Boolean => | |
52 | 54 | a | |
53 | 55 | case _ => | |
54 | 56 | false | |
55 | 57 | } | |
56 | 58 | ||
57 | 59 | ||
58 | 60 | func _savePause (isPaused_) = [BooleanEntry(KEY_PAUSED, isPaused_)] | |
59 | 61 | ||
60 | 62 | ||
61 | 63 | func _loadPauser () = match getString(KEY_PAUSER) { | |
62 | 64 | case a: String => | |
63 | 65 | addressFromStringValue(a) | |
64 | 66 | case _ => | |
65 | 67 | Address(base58'') | |
66 | 68 | } | |
67 | 69 | ||
68 | 70 | ||
69 | 71 | func _savePauser (pauser_) = [StringEntry(KEY_PAUSER, toString(pauser_))] | |
70 | 72 | ||
71 | 73 | ||
72 | 74 | func _loadMultisig () = match getString(KEY_MULTISIG) { | |
73 | 75 | case a: String => | |
74 | 76 | addressFromStringValue(a) | |
75 | 77 | case _ => | |
76 | 78 | Address(base58'') | |
77 | 79 | } | |
78 | 80 | ||
79 | 81 | ||
80 | 82 | func _saveMultisig (multisig_) = [StringEntry(KEY_MULTISIG, toString(multisig_))] | |
81 | 83 | ||
82 | 84 | ||
83 | 85 | func _loadAllowance (caller_) = match getBoolean(makeString([KEY_ALLOWANCE, toString(caller_)], SEPARATOR)) { | |
84 | 86 | case a: Boolean => | |
85 | 87 | a | |
86 | 88 | case _ => | |
87 | 89 | false | |
88 | 90 | } | |
89 | 91 | ||
90 | 92 | ||
91 | 93 | func _saveAllowance (caller_,val_) = [BooleanEntry(makeString([KEY_ALLOWANCE, toString(caller_)], SEPARATOR), val_)] | |
92 | 94 | ||
93 | 95 | ||
94 | 96 | func _loadAdapter (executionChainId_) = match getString(makeString([KEY_ADAPTER, toString(executionChainId_)], SEPARATOR)) { | |
95 | 97 | case a: String => | |
96 | 98 | addressFromStringValue(a) | |
97 | 99 | case _ => | |
98 | 100 | Address(base58'') | |
99 | 101 | } | |
100 | 102 | ||
101 | 103 | ||
102 | 104 | func _saveAdapter (executionChainId_,adapter_) = [StringEntry(makeString([KEY_ADAPTER, toString(executionChainId_)], SEPARATOR), toString(adapter_))] | |
103 | 105 | ||
104 | 106 | ||
105 | 107 | func _onlyThisContract (caller_) = if ((caller_ != this)) | |
106 | 108 | then throw("_onlyThisContract: revert") | |
107 | 109 | else true | |
108 | 110 | ||
109 | 111 | ||
110 | 112 | func _whenMultisigSet () = if ((_loadMultisig() == Address(base58''))) | |
111 | 113 | then throw("_whenMultisigSet: revert") | |
112 | 114 | else true | |
113 | 115 | ||
114 | 116 | ||
115 | 117 | func _whenNotInitialized () = if (_loadInit()) | |
116 | 118 | then throw("_whenNotInitialized: revert") | |
117 | 119 | else true | |
118 | 120 | ||
119 | 121 | ||
120 | 122 | func _whenInitialized () = if (!(_loadInit())) | |
121 | 123 | then throw("_whenInitialized: revert") | |
122 | 124 | else true | |
123 | 125 | ||
124 | 126 | ||
125 | 127 | func _whenNotPaused () = if (_loadPause()) | |
126 | 128 | then throw("_whenNotPaused: revert") | |
127 | 129 | else true | |
128 | 130 | ||
129 | 131 | ||
130 | 132 | func _whenPaused () = if (!(_loadPause())) | |
131 | 133 | then throw("_whenPaused: revert") | |
132 | 134 | else true | |
133 | 135 | ||
134 | 136 | ||
135 | 137 | func _onlyPauser (caller_) = if ((caller_ != _loadPauser())) | |
136 | 138 | then throw("_onlyPauser: revert") | |
137 | 139 | else true | |
138 | 140 | ||
139 | 141 | ||
140 | 142 | func _whenAllowed (caller_) = if (!(_loadAllowance(caller_))) | |
141 | 143 | then throw("_whenAllowed: revert") | |
142 | 144 | else true | |
143 | 145 | ||
144 | 146 | ||
145 | 147 | @Callable(i) | |
146 | 148 | func init (pauser_) = { | |
147 | 149 | let err = if (if (if (_onlyThisContract(i.caller)) | |
148 | 150 | then _whenNotInitialized() | |
149 | 151 | else false) | |
150 | 152 | then _whenMultisigSet() | |
151 | 153 | else false) | |
152 | 154 | then _validateAddress(pauser_, "init: invalid pauser") | |
153 | 155 | else false | |
154 | 156 | if ((err == err)) | |
155 | 157 | then $Tuple2((_saveInit(true) ++ _savePauser(addressFromStringValue(pauser_))), unit) | |
156 | 158 | else throw("Strict value is not equal to itself.") | |
157 | 159 | } | |
158 | 160 | ||
159 | 161 | ||
160 | 162 | ||
161 | 163 | @Callable(i) | |
162 | 164 | func setAdapter (executionChainId_,adapter_) = { | |
163 | 165 | let err = if (if (if (_onlyThisContract(i.caller)) | |
164 | 166 | then _whenInitialized() | |
165 | 167 | else false) | |
166 | 168 | then _validateInt(executionChainId_, 0, MAX_INT, "setAdapter: invalid executionChainId") | |
167 | 169 | else false) | |
168 | 170 | then _validateAddress(adapter_, "setAdapter: invalid adapter") | |
169 | 171 | else false | |
170 | 172 | if ((err == err)) | |
171 | 173 | then $Tuple2(_saveAdapter(executionChainId_, addressFromStringValue(adapter_)), unit) | |
172 | 174 | else throw("Strict value is not equal to itself.") | |
173 | 175 | } | |
174 | 176 | ||
175 | 177 | ||
176 | 178 | ||
177 | 179 | @Callable(i) | |
178 | 180 | func releaseTokens (executionChainId_,executionAsset_,amount_,recipient_,gaslessReward_) = { | |
179 | 181 | let err = if (if (_whenInitialized()) | |
180 | 182 | then _whenNotPaused() | |
181 | 183 | else false) | |
182 | 184 | then _whenAllowed(i.caller) | |
183 | 185 | else false | |
184 | 186 | if ((err == err)) | |
185 | 187 | then { | |
186 | 188 | let invocation = invoke(_loadAdapter(executionChainId_), FUNC_RELEASE_TOKENS, [executionChainId_, executionAsset_, amount_, recipient_, gaslessReward_], nil) | |
187 | 189 | if ((invocation == invocation)) | |
188 | 190 | then $Tuple2(nil, unit) | |
189 | 191 | else throw("Strict value is not equal to itself.") | |
190 | 192 | } | |
191 | 193 | else throw("Strict value is not equal to itself.") | |
192 | 194 | } | |
193 | 195 | ||
194 | 196 | ||
195 | 197 | ||
196 | 198 | @Callable(i) | |
199 | + | func mintTokens (executionChainId_,executionAsset_,amount_,recipient_,gaslessReward_) = { | |
200 | + | let err = if (if (_whenInitialized()) | |
201 | + | then _whenNotPaused() | |
202 | + | else false) | |
203 | + | then _whenAllowed(i.caller) | |
204 | + | else false | |
205 | + | if ((err == err)) | |
206 | + | then { | |
207 | + | let invocation = invoke(_loadAdapter(executionChainId_), FUNC_MINT_TOKENS, [executionChainId_, executionAsset_, amount_, recipient_, gaslessReward_], nil) | |
208 | + | if ((invocation == invocation)) | |
209 | + | then $Tuple2(nil, unit) | |
210 | + | else throw("Strict value is not equal to itself.") | |
211 | + | } | |
212 | + | else throw("Strict value is not equal to itself.") | |
213 | + | } | |
214 | + | ||
215 | + | ||
216 | + | ||
217 | + | @Callable(i) | |
197 | 218 | func allow (caller_) = { | |
198 | 219 | let err = if (if (_onlyThisContract(i.caller)) | |
199 | 220 | then _whenInitialized() | |
200 | 221 | else false) | |
201 | 222 | then _validateAddress(caller_, "allow: invalid caller") | |
202 | 223 | else false | |
203 | 224 | if ((err == err)) | |
204 | 225 | then $Tuple2(_saveAllowance(addressFromStringValue(caller_), true), unit) | |
205 | 226 | else throw("Strict value is not equal to itself.") | |
206 | 227 | } | |
207 | 228 | ||
208 | 229 | ||
209 | 230 | ||
210 | 231 | @Callable(i) | |
211 | 232 | func disallow (caller_) = { | |
212 | 233 | let err = if (if (_onlyThisContract(i.caller)) | |
213 | 234 | then _whenInitialized() | |
214 | 235 | else false) | |
215 | 236 | then _validateAddress(caller_, "disallow: invalid caller") | |
216 | 237 | else false | |
217 | 238 | if ((err == err)) | |
218 | 239 | then $Tuple2(_saveAllowance(addressFromStringValue(caller_), false), unit) | |
219 | 240 | else throw("Strict value is not equal to itself.") | |
220 | 241 | } | |
221 | 242 | ||
222 | 243 | ||
223 | 244 | ||
224 | 245 | @Callable(i) | |
225 | 246 | func pause () = { | |
226 | 247 | let err = if (if (_onlyPauser(i.caller)) | |
227 | 248 | then _whenInitialized() | |
228 | 249 | else false) | |
229 | 250 | then _whenNotPaused() | |
230 | 251 | else false | |
231 | 252 | if ((err == err)) | |
232 | 253 | then $Tuple2(_savePause(true), unit) | |
233 | 254 | else throw("Strict value is not equal to itself.") | |
234 | 255 | } | |
235 | 256 | ||
236 | 257 | ||
237 | 258 | ||
238 | 259 | @Callable(i) | |
239 | 260 | func unpause () = { | |
240 | 261 | let err = if (if (_onlyPauser(i.caller)) | |
241 | 262 | then _whenInitialized() | |
242 | 263 | else false) | |
243 | 264 | then _whenPaused() | |
244 | 265 | else false | |
245 | 266 | if ((err == err)) | |
246 | 267 | then $Tuple2(_savePause(false), unit) | |
247 | 268 | else throw("Strict value is not equal to itself.") | |
248 | 269 | } | |
249 | 270 | ||
250 | 271 | ||
251 | 272 | ||
252 | 273 | @Callable(i) | |
253 | 274 | func updatePauser (pauser_) = { | |
254 | 275 | let err = if (if (_onlyThisContract(i.caller)) | |
255 | 276 | then _whenInitialized() | |
256 | 277 | else false) | |
257 | - | then _validateAddress(pauser_, " | |
278 | + | then _validateAddress(pauser_, "updatePauser: invalid pauser") | |
258 | 279 | else false | |
259 | 280 | if ((err == err)) | |
260 | 281 | then $Tuple2(_savePauser(addressFromStringValue(pauser_)), unit) | |
261 | 282 | else throw("Strict value is not equal to itself.") | |
262 | 283 | } | |
263 | 284 | ||
264 | 285 | ||
265 | 286 | ||
266 | 287 | @Callable(i) | |
267 | 288 | func setMultisig (multisig_) = { | |
268 | 289 | let err = if (_onlyThisContract(i.caller)) | |
269 | 290 | then _validateAddress(multisig_, "setMultisig: invalid multisig") | |
270 | 291 | else false | |
271 | 292 | if ((err == err)) | |
272 | 293 | then $Tuple2(_saveMultisig(addressFromStringValue(multisig_)), unit) | |
273 | 294 | else throw("Strict value is not equal to itself.") | |
274 | 295 | } | |
275 | 296 | ||
276 | 297 | ||
277 | 298 | @Verifier(tx) | |
278 | 299 | func verify () = match getString(KEY_MULTISIG) { | |
279 | 300 | case multisig: String => | |
280 | 301 | valueOrElse(getBoolean(addressFromStringValue(multisig), makeString([KEY_STATUS, toString(this), toBase58String(tx.id)], SEPARATOR)), false) | |
281 | 302 | case _ => | |
282 | 303 | sigVerify(tx.bodyBytes, tx.proofs[0], tx.senderPublicKey) | |
283 | 304 | } | |
284 | 305 |
github/deemru/w8io/026f985 48.21 ms ◑