tx · Hu5BDFzVeuV3Ao1d9aFR5XQDZ3RoeAjx44484KfFBRr7 3MrQ4g9YCsAN2Wr4QUXiWAPhNPv7DGdQNWb: -0.00300000 Waves 2023.03.15 23:48 [2491639] smart account 3MrQ4g9YCsAN2Wr4QUXiWAPhNPv7DGdQNWb > SELF 0.00000000 Waves
{ "type": 13, "id": "Hu5BDFzVeuV3Ao1d9aFR5XQDZ3RoeAjx44484KfFBRr7", "fee": 300000, "feeAssetId": null, "timestamp": 1678913290348, "version": 2, "chainId": 84, "sender": "3MrQ4g9YCsAN2Wr4QUXiWAPhNPv7DGdQNWb", "senderPublicKey": "2VQGRNRWyFAZvjDtkgZwdZcTwZvBJJ61n8zJfYYxm5eK", "proofs": [ "5nZXwXjKu5DHeJo8Tv2ojLWu8CYWoPyboqx7ByafuW79Qy7kXtXQ9R3rC4PJGjod8pLy6aaC3WNTQcnVpyDdQUdz" ], "script": "base64:BgIyCAISBAoCGBgSBAoCGBgSAwoBCBIDCgEIEgQKAggIEgUKAwIICBIFCgMICAgSBAoCCAgHAA5jb2xsZWN0aW9uTmFtZQkBEUBleHRyTmF0aXZlKDEwNTMpAgUEdGhpcwIOY29sbGVjdGlvbk5hbWUABnN5bWJvbAkBEUBleHRyTmF0aXZlKDEwNTMpAgUEdGhpcwIGc3ltYm9sAAtkZXNjcmlwdGlvbgkBEUBleHRyTmF0aXZlKDEwNTMpAgUEdGhpcwILZGVzY3JpcHRpb24AC3RvdGFsQW1vdW50CQERQGV4dHJOYXRpdmUoMTA1MCkCBQR0aGlzAgt0b3RhbEFtb3VudAAIZEFwcEpzb24JAQdBZGRyZXNzAQkA2QQBAiMzTXJHYVpWUmhrbkVHZkhKMTl0dFVQTm5EUm9GcWNIaFZONwEMb25seUludGVybmFsAQZjYWxsZXIDCQAAAgUGY2FsbGVyBQR0aGlzBQR1bml0CQACAQIST25seSBpbnRlcm5hbCBjYWxsAQ10cmFuc2Zlck9yTm90AgJ0bwdhc3NldElkAwkAAAIFAnRvBQ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VudHJ5AgIGc3ltYm9sBQZzeW1ib2wJAMwIAgkBC1N0cmluZ0VudHJ5AgILZGVzY3JpcHRpb24FC2Rlc2NyaXB0aW9uCQDMCAIJAQxJbnRlZ2VyRW50cnkCAgt0b3RhbEFtb3VudAAABQNuaWwBaQEEbWludAICdG8IdG9rZW5VUkkJAQt2YWx1ZU9yRWxzZQIJAQxvbmx5SW50ZXJuYWwBCAUBaQZjYWxsZXIEB3Rva2VuSWQJAGQCBQt0b3RhbEFtb3VudAABBAdwcmVOYW1lCQCsAgIJAKwCAgUGc3ltYm9sAgEjCQCkAwEFB3Rva2VuSWQEBG5hbWUDCQBnAgAQCQCxAgEFB3ByZU5hbWUFB3ByZU5hbWUJAKQDAQUHdG9rZW5JZAQFYXNzZXQJAMMIBwUEbmFtZQkArAICCQCsAgICBnt1cmk6IgUIdG9rZW5VUkkCAiJ9AAEAAAcFBHVuaXQFBmhlaWdodAQHYXNzZXRJZAkAuAgBBQVhc3NldAQJdG9BZGRyZXNzCQEHQWRkcmVzcwEJANkEAQUCdG8ECHRyYW5zZmVyCQENdHJhbnNmZXJPck5vdAIFCXRvQWRkcmVzcwUHYXNzZXRJZAMJAAACBQh0cmFuc2ZlcgUIdHJhbnNmZXIJAMwIAgUFYXNzZXQJAMwIAgUIdHJhbnNmZXIJAMwIAgkBDEludGVnZXJFbnRyeQICC3RvdGFsQW1vdW50BQd0b2tlbklkCQDMCAIJAQtTdHJpbmdFbnRyeQIFBG5hbWUFCHRva2VuVVJJBQNuaWwJAAIBAiRTdHJpY3QgdmFsdWUgaXMgbm90IGVxdWFsIHRvIGl0c2VsZi4AZ/Pf6g==", "height": 2491639, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: CfHMPA3zscACjwjDWgrgtC96Vjg1zvxC4E8U9LEsBWyV Next: CuwEoXYFkyPsDt3j2pBgkVsD9PUQQg6UF5p1bJW1UVuw Full:
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 | @Callable(i) | |
25 | 25 | func makeJSONInternal (arrKeys,arrValues) = valueOrElse(onlyInternal(i.caller), { | |
26 | 26 | let res = invoke(dAppJson, "makeJSON", [arrKeys, arrValues], nil) | |
27 | 27 | if ((res == res)) | |
28 | 28 | then $Tuple2(nil, res) | |
29 | 29 | else throw("Strict value is not equal to itself.") | |
30 | 30 | }) | |
31 | 31 | ||
32 | 32 | ||
33 | 33 | ||
34 | 34 | @Callable(i) | |
35 | 35 | func addToJSONInternal (arrKeys,arrValues) = valueOrElse(onlyInternal(i.caller), { | |
36 | 36 | let res = invoke(dAppJson, "addToJSON", [arrKeys, arrValues], nil) | |
37 | 37 | if ((res == res)) | |
38 | 38 | then $Tuple2(nil, res) | |
39 | 39 | else throw("Strict value is not equal to itself.") | |
40 | 40 | }) | |
41 | 41 | ||
42 | 42 | ||
43 | 43 | ||
44 | 44 | @Callable(i) | |
45 | 45 | func readByJSONKeyInternal (key) = valueOrElse(onlyInternal(i.caller), { | |
46 | 46 | let res = invoke(dAppJson, "readByJSONKey", [key], nil) | |
47 | 47 | if ((res == res)) | |
48 | 48 | then $Tuple2(nil, res) | |
49 | 49 | else throw("Strict value is not equal to itself.") | |
50 | 50 | }) | |
51 | 51 | ||
52 | 52 | ||
53 | 53 | ||
54 | 54 | @Callable(i) | |
55 | 55 | func deleteByJSONKeyInternal (key) = valueOrElse(onlyInternal(i.caller), { | |
56 | 56 | let res = invoke(dAppJson, "deleteByJSONKey", [key], nil) | |
57 | 57 | if ((res == res)) | |
58 | 58 | then $Tuple2(nil, res) | |
59 | 59 | else throw("Strict value is not equal to itself.") | |
60 | 60 | }) | |
61 | 61 | ||
62 | 62 | ||
63 | 63 | ||
64 | 64 | @Callable(i) | |
65 | 65 | func storageJsonInternal (jsonKey,jsonString) = valueOrElse(onlyInternal(i.caller), [StringEntry(jsonKey, jsonString)]) | |
66 | 66 | ||
67 | 67 | ||
68 | 68 | ||
69 | 69 | @Callable(i) | |
70 | 70 | func setUser (assetId,user,expires) = valueOrElse(onlyInternal(i.caller), { | |
71 | 71 | let res = invoke(dAppJson, "makeJSON", [["user", "expires"], [user, expires]], nil) | |
72 | 72 | if ((res == res)) | |
73 | 73 | then $Tuple2([StringEntry(("userOf-" + toUtf8String(assetId)), { | |
74 | 74 | let @ = res | |
75 | 75 | if ($isInstanceOf(@, "String")) | |
76 | 76 | then @ | |
77 | 77 | else throw(($getType(@) + " couldn't be cast to String")) | |
78 | 78 | })], res) | |
79 | 79 | else throw("Strict value is not equal to itself.") | |
80 | 80 | }) | |
81 | 81 | ||
82 | 82 | ||
83 | 83 | ||
84 | 84 | @Callable(i) | |
85 | 85 | func init (collectionName,symbol,description) = valueOrElse(onlyInternal(i.caller), [StringEntry("collectionName", collectionName), StringEntry("symbol", symbol), StringEntry("description", description), IntegerEntry("totalAmount", 0)]) | |
86 | 86 | ||
87 | 87 | ||
88 | 88 | ||
89 | 89 | @Callable(i) | |
90 | 90 | func mint (to,tokenURI) = valueOrElse(onlyInternal(i.caller), { | |
91 | 91 | let tokenId = (totalAmount + 1) | |
92 | 92 | let preName = ((symbol + "#") + toString(tokenId)) | |
93 | 93 | let name = if ((16 >= size(preName))) | |
94 | 94 | then preName | |
95 | 95 | else toString(tokenId) | |
96 | 96 | let asset = Issue(name, (("{uri:\"" + tokenURI) + "\"}"), 1, 0, false, unit, height) | |
97 | 97 | let assetId = calculateAssetId(asset) | |
98 | 98 | let toAddress = Address(fromBase58String(to)) | |
99 | 99 | let transfer = transferOrNot(toAddress, assetId) | |
100 | 100 | if ((transfer == transfer)) | |
101 | 101 | then [asset, transfer, IntegerEntry("totalAmount", tokenId), StringEntry(name, tokenURI)] | |
102 | 102 | else throw("Strict value is not equal to itself.") | |
103 | 103 | }) | |
104 | 104 | ||
105 | 105 |
github/deemru/w8io/026f985 27.01 ms ◑