tx · pXfvdhSPXXDRHNgbyJxh51hmSqcNBPAq1VJjRnvz9t5 3N181WizgkxpWSFQoCnSbhRu2j1cwBadDYY: -0.01400000 Waves 2023.02.20 22:17 [2458382] smart account 3N181WizgkxpWSFQoCnSbhRu2j1cwBadDYY > SELF 0.00000000 Waves
{ "type": 13, "id": "pXfvdhSPXXDRHNgbyJxh51hmSqcNBPAq1VJjRnvz9t5", "fee": 1400000, "feeAssetId": null, "timestamp": 1676920633373, "version": 2, "chainId": 84, "sender": "3N181WizgkxpWSFQoCnSbhRu2j1cwBadDYY", "senderPublicKey": "9Hom3CnVGCVZiB6V5j3mEeAuquZytXpj99sSEdnAFy52", "proofs": [ "yKLTwHXvijRUfNrGjEQNrPT1uKH7MW6dLU9z2esmMxMgmuUTu7NcWmmuJpXBE6BfyXXBBebUUzhvm4ShcCzVFLq" ], "script": "base64:BgInCAISBAoCCAESBQoDAQgIEgMKAQgSAwoBCBIAEgASAwoBCBIDCgEIJwAJU0VQQVJBVE9SAgJfXwAIS0VZX0lOSVQCBElOSVQADEtFWV9NVUxUSVNJRwIITVVMVElTSUcACktFWV9TVEFUVVMCBlNUQVRVUwAKS0VZX1BBVVNFRAIGUEFVU0VEAApLRVlfUEFVU0VSAgZQQVVTRVIADUtFWV9BTExPV0FOQ0UCCUFMTE9XQU5DRQARS0VZX0NBTExfQ0hBSU5fSUQCDUNBTExfQ0hBSU5fSUQAEktFWV9FVkVOVF9MQVNUX0lEWAIORVZFTlRfTEFTVF9JRFgACUtFWV9FVkVOVAIFRVZFTlQACUtFWV9OT05DRQIFTk9OQ0UAB01BWF9JTlQA//////////9/ARBfdmFsaWRhdGVBZGRyZXNzAghhZGRyZXNzXwRlcnJfBAckbWF0Y2gwCQCmCAEFCGFkZHJlc3NfAwkAAQIFByRtYXRjaDACB0FkZHJlc3MEAWEFByRtYXRjaDAGCQACAQUEZXJyXwEMX3ZhbGlkYXRlSW50BAR2YWxfDmxvd2VyQm91bmRhcnlfDnVwcGVyQm91bm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MCCAUCdHgGcHJvb2ZzAAAIBQJ0eA9zZW5kZXJQdWJsaWNLZXlh9XBz", "height": 2458382, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: none Next: 4WwtiPZxCfMdN9jmMZWWeAPwrRL6THgRTa5Hg83v7uyE 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_CALL_CHAIN_ID = "CALL_CHAIN_ID" | |
19 | + | ||
20 | + | let KEY_EVENT_LAST_IDX = "EVENT_LAST_IDX" | |
21 | + | ||
22 | + | let KEY_EVENT = "EVENT" | |
23 | + | ||
24 | + | let KEY_NONCE = "NONCE" | |
25 | + | ||
26 | + | let MAX_INT = 9223372036854775807 | |
27 | + | ||
28 | + | func _validateAddress (address_,err_) = match addressFromString(address_) { | |
29 | + | case a: Address => | |
30 | + | true | |
31 | + | case _ => | |
32 | + | throw(err_) | |
33 | + | } | |
34 | + | ||
35 | + | ||
36 | + | func _validateInt (val_,lowerBoundary_,upperBoundary_,err_) = if (if ((lowerBoundary_ > val_)) | |
37 | + | then true | |
38 | + | else (val_ > upperBoundary_)) | |
39 | + | then throw(err_) | |
40 | + | else true | |
41 | + | ||
42 | + | ||
43 | + | func _loadInit () = match getBoolean(KEY_INIT) { | |
44 | + | case a: Boolean => | |
45 | + | a | |
46 | + | case _ => | |
47 | + | false | |
48 | + | } | |
49 | + | ||
50 | + | ||
51 | + | func _saveInit (isInit_) = [BooleanEntry(KEY_INIT, isInit_)] | |
52 | + | ||
53 | + | ||
54 | + | func _loadPause () = match getBoolean(KEY_PAUSED) { | |
55 | + | case a: Boolean => | |
56 | + | a | |
57 | + | case _ => | |
58 | + | false | |
59 | + | } | |
60 | + | ||
61 | + | ||
62 | + | func _savePause (isPaused_) = [BooleanEntry(KEY_PAUSED, isPaused_)] | |
63 | + | ||
64 | + | ||
65 | + | func _loadPauser () = match getString(KEY_PAUSER) { | |
66 | + | case a: String => | |
67 | + | addressFromStringValue(a) | |
68 | + | case _ => | |
69 | + | Address(base58'') | |
70 | + | } | |
71 | + | ||
72 | + | ||
73 | + | func _savePauser (pauser_) = [StringEntry(KEY_PAUSER, toString(pauser_))] | |
74 | + | ||
75 | + | ||
76 | + | func _loadAllowance (caller_) = match getBoolean(makeString([KEY_ALLOWANCE, toString(caller_)], SEPARATOR)) { | |
77 | + | case a: Boolean => | |
78 | + | a | |
79 | + | case _ => | |
80 | + | false | |
81 | + | } | |
82 | + | ||
83 | + | ||
84 | + | func _saveAllowance (caller_,val_) = [BooleanEntry(makeString([KEY_ALLOWANCE, toString(caller_)], SEPARATOR), val_)] | |
85 | + | ||
86 | + | ||
87 | + | func _loadMultisig () = match getString(KEY_MULTISIG) { | |
88 | + | case a: String => | |
89 | + | addressFromStringValue(a) | |
90 | + | case _ => | |
91 | + | Address(base58'') | |
92 | + | } | |
93 | + | ||
94 | + | ||
95 | + | func _saveMultisig (multisig_) = [StringEntry(KEY_MULTISIG, toString(multisig_))] | |
96 | + | ||
97 | + | ||
98 | + | func _loadCallChainId () = match getInteger(KEY_CALL_CHAIN_ID) { | |
99 | + | case a: Int => | |
100 | + | a | |
101 | + | case _ => | |
102 | + | 0 | |
103 | + | } | |
104 | + | ||
105 | + | ||
106 | + | func _saveCallChainId (callChainId_) = [IntegerEntry(KEY_CALL_CHAIN_ID, callChainId_)] | |
107 | + | ||
108 | + | ||
109 | + | func _loadEventLastIndex () = match getInteger(KEY_EVENT_LAST_IDX) { | |
110 | + | case a: Int => | |
111 | + | a | |
112 | + | case _ => | |
113 | + | 0 | |
114 | + | } | |
115 | + | ||
116 | + | ||
117 | + | func _saveEventLastIndex (index_) = [IntegerEntry(KEY_EVENT_LAST_IDX, index_)] | |
118 | + | ||
119 | + | ||
120 | + | func _saveEvent (index_,event_) = [StringEntry(makeString([KEY_EVENT, toString(index_)], SEPARATOR), makeString([toString(event_._1), toString(event_._2), toString(event_._3), event_._4, event_._5, toString(event_._6)], SEPARATOR))] | |
121 | + | ||
122 | + | ||
123 | + | func _loadNonce () = match getInteger(KEY_NONCE) { | |
124 | + | case a: Int => | |
125 | + | a | |
126 | + | case _ => | |
127 | + | 0 | |
128 | + | } | |
129 | + | ||
130 | + | ||
131 | + | func _saveNonce (val_) = [IntegerEntry(KEY_NONCE, val_)] | |
132 | + | ||
133 | + | ||
134 | + | func _onlyThisContract (caller_) = if ((caller_ != this)) | |
135 | + | then throw("_onlyThisContract: revert") | |
136 | + | else true | |
137 | + | ||
138 | + | ||
139 | + | func _whenMultisigSet () = if ((_loadMultisig() == Address(base58''))) | |
140 | + | then throw("_whenMultisigSet: revert") | |
141 | + | else true | |
142 | + | ||
143 | + | ||
144 | + | func _whenNotInitialized () = if (_loadInit()) | |
145 | + | then throw("_whenNotInitialized: revert") | |
146 | + | else true | |
147 | + | ||
148 | + | ||
149 | + | func _whenInitialized () = if (!(_loadInit())) | |
150 | + | then throw("_whenInitialized: revert") | |
151 | + | else true | |
152 | + | ||
153 | + | ||
154 | + | func _whenNotPaused () = if (_loadPause()) | |
155 | + | then throw("_whenNotPaused: revert") | |
156 | + | else true | |
157 | + | ||
158 | + | ||
159 | + | func _whenPaused () = if (!(_loadPause())) | |
160 | + | then throw("_whenPaused: revert") | |
161 | + | else true | |
162 | + | ||
163 | + | ||
164 | + | func _onlyPauser (caller_) = if ((caller_ != _loadPauser())) | |
165 | + | then throw("_onlyPauser: revert") | |
166 | + | else true | |
167 | + | ||
168 | + | ||
169 | + | func _whenAllowed (caller_) = if (!(_loadAllowance(caller_))) | |
170 | + | then throw("_whenAllowed: revert") | |
171 | + | else true | |
172 | + | ||
173 | + | ||
174 | + | @Callable(i) | |
175 | + | func init (pauser_,callChainId_) = { | |
176 | + | let err = if (if (if (if (_onlyThisContract(i.caller)) | |
177 | + | then _whenNotInitialized() | |
178 | + | else false) | |
179 | + | then _whenMultisigSet() | |
180 | + | else false) | |
181 | + | then _validateAddress(pauser_, "init: invalid pauser") | |
182 | + | else false) | |
183 | + | then _validateInt(callChainId_, 0, MAX_INT, "init: invalid call chain id") | |
184 | + | else false | |
185 | + | if ((err == err)) | |
186 | + | then $Tuple2(((_saveInit(true) ++ _savePauser(addressFromStringValue(pauser_))) ++ _saveCallChainId(callChainId_)), unit) | |
187 | + | else throw("Strict value is not equal to itself.") | |
188 | + | } | |
189 | + | ||
190 | + | ||
191 | + | ||
192 | + | @Callable(i) | |
193 | + | func call (executionChainId_,executionContract_,calldata_) = { | |
194 | + | let err = if (if (_whenInitialized()) | |
195 | + | then _whenAllowed(i.caller) | |
196 | + | else false) | |
197 | + | then _whenNotPaused() | |
198 | + | else false | |
199 | + | if ((err == err)) | |
200 | + | then { | |
201 | + | let nonce = _loadNonce() | |
202 | + | let eventLastIndex = _loadEventLastIndex() | |
203 | + | let event = $Tuple6(_loadCallChainId(), executionChainId_, i.caller, executionContract_, calldata_, nonce) | |
204 | + | $Tuple2(((_saveEventLastIndex((eventLastIndex + 1)) ++ _saveEvent(eventLastIndex, event)) ++ _saveNonce((nonce + 1))), unit) | |
205 | + | } | |
206 | + | else throw("Strict value is not equal to itself.") | |
207 | + | } | |
208 | + | ||
209 | + | ||
210 | + | ||
211 | + | @Callable(i) | |
212 | + | func allow (caller_) = { | |
213 | + | let err = if (if (_onlyThisContract(i.caller)) | |
214 | + | then _whenInitialized() | |
215 | + | else false) | |
216 | + | then _validateAddress(caller_, "allow: invalid caller arg") | |
217 | + | else false | |
218 | + | if ((err == err)) | |
219 | + | then $Tuple2(_saveAllowance(addressFromStringValue(caller_), true), unit) | |
220 | + | else throw("Strict value is not equal to itself.") | |
221 | + | } | |
222 | + | ||
223 | + | ||
224 | + | ||
225 | + | @Callable(i) | |
226 | + | func disallow (caller_) = { | |
227 | + | let err = if (if (_onlyThisContract(i.caller)) | |
228 | + | then _whenInitialized() | |
229 | + | else false) | |
230 | + | then _validateAddress(caller_, "disallow: invalid caller arg") | |
231 | + | else false | |
232 | + | if ((err == err)) | |
233 | + | then $Tuple2(_saveAllowance(addressFromStringValue(caller_), false), unit) | |
234 | + | else throw("Strict value is not equal to itself.") | |
235 | + | } | |
236 | + | ||
237 | + | ||
238 | + | ||
239 | + | @Callable(i) | |
240 | + | func pause () = { | |
241 | + | let err = if (if (_onlyPauser(i.caller)) | |
242 | + | then _whenInitialized() | |
243 | + | else false) | |
244 | + | then _whenNotPaused() | |
245 | + | else false | |
246 | + | if ((err == err)) | |
247 | + | then $Tuple2(_savePause(true), unit) | |
248 | + | else throw("Strict value is not equal to itself.") | |
249 | + | } | |
250 | + | ||
251 | + | ||
252 | + | ||
253 | + | @Callable(i) | |
254 | + | func unpause () = { | |
255 | + | let err = if (if (_onlyPauser(i.caller)) | |
256 | + | then _whenInitialized() | |
257 | + | else false) | |
258 | + | then _whenPaused() | |
259 | + | else false | |
260 | + | if ((err == err)) | |
261 | + | then $Tuple2(_savePause(false), unit) | |
262 | + | else throw("Strict value is not equal to itself.") | |
263 | + | } | |
264 | + | ||
265 | + | ||
266 | + | ||
267 | + | @Callable(i) | |
268 | + | func updatePauser (pauser_) = { | |
269 | + | let err = if (if (_onlyThisContract(i.caller)) | |
270 | + | then _whenInitialized() | |
271 | + | else false) | |
272 | + | then _validateAddress(pauser_, "init: invalid pauser") | |
273 | + | else false | |
274 | + | if ((err == err)) | |
275 | + | then $Tuple2(_savePauser(addressFromStringValue(pauser_)), unit) | |
276 | + | else throw("Strict value is not equal to itself.") | |
277 | + | } | |
278 | + | ||
279 | + | ||
280 | + | ||
281 | + | @Callable(i) | |
282 | + | func setMultisig (multisig_) = { | |
283 | + | let err = if (_onlyThisContract(i.caller)) | |
284 | + | then _validateAddress(multisig_, "setMultisig: invalid multisig address") | |
285 | + | else false | |
286 | + | if ((err == err)) | |
287 | + | then $Tuple2(_saveMultisig(addressFromStringValue(multisig_)), unit) | |
288 | + | else throw("Strict value is not equal to itself.") | |
289 | + | } | |
290 | + | ||
291 | + | ||
292 | + | @Verifier(tx) | |
293 | + | func verify () = match getString(KEY_MULTISIG) { | |
294 | + | case multisig: String => | |
295 | + | valueOrElse(getBoolean(addressFromStringValue(multisig), makeString([KEY_STATUS, toString(this), toBase58String(tx.id)], SEPARATOR)), false) | |
296 | + | case _ => | |
297 | + | sigVerify(tx.bodyBytes, tx.proofs[0], tx.senderPublicKey) | |
298 | + | } | |
299 | + |
github/deemru/w8io/169f3d6 37.13 ms ◑