tx · GpqodifZrmhZk2U8NBpLZMV76VAgzjhdWHmUJzBtayuy 3MqQhA21mw1UHWmdGMV9M9xQL1cpC93LF8o: -0.01000000 Waves 2022.04.28 10:53 [2028047] smart account 3MqQhA21mw1UHWmdGMV9M9xQL1cpC93LF8o > SELF 0.00000000 Waves
{ "type": 13, "id": "GpqodifZrmhZk2U8NBpLZMV76VAgzjhdWHmUJzBtayuy", "fee": 1000000, "feeAssetId": null, "timestamp": 1651132444156, "version": 2, "chainId": 84, "sender": "3MqQhA21mw1UHWmdGMV9M9xQL1cpC93LF8o", "senderPublicKey": "E3TwKTkJRoqHq8mpKDYP1GvftP8ECfnCUT5atXuMXq53", "proofs": [ "zrEEXFGeiNCAFvzMR2FPk2Z94rgpn2z277rpKa3xL9f8iMLubT87ux5K3rboNmmsYFtFfBnjz4oyPUGwbPaVbeo" ], "script": "base64:AAIFAAAAAAAAAAgIAhIECgIICAAAAAMAAAAADVBBWU1FTlRfQVNTRVQBAAAAIK2dSBaFkXln78NKeoaZ0d1Q6QVJPOT+QERHjOGDxML0AAAAAAxSRVdBUkRfQVNTRVQBAAAAIC03E4HTJDddn+FvdtPRD5PvLCz03YmtXEpW6HzJAXIbAQAAAAtpc1BheW1lbnRPawAAAAEAAAABaQQAAAARYWNjZXB0YWJsZUFzc2V0SWQFAAAADVBBWU1FTlRfQVNTRVQDCQAAAAAAAAIJAAGQAAAAAQgFAAAAAWkAAAAIcGF5bWVudHMAAAAAAAAAAAAJAAACAAAAAQIAAAAUUGF5bWVudCBub3QgYXR0YWNoZWQEAAAAAXAJAAGRAAAAAggFAAAAAWkAAAAIcGF5bWVudHMAAAAAAAAAAAAEAAAAByRtYXRjaDAIBQAAAAFwAAAAB2Fzc2V0SWQDCQAAAQAAAAIFAAAAByRtYXRjaDACAAAACkJ5dGVWZWN0b3IEAAAAB2Fzc2V0SWQFAAAAByRtYXRjaDADCQAAAAAAAAIFAAAAB2Fzc2V0SWQFAAAAEWFjY2VwdGFibGVBc3NldElkC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AQIAAAALd3JvbmcgY29sb3IJAAACAAAAAQIAAAAcZ2FtZSBpcyBub3QgYWN0aXZlIHJpZ2h0IG5vdwAAAABOA7/P", "height": 2028047, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: 41D1jtCZCcF4CgQyDrD3JSKqEAjVCJqa1v9beLt3fDB6 Next: A8FLxY7xbtgRHVY26pCvB7R17CsCGiZntkjqAP9vXasd Diff:
Old | New | Differences | |
---|---|---|---|
1 | 1 | {-# STDLIB_VERSION 5 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | + | let PAYMENT_ASSET = base58'CgidgEMbCKXXErgJXVyZCFRaK8SBNA73Jg8mNXALtVKh' | |
5 | + | ||
6 | + | let REWARD_ASSET = base58'43W4FcqA1rEpSmUGHoGiXvpSLfhadws9LS5j3SJsKxxS' | |
7 | + | ||
4 | 8 | func isPaymentOk (i) = { | |
5 | - | let acceptableAssetId = | |
9 | + | let acceptableAssetId = PAYMENT_ASSET | |
6 | 10 | if ((size(i.payments) == 0)) | |
7 | 11 | then throw("Payment not attached") | |
8 | 12 | else { | |
21 | 25 | ||
22 | 26 | @Callable(i) | |
23 | 27 | func coordinates (veri,xy) = { | |
24 | - | let pixels = | |
28 | + | let pixels = REWARD_ASSET | |
25 | 29 | let xMIN = 0 | |
26 | 30 | let xMAX = 1201 | |
27 | 31 | let yMIN = 0 | |
28 | 32 | let yMAX = 601 | |
33 | + | let REWARD_AMOUNT = 100000000 | |
29 | 34 | let START_HEIGHT = 2028020 | |
30 | 35 | let END_HEIGHT = (START_HEIGHT + (1440 * 30)) | |
31 | 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"] | |
51 | 56 | then { | |
52 | 57 | let isEmpty = getString(this, wallet) | |
53 | 58 | if (isPaymentOk(i)) | |
54 | - | then [StringEntry(wallet, veri), ScriptTransfer(i.caller, | |
59 | + | then [StringEntry(wallet, veri), ScriptTransfer(i.caller, REWARD_AMOUNT, pixels)] | |
55 | 60 | else throw("Wrong payment amount or asset") | |
56 | 61 | } | |
57 | 62 | else throw("out of context") |
Old | New | Differences | |
---|---|---|---|
1 | 1 | {-# STDLIB_VERSION 5 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | + | let PAYMENT_ASSET = base58'CgidgEMbCKXXErgJXVyZCFRaK8SBNA73Jg8mNXALtVKh' | |
5 | + | ||
6 | + | let REWARD_ASSET = base58'43W4FcqA1rEpSmUGHoGiXvpSLfhadws9LS5j3SJsKxxS' | |
7 | + | ||
4 | 8 | func isPaymentOk (i) = { | |
5 | - | let acceptableAssetId = | |
9 | + | let acceptableAssetId = PAYMENT_ASSET | |
6 | 10 | if ((size(i.payments) == 0)) | |
7 | 11 | then throw("Payment not attached") | |
8 | 12 | else { | |
9 | 13 | let p = i.payments[0] | |
10 | 14 | match p.assetId { | |
11 | 15 | case assetId: ByteVector => | |
12 | 16 | if ((assetId == acceptableAssetId)) | |
13 | 17 | then (p.amount == 1000000) | |
14 | 18 | else false | |
15 | 19 | case _ => | |
16 | 20 | throw("Wrong payment asset") | |
17 | 21 | } | |
18 | 22 | } | |
19 | 23 | } | |
20 | 24 | ||
21 | 25 | ||
22 | 26 | @Callable(i) | |
23 | 27 | func coordinates (veri,xy) = { | |
24 | - | let pixels = | |
28 | + | let pixels = REWARD_ASSET | |
25 | 29 | let xMIN = 0 | |
26 | 30 | let xMAX = 1201 | |
27 | 31 | let yMIN = 0 | |
28 | 32 | let yMAX = 601 | |
33 | + | let REWARD_AMOUNT = 100000000 | |
29 | 34 | let START_HEIGHT = 2028020 | |
30 | 35 | let END_HEIGHT = (START_HEIGHT + (1440 * 30)) | |
31 | 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"] | |
32 | 37 | if (if ((height > START_HEIGHT)) | |
33 | 38 | then (END_HEIGHT > height) | |
34 | 39 | else false) | |
35 | 40 | then { | |
36 | 41 | let color = containsElement(colors, veri) | |
37 | 42 | if (color) | |
38 | 43 | then { | |
39 | 44 | let currentKey = toBase58String(i.caller.bytes) | |
40 | 45 | let wallet = (((currentKey + "_") + xy) + "_c") | |
41 | 46 | let splitter = split(xy, "_") | |
42 | 47 | let x = valueOrElse(parseInt(splitter[0]), 0) | |
43 | 48 | let y = valueOrElse(parseInt(splitter[1]), 0) | |
44 | 49 | if (if (if (if ((x >= xMIN)) | |
45 | 50 | then (xMAX > x) | |
46 | 51 | else false) | |
47 | 52 | then (y >= yMIN) | |
48 | 53 | else false) | |
49 | 54 | then (yMAX > y) | |
50 | 55 | else false) | |
51 | 56 | then { | |
52 | 57 | let isEmpty = getString(this, wallet) | |
53 | 58 | if (isPaymentOk(i)) | |
54 | - | then [StringEntry(wallet, veri), ScriptTransfer(i.caller, | |
59 | + | then [StringEntry(wallet, veri), ScriptTransfer(i.caller, REWARD_AMOUNT, pixels)] | |
55 | 60 | else throw("Wrong payment amount or asset") | |
56 | 61 | } | |
57 | 62 | else throw("out of context") | |
58 | 63 | } | |
59 | 64 | else throw("wrong color") | |
60 | 65 | } | |
61 | 66 | else throw("game is not active right now") | |
62 | 67 | } | |
63 | 68 | ||
64 | 69 |
github/deemru/w8io/026f985 32.34 ms ◑