tx · EELprxkvTDR2igkzDf4FJxbJnhpn3YPm1voU2cFGVrps 3MrQ4g9YCsAN2Wr4QUXiWAPhNPv7DGdQNWb: -0.00300000 Waves 2023.03.15 22:03 [2491535] smart account 3MrQ4g9YCsAN2Wr4QUXiWAPhNPv7DGdQNWb > SELF 0.00000000 Waves
{ "type": 13, "id": "EELprxkvTDR2igkzDf4FJxbJnhpn3YPm1voU2cFGVrps", "fee": 300000, "feeAssetId": null, "timestamp": 1678907062220, "version": 2, "chainId": 84, "sender": "3MrQ4g9YCsAN2Wr4QUXiWAPhNPv7DGdQNWb", "senderPublicKey": "2VQGRNRWyFAZvjDtkgZwdZcTwZvBJJ61n8zJfYYxm5eK", "proofs": [ "5os2VfwK5NFeM8aTpfvFwKzxoC512vnE8HZ8ZD3bR5NGbhPVS5K8GvTJkd937fZTnXNxpETYGLJRdZVNzCNvwrXq" ], "script": "base64:BgIrCAISBAoCGBgSBAoCGBgSAwoBCBIDCgEIEgQKAggIEgUKAwgICBIECgIICAgADmNvbGxlY3Rpb25OYW1lCQERQGV4dHJOYXRpdmUoMTA1MykCBQR0aGlzAg5jb2xsZWN0aW9uTmFtZQAGc3ltYm9sCQERQGV4dHJOYXRpdmUoMTA1MykCBQR0aGlzAgZzeW1ib2wAC2Rlc2NyaXB0aW9uCQERQGV4dHJOYXRpdmUoMTA1MykCBQR0aGlzAgtkZXNjcmlwdGlvbgALdG90YWxBbW91bnQJARFAZXh0ck5hdGl2ZSgxMDUwKQIFBHRoaXMCC3RvdGFsQW1vdW50AAhkQXBwSnNvbgkBB0FkZHJlc3MBCQDZBAECIzNNckdhWlZSaGtuRUdmSEoxOXR0VVBObkRSb0ZxY0hoVk43AQxvbmx5SW50ZXJuYWwBBmNhbGxlcgMJAAACBQZjYWxsZXIFBHRoaXMFBHVuaXQJAAIBAhJPbmx5IGludGVybmFsIGNhbGwBDXRyYW5zZmVyT3JOb3QCAnRvB2Fzc2V0SWQDCQAAAgUCdG8FBHRoaXMJAQtTdHJp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iJ9AAEAAAcFBHVuaXQFBmhlaWdodAQHYXNzZXRJZAkAuAgBBQVhc3NldAQJdG9BZGRyZXNzCQEHQWRkcmVzcwEJANkEAQUCdG8ECHRyYW5zZmVyCQENdHJhbnNmZXJPck5vdAIFCXRvQWRkcmVzcwUHYXNzZXRJZAMJAAACBQh0cmFuc2ZlcgUIdHJhbnNmZXIJAMwIAgUFYXNzZXQJAMwIAgUIdHJhbnNmZXIJAMwIAgkBDEludGVnZXJFbnRyeQICC3RvdGFsQW1vdW50BQd0b2tlbklkCQDMCAIJAQtTdHJpbmdFbnRyeQIFBG5hbWUFCHRva2VuVVJJBQNuaWwJAAIBAiRTdHJpY3QgdmFsdWUgaXMgbm90IGVxdWFsIHRvIGl0c2VsZi4Aa4oYSg==", "height": 2491535, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: F9NrXu4VauTXkaj3oC43Wci1jVZwGaoM2oiQepJkgQhD Next: 8ZT9HNgLMLuQ2KoLc8vFJct4pJ4a77gRVfyr535o1W7x Diff:
Old | New | Differences | |
---|---|---|---|
65 | 65 | ||
66 | 66 | ||
67 | 67 | @Callable(i) | |
68 | + | func storageJsonInternal (jsonKey,jsonString) = valueOrElse(onlyInternal(i.caller), [StringEntry(jsonKey, jsonString)]) | |
69 | + | ||
70 | + | ||
71 | + | ||
72 | + | @Callable(i) | |
68 | 73 | func init (collectionName,symbol,description) = valueOrElse(onlyInternal(i.caller), [StringEntry("collectionName", collectionName), StringEntry("symbol", symbol), StringEntry("description", description), IntegerEntry("totalAmount", 0)]) | |
69 | 74 | ||
70 | 75 | ||
86 | 91 | }) | |
87 | 92 | ||
88 | 93 | ||
89 | - | ||
90 | - | @Callable(i) | |
91 | - | func testStorageJson (jsonKey,arrKeys,arrValues) = { | |
92 | - | let res = invoke(this, "makeJSONInternal", [arrKeys, arrValues], nil) | |
93 | - | if ((res == res)) | |
94 | - | then $Tuple2([StringEntry(jsonKey, { | |
95 | - | let @ = res | |
96 | - | if ($isInstanceOf(@, "String")) | |
97 | - | then @ | |
98 | - | else throw(($getType(@) + " couldn't be cast to String")) | |
99 | - | })], res) | |
100 | - | else throw("Strict value is not equal to itself.") | |
101 | - | } | |
102 | - | ||
103 | - |
Old | New | Differences | |
---|---|---|---|
1 | 1 | {-# STDLIB_VERSION 6 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | 4 | let collectionName = getStringValue(this, "collectionName") | |
5 | 5 | ||
6 | 6 | let symbol = getStringValue(this, "symbol") | |
7 | 7 | ||
8 | 8 | let description = getStringValue(this, "description") | |
9 | 9 | ||
10 | 10 | let totalAmount = getIntegerValue(this, "totalAmount") | |
11 | 11 | ||
12 | 12 | let dAppJson = Address(fromBase58String("3MrGaZVRhknEGfHJ19ttUPNnDRoFqcHhVN7")) | |
13 | 13 | ||
14 | 14 | func onlyInternal (caller) = if ((caller == this)) | |
15 | 15 | then unit | |
16 | 16 | else throw("Only internal call") | |
17 | 17 | ||
18 | 18 | ||
19 | 19 | func transferOrNot (to,assetId) = if ((to == this)) | |
20 | 20 | then StringEntry("костыль", "костыль") | |
21 | 21 | else ScriptTransfer(to, 1, assetId) | |
22 | 22 | ||
23 | 23 | ||
24 | 24 | func setUser (assetId,user,expires) = throw() | |
25 | 25 | ||
26 | 26 | ||
27 | 27 | @Callable(i) | |
28 | 28 | func makeJSONInternal (arrKeys,arrValues) = valueOrElse(onlyInternal(i.caller), { | |
29 | 29 | let res = invoke(dAppJson, "makeJSON", [arrKeys, arrValues], nil) | |
30 | 30 | if ((res == res)) | |
31 | 31 | then $Tuple2(nil, res) | |
32 | 32 | else throw("Strict value is not equal to itself.") | |
33 | 33 | }) | |
34 | 34 | ||
35 | 35 | ||
36 | 36 | ||
37 | 37 | @Callable(i) | |
38 | 38 | func addToJSONInternal (arrKeys,arrValues) = valueOrElse(onlyInternal(i.caller), { | |
39 | 39 | let res = invoke(dAppJson, "addToJSON", [arrKeys, arrValues], nil) | |
40 | 40 | if ((res == res)) | |
41 | 41 | then $Tuple2(nil, res) | |
42 | 42 | else throw("Strict value is not equal to itself.") | |
43 | 43 | }) | |
44 | 44 | ||
45 | 45 | ||
46 | 46 | ||
47 | 47 | @Callable(i) | |
48 | 48 | func readByJSONKeyInternal (key) = valueOrElse(onlyInternal(i.caller), { | |
49 | 49 | let res = invoke(dAppJson, "readByJSONKey", [key], nil) | |
50 | 50 | if ((res == res)) | |
51 | 51 | then $Tuple2(nil, res) | |
52 | 52 | else throw("Strict value is not equal to itself.") | |
53 | 53 | }) | |
54 | 54 | ||
55 | 55 | ||
56 | 56 | ||
57 | 57 | @Callable(i) | |
58 | 58 | func deleteByJSONKeyInternal (key) = valueOrElse(onlyInternal(i.caller), { | |
59 | 59 | let res = invoke(dAppJson, "deleteByJSONKey", [key], nil) | |
60 | 60 | if ((res == res)) | |
61 | 61 | then $Tuple2(nil, res) | |
62 | 62 | else throw("Strict value is not equal to itself.") | |
63 | 63 | }) | |
64 | 64 | ||
65 | 65 | ||
66 | 66 | ||
67 | 67 | @Callable(i) | |
68 | + | func storageJsonInternal (jsonKey,jsonString) = valueOrElse(onlyInternal(i.caller), [StringEntry(jsonKey, jsonString)]) | |
69 | + | ||
70 | + | ||
71 | + | ||
72 | + | @Callable(i) | |
68 | 73 | func init (collectionName,symbol,description) = valueOrElse(onlyInternal(i.caller), [StringEntry("collectionName", collectionName), StringEntry("symbol", symbol), StringEntry("description", description), IntegerEntry("totalAmount", 0)]) | |
69 | 74 | ||
70 | 75 | ||
71 | 76 | ||
72 | 77 | @Callable(i) | |
73 | 78 | func mint (to,tokenURI) = valueOrElse(onlyInternal(i.caller), { | |
74 | 79 | let tokenId = (totalAmount + 1) | |
75 | 80 | let preName = ((symbol + "#") + toString(tokenId)) | |
76 | 81 | let name = if ((16 >= size(preName))) | |
77 | 82 | then preName | |
78 | 83 | else toString(tokenId) | |
79 | 84 | let asset = Issue(name, (("{uri:\"" + tokenURI) + "\"}"), 1, 0, false, unit, height) | |
80 | 85 | let assetId = calculateAssetId(asset) | |
81 | 86 | let toAddress = Address(fromBase58String(to)) | |
82 | 87 | let transfer = transferOrNot(toAddress, assetId) | |
83 | 88 | if ((transfer == transfer)) | |
84 | 89 | then [asset, transfer, IntegerEntry("totalAmount", tokenId), StringEntry(name, tokenURI)] | |
85 | 90 | else throw("Strict value is not equal to itself.") | |
86 | 91 | }) | |
87 | 92 | ||
88 | 93 | ||
89 | - | ||
90 | - | @Callable(i) | |
91 | - | func testStorageJson (jsonKey,arrKeys,arrValues) = { | |
92 | - | let res = invoke(this, "makeJSONInternal", [arrKeys, arrValues], nil) | |
93 | - | if ((res == res)) | |
94 | - | then $Tuple2([StringEntry(jsonKey, { | |
95 | - | let @ = res | |
96 | - | if ($isInstanceOf(@, "String")) | |
97 | - | then @ | |
98 | - | else throw(($getType(@) + " couldn't be cast to String")) | |
99 | - | })], res) | |
100 | - | else throw("Strict value is not equal to itself.") | |
101 | - | } | |
102 | - | ||
103 | - |
github/deemru/w8io/169f3d6 33.93 ms ◑