tx · Es3A8zivcJhgDjiVdfvY82kTjvMSctdFBJPirMcb6wja 3MrQ4g9YCsAN2Wr4QUXiWAPhNPv7DGdQNWb: -0.00300000 Waves 2023.03.15 21:46 [2491515] smart account 3MrQ4g9YCsAN2Wr4QUXiWAPhNPv7DGdQNWb > SELF 0.00000000 Waves
{ "type": 13, "id": "Es3A8zivcJhgDjiVdfvY82kTjvMSctdFBJPirMcb6wja", "fee": 300000, "feeAssetId": null, "timestamp": 1678906039670, "version": 2, "chainId": 84, "sender": "3MrQ4g9YCsAN2Wr4QUXiWAPhNPv7DGdQNWb", "senderPublicKey": "2VQGRNRWyFAZvjDtkgZwdZcTwZvBJJ61n8zJfYYxm5eK", "proofs": [ "WWvWFX8vp9vLRrCoYXXCPYjuBu4xM1SDuCgCSWJpWHLiDEhKWofMyMbNqg1fPKWG4Y8DaSYNPKcD2cfbBf9SqjV" ], "script": "base64:BgIxCAISBAoCGBgSBAoCGBgSAwoBCBIDCgEIEgUKAwgICBIECgIICBIDCgEIEgUKAwgYGAgADmNvbGxlY3Rpb25OYW1lCQERQGV4dHJOYXRpdmUoMTA1MykCBQR0aGlzAg5jb2xsZWN0aW9uTmFtZQAGc3ltYm9sCQERQGV4dHJOYXRpdmUoMTA1MykCBQR0aGlzAgZzeW1ib2wAC2Rlc2NyaXB0aW9uCQERQGV4dHJOYXRpdmUoMTA1MykCBQR0aGlzAgtkZXNjcmlwdGlvbgALdG90YWxBbW91bnQJARFAZXh0ck5hdGl2ZSgxMDUwKQIFBHRoaXMCC3RvdGFsQW1vdW50AAhkQXBwSnNvbgkBB0FkZHJlc3MBCQDZBAEJARFAZXh0ck5hdGl2ZSgxMDUzKQIFBHRoaXMCCGRBcHBKc29uAQxvbmx5SW50ZXJuYWwBBmNhbGxlcgMJAAACBQZjYWxsZXIFBHRoaXMFBHVuaXQJAAIBAhJPbmx5IGludGVybmFsIGNhbGwBDXRyYW5zZmVyT3JOb3QCAnRvB2Fzc2V0SWQDCQAAAgUCdG8FBH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AAgUIdHJhbnNmZXIFCHRyYW5zZmVyCQDMCAIFBWFzc2V0CQDMCAIFCHRyYW5zZmVyCQDMCAIJAQxJbnRlZ2VyRW50cnkCAgt0b3RhbEFtb3VudAUHdG9rZW5JZAkAzAgCCQELU3RyaW5nRW50cnkCBQRuYW1lBQh0b2tlblVSSQUDbmlsCQACAQIkU3RyaWN0IHZhbHVlIGlzIG5vdCBlcXVhbCB0byBpdHNlbGYuAWkBC3NldERBcHBKc29uAQtkQXBwQWRkcmVzcwkBC3ZhbHVlT3JFbHNlAgkBDG9ubHlJbnRlcm5hbAEIBQFpBmNhbGxlcgkAzAgCCQELU3RyaW5nRW50cnkCAghkQXBwSnNvbgULZEFwcEFkZHJlc3MFA25pbAFpAQ90ZXN0U3RvcmFnZUpzb24DB2pzb25LZXkHYXJyS2V5cwlhcnJWYWx1ZXMEA3JlcwkA/AcEBQR0aGlzAhBtYWtlSlNPTkludGVybmFsCQDMCAIFB2FycktleXMJAMwIAgUJYXJyVmFsdWVzBQNuaWwFA25pbAMJAAACBQNyZXMFA3JlcwkAlAoCCQDMCAIJAQtTdHJpbmdFbnRyeQIFB2pzb25LZXkKAAFABQNyZXMDCQABAgUBQAIGU3RyaW5nBQFACQACAQkArAICCQADAQUBQAIbIGNvdWxkbid0IGJlIGNhc3QgdG8gU3RyaW5nBQNuaWwFA3JlcwkAAgECJFN0cmljdCB2YWx1ZSBpcyBub3QgZXF1YWwgdG8gaXRzZWxmLgC72APk", "height": 2491515, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: JAB8kqzybDWuAineJXCyTAcGDtXPwuEb9Lf3tkmWbGbs Next: 4M1KzdxQvgMasE2qgtMcKNdw4ETXJEfirz4kXf8LVfAe Diff:
Old | New | Differences | |
---|---|---|---|
9 | 9 | ||
10 | 10 | let d = getIntegerValue(this, "totalAmount") | |
11 | 11 | ||
12 | - | func e (f,g) = if ((f == this)) | |
13 | - | then StringEntry("костыль", "костыль") | |
14 | - | else ScriptTransfer(f, 1, g) | |
12 | + | let e = Address(fromBase58String(getStringValue(this, "dAppJson"))) | |
13 | + | ||
14 | + | func f (g) = if ((g == this)) | |
15 | + | then unit | |
16 | + | else throw("Only internal call") | |
15 | 17 | ||
16 | 18 | ||
17 | - | @Callable(h) | |
18 | - | func init (a,b,c) = if ((h.caller == this)) | |
19 | - | then [StringEntry("collectionName", a), StringEntry("symbol", b), StringEntry("description", c), IntegerEntry("totalAmount", 0)] | |
20 | - | else throw("only dApp") | |
19 | + | func h (i,j) = if ((i == this)) | |
20 | + | then StringEntry("костыль", "костыль") | |
21 | + | else ScriptTransfer(i, 1, j) | |
22 | + | ||
23 | + | ||
24 | + | func k (j,l,m) = throw() | |
25 | + | ||
26 | + | ||
27 | + | @Callable(n) | |
28 | + | func makeJSONInternal (o,p) = valueOrElse(f(n.caller), { | |
29 | + | let q = invoke(e, "makeJSON", [o, p], nil) | |
30 | + | if ((q == q)) | |
31 | + | then $Tuple2(nil, q) | |
32 | + | else throw("Strict value is not equal to itself.") | |
33 | + | }) | |
21 | 34 | ||
22 | 35 | ||
23 | 36 | ||
24 | - | @Callable(h) | |
25 | - | func mint (f,i) = if ((h.caller == this)) | |
26 | - | then { | |
27 | - | let j = (d + 1) | |
28 | - | let k = ((b + "#") + toString(j)) | |
29 | - | let l = if ((16 >= size(k))) | |
30 | - | then k | |
31 | - | else toString(j) | |
32 | - | let m = Issue(l, (("{uri:\"" + i) + "\"}"), 1, 0, false, unit, height) | |
33 | - | let g = calculateAssetId(m) | |
34 | - | let n = Address(fromBase58String(f)) | |
35 | - | let o = e(n, g) | |
36 | - | if ((o == o)) | |
37 | - | then [m, o, IntegerEntry("totalAmount", j), StringEntry(l, i)] | |
38 | - | else throw("Strict value is not equal to itself.") | |
39 | - | } | |
40 | - | else throw("only dApp") | |
37 | + | @Callable(n) | |
38 | + | func addToJSONInternal (o,p) = valueOrElse(f(n.caller), { | |
39 | + | let q = invoke(e, "addToJSON", [o, p], nil) | |
40 | + | if ((q == q)) | |
41 | + | then $Tuple2(nil, q) | |
42 | + | else throw("Strict value is not equal to itself.") | |
43 | + | }) | |
44 | + | ||
45 | + | ||
46 | + | ||
47 | + | @Callable(n) | |
48 | + | func readByJSONKeyInternal (r) = valueOrElse(f(n.caller), { | |
49 | + | let q = invoke(e, "readByJSONKey", [r], nil) | |
50 | + | if ((q == q)) | |
51 | + | then $Tuple2(nil, q) | |
52 | + | else throw("Strict value is not equal to itself.") | |
53 | + | }) | |
54 | + | ||
55 | + | ||
56 | + | ||
57 | + | @Callable(n) | |
58 | + | func deleteByJSONKeyInternal (r) = valueOrElse(f(n.caller), { | |
59 | + | let q = invoke(e, "deleteByJSONKey", [r], nil) | |
60 | + | if ((q == q)) | |
61 | + | then $Tuple2(nil, q) | |
62 | + | else throw("Strict value is not equal to itself.") | |
63 | + | }) | |
64 | + | ||
65 | + | ||
66 | + | ||
67 | + | @Callable(n) | |
68 | + | func init (a,b,c) = valueOrElse(f(n.caller), [StringEntry("collectionName", a), StringEntry("symbol", b), StringEntry("description", c), IntegerEntry("totalAmount", 0)]) | |
69 | + | ||
70 | + | ||
71 | + | ||
72 | + | @Callable(n) | |
73 | + | func mint (i,s) = valueOrElse(f(n.caller), { | |
74 | + | let t = (d + 1) | |
75 | + | let u = ((b + "#") + toString(t)) | |
76 | + | let v = if ((16 >= size(u))) | |
77 | + | then u | |
78 | + | else toString(t) | |
79 | + | let w = Issue(v, (("{uri:\"" + s) + "\"}"), 1, 0, false, unit, height) | |
80 | + | let j = calculateAssetId(w) | |
81 | + | let x = Address(fromBase58String(i)) | |
82 | + | let y = h(x, j) | |
83 | + | if ((y == y)) | |
84 | + | then [w, y, IntegerEntry("totalAmount", t), StringEntry(v, s)] | |
85 | + | else throw("Strict value is not equal to itself.") | |
86 | + | }) | |
87 | + | ||
88 | + | ||
89 | + | ||
90 | + | @Callable(n) | |
91 | + | func setDAppJson (z) = valueOrElse(f(n.caller), [StringEntry("dAppJson", z)]) | |
92 | + | ||
93 | + | ||
94 | + | ||
95 | + | @Callable(n) | |
96 | + | func testStorageJson (A,o,p) = { | |
97 | + | let q = invoke(this, "makeJSONInternal", [o, p], nil) | |
98 | + | if ((q == q)) | |
99 | + | then $Tuple2([StringEntry(A, { | |
100 | + | let B = q | |
101 | + | if ($isInstanceOf(B, "String")) | |
102 | + | then B | |
103 | + | else throw(($getType(B) + " couldn't be cast to String")) | |
104 | + | })], q) | |
105 | + | else throw("Strict value is not equal to itself.") | |
106 | + | } | |
41 | 107 | ||
42 | 108 |
Old | New | Differences | |
---|---|---|---|
1 | 1 | {-# STDLIB_VERSION 6 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | 4 | let a = getStringValue(this, "collectionName") | |
5 | 5 | ||
6 | 6 | let b = getStringValue(this, "symbol") | |
7 | 7 | ||
8 | 8 | let c = getStringValue(this, "description") | |
9 | 9 | ||
10 | 10 | let d = getIntegerValue(this, "totalAmount") | |
11 | 11 | ||
12 | - | func e (f,g) = if ((f == this)) | |
13 | - | then StringEntry("костыль", "костыль") | |
14 | - | else ScriptTransfer(f, 1, g) | |
12 | + | let e = Address(fromBase58String(getStringValue(this, "dAppJson"))) | |
13 | + | ||
14 | + | func f (g) = if ((g == this)) | |
15 | + | then unit | |
16 | + | else throw("Only internal call") | |
15 | 17 | ||
16 | 18 | ||
17 | - | @Callable(h) | |
18 | - | func init (a,b,c) = if ((h.caller == this)) | |
19 | - | then [StringEntry("collectionName", a), StringEntry("symbol", b), StringEntry("description", c), IntegerEntry("totalAmount", 0)] | |
20 | - | else throw("only dApp") | |
19 | + | func h (i,j) = if ((i == this)) | |
20 | + | then StringEntry("костыль", "костыль") | |
21 | + | else ScriptTransfer(i, 1, j) | |
22 | + | ||
23 | + | ||
24 | + | func k (j,l,m) = throw() | |
25 | + | ||
26 | + | ||
27 | + | @Callable(n) | |
28 | + | func makeJSONInternal (o,p) = valueOrElse(f(n.caller), { | |
29 | + | let q = invoke(e, "makeJSON", [o, p], nil) | |
30 | + | if ((q == q)) | |
31 | + | then $Tuple2(nil, q) | |
32 | + | else throw("Strict value is not equal to itself.") | |
33 | + | }) | |
21 | 34 | ||
22 | 35 | ||
23 | 36 | ||
24 | - | @Callable(h) | |
25 | - | func mint (f,i) = if ((h.caller == this)) | |
26 | - | then { | |
27 | - | let j = (d + 1) | |
28 | - | let k = ((b + "#") + toString(j)) | |
29 | - | let l = if ((16 >= size(k))) | |
30 | - | then k | |
31 | - | else toString(j) | |
32 | - | let m = Issue(l, (("{uri:\"" + i) + "\"}"), 1, 0, false, unit, height) | |
33 | - | let g = calculateAssetId(m) | |
34 | - | let n = Address(fromBase58String(f)) | |
35 | - | let o = e(n, g) | |
36 | - | if ((o == o)) | |
37 | - | then [m, o, IntegerEntry("totalAmount", j), StringEntry(l, i)] | |
38 | - | else throw("Strict value is not equal to itself.") | |
39 | - | } | |
40 | - | else throw("only dApp") | |
37 | + | @Callable(n) | |
38 | + | func addToJSONInternal (o,p) = valueOrElse(f(n.caller), { | |
39 | + | let q = invoke(e, "addToJSON", [o, p], nil) | |
40 | + | if ((q == q)) | |
41 | + | then $Tuple2(nil, q) | |
42 | + | else throw("Strict value is not equal to itself.") | |
43 | + | }) | |
44 | + | ||
45 | + | ||
46 | + | ||
47 | + | @Callable(n) | |
48 | + | func readByJSONKeyInternal (r) = valueOrElse(f(n.caller), { | |
49 | + | let q = invoke(e, "readByJSONKey", [r], nil) | |
50 | + | if ((q == q)) | |
51 | + | then $Tuple2(nil, q) | |
52 | + | else throw("Strict value is not equal to itself.") | |
53 | + | }) | |
54 | + | ||
55 | + | ||
56 | + | ||
57 | + | @Callable(n) | |
58 | + | func deleteByJSONKeyInternal (r) = valueOrElse(f(n.caller), { | |
59 | + | let q = invoke(e, "deleteByJSONKey", [r], nil) | |
60 | + | if ((q == q)) | |
61 | + | then $Tuple2(nil, q) | |
62 | + | else throw("Strict value is not equal to itself.") | |
63 | + | }) | |
64 | + | ||
65 | + | ||
66 | + | ||
67 | + | @Callable(n) | |
68 | + | func init (a,b,c) = valueOrElse(f(n.caller), [StringEntry("collectionName", a), StringEntry("symbol", b), StringEntry("description", c), IntegerEntry("totalAmount", 0)]) | |
69 | + | ||
70 | + | ||
71 | + | ||
72 | + | @Callable(n) | |
73 | + | func mint (i,s) = valueOrElse(f(n.caller), { | |
74 | + | let t = (d + 1) | |
75 | + | let u = ((b + "#") + toString(t)) | |
76 | + | let v = if ((16 >= size(u))) | |
77 | + | then u | |
78 | + | else toString(t) | |
79 | + | let w = Issue(v, (("{uri:\"" + s) + "\"}"), 1, 0, false, unit, height) | |
80 | + | let j = calculateAssetId(w) | |
81 | + | let x = Address(fromBase58String(i)) | |
82 | + | let y = h(x, j) | |
83 | + | if ((y == y)) | |
84 | + | then [w, y, IntegerEntry("totalAmount", t), StringEntry(v, s)] | |
85 | + | else throw("Strict value is not equal to itself.") | |
86 | + | }) | |
87 | + | ||
88 | + | ||
89 | + | ||
90 | + | @Callable(n) | |
91 | + | func setDAppJson (z) = valueOrElse(f(n.caller), [StringEntry("dAppJson", z)]) | |
92 | + | ||
93 | + | ||
94 | + | ||
95 | + | @Callable(n) | |
96 | + | func testStorageJson (A,o,p) = { | |
97 | + | let q = invoke(this, "makeJSONInternal", [o, p], nil) | |
98 | + | if ((q == q)) | |
99 | + | then $Tuple2([StringEntry(A, { | |
100 | + | let B = q | |
101 | + | if ($isInstanceOf(B, "String")) | |
102 | + | then B | |
103 | + | else throw(($getType(B) + " couldn't be cast to String")) | |
104 | + | })], q) | |
105 | + | else throw("Strict value is not equal to itself.") | |
106 | + | } | |
41 | 107 | ||
42 | 108 |
github/deemru/w8io/169f3d6 29.36 ms ◑