tx · 8ZT9HNgLMLuQ2KoLc8vFJct4pJ4a77gRVfyr535o1W7x

3MrQ4g9YCsAN2Wr4QUXiWAPhNPv7DGdQNWb:  -0.00300000 Waves

2023.03.15 22:18 [2491551] smart account 3MrQ4g9YCsAN2Wr4QUXiWAPhNPv7DGdQNWb > SELF 0.00000000 Waves

{ "type": 13, "id": "8ZT9HNgLMLuQ2KoLc8vFJct4pJ4a77gRVfyr535o1W7x", "fee": 300000, "feeAssetId": null, "timestamp": 1678907902143, "version": 2, "chainId": 84, "sender": "3MrQ4g9YCsAN2Wr4QUXiWAPhNPv7DGdQNWb", "senderPublicKey": "2VQGRNRWyFAZvjDtkgZwdZcTwZvBJJ61n8zJfYYxm5eK", "proofs": [ "9RAV7me9v8Vfy8PMqUuLmn9E2C3GUjHfGGkAqoJobfGUnxF7SZ5TVyR6eJP5E8vmcKcQvGefqAuWez3DnzPtpF2" ], "script": "base64:BgIyCAISBAoCGBgSBAoCGBgSAwoBCBIDCgEIEgQKAggIEgUKAwIIARIFCgMICAgSBAoCCAgHAA5jb2xsZWN0aW9uTmFtZQkBEUBleHRyTmF0aXZlKDEwNTMpAgUEdGhpcwIOY29sbGVjdGlvbk5hbWUABnN5bWJvbAkBEUBleHRyTmF0aXZlKDEwNTMpAgUEdGhpcwIGc3ltYm9sAAtkZXNjcmlwdGlvbgkBEUBleHRyTmF0aXZlKDEwNTMpAgUEdGhpcwILZGVzY3JpcHRpb24AC3RvdGFsQW1vdW50CQERQGV4dHJOYXRpdmUoMTA1MCkCBQR0aGlzAgt0b3RhbEFtb3VudAAIZEFwcEpzb24JAQdBZGRyZXNzAQkA2QQBAiMzTXJHYVpWUmhrbkVHZkhKMTl0dFVQTm5EUm9GcWNIaFZONwEMb25seUludGVybmFsAQZjYWxsZXIDCQAAAgUGY2FsbGVyBQR0aGlzBQR1bml0CQACAQIST25seSBpbnRlcm5hbCBjYWxsAQ10cmFuc2Zlck9yTm90AgJ0bwdhc3NldElkAwkAAAIFAnRvBQR0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sBQZzeW1ib2wJAMwIAgkBC1N0cmluZ0VudHJ5AgILZGVzY3JpcHRpb24FC2Rlc2NyaXB0aW9uCQDMCAIJAQxJbnRlZ2VyRW50cnkCAgt0b3RhbEFtb3VudAAABQNuaWwBaQEEbWludAICdG8IdG9rZW5VUkkJAQt2YWx1ZU9yRWxzZQIJAQxvbmx5SW50ZXJuYWwBCAUBaQZjYWxsZXIEB3Rva2VuSWQJAGQCBQt0b3RhbEFtb3VudAABBAdwcmVOYW1lCQCsAgIJAKwCAgUGc3ltYm9sAgEjCQCkAwEFB3Rva2VuSWQEBG5hbWUDCQBnAgAQCQCxAgEFB3ByZU5hbWUFB3ByZU5hbWUJAKQDAQUHdG9rZW5JZAQFYXNzZXQJAMMIBwUEbmFtZQkArAICCQCsAgICBnt1cmk6IgUIdG9rZW5VUkkCAiJ9AAEAAAcFBHVuaXQFBmhlaWdodAQHYXNzZXRJZAkAuAgBBQVhc3NldAQJdG9BZGRyZXNzCQEHQWRkcmVzcwEJANkEAQUCdG8ECHRyYW5zZmVyCQENdHJhbnNmZXJPck5vdAIFCXRvQWRkcmVzcwUHYXNzZXRJZAMJAAACBQh0cmFuc2ZlcgUIdHJhbnNmZXIJAMwIAgUFYXNzZXQJAMwIAgUIdHJhbnNmZXIJAMwIAgkBDEludGVnZXJFbnRyeQICC3RvdGFsQW1vdW50BQd0b2tlbklkCQDMCAIJAQtTdHJpbmdFbnRyeQIFBG5hbWUFCHRva2VuVVJJBQNuaWwJAAIBAiRTdHJpY3QgdmFsdWUgaXMgbm90IGVxdWFsIHRvIGl0c2VsZi4AAUL5yA==", "height": 2491551, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: EELprxkvTDR2igkzDf4FJxbJnhpn3YPm1voU2cFGVrps Next: Gcf3pTUDCBpcqsfq7Kv7F6P8JyVR612DM4xHUpawr1NX Diff:
OldNewDifferences
1919 func transferOrNot (to,assetId) = if ((to == this))
2020 then StringEntry("костыль", "костыль")
2121 else ScriptTransfer(to, 1, assetId)
22-
23-
24-func setUser (assetId,user,expires) = throw()
2522
2623
2724 @Callable(i)
7067
7168
7269 @Callable(i)
70+func setUser (assetId,user,expires) = valueOrElse(onlyInternal(i.caller), {
71+ let res = invoke(dAppJson, "makeJSON", [["user", "expires"], [user, expires]], nil)
72+ if ((res == res))
73+ then $Tuple2([StringEntry("userOf-assetId", {
74+ let @ = res
75+ if ($isInstanceOf(@, "String"))
76+ then @
77+ else throw(($getType(@) + " couldn't be cast to String"))
78+ })], res)
79+ else throw("Strict value is not equal to itself.")
80+ })
81+
82+
83+
84+@Callable(i)
7385 func init (collectionName,symbol,description) = valueOrElse(onlyInternal(i.caller), [StringEntry("collectionName", collectionName), StringEntry("symbol", symbol), StringEntry("description", description), IntegerEntry("totalAmount", 0)])
7486
7587
Full:
OldNewDifferences
11 {-# STDLIB_VERSION 6 #-}
22 {-# SCRIPT_TYPE ACCOUNT #-}
33 {-# CONTENT_TYPE DAPP #-}
44 let collectionName = getStringValue(this, "collectionName")
55
66 let symbol = getStringValue(this, "symbol")
77
88 let description = getStringValue(this, "description")
99
1010 let totalAmount = getIntegerValue(this, "totalAmount")
1111
1212 let dAppJson = Address(fromBase58String("3MrGaZVRhknEGfHJ19ttUPNnDRoFqcHhVN7"))
1313
1414 func onlyInternal (caller) = if ((caller == this))
1515 then unit
1616 else throw("Only internal call")
1717
1818
1919 func transferOrNot (to,assetId) = if ((to == this))
2020 then StringEntry("костыль", "костыль")
2121 else ScriptTransfer(to, 1, assetId)
22-
23-
24-func setUser (assetId,user,expires) = throw()
2522
2623
2724 @Callable(i)
2825 func makeJSONInternal (arrKeys,arrValues) = valueOrElse(onlyInternal(i.caller), {
2926 let res = invoke(dAppJson, "makeJSON", [arrKeys, arrValues], nil)
3027 if ((res == res))
3128 then $Tuple2(nil, res)
3229 else throw("Strict value is not equal to itself.")
3330 })
3431
3532
3633
3734 @Callable(i)
3835 func addToJSONInternal (arrKeys,arrValues) = valueOrElse(onlyInternal(i.caller), {
3936 let res = invoke(dAppJson, "addToJSON", [arrKeys, arrValues], nil)
4037 if ((res == res))
4138 then $Tuple2(nil, res)
4239 else throw("Strict value is not equal to itself.")
4340 })
4441
4542
4643
4744 @Callable(i)
4845 func readByJSONKeyInternal (key) = valueOrElse(onlyInternal(i.caller), {
4946 let res = invoke(dAppJson, "readByJSONKey", [key], nil)
5047 if ((res == res))
5148 then $Tuple2(nil, res)
5249 else throw("Strict value is not equal to itself.")
5350 })
5451
5552
5653
5754 @Callable(i)
5855 func deleteByJSONKeyInternal (key) = valueOrElse(onlyInternal(i.caller), {
5956 let res = invoke(dAppJson, "deleteByJSONKey", [key], nil)
6057 if ((res == res))
6158 then $Tuple2(nil, res)
6259 else throw("Strict value is not equal to itself.")
6360 })
6461
6562
6663
6764 @Callable(i)
6865 func storageJsonInternal (jsonKey,jsonString) = valueOrElse(onlyInternal(i.caller), [StringEntry(jsonKey, jsonString)])
6966
7067
7168
7269 @Callable(i)
70+func setUser (assetId,user,expires) = valueOrElse(onlyInternal(i.caller), {
71+ let res = invoke(dAppJson, "makeJSON", [["user", "expires"], [user, expires]], nil)
72+ if ((res == res))
73+ then $Tuple2([StringEntry("userOf-assetId", {
74+ let @ = res
75+ if ($isInstanceOf(@, "String"))
76+ then @
77+ else throw(($getType(@) + " couldn't be cast to String"))
78+ })], res)
79+ else throw("Strict value is not equal to itself.")
80+ })
81+
82+
83+
84+@Callable(i)
7385 func init (collectionName,symbol,description) = valueOrElse(onlyInternal(i.caller), [StringEntry("collectionName", collectionName), StringEntry("symbol", symbol), StringEntry("description", description), IntegerEntry("totalAmount", 0)])
7486
7587
7688
7789 @Callable(i)
7890 func mint (to,tokenURI) = valueOrElse(onlyInternal(i.caller), {
7991 let tokenId = (totalAmount + 1)
8092 let preName = ((symbol + "#") + toString(tokenId))
8193 let name = if ((16 >= size(preName)))
8294 then preName
8395 else toString(tokenId)
8496 let asset = Issue(name, (("{uri:\"" + tokenURI) + "\"}"), 1, 0, false, unit, height)
8597 let assetId = calculateAssetId(asset)
8698 let toAddress = Address(fromBase58String(to))
8799 let transfer = transferOrNot(toAddress, assetId)
88100 if ((transfer == transfer))
89101 then [asset, transfer, IntegerEntry("totalAmount", tokenId), StringEntry(name, tokenURI)]
90102 else throw("Strict value is not equal to itself.")
91103 })
92104
93105

github/deemru/w8io/169f3d6 
47.17 ms