tx · C4Yrn9JEDYQqf53XaKB9ADZ7W4Uie3dK5dZGUoovGzeo

3N9K49ZpyQLL9gJjVdxQhu37f8YZdAzakR1:  -0.01000000 Waves

2022.05.18 11:20 [2056852] smart account 3N9K49ZpyQLL9gJjVdxQhu37f8YZdAzakR1 > SELF 0.00000000 Waves

{ "type": 13, "id": "C4Yrn9JEDYQqf53XaKB9ADZ7W4Uie3dK5dZGUoovGzeo", "fee": 1000000, "feeAssetId": null, "timestamp": 1652862068868, "version": 2, "chainId": 84, "sender": "3N9K49ZpyQLL9gJjVdxQhu37f8YZdAzakR1", "senderPublicKey": "8rTCUHVm1p6iEchTjpJ1a7SbCaayaRrp4FegpAsirYag", "proofs": [ "4cJiXjkPHn84rSEYxdfThE5K7u1Z1q3XCcPDLM1V4s4PaT893VwaHXaHJgBm12LCTLKXuVaaEq3BvSyUy3C9mGPk" ], "script": "base64:AAIFAAAAAAAAAAgIAhIECgIICAAAAA8AAAAADVBBWU1FTlRfQVNTRVQBAAAAIK2dSBaFkXln78NKeoaZ0d1Q6QVJPOT+QERHjOGDxML0AAAAAAxSRVdBUkRfQVNTRVQBAAAAIC03E4HTJDddn+FvdtPRD5PvLCz03YmtXEpW6HzJAXIbAAAAABBTVEFLSU5HX0NPTlRSQUNUCQEAAAAHQWRkcmVzcwAAAAEBAAAAGgFUjw3ifhq9EIoKzVKH33tj+QNuo3mChI2IAAAAAAZwaXhlbHMFAAAADFJFV0FSRF9BU1NFVAAAAAAEeE1JTgAAAAAAAAAAAAAAAAAEeE1BWAAAAAAAAAAEsQAAAAAEeU1JTgAAAAAAAAAAAAAAAAAEeU1BWAAAAAAAAAACWQAAAAANUkVXQVJEX0FNT1VOVAAAAAAABfXhAAAAAAAUUkVXQVJEX1BPT0xfRElWSVNJT04AAAAAAAAAAAQAAAAAElRPX1RIRV9SRVdBUkRfUE9PTAkAAGkAAAACBQAAAA1SRVdBUkRfQU1PVU5UBQAAABRSRVdBUkRfUE9PTF9ESVZJU0lPTgAAAA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ANUEFZTUVOVF9BU1NFVAUAAAASVE9fVEhFX1JFV0FSRF9QT09MBQAAAANuaWwDCQAAAAAAAAIFAAAAA3JlcwUAAAADcmVzBAAAAAckbWF0Y2gwBQAAAANyZXMDCQAAAQAAAAIFAAAAByRtYXRjaDACAAAAB0Jvb2xlYW4EAAAAAXIFAAAAByRtYXRjaDAJAARMAAAAAgkBAAAADlNjcmlwdFRyYW5zZmVyAAAAAwgFAAAAAWkAAAAGY2FsbGVyBQAAAA1SRVdBUkRfQU1PVU5UBQAAAAZwaXhlbHMJAARMAAAAAgkBAAAAC1N0cmluZ0VudHJ5AAAAAgUAAAAGd2FsbGV0BQAAAAR2ZXJpCQAETAAAAAIJAQAAAAtTdHJpbmdFbnRyeQAAAAIFAAAACXJld2FyZEtleQkAASwAAAACCQABLAAAAAIJAAGkAAAAAQUAAAAJbmV3QW1vdW50AgAAAAFfCQABpAAAAAEFAAAABmhlaWdodAUAAAADbmlsCQAAAgAAAAECAAAAF0luY29ycmVjdCBpbnZva2UgcmVzdWx0CQAAAgAAAAECAAAAJFN0cmljdCB2YWx1ZSBpcyBub3QgZXF1YWwgdG8gaXRzZWxmLgkAAAIAAAABAgAAAB1Xcm9uZyBwYXltZW50IGFtb3VudCBvciBhc3NldAkAAAIAAAABAgAAAA5vdXQgb2YgY29udGV4dAkAAAIAAAABAgAAAAt3cm9uZyBjb2xvcgkAAAIAAAABAgAAABxnYW1lIGlzIG5vdCBhY3RpdmUgcmlnaHQgbm93AAAAAGtFerE=", "height": 2056852, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: 4dj42gwoP8PmJ1skb67H6qwZ9PT4FNWyn7dUpNbkEGZ3 Next: 3ZCYgYoS7Er6kSoZ87K4dWK1p2WvTG7iHfS4ySvSFxpX Diff:
OldNewDifferences
44 let PAYMENT_ASSET = base58'CgidgEMbCKXXErgJXVyZCFRaK8SBNA73Jg8mNXALtVKh'
55
66 let REWARD_ASSET = base58'43W4FcqA1rEpSmUGHoGiXvpSLfhadws9LS5j3SJsKxxS'
7+
8+let STAKING_CONTRACT = Address(base58'3N2xV35dmGG8EYfhNfdKBPBq2xoSKHkmYxf')
79
810 let pixels = REWARD_ASSET
911
8284 let amount = valueOrElse(parseInt(splitRewardData[0]), 0)
8385 let lastRewardBlock = valueOrElse(parseInt(splitRewardData[1]), height)
8486 let newAmount = (amount + rewardAmount)
85-[StringEntry(wallet, veri), StringEntry(rewardKey, ((toString(newAmount) + "_") + toString(height))), ScriptTransfer(i.caller, REWARD_AMOUNT, pixels)]
87+ let insert = ((toString(newAmount) + "_") + toString(height))
88+ let res = invoke(STAKING_CONTRACT, "rewardPool", [insert], [AttachedPayment(PAYMENT_ASSET, TO_THE_REWARD_POOL)])
89+ if ((res == res))
90+ then match res {
91+ case r: Boolean =>
92+[ScriptTransfer(i.caller, REWARD_AMOUNT, pixels), StringEntry(wallet, veri), StringEntry(rewardKey, ((toString(newAmount) + "_") + toString(height)))]
93+ case _ =>
94+ throw("Incorrect invoke result")
95+ }
96+ else throw("Strict value is not equal to itself.")
8697 }
8798 else throw("Wrong payment amount or asset")
8899 else throw("out of context")
Full:
OldNewDifferences
11 {-# STDLIB_VERSION 5 #-}
22 {-# SCRIPT_TYPE ACCOUNT #-}
33 {-# CONTENT_TYPE DAPP #-}
44 let PAYMENT_ASSET = base58'CgidgEMbCKXXErgJXVyZCFRaK8SBNA73Jg8mNXALtVKh'
55
66 let REWARD_ASSET = base58'43W4FcqA1rEpSmUGHoGiXvpSLfhadws9LS5j3SJsKxxS'
7+
8+let STAKING_CONTRACT = Address(base58'3N2xV35dmGG8EYfhNfdKBPBq2xoSKHkmYxf')
79
810 let pixels = REWARD_ASSET
911
1012 let xMIN = 0
1113
1214 let xMAX = 1201
1315
1416 let yMIN = 0
1517
1618 let yMAX = 601
1719
1820 let REWARD_AMOUNT = 100000000
1921
2022 let REWARD_POOL_DIVISION = 4
2123
2224 let TO_THE_REWARD_POOL = (REWARD_AMOUNT / REWARD_POOL_DIVISION)
2325
2426 let START_HEIGHT = 2028020
2527
2628 let END_HEIGHT = (START_HEIGHT + (1440 * 30))
2729
2830 let colors = ["000", "fff", "000000", "ffffff", "FF0200", "800080", "FF00FF", "008001", "FEFF00", "020080", "0800FF", "183937", "09FEFF", "7076E9", "C0C0C0", "C3103B", "ff0200", "ff00ff", "feff00", "0800ff", "09feff", "7076e9", "c0c0c0", "c3103b"]
2931
3032 func isPaymentOk (i) = {
3133 let acceptableAssetId = PAYMENT_ASSET
3234 if ((size(i.payments) == 0))
3335 then throw("Payment not attached")
3436 else {
3537 let p = i.payments[0]
3638 match p.assetId {
3739 case assetId: ByteVector =>
3840 if ((assetId == acceptableAssetId))
3941 then (p.amount == 1000000)
4042 else false
4143 case _ =>
4244 throw("Wrong payment asset")
4345 }
4446 }
4547 }
4648
4749
4850 @Callable(i)
4951 func coordinates (veri,xy) = if (if ((height > START_HEIGHT))
5052 then (END_HEIGHT > height)
5153 else false)
5254 then {
5355 let color = containsElement(colors, veri)
5456 if (color)
5557 then {
5658 let currentKey = toBase58String(i.caller.bytes)
5759 let splitter = split(xy, "_")
5860 let x = valueOrElse(parseInt(splitter[0]), 0)
5961 let y = valueOrElse(parseInt(splitter[1]), 0)
6062 if (if (((x % 8) != 0))
6163 then ((y % 8) != 0)
6264 else false)
6365 then throw("not cool.")
6466 else {
6567 let xy_new = ((toString(x) + "_") + toString(y))
6668 let wallet = (((currentKey + "_") + xy_new) + "_c")
6769 if (if (if (if ((x >= xMIN))
6870 then (xMAX > x)
6971 else false)
7072 then (y >= yMIN)
7173 else false)
7274 then (yMAX > y)
7375 else false)
7476 then if (isPaymentOk(i))
7577 then {
7678 let rewardKey = "reward_pool"
7779 let rewardAmount = TO_THE_REWARD_POOL
7880 let rewardHeight = height
7981 let rewardPoolIfEmpty = ("0_" + toString(height))
8082 let rewardData = valueOrElse(getString(this, "reward_pool"), rewardPoolIfEmpty)
8183 let splitRewardData = split(rewardData, "_")
8284 let amount = valueOrElse(parseInt(splitRewardData[0]), 0)
8385 let lastRewardBlock = valueOrElse(parseInt(splitRewardData[1]), height)
8486 let newAmount = (amount + rewardAmount)
85-[StringEntry(wallet, veri), StringEntry(rewardKey, ((toString(newAmount) + "_") + toString(height))), ScriptTransfer(i.caller, REWARD_AMOUNT, pixels)]
87+ let insert = ((toString(newAmount) + "_") + toString(height))
88+ let res = invoke(STAKING_CONTRACT, "rewardPool", [insert], [AttachedPayment(PAYMENT_ASSET, TO_THE_REWARD_POOL)])
89+ if ((res == res))
90+ then match res {
91+ case r: Boolean =>
92+[ScriptTransfer(i.caller, REWARD_AMOUNT, pixels), StringEntry(wallet, veri), StringEntry(rewardKey, ((toString(newAmount) + "_") + toString(height)))]
93+ case _ =>
94+ throw("Incorrect invoke result")
95+ }
96+ else throw("Strict value is not equal to itself.")
8697 }
8798 else throw("Wrong payment amount or asset")
8899 else throw("out of context")
89100 }
90101 }
91102 else throw("wrong color")
92103 }
93104 else throw("game is not active right now")
94105
95106

github/deemru/w8io/026f985 
29.55 ms