tx · 6U6FKEzxpvutuLcZUu5QRKDk8nDz7QvbWD5zEgRpRNYa

3N2KNrB3madM5kY2CAknABcGDgzkAkfZLVX:  -0.05000000 Waves

2023.07.12 15:24 [2662676] smart account 3N2KNrB3madM5kY2CAknABcGDgzkAkfZLVX > SELF 0.00000000 Waves

{ "type": 13, "id": "6U6FKEzxpvutuLcZUu5QRKDk8nDz7QvbWD5zEgRpRNYa", "fee": 5000000, "feeAssetId": null, "timestamp": 1689164703132, "version": 2, "chainId": 84, "sender": "3N2KNrB3madM5kY2CAknABcGDgzkAkfZLVX", "senderPublicKey": "9uCy4StXuoZuAxyDX2eBnJa9ZFeV76kBzDbBXaGb1JuY", "proofs": [ "4nctsWz5mB8rX5BWPkmiUDHHWzNbZagqW4CAAekAhDW28UZm1jezpBGkDSU7wszjnJk6vWHyppLVMq6qFaweRwnv" ], "script": "base64:BgL+BggCEgMKAQgSABIDCgEIEgMKAQgSAwoBCBIDCgEIEgMKAQgiA1NFUCIEam9pbiICYXIiDmtleUluaXRpYWxpemVkIhVrZXlDb29yZGluYXRvckFkZHJlc3MiEmtleVZlcmlmaWVyQWRkcmVzcyIQa2V5TWludGVyQWRkcmVzcyIMa2V5RWFzdEFzc2V0IglrZXlTaWduZWQiCF9hZGRyZXNzIgVfdHhJZCIRa2V5UHJvdG9jb2xBY3RpdmUiDWlzSW5pdGlhbGl6ZWQiD211c3RJbml0aWFsaXplZCISbXVzdE5vdEluaXRpYWxpemVkIghtdXN0U2VsZiIBaSILY29vcmRpbmF0b3IiCHZlcmlmaWVyIgckbWF0Y2gwIgFzIgpnZXRBZGRyZXNzIgNrZXkiA2VyciIQZ2V0TWludGVyQWRkcmVzcyIPZ2V0RWFzdEFzc2V0U3RyIgxnZXRFYXN0QXNzZXQiCGlzQWN0aXZlIgptdXN0QWN0aXZlIhJtdXN0SGF2ZU9uZVBheW1lbnQiFGdldEFzc2V0SWRGcm9tU3RyaW5nIgdhc3NldElkIgdpc0Fzc2V0IgFwIg1jaGV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BAWoEAmFqCQDMCAIJAQFuAAkAzAgCCQEBcAEFAXEJAMwIAgkBAU8BBQFqCQDMCAIJAQJhZQEFAWoFA25pbAMJAAACBQJhagUCYWoJAMwIAgkBDEJvb2xlYW5FbnRyeQIJAQFRAQUBagcFA25pbAkAAgECJFN0cmljdCB2YWx1ZSBpcyBub3QgZXF1YWwgdG8gaXRzZWxmLgFxAQhhZGRBc3NldAEBUwQCYWoJAMwIAgkBAW4ACQDMCAIJAQFwAQUBcQkAzAgCCQECYWMBBQFTCQDMCAIJAQJhaAEFAVMFA25pbAMJAAACBQJhagUCYWoJAMwIAgkBDEJvb2xlYW5FbnRyeQIJAQFSAQUBUwYFA25pbAkAAgECJFN0cmljdCB2YWx1ZSBpcyBub3QgZXF1YWwgdG8gaXRzZWxmLgFxAQtyZW1vdmVBc3NldAEBUwQCYWoJAMwIAgkBAW4ACQDMCAIJAQFwAQUBcQkAzAgCCQECYWcBBQFTBQNuaWwDCQAAAgUCYWoFAmFqCQDMCAIJAQxCb29sZWFuRW50cnkCCQEBUgEFAVMHBQNuaWwJAAIBAiRTdHJpY3QgdmFsdWUgaXMgbm90IGVxdWFsIHRvIGl0c2VsZi4BAmFwAQJhcQAEAXQJAQFzAAMJAAECBQF0AgZTdHJpbmcEAVAFAXQJAQt2YWx1ZU9yRWxzZQIJAJsIAgkBEUBleHRyTmF0aXZlKDEwNjIpAQUBUAkBAWkCCQClCAEFBHRoaXMJANgEAQgFAmFwAmlkBwkA9AMDCAUCYXAJYm9keUJ5dGVzCQCRAwIIBQJhcAZwcm9vZnMAAAgFAmFwD3NlbmRlclB1YmxpY0tleRkarJQ=", "height": 2662676, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: none Next: none Full:
OldNewDifferences
1-# no script
1+{-# STDLIB_VERSION 6 #-}
2+{-# SCRIPT_TYPE ACCOUNT #-}
3+{-# CONTENT_TYPE DAPP #-}
4+let SEP = "__"
5+
6+func join (ar) = makeString(ar, SEP)
7+
8+
9+func keyInitialized () = join(["%s", "initialized"])
10+
11+
12+func keyCoordinatorAddress () = join(["%s", "coordinatorAddress"])
13+
14+
15+func keyVerifierAddress () = join(["%s", "verifierAddress"])
16+
17+
18+func keyMinterAddress () = join(["%s", "minterAddress"])
19+
20+
21+func keyEastAsset () = join(["%s", "eastAsset"])
22+
23+
24+func keySigned (_address,_txId) = join(["%s%s%s", "signed", _address, _txId])
25+
26+
27+func keyProtocolActive () = join(["%s", "protocolActive"])
28+
29+
30+func isInitialized () = valueOrElse(getBoolean(this, keyInitialized()), false)
31+
32+
33+func mustInitialized () = if (!(isInitialized()))
34+ then throw("Not initialized")
35+ else unit
36+
37+
38+func mustNotInitialized () = if (isInitialized())
39+ then throw("Already initialized")
40+ else unit
41+
42+
43+func mustSelf (i) = if ((i.caller != this))
44+ then throw("Only self invocation allowed.")
45+ else unit
46+
47+
48+func coordinator () = addressFromStringValue(valueOrErrorMessage(getString(keyCoordinatorAddress()), "Coordinator is not set"))
49+
50+
51+func verifier () = match getString(keyCoordinatorAddress()) {
52+ case s: String =>
53+ getString(addressFromStringValue(s), keyVerifierAddress())
54+ case _: Unit =>
55+ unit
56+ case _ =>
57+ throw("Match error")
58+}
59+
60+
61+func getAddress (key,err) = addressFromStringValue(valueOrErrorMessage(getString(coordinator(), key), err))
62+
63+
64+func getMinterAddress () = getAddress(keyMinterAddress(), "Minter is not set")
65+
66+
67+func getEastAssetStr () = valueOrErrorMessage(getString(coordinator(), keyEastAsset()), "East asset is not set")
68+
69+
70+func getEastAsset () = fromBase58String(getEastAssetStr())
71+
72+
73+func isActive () = valueOrElse(getBoolean(coordinator(), keyProtocolActive()), false)
74+
75+
76+func mustActive () = if (if (!(isActive()))
77+ then true
78+ else !(isInitialized()))
79+ then throw("Protocol is disabled. Please contact support.")
80+ else unit
81+
82+
83+func mustHaveOnePayment (i) = if ((size(i.payments) != 1))
84+ then throw("Must have one payment.")
85+ else unit
86+
87+
88+func getAssetIdFromString (assetId) = if ((assetId == "WAVES"))
89+ then unit
90+ else fromBase58String(assetId)
91+
92+
93+func isAsset (p,checkingAsset) = {
94+ let assetId = match checkingAsset {
95+ case bv: ByteVector =>
96+ bv
97+ case s: String =>
98+ getAssetIdFromString(s)
99+ case _: Unit =>
100+ unit
101+ case _ =>
102+ throw("Match error")
103+ }
104+ match assetId {
105+ case bv: ByteVector =>
106+ let name = match assetInfo(bv) {
107+ case asset: Asset =>
108+ asset.name
109+ case _: Unit =>
110+ throw(("Can't find asset " + toBase58String(bv)))
111+ case _ =>
112+ throw("Match error")
113+ }
114+ let err = throw(("Attached payment asset is not " + name))
115+ match p.assetId {
116+ case paymentAsset: ByteVector =>
117+ if ((paymentAsset != assetId))
118+ then err
119+ else unit
120+ case _: Unit =>
121+ err
122+ case _ =>
123+ throw("Match error")
124+ }
125+ case _: Unit =>
126+ if ((p.assetId != unit))
127+ then throw("Attached payment asset is not WAVES")
128+ else unit
129+ case _ =>
130+ throw("Match error")
131+ }
132+ }
133+
134+
135+func checkAddress (_address) = match addressFromString(_address) {
136+ case address: Address =>
137+ true
138+ case _: Unit =>
139+ throw("Invalid address")
140+ case _ =>
141+ throw("Match error")
142+}
143+
144+
145+func keyAllowedAddress (_address) = join(["%s%s", "allowedAddress", _address])
146+
147+
148+func keyAllowedAsset (_asset) = join(["%s%s", "allowedAsset", _asset])
149+
150+
151+func isAddressEnabled (_address) = valueOrElse(getBoolean(this, keyAllowedAddress(_address)), false)
152+
153+
154+func isAssetEnabled (_asset) = valueOrElse(getBoolean(this, keyAllowedAsset(_asset)), false)
155+
156+
157+func mustAllowedAddress (i) = {
158+ let callerAddressStr = toBase58String(i.caller.bytes)
159+ let isEnabled = isAddressEnabled(callerAddressStr)
160+ if (isEnabled)
161+ then unit
162+ else throw(((("Unknown caller address. " + toString(i.caller)) + " ") + toBase58String(i.caller.bytes)))
163+ }
164+
165+
166+func mustOnlyAllowedAsset (i) = {
167+ let assetIdStr = toBase58String(value(i.payments[0].assetId))
168+ let paymentsSize = size(i.payments)
169+ let isEnabled = isAssetEnabled(assetIdStr)
170+ let isOnly = (paymentsSize == 1)
171+ if (if (isEnabled)
172+ then isOnly
173+ else false)
174+ then unit
175+ else throw(((("Unknown assetId or payment is not single. " + assetIdStr) + " ") + toString(paymentsSize)))
176+ }
177+
178+
179+func checkAsset (_asset) = {
180+ let asset = assetInfo(fromBase58String(_asset))
181+ match asset {
182+ case info: Asset =>
183+ if ((info.decimals == 6))
184+ then true
185+ else throw("Invalid asset")
186+ case _: Unit =>
187+ throw(("Unknown asset. " + _asset))
188+ case _ =>
189+ throw("Match error")
190+ }
191+ }
192+
193+
194+func checkAddressEnabled (_address) = if (isAddressEnabled(_address))
195+ then unit
196+ else throw("Address already disabled")
197+
198+
199+func checkAddressDisabled (_address) = if (isAddressEnabled(_address))
200+ then throw("Address already enabled")
201+ else unit
202+
203+
204+func checkAssetEnabled (_asset) = if (isAssetEnabled(_asset))
205+ then unit
206+ else throw("Asset already disabled")
207+
208+
209+func checkAssetDisabled (_asset) = if (isAssetEnabled(_asset))
210+ then throw("Asset already enabled")
211+ else unit
212+
213+
214+@Callable(i)
215+func initialize (_coordinatorAddress) = {
216+ let checks = [mustSelf(i), mustNotInitialized(), checkAddress(_coordinatorAddress)]
217+ if ((checks == checks))
218+ then [StringEntry(keyCoordinatorAddress(), _coordinatorAddress), BooleanEntry(keyInitialized(), true)]
219+ else throw("Strict value is not equal to itself.")
220+ }
221+
222+
223+
224+@Callable(i)
225+func issue () = {
226+ let checks = [mustActive(), mustAllowedAddress(i), mustOnlyAllowedAsset(i)]
227+ if ((checks == checks))
228+ then {
229+ let amount = i.payments[0].amount
230+ let minter = getMinterAddress()
231+ let doIssueEast = invoke(minter, "issue", [amount], nil)
232+ if ((doIssueEast == doIssueEast))
233+ then {
234+ let eastAsset = getEastAsset()
235+[ScriptTransfer(i.caller, amount, eastAsset)]
236+ }
237+ else throw("Strict value is not equal to itself.")
238+ }
239+ else throw("Strict value is not equal to itself.")
240+ }
241+
242+
243+
244+@Callable(i)
245+func burnFor (_asset) = {
246+ let eastAsset = getEastAsset()
247+ let payment = i.payments[0]
248+ let checks = [mustActive(), mustAllowedAddress(i), mustHaveOnePayment(i), isAsset(payment, eastAsset), checkAssetEnabled(_asset)]
249+ if ((checks == checks))
250+ then {
251+ let amount = payment.amount
252+[Burn(eastAsset, amount), ScriptTransfer(i.caller, amount, fromBase58String(_asset))]
253+ }
254+ else throw("Strict value is not equal to itself.")
255+ }
256+
257+
258+
259+@Callable(i)
260+func addAddress (_address) = {
261+ let checks = [mustInitialized(), mustSelf(i), checkAddress(_address), checkAddressDisabled(_address)]
262+ if ((checks == checks))
263+ then [BooleanEntry(keyAllowedAddress(_address), true)]
264+ else throw("Strict value is not equal to itself.")
265+ }
266+
267+
268+
269+@Callable(i)
270+func removeAddress (_address) = {
271+ let checks = [mustInitialized(), mustSelf(i), checkAddress(_address), checkAddressEnabled(_address)]
272+ if ((checks == checks))
273+ then [BooleanEntry(keyAllowedAddress(_address), false)]
274+ else throw("Strict value is not equal to itself.")
275+ }
276+
277+
278+
279+@Callable(i)
280+func addAsset (_asset) = {
281+ let checks = [mustInitialized(), mustSelf(i), checkAsset(_asset), checkAssetDisabled(_asset)]
282+ if ((checks == checks))
283+ then [BooleanEntry(keyAllowedAsset(_asset), true)]
284+ else throw("Strict value is not equal to itself.")
285+ }
286+
287+
288+
289+@Callable(i)
290+func removeAsset (_asset) = {
291+ let checks = [mustInitialized(), mustSelf(i), checkAssetEnabled(_asset)]
292+ if ((checks == checks))
293+ then [BooleanEntry(keyAllowedAsset(_asset), false)]
294+ else throw("Strict value is not equal to itself.")
295+ }
296+
297+
298+@Verifier(tx)
299+func verify () = match verifier() {
300+ case address: String =>
301+ valueOrElse(getBoolean(addressFromStringValue(address), keySigned(toString(this), toBase58String(tx.id))), false)
302+ case _ =>
303+ sigVerify(tx.bodyBytes, tx.proofs[0], tx.senderPublicKey)
304+}
305+

github/deemru/w8io/026f985 
19.57 ms