tx · HFz1cVTuPoARbUvRmhmZuSxWvz5e6xCWwY6GSwUC4qkz

3N7NSGttZdtSoZanmmvFbtbKy81aH3qmCr1:  -0.01000000 Waves

2022.10.27 08:33 [2290419] smart account 3N7NSGttZdtSoZanmmvFbtbKy81aH3qmCr1 > SELF 0.00000000 Waves

{ "type": 13, "id": "HFz1cVTuPoARbUvRmhmZuSxWvz5e6xCWwY6GSwUC4qkz", "fee": 1000000, "feeAssetId": null, "timestamp": 1666848780811, "version": 2, "chainId": 84, "sender": "3N7NSGttZdtSoZanmmvFbtbKy81aH3qmCr1", "senderPublicKey": "DnHWpL2JmrKWWVJgbwq4czBSA7NpfK3MyfsKzKLJbcro", "proofs": [ "2K9XuSf6eCN2NEJGMroNad2YshJdGdq3uNpH7n6ZvEX6iL5z8ieXMStfdS9f4dH7EFawmdUkNNqUjrbmUqknyQ6y" ], "script": "base64:AAIFAAAAAAAAABYIAhIFCgMICAESBAoCCAISAwoBCBIAAAAADQEAAAAQZ2V0U3RyaW5nT3JUaHJvdwAAAAIAAAAHYWRkcmVzcwAAAANrZXkJAQAAABN2YWx1ZU9yRXJyb3JNZXNzYWdlAAAAAgkABB0AAAACBQAAAAdhZGRyZXNzBQAAAANrZXkJAAEsAAAAAgkAASwAAAACCQABLAAAAAICAAAADENhbid0IHJlYWQgJwUAAAADa2V5AgAAAA0nIGF0IGFkZHJlc3MgCQAEJQAAAAEFAAAAB2FkZHJlc3MBAAAAEWdldEludGVnZXJPclRocm93AAAAAgAAAAdhZGRyZXNzAAAAA2tleQkBAAAAE3ZhbHVlT3JFcnJvck1lc3NhZ2UAAAACCQAEGgAAAAIFAAAAB2FkZHJlc3MFAAAAA2tleQkAASwAAAACCQABLAAAAAIJAAEsAAAAAgIAAAAMQ2FuJ3QgcmVhZCAnBQAAAANrZXkCAAAADScgYXQgYWRkcmVzcyAJAAQlAAAAAQUAAAAHYWRkcmVzcwEAAAATcGFyc2VBZGRyZXNzT3JUaHJvdwAAAAEAAAAMbWF5Ym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ZQQAAAAFdG9rZW4JAAGbAAAAAQUAAAAIdG9rZW5TdHIEAAAACHRyYW5zZmVyCQAD/AAAAAQFAAAABHRoaXMCAAAACHRyYW5zZmVyCQAETAAAAAIFAAAACWNhbGxlclN0cgkABEwAAAACBQAAAAVhc3NldAUAAAADbmlsBQAAAANuaWwDCQAAAAAAAAIFAAAACHRyYW5zZmVyBQAAAAh0cmFuc2ZlcgQAAAAMcmVnaXN0cmF0aW9uCQAD/AAAAAQFAAAACXJlZ2lzdHJhcgIAAAAHcmVjbGFpbQkABEwAAAACCAUAAAAFYXNzZXQAAAAEbmFtZQUAAAADbmlsBQAAAANuaWwDCQAAAAAAAAIFAAAADHJlZ2lzdHJhdGlvbgUAAAAMcmVnaXN0cmF0aW9uBQAAAANuaWwJAAACAAAAAQIAAAAkU3RyaWN0IHZhbHVlIGlzIG5vdCBlcXVhbCB0byBpdHNlbGYuCQAAAgAAAAECAAAAJFN0cmljdCB2YWx1ZSBpcyBub3QgZXF1YWwgdG8gaXRzZWxmLgAAAADmEoHI", "height": 2290419, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: 7GGXH3syx5ANdEU857ZrWNcyTJzF3Viqdk7vEPpxNnk9 Next: HLZ34NGRBEP2Wt9KR1fyCNrhBHU7V3NoZ6PcQdNYPDuf Diff:
OldNewDifferences
3232
3333 let meedusInitTimestamp = getIntegerOrThrow(this, key_meedusInitTimestamp)
3434
35-func isNFT (asset) = if (if (if ((asset.quantity != 1))
36- then true
37- else (asset.issuer != meedus))
38- then true
39- else (asset.decimals != 0))
40- then true
41- else (asset.reissuable != false)
42-
43-
44-func makeTransfer (address,asset) = match invoke(this, "transfer", [address, asset], nil) {
45- case b: Boolean =>
46- b
47- case _ =>
48- throw("Invalid result for transfer")
49-}
50-
51-
5235 @Callable(inv)
5336 func init (meedusAddress,registrarAddress,meedusInitTimestamp) = [StringEntry(key_meedusAddress, meedusAddress), StringEntry(key_registrarAddress, registrarAddress), IntegerEntry(key_meedusInitTimestamp, meedusInitTimestamp)]
5437
5740 @Callable(inv)
5841 func transfer (addressStr,asset) = {
5942 let address = parseAddressOrThrow(addressStr)
60- $Tuple2([ScriptTransfer(address, 1, asset)], true)
43+[ScriptTransfer(address, 1, asset)]
6144 }
6245
6346
8568 let pmt = inv.payments[0]
8669 let assetId = valueOrErrorMessage(pmt.assetId, "Asset cannot be WAVES")
8770 let asset = valueOrErrorMessage(assetInfo(assetId), "Invalid asset")
88- if ((pmt.amount != 1))
89- then throw("Incorrect amount of asset")
90- else if (isNFT(asset))
91- then throw("Asset in payment is not NFT")
92- else {
93- let tokenStr = getStringOrThrow(registrar, key_Name_token(asset.name))
94- let token = toBytes(tokenStr)
95- let transfer = makeTransfer(caller, token)
96- if ((transfer == transfer))
97- then {
98- let registration = invoke(registrar, "reclaim", [asset.name], nil)
99- if ((registration == registration))
100- then nil
101- else throw("Strict value is not equal to itself.")
102- }
103- else throw("Strict value is not equal to itself.")
104- }
71+ let isMeedusNFT = if (if (if ((asset.issuer == meedus))
72+ then (asset.quantity == 1)
73+ else false)
74+ then (asset.decimals == 0)
75+ else false)
76+ then (asset.reissuable == false)
77+ else false
78+ if (if ((pmt.amount != 1))
79+ then true
80+ else !(isMeedusNFT))
81+ then throw("Payment should contain Meedus NFT")
82+ else {
83+ let tokenStr = getStringOrThrow(registrar, key_Name_token(asset.name))
84+ let token = toBytes(tokenStr)
85+ let transfer = invoke(this, "transfer", [callerStr, asset], nil)
86+ if ((transfer == transfer))
87+ then {
88+ let registration = invoke(registrar, "reclaim", [asset.name], nil)
89+ if ((registration == registration))
90+ then nil
91+ else throw("Strict value is not equal to itself.")
92+ }
93+ else throw("Strict value is not equal to itself.")
94+ }
10595 }
10696
10797
Full:
OldNewDifferences
11 {-# STDLIB_VERSION 5 #-}
22 {-# SCRIPT_TYPE ACCOUNT #-}
33 {-# CONTENT_TYPE DAPP #-}
44 func getStringOrThrow (address,key) = valueOrErrorMessage(getString(address, key), ((("Can't read '" + key) + "' at address ") + toString(address)))
55
66
77 func getIntegerOrThrow (address,key) = valueOrErrorMessage(getInteger(address, key), ((("Can't read '" + key) + "' at address ") + toString(address)))
88
99
1010 func parseAddressOrThrow (maybeAddress) = valueOrErrorMessage(addressFromString(maybeAddress), (("Can't parse address from '" + maybeAddress) + "'"))
1111
1212
1313 func key_entity (name,pk,property) = ((((name + "_") + pk) + "_") + property)
1414
1515
1616 func key_Name_token (name) = key_entity("Name", name, "token")
1717
1818
1919 let key_meedusAddress = "meedusAddress"
2020
2121 let key_registrarAddress = "registrarAddress"
2222
2323 let key_meedusInitTimestamp = "meedusInitTimestamp"
2424
2525 let meedusAddress = getStringOrThrow(this, key_meedusAddress)
2626
2727 let meedus = parseAddressOrThrow(meedusAddress)
2828
2929 let registrarAddress = getStringOrThrow(this, key_registrarAddress)
3030
3131 let registrar = parseAddressOrThrow(registrarAddress)
3232
3333 let meedusInitTimestamp = getIntegerOrThrow(this, key_meedusInitTimestamp)
3434
35-func isNFT (asset) = if (if (if ((asset.quantity != 1))
36- then true
37- else (asset.issuer != meedus))
38- then true
39- else (asset.decimals != 0))
40- then true
41- else (asset.reissuable != false)
42-
43-
44-func makeTransfer (address,asset) = match invoke(this, "transfer", [address, asset], nil) {
45- case b: Boolean =>
46- b
47- case _ =>
48- throw("Invalid result for transfer")
49-}
50-
51-
5235 @Callable(inv)
5336 func init (meedusAddress,registrarAddress,meedusInitTimestamp) = [StringEntry(key_meedusAddress, meedusAddress), StringEntry(key_registrarAddress, registrarAddress), IntegerEntry(key_meedusInitTimestamp, meedusInitTimestamp)]
5437
5538
5639
5740 @Callable(inv)
5841 func transfer (addressStr,asset) = {
5942 let address = parseAddressOrThrow(addressStr)
60- $Tuple2([ScriptTransfer(address, 1, asset)], true)
43+[ScriptTransfer(address, 1, asset)]
6144 }
6245
6346
6447
6548 @Callable(inv)
6649 func reserve (name) = {
6750 let caller = inv.caller
6851 let callerStr = toString(caller)
6952 if ((this != caller))
7053 then throw("Only self call are allowed")
7154 else {
7255 let reservation = invoke(registrar, "register", [name, callerStr, meedusInitTimestamp], nil)
7356 if ((reservation == reservation))
7457 then nil
7558 else throw("Strict value is not equal to itself.")
7659 }
7760 }
7861
7962
8063
8164 @Callable(inv)
8265 func exchange () = {
8366 let caller = inv.caller
8467 let callerStr = toString(caller)
8568 let pmt = inv.payments[0]
8669 let assetId = valueOrErrorMessage(pmt.assetId, "Asset cannot be WAVES")
8770 let asset = valueOrErrorMessage(assetInfo(assetId), "Invalid asset")
88- if ((pmt.amount != 1))
89- then throw("Incorrect amount of asset")
90- else if (isNFT(asset))
91- then throw("Asset in payment is not NFT")
92- else {
93- let tokenStr = getStringOrThrow(registrar, key_Name_token(asset.name))
94- let token = toBytes(tokenStr)
95- let transfer = makeTransfer(caller, token)
96- if ((transfer == transfer))
97- then {
98- let registration = invoke(registrar, "reclaim", [asset.name], nil)
99- if ((registration == registration))
100- then nil
101- else throw("Strict value is not equal to itself.")
102- }
103- else throw("Strict value is not equal to itself.")
104- }
71+ let isMeedusNFT = if (if (if ((asset.issuer == meedus))
72+ then (asset.quantity == 1)
73+ else false)
74+ then (asset.decimals == 0)
75+ else false)
76+ then (asset.reissuable == false)
77+ else false
78+ if (if ((pmt.amount != 1))
79+ then true
80+ else !(isMeedusNFT))
81+ then throw("Payment should contain Meedus NFT")
82+ else {
83+ let tokenStr = getStringOrThrow(registrar, key_Name_token(asset.name))
84+ let token = toBytes(tokenStr)
85+ let transfer = invoke(this, "transfer", [callerStr, asset], nil)
86+ if ((transfer == transfer))
87+ then {
88+ let registration = invoke(registrar, "reclaim", [asset.name], nil)
89+ if ((registration == registration))
90+ then nil
91+ else throw("Strict value is not equal to itself.")
92+ }
93+ else throw("Strict value is not equal to itself.")
94+ }
10595 }
10696
10797

github/deemru/w8io/026f985 
33.11 ms