tx · CqwSP65EPmYR7kZuZBUMdfj8S6JdDCF25UUajAYFgyuG 3Mytb3VCj8DZHoLi79gYgdBebhSzear4bcv: -0.00200000 Waves 2022.07.21 13:22 [2149397] smart account 3Mytb3VCj8DZHoLi79gYgdBebhSzear4bcv > SELF 0.00000000 Waves
{ "type": 13, "id": "CqwSP65EPmYR7kZuZBUMdfj8S6JdDCF25UUajAYFgyuG", "fee": 200000, "feeAssetId": null, "timestamp": 1658399024092, "version": 2, "chainId": 84, "sender": "3Mytb3VCj8DZHoLi79gYgdBebhSzear4bcv", "senderPublicKey": "8B7i8HQWLc9Wv2DgoTSyf8RT8xizHECxGY9kvtm5h8zY", "proofs": [ "3uHvEg5HoFnbvP6zMbyhYnp7KrCNY13rwZP5wgdd2S2VXPuasK3m7LuuiAKingqKc39yzhHdsfceoty2omLdBvXH" ], "script": "base64:AAIFAAAAAAAAAA0IAhIECgIICBIDCgEIAAAACAAAAAAKc2hpbnl3Z2dpZAEAAAAgiWnPAv+2urnUcZbXebiZdiawdNB3efRzbobw9HOfBiYAAAAAD3RyZWFzdXJ5QWRkcmVzcwEAAAAaAVRl+PAWCwTAWUJwGp5IjJf/ftwcYvLdu/0AAAAADm5hdGlvbnNBZGRyZXNzAQAAABoBVE2F6N70+ERrWRA7cF/Dt7llDlH1REZtoAAAAAASbWFya2V0cGxhY2VBZGRyZXNzAQAAABoBVB0huZPx/BjDpxtJcRZDllF066xULiW87wAAAAALYWRtaW5XYWxsZXQJAQAAABFAZXh0ck5hdGl2ZSgxMDYyKQAAAAECAAAAIzNNcE50aVBTUlNxNk5uYVFZazM4QmZXU3paY2dBWVR5clE5AQAAAAx0cnlHZXRTdHJpbmcAAAABAAAAA2tleQQAAAAHJG1hdGNoMAkABB0AAAACBQAAAAR0aGlzBQAAAANrZXkDCQAAAQAAAAIFAAAAByRtYXRjaDACAAAABlN0cmluZwQAAAABYgUAAAAHJG1hdGNoMAUAAAABYgIAAAAAAQAAAA10cnlHZXRJbnRlZ2VyAA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dXJlS2V5BAAAAAVvd25lZAkBAAAADHRyeUdldFN0cmluZwAAAAEJAAEsAAAAAgUAAAALdHJlYXN1cmVLZXkCAAAAB19SZWRlZW0DCQEAAAACIT0AAAACBQAAAAVvd25lZAkABCUAAAABCAUAAAABaQAAAAZjYWxsZXIJAAACAAAAAQIAAAAmVGhpcyB0cmVhc3VyZSBoYXMgYWxyZWFkeSBiZWVuIGNsYWltZWQEAAAAC3RyZWFzdXJlVmFsCQEAAAANdHJ5R2V0SW50ZWdlcgAAAAEFAAAAC3RyZWFzdXJlS2V5CQAETAAAAAIJAQAAAA5TY3JpcHRUcmFuc2ZlcgAAAAMIBQAAAAFpAAAABmNhbGxlcgUAAAALdHJlYXN1cmVWYWwFAAAACnNoaW55d2dnaWQJAARMAAAAAgkBAAAAC0RlbGV0ZUVudHJ5AAAAAQkAASwAAAACBQAAAAt0cmVhc3VyZUtleQIAAAAHX1JlZGVlbQkABEwAAAACCQEAAAALRGVsZXRlRW50cnkAAAABBQAAAAt0cmVhc3VyZUtleQUAAAADbmlsAAAAAIts8FA=", "height": 2149397, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: HnhvqCntVaxnZfH4gUhv7bCwWZqqCQtioVwRJxX4wr7W Next: none Diff:
Old | New | Differences | |
---|---|---|---|
44 | 44 | else { | |
45 | 45 | let owned = tryGetString((treasureKey + "_Redeem")) | |
46 | 46 | if ((owned != "")) | |
47 | - | then throw("This treasure has been | |
47 | + | then throw("This treasure has been assigned to another player") | |
48 | 48 | else [StringEntry((treasureKey + "_Redeem"), toAddr)] | |
49 | 49 | } | |
50 | 50 | ||
54 | 54 | func redeemTreasure (treasureKey) = { | |
55 | 55 | let owned = tryGetString((treasureKey + "_Redeem")) | |
56 | 56 | if ((owned != toString(i.caller))) | |
57 | - | then throw("This treasure has been claimed") | |
57 | + | then throw("This treasure has already been claimed") | |
58 | 58 | else { | |
59 | 59 | let treasureVal = tryGetInteger(treasureKey) | |
60 | 60 | [ScriptTransfer(i.caller, treasureVal, shinywggid), DeleteEntry((treasureKey + "_Redeem")), DeleteEntry(treasureKey)] |
Old | New | Differences | |
---|---|---|---|
1 | 1 | {-# STDLIB_VERSION 5 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | 4 | let shinywggid = base58'AFQS5E4ELtxex3iANtWtUU2V2oWJZSo8VVnK8z3VFmqf' | |
5 | 5 | ||
6 | 6 | let treasuryAddress = base58'3MyDGEoKp1gF4LSRknk9vSuDEyrwuYXcQEQ' | |
7 | 7 | ||
8 | 8 | let nationsAddress = base58'3MvyzDtzWWV5MZ1GP8JfQhhQqiGU4Nbifdy' | |
9 | 9 | ||
10 | 10 | let marketplaceAddress = base58'3Mra7mjPipcQd5sJaRmXK8xgS4scb8gPF4A' | |
11 | 11 | ||
12 | 12 | let adminWallet = addressFromStringValue("3MpNtiPSRSq6NnaQYk38BfWSzZcgAYTyrQ9") | |
13 | 13 | ||
14 | 14 | func tryGetString (key) = match getString(this, key) { | |
15 | 15 | case b: String => | |
16 | 16 | b | |
17 | 17 | case _ => | |
18 | 18 | "" | |
19 | 19 | } | |
20 | 20 | ||
21 | 21 | ||
22 | 22 | func tryGetInteger (key) = match getInteger(this, key) { | |
23 | 23 | case b: Int => | |
24 | 24 | b | |
25 | 25 | case _ => | |
26 | 26 | 0 | |
27 | 27 | } | |
28 | 28 | ||
29 | 29 | ||
30 | 30 | func checkAdmin (caller) = if (if (if (if ((caller == adminWallet)) | |
31 | 31 | then true | |
32 | 32 | else (caller == this)) | |
33 | 33 | then true | |
34 | 34 | else (caller.bytes == nationsAddress)) | |
35 | 35 | then true | |
36 | 36 | else (caller.bytes == treasuryAddress)) | |
37 | 37 | then true | |
38 | 38 | else (caller.bytes == marketplaceAddress) | |
39 | 39 | ||
40 | 40 | ||
41 | 41 | @Callable(i) | |
42 | 42 | func discoverTreasure (treasureKey,toAddr) = if (!(checkAdmin(i.caller))) | |
43 | 43 | then throw("You are not authorized to perform this operation") | |
44 | 44 | else { | |
45 | 45 | let owned = tryGetString((treasureKey + "_Redeem")) | |
46 | 46 | if ((owned != "")) | |
47 | - | then throw("This treasure has been | |
47 | + | then throw("This treasure has been assigned to another player") | |
48 | 48 | else [StringEntry((treasureKey + "_Redeem"), toAddr)] | |
49 | 49 | } | |
50 | 50 | ||
51 | 51 | ||
52 | 52 | ||
53 | 53 | @Callable(i) | |
54 | 54 | func redeemTreasure (treasureKey) = { | |
55 | 55 | let owned = tryGetString((treasureKey + "_Redeem")) | |
56 | 56 | if ((owned != toString(i.caller))) | |
57 | - | then throw("This treasure has been claimed") | |
57 | + | then throw("This treasure has already been claimed") | |
58 | 58 | else { | |
59 | 59 | let treasureVal = tryGetInteger(treasureKey) | |
60 | 60 | [ScriptTransfer(i.caller, treasureVal, shinywggid), DeleteEntry((treasureKey + "_Redeem")), DeleteEntry(treasureKey)] | |
61 | 61 | } | |
62 | 62 | } | |
63 | 63 | ||
64 | 64 |
github/deemru/w8io/026f985 28.09 ms ◑