tx · 72tibMuPv7PH8YBbp4rWxGoe72fxbvA97E3QfB73CAqh

3MrdV3AP4zfU77ifesNStoDZmL1Cfx13eDc:  -0.05000000 Waves

2019.12.19 06:21 [815234] smart account 3MrdV3AP4zfU77ifesNStoDZmL1Cfx13eDc > SELF 0.00000000 Waves

{ "type": 13, "id": "72tibMuPv7PH8YBbp4rWxGoe72fxbvA97E3QfB73CAqh", "fee": 5000000, "feeAssetId": null, "timestamp": 1576725714188, "version": 1, "sender": "3MrdV3AP4zfU77ifesNStoDZmL1Cfx13eDc", "senderPublicKey": "5M79Anear5ntQk2bbDdFA2goiPXkv7Xy2UpV4n5RKRv", "proofs": [ "3Kgp6V4RBuKj25qE3tyEMoG2shLYkMCupw5bgQDLE3Eq81DFwU92GkbDnc7nS4n6wQbq5dw4WCApPYqXw8PK1V9i" ], "script": "base64:AAIDAAAAAAAAAA4IARIAEgMKAQgSAwoBCAAAAA4AAAAAEldCRVRSRVNFUlZBVElPTktFWQIAAAAVJFdCRVRfUkVTRVJWRURfQU1PVU5UAAAAABNST1lBTFJFU0VSVkFUSU9OS0VZAgAAABYkUk9ZQUxfUkVTRVJWRURfQU1PVU5UAAAAAARXQkVUAQAAACCGtDaoeNMOzNjwF61LLiwEHwefusq5FqlK128lrZvQdgAAAAAFUk9ZQUwBAAAAIEPpioLCJdl0nJV8IFJJxqOakLK2lV9iYl7KOImJDGkcAAAAAApXQkVUTE9DS0VEAAAAAAAAAAAAAAAAAAtST1lBTExPQ0tFRAAAAAAAAAAAAQAAAAAMV0JFVFdJVEhEUkFXAAAAAAAAAAACAAAAAA1ST1lBTFdJVEhEUkFXAAAAAAAAAAADAAAAAA1XQVZFU1dJVEhEUkFXAAAAAAAAAAAEAQAAABZFeHRyYWN0V0JFVFJlc2VydmVkQW10AAAAAAQAAAAHJG1hdGNoMAkABBoAAAACBQAAAAR0aGlzBQAAABJXQkVUUkVTRVJWQVRJT05LRVkDCQAAAQAAAAIFAAAAByRtYXRjaDACAAAAA0ludAQ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XRhRW50cnkAAAACBQAAAAZ3YWxsZXQJAQAAABNGb3JtYXRQbGF5ZXJCYWxhbmNlAAAABQkAAZEAAAACBQAAAAdiYWxhbmNlBQAAAApXQkVUTE9DS0VEAAAAAAAAAAAACQABkQAAAAIFAAAAB2JhbGFuY2UFAAAADFdCRVRXSVRIRFJBVwkAAZEAAAACBQAAAAdiYWxhbmNlBQAAAA1ST1lBTFdJVEhEUkFXCQABkQAAAAIFAAAAB2JhbGFuY2UFAAAADVdBVkVTV0lUSERSQVcFAAAAA25pbAkBAAAAC1RyYW5zZmVyU2V0AAAAAQkABEwAAAACCQEAAAAOU2NyaXB0VHJhbnNmZXIAAAADCAUAAAABaQAAAAZjYWxsZXIJAAGRAAAAAgUAAAAHYmFsYW5jZQUAAAALUk9ZQUxMT0NLRUQFAAAABVJPWUFMBQAAAANuaWwJAAACAAAAAQIAAAANaW52YWxpdCBhc3NldAAAAAFpAQAAAAlmaXhwbGF5ZXIAAAABAAAABWFzc2V0BAAAAAZ3YWxsZXQJAAQlAAAAAQgFAAAAAWkAAAAGY2FsbGVyCQEAAAAMU2NyaXB0UmVzdWx0AAAAAgkBAAAACFdyaXRlU2V0AAAAAQkABEwAAAACCQEAAAAJRGF0YUVudHJ5AAAAAgUAAAAGd2FsbGV0CQEAAAATRm9ybWF0UGxheWVyQmFsYW5jZQAAAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAAAA25pbAkBAAAAC1RyYW5zZmVyU2V0AAAAAQUAAAADbmlsAAAAAM+A0i4=", "chainId": 84, "height": 815234, "spentComplexity": 0 } View: original | compacted Prev: Ch6CQt9NWcCVBwMqVrJAEKX6NR85ofHEvm3cwbjDBUvK Next: GMt9ggCQi3mCQMuv5oSLVVqoKYs8NEmCu58bzpZQEpWY Diff:
OldNewDifferences
107107 }
108108
109109
110+
111+@Callable(i)
112+func fixplayer (asset) = {
113+ let wallet = toString(i.caller)
114+ ScriptResult(WriteSet([DataEntry(wallet, FormatPlayerBalance(0, 0, 0, 0, 0))]), TransferSet(nil))
115+ }
116+
117+
Full:
OldNewDifferences
11 {-# STDLIB_VERSION 3 #-}
22 {-# SCRIPT_TYPE ACCOUNT #-}
33 {-# CONTENT_TYPE DAPP #-}
44 let WBETRESERVATIONKEY = "$WBET_RESERVED_AMOUNT"
55
66 let ROYALRESERVATIONKEY = "$ROYAL_RESERVED_AMOUNT"
77
88 let WBET = base58'A4q1mYKo11yuH9gmvDodeJoksagcyQzeFE9JtphMWddw'
99
1010 let ROYAL = base58'5a6rvDEiVwvhTvTH6ce2qFwqdCt3VKaHKXEpwLXXVvyy'
1111
1212 let WBETLOCKED = 0
1313
1414 let ROYALLOCKED = 1
1515
1616 let WBETWITHDRAW = 2
1717
1818 let ROYALWITHDRAW = 3
1919
2020 let WAVESWITHDRAW = 4
2121
2222 func ExtractWBETReservedAmt () = match getInteger(this, WBETRESERVATIONKEY) {
2323 case a: Int =>
2424 a
2525 case _ =>
2626 0
2727 }
2828
2929
3030 func ExtractROYALReservedAmt () = match getInteger(this, ROYALRESERVATIONKEY) {
3131 case a: Int =>
3232 a
3333 case _ =>
3434 0
3535 }
3636
3737
3838 func ExtractPlayerAmt (wallet) = match getString(this, wallet) {
3939 case str: String =>
4040 str
4141 case _ =>
4242 "0_0_0_0_0"
4343 }
4444
4545
4646 func FormatPlayerBalance (wbet,royal,wbetWithdraw,royalWithdraw,wavesWithdraw) = ((((((((toString(wbet) + "_") + toString(royal)) + "_") + toString(wbetWithdraw)) + "_") + toString(royalWithdraw)) + "_") + toString(wavesWithdraw))
4747
4848
4949 func ParsePlayerBalance (wallet) = {
5050 let amounts = split(ExtractPlayerAmt(wallet), "_")
5151 let wbetAmount = parseIntValue(amounts[WBETLOCKED])
5252 let royalAmount = parseIntValue(amounts[ROYALLOCKED])
5353 let wbetWithdraw = parseIntValue(amounts[WBETWITHDRAW])
5454 let royalWithdraw = parseIntValue(amounts[ROYALWITHDRAW])
5555 let wavesWithdraw = parseIntValue(amounts[WAVESWITHDRAW])
5656 [wbetAmount, royalAmount, wbetWithdraw, royalWithdraw, wavesWithdraw]
5757 }
5858
5959
6060 @Callable(i)
6161 func lock () = {
6262 let payment = extract(i.payment)
6363 if (if ((payment.assetId != WBET))
6464 then (payment.assetId != ROYAL)
6565 else false)
6666 then throw("The token should be in WBET or ROYAL.")
6767 else {
6868 let wallet = toString(i.caller)
6969 let balance = ParsePlayerBalance(wallet)
7070 if ((payment.assetId == WBET))
7171 then {
7272 let newWBETReservedAmount = (ExtractWBETReservedAmt() + payment.amount)
7373 let newPlayerWBETAmount = (balance[WBETLOCKED] + payment.amount)
7474 ScriptResult(WriteSet([DataEntry(WBETRESERVATIONKEY, newWBETReservedAmount), DataEntry(wallet, FormatPlayerBalance(newPlayerWBETAmount, balance[ROYALLOCKED], balance[WBETWITHDRAW], balance[ROYALWITHDRAW], balance[WAVESWITHDRAW]))]), TransferSet(nil))
7575 }
7676 else if ((payment.assetId == ROYAL))
7777 then {
7878 let newROYALReservedAmount = (ExtractROYALReservedAmt() + payment.amount)
7979 let newPlayerRoyalAmount = (balance[ROYALLOCKED] + payment.amount)
8080 ScriptResult(WriteSet([DataEntry(ROYALRESERVATIONKEY, newROYALReservedAmount), DataEntry(wallet, FormatPlayerBalance(balance[WBETLOCKED], newPlayerRoyalAmount, balance[WBETWITHDRAW], balance[ROYALWITHDRAW], balance[WAVESWITHDRAW]))]), TransferSet(nil))
8181 }
8282 else throw("error")
8383 }
8484 }
8585
8686
8787
8888 @Callable(i)
8989 func unlock (asset) = {
9090 let wallet = toString(i.caller)
9191 let balance = ParsePlayerBalance(wallet)
9292 if ((asset == "WBET"))
9393 then if ((0 >= balance[WBETLOCKED]))
9494 then throw("You dont have enough balance to withdraw the amount requested.")
9595 else {
9696 let newWBETReservedAmount = (ExtractWBETReservedAmt() - balance[WBETLOCKED])
9797 ScriptResult(WriteSet([DataEntry(WBETRESERVATIONKEY, newWBETReservedAmount), DataEntry(wallet, FormatPlayerBalance(0, balance[ROYALLOCKED], balance[WBETWITHDRAW], balance[ROYALWITHDRAW], balance[WAVESWITHDRAW]))]), TransferSet([ScriptTransfer(i.caller, balance[WBETLOCKED], WBET)]))
9898 }
9999 else if ((asset == "ROYAL"))
100100 then if ((0 >= balance[ROYALLOCKED]))
101101 then throw("You dont have enough balance to withdraw the amount requested.")
102102 else {
103103 let newROYALReservedAmount = (ExtractROYALReservedAmt() - balance[ROYALLOCKED])
104104 ScriptResult(WriteSet([DataEntry(ROYALRESERVATIONKEY, newROYALReservedAmount), DataEntry(wallet, FormatPlayerBalance(balance[WBETLOCKED], 0, balance[WBETWITHDRAW], balance[ROYALWITHDRAW], balance[WAVESWITHDRAW]))]), TransferSet([ScriptTransfer(i.caller, balance[ROYALLOCKED], ROYAL)]))
105105 }
106106 else throw("invalit asset")
107107 }
108108
109109
110+
111+@Callable(i)
112+func fixplayer (asset) = {
113+ let wallet = toString(i.caller)
114+ ScriptResult(WriteSet([DataEntry(wallet, FormatPlayerBalance(0, 0, 0, 0, 0))]), TransferSet(nil))
115+ }
116+
117+

github/deemru/w8io/026f985 
33.79 ms