tx · ATsU1m5FkF1XgRi25BpbYtVX5ExNu2Wz23Mgyja5zCwH 3N4boZRUJ2LxY5jLyp6hmxGktqnawQidu6H: -0.00200000 Waves 2022.09.14 22:36 [2229204] smart account 3N4boZRUJ2LxY5jLyp6hmxGktqnawQidu6H > SELF 0.00000000 Waves
{ "type": 13, "id": "ATsU1m5FkF1XgRi25BpbYtVX5ExNu2Wz23Mgyja5zCwH", "fee": 200000, "feeAssetId": null, "timestamp": 1663184207164, "version": 2, "chainId": 84, "sender": "3N4boZRUJ2LxY5jLyp6hmxGktqnawQidu6H", "senderPublicKey": "BDeCphaaC4MZvfmbJqQZ78EvuEBZTJ1VEW7fbxue8BUu", "proofs": [ "3DKXWagK4EBZcWD5Sd6XY6KQpTc4e3t8YXgRP8WoLXERUkp2Y1XvRh2ABbeMDuDFX22Gc5xqHnZepKyF8dUQnVQD" ], "script": "base64:BgIKCAISBAoCAggSAAQADGtVc2VyUGF5bWVudAIHUGF5bWVudAAEa1dvbgIDV29uAAlzZXBhcmF0b3ICAS8BCXJhbmRvbWl6ZQIFYnl0ZXMFcmFuZ2UEBGhhc2gJAPcDAQUFYnl0ZXMEBWluZGV4CQCxCQEFBGhhc2gJAGoCBQVpbmRleAUFcmFuZ2UCAWkBCGNvdW50aW5nAgVieXRlcwZjYWxsZXIDCQECIT0CCAUBaQZjYWxsZXIFBHRoaXMJAAIBAgpPbmx5IG93bmVyBAVjb3VudAkBCXJhbmRvbWl6ZQIJAMkBAgUFYnl0ZXMJAGkCCQDIAQEFBWJ5dGVzAAIACgMJAGcCBQVjb3VudAADCQDMCAIJAQxCb29sZWFuRW50cnkCCQCsAgIJAKwCAgUEa1dvbgUJc2VwYXJhdG9yBQZjYWxsZXIHBQNuaWwJAMwIAgkBDEJvb2xlYW5FbnRyeQIJAKwCAgkArAICBQRrV29uBQlzZXBhcmF0b3IFBmNhbGxlcgYFA25pbAFpAQlzdGFydEdhbWUABAZhbW91bnQJAQV2YWx1ZQEICQCRAwIIBQFpC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2YWx1ZSBpcyBub3QgZXF1YWwgdG8gaXRzZWxmLgBlsIUU", "height": 2229204, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: GsizKh7j4ggip5T1gJgTWa6ZCXBZiJ7cAAwJrQvE8Qx8 Next: EGCRjyGUx2mvfrnXukWTtVknps6FmqeqpzdpXkaRdVLa Diff:
Old | New | Differences | |
---|---|---|---|
31 | 31 | let amount = value(i.payments[0].amount) | |
32 | 32 | if ((i.payments[0].assetId != unit)) | |
33 | 33 | then throw("Pay in waves") | |
34 | - | else if ((amount > | |
34 | + | else if ((amount > 1000000000)) | |
35 | 35 | then throw("Maximum bet 10 waves") | |
36 | 36 | else { | |
37 | 37 | let nullInitStore = invoke(this, "counting", [i.transactionId, toString(i.caller)], nil) |
Old | New | Differences | |
---|---|---|---|
1 | 1 | {-# STDLIB_VERSION 6 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | 4 | let kUserPayment = "Payment" | |
5 | 5 | ||
6 | 6 | let kWon = "Won" | |
7 | 7 | ||
8 | 8 | let separator = "/" | |
9 | 9 | ||
10 | 10 | func randomize (bytes,range) = { | |
11 | 11 | let hash = sha256(bytes) | |
12 | 12 | let index = toInt(hash) | |
13 | 13 | (index % range) | |
14 | 14 | } | |
15 | 15 | ||
16 | 16 | ||
17 | 17 | @Callable(i) | |
18 | 18 | func counting (bytes,caller) = if ((i.caller != this)) | |
19 | 19 | then throw("Only owner") | |
20 | 20 | else { | |
21 | 21 | let count = randomize(take(bytes, (size(bytes) / 2)), 10) | |
22 | 22 | if ((count >= 3)) | |
23 | 23 | then [BooleanEntry(((kWon + separator) + caller), false)] | |
24 | 24 | else [BooleanEntry(((kWon + separator) + caller), true)] | |
25 | 25 | } | |
26 | 26 | ||
27 | 27 | ||
28 | 28 | ||
29 | 29 | @Callable(i) | |
30 | 30 | func startGame () = { | |
31 | 31 | let amount = value(i.payments[0].amount) | |
32 | 32 | if ((i.payments[0].assetId != unit)) | |
33 | 33 | then throw("Pay in waves") | |
34 | - | else if ((amount > | |
34 | + | else if ((amount > 1000000000)) | |
35 | 35 | then throw("Maximum bet 10 waves") | |
36 | 36 | else { | |
37 | 37 | let nullInitStore = invoke(this, "counting", [i.transactionId, toString(i.caller)], nil) | |
38 | 38 | if ((nullInitStore == nullInitStore)) | |
39 | 39 | then { | |
40 | 40 | let won = valueOrErrorMessage(getBoolean(this, ((kWon + separator) + toString(i.caller))), "Storage read error") | |
41 | 41 | if (won) | |
42 | 42 | then [ScriptTransfer(i.caller, (amount * 2), unit), DeleteEntry(((kWon + separator) + toString(i.caller))), BooleanEntry(((((kWon + separator) + toString(i.caller)) + separator) + toString(randomize(i.transactionId, 1000))), true)] | |
43 | 43 | else [DeleteEntry(((kWon + separator) + toString(i.caller))), BooleanEntry(((((kWon + separator) + toString(i.caller)) + separator) + toString(randomize(i.transactionId, 1000))), false)] | |
44 | 44 | } | |
45 | 45 | else throw("Strict value is not equal to itself.") | |
46 | 46 | } | |
47 | 47 | } | |
48 | 48 | ||
49 | 49 |
github/deemru/w8io/169f3d6 54.39 ms ◑