tx · 9k6Jx3Mi3YAZojXPtdhRdHGmRFrsjBcVZBo9H9rH8emE 3N7NSGttZdtSoZanmmvFbtbKy81aH3qmCr1: -0.01000000 Waves 2022.10.25 15:40 [2287920] smart account 3N7NSGttZdtSoZanmmvFbtbKy81aH3qmCr1 > SELF 0.00000000 Waves
{ "type": 13, "id": "9k6Jx3Mi3YAZojXPtdhRdHGmRFrsjBcVZBo9H9rH8emE", "fee": 1000000, "feeAssetId": null, "timestamp": 1666701661347, "version": 2, "chainId": 84, "sender": "3N7NSGttZdtSoZanmmvFbtbKy81aH3qmCr1", "senderPublicKey": "DnHWpL2JmrKWWVJgbwq4czBSA7NpfK3MyfsKzKLJbcro", "proofs": [ "4ZPrf5ZPYTcyHJPj3V7YLQC47rJCLmXTTN9mCVwmC5M3KTEnhzMf6BkAgmdWx4xJNhZkwLZmF7UnGKGnkzvRJozQ" ], "script": "base64:AAIFAAAAAAAAABAIAhIFCgMICAESABIDCgEIAAAADAEAAAAQZ2V0U3RyaW5nT3JUaHJvdwAAAAIAAAAHYWRkcmVzcwAAAANrZXkJAQAAABN2YWx1ZU9yRXJyb3JNZXNzYWdlAAAAAgkABB0AAAACBQAAAAdhZGRyZXNzBQAAAANrZXkJAAEsAAAAAgkAASwAAAACCQABLAAAAAICAAAADENhbid0IHJlYWQgJwUAAAADa2V5AgAAAA0nIGF0IGFkZHJlc3MgCQAEJQAAAAEFAAAAB2FkZHJlc3MBAAAAEWdldEludGVnZXJPclRocm93AAAAAgAAAAdhZGRyZXNzAAAAA2tleQkBAAAAE3ZhbHVlT3JFcnJvck1lc3NhZ2UAAAACCQAEGgAAAAIFAAAAB2FkZHJlc3MFAAAAA2tleQkAASwAAAACCQABLAAAAAIJAAEsAAAAAgIAAAAMQ2FuJ3QgcmVhZCAnBQAAAANrZXkCAAAADScgYXQgYWRkcmVzcyAJAAQlAAAAAQUAAAAHYWRkcmVzcwEAAAATcGFyc2VBZGRyZXNzT3JUaHJvdwAAAAEAAAAMbWF5YmV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lvbgkAA/wAAAAEBQAAAAlyZWdpc3RyYXICAAAACHJlZ2lzdGVyCQAETAAAAAIIBQAAAAVhc3NldAAAAARuYW1lCQAETAAAAAIFAAAACWNhbGxlclN0cgkABEwAAAACBQAAABNtZWVkdXNJbml0VGltZXN0YW1wBQAAAANuaWwFAAAAA25pbAMJAAAAAAAAAgUAAAAMcmVnaXN0cmF0aW9uBQAAAAxyZWdpc3RyYXRpb24FAAAAA25pbAkAAAIAAAABAgAAACRTdHJpY3QgdmFsdWUgaXMgbm90IGVxdWFsIHRvIGl0c2VsZi4AAAADaW52AQAAAAdyZXNlcnZlAAAAAQAAAARuYW1lBAAAAAZjYWxsZXIIBQAAAANpbnYAAAAGY2FsbGVyAwkBAAAAAiE9AAAAAgUAAAAEdGhpcwUAAAAGY2FsbGVyCQAAAgAAAAECAAAAGk9ubHkgc2VsZiBjYWxsIGFyZSBhbGxvd2VkBAAAAAtyZXNlcnZhdGlvbgkAA/wAAAAEBQAAAAlyZWdpc3RyYXICAAAACmFkZFJlc2VydmUJAARMAAAAAgUAAAAEbmFtZQUAAAADbmlsBQAAAANuaWwDCQAAAAAAAAIFAAAAC3Jlc2VydmF0aW9uBQAAAAtyZXNlcnZhdGlvbgUAAAADbmlsCQAAAgAAAAECAAAAJFN0cmljdCB2YWx1ZSBpcyBub3QgZXF1YWwgdG8gaXRzZWxmLgAAAADMdMHY", "height": 2287920, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: none Next: 7GGXH3syx5ANdEU857ZrWNcyTJzF3Viqdk7vEPpxNnk9 Full:
Old | New | Differences | |
---|---|---|---|
1 | - | # no script | |
1 | + | {-# STDLIB_VERSION 5 #-} | |
2 | + | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | + | {-# CONTENT_TYPE DAPP #-} | |
4 | + | func getStringOrThrow (address,key) = valueOrErrorMessage(getString(address, key), ((("Can't read '" + key) + "' at address ") + toString(address))) | |
5 | + | ||
6 | + | ||
7 | + | func getIntegerOrThrow (address,key) = valueOrErrorMessage(getInteger(address, key), ((("Can't read '" + key) + "' at address ") + toString(address))) | |
8 | + | ||
9 | + | ||
10 | + | func parseAddressOrThrow (maybeAddress) = valueOrErrorMessage(addressFromString(maybeAddress), (("Can't parse address from '" + maybeAddress) + "'")) | |
11 | + | ||
12 | + | ||
13 | + | func key_reissued (name) = ("Reissued_" + name) | |
14 | + | ||
15 | + | ||
16 | + | let key_meedusAddress = "meedusAddress" | |
17 | + | ||
18 | + | let key_registrarAddress = "registrarAddress" | |
19 | + | ||
20 | + | let key_meedusInitTimestamp = "meedusInitTimestamp" | |
21 | + | ||
22 | + | let meedusAddress = getStringOrThrow(this, key_meedusAddress) | |
23 | + | ||
24 | + | let meedus = parseAddressOrThrow(meedusAddress) | |
25 | + | ||
26 | + | let registrarAddress = getStringOrThrow(this, key_registrarAddress) | |
27 | + | ||
28 | + | let registrar = parseAddressOrThrow(registrarAddress) | |
29 | + | ||
30 | + | let meedusInitTimestamp = getIntegerOrThrow(this, key_meedusInitTimestamp) | |
31 | + | ||
32 | + | @Callable(inv) | |
33 | + | func init (meedusAddress,registrarAddress,meedusInitTimestamp) = [StringEntry(key_meedusAddress, meedusAddress), StringEntry(key_registrarAddress, registrarAddress), IntegerEntry(key_meedusInitTimestamp, meedusInitTimestamp)] | |
34 | + | ||
35 | + | ||
36 | + | ||
37 | + | @Callable(inv) | |
38 | + | func exchange () = { | |
39 | + | let caller = inv.caller | |
40 | + | let callerStr = toString(caller) | |
41 | + | let pmt = inv.payments[0] | |
42 | + | let assetId = valueOrErrorMessage(pmt.assetId, "Asset cannot be WAVES") | |
43 | + | let asset = valueOrErrorMessage(assetInfo(assetId), "Invalid asset") | |
44 | + | if ((pmt.amount != 1)) | |
45 | + | 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)) | |
53 | + | then throw("Asset in payment is not NFT") | |
54 | + | else { | |
55 | + | let registration = invoke(registrar, "register", [asset.name, callerStr, meedusInitTimestamp], nil) | |
56 | + | if ((registration == registration)) | |
57 | + | then nil | |
58 | + | else throw("Strict value is not equal to itself.") | |
59 | + | } | |
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 | + | } | |
75 | + | } | |
76 | + | ||
77 | + |
github/deemru/w8io/026f985 21.17 ms ◑