tx · 7nzjChksjw9bSAc4PP7EvfG6bWUf4rKHfsKSUbpnGfh2 3N4NPivoThtskr7JxnNrKL7s8BzmRGx9rT2: -0.01400000 Waves 2019.08.10 20:20 [625211] smart account 3N4NPivoThtskr7JxnNrKL7s8BzmRGx9rT2 > SELF 0.00000000 Waves
{ "type": 13, "id": "7nzjChksjw9bSAc4PP7EvfG6bWUf4rKHfsKSUbpnGfh2", "fee": 1400000, "feeAssetId": null, "timestamp": 1565457606608, "version": 1, "sender": "3N4NPivoThtskr7JxnNrKL7s8BzmRGx9rT2", "senderPublicKey": "F3vhYapU4NBzfM2X4KNkoFcxj3UbYnJjqituG6KE7ZPG", "proofs": [ "4oWy791xhPJLnAvw8HGNaNKsocBDWNEBt5k7D2t5G2E2w9axA22UPV1UriTZr67vGyVx46BrcFznht9KiAZ5HgGh" ], "script": "base64:AAIDAAAAAAAAAAAAAAAJAAAAAAdSVU5OSU5HAgAAAAdSVU5OSU5HAAAAABBDTE9TRURGT1JCRVRUSU5HAgAAABBDTE9TRURGT1JCRVRUSU5HAAAAAAZDTE9TRUQCAAAABkNMT1NFRAAAAAAJREFQUE9XTkVSAgAAACMzTjROUGl2b1RodHNrcjdKeG5OcktMN3M4QnptUkd4OXJUMgAAAAAFV0FWRVMCAAAABVdBVkVTAAAAAAROT05FAgAAAAROT05FAQAAAAtnZXROdW1CeUtleQAAAAEAAAADa2V5BAAAAANudW0EAAAAByRtYXRjaDAJAAQaAAAAAgUAAAAEdGhpcwUAAAADa2V5AwkAAAEAAAACBQAAAAckbWF0Y2gwAgAAAANJbnQEAAAAAWEFAAAAByRtYXRjaDAFAAAAAWEAAAAAAAAAAAAFAAAAA251bQEAAAALZ2V0U3RyQnlLZXkAAAABAAAAA2tleQQAAAADc3RyBAAAAAckbWF0Y2gwCQAEHQAAAAIFAAAABHRoaXMFAAAAA2tleQMJAAABAAAAAgUAAAAHJG1hdGNoMAIAAAAGU3RyaW5nBAAAAAFhBQAAAAckbWF0Y2gwBQAAAAF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HJG1hdGNoMAUAAAACdHgDAwkAAAEAAAACBQAAAAckbWF0Y2gwAgAAABRTZXRTY3JpcHRUcmFuc2FjdGlvbgYJAAABAAAAAgUAAAAHJG1hdGNoMAIAAAAPRGF0YVRyYW5zYWN0aW9uCQAB9AAAAAMIBQAAAAJ0eAAAAAlib2R5Qnl0ZXMJAAGRAAAAAggFAAAAAnR4AAAABnByb29mcwAAAAAAAAAAAAgFAAAAAnR4AAAAD3NlbmRlclB1YmxpY0tleQMJAAABAAAAAgUAAAAHJG1hdGNoMAIAAAAXSW52b2tlU2NyaXB0VHJhbnNhY3Rpb24GBsqUA3s=", "chainId": 84, "height": 625211, "spentComplexity": 0 } View: original | compacted Prev: FhDSuZnFi3qXQNKETf3H4UA9Ay7V9TPdN7arAaHTrkFV Next: 5sCYrwv8f74mmBzdB8CbZkTfJP9R6t45foMZSH8D4khP Diff:
Old | New | Differences | |
---|---|---|---|
58 | 58 | func setContestConfiguration (currencyTicker,contestStartHeight) = { | |
59 | 59 | let account = toBase58String(i.caller.bytes) | |
60 | 60 | let contestStatus = getContestStatus() | |
61 | - | let currentHeight = match transactionHeightById(i.transactionId) { | |
62 | - | case a: Int => | |
63 | - | a | |
64 | - | case _ => | |
65 | - | 0 | |
66 | - | } | |
61 | + | let currentHeight = height | |
67 | 62 | let contestFinishHeight = currentHeight | |
68 | 63 | if ((account != DAPPOWNER)) | |
69 | 64 | then throw("Only dAPP Owner can Configure Contest.") |
Old | New | Differences | |
---|---|---|---|
1 | 1 | {-# STDLIB_VERSION 3 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | 4 | let RUNNING = "RUNNING" | |
5 | 5 | ||
6 | 6 | let CLOSEDFORBETTING = "CLOSEDFORBETTING" | |
7 | 7 | ||
8 | 8 | let CLOSED = "CLOSED" | |
9 | 9 | ||
10 | 10 | let DAPPOWNER = "3N4NPivoThtskr7JxnNrKL7s8BzmRGx9rT2" | |
11 | 11 | ||
12 | 12 | let WAVES = "WAVES" | |
13 | 13 | ||
14 | 14 | let NONE = "NONE" | |
15 | 15 | ||
16 | 16 | func getNumByKey (key) = { | |
17 | 17 | let num = match getInteger(this, key) { | |
18 | 18 | case a: Int => | |
19 | 19 | a | |
20 | 20 | case _ => | |
21 | 21 | 0 | |
22 | 22 | } | |
23 | 23 | num | |
24 | 24 | } | |
25 | 25 | ||
26 | 26 | ||
27 | 27 | func getStrByKey (key) = { | |
28 | 28 | let str = match getString(this, key) { | |
29 | 29 | case a: String => | |
30 | 30 | a | |
31 | 31 | case _ => | |
32 | 32 | NONE | |
33 | 33 | } | |
34 | 34 | str | |
35 | 35 | } | |
36 | 36 | ||
37 | 37 | ||
38 | 38 | func getContestStatus () = getStrByKey("contest_status") | |
39 | 39 | ||
40 | 40 | ||
41 | 41 | @Callable(i) | |
42 | 42 | func setContestStatus (contestStatus) = { | |
43 | 43 | let account = toBase58String(i.caller.bytes) | |
44 | 44 | if ((account != DAPPOWNER)) | |
45 | 45 | then throw("Only dAPP Owner can set Contest Status.") | |
46 | 46 | else if (if (if ((contestStatus != RUNNING)) | |
47 | 47 | then (contestStatus != CLOSEDFORBETTING) | |
48 | 48 | else false) | |
49 | 49 | then (contestStatus != CLOSED) | |
50 | 50 | else false) | |
51 | 51 | then throw(("Invalid status: " + contestStatus)) | |
52 | 52 | else WriteSet([DataEntry("contest_status", contestStatus)]) | |
53 | 53 | } | |
54 | 54 | ||
55 | 55 | ||
56 | 56 | ||
57 | 57 | @Callable(i) | |
58 | 58 | func setContestConfiguration (currencyTicker,contestStartHeight) = { | |
59 | 59 | let account = toBase58String(i.caller.bytes) | |
60 | 60 | let contestStatus = getContestStatus() | |
61 | - | let currentHeight = match transactionHeightById(i.transactionId) { | |
62 | - | case a: Int => | |
63 | - | a | |
64 | - | case _ => | |
65 | - | 0 | |
66 | - | } | |
61 | + | let currentHeight = height | |
67 | 62 | let contestFinishHeight = currentHeight | |
68 | 63 | if ((account != DAPPOWNER)) | |
69 | 64 | then throw("Only dAPP Owner can Configure Contest.") | |
70 | 65 | else if ((currentHeight >= contestStartHeight)) | |
71 | 66 | then throw(("Start Height must be greater than current Blockchain height: " + toString(currentHeight))) | |
72 | 67 | else if ((contestStatus != RUNNING)) | |
73 | 68 | then throw(("You cannot configure Contest while status is: " + contestStatus)) | |
74 | 69 | else if ((currencyTicker != WAVES)) | |
75 | 70 | then throw((("dAPP does not support currency: " + currencyTicker) + "yet.")) | |
76 | 71 | else WriteSet([DataEntry("contest_currency", currencyTicker), DataEntry("contest_startheight", contestStartHeight), DataEntry("contest_finishheight", contestFinishHeight), DataEntry("contest_status", RUNNING)]) | |
77 | 72 | } | |
78 | 73 | ||
79 | 74 | ||
80 | 75 | @Verifier(tx) | |
81 | 76 | func verify () = match tx { | |
82 | 77 | case _: SetScriptTransaction|DataTransaction => | |
83 | 78 | sigVerify(tx.bodyBytes, tx.proofs[0], tx.senderPublicKey) | |
84 | 79 | case _: InvokeScriptTransaction => | |
85 | 80 | true | |
86 | 81 | case _ => | |
87 | 82 | true | |
88 | 83 | } | |
89 | 84 |
github/deemru/w8io/026f985 31.78 ms ◑