tx · L7odvTZf4qHxfwczwtCjvmpHHnsn6jkNNvzes2m7Raj

3Mz7zzdQoHabgytXU3UuTAzADXPBBLgFqu8:  -0.01400000 Waves

2019.12.11 02:05 [803330] smart account 3Mz7zzdQoHabgytXU3UuTAzADXPBBLgFqu8 > SELF 0.00000000 Waves

{ "type": 13, "id": "L7odvTZf4qHxfwczwtCjvmpHHnsn6jkNNvzes2m7Raj", "fee": 1400000, "feeAssetId": null, "timestamp": 1576019145614, "version": 1, "sender": "3Mz7zzdQoHabgytXU3UuTAzADXPBBLgFqu8", "senderPublicKey": "6uncmj7GmSzxFAGGX8NcToqPxTxWUHW7Aj1WSbMH2qXw", "proofs": [ "3uRNPVyW2jMMfYcMXTSA56kgh4tBSrS7LcT5XKXUaXMJCM3eEZtVEQJvTWKbWthZaZk2CfDpo5KdYF7Z7sAbxSAf" ], "script": "base64:AAIDAAAAAAAAAAcIARIDCgEIAAAADwAAAAAJUlNBUFVCTElDCQACWwAAAAECAAABj2Jhc2U2NDpNSUlCSWpBTkJna3Foa2lHOXcwQkFRRUZBQU9DQVE4QU1JSUJDZ0tDQVFFQWc0ZEFSNlhiQkRBUzloci9FajNkSnY2RmZjNDY2eC9tT0dNV1UzbHJBQnMzcWE4QkhtdUpHbmtmYnBFZjJ2QXdZVE9XUHZ2emZNMTBPQmJmbG9TeXEzYzlNS3Z5VGUxbHVCTEdxVzR2WlVYSXl2U2d6MWxpeVVWZWZJUXkzZHlGOWpiZVRaYkMwYmJjVC83TzNERUwrMDF6NkErckRDYWNTWjBsR29sU1E2QW5oTHh6SWtWcE9RSmJyQm1DK3grWnVaUENNV3pKeW5kNWFlT243amFqL21rUlZ5eGU2Zy8wT2hXejROaWlaWGV1TVJCKzhtS3kwZldEL1VsSWxaV0hzQVMyWm1ya1hLcWpMcTAvMHdyOElMSmt6bmpTcWRuSTVJYmpnM3VRcmovNEFOK2k5cjI4YVE3My9aa1B0WTVTYncwQU9pQUJCdTdnSG1xOWF5VnhaUUlEQVFBQg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RFRAIAAAABXwUAAAAOcGxheWVyUHViS2V5NTgCAAAAAV8FAAAABGJldHMJAQAAAAxTY3JpcHRSZXN1bHQAAAACCQEAAAAIV3JpdGVTZXQAAAABCQAETAAAAAIJAQAAAAlEYXRhRW50cnkAAAACBQAAAA9HQU1FU0NPVU5URVJLRVkFAAAACm5ld0dhbWVOdW0JAARMAAAAAgkBAAAACURhdGFFbnRyeQAAAAIFAAAABmdhbWVJZAUAAAALZ2FtZURhdGFTdHIFAAAAA25pbAkBAAAAC1RyYW5zZmVyU2V0AAAAAQUAAAADbmlsAAAAAC+yhJs=", "chainId": 84, "height": 803330, "spentComplexity": 0 } View: original | compacted Prev: 2c25SLZ75rY4Fn43yBzt6g8uGQkCaisQZzW6DQqwMfv7 Next: 2LGBLtP3dbiqw4a58x2hc5UMiw3N8jxU3NugaQCsXiXN Diff:
OldNewDifferences
5151 let payment = extract(i.payment)
5252 let feeAssetId = isDefined(i.feeAssetId)
5353 let playerBalance = wavesBalance(i.caller)
54- let a = getAmt(bets)
54+ let a = (getAmt(bets) * 1000000000)
5555 if ((payment.assetId != WBET))
5656 then throw("Payment should be in Wavesbet")
5757 else if ((1000000 > playerBalance))
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
66 let GAMESCOUNTERKEY = "$GAME_NUM"
77
88 let WBET = base58'A4q1mYKo11yuH9gmvDodeJoksagcyQzeFE9JtphMWddw'
99
1010 let WALLETWAVESBET = Address(base58'3MtCy2PCFPyu8A9SRNL4qUo1V17SGLHftD8')
1111
1212 let WALLETMCAFEE = Address(base58'3MtCy2PCFPyu8A9SRNL4qUo1V17SGLHftD8')
1313
1414 let WAVELET = 100000000
1515
1616 let FEEWAVESBET = 4
1717
1818 let FEEMCAFEE = 2
1919
2020 let STATESUBMITTED = "SUBMITTED"
2121
2222 let STATEWON = "WON"
2323
2424 let STATELOST = "LOST"
2525
2626 let BETMIN = (1 * WAVELET)
2727
2828 let BETMAX = (20000000 * WAVELET)
2929
3030 func getAmt (bets) = {
3131 let bts = split(bets, "_")
3232 (((((((((parseIntValue(drop(bts[0], 4)) + parseIntValue(drop(bts[1], 4))) + parseIntValue(drop(bts[2], 4))) + parseIntValue(drop(bts[3], 4))) + parseIntValue(drop(bts[4], 4))) + parseIntValue(drop(bts[5], 4))) + parseIntValue(drop(bts[6], 4))) + parseIntValue(drop(bts[7], 4))) + parseIntValue(drop(bts[8], 4))) + parseIntValue(drop(bts[9], 4)))
3333 }
3434
3535
3636 func IncrementGameNum () = {
3737 let gameNum = match getInteger(this, GAMESCOUNTERKEY) {
3838 case num: Int =>
3939 num
4040 case _ =>
4141 0
4242 }
4343 (gameNum + 1)
4444 }
4545
4646
4747 @Callable(i)
4848 func playRoulette (bets) = {
4949 let gameId = toBase58String(i.transactionId)
5050 let gameIdUsed = isDefined(getString(this, gameId))
5151 let payment = extract(i.payment)
5252 let feeAssetId = isDefined(i.feeAssetId)
5353 let playerBalance = wavesBalance(i.caller)
54- let a = getAmt(bets)
54+ let a = (getAmt(bets) * 1000000000)
5555 if ((payment.assetId != WBET))
5656 then throw("Payment should be in Wavesbet")
5757 else if ((1000000 > playerBalance))
5858 then throw("There are not enough waves, it takes 0.01 Waves to bet. Game aborted.")
5959 else if (feeAssetId)
6060 then throw("Transaction's fee must be in Waves. Game aborted.")
6161 else if (gameIdUsed)
6262 then throw("Passed gameId had been used before. Game aborted.")
6363 else if ((a != payment.amount))
6464 then throw((("Payment value is different from bet value. " + toString(a)) + toString(payment.amount)))
6565 else {
6666 let newGameNum = IncrementGameNum()
6767 let playerPubKey58 = toBase58String(i.callerPublicKey)
6868 let gameDataStr = ((((STATESUBMITTED + "_") + playerPubKey58) + "_") + bets)
6969 ScriptResult(WriteSet([DataEntry(GAMESCOUNTERKEY, newGameNum), DataEntry(gameId, gameDataStr)]), TransferSet(nil))
7070 }
7171 }
7272
7373

github/deemru/w8io/169f3d6 
36.45 ms