tx · 37qHXXHTSec5oXip1bCnb2WCqjeYnFawNaPwWN3eWtgN

3N1SNsqhyGDYAA7b8ZTgwhD7QHGJMT4nBJX:  -0.01000000 Waves

2022.04.03 16:08 [1992449] smart account 3N1SNsqhyGDYAA7b8ZTgwhD7QHGJMT4nBJX > SELF 0.00000000 Waves

{ "type": 13, "id": "37qHXXHTSec5oXip1bCnb2WCqjeYnFawNaPwWN3eWtgN", "fee": 1000000, "feeAssetId": null, "timestamp": 1648991292819, "version": 2, "chainId": 84, "sender": "3N1SNsqhyGDYAA7b8ZTgwhD7QHGJMT4nBJX", "senderPublicKey": "B6nC1bV4M26PtCHchSuaoTMtRz8Kp4ywEkErAYbfJ8NY", "proofs": [ "5Ba7YJ5SUvosV398wiTcubRZgFGjWBi5AwikmZakgHwuoAbyyJhqmrypwnUm4XZtKewCJUa2jT3Kv11RxnXxuUtY" ], "script": "base64:AAIFAAAAAAAAAAgIAhIAEgASAAAAAAQAAAAABW93bmVyCQEAAAAHQWRkcmVzcwAAAAEBAAAAGgFUjFZ7fOjZY90m9pn8ViGu955KF8V0o4vQAAAAAAdwbGF5ZXJzBQAAAANuaWwBAAAACnJhbmRvbWl6ZXIAAAABAAAAA2ludgQAAAAEcmFuZAkAAMsAAAACCAUAAAADaW52AAAADXRyYW5zYWN0aW9uSWQIBQAAAANpbnYAAAAPY2FsbGVyUHVibGljS2V5BQAAAARyYW5kAQAAABBhZGRQbGF5ZXJzVG9MaXN0AAAAAQAAAAFpCQAETQAAAAIFAAAAB3BsYXllcnMIBQAAAAFpAAAABmNhbGxlcgAAAAMAAAABaQEAAAAKZ2V0UGxheWVycwAAAAAFAAAAB3BsYXllcnMAAAABaQEAAAAFZW50ZXIAAAAABAAAAAFhCQEAAAAQYWRkUGxheWVyc1RvTGlzdAAAAAEFAAAAAWkEAAAADXBsYXllckFkZHJlc3MIBQAAAAFpAAAABmNhbGxlcgkABEwAAAACCQEAAAAOU2NyaXB0VHJhbnNmZXIAAAADBQAAAAR0aGlzCAkAAZEAAAACCAUAAAABaQAAAAhwYXltZW50cwAAAAAAAAAAAAAAAAZhbW91bnQFAAAABHVuaXQFAAAAA25pbAAAAAFpAQAAAApwaWNrV2lubmVyAAAAAAMJAAAAAAAAAggFAAAAAWkAAAAGY2FsbGVyBQAAAAR0aGlzBAAAAA9udW1iZXJPZlBsYXllcnMJAAGQAAAAAQUAAAAHcGxheWVycwQAAAAEcmFuZAkABLEAAAABCQEAAAAKcmFuZG9taXplcgAAAAEFAAAAAWkEAAAADnNlbGVjdGVkUGxheWVyCQABkQAAAAIFAAAAB3BsYXllcnMJAABqAAAAAgUAAAAEcmFuZAUAAAAPbnVtYmVyT2ZQbGF5ZXJzCQAETAAAAAIJAQAAAA5TY3JpcHRUcmFuc2ZlcgAAAAMFAAAADnNlbGVjdGVkUGxheWVyCQAAaQAAAAIJAABoAAAAAggJAAPvAAAAAQUAAAAEdGhpcwAAAAlhdmFpbGFibGUAAAAAAAAAAFAAAAAAAAAAAGQFAAAABHVuaXQJAARMAAAAAgkBAAAADlNjcmlwdFRyYW5zZmVyAAAAAwUAAAAFb3duZXIJAABpAAAAAgkAAGgAAAACCAkAA+8AAAABBQAAAAR0aGlzAAAACWF2YWlsYWJsZQAAAAAAAAAAFAAAAAAAAAAAZAUAAAAEdW5pdAUAAAADbmlsCQAAAgAAAAECAAAAFllvdSBoYXZlbnQgcGVybWlzc2lvbnMAAAABAAAAAnR4AQAAAAZ2ZXJpZnkAAAAACQAB9AAAAAMIBQAAAAJ0eAAAAAlib2R5Qnl0ZXMJAAGRAAAAAggFAAAAAnR4AAAABnByb29mcwAAAAAAAAAAAAgFAAAAAnR4AAAAD3NlbmRlclB1YmxpY0tleVewglU=", "height": 1992449, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: BAAbNPXiubUtakxy8Zf7FpCJoStP1Jv6dpy3BhxUJxxK Next: none Diff:
OldNewDifferences
1-{-# STDLIB_VERSION 3 #-}
1+{-# STDLIB_VERSION 5 #-}
22 {-# SCRIPT_TYPE ACCOUNT #-}
33 {-# CONTENT_TYPE DAPP #-}
44 let a = Address(base58'3N2i7ygFVfQLEoupDNpBT7FLcjh4Sb38wm9')
55
6-let b = Address(base58'3N1SNsqhyGDYAA7b8ZTgwhD7QHGJMT4nBJX')
6+let b = nil
77
8-let c = 20
9-
10-let d = 5
11-
12-let e = 100
13-
14-let f = 0
15-
16-let g = nil
17-
18-func h () = g
8+func c (d) = {
9+ let e = (d.transactionId + d.callerPublicKey)
10+ e
11+ }
1912
2013
21-@Callable(i)
14+func f (g) = (b :+ g.caller)
15+
16+
17+@Callable(g)
18+func getPlayers () = b
19+
20+
21+
22+@Callable(g)
2223 func enter () = {
23- let j = toBase58String(i.caller.bytes)
24- let k = extract(i.payment)
25- TransferSet([ScriptTransfer(this, k.amount, unit)])
24+ let h = f(g)
25+ let i = g.caller
26+[ScriptTransfer(this, g.payments[0].amount, unit)]
2627 }
2728
2829
2930
30-@Callable(i)
31-func pickWinner () = WriteSet(nil)
31+@Callable(g)
32+func pickWinner () = if ((g.caller == this))
33+ then {
34+ let j = size(b)
35+ let e = toInt(c(g))
36+ let k = b[(e % j)]
37+[ScriptTransfer(k, ((wavesBalance(this).available * 80) / 100), unit), ScriptTransfer(a, ((wavesBalance(this).available * 20) / 100), unit)]
38+ }
39+ else throw("You havent permissions")
3240
3341
3442 @Verifier(l)
Full:
OldNewDifferences
1-{-# STDLIB_VERSION 3 #-}
1+{-# STDLIB_VERSION 5 #-}
22 {-# SCRIPT_TYPE ACCOUNT #-}
33 {-# CONTENT_TYPE DAPP #-}
44 let a = Address(base58'3N2i7ygFVfQLEoupDNpBT7FLcjh4Sb38wm9')
55
6-let b = Address(base58'3N1SNsqhyGDYAA7b8ZTgwhD7QHGJMT4nBJX')
6+let b = nil
77
8-let c = 20
9-
10-let d = 5
11-
12-let e = 100
13-
14-let f = 0
15-
16-let g = nil
17-
18-func h () = g
8+func c (d) = {
9+ let e = (d.transactionId + d.callerPublicKey)
10+ e
11+ }
1912
2013
21-@Callable(i)
14+func f (g) = (b :+ g.caller)
15+
16+
17+@Callable(g)
18+func getPlayers () = b
19+
20+
21+
22+@Callable(g)
2223 func enter () = {
23- let j = toBase58String(i.caller.bytes)
24- let k = extract(i.payment)
25- TransferSet([ScriptTransfer(this, k.amount, unit)])
24+ let h = f(g)
25+ let i = g.caller
26+[ScriptTransfer(this, g.payments[0].amount, unit)]
2627 }
2728
2829
2930
30-@Callable(i)
31-func pickWinner () = WriteSet(nil)
31+@Callable(g)
32+func pickWinner () = if ((g.caller == this))
33+ then {
34+ let j = size(b)
35+ let e = toInt(c(g))
36+ let k = b[(e % j)]
37+[ScriptTransfer(k, ((wavesBalance(this).available * 80) / 100), unit), ScriptTransfer(a, ((wavesBalance(this).available * 20) / 100), unit)]
38+ }
39+ else throw("You havent permissions")
3240
3341
3442 @Verifier(l)
3543 func m () = sigVerify(l.bodyBytes, l.proofs[0], l.senderPublicKey)
3644

github/deemru/w8io/169f3d6 
28.54 ms