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:
Old | New | | Differences |
---|
1 | | - | {-# STDLIB_VERSION 3 #-} |
---|
| 1 | + | {-# STDLIB_VERSION 5 #-} |
---|
2 | 2 | | {-# SCRIPT_TYPE ACCOUNT #-} |
---|
3 | 3 | | {-# CONTENT_TYPE DAPP #-} |
---|
4 | 4 | | let a = Address(base58'3N2i7ygFVfQLEoupDNpBT7FLcjh4Sb38wm9') |
---|
5 | 5 | | |
---|
6 | | - | let b = Address(base58'3N1SNsqhyGDYAA7b8ZTgwhD7QHGJMT4nBJX') |
---|
| 6 | + | let b = nil |
---|
7 | 7 | | |
---|
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 | + | } |
---|
19 | 12 | | |
---|
20 | 13 | | |
---|
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) |
---|
22 | 23 | | 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)] |
---|
26 | 27 | | } |
---|
27 | 28 | | |
---|
28 | 29 | | |
---|
29 | 30 | | |
---|
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") |
---|
32 | 40 | | |
---|
33 | 41 | | |
---|
34 | 42 | | @Verifier(l) |
---|
Full:
Old | New | | Differences |
---|
1 | | - | {-# STDLIB_VERSION 3 #-} |
---|
| 1 | + | {-# STDLIB_VERSION 5 #-} |
---|
2 | 2 | | {-# SCRIPT_TYPE ACCOUNT #-} |
---|
3 | 3 | | {-# CONTENT_TYPE DAPP #-} |
---|
4 | 4 | | let a = Address(base58'3N2i7ygFVfQLEoupDNpBT7FLcjh4Sb38wm9') |
---|
5 | 5 | | |
---|
6 | | - | let b = Address(base58'3N1SNsqhyGDYAA7b8ZTgwhD7QHGJMT4nBJX') |
---|
| 6 | + | let b = nil |
---|
7 | 7 | | |
---|
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 | + | } |
---|
19 | 12 | | |
---|
20 | 13 | | |
---|
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) |
---|
22 | 23 | | 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)] |
---|
26 | 27 | | } |
---|
27 | 28 | | |
---|
28 | 29 | | |
---|
29 | 30 | | |
---|
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") |
---|
32 | 40 | | |
---|
33 | 41 | | |
---|
34 | 42 | | @Verifier(l) |
---|
35 | 43 | | func m () = sigVerify(l.bodyBytes, l.proofs[0], l.senderPublicKey) |
---|
36 | 44 | | |
---|