tx · 8U52z4b6U2VPdBERpdMWGQt9rmTkBve2RZrEDJK2SLBf

3MrrWZRXFipBPwYy79PVBEVrR7oYW62jf8m:  -0.01000000 Waves

2022.05.11 20:08 [2047284] smart account 3MrrWZRXFipBPwYy79PVBEVrR7oYW62jf8m > SELF 0.00000000 Waves

{ "type": 13, "id": "8U52z4b6U2VPdBERpdMWGQt9rmTkBve2RZrEDJK2SLBf", "fee": 1000000, "feeAssetId": null, "timestamp": 1652288894021, "version": 2, "chainId": 84, "sender": "3MrrWZRXFipBPwYy79PVBEVrR7oYW62jf8m", "senderPublicKey": "AaHNopvbKHuDBasQJKhbMwM4d2XpUNjcJRJtfjEDbXQx", "proofs": [ "4m6LBND2HfMv7GUFYqcsABfGv7NwbRTtEdnSA95sXHFM9v6ere3UoJU3PeF2Gz9V7UiepAUdX91XEq6Xv5ga3xGj" ], "script": "base64:AAIFAAAAAAAAABkIAhIDCgEBEgUKAwgICBIAEgASABIDCgEBAAAAEgAAAAAYbWF4VG9rZW5BbW91bnRGb3JQcmVzYWxlAAAAAAAAmJaAAAAAAAd0b2tlbklkAQAAACC25cEgIXwI679AIVs9PIKhoyN9ZeI8m1tIzfgUgaNPWwAAAAAJY2xhaW1BZGRyAQAAABoBVJbC74rYcvif26LO41st+yuak7E6uU2KbgAAAAADd3ZzAAAAAAAF9eEAAAAAAA50b2tlblVuaXRQcmljZQAAAAAAAAAABQAAAAALZGVub21pbmF0b3IAAAAAAACYloAAAAAAD2RlY2ltYWxzSW5Ub2tlbgAAAAAAAAAAZAEAAAANdHJ5R2V0SW50ZWdlcgAAAAEAAAADa2V5BAAAAAN2YWwEAAAAByRtYXRjaDAJAAQaAAAAAgUAAAAEdGhpcwUAAAADa2V5AwkAAAEAAAACBQAAAAckbWF0Y2gwAgAAAANJbnQEAAAAAWIFAAAAByRtYXRjaDAFAAAAAWIAAAAAAAAAAAAFAAAAA3ZhbAEAAAAMdHJ5R2V0U3RyaW5nAAAAAQAAAANrZXkEAAAAA3Zhb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GcHJvb2ZzAAAAAAAAAAAACAUAAAACdHgAAAAPc2VuZGVyUHVibGljS2V5WDinDA==", "height": 2047284, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: none Next: VAAjUJzmudDhdHHhxxTYksgqHMB6a3nUvk3MPqLBZxo Full:
OldNewDifferences
1-# no script
1+{-# STDLIB_VERSION 5 #-}
2+{-# SCRIPT_TYPE ACCOUNT #-}
3+{-# CONTENT_TYPE DAPP #-}
4+let a = 10000000
5+
6+let b = base58'DJxQ2KqhzD9KyfvCAgbTnGAgDEqCHkkYYz9bZcRmatGa'
7+
8+let c = base58'3N3fEf4mmVyYcbeuHYmZvXuJjoXjH5WRuEV'
9+
10+let d = 100000000
11+
12+let e = 5
13+
14+let f = 10000000
15+
16+let g = 100
17+
18+func h (i) = {
19+ let j = {
20+ let k = getInteger(this, i)
21+ if ($isInstanceOf(k, "Int"))
22+ then {
23+ let l = k
24+ l
25+ }
26+ else 0
27+ }
28+ j
29+ }
30+
31+
32+func m (i) = {
33+ let j = {
34+ let k = getString(this, i)
35+ if ($isInstanceOf(k, "String"))
36+ then {
37+ let l = k
38+ l
39+ }
40+ else ""
41+ }
42+ j
43+ }
44+
45+
46+func n (i) = {
47+ let k = getBoolean(this, i)
48+ if ($isInstanceOf(k, "Boolean"))
49+ then {
50+ let l = k
51+ l
52+ }
53+ else false
54+ }
55+
56+
57+func o (p) = {
58+ let j = h((p + "_tokenPresale"))
59+ j
60+ }
61+
62+
63+func q () = {
64+ let j = {
65+ let k = getInteger(this, "remainingPresaleTokenAmount")
66+ if ($isInstanceOf(k, "Int"))
67+ then {
68+ let l = k
69+ l
70+ }
71+ else a
72+ }
73+ j
74+ }
75+
76+
77+func r () = {
78+ let k = getBoolean(this, "presaleStatus")
79+ if ($isInstanceOf(k, "Boolean"))
80+ then {
81+ let l = k
82+ l
83+ }
84+ else true
85+ }
86+
87+
88+func s () = {
89+ let j = {
90+ let k = getInteger(this, "totalNftCount")
91+ if ($isInstanceOf(k, "Int"))
92+ then {
93+ let l = k
94+ l
95+ }
96+ else 0
97+ }
98+ j
99+ }
100+
101+
102+func t () = {
103+ let j = {
104+ let k = getInteger(this, "remainingNftCount")
105+ if ($isInstanceOf(k, "Int"))
106+ then {
107+ let l = k
108+ l
109+ }
110+ else 0
111+ }
112+ j
113+ }
114+
115+
116+func u () = {
117+ let j = {
118+ let k = getString(this, "remainingNfts")
119+ if ($isInstanceOf(k, "String"))
120+ then {
121+ let l = k
122+ l
123+ }
124+ else ""
125+ }
126+ j
127+ }
128+
129+
130+func v (w) = {
131+ let k = getBoolean(this, (w + "_soldOut"))
132+ if ($isInstanceOf(k, "Boolean"))
133+ then {
134+ let l = k
135+ l
136+ }
137+ else false
138+ }
139+
140+
141+func x (y) = {
142+ let z = ((((y.transactionId + y.callerPublicKey) + lastBlock.generationSignature) + toBytes(lastBlock.timestamp)) + toBytes(lastBlock.height))
143+ sha256(z)
144+ }
145+
146+
147+@Callable(y)
148+func buyTokensFromPresale (A) = {
149+ let B = toBase58String(y.caller.bytes)
150+ let C = value(y.payments[0])
151+ let D = C.amount
152+ if (!(r()))
153+ then throw("Presale Stopped by the Owner")
154+ else if ((A > q()))
155+ then throw("Exceeded Remaining Token Amount Dedicated for Presale")
156+ else if (((fraction(A, e, f) * d) > D))
157+ then throw("Not enough payments in waves")
158+ else [IntegerEntry((B + "_tokenPresale"), (A + o(B))), IntegerEntry("remainingPresaleTokenAmount", (q() - A)), StringEntry((B + "_presaleAddresses"), B), ScriptTransfer(value(addressFromString(B)), (A * g), b)]
159+ }
160+
161+
162+
163+@Callable(y)
164+func mintNftByOwner (E,F,G) = {
165+ let B = toBase58String(y.caller.bytes)
166+ if ((y.caller != this))
167+ then throw("Only Dapp Owner Can Mint")
168+ else {
169+ let H = Issue(E, G, 1, 0, false)
170+ let w = calculateAssetId(H)
171+ let I = toBase58String(w)
172+[H, StringEntry((I + "_metadata"), G), StringEntry((I + "_assetId"), I), StringEntry((I + "_ownerAddr"), B), StringEntry(((I + "_collectionId_") + F), I), IntegerEntry("totalNftCount", (s() + 1)), IntegerEntry("remainingNftCount", (t() + 1)), StringEntry(toString((s() + 1)), I), StringEntry("remainingNfts", ((u() + toString((s() + 1))) + "_")), BooleanEntry((I + "_soldOut"), false)]
173+ }
174+ }
175+
176+
177+
178+@Callable(y)
179+func buyNftsFromPresale () = {
180+ let B = toBase58String(y.caller.bytes)
181+ if (!(r()))
182+ then throw("Presale Stopped by the Owner")
183+ else if ((t() == 0))
184+ then throw("Nfts are not available for buying - all are sold")
185+ else {
186+ let J = split(u(), "_")
187+ let K = t()
188+ let z = toInt(x(y))
189+ let L = (z % K)
190+ let M = J[L]
191+ let N = getStringValue(this, M)
192+ let O = removeByIndex(J, L)
193+ let P = makeString(O, "_")
194+[ScriptTransfer(value(addressFromString(B)), 1, fromBase58String(N)), StringEntry((N + "_ownerAddr"), B), IntegerEntry("remainingNftCount", (t() - 1)), StringEntry("remainingNfts", P), BooleanEntry((N + "_soldOut"), true)]
195+ }
196+ }
197+
198+
199+
200+@Callable(y)
201+func stopPresale () = if ((y.caller.bytes != this.bytes))
202+ then throw("Only Owner Can Stop the Presale")
203+ else [BooleanEntry("presaleStatus", false)]
204+
205+
206+
207+@Callable(y)
208+func reOpenPresale () = if ((y.caller.bytes != this.bytes))
209+ then throw("Only Owner Can Re-Open the Presale")
210+ else [BooleanEntry("presaleStatus", true)]
211+
212+
213+
214+@Callable(y)
215+func claim (D) = if ((y.caller.bytes != this.bytes))
216+ then throw("Only Owner Can Claim")
217+ else [ScriptTransfer(Address(c), (D * d), unit)]
218+
219+
220+@Verifier(Q)
221+func R () = sigVerify(Q.bodyBytes, Q.proofs[0], Q.senderPublicKey)
222+

github/deemru/w8io/169f3d6 
21.84 ms