tx · BD3QboVqFVkAacTHxVKbEAkTzomxZVMNENrHRKmLxVwm

3Mz29fiz3zgY9JDbiHKANvHsFgQutdfu4Ua:  -0.01400000 Waves

2021.03.23 11:04 [1450127] smart account 3Mz29fiz3zgY9JDbiHKANvHsFgQutdfu4Ua > SELF 0.00000000 Waves

{ "type": 13, "id": "BD3QboVqFVkAacTHxVKbEAkTzomxZVMNENrHRKmLxVwm", "fee": 1400000, "feeAssetId": null, "timestamp": 1616486660192, "version": 2, "chainId": 84, "sender": "3Mz29fiz3zgY9JDbiHKANvHsFgQutdfu4Ua", "senderPublicKey": "CTyHhnVTxf16Z4CmGGneAK8WB5g2QyT4MB8kUn8vPPcu", "proofs": [ "4D8ruisLnkcFTZvq9BpQqJZ4EL2CErzeUX5ebTe9uNsTaGcZ2BADtCAU6uPA9F9yV1GYM1dtZfHiqurMNEvqk8m2" ], "script": "base64:AAIEAAAAAAAAAAQIAhIAAAAAAAAAAAEAAAABaQEAAAAEY2FsbAAAAAAEAAAABWFzc2V0CQAEQwAAAAcCAAAABUFzc2V0AgAAAAAAAAAAAAAAAAEAAAAAAAAAAAAGBQAAAAR1bml0AAAAAAAAAAAABAAAAAdhc3NldElkCQAEOAAAAAEFAAAABWFzc2V0CQAETAAAAAIJAQAAAAtCaW5hcnlFbnRyeQAAAAICAAAAA2JpbgEAAAAACQAETAAAAAIJAQAAAAxCb29sZWFuRW50cnkAAAACAgAAAARib29sBgkABEwAAAACCQEAAAAMSW50ZWdlckVudHJ5AAAAAgIAAAADaW50AAAAAAAAAAABCQAETAAAAAIJAQAAAAtTdHJpbmdFbnRyeQAAAAICAAAAA3N0cgIAAAAACQAETAAAAAIJAQAAAAtEZWxldGVFbnRyeQAAAAECAAAAA3N0cgkABEwAAAACBQAAAAVhc3NldAkABEwAAAACCQEAAAAHUmVpc3N1ZQAAAAMFAAAAB2Fzc2V0SWQAAAAAAAAAAAEHCQAETAAAAAIJAQAAAARCdXJuAAAAAgUAAAAHYXNzZXRJZAAAAAAAAAAAAQkABEwAAAACCQEAAAAOU2NyaXB0VHJhbnNmZXIAAAADCAUAAAABaQAAAAZjYWxsZXIAAAAAAAAAAAEFAAAAB2Fzc2V0SWQFAAAAA25pbAAAAAEAAAACdHgBAAAABnZlcmlmeQAAAAAJAAH0AAAAAwgFAAAAAnR4AAAACWJvZHlCeXRlcwkAAZEAAAACCAUAAAACdHgAAAAGcHJvb2ZzAAAAAAAAAAAACAUAAAACdHgAAAAPc2VuZGVyUHVibGljS2V5KOU8bg==", "height": 1450127, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: 2Ks8bwYNoDGiZtPW3zohi4gGxZLSy5qsQLq29Sk3RnV9 Next: DBizCVAQEPcn9iUentFkj6xoYhdbLsacen5ZwSBhR6m1 Full:
OldNewDifferences
11 {-# STDLIB_VERSION 4 #-}
22 {-# SCRIPT_TYPE ACCOUNT #-}
33 {-# CONTENT_TYPE DAPP #-}
4-let a = 1
54
6-let b = "___"
75
8-let c = "WAVES"
9-
10-let d = "StakeContractNFT"
11-
12-let e = "StakeReceiptNFT"
13-
14-let f = [1, 10, 100, 1000, 10000, 100000, 1000000, 10000000, 100000000]
15-
16-let g = "DAPP_URL"
17-
18-let h = "DAPP_NAME"
19-
20-let i = "LOCKED_QUANTITY_"
21-
22-let j = "TOKEN_TOTAL_ISSUED_SUPPLIES"
23-
24-let k = "TOKEN_TOTAL_BURNED_SUPPLIES"
25-
26-let l = "ASSET_ISSUED_CONTRACTS_"
27-
28-let m = "ASSET_BURNED_CONTRACTS_"
29-
30-let n = "TOTAL_ISSUED_CONTRACTS"
31-
32-let o = "TOTAL_BURNED_CONTRACTS"
33-
34-let p = "NONCE"
35-
36-let q = "STAKING_WHITELIST"
37-
38-let r = base58'7J7kaZgCXKkWFxjths5ZuMGsrkpxoawPBUGaFvzpHe7V'
39-
40-let s = (10 * 100000000)
41-
42-func t (u) = {
43- let v = getString(this, u)
44- if ($isInstanceOf(v, "String"))
45- then {
46- let w = v
47- w
48- }
49- else ""
6+@Callable(a)
7+func call () = {
8+ let b = Issue("Asset", "", 1, 0, true, unit, 0)
9+ let c = calculateAssetId(b)
10+[BinaryEntry("bin", base58''), BooleanEntry("bool", true), IntegerEntry("int", 1), StringEntry("str", ""), DeleteEntry("str"), b, Reissue(c, 1, false), Burn(c, 1), ScriptTransfer(a.caller, 1, c)]
5011 }
5112
5213
53-func x (u) = {
54- let v = getString(this, u)
55- if ($isInstanceOf(v, "String"))
56- then {
57- let w = v
58- w
59- }
60- else throw(("getStringOrError: " + u))
61- }
62-
63-
64-func y (u) = {
65- let v = getInteger(this, u)
66- if ($isInstanceOf(v, "Int"))
67- then {
68- let w = v
69- w
70- }
71- else 0
72- }
73-
74-
75-func z () = {
76- let A = (y(p) + 1)
77-[parseIntValue((toString(A) + toString(height))), A]
78- }
79-
80-
81-@Callable(B)
82-func depositToStake () = if ((this == B.caller))
83- then throw("dApp can't interact with self")
84- else if ((size(B.payments) != 1))
85- then throw("Not a valid amount of payments (require 1)")
86- else if ((1 > B.payments[0].amount))
87- then throw("Can't stake negatif or zero")
88- else {
89- let C = {
90- let v = B.payments[0].assetId
91- if ($isInstanceOf(v, "ByteVector"))
92- then {
93- let D = v
94- toBase58String(D)
95- }
96- else c
97- }
98- if ((contains(x(q), C) != true))
99- then throw("Asset not on staking whitelist")
100- else {
101- let E = z()
102- let F = ((((((((((((x(h) + b) + x(g)) + b) + toString(a)) + b) + toString(height)) + b) + toBase58String(B.caller.bytes)) + b) + C) + b) + toString(B.payments[0].amount))
103- let G = Issue(d, F, 1, 0, false, unit, E[0])
104- let H = calculateAssetId(G)
105- let I = (y((i + C)) + B.payments[0].amount)
106- let J = (y((l + C)) + 1)
107- let K = (y(n) + 1)
108-[IntegerEntry(p, E[1]), IntegerEntry((i + C), I), IntegerEntry((l + C), J), IntegerEntry(n, K), G, ScriptTransfer(B.caller, G.quantity, H)]
109- }
110- }
111-
112-
113-
114-@Callable(B)
115-func withdrawStake () = if ((this == B.caller))
116- then throw("dApp can't interact with self")
117- else if ((size(B.payments) != 1))
118- then throw("Not a valid amount of payments (require 1)")
119- else if ((B.payments[0].amount != 1))
120- then throw("Can't stake negatif or zero")
121- else {
122- let C = {
123- let v = B.payments[0].assetId
124- if ($isInstanceOf(v, "ByteVector"))
125- then {
126- let L = v
127- L
128- }
129- else throw("Not an Asset")
130- }
131- let M = {
132- let v = assetInfo(C)
133- if ($isInstanceOf(v, "Asset"))
134- then {
135- let D = v
136- D
137- }
138- else throw("Couldn't find Asset")
139- }
140- if ((M.issuer != this))
141- then throw("Contract error: dApp isn't issuer")
142- else if ((M.name != d))
143- then throw("Contract error: name")
144- else if (if (if (if ((M.decimals != 0))
145- then true
146- else (M.quantity != 1))
147- then true
148- else (M.reissuable != false))
149- then true
150- else (M.scripted != false))
151- then throw("Contract error: specs")
152- else {
153- let N = split(M.description, b)
154- let O = N[0]
155- let P = N[1]
156- let Q = parseIntValue(N[2])
157- let R = parseIntValue(N[3])
158- let S = N[4]
159- let T = N[5]
160- let U = {
161- let v = assetInfo(fromBase58String(N[5]))
162- if ($isInstanceOf(v, "Asset"))
163- then {
164- let D = v
165- D
166- }
167- else throw("Contract error: asset")
168- }
169- let V = parseIntValue(N[6])
170- if ((size(N) != 7))
171- then throw("Contract error: corrupted")
172- else if ((Q > a))
173- then throw("Contract error: version")
174- else if ((R >= height))
175- then throw("Contract error: starting height")
176- else if (if ((1 > V))
177- then true
178- else (V > U.quantity))
179- then throw("Contract error: quantity")
180- else if ((V > assetBalance(this, U.id)))
181- then throw("Contract error: dApp balance")
182- else {
183- let W = (height - R)
184- let X = (W * s)
185- let Y = getIntegerValue(this, (i + T))
186- let Z = fraction(X, V, Y)
187- let E = z()
188- let aa = {
189- let v = assetInfo(r)
190- if ($isInstanceOf(v, "Asset"))
191- then {
192- let D = v
193- D
194- }
195- else throw("Token not existing bro")
196- }
197- let ab = (((((("dApp '" + O) + " (") + P) + ") '. Contract version ") + toString(Q)) + ". ")
198- let ac = (("Contract signer: " + S) + ". ")
199- let ad = (((((("Asset and quantity locked: " + toString((V / f[U.decimals]))) + " ") + U.name) + " (id: ") + T) + "). ")
200- let ae = (("Lock duration: " + toString(W)) + " blocks. ")
201- let af = (((((("Staked and received " + toString((Z / f[aa.decimals]))) + " ") + aa.name) + " (id: ") + toBase58String(r)) + ").")
202- let ag = ((((ab + ac) + ad) + ae) + af)
203- let ah = Issue(e, ag, 1, 0, false, unit, E[0])
204- let ai = calculateAssetId(ah)
205- let I = (getIntegerValue(this, (i + T)) - V)
206- let aj = (y(j) + Z)
207- let ak = (y((m + T)) + 1)
208- let al = (y(o) + 1)
209- if ((0 > I))
210- then throw("Contract error: invalid quantity")
211- else [Burn(C, 1), IntegerEntry((i + T), I), IntegerEntry(j, aj), IntegerEntry((m + T), ak), IntegerEntry(o, al), ah, ScriptTransfer(B.caller, ah.quantity, ai), ScriptTransfer(B.caller, V, U.id), Reissue(r, Z, true), ScriptTransfer(B.caller, Z, r)]
212- }
213- }
214- }
215-
216-
217-@Verifier(am)
218-func an () = sigVerify(am.bodyBytes, am.proofs[0], am.senderPublicKey)
14+@Verifier(d)
15+func e () = sigVerify(d.bodyBytes, d.proofs[0], d.senderPublicKey)
21916

github/deemru/w8io/169f3d6 
44.97 ms