tx · ChjWtZcgBP3yoYj663RoF7Ld11HfT89NB56Mgv1sRjWs 3N8qh6A5T2MkkWELKG76TdMyL35bH4MdEem: -0.01000000 Waves 2019.07.10 16:15 [579623] smart account 3N8qh6A5T2MkkWELKG76TdMyL35bH4MdEem > SELF 0.00000000 Waves
{ "type": 13, "id": "ChjWtZcgBP3yoYj663RoF7Ld11HfT89NB56Mgv1sRjWs", "fee": 1000000, "feeAssetId": null, "timestamp": 1562764514134, "version": 1, "sender": "3N8qh6A5T2MkkWELKG76TdMyL35bH4MdEem", "senderPublicKey": "7RXqgaABmLCuBLhTPmvHkfnQVRscHvgRtrn9SEPGMY63", "proofs": [ "4oP4UfcHKwK8pkEqbMkZbhD1aL7X6DosjuGeXQUBqwAXmnt76xSrMjpG1BgPACEhaSZPHixaSCQnSVmVfytKgZ55" ], "script": "base64:AAIDAAAAAAAAAAAAAAAGAQAAABBnZXRTdHJpbmdGcm9tS2V5AAAAAQAAAANrZXkEAAAAByRtYXRjaDAJAAQdAAAAAgUAAAAEdGhpcwUAAAADa2V5AwkAAAEAAAACBQAAAAckbWF0Y2gwAgAAAAZTdHJpbmcEAAAAA3N0cgUAAAAHJG1hdGNoMAUAAAADc3RyCQAAAgAAAAECAAAAGk5vIHN0cmluZyBmb3VuZCBmb3IgZW50cnkhAQAAABdnZXRTdHJpbmdGcm9tS2V5T3JFbXB0eQAAAAEAAAADa2V5BAAAAAckbWF0Y2gwCQAEHQAAAAIFAAAABHRoaXMFAAAAA2tleQMJAAABAAAAAgUAAAAHJG1hdGNoMAIAAAAGU3RyaW5nBAAAAANzdHIFAAAAByRtYXRjaDAFAAAAA3N0cgIAAAAAAQAAAA1nZXRJbnRGcm9tS2V5AAAAAQAAAANrZXkEAAAAByRtYXRjaDAJAAQaAAAAAgUAAAAEdGhpcwUAAAADa2V5AwkAAAEAAAACBQAAAAckbWF0Y2gwAgAAAANJbnQEAAAAAW4FAAAAByRtYXRjaDAFAAAAAW4AAAAAAAAAAAABAAAAEmNo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yaW9kBQAAAANuaWwJAAACAAAAAQIAAAA0SW5pdCBmdW5jdGlvbiBjYW4gb25seSBiZSBjYWxsZWQgYnkgY29udHJhY3QgaXRzZWxmIQAAAAEAAAACdHgBAAAABnZlcmlmeQAAAAAEAAAAByRtYXRjaDAFAAAAAnR4AwkAAAEAAAACBQAAAAckbWF0Y2gwAgAAABdJbnZva2VTY3JpcHRUcmFuc2FjdGlvbgQAAAACdHgFAAAAByRtYXRjaDADAwMJAAAAAAAAAggFAAAAAnR4AAAABGRBcHAFAAAABHRoaXMJAAAAAAAAAggFAAAAAnR4AAAACGZ1bmN0aW9uAgAAAARpbml0BwkAAAAAAAACCAUAAAACdHgAAAADZmVlAAAAAAAADbugBwkAAfQAAAADCAUAAAACdHgAAAAJYm9keUJ5dGVzCQABkQAAAAIIBQAAAAJ0eAAAAAZwcm9vZnMAAAAAAAAAAAAIBQAAAAJ0eAAAAA9zZW5kZXJQdWJsaWNLZXkHB6189AQ=", "chainId": 84, "height": 579623, "spentComplexity": 0 } View: original | compacted Prev: none Next: none Full:
Old | New | Differences | |
---|---|---|---|
1 | - | # no script | |
1 | + | {-# STDLIB_VERSION 3 #-} | |
2 | + | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | + | {-# CONTENT_TYPE DAPP #-} | |
4 | + | func getStringFromKey (key) = match getString(this, key) { | |
5 | + | case str: String => | |
6 | + | str | |
7 | + | case _ => | |
8 | + | throw("No string found for entry!") | |
9 | + | } | |
10 | + | ||
11 | + | ||
12 | + | func getStringFromKeyOrEmpty (key) = match getString(this, key) { | |
13 | + | case str: String => | |
14 | + | str | |
15 | + | case _ => | |
16 | + | "" | |
17 | + | } | |
18 | + | ||
19 | + | ||
20 | + | func getIntFromKey (key) = match getInteger(this, key) { | |
21 | + | case n: Int => | |
22 | + | n | |
23 | + | case _ => | |
24 | + | 0 | |
25 | + | } | |
26 | + | ||
27 | + | ||
28 | + | func channelIsInitiated () = { | |
29 | + | let firstAddress = getStringFromKey("firstAddress") | |
30 | + | let secondAddress = getStringFromKey("secondAddress") | |
31 | + | let firstCounterPart = getStringFromKey((firstAddress + "_counterpart")) | |
32 | + | let secondCounterpart = getStringFromKey((secondAddress + "_counterpart")) | |
33 | + | (getIntFromKey("timelockPeriod") > 0) | |
34 | + | } | |
35 | + | ||
36 | + | ||
37 | + | func closingInitiated () = { | |
38 | + | let initiator = getStringFromKey("closing_initiated_by") | |
39 | + | (initiator != "") | |
40 | + | } | |
41 | + | ||
42 | + | ||
43 | + | func checkIfValidAccount (sender) = { | |
44 | + | let firstAddress = getStringFromKey("firstAddress") | |
45 | + | let secondAddress = getStringFromKey("secondAddress") | |
46 | + | if (if ((firstAddress != sender)) | |
47 | + | then (secondAddress != sender) | |
48 | + | else false) | |
49 | + | then false | |
50 | + | else true | |
51 | + | } | |
52 | + | ||
53 | + | ||
54 | + | @Callable(i) | |
55 | + | func claimCheating (recipientA,amountRecipientA,recipientB,amountRecipientB,timestamp,signature) = { | |
56 | + | let sender = toBase58String(i.caller.bytes) | |
57 | + | let validSender = checkIfValidAccount(sender) | |
58 | + | let originalString = ((((recipientA + toString(amountRecipientA)) + recipientB) + toString(amountRecipientB)) + toString(timestamp)) | |
59 | + | let counterPart = getStringFromKey((sender + "_counterpart")) | |
60 | + | let signedByCounterpart = sigVerify(toBytes(originalString), fromBase58String(signature), fromBase58String(counterPart)) | |
61 | + | let notInitiator = (sender != getStringFromKey("closing_initiated_by")) | |
62 | + | let oldTimestamp = getIntFromKey("timestamp") | |
63 | + | let isClosingInitiated = closingInitiated() | |
64 | + | if (isClosingInitiated) | |
65 | + | then if (if (if (if (notInitiator) | |
66 | + | then validSender | |
67 | + | else false) | |
68 | + | then signedByCounterpart | |
69 | + | else false) | |
70 | + | then (timestamp > oldTimestamp) | |
71 | + | else false) | |
72 | + | then TransferSet([ScriptTransfer(i.caller, (amountRecipientA + amountRecipientB), unit)]) | |
73 | + | else throw("Wrong signature or timestamp not newer!") | |
74 | + | else throw("Closing of channel not initiated yet!") | |
75 | + | } | |
76 | + | ||
77 | + | ||
78 | + | ||
79 | + | @Callable(i) | |
80 | + | func confirmClose () = { | |
81 | + | let sender = toBase58String(i.caller.bytes) | |
82 | + | let validSender = checkIfValidAccount(sender) | |
83 | + | let initiator = getString(this, "closing_initiated_by") | |
84 | + | let isClosingInitiated = closingInitiated() | |
85 | + | if (isClosingInitiated) | |
86 | + | then if (if ((sender != initiator)) | |
87 | + | then validSender | |
88 | + | else false) | |
89 | + | then { | |
90 | + | let firstAddress = getStringFromKey("firstAddress") | |
91 | + | let secondAddress = getStringFromKey("secondAddress") | |
92 | + | let firstAddressAmount = getIntFromKey(firstAddress) | |
93 | + | let secondAddressAmount = getIntFromKey(secondAddress) | |
94 | + | TransferSet([ScriptTransfer(Address(fromBase58String(firstAddress)), firstAddressAmount, unit), ScriptTransfer(Address(fromBase58String(secondAddress)), secondAddressAmount, unit)]) | |
95 | + | } | |
96 | + | else throw("Initiator can not confirm closing of the channel!") | |
97 | + | else throw("Closing of channel not initiated yet!") | |
98 | + | } | |
99 | + | ||
100 | + | ||
101 | + | ||
102 | + | @Callable(i) | |
103 | + | func closeAfterTimelock () = { | |
104 | + | let sender = toBase58String(i.caller.bytes) | |
105 | + | let validSender = checkIfValidAccount(sender) | |
106 | + | let timelock = getIntFromKey("timelock") | |
107 | + | let isClosingInitiated = closingInitiated() | |
108 | + | if (isClosingInitiated) | |
109 | + | then if (if ((height > timelock)) | |
110 | + | then validSender | |
111 | + | else false) | |
112 | + | then { | |
113 | + | let firstAddress = getStringFromKey("firstAddress") | |
114 | + | let secondAddress = getStringFromKey("secondAddress") | |
115 | + | let firstAddressAmount = getIntFromKey(firstAddress) | |
116 | + | let secondAddressAmount = getIntFromKey(secondAddress) | |
117 | + | TransferSet([ScriptTransfer(Address(fromBase58String(firstAddress)), firstAddressAmount, unit), ScriptTransfer(Address(fromBase58String(secondAddress)), secondAddressAmount, unit)]) | |
118 | + | } | |
119 | + | else throw("Timelock still valid!") | |
120 | + | else throw("Closing of channel not initiated yet!") | |
121 | + | } | |
122 | + | ||
123 | + | ||
124 | + | ||
125 | + | @Callable(i) | |
126 | + | func initialClosing (recipientA,amountRecipientA,recipientB,amountRecipientB,timestamp,signature) = { | |
127 | + | let closingInitiator = getStringFromKeyOrEmpty("closing_initiated_by") | |
128 | + | let closingAlreadyInitiated = (closingInitiator != "") | |
129 | + | let isInitiated = channelIsInitiated() | |
130 | + | let sender = toBase58String(i.caller.bytes) | |
131 | + | let validSender = checkIfValidAccount(sender) | |
132 | + | let recipientAValid = checkIfValidAccount(recipientA) | |
133 | + | let recipientBValid = checkIfValidAccount(recipientB) | |
134 | + | let validRecipients = if (recipientAValid) | |
135 | + | then true | |
136 | + | else recipientBValid | |
137 | + | let originalString = ((((recipientA + toString(amountRecipientA)) + recipientB) + toString(amountRecipientB)) + toString(timestamp)) | |
138 | + | let counterPart = getStringFromKey((sender + "_counterpart")) | |
139 | + | let signedByCounterpart = sigVerify(toBytes(originalString), fromBase58String(signature), fromBase58String(counterPart)) | |
140 | + | let timelockPeriod = getIntFromKey("timelockPeriod") | |
141 | + | if (!(closingAlreadyInitiated)) | |
142 | + | then if (isInitiated) | |
143 | + | then if (validSender) | |
144 | + | then if (validRecipients) | |
145 | + | then if (signedByCounterpart) | |
146 | + | then WriteSet([DataEntry(recipientA, amountRecipientA), DataEntry(recipientB, amountRecipientB), DataEntry("closing_initiated_by", sender), DataEntry("timestamp", timestamp), DataEntry("timelock", (height + timelockPeriod))]) | |
147 | + | else throw("Wrong signature!") | |
148 | + | else throw("Unvalid recipients") | |
149 | + | else throw("Sender of transaction not valid!") | |
150 | + | else throw("Channnel not initiated!") | |
151 | + | else throw(("Closing already initiated by: " + closingInitiator)) | |
152 | + | } | |
153 | + | ||
154 | + | ||
155 | + | ||
156 | + | @Callable(i) | |
157 | + | func fund () = { | |
158 | + | let isInitiated = channelIsInitiated() | |
159 | + | let sender = toBase58String(i.caller.bytes) | |
160 | + | let validSender = checkIfValidAccount(sender) | |
161 | + | let payment = match i.payment { | |
162 | + | case p: AttachedPayment => | |
163 | + | p | |
164 | + | case _ => | |
165 | + | throw("No Payment attached!") | |
166 | + | } | |
167 | + | let paymentInAsset = isDefined(payment.assetId) | |
168 | + | let amountKey = (sender + "_amount") | |
169 | + | let currentAmount = getIntFromKey(amountKey) | |
170 | + | if (isInitiated) | |
171 | + | then if (validSender) | |
172 | + | then if (!(paymentInAsset)) | |
173 | + | then if ((currentAmount != 0)) | |
174 | + | then throw("User has already funded payment channel!") | |
175 | + | else WriteSet([DataEntry(amountKey, payment.amount)]) | |
176 | + | else throw("Funding in Waves only!") | |
177 | + | else throw(("Wrong account tries to fund channel: " + sender)) | |
178 | + | else throw("Channnel not initiated!") | |
179 | + | } | |
180 | + | ||
181 | + | ||
182 | + | ||
183 | + | @Callable(i) | |
184 | + | func init (firstPublicKey,secondPublicKey,timelockPeriod) = { | |
185 | + | let calledBySelf = (i.caller == this) | |
186 | + | let firstAddress = toBase58String(addressFromPublicKey(fromBase58String(firstPublicKey)).bytes) | |
187 | + | let secondAddress = toBase58String(addressFromPublicKey(fromBase58String(secondPublicKey)).bytes) | |
188 | + | let currentFirstAddress = getStringFromKeyOrEmpty((firstAddress + "_counterpart")) | |
189 | + | let currentSecondAddress = getStringFromKeyOrEmpty((secondAddress + "_counterpart")) | |
190 | + | if (calledBySelf) | |
191 | + | then if (if ((currentFirstAddress != "")) | |
192 | + | then true | |
193 | + | else (currentSecondAddress != "")) | |
194 | + | then throw("Contract already initiated!") | |
195 | + | else WriteSet([DataEntry("firstAddress", firstAddress), DataEntry("secondAddress", secondAddress), DataEntry((firstAddress + "_counterpart"), secondPublicKey), DataEntry((secondAddress + "_counterpart"), firstPublicKey), DataEntry("timelockPeriod", timelockPeriod)]) | |
196 | + | else throw("Init function can only be called by contract itself!") | |
197 | + | } | |
198 | + | ||
199 | + | ||
200 | + | @Verifier(tx) | |
201 | + | func verify () = match tx { | |
202 | + | case tx: InvokeScriptTransaction => | |
203 | + | if (if (if ((tx.dApp == this)) | |
204 | + | then (tx.function == "init") | |
205 | + | else false) | |
206 | + | then (tx.fee == 900000) | |
207 | + | else false) | |
208 | + | then sigVerify(tx.bodyBytes, tx.proofs[0], tx.senderPublicKey) | |
209 | + | else false | |
210 | + | case _ => | |
211 | + | false | |
212 | + | } | |
213 | + |
github/deemru/w8io/026f985 17.39 ms ◑