tx · 89eJNseCvbRvACYZEpvNitiigR8rVEL3gk2cDJZr29pY 3Mr5qPbeVKxVRjGMAumaEkSK7dMo3FbtFYE: -0.01000000 Waves 2021.06.07 21:05 [1560276] smart account 3Mr5qPbeVKxVRjGMAumaEkSK7dMo3FbtFYE > SELF 0.00000000 Waves
{ "type": 13, "id": "89eJNseCvbRvACYZEpvNitiigR8rVEL3gk2cDJZr29pY", "fee": 1000000, "feeAssetId": null, "timestamp": 1623089220829, "version": 2, "chainId": 84, "sender": "3Mr5qPbeVKxVRjGMAumaEkSK7dMo3FbtFYE", "senderPublicKey": "EsW1U1EWPD2yLGRwTq3i9ftXRvWVpLbNz9R8U9xAF4e8", "proofs": [ "61T3M79fUtQURYREgH9m57RPivFGYEL4sSRHcBL6s6d9EHS1MXToDTQVPz3iYjVYBpbCYW82YSFGkVSTfzr4eABp" ], "script": "base64:AAIEAAAAAAAAACwIAhIDCgEIEgMKAQESAwoBARIECgIIARIHCgUICAEBCBIECgIIARIECgIIAQAAAA8BAAAADmdldE51bWJlckJ5S2V5AAAAAQAAAANrZXkEAAAABm51bWJlcgQAAAAHJG1hdGNoMAkABBoAAAACBQAAAAR0aGlzBQAAAANrZXkDCQAAAQAAAAIFAAAAByRtYXRjaDACAAAAA0ludAQAAAABYQUAAAAHJG1hdGNoMAUAAAABYQAAAAAAAAAAAAUAAAAGbnVtYmVyAAAAAAROT05FAgAAAARub25lAQAAAA5nZXRTdHJpbmdCeUtleQAAAAEAAAADa2V5BAAAAAZzdHJpbmcEAAAAByRtYXRjaDAJAAQdAAAAAgUAAAAEdGhpcwUAAAADa2V5AwkAAAEAAAACBQAAAAckbWF0Y2gwAgAAAAZTdHJpbmcEAAAAAWEFAAAAByRtYXRjaDAFAAAAAWEFAAAABE5PTkUFAAAABnN0cmluZwEAAAAPYWRkcmVzc1RvU3RyaW5nAAAAAQAAAAdhZGRyZXNzCQACWAAAAAEIBQAAAAdhZGRyZXNzAAAABWJ5dGVzAQAAAA9zdHJpbmdU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spentComplexity": 0 } View: original | compacted Prev: none Next: 8ubdGLD6vFVDPUQL7ZmfcMiexTLeuEALfM6agDECVKDE Full:
Old | New | Differences | |
---|---|---|---|
1 | - | # no script | |
1 | + | {-# STDLIB_VERSION 4 #-} | |
2 | + | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | + | {-# CONTENT_TYPE DAPP #-} | |
4 | + | func a (b) = { | |
5 | + | let c = { | |
6 | + | let d = getInteger(this, b) | |
7 | + | if ($isInstanceOf(d, "Int")) | |
8 | + | then { | |
9 | + | let e = d | |
10 | + | e | |
11 | + | } | |
12 | + | else 0 | |
13 | + | } | |
14 | + | c | |
15 | + | } | |
16 | + | ||
17 | + | ||
18 | + | let f = "none" | |
19 | + | ||
20 | + | func g (b) = { | |
21 | + | let h = { | |
22 | + | let d = getString(this, b) | |
23 | + | if ($isInstanceOf(d, "String")) | |
24 | + | then { | |
25 | + | let e = d | |
26 | + | e | |
27 | + | } | |
28 | + | else f | |
29 | + | } | |
30 | + | h | |
31 | + | } | |
32 | + | ||
33 | + | ||
34 | + | func i (j) = toBase58String(j.bytes) | |
35 | + | ||
36 | + | ||
37 | + | func k (h) = Address(fromBase58String(h)) | |
38 | + | ||
39 | + | ||
40 | + | func l (m) = toBase58String(m) | |
41 | + | ||
42 | + | ||
43 | + | func n (h) = fromBase58String(h) | |
44 | + | ||
45 | + | ||
46 | + | func o (p) = (("user_" + p) + "_email") | |
47 | + | ||
48 | + | ||
49 | + | func q (p) = g(o(p)) | |
50 | + | ||
51 | + | ||
52 | + | func r (s) = (("dApp_" + i(s)) + "_tokenId") | |
53 | + | ||
54 | + | ||
55 | + | func t (s) = g(r(s)) | |
56 | + | ||
57 | + | ||
58 | + | func u (v) = (("asset_" + v) + "_price") | |
59 | + | ||
60 | + | ||
61 | + | func w (v) = a(u(v)) | |
62 | + | ||
63 | + | ||
64 | + | func x (v) = (("asset_" + v) + "_data") | |
65 | + | ||
66 | + | ||
67 | + | func y (v) = g(u(v)) | |
68 | + | ||
69 | + | ||
70 | + | @Callable(z) | |
71 | + | func signUp (A) = { | |
72 | + | let B = i(z.caller) | |
73 | + | let p = q(B) | |
74 | + | if ((p != f)) | |
75 | + | then throw((("User " + p) + " is already registered")) | |
76 | + | else [StringEntry(o(B), A)] | |
77 | + | } | |
78 | + | ||
79 | + | ||
80 | + | ||
81 | + | @Callable(z) | |
82 | + | func issueNyanToken (C) = { | |
83 | + | let D = t(this) | |
84 | + | if ((D != f)) | |
85 | + | then throw("NYAN Token is already issued") | |
86 | + | else { | |
87 | + | let E = Issue("NYAN Token", "NYAN Token is a cryptocurrency token that operates on the Waves platform", C, 0, true) | |
88 | + | let F = calculateAssetId(E) | |
89 | + | [E, StringEntry(r(this), l(F))] | |
90 | + | } | |
91 | + | } | |
92 | + | ||
93 | + | ||
94 | + | ||
95 | + | @Callable(z) | |
96 | + | func reissueNyanToken (C) = { | |
97 | + | let D = t(this) | |
98 | + | if ((D == f)) | |
99 | + | then throw("NYAN Token was not issued") | |
100 | + | else [Reissue(n(D), C, true)] | |
101 | + | } | |
102 | + | ||
103 | + | ||
104 | + | ||
105 | + | @Callable(z) | |
106 | + | func transferNyanToken (G,H) = { | |
107 | + | let p = q(G) | |
108 | + | let F = n(t(this)) | |
109 | + | let I = assetBalance(this, F) | |
110 | + | let J = (I - H) | |
111 | + | if ((p == f)) | |
112 | + | then throw("You cannot transfer NYAN Tokens to an unregistered user") | |
113 | + | else if ((0 > H)) | |
114 | + | then throw("You cannot transfer a negative amount") | |
115 | + | else if ((0 > J)) | |
116 | + | then throw("Not enough NYAN Tokens to transfer") | |
117 | + | else [ScriptTransfer(k(G), H, F)] | |
118 | + | } | |
119 | + | ||
120 | + | ||
121 | + | ||
122 | + | @Callable(z) | |
123 | + | func issueAssetToken (K,L,C,M,N) = { | |
124 | + | let O = Issue(K, L, C, 0, true) | |
125 | + | let P = calculateAssetId(O) | |
126 | + | let Q = l(P) | |
127 | + | if ((C == 0)) | |
128 | + | then [O, IntegerEntry(u(Q), M), StringEntry(x(Q), N)] | |
129 | + | else { | |
130 | + | let F = n(t(this)) | |
131 | + | let I = assetBalance(this, F) | |
132 | + | let H = (C * M) | |
133 | + | let J = (I - H) | |
134 | + | if ((0 > J)) | |
135 | + | then throw("Not enough NYAN Tokens to issue an asset") | |
136 | + | else [O, Burn(F, H), IntegerEntry(u(Q), M), StringEntry(x(Q), N)] | |
137 | + | } | |
138 | + | } | |
139 | + | ||
140 | + | ||
141 | + | ||
142 | + | @Callable(z) | |
143 | + | func reissueAssetToken (v,C) = { | |
144 | + | let F = n(t(this)) | |
145 | + | let I = assetBalance(this, F) | |
146 | + | let M = w(v) | |
147 | + | let H = (C * M) | |
148 | + | let J = (I - H) | |
149 | + | if ((0 > J)) | |
150 | + | then throw("Not enough NYAN Tokens to reissue an asset") | |
151 | + | else [Reissue(n(v), C, true), Burn(F, H)] | |
152 | + | } | |
153 | + | ||
154 | + | ||
155 | + | ||
156 | + | @Callable(z) | |
157 | + | func exchangeAssetToken (v,H) = { | |
158 | + | let R = z.payments | |
159 | + | if ((size(R) == 0)) | |
160 | + | then throw("You need to attach the payment") | |
161 | + | else { | |
162 | + | let S = R[0].amount | |
163 | + | let T = value(R[0].assetId) | |
164 | + | let U = w(v) | |
165 | + | let V = (H * U) | |
166 | + | let B = z.caller | |
167 | + | let P = n(v) | |
168 | + | if ((V > S)) | |
169 | + | then throw("Not enough NYAN Tokens to exchange an asset") | |
170 | + | else if ((S == V)) | |
171 | + | then [ScriptTransfer(B, H, P), Burn(T, S)] | |
172 | + | else { | |
173 | + | let W = (S - V) | |
174 | + | [ScriptTransfer(B, H, P), ScriptTransfer(B, W, T), Burn(T, V)] | |
175 | + | } | |
176 | + | } | |
177 | + | } | |
178 | + | ||
179 | + | ||
180 | + | @Verifier(X) | |
181 | + | func Y () = sigVerify(X.bodyBytes, X.proofs[0], X.senderPublicKey) | |
182 | + |
github/deemru/w8io/026f985 31.38 ms ◑