tx · 5AA2EP2U25zA5GEJtYTZ2VLXnycinqfajZopfiQHW2rF 3Mytb3VCj8DZHoLi79gYgdBebhSzear4bcv: -0.00200000 Waves 2022.06.21 12:33 [2105978] smart account 3Mytb3VCj8DZHoLi79gYgdBebhSzear4bcv > SELF 0.00000000 Waves
{ "type": 13, "id": "5AA2EP2U25zA5GEJtYTZ2VLXnycinqfajZopfiQHW2rF", "fee": 200000, "feeAssetId": null, "timestamp": 1655804075960, "version": 2, "chainId": 84, "sender": "3Mytb3VCj8DZHoLi79gYgdBebhSzear4bcv", "senderPublicKey": "8B7i8HQWLc9Wv2DgoTSyf8RT8xizHECxGY9kvtm5h8zY", "proofs": [ "4GjMYUREWb5i4bJsrCBhybTz2jsHdx8Qp1V3eG4YFXrcv147ChKzkBt7iMKJoa2sX6b2y7cA5RJLCTxzsnQwrdi4" ], "script": "base64:AAIFAAAAAAAAAA0IAhIECgIICBIDCgEIAAAACAAAAAAKc2hpbnl3Z2dpZAEAAAAgiWnPAv+2urnUcZbXebiZdiawdNB3efRzbobw9HOfBiYAAAAAD3RyZWFzdXJ5QWRkcmVzcwEAAAAaAVRl+PAWCwTAWUJwGp5IjJf/ftwcYvLdu/0AAAAADm5hdGlvbnNBZGRyZXNzAQAAABoBVE2F6N70+ERrWRA7cF/Dt7llDlH1REZtoAAAAAASbWFya2V0cGxhY2VBZGRyZXNzAQAAABoBVB0huZPx/BjDpxtJcRZDllF066xULiW87wAAAAALYWRtaW5XYWxsZXQJAQAAABFAZXh0ck5hdGl2ZSgxMDYyKQAAAAECAAAAIzNNcE50aVBTUlNxNk5uYVFZazM4QmZXU3paY2dBWVR5clE5AQAAAAx0cnlHZXRTdHJpbmcAAAABAAAAA2tleQQAAAAHJG1hdGNoMAkABB0AAAACBQAAAAR0aGlzBQAAAANrZXkDCQAAAQAAAAIFAAAAByRtYXRjaDACAAAABlN0cmluZwQAAAABYgUAAAAHJG1hdGNoMAUAAAABYgIAAAAAAQAAAA10cnlHZXRJbnRlZ2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lYXN1cmVLZXkEAAAABW93bmVkCQEAAAAMdHJ5R2V0U3RyaW5nAAAAAQkAASwAAAACBQAAAAt0cmVhc3VyZUtleQIAAAAHX1JlZGVlbQMJAQAAAAIhPQAAAAIFAAAABW93bmVkCQAEJQAAAAEIBQAAAAFpAAAABmNhbGxlcgkAAAIAAAABAgAAADNUaGlzIHRyZWFzdXJlIGhhcyBiZWVuIGRpc2NvdmVyZWQgYnkgYW5vdGhlciBwbGF5ZXIEAAAAC3RyZWFzdXJlVmFsCQEAAAANdHJ5R2V0SW50ZWdlcgAAAAEFAAAAC3RyZWFzdXJlS2V5CQAETAAAAAIJAQAAAA5TY3JpcHRUcmFuc2ZlcgAAAAMIBQAAAAFpAAAABmNhbGxlcgUAAAALdHJlYXN1cmVWYWwFAAAACnNoaW55d2dnaWQJAARMAAAAAgkBAAAAC0RlbGV0ZUVudHJ5AAAAAQkAASwAAAACBQAAAAt0cmVhc3VyZUtleQIAAAAHX1JlZGVlbQkABEwAAAACCQEAAAALRGVsZXRlRW50cnkAAAABBQAAAAt0cmVhc3VyZUtleQUAAAADbmlsAAAAALmSFog=", "height": 2105978, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: 46TNtkKzc2XpdgU9jbLLhdbyiSGG2QwXwAvVG1nCPzkR Next: HnhvqCntVaxnZfH4gUhv7bCwWZqqCQtioVwRJxX4wr7W Full:
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 | 47 | then throw("This treasure has been discovered by 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 | 57 | then throw("This treasure has been discovered by another player") | |
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 23.80 ms ◑