tx · Ac6W2vMfD6FJUeYP86ZNzBo1VNXiRzqZZJzwJGML12Pi

3N778wrQUp2Fm75ZTwtZ2WM7L9R2hT1Pavb:  -0.01400000 Waves

2020.03.17 19:58 [913544] smart account 3N778wrQUp2Fm75ZTwtZ2WM7L9R2hT1Pavb > SELF 0.00000000 Waves

{ "type": 13, "id": "Ac6W2vMfD6FJUeYP86ZNzBo1VNXiRzqZZJzwJGML12Pi", "fee": 1400000, "feeAssetId": null, "timestamp": 1584464257079, "version": 1, "sender": "3N778wrQUp2Fm75ZTwtZ2WM7L9R2hT1Pavb", "senderPublicKey": "GDLTHJjR9hamQRzEMe3M685bqZSbdGzjtEXWbQupogZQ", "proofs": [ "4JWXeYFZ8CizapU3tFijzw6KEYpxu7SJXcowtWLaDsrtj4fNSdePp3VToE4rus8j43x9Vd19M2q7tCaXMATB4yj6" ], "script": "base64:AAIDAAAAAAAAAA4IARIDCgEIEgUKAwgIAgAAAA0AAAAACVJTQVBVQkxJQwkAAlsAAAABAgAAAY9iYXNlNjQ6TUlJQklqQU5CZ2txaGtpRzl3MEJBUUVGQUFPQ0FROEFNSUlCQ2dLQ0FRRUFnNGRBUjZYYkJEQVM5aHIvRWozZEp2NkZmYzQ2NngvbU9HTVdVM2xyQUJzM3FhOEJIbXVKR25rZmJwRWYydkF3WVRPV1B2dnpmTTEwT0JiZmxvU3lxM2M5TUt2eVRlMWx1QkxHcVc0dlpVWEl5dlNnejFsaXlVVmVmSVF5M2R5RjlqYmVUWmJDMGJiY1QvN08zREVMKzAxejZBK3JEQ2FjU1owbEdvbFNRNkFuaEx4eklrVnBPUUpickJtQyt4K1p1WlBDTVd6SnluZDVhZU9uN2phai9ta1JWeXhlNmcvME9oV3o0TmlpWlhldU1SQis4bUt5MGZXRC9VbElsWldIc0FTMlptcmtYS3FqTHEwLzB3cjhJTEprem5qU3Fkbkk1SWJqZzN1UXJqLzRBTitpOXIyOGFRNzMvWmtQdFk1U2J3MEFPaUFCQnU3Z0htcTlheVZ4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zZXROYW1lBAAAAAZ3aW5BbXQJAQAAAA1wYXJzZUludFZhbHVlAAAAAQUAAAAHcGF5bWVudAQAAAAJYXNzZXRUeXBlCQEAAAANU3RyaW5nVG9Bc3NldAAAAAEFAAAACWFzc2V0TmFtZQkBAAAADFNjcmlwdFJlc3VsdAAAAAIJAQAAAAhXcml0ZVNldAAAAAEJAARMAAAAAgkBAAAACURhdGFFbnRyeQAAAAIFAAAABmdhbWVJZAUAAAAObmV3R2FtZURhdGFTdHIFAAAAA25pbAkBAAAAC1RyYW5zZmVyU2V0AAAAAQkABEwAAAACCQEAAAAOU2NyaXB0VHJhbnNmZXIAAAADBQAAAA1wbGF5ZXJBZGRyZXNzBQAAAAZ3aW5BbXQFAAAACWFzc2V0VHlwZQUAAAADbmlsAAAAACdKxL0=", "chainId": 84, "height": 913544, "spentComplexity": 0 } View: original | compacted Prev: DcFGxUgQ9WHYogWJYfFmvDjPuJzGMb2w4r5dCYwXCgov Next: TuPHCiQEEJMxmd5v1RtF6Tn6FjzT3z9EpNC84q4kUP1 Diff:
OldNewDifferences
11 {-# STDLIB_VERSION 3 #-}
22 {-# SCRIPT_TYPE ACCOUNT #-}
33 {-# CONTENT_TYPE DAPP #-}
4-let RSAPUBLIC = fromBase64String("MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAoVVwBoT58X6saLum22vC++e0VvUAyZZBKY8qOR0tQKmX4VE6LKHO3Krn9AGMcu2BnTYEBUTd7cW0S47jMOVjDjpOQI0IKcXrhS+yZr06/gNdLHPDu25BjxU2KwJFyiE+2CQ24eAHAnyvZiPCBhbcUAdH/IXmOB222BJK9cRBdBHb/tvpoxuSjdJdCrpSWH1Eqx3nXedQ/hGnSMzO+fwIruRskSM7xNv7OQ/i/AGjnCpI50Juri21nKjDa54NK8FrX1RPLcU2MrOi3UB80u55L/zsYzR90Kil8iqvsKRJ9nwWV+5TuufspDY3ZSePQZH7AY1fpBlMJFocTWEKYFU1FQIDAQAB")
4+let RSAPUBLIC = fromBase64String("base64:MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAg4dAR6XbBDAS9hr/Ej3dJv6Ffc466x/mOGMWU3lrABs3qa8BHmuJGnkfbpEf2vAwYTOWPvvzfM10OBbfloSyq3c9MKvyTe1luBLGqW4vZUXIyvSgz1liyUVefIQy3dyF9jbeTZbC0bbcT/7O3DEL+01z6A+rDCacSZ0lGolSQ6AnhLxzIkVpOQJbrBmC+x+ZuZPCMWzJynd5aeOn7jaj/mkRVyxe6g/0OhWz4NiiZXeuMRB+8mKy0fWD/UlIlZWHsAS2ZmrkXKqjLq0/0wr8ILJkznjSqdnI5Ibjg3uQrj/4AN+i9r28aQ73/ZkPtY5Sbw0AOiABBu7gHmq9ayVxZQIDAQAB")
55
66 let WAVES = base58'WAVES'
77
Full:
OldNewDifferences
11 {-# STDLIB_VERSION 3 #-}
22 {-# SCRIPT_TYPE ACCOUNT #-}
33 {-# CONTENT_TYPE DAPP #-}
4-let RSAPUBLIC = fromBase64String("MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAoVVwBoT58X6saLum22vC++e0VvUAyZZBKY8qOR0tQKmX4VE6LKHO3Krn9AGMcu2BnTYEBUTd7cW0S47jMOVjDjpOQI0IKcXrhS+yZr06/gNdLHPDu25BjxU2KwJFyiE+2CQ24eAHAnyvZiPCBhbcUAdH/IXmOB222BJK9cRBdBHb/tvpoxuSjdJdCrpSWH1Eqx3nXedQ/hGnSMzO+fwIruRskSM7xNv7OQ/i/AGjnCpI50Juri21nKjDa54NK8FrX1RPLcU2MrOi3UB80u55L/zsYzR90Kil8iqvsKRJ9nwWV+5TuufspDY3ZSePQZH7AY1fpBlMJFocTWEKYFU1FQIDAQAB")
4+let RSAPUBLIC = fromBase64String("base64:MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAg4dAR6XbBDAS9hr/Ej3dJv6Ffc466x/mOGMWU3lrABs3qa8BHmuJGnkfbpEf2vAwYTOWPvvzfM10OBbfloSyq3c9MKvyTe1luBLGqW4vZUXIyvSgz1liyUVefIQy3dyF9jbeTZbC0bbcT/7O3DEL+01z6A+rDCacSZ0lGolSQ6AnhLxzIkVpOQJbrBmC+x+ZuZPCMWzJynd5aeOn7jaj/mkRVyxe6g/0OhWz4NiiZXeuMRB+8mKy0fWD/UlIlZWHsAS2ZmrkXKqjLq0/0wr8ILJkznjSqdnI5Ibjg3uQrj/4AN+i9r28aQ73/ZkPtY5Sbw0AOiABBu7gHmq9ayVxZQIDAQAB")
55
66 let WAVES = 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"))
4747 then WAVES
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([ScriptTransfer(WALLETCOMMUNITY, fraction(payment.amount, FEECOMMUNITY, 100), payment.assetId), ScriptTransfer(WALLETWAVESBET, fraction(payment.amount, FEEWAVESBET, 100), payment.assetId), ScriptTransfer(WALLETMCAFEE, fraction(payment.amount, FEEMCAFEE, 100), payment.assetId)]))
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, winAmt, assetType)]))
9696 }
9797 }
9898
9999

github/deemru/w8io/026f985 
28.26 ms