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/BjDpxtJcRZDllF066xULiW87wAAAAALYWRtaW5XYWxsZXQJAQAAABFAZXh0ck5hdGl2ZSgxMDYyKQAAAAECAAAAIzNNcE50aVBTUlNxNk5uYVFZazM4QmZXU3paY2dBWVR5clE5AQAAAAx0cnlHZXRTdHJpbmcAAAABAAAAA2tleQQAAAAHJG1hdGNoMAkABB0AAAACBQAAAAR0aGlzBQAAAANrZXkDCQAAAQAAAAIFAAAAByRtYXRjaDACAAAABlN0cmluZwQAAAABYgUAAAAHJG1hdGNoMAUAAAABYgIAAAAAAQAAAA10cnlHZXRJbnRlZ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JlYXN1cmVLZXkEAAAABW93bmVkCQEAAAAMdHJ5R2V0U3RyaW5nAAAAAQkAASwAAAACBQAAAAt0cmVhc3VyZUtleQIAAAAHX1JlZGVlbQMJAQAAAAIhPQAAAAIFAAAABW93bmVkCQAEJQAAAAEIBQAAAAFpAAAABmNhbGxlcgkAAAIAAAABAgAAADNUaGlzIHRyZWFzdXJlIGhhcyBiZWVuIGRpc2NvdmVyZWQgYnkgYW5vdGhlciBwbGF5ZXIEAAAAC3RyZWFzdXJlVmFsCQEAAAANdHJ5R2V0SW50ZWdlcgAAAAEFAAAAC3RyZWFzdXJlS2V5CQAETAAAAAIJAQAAAA5TY3JpcHRUcmFuc2ZlcgAAAAMIBQAAAAFpAAAABmNhbGxlcgUAAAALdHJlYXN1cmVWYWwFAAAACnNoaW55d2dnaWQJAARMAAAAAgkBAAAAC0RlbGV0ZUVudHJ5AAAAAQkAASwAAAACBQAAAAt0cmVhc3VyZUtleQIAAAAHX1JlZGVlbQkABEwAAAACCQEAAAALRGVsZXRlRW50cnkAAAABBQAAAAt0cmVhc3VyZUtleQUAAAADbmlsAAAAALmSFog=", "height": 2105978, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: 46TNtkKzc2XpdgU9jbLLhdbyiSGG2QwXwAvVG1nCPzkR Next: HnhvqCntVaxnZfH4gUhv7bCwWZqqCQtioVwRJxX4wr7W Full:
OldNewDifferences
11 {-# STDLIB_VERSION 5 #-}
22 {-# SCRIPT_TYPE ACCOUNT #-}
33 {-# CONTENT_TYPE DAPP #-}
44 let shinywggid = base58'AFQS5E4ELtxex3iANtWtUU2V2oWJZSo8VVnK8z3VFmqf'
55
66 let treasuryAddress = base58'3MyDGEoKp1gF4LSRknk9vSuDEyrwuYXcQEQ'
77
88 let nationsAddress = base58'3MvyzDtzWWV5MZ1GP8JfQhhQqiGU4Nbifdy'
99
1010 let marketplaceAddress = base58'3Mra7mjPipcQd5sJaRmXK8xgS4scb8gPF4A'
1111
1212 let adminWallet = addressFromStringValue("3MpNtiPSRSq6NnaQYk38BfWSzZcgAYTyrQ9")
1313
1414 func tryGetString (key) = match getString(this, key) {
1515 case b: String =>
1616 b
1717 case _ =>
1818 ""
1919 }
2020
2121
2222 func tryGetInteger (key) = match getInteger(this, key) {
2323 case b: Int =>
2424 b
2525 case _ =>
2626 0
2727 }
2828
2929
3030 func checkAdmin (caller) = if (if (if (if ((caller == adminWallet))
3131 then true
3232 else (caller == this))
3333 then true
3434 else (caller.bytes == nationsAddress))
3535 then true
3636 else (caller.bytes == treasuryAddress))
3737 then true
3838 else (caller.bytes == marketplaceAddress)
3939
4040
4141 @Callable(i)
4242 func discoverTreasure (treasureKey,toAddr) = if (!(checkAdmin(i.caller)))
4343 then throw("You are not authorized to perform this operation")
4444 else {
4545 let owned = tryGetString((treasureKey + "_Redeem"))
4646 if ((owned != ""))
4747 then throw("This treasure has been discovered by another player")
4848 else [StringEntry((treasureKey + "_Redeem"), toAddr)]
4949 }
5050
5151
5252
5353 @Callable(i)
5454 func redeemTreasure (treasureKey) = {
5555 let owned = tryGetString((treasureKey + "_Redeem"))
5656 if ((owned != toString(i.caller)))
5757 then throw("This treasure has been discovered by another player")
5858 else {
5959 let treasureVal = tryGetInteger(treasureKey)
6060 [ScriptTransfer(i.caller, treasureVal, shinywggid), DeleteEntry((treasureKey + "_Redeem")), DeleteEntry(treasureKey)]
6161 }
6262 }
6363
6464

github/deemru/w8io/026f985 
23.80 ms