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