tx · BnVNjbvENMNTxPfGE2jWWrNdKmXi2rCzKLQLZTpDnmQe

3MrdV3AP4zfU77ifesNStoDZmL1Cfx13eDc:  -0.05000000 Waves

2019.12.18 16:33 [814406] smart account 3MrdV3AP4zfU77ifesNStoDZmL1Cfx13eDc > SELF 0.00000000 Waves

{ "type": 13, "id": "BnVNjbvENMNTxPfGE2jWWrNdKmXi2rCzKLQLZTpDnmQe", "fee": 5000000, "feeAssetId": null, "timestamp": 1576676042405, "version": 1, "sender": "3MrdV3AP4zfU77ifesNStoDZmL1Cfx13eDc", "senderPublicKey": "5M79Anear5ntQk2bbDdFA2goiPXkv7Xy2UpV4n5RKRv", "proofs": [ "5us439aTHKqWd7stJXLsJo1TG4sNnpNSCZ9NvBu7gv74XZG7XJfejXna3UrCnykSoKRZ6jMM5LRBTWZMSXb57CW1" ], "script": "base64:AAIDAAAAAAAAAAoIARIAEgQKAgEIAAAACAAAAAASV0JFVFJFU0VSVkFUSU9OS0VZAgAAABUkV0JFVF9SRVNFUlZFRF9BTU9VTlQAAAAAE1JPWUFMUkVTRVJWQVRJT05LRVkCAAAAFiRST1lBTF9SRVNFUlZFRF9BTU9VTlQAAAAABFdCRVQBAAAAIIa0Nqh40w7M2PAXrUsuLAQfB5+6yrkWqUrXbyWtm9B2AAAAAAVST1lBTAEAAAAgQ+mKgsIl2XSclXwgUknGo5qQsraVX2JiXso4iYkMaRwBAAAAFkV4dHJhY3RXQkVUUmVzZXJ2ZWRBbXQAAAAABAAAAAckbWF0Y2gwCQAEGgAAAAIFAAAABHRoaXMFAAAAEldCRVRSRVNFUlZBVElPTktFWQMJAAABAAAAAgUAAAAHJG1hdGNoMAIAAAADSW50BAAAAAFhBQAAAAckbWF0Y2gwBQAAAAFhAAAAAAAAAAAAAQAAABdFeHRyYWN0Uk9ZQUxSZXNlcnZlZEFtdAAAAAAEAAAAByRtYXRjaDAJAAQaAAAAAgUAAAAEdGhpcwUAAAATUk9ZQUxSRVNFUlZBVElPTktFWQMJAAAB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height": 814406, "spentComplexity": 0 } View: original | compacted Prev: B9X5fBNrTSELm2WBtrho8A8iip4T5gio5vsi2F9QQaZ3 Next: Ch6CQt9NWcCVBwMqVrJAEKX6NR85ofHEvm3cwbjDBUvK Diff:
OldNewDifferences
7878 else {
7979 let newWBETReservedAmount = (ExtractWBETReservedAmt() - amount)
8080 let newPlayerWBETAmount = (wbetAmount - amount)
81- ScriptResult(WriteSet([DataEntry(WBETRESERVATIONKEY, newWBETReservedAmount), DataEntry(wallet, FormatPlayerBalance(newPlayerWBETAmount, royalAmount))]), TransferSet(nil))
81+ ScriptResult(WriteSet([DataEntry(WBETRESERVATIONKEY, newWBETReservedAmount), DataEntry(wallet, FormatPlayerBalance(newPlayerWBETAmount, royalAmount))]), TransferSet([ScriptTransfer(i.caller, amount, WBET)]))
8282 }
8383 else if ((asset == "ROYAL"))
8484 then if ((amount > royalAmount))
8686 else {
8787 let newROYALReservedAmount = (ExtractROYALReservedAmt() - amount)
8888 let newPlayerROYALAmount = (royalAmount - amount)
89- ScriptResult(WriteSet([DataEntry(ROYALRESERVATIONKEY, newROYALReservedAmount), DataEntry(wallet, FormatPlayerBalance(wbetAmount, newPlayerROYALAmount))]), TransferSet(nil))
89+ ScriptResult(WriteSet([DataEntry(ROYALRESERVATIONKEY, newROYALReservedAmount), DataEntry(wallet, FormatPlayerBalance(wbetAmount, newPlayerROYALAmount))]), TransferSet([ScriptTransfer(i.caller, amount, ROYAL)]))
9090 }
9191 else throw("invalit asset")
92- }
93-
94-
95-
96-@Callable(i)
97-func clock () = {
98- let wallet = toString(i.caller)
99- ScriptResult(WriteSet([DataEntry(WBETRESERVATIONKEY, 0), DataEntry(ROYALRESERVATIONKEY, 0), DataEntry(wallet, FormatPlayerBalance(0, 0))]), TransferSet(nil))
10092 }
10193
10294
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 func ExtractWBETReservedAmt () = match getInteger(this, WBETRESERVATIONKEY) {
1313 case a: Int =>
1414 a
1515 case _ =>
1616 0
1717 }
1818
1919
2020 func ExtractROYALReservedAmt () = match getInteger(this, ROYALRESERVATIONKEY) {
2121 case a: Int =>
2222 a
2323 case _ =>
2424 0
2525 }
2626
2727
2828 func ExtractPlayerAmt (wallet) = match getString(this, wallet) {
2929 case str: String =>
3030 str
3131 case _ =>
3232 "0_0"
3333 }
3434
3535
3636 func FormatPlayerBalance (wbet,royal) = ((toString(wbet) + "_") + toString(royal))
3737
3838
3939 @Callable(i)
4040 func lock () = {
4141 let payment = extract(i.payment)
4242 if (if ((payment.assetId != WBET))
4343 then (payment.assetId != ROYAL)
4444 else false)
4545 then throw("The token should be in WBET or ROYAL.")
4646 else {
4747 let wallet = toString(i.caller)
4848 let playerAmount = split(ExtractPlayerAmt(wallet), "_")
4949 let wbetAmount = parseIntValue(playerAmount[0])
5050 let royalAmount = parseIntValue(playerAmount[1])
5151 if ((payment.assetId == WBET))
5252 then {
5353 let newWBETReservedAmount = (ExtractWBETReservedAmt() + payment.amount)
5454 let newPlayerWBETAmount = (wbetAmount + payment.amount)
5555 ScriptResult(WriteSet([DataEntry(WBETRESERVATIONKEY, newWBETReservedAmount), DataEntry(wallet, FormatPlayerBalance(newPlayerWBETAmount, royalAmount))]), TransferSet(nil))
5656 }
5757 else if ((payment.assetId == ROYAL))
5858 then {
5959 let newROYALReservedAmount = (ExtractROYALReservedAmt() + payment.amount)
6060 let newPlayerRoyalAmount = (royalAmount + payment.amount)
6161 ScriptResult(WriteSet([DataEntry(ROYALRESERVATIONKEY, newROYALReservedAmount), DataEntry(wallet, FormatPlayerBalance(wbetAmount, newPlayerRoyalAmount))]), TransferSet(nil))
6262 }
6363 else throw("error")
6464 }
6565 }
6666
6767
6868
6969 @Callable(i)
7070 func unlock (amount,asset) = {
7171 let wallet = toString(i.caller)
7272 let playerAmount = split(ExtractPlayerAmt(wallet), "_")
7373 let wbetAmount = parseIntValue(playerAmount[0])
7474 let royalAmount = parseIntValue(playerAmount[1])
7575 if ((asset == "WBET"))
7676 then if ((amount > wbetAmount))
7777 then throw("You dont have enough balance to withdraw the amount requested.")
7878 else {
7979 let newWBETReservedAmount = (ExtractWBETReservedAmt() - amount)
8080 let newPlayerWBETAmount = (wbetAmount - amount)
81- ScriptResult(WriteSet([DataEntry(WBETRESERVATIONKEY, newWBETReservedAmount), DataEntry(wallet, FormatPlayerBalance(newPlayerWBETAmount, royalAmount))]), TransferSet(nil))
81+ ScriptResult(WriteSet([DataEntry(WBETRESERVATIONKEY, newWBETReservedAmount), DataEntry(wallet, FormatPlayerBalance(newPlayerWBETAmount, royalAmount))]), TransferSet([ScriptTransfer(i.caller, amount, WBET)]))
8282 }
8383 else if ((asset == "ROYAL"))
8484 then if ((amount > royalAmount))
8585 then throw("You dont have enough balance to withdraw the amount requested.")
8686 else {
8787 let newROYALReservedAmount = (ExtractROYALReservedAmt() - amount)
8888 let newPlayerROYALAmount = (royalAmount - amount)
89- ScriptResult(WriteSet([DataEntry(ROYALRESERVATIONKEY, newROYALReservedAmount), DataEntry(wallet, FormatPlayerBalance(wbetAmount, newPlayerROYALAmount))]), TransferSet(nil))
89+ ScriptResult(WriteSet([DataEntry(ROYALRESERVATIONKEY, newROYALReservedAmount), DataEntry(wallet, FormatPlayerBalance(wbetAmount, newPlayerROYALAmount))]), TransferSet([ScriptTransfer(i.caller, amount, ROYAL)]))
9090 }
9191 else throw("invalit asset")
92- }
93-
94-
95-
96-@Callable(i)
97-func clock () = {
98- let wallet = toString(i.caller)
99- ScriptResult(WriteSet([DataEntry(WBETRESERVATIONKEY, 0), DataEntry(ROYALRESERVATIONKEY, 0), DataEntry(wallet, FormatPlayerBalance(0, 0))]), TransferSet(nil))
10092 }
10193
10294

github/deemru/w8io/026f985 
36.11 ms