tx · ENZgHeF8WCyiWhNf5Tr9B6VX91rRPaq2cy3zn4EnS124
3MsGBnTzBhrNe6w1KpLYPkzdDdxWudm4U89: -0.01400000 Waves
2019.08.21 07:59 [640425] smart account 3MsGBnTzBhrNe6w1KpLYPkzdDdxWudm4U89 > SELF 0.00000000 Waves
{
"type": 13,
"id": "ENZgHeF8WCyiWhNf5Tr9B6VX91rRPaq2cy3zn4EnS124",
"fee": 1400000,
"feeAssetId": null,
"timestamp": 1566362778851,
"version": 1,
"sender": "3MsGBnTzBhrNe6w1KpLYPkzdDdxWudm4U89",
"senderPublicKey": "FgbqvGasMMrXxbhwrsgEiCgJLjXPjgn8kHxsZiVmLrkb",
"proofs": [
"4jMaFfkuAKTLgdLg7Qsznq9HHss4Jo4v55UBnaru4afuSCeMJ22p5SEELNcimcoXosrCG9iqLQRTeb8QqXGXJUB9"
],
"script": "base64:AAIDAAAAAAAAAAAAAAAKAAAAAAlSU0FQVUJMSUMJAAJbAAAAAQIAAAGPYmFzZTY0Ok1JSUJJakFOQmdrcWhraUc5dzBCQVFFRkFBT0NBUThBTUlJQkNnS0NBUUVBbGVtcjk1SjFqWlVzN2NKbXJtbWxONHpvN1lWc0JKekllSmRrOExERkdoVUtTSTZ5ZnMyMFp5SmUyMSs2R0p3Tm5LVVUxVXlvYzE3d1NXTUtrclowTU12WUUrWjVBaWlqdkJLNHNTSjNJZ0dqZFU4L05oSThDQkR1MEYreFJNOXEzVEIzTExiRHk1c0JkdWRZZkhmc1VPYytNVHZBRDY5bjI3ZGIyUmg4K3laUU10dWJrdVRRTnA4OXNwaEhRYUxHeVFGYU5sSy9OYTNsRng2b21xemFhMWdqb3BsVXI2cnZZS2dmQUlDVUIzelZtSlNoaUVpN3c3UjBoV2xOUkQzcWNaakNVT05TcEZvNFdiemtuR09henc4NEIrSU1JRm5JcFhXelFMOFJYMHZOY2ZzQnZMRGZNNmsyWmFjcXd5TUthTExxaWdkQmlHZEo3VyswbE9TdE9RSURBUUFCAAAAABNSQ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plexity": 0
}
View: original | compacted
Prev: 7ghdh12Zkw3pDgVFaZmQ5SVQdka4FRdvy9RzbPZj9jxP
Next: HidEkjBgMN73s5GwJiThZa1hyhP4SqMyRVjsEpuyEkVF
Diff:
Old | New | | Differences |
---|
1 | 1 | | {-# STDLIB_VERSION 3 #-} |
---|
2 | 2 | | {-# SCRIPT_TYPE ACCOUNT #-} |
---|
3 | 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 | + | |
---|
4 | 8 | | let WAVELET = ((100 * 1000) * 1000) |
---|
5 | 9 | | |
---|
6 | 10 | | let COMMISSION = ((5 * WAVELET) / 1000) |
---|
|
20 | 24 | | |
---|
21 | 25 | | @Callable(i) |
---|
22 | 26 | | func bet (playerChoice) = { |
---|
23 | | - | let callerAddress = toBase58String(i.caller.bytes) |
---|
| 27 | + | let playerAddress = toBase58String(i.caller.bytes) |
---|
24 | 28 | | let answer = getAnswer(playerChoice) |
---|
25 | 29 | | let amount = i.payment |
---|
26 | | - | WriteSet([DataEntry((callerAddress + " это Ставка Игрока"), playerChoice), DataEntry("Ответ Сервера", answer)]) |
---|
| 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)) |
---|
27 | 34 | | } |
---|
28 | 35 | | |
---|
29 | 36 | | |
---|
Full:
Old | New | | Differences |
---|
1 | 1 | | {-# STDLIB_VERSION 3 #-} |
---|
2 | 2 | | {-# SCRIPT_TYPE ACCOUNT #-} |
---|
3 | 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 | + | |
---|
4 | 8 | | let WAVELET = ((100 * 1000) * 1000) |
---|
5 | 9 | | |
---|
6 | 10 | | let COMMISSION = ((5 * WAVELET) / 1000) |
---|
7 | 11 | | |
---|
8 | 12 | | let BET1 = (1 * WAVELET) |
---|
9 | 13 | | |
---|
10 | 14 | | let BET2 = (2 * WAVELET) |
---|
11 | 15 | | |
---|
12 | 16 | | let BET4 = (4 * WAVELET) |
---|
13 | 17 | | |
---|
14 | 18 | | let BET8 = (8 * WAVELET) |
---|
15 | 19 | | |
---|
16 | 20 | | let BET14 = (14 * WAVELET) |
---|
17 | 21 | | |
---|
18 | 22 | | func getAnswer (playerChoice) = BET14 |
---|
19 | 23 | | |
---|
20 | 24 | | |
---|
21 | 25 | | @Callable(i) |
---|
22 | 26 | | func bet (playerChoice) = { |
---|
23 | | - | let callerAddress = toBase58String(i.caller.bytes) |
---|
| 27 | + | let playerAddress = toBase58String(i.caller.bytes) |
---|
24 | 28 | | let answer = getAnswer(playerChoice) |
---|
25 | 29 | | let amount = i.payment |
---|
26 | | - | WriteSet([DataEntry((callerAddress + " это Ставка Игрока"), playerChoice), DataEntry("Ответ Сервера", answer)]) |
---|
| 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)) |
---|
27 | 34 | | } |
---|
28 | 35 | | |
---|
29 | 36 | | |
---|
30 | 37 | | |
---|
31 | 38 | | @Callable(i) |
---|
32 | 39 | | func withdraw (amount) = { |
---|
33 | 40 | | let currentKey = toBase58String(i.caller.bytes) |
---|
34 | 41 | | let currentAmount = match getInteger(this, currentKey) { |
---|
35 | 42 | | case a: Int => |
---|
36 | 43 | | a |
---|
37 | 44 | | case _ => |
---|
38 | 45 | | 0 |
---|
39 | 46 | | } |
---|
40 | 47 | | let newAmount = (currentAmount - amount) |
---|
41 | 48 | | if ((0 > amount)) |
---|
42 | 49 | | then throw("Can't withdraw negative amount") |
---|
43 | 50 | | else if ((0 > newAmount)) |
---|
44 | 51 | | then throw("Not enough balance") |
---|
45 | 52 | | else ScriptResult(WriteSet([DataEntry(currentKey, newAmount)]), TransferSet([ScriptTransfer(i.caller, amount, unit)])) |
---|
46 | 53 | | } |
---|
47 | 54 | | |
---|
48 | 55 | | |
---|