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