tx · 738Tdmgurm6whfqdVz7BoQuw5eEm7MA4K82Ln6nYLGwP

3N778wrQUp2Fm75ZTwtZ2WM7L9R2hT1Pavb:  -0.01400000 Waves

2020.04.04 20:26 [939763] smart account 3N778wrQUp2Fm75ZTwtZ2WM7L9R2hT1Pavb > SELF 0.00000000 Waves

{ "type": 13, "id": "738Tdmgurm6whfqdVz7BoQuw5eEm7MA4K82Ln6nYLGwP", "fee": 1400000, "feeAssetId": null, "timestamp": 1586021192988, "version": 1, "sender": "3N778wrQUp2Fm75ZTwtZ2WM7L9R2hT1Pavb", "senderPublicKey": "GDLTHJjR9hamQRzEMe3M685bqZSbdGzjtEXWbQupogZQ", "proofs": [ "4KmrQnjk9B1XDJfKZaGJ48sEAZoZUjVGXtBa2Por3yNcZtkcmSS75Rv3a4eteJnX3yJcZ88nDyeVJKbiBBLd5cba" ], "script": "base64:AAIDAAAAAAAAAA4IARIDCgEIEgUKAwgIAgAAAA0AAAAACVJTQVBVQkxJQwkAAlsAAAABAgAAAY9iYXNlNjQ6TUlJQklqQU5CZ2txaGtpRzl3MEJBUUVGQUFPQ0FROEFNSUlCQ2dLQ0FRRUFnNGRBUjZYYkJEQVM5aHIvRWozZEp2NkZmYzQ2NngvbU9HTVdVM2xyQUJzM3FhOEJIbXVKR25rZmJwRWYydkF3WVRPV1B2dnpmTTEwT0JiZmxvU3lxM2M5TUt2eVRlMWx1QkxHcVc0dlpVWEl5dlNnejFsaXlVVmVmSVF5M2R5RjlqYmVUWmJDMGJiY1QvN08zREVMKzAxejZBK3JEQ2FjU1owbEdvbFNRNkFuaEx4eklrVnBPUUpickJtQyt4K1p1WlBDTVd6SnluZDVhZU9uN2phai9ta1JWeXhlNmcvME9oV3o0TmlpWlhldU1SQis4bUt5MGZXRC9VbElsWldIc0FTMlptcmtYS3FqTHEwLzB3cjhJTEprem5qU3Fkbkk1SWJqZzN1UXJqLzRBTitpOXIyOGFRNzMvWmtQdFk1U2J3MEFPaUFCQnU3Z0htcTlheVZ4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SVRZAAAAAAAAAABkBQAAAAlhc3NldFR5cGUJAARMAAAAAgkBAAAADlNjcmlwdFRyYW5zZmVyAAAAAwUAAAAOV0FMTEVUV0FWRVNCRVQJAABrAAAAAwUAAAAGd2luQW10BQAAAAtGRUVXQVZFU0JFVAAAAAAAAAAAZAUAAAAJYXNzZXRUeXBlCQAETAAAAAIJAQAAAA5TY3JpcHRUcmFuc2ZlcgAAAAMFAAAADFdBTExFVE1DQUZFRQkAAGsAAAADBQAAAAZ3aW5BbXQFAAAACUZFRU1DQUZFRQAAAAAAAAAAZAUAAAAJYXNzZXRUeXBlBQAAAANuaWwAAAAAMl/puA==", "chainId": 84, "height": 939763, "spentComplexity": 0 } View: original | compacted Prev: BEvNjZjdjVpSovCWuaaSHUAvphTmNqRxhy97oi3nWRq4 Next: HgXmS98moHnSCTah5zGDWPhjBLCPfdsrFno9AK6oTiAD Diff:
OldNewDifferences
33 {-# CONTENT_TYPE DAPP #-}
44 let RSAPUBLIC = fromBase64String("base64:MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAg4dAR6XbBDAS9hr/Ej3dJv6Ffc466x/mOGMWU3lrABs3qa8BHmuJGnkfbpEf2vAwYTOWPvvzfM10OBbfloSyq3c9MKvyTe1luBLGqW4vZUXIyvSgz1liyUVefIQy3dyF9jbeTZbC0bbcT/7O3DEL+01z6A+rDCacSZ0lGolSQ6AnhLxzIkVpOQJbrBmC+x+ZuZPCMWzJynd5aeOn7jaj/mkRVyxe6g/0OhWz4NiiZXeuMRB+8mKy0fWD/UlIlZWHsAS2ZmrkXKqjLq0/0wr8ILJkznjSqdnI5Ibjg3uQrj/4AN+i9r28aQ73/ZkPtY5Sbw0AOiABBu7gHmq9ayVxZQIDAQAB")
55
6-let WAVES = base58'WAVES'
6+let WAVES = assetInfo(base58'WAVES')
77
88 let WBET = base58'A4q1mYKo11yuH9gmvDodeJoksagcyQzeFE9JtphMWddw'
99
4444 func StringToAsset (assetStr) = if ((assetStr == "WBET"))
4545 then WBET
4646 else if ((assetStr == "WAVES"))
47- then WAVES
47+ then unit
4848 else if ((assetStr == "ROYALS"))
4949 then ROYALS
5050 else throw("Invalid asset")
Full:
OldNewDifferences
11 {-# STDLIB_VERSION 3 #-}
22 {-# SCRIPT_TYPE ACCOUNT #-}
33 {-# CONTENT_TYPE DAPP #-}
44 let RSAPUBLIC = fromBase64String("base64:MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAg4dAR6XbBDAS9hr/Ej3dJv6Ffc466x/mOGMWU3lrABs3qa8BHmuJGnkfbpEf2vAwYTOWPvvzfM10OBbfloSyq3c9MKvyTe1luBLGqW4vZUXIyvSgz1liyUVefIQy3dyF9jbeTZbC0bbcT/7O3DEL+01z6A+rDCacSZ0lGolSQ6AnhLxzIkVpOQJbrBmC+x+ZuZPCMWzJynd5aeOn7jaj/mkRVyxe6g/0OhWz4NiiZXeuMRB+8mKy0fWD/UlIlZWHsAS2ZmrkXKqjLq0/0wr8ILJkznjSqdnI5Ibjg3uQrj/4AN+i9r28aQ73/ZkPtY5Sbw0AOiABBu7gHmq9ayVxZQIDAQAB")
55
6-let WAVES = base58'WAVES'
6+let WAVES = assetInfo(base58'WAVES')
77
88 let WBET = base58'A4q1mYKo11yuH9gmvDodeJoksagcyQzeFE9JtphMWddw'
99
1010 let ROYALS = base58'BSt87FHK4td7NvDuzKYeb2ETVersiZDr4QW6WMX1BaFU'
1111
1212 let WALLETCOMMUNITY = Address(base58'3MtCy2PCFPyu8A9SRNL4qUo1V17SGLHftD8')
1313
1414 let WALLETWAVESBET = Address(base58'3MxK12u62zsu9xh3hU7p5iJncCLANd3zhTZ')
1515
1616 let WALLETMCAFEE = Address(base58'3MxK12u62zsu9xh3hU7p5iJncCLANd3zhTZ')
1717
1818 let FEECOMMUNITY = 1
1919
2020 let FEEWAVESBET = 3
2121
2222 let FEEMCAFEE = 2
2323
2424 func ExtractString (id) = {
2525 let rawDataStr = match getString(this, id) {
2626 case str: String =>
2727 str
2828 case _ =>
2929 throw(("Couldn't find string by " + id))
3030 }
3131 rawDataStr
3232 }
3333
3434
3535 func AssetToString (payment) = if ((payment.assetId == WBET))
3636 then "WBET"
3737 else if ((payment.assetId == WAVES))
3838 then "WAVES"
3939 else if ((payment.assetId == ROYALS))
4040 then "ROYALS"
4141 else throw("Payment should be in Wavesbet, Waves or Royals")
4242
4343
4444 func StringToAsset (assetStr) = if ((assetStr == "WBET"))
4545 then WBET
4646 else if ((assetStr == "WAVES"))
47- then WAVES
47+ then unit
4848 else if ((assetStr == "ROYALS"))
4949 then ROYALS
5050 else throw("Invalid asset")
5151
5252
5353 @Callable(i)
5454 func play (tableId) = {
5555 let payment = extract(i.payment)
5656 let feeAssetId = isDefined(i.feeAssetId)
5757 let gameId = toBase58String(i.transactionId)
5858 let gameIdUsed = isDefined(getString(this, gameId))
5959 if (if (if ((payment.assetId != WBET))
6060 then (payment.assetId != WAVES)
6161 else false)
6262 then (payment.assetId != ROYALS)
6363 else false)
6464 then throw("Payment should be in Wavesbet, Waves or Royals")
6565 else if (feeAssetId)
6666 then throw("Transaction's fee must be in Waves. Game aborted.")
6767 else if (gameIdUsed)
6868 then throw("Passed GameId had been used before. Game aborted.")
6969 else {
7070 let playerPubKey58 = toBase58String(i.callerPublicKey)
7171 let gameDataStr = (((((((("SUBMITTED" + "_") + tableId) + "_") + playerPubKey58) + "_") + toString(payment.amount)) + "_") + AssetToString(payment))
7272 ScriptResult(WriteSet([DataEntry(gameId, gameDataStr)]), TransferSet(nil))
7373 }
7474 }
7575
7676
7777
7878 @Callable(i)
7979 func withdraw (gameId,payment,rsaSign) = {
8080 let gameDataList = split(ExtractString(gameId), "_")
8181 let gameState = gameDataList[0]
8282 let tableId = gameDataList[1]
8383 let playerPubKey58 = gameDataList[2]
8484 let assetName = gameDataList[4]
8585 let playerAddress = addressFromPublicKey(fromBase58String(playerPubKey58))
8686 let rsaSigValid = rsaVerify(SHA256, toBytes(gameId), rsaSign, RSAPUBLIC)
8787 if ((gameState != "SUBMITTED"))
8888 then throw("Invalid game state for passed gameId. Game aborted.")
8989 else if (!(rsaSigValid))
9090 then throw("Invalid RSA Verification")
9191 else {
9292 let newGameDataStr = ((((((("WON_" + tableId) + "_") + playerPubKey58) + "_") + payment) + "_") + assetName)
9393 let winAmt = parseIntValue(payment)
9494 let assetType = StringToAsset(assetName)
9595 ScriptResult(WriteSet([DataEntry(gameId, newGameDataStr)]), TransferSet([ScriptTransfer(playerAddress, fraction(winAmt, 94, 100), assetType), ScriptTransfer(WALLETCOMMUNITY, fraction(winAmt, FEECOMMUNITY, 100), assetType), ScriptTransfer(WALLETWAVESBET, fraction(winAmt, FEEWAVESBET, 100), assetType), ScriptTransfer(WALLETMCAFEE, fraction(winAmt, FEEMCAFEE, 100), assetType)]))
9696 }
9797 }
9898
9999

github/deemru/w8io/169f3d6 
23.93 ms