tx · WDfkA1kxWyD2MubAodwzbm63sTpptRsNKAGjhokRUoH 3MsD5LWNJmQkkWpj3RtaeRVrKGLgoCE7kpB: -0.01000000 Waves 2019.08.21 07:44 [640410] smart account 3MsD5LWNJmQkkWpj3RtaeRVrKGLgoCE7kpB > SELF 0.00000000 Waves
{ "type": 13, "id": "WDfkA1kxWyD2MubAodwzbm63sTpptRsNKAGjhokRUoH", "fee": 1000000, "feeAssetId": null, "timestamp": 1566362654537, "version": 1, "sender": "3MsD5LWNJmQkkWpj3RtaeRVrKGLgoCE7kpB", "senderPublicKey": "6f7rQN8AP2zH649ga8sXpVDY7aM2AgjJijB2qGmJBaMo", "proofs": [ "4mcdXSyHQHafEX2LM7b66AR5FS5XWqj5PCRQgjdKkTTnbWJk5XSfZujfuxGyxciaQzAknDRzULEvZaPpc5UvHnj2" ], "script": "base64:AAIDAAAAAAAAAAAAAAAKAAAAAAlSU0FQVUJMSUMJAAJbAAAAAQIAAAGPYmFzZTY0Ok1JSUJJakFOQmdrcWhraUc5dzBCQVFFRkFBT0NBUThBTUlJQkNnS0NBUUVBbGVtcjk1SjFqWlVzN2NKbXJtbWxONHpvN1lWc0JKekllSmRrOExERkdoVUtTSTZ5ZnMyMFp5SmUyMSs2R0p3Tm5LVVUxVXlvYzE3d1NXTUtrclowTU12WUUrWjVBaWlqdkJLNHNTSjNJZ0dqZFU4L05oSThDQkR1MEYreFJNOXEzVEIzTExiRHk1c0JkdWRZZkhmc1VPYytNVHZBRDY5bjI3ZGIyUmg4K3laUU10dWJrdVRRTnA4OXNwaEhRYUxHeVFGYU5sSy9OYTNsRng2b21xemFhMWdqb3BsVXI2cnZZS2dmQUlDVUIzelZtSlNoaUVpN3c3UjBoV2xOUkQzcWNaakNVT05TcEZvNFdiemtuR09henc4NEIrSU1JRm5JcFhXelFMOFJYMHZOY2ZzQnZMRGZNNmsyWmFjcXd5TUthTExxaWdkQmlHZEo3VyswbE9TdE9RSURBUUFCAAAAABNSQU5ET1JBQ0xFVEl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V0Q29tbW9uRGF0YQkABEwAAAACCQEAAAAOU2NyaXB0VHJhbnNmZXIAAAADBQAAAA9wbGF5ZXJBZGRyZXNzVHgAAAAAAAAAAAoFAAAABHVuaXQFAAAAA25pbAkBAAAADFNjcmlwdFJlc3VsdAAAAAIJAQAAAAhXcml0ZVNldAAAAAEFAAAABGdhbWUJAQAAAAtUcmFuc2ZlclNldAAAAAEFAAAADnRTZXRDb21tb25EYXRhAAAAAWkBAAAACHdpdGhkcmF3AAAAAQAAAAZhbW91bnQEAAAACmN1cnJlbnRLZXkJAAJYAAAAAQgIBQAAAAFpAAAABmNhbGxlcgAAAAVieXRlcwQAAAANY3VycmVudEFtb3VudAQAAAAHJG1hdGNoMAkABBoAAAACBQAAAAR0aGlzBQAAAApjdXJyZW50S2V5AwkAAAEAAAACBQAAAAckbWF0Y2gwAgAAAANJbnQEAAAAAWEFAAAAByRtYXRjaDAFAAAAAWEAAAAAAAAAAAAEAAAACW5ld0Ftb3VudAkAAGUAAAACBQAAAA1jdXJyZW50QW1vdW50BQAAAAZhbW91bnQDCQAAZgAAAAIAAAAAAAAAAAAFAAAABmFtb3VudAkAAAIAAAABAgAAAB5DYW4ndCB3aXRoZHJhdyBuZWdhdGl2ZSBhbW91bnQDCQAAZgAAAAIAAAAAAAAAAAAFAAAACW5ld0Ftb3VudAkAAAIAAAABAgAAABJOb3QgZW5vdWdoIGJhbGFuY2UJAQAAAAxTY3JpcHRSZXN1bHQAAAACCQEAAAAIV3JpdGVTZXQAAAABCQAETAAAAAIJAQAAAAlEYXRhRW50cnkAAAACBQAAAApjdXJyZW50S2V5BQAAAAluZXdBbW91bnQFAAAAA25pbAkBAAAAC1RyYW5zZmVyU2V0AAAAAQkABEwAAAACCQEAAAAOU2NyaXB0VHJhbnNmZXIAAAADCAUAAAABaQAAAAZjYWxsZXIFAAAABmFtb3VudAUAAAAEdW5pdAUAAAADbmlsAAAAAKlGYzM=", "chainId": 84, "height": 640410, "spentComplexity": 0 } View: original | compacted Prev: none Next: 5q33ofW7UwEF3vQiK1DzS1XaLH1TTFoSqFGMydqNyc8T Full:
Old | New | Differences | |
---|---|---|---|
1 | - | # no script | |
1 | + | {-# STDLIB_VERSION 3 #-} | |
2 | + | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | + | {-# CONTENT_TYPE DAPP #-} | |
4 | + | let RSAPUBLIC = fromBase64String("base64:MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAlemr95J1jZUs7cJmrmmlN4zo7YVsBJzIeJdk8LDFGhUKSI6yfs20ZyJe21+6GJwNnKUU1Uyoc17wSWMKkrZ0MMvYE+Z5AiijvBK4sSJ3IgGjdU8/NhI8CBDu0F+xRM9q3TB3LLbDy5sBdudYfHfsUOc+MTvAD69n27db2Rh8+yZQMtubkuTQNp89sphHQaLGyQFaNlK/Na3lFx6omqzaa1gjoplUr6rvYKgfAICUB3zVmJShiEi7w7R0hWlNRD3qcZjCUONSpFo4WbzknGOazw84B+IMIFnIpXWzQL8RX0vNcfsBvLDfM6k2ZacqwyMKaLLqigdBiGdJ7W+0lOStOQIDAQAB") | |
5 | + | ||
6 | + | let RANDORACLETIMEFRAME = 4320 | |
7 | + | ||
8 | + | let WAVELET = ((100 * 1000) * 1000) | |
9 | + | ||
10 | + | let COMMISSION = ((5 * WAVELET) / 1000) | |
11 | + | ||
12 | + | let BET1 = (1 * WAVELET) | |
13 | + | ||
14 | + | let BET2 = (2 * WAVELET) | |
15 | + | ||
16 | + | let BET4 = (4 * WAVELET) | |
17 | + | ||
18 | + | let BET8 = (8 * WAVELET) | |
19 | + | ||
20 | + | let BET14 = (14 * WAVELET) | |
21 | + | ||
22 | + | func getAnswer (playerChoice) = BET14 | |
23 | + | ||
24 | + | ||
25 | + | @Callable(i) | |
26 | + | func bet (playerChoice) = { | |
27 | + | let playerAddress = toBase58String(i.caller.bytes) | |
28 | + | let answer = getAnswer(playerChoice) | |
29 | + | let amount = i.payment | |
30 | + | let game = [DataEntry((playerAddress + " это Ставка Игрока"), playerChoice), DataEntry("Ответ Сервера", answer)] | |
31 | + | let playerAddressTx = Address(i.caller.bytes) | |
32 | + | let tSetCommonData = [ScriptTransfer(playerAddressTx, 10, unit)] | |
33 | + | ScriptResult(WriteSet(game), TransferSet(tSetCommonData)) | |
34 | + | } | |
35 | + | ||
36 | + | ||
37 | + | ||
38 | + | @Callable(i) | |
39 | + | func withdraw (amount) = { | |
40 | + | let currentKey = toBase58String(i.caller.bytes) | |
41 | + | let currentAmount = match getInteger(this, currentKey) { | |
42 | + | case a: Int => | |
43 | + | a | |
44 | + | case _ => | |
45 | + | 0 | |
46 | + | } | |
47 | + | let newAmount = (currentAmount - amount) | |
48 | + | if ((0 > amount)) | |
49 | + | then throw("Can't withdraw negative amount") | |
50 | + | else if ((0 > newAmount)) | |
51 | + | then throw("Not enough balance") | |
52 | + | else ScriptResult(WriteSet([DataEntry(currentKey, newAmount)]), TransferSet([ScriptTransfer(i.caller, amount, unit)])) | |
53 | + | } | |
54 | + | ||
55 | + |
github/deemru/w8io/169f3d6 21.92 ms ◑