tx · 6uPa5yEntiaaophNBuq8KACnTVDJkV8mwqYdzj7kzr9T 3MrQ4g9YCsAN2Wr4QUXiWAPhNPv7DGdQNWb: -0.00600000 Waves 2023.03.17 20:16 [2494293] smart account 3MrQ4g9YCsAN2Wr4QUXiWAPhNPv7DGdQNWb > SELF 0.00000000 Waves
{ "type": 13, "id": "6uPa5yEntiaaophNBuq8KACnTVDJkV8mwqYdzj7kzr9T", "fee": 600000, "feeAssetId": null, "timestamp": 1679073415746, "version": 2, "chainId": 84, "sender": "3MrQ4g9YCsAN2Wr4QUXiWAPhNPv7DGdQNWb", "senderPublicKey": "2VQGRNRWyFAZvjDtkgZwdZcTwZvBJJ61n8zJfYYxm5eK", "proofs": [ "2nJS6XHisu2HRUGkSdJpLnXpaPozhHMwtxwLB1WhzYgf76YgHm3sfAAZY5NcCikFJ3VcUqaoUEAFUFTEo5PC19Br" ], "script": "base64:BgJTCAISBAoCGBgSBQoDCBgYEgQKAggIEgQKAggIEgQKAggIEgUKAwgICBIDCgECEgMKAQgSBAoCCAgSBQoDCAgIEgQKAggIEgYKBAgBAQESBAoCAQEKAA5jb2xsZWN0aW9uTmFtZQkBEUBleHRyTmF0aXZlKDEwNTgpAQIOY29sbGVjdGlvbk5hbWUABnN5bWJvbAkBEUBleHRyTmF0aXZlKDEwNTgpAQIGc3ltYm9sAAtkZXNjcmlwdGlvbgkBEUBleHRyTmF0aXZlKDEwNTgpAQILZGVzY3JpcHRpb24AC3RvdGFsQW1vdW50CQERQGV4dHJOYXRpdmUoMTA1NSkBAgt0b3RhbEFtb3VudAAIZEFwcEpzb24JAQdBZGRyZXNzAQkA2QQBAiMzTXJHYVpWUmhrbkVHZkhKMTl0dFVQTm5EUm9GcWNIaFZONwAMdG9rZW5QYXltZW50CQEHQWRkcmVzcwEJARFAZXh0ck5hdGl2ZSgxMDU3KQECDHRva2VuUGF5bWVudAEMb25seUludGVybmFsAQZjYWxsZXIDCQAAAgUGY2FsbGVyBQR0aGlzBQR1bml0CQAC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bid0IGJlIGNhc3QgdG8gKFN0cmluZywgU3RyaW5nKQMJAAACBQ9kZWxldGVMZW5kQ291bnQFD2RlbGV0ZUxlbmRDb3VudAQKZGVsZXRlTGVuZAoAAUAJAPwHBAUIZEFwcEpzb24CD2RlbGV0ZUJ5SlNPTktleQkAzAgCCAUPZGVsZXRlTGVuZENvdW50Al8yCQDMCAIFDGxlbmRJZFN0cmluZwUDbmlsBQNuaWwDCQABAgUBQAIQKFN0cmluZywgU3RyaW5nKQUBQAkAAgEJAKwCAgkAAwEFAUACJSBjb3VsZG4ndCBiZSBjYXN0IHRvIChTdHJpbmcsIFN0cmluZykDCQAAAgUKZGVsZXRlTGVuZAUKZGVsZXRlTGVuZAkAzAgCCQELU3RyaW5nRW50cnkCAgVEZWJ1ZwgFCmRlbGV0ZUxlbmQCXzEFA25pbAkAAgECJFN0cmljdCB2YWx1ZSBpcyBub3QgZXF1YWwgdG8gaXRzZWxmLgkAAgECJFN0cmljdCB2YWx1ZSBpcyBub3QgZXF1YWwgdG8gaXRzZWxmLgAZ7qul", "height": 2494293, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: DEt3DHRnHmnntKVSFm6VG69gSPvzDgXAePB8hT6AXAsF Next: 5ePwyLUvGRHR4bwQoovrdAtJdy13eAJeerPTexFMZ6YL Diff:
Old | New | Differences | |
---|---|---|---|
203 | 203 | else throw(($getType(x) + " couldn't be cast to (String, String)")) | |
204 | 204 | } | |
205 | 205 | if ((R == R)) | |
206 | - | then | |
206 | + | then [StringEntry("Debug", R._1)] | |
207 | 207 | else throw("Strict value is not equal to itself.") | |
208 | 208 | } | |
209 | 209 | else throw("Strict value is not equal to itself.") |
Old | New | Differences | |
---|---|---|---|
1 | 1 | {-# STDLIB_VERSION 6 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | 4 | let a = getStringValue("collectionName") | |
5 | 5 | ||
6 | 6 | let b = getStringValue("symbol") | |
7 | 7 | ||
8 | 8 | let c = getStringValue("description") | |
9 | 9 | ||
10 | 10 | let d = getIntegerValue("totalAmount") | |
11 | 11 | ||
12 | 12 | let e = Address(fromBase58String("3MrGaZVRhknEGfHJ19ttUPNnDRoFqcHhVN7")) | |
13 | 13 | ||
14 | 14 | let f = Address(getBinaryValue("tokenPayment")) | |
15 | 15 | ||
16 | 16 | func g (h) = if ((h == this)) | |
17 | 17 | then unit | |
18 | 18 | else throw("Only internal call") | |
19 | 19 | ||
20 | 20 | ||
21 | 21 | func i (j,k) = if ((j == this)) | |
22 | 22 | then StringEntry("костыль", "костыль") | |
23 | 23 | else ScriptTransfer(j, 1, k) | |
24 | 24 | ||
25 | 25 | ||
26 | 26 | func l (k) = valueOrErrorMessage(assetInfo(fromBase58String(k)), "Can't find asset by asset id") | |
27 | 27 | ||
28 | 28 | ||
29 | 29 | func m (h,k) = if ((assetBalance(h, fromBase58String(k)) == 1)) | |
30 | 30 | then unit | |
31 | 31 | else throw("Only asset owner") | |
32 | 32 | ||
33 | 33 | ||
34 | 34 | @Callable(n) | |
35 | 35 | func makeJSONInternal (o,p) = valueOrElse(g(n.caller), { | |
36 | 36 | let q = invoke(e, "makeJSON", [o, p], nil) | |
37 | 37 | if ((q == q)) | |
38 | 38 | then $Tuple2(nil, q) | |
39 | 39 | else throw("Strict value is not equal to itself.") | |
40 | 40 | }) | |
41 | 41 | ||
42 | 42 | ||
43 | 43 | ||
44 | 44 | @Callable(n) | |
45 | 45 | func addToJSONInternal (r,o,p) = valueOrElse(g(n.caller), { | |
46 | 46 | let q = invoke(e, "addToJSON", [r, o, p], nil) | |
47 | 47 | if ((q == q)) | |
48 | 48 | then $Tuple2(nil, q) | |
49 | 49 | else throw("Strict value is not equal to itself.") | |
50 | 50 | }) | |
51 | 51 | ||
52 | 52 | ||
53 | 53 | ||
54 | 54 | @Callable(n) | |
55 | 55 | func readByJSONKeyInternal (r,s) = valueOrElse(g(n.caller), { | |
56 | 56 | let q = invoke(e, "readByJSONKey", [r, s], nil) | |
57 | 57 | if ((q == q)) | |
58 | 58 | then $Tuple2(nil, q) | |
59 | 59 | else throw("Strict value is not equal to itself.") | |
60 | 60 | }) | |
61 | 61 | ||
62 | 62 | ||
63 | 63 | ||
64 | 64 | @Callable(n) | |
65 | 65 | func deleteByJSONKeyInternal (r,s) = valueOrElse(g(n.caller), { | |
66 | 66 | let q = invoke(e, "deleteByJSONKey", [r, s], nil) | |
67 | 67 | if ((q == q)) | |
68 | 68 | then $Tuple2(nil, q) | |
69 | 69 | else throw("Strict value is not equal to itself.") | |
70 | 70 | }) | |
71 | 71 | ||
72 | 72 | ||
73 | 73 | ||
74 | 74 | @Callable(n) | |
75 | 75 | func storageJsonInternal (t,u) = valueOrElse(g(n.caller), [StringEntry(t, u)]) | |
76 | 76 | ||
77 | 77 | ||
78 | 78 | ||
79 | 79 | @Callable(n) | |
80 | 80 | func setUser (k,v,w) = { | |
81 | 81 | let q = invoke(e, "makeJSON", [["user", "expires"], [v, w]], nil) | |
82 | 82 | if ((q == q)) | |
83 | 83 | then $Tuple2([StringEntry(("userOf-" + k), { | |
84 | 84 | let x = q | |
85 | 85 | if ($isInstanceOf(x, "String")) | |
86 | 86 | then x | |
87 | 87 | else throw(($getType(x) + " couldn't be cast to String")) | |
88 | 88 | })], q) | |
89 | 89 | else throw("Strict value is not equal to itself.") | |
90 | 90 | } | |
91 | 91 | ||
92 | 92 | ||
93 | 93 | ||
94 | 94 | @Callable(n) | |
95 | 95 | func setTokenPayment (k) = valueOrElse(g(n.caller), [BinaryEntry("tokenPayment", k)]) | |
96 | 96 | ||
97 | 97 | ||
98 | 98 | ||
99 | 99 | @Callable(n) | |
100 | 100 | func deleteValueByKey (s) = valueOrElse(g(n.caller), [DeleteEntry(s)]) | |
101 | 101 | ||
102 | 102 | ||
103 | 103 | ||
104 | 104 | @Callable(n) | |
105 | 105 | func setString (s,y) = valueOrElse(g(n.caller), [StringEntry(s, y)]) | |
106 | 106 | ||
107 | 107 | ||
108 | 108 | ||
109 | 109 | @Callable(n) | |
110 | 110 | func init (a,b,c) = valueOrElse(g(n.caller), [StringEntry("collectionName", a), StringEntry("symbol", b), StringEntry("description", c), IntegerEntry("totalAmount", 0)]) | |
111 | 111 | ||
112 | 112 | ||
113 | 113 | ||
114 | 114 | @Callable(n) | |
115 | 115 | func mint (j,z) = { | |
116 | 116 | let A = (d + 1) | |
117 | 117 | let B = ((b + "#") + toString(A)) | |
118 | 118 | let C = if ((16 >= size(B))) | |
119 | 119 | then B | |
120 | 120 | else toString(A) | |
121 | 121 | let r = { | |
122 | 122 | let x = invoke(e, "makeJSON", [["tokenURI"], [z]], nil) | |
123 | 123 | if ($isInstanceOf(x, "String")) | |
124 | 124 | then x | |
125 | 125 | else throw(($getType(x) + " couldn't be cast to String")) | |
126 | 126 | } | |
127 | 127 | let D = Issue(C, r, 1, 0, false, unit, height) | |
128 | 128 | let k = calculateAssetId(D) | |
129 | 129 | let E = Address(fromBase58String(j)) | |
130 | 130 | let F = i(E, k) | |
131 | 131 | if ((F == F)) | |
132 | 132 | then [D, F, IntegerEntry("totalAmount", A), StringEntry(C, z)] | |
133 | 133 | else throw("Strict value is not equal to itself.") | |
134 | 134 | } | |
135 | 135 | ||
136 | 136 | ||
137 | 137 | ||
138 | 138 | @Callable(n) | |
139 | 139 | func initLend (k,G,H,I) = valueOrElse(m(n.caller, k), { | |
140 | 140 | let D = l(k) | |
141 | 141 | let z = { | |
142 | 142 | let x = invoke(e, "readByJSONKey", [D.description, "tokenURI"], nil) | |
143 | 143 | if ($isInstanceOf(x, "String")) | |
144 | 144 | then x | |
145 | 145 | else throw(($getType(x) + " couldn't be cast to String")) | |
146 | 146 | } | |
147 | 147 | if ((z == z)) | |
148 | 148 | then { | |
149 | 149 | let J = getStringValue("Lends") | |
150 | 150 | let K = { | |
151 | 151 | let x = invoke(e, "deleteByJSONKey", [J, "lendCount"], nil) | |
152 | 152 | if ($isInstanceOf(x, "(String, String)")) | |
153 | 153 | then x | |
154 | 154 | else throw(($getType(x) + " couldn't be cast to (String, String)")) | |
155 | 155 | } | |
156 | 156 | if ((K == K)) | |
157 | 157 | then { | |
158 | 158 | let L = K._1 | |
159 | 159 | let M = toString((parseIntValue(L) + 1)) | |
160 | 160 | let N = { | |
161 | 161 | let x = invoke(e, "makeJSON", [["supportedInterface", "assetdId", "tokenURI", "owner", "timeUnitSeconds", "timeUnitPrice", "timeUnitCount", "startTimestamp", "endTimestamp", "deposit", "claimed", "rents"], ["0", k, z, toString(n.caller), toString(G), toString(H), toString(I), toString(lastBlock.timestamp), toString((lastBlock.timestamp + (G * I))), "0", "0", "{\"rentCount\":\"0\"}"]], nil) | |
162 | 162 | if ($isInstanceOf(x, "String")) | |
163 | 163 | then x | |
164 | 164 | else throw(($getType(x) + " couldn't be cast to String")) | |
165 | 165 | } | |
166 | 166 | if ((N == N)) | |
167 | 167 | then { | |
168 | 168 | let O = { | |
169 | 169 | let x = invoke(e, "addToJSON", [K._2, [L, "lendCount"], [N, M]], nil) | |
170 | 170 | if ($isInstanceOf(x, "String")) | |
171 | 171 | then x | |
172 | 172 | else throw(($getType(x) + " couldn't be cast to String")) | |
173 | 173 | } | |
174 | 174 | if ((O == O)) | |
175 | 175 | then [StringEntry("Lends", O)] | |
176 | 176 | else throw("Strict value is not equal to itself.") | |
177 | 177 | } | |
178 | 178 | else throw("Strict value is not equal to itself.") | |
179 | 179 | } | |
180 | 180 | else throw("Strict value is not equal to itself.") | |
181 | 181 | } | |
182 | 182 | else throw("Strict value is not equal to itself.") | |
183 | 183 | }) | |
184 | 184 | ||
185 | 185 | ||
186 | 186 | ||
187 | 187 | @Callable(n) | |
188 | 188 | func initRent (L,I) = { | |
189 | 189 | let P = toString(L) | |
190 | 190 | let J = getStringValue("Lends") | |
191 | 191 | let Q = { | |
192 | 192 | let x = invoke(e, "deleteByJSONKey", [J, "lendCount"], nil) | |
193 | 193 | if ($isInstanceOf(x, "(String, String)")) | |
194 | 194 | then x | |
195 | 195 | else throw(($getType(x) + " couldn't be cast to (String, String)")) | |
196 | 196 | } | |
197 | 197 | if ((Q == Q)) | |
198 | 198 | then { | |
199 | 199 | let R = { | |
200 | 200 | let x = invoke(e, "deleteByJSONKey", [Q._2, P], nil) | |
201 | 201 | if ($isInstanceOf(x, "(String, String)")) | |
202 | 202 | then x | |
203 | 203 | else throw(($getType(x) + " couldn't be cast to (String, String)")) | |
204 | 204 | } | |
205 | 205 | if ((R == R)) | |
206 | - | then | |
206 | + | then [StringEntry("Debug", R._1)] | |
207 | 207 | else throw("Strict value is not equal to itself.") | |
208 | 208 | } | |
209 | 209 | else throw("Strict value is not equal to itself.") | |
210 | 210 | } | |
211 | 211 | ||
212 | 212 |
github/deemru/w8io/026f985 43.91 ms ◑