tx · 7GGXH3syx5ANdEU857ZrWNcyTJzF3Viqdk7vEPpxNnk9

3N7NSGttZdtSoZanmmvFbtbKy81aH3qmCr1:  -0.01000000 Waves

2022.10.26 16:27 [2289448] smart account 3N7NSGttZdtSoZanmmvFbtbKy81aH3qmCr1 > SELF 0.00000000 Waves

{ "type": 13, "id": "7GGXH3syx5ANdEU857ZrWNcyTJzF3Viqdk7vEPpxNnk9", "fee": 1000000, "feeAssetId": null, "timestamp": 1666790906566, "version": 2, "chainId": 84, "sender": "3N7NSGttZdtSoZanmmvFbtbKy81aH3qmCr1", "senderPublicKey": "DnHWpL2JmrKWWVJgbwq4czBSA7NpfK3MyfsKzKLJbcro", "proofs": [ "4xt7G5gexBjfXcXLan3V2fMEo3b3EcVQe6e82ej36y5jKZFzN5y8GnoAZF2eS5Vy2wiDc36ZWDiVEv3vyYmngqCe" ], "script": "base64:AAIFAAAAAAAAABYIAhIFCgMICAESBAoCCAISAwoBCBIAAAAADwEAAAAQZ2V0U3RyaW5nT3JUaHJvdwAAAAIAAAAHYWRkcmVzcwAAAANrZXkJAQAAABN2YWx1ZU9yRXJyb3JNZXNzYWdlAAAAAgkABB0AAAACBQAAAAdhZGRyZXNzBQAAAANrZXkJAAEsAAAAAgkAASwAAAACCQABLAAAAAICAAAADENhbid0IHJlYWQgJwUAAAADa2V5AgAAAA0nIGF0IGFkZHJlc3MgCQAEJQAAAAEFAAAAB2FkZHJlc3MBAAAAEWdldEludGVnZXJPclRocm93AAAAAgAAAAdhZGRyZXNzAAAAA2tleQkBAAAAE3ZhbHVlT3JFcnJvck1lc3NhZ2UAAAACCQAEGgAAAAIFAAAAB2FkZHJlc3MFAAAAA2tleQkAASwAAAACCQABLAAAAAIJAAEsAAAAAgIAAAAMQ2FuJ3QgcmVhZCAnBQAAAANrZXkCAAAADScgYXQgYWRkcmVzcyAJAAQlAAAAAQUAAAAHYWRkcmVzcwEAAAATcGFyc2VBZGRyZXNzT3JUaHJvdwAAAAEAAAAMbWF5YmV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TWVzc2FnZQAAAAIJAAPsAAAAAQUAAAAHYXNzZXRJZAIAAAANSW52YWxpZCBhc3NldAMJAQAAAAIhPQAAAAIIBQAAAANwbXQAAAAGYW1vdW50AAAAAAAAAAABCQAAAgAAAAECAAAAGUluY29ycmVjdCBhbW91bnQgb2YgYXNzZXQDCQEAAAAFaXNORlQAAAABBQAAAAVhc3NldAkAAAIAAAABAgAAABtBc3NldCBpbiBwYXltZW50IGlzIG5vdCBORlQEAAAACHRva2VuU3RyCQEAAAAQZ2V0U3RyaW5nT3JUaHJvdwAAAAIFAAAACXJlZ2lzdHJhcgkBAAAADmtleV9OYW1lX3Rva2VuAAAAAQgFAAAABWFzc2V0AAAABG5hbWUEAAAABXRva2VuCQABmwAAAAEFAAAACHRva2VuU3RyBAAAAAh0cmFuc2ZlcgkBAAAADG1ha2VUcmFuc2ZlcgAAAAIFAAAABmNhbGxlcgUAAAAFdG9rZW4DCQAAAAAAAAIFAAAACHRyYW5zZmVyBQAAAAh0cmFuc2ZlcgQAAAAMcmVnaXN0cmF0aW9uCQAD/AAAAAQFAAAACXJlZ2lzdHJhcgIAAAAHcmVjbGFpbQkABEwAAAACCAUAAAAFYXNzZXQAAAAEbmFtZQUAAAADbmlsBQAAAANuaWwDCQAAAAAAAAIFAAAADHJlZ2lzdHJhdGlvbgUAAAAMcmVnaXN0cmF0aW9uBQAAAANuaWwJAAACAAAAAQIAAAAkU3RyaWN0IHZhbHVlIGlzIG5vdCBlcXVhbCB0byBpdHNlbGYuCQAAAgAAAAECAAAAJFN0cmljdCB2YWx1ZSBpcyBub3QgZXF1YWwgdG8gaXRzZWxmLgAAAAADCfXd", "height": 2289448, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: 9k6Jx3Mi3YAZojXPtdhRdHGmRFrsjBcVZBo9H9rH8emE Next: HFz1cVTuPoARbUvRmhmZuSxWvz5e6xCWwY6GSwUC4qkz Diff:
OldNewDifferences
1010 func parseAddressOrThrow (maybeAddress) = valueOrErrorMessage(addressFromString(maybeAddress), (("Can't parse address from '" + maybeAddress) + "'"))
1111
1212
13-func key_reissued (name) = ("Reissued_" + name)
13+func key_entity (name,pk,property) = ((((name + "_") + pk) + "_") + property)
14+
15+
16+func key_Name_token (name) = key_entity("Name", name, "token")
1417
1518
1619 let key_meedusAddress = "meedusAddress"
2932
3033 let meedusInitTimestamp = getIntegerOrThrow(this, key_meedusInitTimestamp)
3134
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+
3252 @Callable(inv)
3353 func init (meedusAddress,registrarAddress,meedusInitTimestamp) = [StringEntry(key_meedusAddress, meedusAddress), StringEntry(key_registrarAddress, registrarAddress), IntegerEntry(key_meedusInitTimestamp, meedusInitTimestamp)]
54+
55+
56+
57+@Callable(inv)
58+func transfer (addressStr,asset) = {
59+ let address = parseAddressOrThrow(addressStr)
60+ $Tuple2([ScriptTransfer(address, 1, asset)], true)
61+ }
62+
63+
64+
65+@Callable(inv)
66+func reserve (name) = {
67+ let caller = inv.caller
68+ let callerStr = toString(caller)
69+ if ((this != caller))
70+ then throw("Only self call are allowed")
71+ else {
72+ let reservation = invoke(registrar, "register", [name, callerStr, meedusInitTimestamp], nil)
73+ if ((reservation == reservation))
74+ then nil
75+ else throw("Strict value is not equal to itself.")
76+ }
77+ }
3478
3579
3680
4387 let asset = valueOrErrorMessage(assetInfo(assetId), "Invalid asset")
4488 if ((pmt.amount != 1))
4589 then throw("Incorrect amount of asset")
46- else if (if (if (if ((asset.quantity != 1))
47- then true
48- else (asset.issuer != meedus))
49- then true
50- else (asset.decimals != 0))
51- then true
52- else (asset.reissuable == true))
90+ else if (isNFT(asset))
5391 then throw("Asset in payment is not NFT")
5492 else {
55- let registration = invoke(registrar, "register", [asset.name, callerStr, meedusInitTimestamp], nil)
56- if ((registration == registration))
57- then nil
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+ }
58103 else throw("Strict value is not equal to itself.")
59104 }
60- }
61-
62-
63-
64-@Callable(inv)
65-func reserve (name) = {
66- let caller = inv.caller
67- if ((this != caller))
68- then throw("Only self call are allowed")
69- else {
70- let reservation = invoke(registrar, "addReserve", [name], nil)
71- if ((reservation == reservation))
72- then nil
73- else throw("Strict value is not equal to itself.")
74- }
75105 }
76106
77107
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
13-func key_reissued (name) = ("Reissued_" + name)
13+func key_entity (name,pk,property) = ((((name + "_") + pk) + "_") + property)
14+
15+
16+func key_Name_token (name) = key_entity("Name", name, "token")
1417
1518
1619 let key_meedusAddress = "meedusAddress"
1720
1821 let key_registrarAddress = "registrarAddress"
1922
2023 let key_meedusInitTimestamp = "meedusInitTimestamp"
2124
2225 let meedusAddress = getStringOrThrow(this, key_meedusAddress)
2326
2427 let meedus = parseAddressOrThrow(meedusAddress)
2528
2629 let registrarAddress = getStringOrThrow(this, key_registrarAddress)
2730
2831 let registrar = parseAddressOrThrow(registrarAddress)
2932
3033 let meedusInitTimestamp = getIntegerOrThrow(this, key_meedusInitTimestamp)
3134
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+
3252 @Callable(inv)
3353 func init (meedusAddress,registrarAddress,meedusInitTimestamp) = [StringEntry(key_meedusAddress, meedusAddress), StringEntry(key_registrarAddress, registrarAddress), IntegerEntry(key_meedusInitTimestamp, meedusInitTimestamp)]
54+
55+
56+
57+@Callable(inv)
58+func transfer (addressStr,asset) = {
59+ let address = parseAddressOrThrow(addressStr)
60+ $Tuple2([ScriptTransfer(address, 1, asset)], true)
61+ }
62+
63+
64+
65+@Callable(inv)
66+func reserve (name) = {
67+ let caller = inv.caller
68+ let callerStr = toString(caller)
69+ if ((this != caller))
70+ then throw("Only self call are allowed")
71+ else {
72+ let reservation = invoke(registrar, "register", [name, callerStr, meedusInitTimestamp], nil)
73+ if ((reservation == reservation))
74+ then nil
75+ else throw("Strict value is not equal to itself.")
76+ }
77+ }
3478
3579
3680
3781 @Callable(inv)
3882 func exchange () = {
3983 let caller = inv.caller
4084 let callerStr = toString(caller)
4185 let pmt = inv.payments[0]
4286 let assetId = valueOrErrorMessage(pmt.assetId, "Asset cannot be WAVES")
4387 let asset = valueOrErrorMessage(assetInfo(assetId), "Invalid asset")
4488 if ((pmt.amount != 1))
4589 then throw("Incorrect amount of asset")
46- else if (if (if (if ((asset.quantity != 1))
47- then true
48- else (asset.issuer != meedus))
49- then true
50- else (asset.decimals != 0))
51- then true
52- else (asset.reissuable == true))
90+ else if (isNFT(asset))
5391 then throw("Asset in payment is not NFT")
5492 else {
55- let registration = invoke(registrar, "register", [asset.name, callerStr, meedusInitTimestamp], nil)
56- if ((registration == registration))
57- then nil
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+ }
58103 else throw("Strict value is not equal to itself.")
59104 }
60- }
61-
62-
63-
64-@Callable(inv)
65-func reserve (name) = {
66- let caller = inv.caller
67- if ((this != caller))
68- then throw("Only self call are allowed")
69- else {
70- let reservation = invoke(registrar, "addReserve", [name], nil)
71- if ((reservation == reservation))
72- then nil
73- else throw("Strict value is not equal to itself.")
74- }
75105 }
76106
77107

github/deemru/w8io/026f985 
51.05 ms