tx · Cv8UQGkAR6EJGw2BZSPAcoQFRAuBg8gn3wsSms1ucgoa 3MrQ4g9YCsAN2Wr4QUXiWAPhNPv7DGdQNWb: -0.00500000 Waves 2023.03.17 00:02 [2493092] smart account 3MrQ4g9YCsAN2Wr4QUXiWAPhNPv7DGdQNWb > SELF 0.00000000 Waves
{ "type": 13, "id": "Cv8UQGkAR6EJGw2BZSPAcoQFRAuBg8gn3wsSms1ucgoa", "fee": 500000, "feeAssetId": null, "timestamp": 1679000573909, "version": 2, "chainId": 84, "sender": "3MrQ4g9YCsAN2Wr4QUXiWAPhNPv7DGdQNWb", "senderPublicKey": "2VQGRNRWyFAZvjDtkgZwdZcTwZvBJJ61n8zJfYYxm5eK", "proofs": [ "5XaWY2fZkLii1hGJrQroH6PMxeChacTAUTCzMRTxivZsFASKLRkACKUHhEJnJY3UySDo8ZM9KWKy9fw6ADKTDQLy" ], "script": "base64:BgJNCAISBAoCGBgSBQoDCBgYEgQKAggIEgQKAggIEgQKAggIEgUKAwgICBIDCgECEgMKAQgSBAoCCAgSBQoDCAgIEgQKAggIEgYKBAgBAQEKAA5jb2xsZWN0aW9uTmFtZQkBEUBleHRyTmF0aXZlKDEwNTgpAQIOY29sbGVjdGlvbk5hbWUABnN5bWJvbAkBEUBleHRyTmF0aXZlKDEwNTgpAQIGc3ltYm9sAAtkZXNjcmlwdGlvbgkBEUBleHRyTmF0aXZlKDEwNTgpAQILZGVzY3JpcHRpb24AC3RvdGFsQW1vdW50CQERQGV4dHJOYXRpdmUoMTA1NSkBAgt0b3RhbEFtb3VudAAIZEFwcEpzb24JAQdBZGRyZXNzAQkA2QQBAiMzTXJHYVpWUmhrbkVHZkhKMTl0dFVQTm5EUm9GcWNIaFZONwAMdG9rZW5QYXltZW50CQEHQWRkcmVzcwEJARFAZXh0ck5hdGl2ZSgxMDU3KQECDHRva2VuUGF5bWVudAEMb25seUludGVybmFsAQZjYWxsZXIDCQAAAgUGY2FsbGVyBQR0aGlzBQR1bml0CQACAQI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CAgEwCQDMCAICDXsiY291bnQiOiIwIn0FA25pbAUDbmlsBQNuaWwDCQABAgUBQAIGU3RyaW5nBQFACQACAQkArAICCQADAQUBQAIbIGNvdWxkbid0IGJlIGNhc3QgdG8gU3RyaW5nAwkAAAIFBG1ha2UFBG1ha2UEBmluc2VydAoAAUAJAPwHBAUIZEFwcEpzb24CCWFkZFRvSlNPTgkAzAgCCAUGZGVsZXRlAl8yCQDMCAIJAMwIAgUGbGVuZElkCQDMCAICBWNvdW50BQNuaWwJAMwIAgkAzAgCBQRtYWtlCQDMCAIFCG5ld0NvdW50BQNuaWwFA25pbAUDbmlsAwkAAQIFAUACBlN0cmluZwUBQAkAAgEJAKwCAgkAAwEFAUACGyBjb3VsZG4ndCBiZSBjYXN0IHRvIFN0cmluZwMJAAACBQZpbnNlcnQFBmluc2VydAkAzAgCCQELU3RyaW5nRW50cnkCAgVMZW5kcwUGaW5zZXJ0BQNuaWwJAAIBAiRTdHJpY3QgdmFsdWUgaXMgbm90IGVxdWFsIHRvIGl0c2VsZi4JAAIBAiRTdHJpY3QgdmFsdWUgaXMgbm90IGVxdWFsIHRvIGl0c2VsZi4AXS2MVQ==", "height": 2493092, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: 3VCc5uQcFeUdbY4tMRZ7NRrHn1wCWnzdxsaauttFtm6h Next: H6xsmEMEUKYySiyU7bi7nFB7bgGfwuXTMJUaPB7QbQtd Diff:
Old | New | Differences | |
---|---|---|---|
118 | 118 | let C = if ((16 >= size(B))) | |
119 | 119 | then B | |
120 | 120 | else toString(A) | |
121 | - | let D = Issue(C, (("{uri:\"" + z) + "\"}"), 1, 0, false, unit, height) | |
121 | + | let r = { | |
122 | + | let x = invoke(e, "makeJSON", [["tokenURI"], [z]], nil) | |
123 | + | if ($isInstanceOf(x, "String")) | |
124 | + | then x | |
125 | + | else throw(($getType(x) + " couldn't be cast to String")) | |
126 | + | } | |
127 | + | let D = Issue(C, r, 1, 0, false, unit, height) | |
122 | 128 | let k = calculateAssetId(D) | |
123 | 129 | let E = Address(fromBase58String(j)) | |
124 | 130 | let F = i(E, k) | |
132 | 138 | @Callable(n) | |
133 | 139 | func initLend (k,G,H,I) = valueOrElse(m(n.caller, k), { | |
134 | 140 | let D = l(k) | |
135 | - | let J = D.description | |
136 | - | let K = getStringValue("Lends") | |
137 | - | let L = invoke(e, "deleteByJSONKey", [K, "count"], nil) | |
138 | - | let M = ( let x = L | |
139 | - | if ($isInstanceOf(x, "(String, String)")) | |
140 | - | then x | |
141 | - | else throw(($getType(x) + " couldn't be cast to (String, String)")))._1 | |
142 | - | let N = toString((parseIntValue(M) + 1)) | |
143 | - | let O = invoke(e, "makeJSON", [["supportedInterface", "assetdId", "tokenUri", "owner", "timeUnitSeconds", "timeUnitPrice", "timeUnitCount", "startTimestamp", "endTimestamp", "deposit", "claimed", "rents"], ["0", k, J, toString(n.caller), toString(G), toString(H), toString(I), toString(lastBlock.timestamp), toString((lastBlock.timestamp + (G * I))), "0", "0", "{\"count\":\"0\"}"]], nil) | |
144 | - | if ((O == O)) | |
141 | + | let z = { | |
142 | + | let x = invoke(e, "readByJSONKey", [D.description, "tokenURI"], nil) | |
143 | + | if ($isInstanceOf(x, "String")) | |
144 | + | then x | |
145 | + | else throw(($getType(x) + " couldn't be cast to String")) | |
146 | + | } | |
147 | + | let J = getStringValue("Lends") | |
148 | + | let K = { | |
149 | + | let x = invoke(e, "deleteByJSONKey", [J, "count"], nil) | |
150 | + | if ($isInstanceOf(x, "(String, String)")) | |
151 | + | then x | |
152 | + | else throw(($getType(x) + " couldn't be cast to (String, String)")) | |
153 | + | } | |
154 | + | let L = K._1 | |
155 | + | let M = toString((parseIntValue(L) + 1)) | |
156 | + | let N = { | |
157 | + | 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", "{\"count\":\"0\"}"]], nil) | |
158 | + | if ($isInstanceOf(x, "String")) | |
159 | + | then x | |
160 | + | else throw(($getType(x) + " couldn't be cast to String")) | |
161 | + | } | |
162 | + | if ((N == N)) | |
145 | 163 | then { | |
146 | - | let P = invoke(e, "addToJSON", [( let x = L | |
147 | - | if ($isInstanceOf(x, "(String, String)")) | |
148 | - | then x | |
149 | - | else throw(($getType(x) + " couldn't be cast to (String, String)")))._2, [M, "count"], [{ | |
150 | - | let x = O | |
164 | + | let O = { | |
165 | + | let x = invoke(e, "addToJSON", [K._2, [L, "count"], [N, M]], nil) | |
151 | 166 | if ($isInstanceOf(x, "String")) | |
152 | 167 | then x | |
153 | 168 | else throw(($getType(x) + " couldn't be cast to String")) | |
154 | - | }, N]], nil) | |
155 | - | if ((P == P)) | |
156 | - | then [StringEntry("Lends", { | |
157 | - | let x = P | |
158 | - | if ($isInstanceOf(x, "String")) | |
159 | - | then x | |
160 | - | else throw(($getType(x) + " couldn't be cast to String")) | |
161 | - | })] | |
169 | + | } | |
170 | + | if ((O == O)) | |
171 | + | then [StringEntry("Lends", O)] | |
162 | 172 | else throw("Strict value is not equal to itself.") | |
163 | 173 | } | |
164 | 174 | 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) = valueOrElse(g(n.caller), { | |
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 | - | let D = Issue(C, (("{uri:\"" + z) + "\"}"), 1, 0, false, unit, height) | |
121 | + | let r = { | |
122 | + | let x = invoke(e, "makeJSON", [["tokenURI"], [z]], nil) | |
123 | + | if ($isInstanceOf(x, "String")) | |
124 | + | then x | |
125 | + | else throw(($getType(x) + " couldn't be cast to String")) | |
126 | + | } | |
127 | + | let D = Issue(C, r, 1, 0, false, unit, height) | |
122 | 128 | let k = calculateAssetId(D) | |
123 | 129 | let E = Address(fromBase58String(j)) | |
124 | 130 | let F = i(E, k) | |
125 | 131 | if ((F == F)) | |
126 | 132 | then [D, F, IntegerEntry("totalAmount", A), StringEntry(C, z)] | |
127 | 133 | else throw("Strict value is not equal to itself.") | |
128 | 134 | }) | |
129 | 135 | ||
130 | 136 | ||
131 | 137 | ||
132 | 138 | @Callable(n) | |
133 | 139 | func initLend (k,G,H,I) = valueOrElse(m(n.caller, k), { | |
134 | 140 | let D = l(k) | |
135 | - | let J = D.description | |
136 | - | let K = getStringValue("Lends") | |
137 | - | let L = invoke(e, "deleteByJSONKey", [K, "count"], nil) | |
138 | - | let M = ( let x = L | |
139 | - | if ($isInstanceOf(x, "(String, String)")) | |
140 | - | then x | |
141 | - | else throw(($getType(x) + " couldn't be cast to (String, String)")))._1 | |
142 | - | let N = toString((parseIntValue(M) + 1)) | |
143 | - | let O = invoke(e, "makeJSON", [["supportedInterface", "assetdId", "tokenUri", "owner", "timeUnitSeconds", "timeUnitPrice", "timeUnitCount", "startTimestamp", "endTimestamp", "deposit", "claimed", "rents"], ["0", k, J, toString(n.caller), toString(G), toString(H), toString(I), toString(lastBlock.timestamp), toString((lastBlock.timestamp + (G * I))), "0", "0", "{\"count\":\"0\"}"]], nil) | |
144 | - | if ((O == O)) | |
141 | + | let z = { | |
142 | + | let x = invoke(e, "readByJSONKey", [D.description, "tokenURI"], nil) | |
143 | + | if ($isInstanceOf(x, "String")) | |
144 | + | then x | |
145 | + | else throw(($getType(x) + " couldn't be cast to String")) | |
146 | + | } | |
147 | + | let J = getStringValue("Lends") | |
148 | + | let K = { | |
149 | + | let x = invoke(e, "deleteByJSONKey", [J, "count"], nil) | |
150 | + | if ($isInstanceOf(x, "(String, String)")) | |
151 | + | then x | |
152 | + | else throw(($getType(x) + " couldn't be cast to (String, String)")) | |
153 | + | } | |
154 | + | let L = K._1 | |
155 | + | let M = toString((parseIntValue(L) + 1)) | |
156 | + | let N = { | |
157 | + | 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", "{\"count\":\"0\"}"]], nil) | |
158 | + | if ($isInstanceOf(x, "String")) | |
159 | + | then x | |
160 | + | else throw(($getType(x) + " couldn't be cast to String")) | |
161 | + | } | |
162 | + | if ((N == N)) | |
145 | 163 | then { | |
146 | - | let P = invoke(e, "addToJSON", [( let x = L | |
147 | - | if ($isInstanceOf(x, "(String, String)")) | |
148 | - | then x | |
149 | - | else throw(($getType(x) + " couldn't be cast to (String, String)")))._2, [M, "count"], [{ | |
150 | - | let x = O | |
164 | + | let O = { | |
165 | + | let x = invoke(e, "addToJSON", [K._2, [L, "count"], [N, M]], nil) | |
151 | 166 | if ($isInstanceOf(x, "String")) | |
152 | 167 | then x | |
153 | 168 | else throw(($getType(x) + " couldn't be cast to String")) | |
154 | - | }, N]], nil) | |
155 | - | if ((P == P)) | |
156 | - | then [StringEntry("Lends", { | |
157 | - | let x = P | |
158 | - | if ($isInstanceOf(x, "String")) | |
159 | - | then x | |
160 | - | else throw(($getType(x) + " couldn't be cast to String")) | |
161 | - | })] | |
169 | + | } | |
170 | + | if ((O == O)) | |
171 | + | then [StringEntry("Lends", O)] | |
162 | 172 | else throw("Strict value is not equal to itself.") | |
163 | 173 | } | |
164 | 174 | else throw("Strict value is not equal to itself.") | |
165 | 175 | }) | |
166 | 176 | ||
167 | 177 |
github/deemru/w8io/169f3d6 47.53 ms ◑