tx · 2c25SLZ75rY4Fn43yBzt6g8uGQkCaisQZzW6DQqwMfv7

3Mz7zzdQoHabgytXU3UuTAzADXPBBLgFqu8:  -0.01400000 Waves

2019.12.11 02:01 [803327] smart account 3Mz7zzdQoHabgytXU3UuTAzADXPBBLgFqu8 > SELF 0.00000000 Waves

{ "type": 13, "id": "2c25SLZ75rY4Fn43yBzt6g8uGQkCaisQZzW6DQqwMfv7", "fee": 1400000, "feeAssetId": null, "timestamp": 1576018900482, "version": 1, "sender": "3Mz7zzdQoHabgytXU3UuTAzADXPBBLgFqu8", "senderPublicKey": "6uncmj7GmSzxFAGGX8NcToqPxTxWUHW7Aj1WSbMH2qXw", "proofs": [ "eQZphx9AWCBPbgwuPSBR5BVzXzULYn41bKMTuoNpoRPA8Fptaud5tDEhwd88o2WiUizEpkTJxbA7usUk51SFX1F" ], "script": "base64:AAIDAAAAAAAAAAcIARIDCgEIAAAADwAAAAAJUlNBUFVCTElDCQACWwAAAAECAAABj2Jhc2U2NDpNSUlCSWpBTkJna3Foa2lHOXcwQkFRRUZBQU9DQVE4QU1JSUJDZ0tDQVFFQWc0ZEFSNlhiQkRBUzloci9FajNkSnY2RmZjNDY2eC9tT0dNV1UzbHJBQnMzcWE4QkhtdUpHbmtmYnBFZjJ2QXdZVE9XUHZ2emZNMTBPQmJmbG9TeXEzYzlNS3Z5VGUxbHVCTEdxVzR2WlVYSXl2U2d6MWxpeVVWZWZJUXkzZHlGOWpiZVRaYkMwYmJjVC83TzNERUwrMDF6NkErckRDYWNTWjBsR29sU1E2QW5oTHh6SWtWcE9RSmJyQm1DK3grWnVaUENNV3pKeW5kNWFlT243amFqL21rUlZ5eGU2Zy8wT2hXejROaWlaWGV1TVJCKzhtS3kwZldEL1VsSWxaV0hzQVMyWm1ya1hLcWpMcTAvMHdyOElMSmt6bmpTcWRuSTVJYmpnM3VRcmovNEFOK2k5cjI4YVE3My9aa1B0WTVTYncwQU9pQUJCdTdnSG1xOWF5VnhaUUlEQVFBQgAAA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AADnBsYXllclB1YktleTU4AgAAAAFfBQAAAARiZXRzCQEAAAAMU2NyaXB0UmVzdWx0AAAAAgkBAAAACFdyaXRlU2V0AAAAAQkABEwAAAACCQEAAAAJRGF0YUVudHJ5AAAAAgUAAAAPR0FNRVNDT1VOVEVSS0VZBQAAAApuZXdHYW1lTnVtCQAETAAAAAIJAQAAAAlEYXRhRW50cnkAAAACBQAAAAZnYW1lSWQFAAAAC2dhbWVEYXRhU3RyBQAAAANuaWwJAQAAAAtUcmFuc2ZlclNldAAAAAEFAAAAA25pbAAAAACaIkZi", "chainId": 84, "height": 803327, "spentComplexity": 0 } View: original | compacted Prev: 6JkRa4ErCMiCbFSgakUMvXJRJLUCJ6wmnU1kTCD5AfL4 Next: L7odvTZf4qHxfwczwtCjvmpHHnsn6jkNNvzes2m7Raj Diff:
OldNewDifferences
2828 let BETMAX = (20000000 * WAVELET)
2929
3030 func getAmt (bets) = {
31- let b01 = take(drop(bets, 4), 10)
32- let b02 = take(drop(bets, 19), 10)
33- let b03 = take(drop(bets, 34), 10)
34- let b04 = take(drop(bets, 49), 10)
35- let b05 = take(drop(bets, 64), 10)
36- let b06 = take(drop(bets, 79), 10)
37- let b07 = take(drop(bets, 94), 10)
38- let b08 = take(drop(bets, 109), 10)
39- let b09 = take(drop(bets, 124), 10)
40- let b10 = take(drop(bets, 139), 10)
41- (((((((((parseIntValue(b01) + parseIntValue(b02)) + parseIntValue(b03)) + parseIntValue(b04)) + parseIntValue(b05)) + parseIntValue(b06)) + parseIntValue(b07)) + parseIntValue(b08)) + parseIntValue(b09)) + parseIntValue(b10))
31+ let bts = split(bets, "_")
32+ (((((((((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)))
4233 }
4334
4435
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) = {
31- let b01 = take(drop(bets, 4), 10)
32- let b02 = take(drop(bets, 19), 10)
33- let b03 = take(drop(bets, 34), 10)
34- let b04 = take(drop(bets, 49), 10)
35- let b05 = take(drop(bets, 64), 10)
36- let b06 = take(drop(bets, 79), 10)
37- let b07 = take(drop(bets, 94), 10)
38- let b08 = take(drop(bets, 109), 10)
39- let b09 = take(drop(bets, 124), 10)
40- let b10 = take(drop(bets, 139), 10)
41- (((((((((parseIntValue(b01) + parseIntValue(b02)) + parseIntValue(b03)) + parseIntValue(b04)) + parseIntValue(b05)) + parseIntValue(b06)) + parseIntValue(b07)) + parseIntValue(b08)) + parseIntValue(b09)) + parseIntValue(b10))
31+ let bts = split(bets, "_")
32+ (((((((((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)))
4233 }
4334
4435
4536 func IncrementGameNum () = {
4637 let gameNum = match getInteger(this, GAMESCOUNTERKEY) {
4738 case num: Int =>
4839 num
4940 case _ =>
5041 0
5142 }
5243 (gameNum + 1)
5344 }
5445
5546
5647 @Callable(i)
5748 func playRoulette (bets) = {
5849 let gameId = toBase58String(i.transactionId)
5950 let gameIdUsed = isDefined(getString(this, gameId))
6051 let payment = extract(i.payment)
6152 let feeAssetId = isDefined(i.feeAssetId)
6253 let playerBalance = wavesBalance(i.caller)
6354 let a = getAmt(bets)
6455 if ((payment.assetId != WBET))
6556 then throw("Payment should be in Wavesbet")
6657 else if ((1000000 > playerBalance))
6758 then throw("There are not enough waves, it takes 0.01 Waves to bet. Game aborted.")
6859 else if (feeAssetId)
6960 then throw("Transaction's fee must be in Waves. Game aborted.")
7061 else if (gameIdUsed)
7162 then throw("Passed gameId had been used before. Game aborted.")
7263 else if ((a != payment.amount))
7364 then throw((("Payment value is different from bet value. " + toString(a)) + toString(payment.amount)))
7465 else {
7566 let newGameNum = IncrementGameNum()
7667 let playerPubKey58 = toBase58String(i.callerPublicKey)
7768 let gameDataStr = ((((STATESUBMITTED + "_") + playerPubKey58) + "_") + bets)
7869 ScriptResult(WriteSet([DataEntry(GAMESCOUNTERKEY, newGameNum), DataEntry(gameId, gameDataStr)]), TransferSet(nil))
7970 }
8071 }
8172
8273

github/deemru/w8io/169f3d6 
65.69 ms