tx · DP7XDoi3iVizBjTK9zXwq2TWKSKxNxhVJjrRj3YnE3NR

3N2xV35dmGG8EYfhNfdKBPBq2xoSKHkmYxf:  -0.01000000 Waves

2022.05.18 15:33 [2057108] smart account 3N2xV35dmGG8EYfhNfdKBPBq2xoSKHkmYxf > SELF 0.00000000 Waves

{ "type": 13, "id": "DP7XDoi3iVizBjTK9zXwq2TWKSKxNxhVJjrRj3YnE3NR", "fee": 1000000, "feeAssetId": null, "timestamp": 1652877288300, "version": 2, "chainId": 84, "sender": "3N2xV35dmGG8EYfhNfdKBPBq2xoSKHkmYxf", "senderPublicKey": "9F6gZRAntXCZwkaxqm21ELyF2oCxcX1947Aazo7nMLYG", "proofs": [ "4Zf9E2RorGBKWBfuxHuunFS9ymp7QdoxdvbrbfF1SehnGbavGFtgGMGpbPQLMJfNVtm7WUtBnWYYhFer7pc6b18j" ], "script": "base64:AAIFAAAAAAAAABMIAhIDCgEIEgASAwoBARIDCgEBAAAABQAAAAANUEFZTUVOVF9BU1NFVAEAAAAgLTcTgdMkN12f4W9209EPk+8sLPTdia1cSlbofMkBchsAAAAADFJFV0FSRF9BU1NFVAEAAAAgrZ1IFoWReWfvw0p6hpnR3VDpBUk85P5AREeM4YPEwvQAAAAAC1JFV0FSRF9QT09MCQEAAAAHQWRkcmVzcwAAAAEBAAAAGgFU7X9voqvlbe3yLTFcZGa96NUkfO3kvsCHAAAAAAhDT05UUkFDVAkBAAAAB0FkZHJlc3MAAAABAQAAABoBVNTCmVqQvvGYzTJ/MbdqgO4Y1YJeAdXS1AEAAAALaXNQYXltZW50T2sAAAABAAAAAWkEAAAAEWFjY2VwdGFibGVBc3NldElkBQAAAA1QQVlNRU5UX0FTU0VUAwkAAAAAAAACCQABkAAAAAEIBQAAAAFpAAAACHBheW1lbnRzAAAAAAAAAAAACQAAAgAAAAECAAAAFFBheW1lbnQgbm90IGF0dGFjaGVkBAAAAAFwCQABkQAAAAIIBQAAAAFpAAAACHBheW1lbnRzAAAAAAAAAAA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vdW50IG9yIGFzc2V0AAAAAWkBAAAADndpdGhkcmF3UGl4ZWxzAAAAAQAAAA9yZXF1ZXN0ZWRBbW91bnQEAAAABmFtb3VudAkBAAAAC3ZhbHVlT3JFbHNlAAAAAgUAAAAPcmVxdWVzdGVkQW1vdW50AAAAAAAAAAAAAwkAAGYAAAACBQAAAAZhbW91bnQAAAAAAAAAAAAJAAACAAAAAQIAAAABYQkAAAIAAAABAgAAABNub3RoaW5nIHRvIHdpdGhkcmF3AAAAAWkBAAAABWNsYWltAAAAAQAAAAtjbGFpbUFtb3VudAQAAAAKY3VycmVudEtleQkAAlgAAAABCAgFAAAAAWkAAAAGY2FsbGVyAAAABWJ5dGVzBAAAAAZ3YWxsZXQJAAEsAAAAAgUAAAAKY3VycmVudEtleQIAAAAGX3NoYXJlBAAAAAxjbGFpbV9hbW91bnQJAQAAAAt2YWx1ZU9yRWxzZQAAAAIFAAAAC2NsYWltQW1vdW50AAAAAAAAAAAABAAAAAhnZXRTaGFyZQkBAAAAE3ZhbHVlT3JFcnJvck1lc3NhZ2UAAAACCQAEGgAAAAIFAAAABHRoaXMFAAAABndhbGxldAIAAAAQbm90aGluZyB0byBjbGFpbQQAAAAMUE9PTF9CQUxBTkNFCQEAAAATdmFsdWVPckVycm9yTWVzc2FnZQAAAAIJAAPwAAAAAgUAAAALUkVXQVJEX1BPT0wFAAAADFJFV0FSRF9BU1NFVAIAAAAVcmV3YXJkIHBvb2wgaXMgZW1wdHkhAwMJAABnAAAAAgUAAAAMUE9PTF9CQUxBTkNFBQAAAAxjbGFpbV9hbW91bnQJAABnAAAAAgUAAAAIZ2V0U2hhcmUFAAAADGNsYWltX2Ftb3VudAcJAAACAAAAAQIAAAADc2llCQAAAgAAAAEJAAGkAAAAAQUAAAAMUE9PTF9CQUxBTkNFAAAAAHizpE0=", "height": 2057108, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: 9iYuQW1xYtFsjRunKaDntvaDy8MjF9nNL1dSbPesxa27 Next: none Diff:
OldNewDifferences
4242 let currentKey = toBase58String(i.caller.bytes)
4343 if (isPaymentOk(i))
4444 then {
45- let wallet = (currentKey + "_share")
45+ let wallet = (currentKey + "_total")
4646 let getShare = valueOrElse(getInteger(this, wallet), 0)
4747 let total = (getShare + i.payments[0].amount)
4848 [IntegerEntry(wallet, total)]
Full:
OldNewDifferences
11 {-# STDLIB_VERSION 5 #-}
22 {-# SCRIPT_TYPE ACCOUNT #-}
33 {-# CONTENT_TYPE DAPP #-}
44 let PAYMENT_ASSET = base58'43W4FcqA1rEpSmUGHoGiXvpSLfhadws9LS5j3SJsKxxS'
55
66 let REWARD_ASSET = base58'CgidgEMbCKXXErgJXVyZCFRaK8SBNA73Jg8mNXALtVKh'
77
88 let REWARD_POOL = Address(base58'3NBZraoFBG4i6YVuAtcAwTEDwsfEcLh9bSv')
99
1010 let CONTRACT = Address(base58'3N9K49ZpyQLL9gJjVdxQhu37f8YZdAzakR1')
1111
1212 func isPaymentOk (i) = {
1313 let acceptableAssetId = PAYMENT_ASSET
1414 if ((size(i.payments) == 0))
1515 then throw("Payment not attached")
1616 else {
1717 let p = i.payments[0]
1818 match p.assetId {
1919 case assetId: ByteVector =>
2020 if ((assetId == acceptableAssetId))
2121 then (p.amount == 100000)
2222 else false
2323 case _ =>
2424 throw("Wrong payment asset or min amount 0.0001")
2525 }
2626 }
2727 }
2828
2929
3030 @Callable(i)
3131 func rewardPool (data) = {
3232 let currentKey = i.caller
3333 if ((currentKey == CONTRACT))
3434 then $Tuple2([StringEntry("reward_pool", data)], height)
3535 else throw("you are not allowed")
3636 }
3737
3838
3939
4040 @Callable(i)
4141 func stakePixels () = {
4242 let currentKey = toBase58String(i.caller.bytes)
4343 if (isPaymentOk(i))
4444 then {
45- let wallet = (currentKey + "_share")
45+ let wallet = (currentKey + "_total")
4646 let getShare = valueOrElse(getInteger(this, wallet), 0)
4747 let total = (getShare + i.payments[0].amount)
4848 [IntegerEntry(wallet, total)]
4949 }
5050 else throw("Wrong payment amount or asset")
5151 }
5252
5353
5454
5555 @Callable(i)
5656 func withdrawPixels (requestedAmount) = {
5757 let amount = valueOrElse(requestedAmount, 0)
5858 if ((amount > 0))
5959 then throw("a")
6060 else throw("nothing to withdraw")
6161 }
6262
6363
6464
6565 @Callable(i)
6666 func claim (claimAmount) = {
6767 let currentKey = toBase58String(i.caller.bytes)
6868 let wallet = (currentKey + "_share")
6969 let claim_amount = valueOrElse(claimAmount, 0)
7070 let getShare = valueOrErrorMessage(getInteger(this, wallet), "nothing to claim")
7171 let POOL_BALANCE = valueOrErrorMessage(assetBalance(REWARD_POOL, REWARD_ASSET), "reward pool is empty!")
7272 if (if ((POOL_BALANCE >= claim_amount))
7373 then (getShare >= claim_amount)
7474 else false)
7575 then throw("sie")
7676 else throw(toString(POOL_BALANCE))
7777 }
7878
7979

github/deemru/w8io/026f985 
25.53 ms