tx · 4nMw3HvfnHmWZmQcKHZetZNdkQYHhWAZHytdCmYexemd

3MzqDsrJ19a1wqwLNC9WZhHixkTczC1HLFb:  -0.09000000 Waves

2019.08.13 17:29 [629422] smart account 3MzqDsrJ19a1wqwLNC9WZhHixkTczC1HLFb > SELF 0.00000000 Waves

{ "type": 13, "id": "4nMw3HvfnHmWZmQcKHZetZNdkQYHhWAZHytdCmYexemd", "fee": 9000000, "feeAssetId": null, "timestamp": 1565706515351, "version": 1, "sender": "3MzqDsrJ19a1wqwLNC9WZhHixkTczC1HLFb", "senderPublicKey": "CB6swHXQ614ikcpiGn6fBKJyMgXNMNj4ghov1JM9BJmm", "proofs": [ "56S6qmFDzbT5VukwqQvhH3tg26s2MrNwXTs1frB959PKPpWY3Ao7CZBYoaZkChaFAyu97HbBAHEniGr1fGxhGLgG" ], "script": "base64:AAIDAAAAAAAAAAAAAAAFAAAAAA1nYW1pbmdBc3NldElkCQACWQAAAAECAAAALERuMTZoQ1FUdUpzZmVDY3dTNm9uVXpMVE5SemJMVWI3ekVHSHBSS0tQSjVvAQAAABZnZXRTZW5kZXJGcm9tUGF5bWVudFR4AAAAAQAAAAx0cmFuc2ZlclR4SWQEAAAAEHRyYW5zZmVyVHhTZW5kZXIEAAAAByRtYXRjaDAJAAPuAAAAAQkAAlkAAAABCQEAAAAHZXh0cmFjdAAAAAEFAAAADHRyYW5zZmVyVHhJZAMJAAABAAAAAgUAAAAHJG1hdGNoMAIAAAATVHJhbnNmZXJUcmFuc2FjdGlvbgQAAAACdHgFAAAAByRtYXRjaDAIBQAAAAJ0eAAAAAZzZW5kZXIJAAACAAAAAQIAAAAeVHJhbnNhY3Rpb24gaXMgbm8gdHJhbnNmZXIgdHghBQAAABB0cmFuc2ZlclR4U2VuZGVyAQAAABZnZXRBbW91bnRGcm9tUGF5bWVudFR4AAAAAQAAAAx0cmFuc2ZlclR4SWQEAAAABmFtb3VudAQAAAAHJG1hdGNoMAkAA+4AAAABCQACWQAAAAEJAQAAAA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luZ1Njb3JlVmFsdWUFAAAACnRoaXNTZW5kZXIFAAAADm1hdGNoaW5nU2VuZGVyBAAAAARkcmF3CQAAAAAAAAIFAAAAEm1hdGNoaW5nU2NvcmVWYWx1ZQUAAAAOdGhpc1Njb3JlVmFsdWUDBQAAAARkcmF3CQEAAAAMU2NyaXB0UmVzdWx0AAAAAgkBAAAACFdyaXRlU2V0AAAAAQkABEwAAAACCQEAAAAJRGF0YUVudHJ5AAAAAgIAAAAIb3BlbkdhbWUCAAAABG5vbmUFAAAAA25pbAkBAAAAC1RyYW5zZmVyU2V0AAAAAQkABEwAAAACCQEAAAAOU2NyaXB0VHJhbnNmZXIAAAADBQAAAA5tYXRjaGluZ1NlbmRlcgAAAAAABfXhAAUAAAANZ2FtaW5nQXNzZXRJZAkABEwAAAACCQEAAAAOU2NyaXB0VHJhbnNmZXIAAAADBQAAAAp0aGlzU2VuZGVyAAAAAAAF9eEABQAAAA1nYW1pbmdBc3NldElkBQAAAANuaWwJAQAAAAxTY3JpcHRSZXN1bHQAAAACCQEAAAAIV3JpdGVTZXQAAAABCQAETAAAAAIJAQAAAAlEYXRhRW50cnkAAAACAgAAAAhvcGVuR2FtZQIAAAAEbm9uZQUAAAADbmlsCQEAAAALVHJhbnNmZXJTZXQAAAABCQAETAAAAAIJAQAAAA5TY3JpcHRUcmFuc2ZlcgAAAAMFAAAABndpbm5lcgAAAAAAC+vCAAUAAAANZ2FtaW5nQXNzZXRJZAUAAAADbmlsCQAAAgAAAAECAAAAGlRoaXMgc2hvdWxkIG5ldmVyIGhhcHBlbjIhCQAAAgAAAAECAAAAGlRoaXMgc2hvdWxkIG5ldmVyIGhhcHBlbjMhCQAAAgAAAAECAAAAE0ludmFsaWQgcGF5bWVudCB0eCEAAAAAqzXZwA==", "chainId": 84, "height": 629422, "spentComplexity": 0 } View: original | compacted Prev: 5yrMjUbU83CqUQrokoBcsFahUkVZzZkSmonHFKxKfNsa Next: none Diff:
OldNewDifferences
7777 then ScriptResult(WriteSet([DataEntry("openGame", "none")]), TransferSet([ScriptTransfer(matchingSender, 100000000, gamingAssetId), ScriptTransfer(thisSender, 100000000, gamingAssetId)]))
7878 else ScriptResult(WriteSet([DataEntry("openGame", "none")]), TransferSet([ScriptTransfer(winner, 200000000, gamingAssetId)]))
7979 case _ =>
80- throw("This should never happen!")
80+ throw("This should never happen2!")
8181 }
8282 case _ =>
83- throw("This should never happen!")
83+ throw("This should never happen3!")
8484 }
8585 }
8686 else throw("Invalid payment tx!")
Full:
OldNewDifferences
11 {-# STDLIB_VERSION 3 #-}
22 {-# SCRIPT_TYPE ACCOUNT #-}
33 {-# CONTENT_TYPE DAPP #-}
44 let gamingAssetId = fromBase58String("Dn16hCQTuJsfeCcwS6onUzLTNRzbLUb7zEGHpRKKPJ5o")
55
66 func getSenderFromPaymentTx (transferTxId) = {
77 let transferTxSender = match transferTransactionById(fromBase58String(extract(transferTxId))) {
88 case tx: TransferTransaction =>
99 tx.sender
1010 case _ =>
1111 throw("Transaction is no transfer tx!")
1212 }
1313 transferTxSender
1414 }
1515
1616
1717 func getAmountFromPaymentTx (transferTxId) = {
1818 let amount = match transferTransactionById(fromBase58String(extract(transferTxId))) {
1919 case tx: TransferTransaction =>
2020 tx.amount
2121 case _ =>
2222 throw("Transaction is no transfer tx!")
2323 }
2424 amount
2525 }
2626
2727
2828 func getAssetFromPaymentTx (transferTxId) = {
2929 let assetId = match transferTransactionById(fromBase58String(extract(transferTxId))) {
3030 case tx: TransferTransaction =>
3131 tx.assetId
3232 case _ =>
3333 throw("Transaction is no transfer tx!")
3434 }
3535 assetId
3636 }
3737
3838
3939 func checkPaymentTx (paymentTxId,thisSender) = {
4040 let amount = getAmountFromPaymentTx(paymentTxId)
4141 let sender = getSenderFromPaymentTx(paymentTxId)
4242 let assetId = getAssetFromPaymentTx(paymentTxId)
4343 if (if ((sender == thisSender))
4444 then (amount == 100000000)
4545 else false)
4646 then (assetId == gamingAssetId)
4747 else false
4848 }
4949
5050
5151 @Callable(i)
5252 func registerGame (txId) = {
5353 let open = match getString(this, "openGame") {
5454 case openTxId: String =>
5555 openTxId
5656 case _ =>
5757 throw("Initiating impossible!")
5858 }
5959 let thisSender = getSenderFromPaymentTx(txId)
6060 let txValid = checkPaymentTx(txId, thisSender)
6161 if (txValid)
6262 then if ((open == "none"))
6363 then WriteSet([DataEntry("openGame", txId)])
6464 else {
6565 let matchingSender = getSenderFromPaymentTx(open)
6666 let matchingScore = getInteger(matchingSender, (open + "_score"))
6767 let thisScore = getInteger(thisSender, (txId + "_score"))
6868 match matchingScore {
6969 case matchingScoreValue: Int =>
7070 match thisScore {
7171 case thisScoreValue: Int =>
7272 let winner = if ((thisScoreValue > matchingScoreValue))
7373 then thisSender
7474 else matchingSender
7575 let draw = (matchingScoreValue == thisScoreValue)
7676 if (draw)
7777 then ScriptResult(WriteSet([DataEntry("openGame", "none")]), TransferSet([ScriptTransfer(matchingSender, 100000000, gamingAssetId), ScriptTransfer(thisSender, 100000000, gamingAssetId)]))
7878 else ScriptResult(WriteSet([DataEntry("openGame", "none")]), TransferSet([ScriptTransfer(winner, 200000000, gamingAssetId)]))
7979 case _ =>
80- throw("This should never happen!")
80+ throw("This should never happen2!")
8181 }
8282 case _ =>
83- throw("This should never happen!")
83+ throw("This should never happen3!")
8484 }
8585 }
8686 else throw("Invalid payment tx!")
8787 }
8888
8989

github/deemru/w8io/169f3d6 
48.19 ms