tx · 9S1rRkFxVhgEupdTYm8smzRJofFHiTLmC1ZHrEQqrxKg 3MpFh7erZxGowR5YVFNvaSu2tCD7uMBEj1S: -0.01000000 Waves 2019.09.21 13:06 [685933] smart account 3MpFh7erZxGowR5YVFNvaSu2tCD7uMBEj1S > SELF 0.00000000 Waves
{ "type": 13, "id": "9S1rRkFxVhgEupdTYm8smzRJofFHiTLmC1ZHrEQqrxKg", "fee": 1000000, "feeAssetId": null, "timestamp": 1569060274690, "version": 1, "sender": "3MpFh7erZxGowR5YVFNvaSu2tCD7uMBEj1S", "senderPublicKey": "CF1hAU11frb9TBNiAkVsZYdPWMfh3px99upjBKoLeACo", "proofs": [ "2HbPDDunw7xNH8XjdwSjhbd3AzTc2FEWM6nLtu8tZ1THo1TiX6qxA6wSnqUUXzjy8p61g8rtmxoHJCbkwrAgLjSh" ], "script": "base64:AAIDAAAAAAAAAAAAAAA1AQAAABNnZXRFeHRBZGRyZXNzT3JhY2xlAAAAAAkBAAAAB2V4dHJhY3QAAAABCQEAAAARYWRkcmVzc0Zyb21TdHJpbmcAAAABAgAAACMzTjdqZVVoOTU1WEVWdWpyeXN0MjR0WEt6Vm0yZlhXc1pEUwAAAAALQkxBQ0tMSVNURUQCAAAACWJsYWNrbGlzdAAAAAALb3duZXJQdWJLZXkBAAAAIKcHeHJMZXUSc1Xe0exz43pzrG8m9UpPWnSkEK48zHUoAAAAAAROT05FAgAAAARub25lAAAAAAZDTE9TRUQCAAAABWNsb3NlAAAAAAZPUEVORUQCAAAABG9wZW4BAAAADmdldE51bWJlckJ5S2V5AAAAAQAAAANrZXkEAAAAA251bQQAAAAHJG1hdGNoMAkABBoAAAACBQAAAAR0aGlzBQAAAANrZXkDCQAAAQAAAAIFAAAAByRtYXRjaDACAAAAA0ludAQAAAABYQUAAAAHJG1hdGNoMAUAAAABYQAAAAAAAAAAAAUAAAADbnVtAQAAAAtnZXRTdHJCeUtleQAAAAEAAAADa2V5BAAAAANzdHIEAAAAByRtYXRjaDAJA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HJG1hdGNoMAkAAfQAAAADCAUAAAACdHgAAAAJYm9keUJ5dGVzCQABkQAAAAIIBQAAAAJ0eAAAAAZwcm9vZnMAAAAAAAAAAAAFAAAAC293bmVyUHViS2V5AwkAAAEAAAACBQAAAAckbWF0Y2gwAgAAAA9EYXRhVHJhbnNhY3Rpb24EAAAAAWQFAAAAByRtYXRjaDAGAwkAAAEAAAACBQAAAAckbWF0Y2gwAgAAABNUcmFuc2ZlclRyYW5zYWN0aW9uBAAAAAF0BQAAAAckbWF0Y2gwCQAB9AAAAAMIBQAAAAJ0eAAAAAlib2R5Qnl0ZXMJAAGRAAAAAggFAAAAAnR4AAAABnByb29mcwAAAAAAAAAAAAUAAAALb3duZXJQdWJLZXkHyJh5ng==", "chainId": 84, "height": 685933, "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 getExtAddressOracle () = extract(addressFromString("3N7jeUh955XEVujryst24tXKzVm2fXWsZDS")) | |
5 | + | ||
6 | + | ||
7 | + | let BLACKLISTED = "blacklist" | |
8 | + | ||
9 | + | let ownerPubKey = base58'CF1hAU11frb9TBNiAkVsZYdPWMfh3px99upjBKoLeACo' | |
10 | + | ||
11 | + | let NONE = "none" | |
12 | + | ||
13 | + | let CLOSED = "close" | |
14 | + | ||
15 | + | let OPENED = "open" | |
16 | + | ||
17 | + | func getNumberByKey (key) = { | |
18 | + | let num = match getInteger(this, key) { | |
19 | + | case a: Int => | |
20 | + | a | |
21 | + | case _ => | |
22 | + | 0 | |
23 | + | } | |
24 | + | num | |
25 | + | } | |
26 | + | ||
27 | + | ||
28 | + | func getStrByKey (key) = { | |
29 | + | let str = match getString(this, key) { | |
30 | + | case a: String => | |
31 | + | a | |
32 | + | case _ => | |
33 | + | NONE | |
34 | + | } | |
35 | + | str | |
36 | + | } | |
37 | + | ||
38 | + | ||
39 | + | func getKeyRoom (roomer,title,data) = ("room_" + toBase58String(sha256(toBytes(((roomer + title) + data))))) | |
40 | + | ||
41 | + | ||
42 | + | func getKeyRoomPrize (room) = (room + "_prize") | |
43 | + | ||
44 | + | ||
45 | + | func getValueRoomPrize (room) = getNumberByKey(getKeyRoomPrize(room)) | |
46 | + | ||
47 | + | ||
48 | + | func getKeyRoomRoomer (room) = (room + "_roomer") | |
49 | + | ||
50 | + | ||
51 | + | func getValueRoomRoomer (room) = getStrByKey(getKeyRoomRoomer(room)) | |
52 | + | ||
53 | + | ||
54 | + | func getKeyRoomLimit (room) = (room + "_limit") | |
55 | + | ||
56 | + | ||
57 | + | func getValueRoomLimit (room) = getNumberByKey(getKeyRoomLimit(room)) | |
58 | + | ||
59 | + | ||
60 | + | func getKeyRoomStatus (room) = (room + "_status") | |
61 | + | ||
62 | + | ||
63 | + | func getValueRoomStatus (room) = getStrByKey(getKeyRoomStatus(room)) | |
64 | + | ||
65 | + | ||
66 | + | func getKeyRoomData (room) = (room + "_data") | |
67 | + | ||
68 | + | ||
69 | + | func getValueRoomData (room) = getStrByKey(getKeyRoomData(room)) | |
70 | + | ||
71 | + | ||
72 | + | func getKeyPropose (contributor,outline,data) = ("propose_" + toBase58String(sha256(toBytes(((contributor + outline) + data))))) | |
73 | + | ||
74 | + | ||
75 | + | func getKeyProposeContributor (propose) = (propose + "_contributor") | |
76 | + | ||
77 | + | ||
78 | + | func getValueProposeContributor (propose) = getStrByKey(getKeyProposeContributor(propose)) | |
79 | + | ||
80 | + | ||
81 | + | func getKeyProposeData (propose) = (propose + "_data") | |
82 | + | ||
83 | + | ||
84 | + | func getValueProposeData (propose) = getStrByKey(getKeyProposeData(propose)) | |
85 | + | ||
86 | + | ||
87 | + | func getKeyAdoption (room,propose) = ("adoption_" + toBase58String(sha256(toBytes((room + propose))))) | |
88 | + | ||
89 | + | ||
90 | + | func getKeyAdoptionWinner (adoption) = (adoption + "_winner") | |
91 | + | ||
92 | + | ||
93 | + | func getValueAdoptionWinner (adoption) = getStrByKey(getKeyAdoptionWinner(adoption)) | |
94 | + | ||
95 | + | ||
96 | + | func getKeyAdoptionPrize (adoption) = (adoption + "_prize") | |
97 | + | ||
98 | + | ||
99 | + | func getValueAdoptionPrize (adoption) = getStrByKey(getKeyAdoptionPrize(adoption)) | |
100 | + | ||
101 | + | ||
102 | + | func getKeyMealpolicyUser (account) = (toBase58String(sha256(toBytes(account))) + "_mealpolicy") | |
103 | + | ||
104 | + | ||
105 | + | func getValueMealpolicyUser (account) = getStrByKey(getKeyMealpolicyUser(account)) | |
106 | + | ||
107 | + | ||
108 | + | func getKeySexUser (account) = (toBase58String(sha256(toBytes(account))) + "_sex") | |
109 | + | ||
110 | + | ||
111 | + | func getValueSexUser (account) = getStrByKey(getKeySexUser(account)) | |
112 | + | ||
113 | + | ||
114 | + | func getKeyAgeUser (account) = (toBase58String(sha256(toBytes(account))) + "_age") | |
115 | + | ||
116 | + | ||
117 | + | func getValueAgeUser (account) = getNumberByKey(getKeyAgeUser(account)) | |
118 | + | ||
119 | + | ||
120 | + | func getKeyHobbyUser (account) = (toBase58String(sha256(toBytes(account))) + "_hobby") | |
121 | + | ||
122 | + | ||
123 | + | func getValueHobbyUser (account) = getStrByKey(getKeyHobbyUser(account)) | |
124 | + | ||
125 | + | ||
126 | + | func getKeyAreaUser (account) = (toBase58String(sha256(toBytes(account))) + "_area") | |
127 | + | ||
128 | + | ||
129 | + | func getValueAreaUser (account) = getStrByKey(getKeyAreaUser(account)) | |
130 | + | ||
131 | + | ||
132 | + | func getKeyRoomCountRoomer (account) = (toBase58String(sha256(toBytes(account))) + "_roomCount") | |
133 | + | ||
134 | + | ||
135 | + | func getValueRoomCountRoomer (account) = getNumberByKey(getKeyRoomCountRoomer(account)) | |
136 | + | ||
137 | + | ||
138 | + | func getKeyAdoptCountRoomer (account) = (toBase58String(sha256(toBytes(account))) + "_adoptCount") | |
139 | + | ||
140 | + | ||
141 | + | func getValueAdoptCountRoomer (account) = getNumberByKey(getKeyAdoptCountRoomer(account)) | |
142 | + | ||
143 | + | ||
144 | + | func getKeyEvaluateData (room,propose) = ("evaluate_" + toBase58String(sha256(toBytes((propose + room))))) | |
145 | + | ||
146 | + | ||
147 | + | func getValueEvaluateData (room,propose) = getStrByKey(getKeyEvaluateData(propose, room)) | |
148 | + | ||
149 | + | ||
150 | + | func getKeyEvaluateCountProposer (account) = (toBase58String(sha256(toBytes(account))) + "_evaluateCount") | |
151 | + | ||
152 | + | ||
153 | + | func getValueEvaluateCountProposer (account) = getNumberByKey(getKeyEvaluateCountProposer(account)) | |
154 | + | ||
155 | + | ||
156 | + | func getKeyTotalPointProposer (account) = (toBase58String(sha256(toBytes(account))) + "_evaluateCount") | |
157 | + | ||
158 | + | ||
159 | + | func getValueTotalPointProposer (account) = getNumberByKey(getKeyTotalPointProposer(account)) | |
160 | + | ||
161 | + | ||
162 | + | func getKeyBalanceUser (account) = (toBase58String(sha256(toBytes(account))) + "_balance") | |
163 | + | ||
164 | + | ||
165 | + | func getValueBalanceUser (account) = getNumberByKey(getKeyBalanceUser(account)) | |
166 | + | ||
167 | + | ||
168 | + | func getExtKeyUserBlackListStatus (account) = (account + "_blacklisted") | |
169 | + | ||
170 | + | ||
171 | + | func getExtValueUserBlackListStatus (oracle,account) = { | |
172 | + | let str = match getString(oracle, getExtKeyUserBlackListStatus(account)) { | |
173 | + | case a: String => | |
174 | + | a | |
175 | + | case _ => | |
176 | + | NONE | |
177 | + | } | |
178 | + | str | |
179 | + | } | |
180 | + | ||
181 | + | ||
182 | + | @Callable(i) | |
183 | + | func setUser (account,mealpolicy,sex,age,hobby,area) = WriteSet([DataEntry(getKeyMealpolicyUser(account), mealpolicy), DataEntry(getKeySexUser(account), sex), DataEntry(getKeyAgeUser(account), age), DataEntry(getKeyHobbyUser(account), hobby), DataEntry(getKeyAreaUser(account), area)]) | |
184 | + | ||
185 | + | ||
186 | + | ||
187 | + | @Callable(i) | |
188 | + | func createRoom (title,data,now,duration) = { | |
189 | + | let pmt = extract(i.payment) | |
190 | + | if (isDefined(pmt.assetId)) | |
191 | + | then throw("can use WAVES only at the moment") | |
192 | + | else { | |
193 | + | let roomer = toBase58String(i.caller.bytes) | |
194 | + | let room = getKeyRoom(roomer, title, data) | |
195 | + | let prize = pmt.amount | |
196 | + | let oracle = getExtAddressOracle() | |
197 | + | let roomerVerify = getExtValueUserBlackListStatus(oracle, roomer) | |
198 | + | let limit = (now + duration) | |
199 | + | if ((0 >= prize)) | |
200 | + | then throw("prize cannot be negative amount") | |
201 | + | else if ((360 >= duration)) | |
202 | + | then throw("duration cannot be less than 6hours") | |
203 | + | else if ((getValueRoomRoomer(room) != NONE)) | |
204 | + | then throw("the room is already exist") | |
205 | + | else if ((roomerVerify == BLACKLISTED)) | |
206 | + | then throw("your request was denied") | |
207 | + | else WriteSet([DataEntry(getKeyRoomPrize(room), prize), DataEntry(getKeyRoomRoomer(room), roomer), DataEntry(getKeyRoomLimit(room), limit), DataEntry(getKeyRoomStatus(room), OPENED), DataEntry(getKeyRoomData(room), data), DataEntry(getKeyRoomCountRoomer(roomer), (getValueRoomCountRoomer(roomer) + 1))]) | |
208 | + | } | |
209 | + | } | |
210 | + | ||
211 | + | ||
212 | + | ||
213 | + | @Callable(i) | |
214 | + | func closeRoom (room) = { | |
215 | + | let roomer = getValueRoomRoomer(room) | |
216 | + | let prize = getValueRoomPrize(room) | |
217 | + | if ((roomer != toBase58String(i.caller.bytes))) | |
218 | + | then throw("you cannot close this Room") | |
219 | + | else if ((getValueRoomStatus(room) == CLOSED)) | |
220 | + | then throw("this Room has already closed") | |
221 | + | else ScriptResult(WriteSet([DataEntry(getKeyRoomStatus(room), CLOSED)]), TransferSet([ScriptTransfer(addressFromStringValue(roomer), prize, unit)])) | |
222 | + | } | |
223 | + | ||
224 | + | ||
225 | + | ||
226 | + | @Callable(i) | |
227 | + | func createProposal (room,data,outline,now) = { | |
228 | + | let contributor = toBase58String(i.caller.bytes) | |
229 | + | let oracle = getExtAddressOracle() | |
230 | + | let contributorVerify = getExtValueUserBlackListStatus(oracle, contributor) | |
231 | + | let propose = getKeyPropose(contributor, outline, data) | |
232 | + | let roomer = getValueRoomRoomer(room) | |
233 | + | let limit = getValueRoomLimit(room) | |
234 | + | if ((data == NONE)) | |
235 | + | then throw("your proposal is empty") | |
236 | + | else if ((roomer == NONE)) | |
237 | + | then throw("room does not exist") | |
238 | + | else if ((now >= limit)) | |
239 | + | then throw("propose to this room is already closed") | |
240 | + | else if ((contributorVerify == BLACKLISTED)) | |
241 | + | then throw("your request was denied") | |
242 | + | else if ((getValueRoomStatus(room) == CLOSED)) | |
243 | + | then throw("this Room has already closed") | |
244 | + | else WriteSet([DataEntry(getKeyProposeContributor(propose), contributor), DataEntry(getKeyProposeData(propose), data)]) | |
245 | + | } | |
246 | + | ||
247 | + | ||
248 | + | ||
249 | + | @Callable(i) | |
250 | + | func createAdoption (room,propose) = { | |
251 | + | let adoption = getKeyAdoption(room, propose) | |
252 | + | let prize = getValueRoomPrize(room) | |
253 | + | let winner = getValueProposeContributor(propose) | |
254 | + | let roomer = getValueRoomRoomer(room) | |
255 | + | if ((roomer != toBase58String(i.caller.bytes))) | |
256 | + | then throw("only the Room's owner can do this transaction") | |
257 | + | else if ((winner == NONE)) | |
258 | + | then throw("the winner doesn't exist") | |
259 | + | else if ((getValueAdoptionWinner(adoption) != NONE)) | |
260 | + | then throw("you have already do the adoption") | |
261 | + | else if ((getValueRoomStatus(room) == CLOSED)) | |
262 | + | then throw("this Room has already closed") | |
263 | + | else WriteSet([DataEntry(getKeyBalanceUser(winner), (getValueBalanceUser(winner) + prize)), DataEntry(getKeyAdoptionWinner(adoption), winner), DataEntry(getKeyAdoptionPrize(adoption), prize), DataEntry(getKeyRoomStatus(room), CLOSED), DataEntry(getKeyAdoptCountRoomer(roomer), (getValueAdoptCountRoomer(roomer) + 1))]) | |
264 | + | } | |
265 | + | ||
266 | + | ||
267 | + | ||
268 | + | @Callable(i) | |
269 | + | func evaluateProposer (propose,room,point,data) = { | |
270 | + | let adoption = getKeyAdoption(room, propose) | |
271 | + | let winner = getValueProposeContributor(propose) | |
272 | + | let roomer = getValueRoomRoomer(room) | |
273 | + | if ((roomer != toBase58String(i.caller.bytes))) | |
274 | + | then throw("only the Room's owner can do this transaction") | |
275 | + | else if ((winner == NONE)) | |
276 | + | then throw("proposer doesn't exist") | |
277 | + | else if ((adoption == NONE)) | |
278 | + | then throw("you cannot evaluate this proposer") | |
279 | + | else if ((getValueEvaluateData(room, propose) != NONE)) | |
280 | + | then throw("you have already evaluate") | |
281 | + | else WriteSet([DataEntry(getKeyEvaluateData(room, propose), data), DataEntry(getKeyEvaluateCountProposer(winner), (getValueEvaluateCountProposer(winner) + 1)), DataEntry(getKeyTotalPointProposer(winner), (getValueTotalPointProposer(winner) + point))]) | |
282 | + | } | |
283 | + | ||
284 | + | ||
285 | + | ||
286 | + | @Callable(i) | |
287 | + | func withdraw () = { | |
288 | + | let user = toBase58String(i.caller.bytes) | |
289 | + | let balance = getValueBalanceUser(user) | |
290 | + | if ((0 >= balance)) | |
291 | + | then throw("you have nothing to withdraw") | |
292 | + | else ScriptResult(WriteSet([DataEntry(getKeyBalanceUser(user), 0)]), TransferSet([ScriptTransfer(addressFromStringValue(user), balance, unit)])) | |
293 | + | } | |
294 | + | ||
295 | + | ||
296 | + | @Verifier(tx) | |
297 | + | func varify () = match tx { | |
298 | + | case s: SetScriptTransaction => | |
299 | + | sigVerify(tx.bodyBytes, tx.proofs[0], ownerPubKey) | |
300 | + | case d: DataTransaction => | |
301 | + | true | |
302 | + | case t: TransferTransaction => | |
303 | + | sigVerify(tx.bodyBytes, tx.proofs[0], ownerPubKey) | |
304 | + | case _ => | |
305 | + | false | |
306 | + | } | |
307 | + |
github/deemru/w8io/026f985 21.51 ms ◑