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