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