tx · FDSwg7maZmdACsjQ9mK9Utz51EmiPBTUkCvBvbpWqFC 3ND1HjEmmoTW8PNnwfzVsa2fLyj6KHqG3Dq: -0.01000000 Waves 2021.10.14 21:54 [1746331] smart account 3ND1HjEmmoTW8PNnwfzVsa2fLyj6KHqG3Dq > SELF 0.00000000 Waves
{ "type": 13, "id": "FDSwg7maZmdACsjQ9mK9Utz51EmiPBTUkCvBvbpWqFC", "fee": 1000000, "feeAssetId": null, "timestamp": 1634237668397, "version": 2, "chainId": 84, "sender": "3ND1HjEmmoTW8PNnwfzVsa2fLyj6KHqG3Dq", "senderPublicKey": "CdLPZgGrzqnG3MWoZeBQUgLyx1BdN6MkKWrrM9zgsPj", "proofs": [ "63oYEVyif9AkMRozuJ96RWEB4j9ropBrecL7ursPL8Qa8oXSNpwMxuDw4JezubrpoxRoVCR7tr4h39KQLgWdGpwz" ], "script": "base64:AAIDAAAAAAAAAAgIARIECgIBAQAAAAIBAAAACnJhbmRvbWl6ZXIAAAABAAAAA2ludgQAAAAIbGFzdFBsYXkEAAAAByRtYXRjaDAJAAQcAAAAAgUAAAAEdGhpcwIAAAAIbGFzdFBsYXkDCQAAAQAAAAIFAAAAByRtYXRjaDACAAAACkJ5dGVWZWN0b3IEAAAAAXMFAAAAByRtYXRjaDAFAAAAAXMDCQAAAQAAAAIFAAAAByRtYXRjaDACAAAABFVuaXQBAAAADFdhdmVzTG90dG9WMgkAAAIAAAABAgAAAAtNYXRjaCBlcnJvcgQAAAAEcmFuZAkAAMsAAAACCQAAywAAAAIJAADLAAAAAgkAAMsAAAACCQAAywAAAAIFAAAACGxhc3RQbGF5CAUAAAADaW52AAAADXRyYW5zYWN0aW9uSWQIBQAAAANpbnYAAAAPY2FsbGVyUHVibGljS2V5CAUAAAAJbGFzdEJsb2NrAAAAE2dlbmVyYXRpb25TaWduYXR1cmUJAAGaAAAAAQgFAAAACWxhc3RCbG9jawAAAAl0aW1lc3RhbXAJAAGaAAAAAQgFAAAACWxhc3RCbG9jaw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AANpbnYBAAAACXplcm8yaGVybwAAAAIAAAAKZ3Vlc3NTdGFydAAAAAhndWVzc0VuZAkBAAAACnN0YXJ0TG90dG8AAAADBQAAAANpbnYFAAAACmd1ZXNzU3RhcnQFAAAACGd1ZXNzRW5kAAAAAGLVhpU=", "height": 1746331, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: none Next: none Full:
Old | New | Differences | |
---|---|---|---|
1 | - | # no script | |
1 | + | {-# STDLIB_VERSION 3 #-} | |
2 | + | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | + | {-# CONTENT_TYPE DAPP #-} | |
4 | + | func a (b) = { | |
5 | + | let c = { | |
6 | + | let d = getBinary(this, "lastPlay") | |
7 | + | if ($isInstanceOf(d, "ByteVector")) | |
8 | + | then { | |
9 | + | let e = d | |
10 | + | e | |
11 | + | } | |
12 | + | else if ($isInstanceOf(d, "Unit")) | |
13 | + | then base58'2ee4oFDYriWJ9EMeR' | |
14 | + | else throw("Match error") | |
15 | + | } | |
16 | + | let f = (((((c + b.transactionId) + b.callerPublicKey) + lastBlock.generationSignature) + toBytes(lastBlock.timestamp)) + toBytes(lastBlock.height)) | |
17 | + | sha256(f) | |
18 | + | } | |
19 | + | ||
20 | + | ||
21 | + | func g (b,h,i) = { | |
22 | + | let j = (wavesBalance(this) / 100) | |
23 | + | let k = extract(b.payment) | |
24 | + | if (!(isDefined(b.payment))) | |
25 | + | then throw("Should be with Payment in Waves") | |
26 | + | else if (isDefined(k.assetId)) | |
27 | + | then throw("Payment should be in Waves") | |
28 | + | else if ((k.amount > j)) | |
29 | + | then throw(("Payment should be less than " + toString(j))) | |
30 | + | else if ((0 > h)) | |
31 | + | then throw("guessStart and guessEnd Must be in between 0-100") | |
32 | + | else if ((i > 100)) | |
33 | + | then throw("guessStart and guessEnd Must be in between 0-100") | |
34 | + | else if ((h > i)) | |
35 | + | then throw("guessStart and guessEnd Must be in between 0-100") | |
36 | + | else { | |
37 | + | let l = toBase58String(b.caller.bytes) | |
38 | + | let m = a(b) | |
39 | + | let f = (toInt(m) % 101) | |
40 | + | let n = getIntegerValue(this, (toBase58String(b.caller.bytes) + "_win_amount")) | |
41 | + | let o = if (isDefined(n)) | |
42 | + | then n | |
43 | + | else 0 | |
44 | + | let p = getIntegerValue(this, (toBase58String(b.caller.bytes) + "_play_amount")) | |
45 | + | let q = if (isDefined(p)) | |
46 | + | then p | |
47 | + | else 0 | |
48 | + | if (if ((i > f)) | |
49 | + | then (f > h) | |
50 | + | else false) | |
51 | + | then { | |
52 | + | let r = WriteSet([DataEntry("lastPlay", f), DataEntry("lastbet", ((toString(h) + "_") + toString(i))), DataEntry((l + "_play_amount"), (q + 1)), DataEntry((l + "_win_amount"), (o + 1))]) | |
53 | + | ScriptResult(r, TransferSet([ScriptTransfer(b.caller, ((k.amount * 190) / 100), unit)])) | |
54 | + | } | |
55 | + | else { | |
56 | + | let r = WriteSet([DataEntry("lastPlay", f), DataEntry("lastbet", ((toString(h) + "_") + toString(i))), DataEntry((l + "_play_amount"), (q + 1)), DataEntry((l + "_win_amount"), o)]) | |
57 | + | ScriptResult(r, TransferSet(nil)) | |
58 | + | } | |
59 | + | } | |
60 | + | } | |
61 | + | ||
62 | + | ||
63 | + | @Callable(b) | |
64 | + | func zero2hero (h,i) = g(b, h, i) | |
65 | + | ||
66 | + |
github/deemru/w8io/169f3d6 20.66 ms ◑