tx · A8FLxY7xbtgRHVY26pCvB7R17CsCGiZntkjqAP9vXasd 3MqQhA21mw1UHWmdGMV9M9xQL1cpC93LF8o: -0.01000000 Waves 2022.04.28 14:29 [2028262] smart account 3MqQhA21mw1UHWmdGMV9M9xQL1cpC93LF8o > SELF 0.00000000 Waves
{ "type": 13, "id": "A8FLxY7xbtgRHVY26pCvB7R17CsCGiZntkjqAP9vXasd", "fee": 1000000, "feeAssetId": null, "timestamp": 1651145360189, "version": 2, "chainId": 84, "sender": "3MqQhA21mw1UHWmdGMV9M9xQL1cpC93LF8o", "senderPublicKey": "E3TwKTkJRoqHq8mpKDYP1GvftP8ECfnCUT5atXuMXq53", "proofs": [ "ERXQ7hHytdkS8JQNcLhMLc5rNDhfXUirG7ikBeiwpcHQ9S93ESCvQQwXkmgbo1MSCoErZ5kxkRuSA4oYTPxgDPD" ], "script": "base64:AAIFAAAAAAAAAAoIAhIECgIICBIAAAAADAAAAAANUEFZTUVOVF9BU1NFVAEAAAAgrZ1IFoWReWfvw0p6hpnR3VDpBUk85P5AREeM4YPEwvQAAAAADFJFV0FSRF9BU1NFVAEAAAAgLTcTgdMkN12f4W9209EPk+8sLPTdia1cSlbofMkBchsAAAAABnBpeGVscwUAAAAMUkVXQVJEX0FTU0VUAAAAAAR4TUlOAAAAAAAAAAAAAAAAAAR4TUFYAAAAAAAAAASxAAAAAAR5TUlOAAAAAAAAAAAAAAAAAAR5TUFYAAAAAAAAAAJZAAAAAA1SRVdBUkRfQU1PVU5UAAAAAAAF9eEAAAAAAAxTVEFSVF9IRUlHSFQAAAAAAAAe8fQAAAAACkVORF9IRUlHSFQJAABkAAAAAgUAAAAMU1RBUlRfSEVJR0hUCQAAaAAAAAIAAAAAAAAABaAAAAAAAAAAAB4AAAAABmNvbG9ycwkABEwAAAACAgAAAAMwMDAJAARMAAAAAgIAAAADZmZmCQAETAAAAAICAAAABjAwMDAwMAkABEwAAAACAgAAAAZmZmZmZmYJAARMAAAAAgIAAAAGRkYwMjAw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b2xvcgkAAAIAAAABAgAAABxnYW1lIGlzIG5vdCBhY3RpdmUgcmlnaHQgbm93AAAAAWkBAAAACHNodXRkb3duAAAAAAkAAAIAAAABAgAAAAR0ZXN0AAAAADbsn+c=", "height": 2028262, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: GpqodifZrmhZk2U8NBpLZMV76VAgzjhdWHmUJzBtayuy Next: 7J6HDs7Vp3q4zCY6Fhqo8iDqtyQfEKUu74b3yRr5tLDD Diff:
Old | New | Differences | |
---|---|---|---|
4 | 4 | let PAYMENT_ASSET = base58'CgidgEMbCKXXErgJXVyZCFRaK8SBNA73Jg8mNXALtVKh' | |
5 | 5 | ||
6 | 6 | let REWARD_ASSET = base58'43W4FcqA1rEpSmUGHoGiXvpSLfhadws9LS5j3SJsKxxS' | |
7 | + | ||
8 | + | let pixels = REWARD_ASSET | |
9 | + | ||
10 | + | let xMIN = 0 | |
11 | + | ||
12 | + | let xMAX = 1201 | |
13 | + | ||
14 | + | let yMIN = 0 | |
15 | + | ||
16 | + | let yMAX = 601 | |
17 | + | ||
18 | + | let REWARD_AMOUNT = 100000000 | |
19 | + | ||
20 | + | let START_HEIGHT = 2028020 | |
21 | + | ||
22 | + | let END_HEIGHT = (START_HEIGHT + (1440 * 30)) | |
23 | + | ||
24 | + | let colors = ["000", "fff", "000000", "ffffff", "FF0200", "800080", "FF00FF", "008001", "FEFF00", "020080", "0800FF", "183937", "09FEFF", "7076E9", "C0C0C0", "C3103B", "ff0200", "ff00ff", "feff00", "0800ff", "09feff", "7076e9", "c0c0c0", "c3103b"] | |
7 | 25 | ||
8 | 26 | func isPaymentOk (i) = { | |
9 | 27 | let acceptableAssetId = PAYMENT_ASSET | |
24 | 42 | ||
25 | 43 | ||
26 | 44 | @Callable(i) | |
27 | - | func coordinates (veri,xy) = { | |
28 | - | let pixels = REWARD_ASSET | |
29 | - | let xMIN = 0 | |
30 | - | let xMAX = 1201 | |
31 | - | let yMIN = 0 | |
32 | - | let yMAX = 601 | |
33 | - | let REWARD_AMOUNT = 100000000 | |
34 | - | let START_HEIGHT = 2028020 | |
35 | - | let END_HEIGHT = (START_HEIGHT + (1440 * 30)) | |
36 | - | let colors = ["000", "fff", "000000", "ffffff", "FF0200", "800080", "FF00FF", "008001", "FEFF00", "020080", "0800FF", "183937", "09FEFF", "7076E9", "C0C0C0", "C3103B", "ff0200", "ff00ff", "feff00", "0800ff", "09feff", "7076e9", "c0c0c0", "c3103b"] | |
37 | - | if (if ((height > START_HEIGHT)) | |
38 | - | then (END_HEIGHT > height) | |
39 | - | else false) | |
40 | - | then { | |
41 | - | let color = containsElement(colors, veri) | |
42 | - | if (color) | |
43 | - | then { | |
44 | - | let currentKey = toBase58String(i.caller.bytes) | |
45 | - | let wallet = (((currentKey + "_") + xy) + "_c") | |
46 | - | let splitter = split(xy, "_") | |
47 | - | let x = valueOrElse(parseInt(splitter[0]), 0) | |
48 | - | let y = valueOrElse(parseInt(splitter[1]), 0) | |
49 | - | if (if (if (if ((x >= xMIN)) | |
50 | - | then (xMAX > x) | |
51 | - | else false) | |
52 | - | then (y >= yMIN) | |
53 | - | else false) | |
54 | - | then (yMAX > y) | |
55 | - | else false) | |
56 | - | then { | |
57 | - | let isEmpty = getString(this, wallet) | |
58 | - | if (isPaymentOk(i)) | |
59 | - | then [StringEntry(wallet, veri), ScriptTransfer(i.caller, REWARD_AMOUNT, pixels)] | |
60 | - | else throw("Wrong payment amount or asset") | |
61 | - | } | |
62 | - | else throw("out of context") | |
63 | - | } | |
64 | - | else throw("wrong color") | |
65 | - | } | |
66 | - | else throw("game is not active right now") | |
67 | - | } | |
45 | + | func coordinates (veri,xy) = if (if ((height > START_HEIGHT)) | |
46 | + | then (END_HEIGHT > height) | |
47 | + | else false) | |
48 | + | then { | |
49 | + | let color = containsElement(colors, veri) | |
50 | + | if (color) | |
51 | + | then { | |
52 | + | let currentKey = toBase58String(i.caller.bytes) | |
53 | + | let wallet = (((currentKey + "_") + xy) + "_c") | |
54 | + | let splitter = split(xy, "_") | |
55 | + | let x = valueOrElse(parseInt(splitter[0]), 0) | |
56 | + | let y = valueOrElse(parseInt(splitter[1]), 0) | |
57 | + | if (if (if (if ((x >= xMIN)) | |
58 | + | then (xMAX > x) | |
59 | + | else false) | |
60 | + | then (y >= yMIN) | |
61 | + | else false) | |
62 | + | then (yMAX > y) | |
63 | + | else false) | |
64 | + | then { | |
65 | + | let isEmpty = getString(this, wallet) | |
66 | + | if (isPaymentOk(i)) | |
67 | + | then [StringEntry(wallet, veri), ScriptTransfer(i.caller, REWARD_AMOUNT, pixels)] | |
68 | + | else throw("Wrong payment amount or asset") | |
69 | + | } | |
70 | + | else throw("out of context") | |
71 | + | } | |
72 | + | else throw("wrong color") | |
73 | + | } | |
74 | + | else throw("game is not active right now") | |
75 | + | ||
76 | + | ||
77 | + | ||
78 | + | @Callable(i) | |
79 | + | func shutdown () = throw("test") | |
68 | 80 | ||
69 | 81 |
Old | New | Differences | |
---|---|---|---|
1 | 1 | {-# STDLIB_VERSION 5 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | 4 | let PAYMENT_ASSET = base58'CgidgEMbCKXXErgJXVyZCFRaK8SBNA73Jg8mNXALtVKh' | |
5 | 5 | ||
6 | 6 | let REWARD_ASSET = base58'43W4FcqA1rEpSmUGHoGiXvpSLfhadws9LS5j3SJsKxxS' | |
7 | + | ||
8 | + | let pixels = REWARD_ASSET | |
9 | + | ||
10 | + | let xMIN = 0 | |
11 | + | ||
12 | + | let xMAX = 1201 | |
13 | + | ||
14 | + | let yMIN = 0 | |
15 | + | ||
16 | + | let yMAX = 601 | |
17 | + | ||
18 | + | let REWARD_AMOUNT = 100000000 | |
19 | + | ||
20 | + | let START_HEIGHT = 2028020 | |
21 | + | ||
22 | + | let END_HEIGHT = (START_HEIGHT + (1440 * 30)) | |
23 | + | ||
24 | + | let colors = ["000", "fff", "000000", "ffffff", "FF0200", "800080", "FF00FF", "008001", "FEFF00", "020080", "0800FF", "183937", "09FEFF", "7076E9", "C0C0C0", "C3103B", "ff0200", "ff00ff", "feff00", "0800ff", "09feff", "7076e9", "c0c0c0", "c3103b"] | |
7 | 25 | ||
8 | 26 | func isPaymentOk (i) = { | |
9 | 27 | let acceptableAssetId = PAYMENT_ASSET | |
10 | 28 | if ((size(i.payments) == 0)) | |
11 | 29 | then throw("Payment not attached") | |
12 | 30 | else { | |
13 | 31 | let p = i.payments[0] | |
14 | 32 | match p.assetId { | |
15 | 33 | case assetId: ByteVector => | |
16 | 34 | if ((assetId == acceptableAssetId)) | |
17 | 35 | then (p.amount == 1000000) | |
18 | 36 | else false | |
19 | 37 | case _ => | |
20 | 38 | throw("Wrong payment asset") | |
21 | 39 | } | |
22 | 40 | } | |
23 | 41 | } | |
24 | 42 | ||
25 | 43 | ||
26 | 44 | @Callable(i) | |
27 | - | func coordinates (veri,xy) = { | |
28 | - | let pixels = REWARD_ASSET | |
29 | - | let xMIN = 0 | |
30 | - | let xMAX = 1201 | |
31 | - | let yMIN = 0 | |
32 | - | let yMAX = 601 | |
33 | - | let REWARD_AMOUNT = 100000000 | |
34 | - | let START_HEIGHT = 2028020 | |
35 | - | let END_HEIGHT = (START_HEIGHT + (1440 * 30)) | |
36 | - | let colors = ["000", "fff", "000000", "ffffff", "FF0200", "800080", "FF00FF", "008001", "FEFF00", "020080", "0800FF", "183937", "09FEFF", "7076E9", "C0C0C0", "C3103B", "ff0200", "ff00ff", "feff00", "0800ff", "09feff", "7076e9", "c0c0c0", "c3103b"] | |
37 | - | if (if ((height > START_HEIGHT)) | |
38 | - | then (END_HEIGHT > height) | |
39 | - | else false) | |
40 | - | then { | |
41 | - | let color = containsElement(colors, veri) | |
42 | - | if (color) | |
43 | - | then { | |
44 | - | let currentKey = toBase58String(i.caller.bytes) | |
45 | - | let wallet = (((currentKey + "_") + xy) + "_c") | |
46 | - | let splitter = split(xy, "_") | |
47 | - | let x = valueOrElse(parseInt(splitter[0]), 0) | |
48 | - | let y = valueOrElse(parseInt(splitter[1]), 0) | |
49 | - | if (if (if (if ((x >= xMIN)) | |
50 | - | then (xMAX > x) | |
51 | - | else false) | |
52 | - | then (y >= yMIN) | |
53 | - | else false) | |
54 | - | then (yMAX > y) | |
55 | - | else false) | |
56 | - | then { | |
57 | - | let isEmpty = getString(this, wallet) | |
58 | - | if (isPaymentOk(i)) | |
59 | - | then [StringEntry(wallet, veri), ScriptTransfer(i.caller, REWARD_AMOUNT, pixels)] | |
60 | - | else throw("Wrong payment amount or asset") | |
61 | - | } | |
62 | - | else throw("out of context") | |
63 | - | } | |
64 | - | else throw("wrong color") | |
65 | - | } | |
66 | - | else throw("game is not active right now") | |
67 | - | } | |
45 | + | func coordinates (veri,xy) = if (if ((height > START_HEIGHT)) | |
46 | + | then (END_HEIGHT > height) | |
47 | + | else false) | |
48 | + | then { | |
49 | + | let color = containsElement(colors, veri) | |
50 | + | if (color) | |
51 | + | then { | |
52 | + | let currentKey = toBase58String(i.caller.bytes) | |
53 | + | let wallet = (((currentKey + "_") + xy) + "_c") | |
54 | + | let splitter = split(xy, "_") | |
55 | + | let x = valueOrElse(parseInt(splitter[0]), 0) | |
56 | + | let y = valueOrElse(parseInt(splitter[1]), 0) | |
57 | + | if (if (if (if ((x >= xMIN)) | |
58 | + | then (xMAX > x) | |
59 | + | else false) | |
60 | + | then (y >= yMIN) | |
61 | + | else false) | |
62 | + | then (yMAX > y) | |
63 | + | else false) | |
64 | + | then { | |
65 | + | let isEmpty = getString(this, wallet) | |
66 | + | if (isPaymentOk(i)) | |
67 | + | then [StringEntry(wallet, veri), ScriptTransfer(i.caller, REWARD_AMOUNT, pixels)] | |
68 | + | else throw("Wrong payment amount or asset") | |
69 | + | } | |
70 | + | else throw("out of context") | |
71 | + | } | |
72 | + | else throw("wrong color") | |
73 | + | } | |
74 | + | else throw("game is not active right now") | |
75 | + | ||
76 | + | ||
77 | + | ||
78 | + | @Callable(i) | |
79 | + | func shutdown () = throw("test") | |
68 | 80 | ||
69 | 81 |
github/deemru/w8io/026f985 23.69 ms ◑