tx · 4M1KzdxQvgMasE2qgtMcKNdw4ETXJEfirz4kXf8LVfAe 3MrQ4g9YCsAN2Wr4QUXiWAPhNPv7DGdQNWb: -0.00300000 Waves 2023.03.15 21:48 [2491517] smart account 3MrQ4g9YCsAN2Wr4QUXiWAPhNPv7DGdQNWb > SELF 0.00000000 Waves
{ "type": 13, "id": "4M1KzdxQvgMasE2qgtMcKNdw4ETXJEfirz4kXf8LVfAe", "fee": 300000, "feeAssetId": null, "timestamp": 1678906108601, "version": 2, "chainId": 84, "sender": "3MrQ4g9YCsAN2Wr4QUXiWAPhNPv7DGdQNWb", "senderPublicKey": "2VQGRNRWyFAZvjDtkgZwdZcTwZvBJJ61n8zJfYYxm5eK", "proofs": [ "3NfmrxrgneMRVVM35AALUDZb2PuXsFB6J6s1t9K5NkMtPEb8bGhNrBW2EiBcfDUTMVqLAwBqdCfpcHz6qpRzbjeT" ], "script": "base64:BgIsCAISBAoCGBgSBAoCGBgSAwoBCBIDCgEIEgUKAwgICBIECgIICBIFCgMIGBgIAA5jb2xsZWN0aW9uTmFtZQkBEUBleHRyTmF0aXZlKDEwNTMpAgUEdGhpcwIOY29sbGVjdGlvbk5hbWUABnN5bWJvbAkBEUBleHRyTmF0aXZlKDEwNTMpAgUEdGhpcwIGc3ltYm9sAAtkZXNjcmlwdGlvbgkBEUBleHRyTmF0aXZlKDEwNTMpAgUEdGhpcwILZGVzY3JpcHRpb24AC3RvdGFsQW1vdW50CQERQGV4dHJOYXRpdmUoMTA1MCkCBQR0aGlzAgt0b3RhbEFtb3VudAAIZEFwcEpzb24JAQdBZGRyZXNzAQkA2QQBAiMzTXJHYVpWUmhrbkVHZkhKMTl0dFVQTm5EUm9GcWNIaFZONwEMb25seUludGVybmFsAQZjYWxsZXIDCQAAAgUGY2FsbGVyBQR0aGlzBQR1bml0CQACAQIST25seSBpbnRlcm5hbCBjYWxsAQ10cmFuc2Zlck9yTm90AgJ0bwdhc3NldElkAwkAAAIFAnRvBQR0aGlzCQELU3Ry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yBQh0cmFuc2ZlcgkAzAgCBQVhc3NldAkAzAgCBQh0cmFuc2ZlcgkAzAgCCQEMSW50ZWdlckVudHJ5AgILdG90YWxBbW91bnQFB3Rva2VuSWQJAMwIAgkBC1N0cmluZ0VudHJ5AgUEbmFtZQUIdG9rZW5VUkkFA25pbAkAAgECJFN0cmljdCB2YWx1ZSBpcyBub3QgZXF1YWwgdG8gaXRzZWxmLgFpAQ90ZXN0U3RvcmFnZUpzb24DB2pzb25LZXkHYXJyS2V5cwlhcnJWYWx1ZXMEA3JlcwkA/AcEBQR0aGlzAhBtYWtlSlNPTkludGVybmFsCQDMCAIFB2FycktleXMJAMwIAgUJYXJyVmFsdWVzBQNuaWwFA25pbAMJAAACBQNyZXMFA3JlcwkAlAoCCQDMCAIJAQtTdHJpbmdFbnRyeQIFB2pzb25LZXkKAAFABQNyZXMDCQABAgUBQAIGU3RyaW5nBQFACQACAQkArAICCQADAQUBQAIbIGNvdWxkbid0IGJlIGNhc3QgdG8gU3RyaW5nBQNuaWwFA3JlcwkAAgECJFN0cmljdCB2YWx1ZSBpcyBub3QgZXF1YWwgdG8gaXRzZWxmLgBEDjPC", "height": 2491517, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: Es3A8zivcJhgDjiVdfvY82kTjvMSctdFBJPirMcb6wja Next: F9NrXu4VauTXkaj3oC43Wci1jVZwGaoM2oiQepJkgQhD Diff:
Old | New | Differences | |
---|---|---|---|
9 | 9 | ||
10 | 10 | let totalAmount = getIntegerValue(this, "totalAmount") | |
11 | 11 | ||
12 | - | let dAppJson = Address(fromBase58String( | |
12 | + | let dAppJson = Address(fromBase58String("3MrGaZVRhknEGfHJ19ttUPNnDRoFqcHhVN7")) | |
13 | 13 | ||
14 | 14 | func onlyInternal (caller) = if ((caller == this)) | |
15 | 15 | then unit | |
88 | 88 | ||
89 | 89 | ||
90 | 90 | @Callable(i) | |
91 | - | func setDAppJson (dAppAddress) = valueOrElse(onlyInternal(i.caller), [StringEntry("dAppJson", dAppAddress)]) | |
92 | - | ||
93 | - | ||
94 | - | ||
95 | - | @Callable(i) | |
96 | 91 | func testStorageJson (jsonKey,arrKeys,arrValues) = { | |
97 | 92 | let res = invoke(this, "makeJSONInternal", [arrKeys, arrValues], nil) | |
98 | 93 | if ((res == res)) |
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 | - | let dAppJson = Address(fromBase58String( | |
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 | 68 | func init (collectionName,symbol,description) = valueOrElse(onlyInternal(i.caller), [StringEntry("collectionName", collectionName), StringEntry("symbol", symbol), StringEntry("description", description), IntegerEntry("totalAmount", 0)]) | |
69 | 69 | ||
70 | 70 | ||
71 | 71 | ||
72 | 72 | @Callable(i) | |
73 | 73 | func mint (to,tokenURI) = valueOrElse(onlyInternal(i.caller), { | |
74 | 74 | let tokenId = (totalAmount + 1) | |
75 | 75 | let preName = ((symbol + "#") + toString(tokenId)) | |
76 | 76 | let name = if ((16 >= size(preName))) | |
77 | 77 | then preName | |
78 | 78 | else toString(tokenId) | |
79 | 79 | let asset = Issue(name, (("{uri:\"" + tokenURI) + "\"}"), 1, 0, false, unit, height) | |
80 | 80 | let assetId = calculateAssetId(asset) | |
81 | 81 | let toAddress = Address(fromBase58String(to)) | |
82 | 82 | let transfer = transferOrNot(toAddress, assetId) | |
83 | 83 | if ((transfer == transfer)) | |
84 | 84 | then [asset, transfer, IntegerEntry("totalAmount", tokenId), StringEntry(name, tokenURI)] | |
85 | 85 | else throw("Strict value is not equal to itself.") | |
86 | 86 | }) | |
87 | 87 | ||
88 | 88 | ||
89 | 89 | ||
90 | 90 | @Callable(i) | |
91 | - | func setDAppJson (dAppAddress) = valueOrElse(onlyInternal(i.caller), [StringEntry("dAppJson", dAppAddress)]) | |
92 | - | ||
93 | - | ||
94 | - | ||
95 | - | @Callable(i) | |
96 | 91 | func testStorageJson (jsonKey,arrKeys,arrValues) = { | |
97 | 92 | let res = invoke(this, "makeJSONInternal", [arrKeys, arrValues], nil) | |
98 | 93 | if ((res == res)) | |
99 | 94 | then $Tuple2([StringEntry(jsonKey, { | |
100 | 95 | let @ = res | |
101 | 96 | if ($isInstanceOf(@, "String")) | |
102 | 97 | then @ | |
103 | 98 | else throw(($getType(@) + " couldn't be cast to String")) | |
104 | 99 | })], res) | |
105 | 100 | else throw("Strict value is not equal to itself.") | |
106 | 101 | } | |
107 | 102 | ||
108 | 103 |
github/deemru/w8io/169f3d6 34.53 ms ◑