tx · EFnd6Gnt74Qd7ZXFFzDP9RzttDtE9roj8166LAWqGhTu 3NBB3iv7YDRsD8ZM2Pw2V5eTcsfqh3j2mvF: -0.01400000 Waves 2019.06.23 21:22 [555055] smart account 3NBB3iv7YDRsD8ZM2Pw2V5eTcsfqh3j2mvF > SELF 0.00000000 Waves
{ "type": 13, "id": "EFnd6Gnt74Qd7ZXFFzDP9RzttDtE9roj8166LAWqGhTu", "fee": 1400000, "feeAssetId": null, "timestamp": 1561314189152, "version": 1, "sender": "3NBB3iv7YDRsD8ZM2Pw2V5eTcsfqh3j2mvF", "senderPublicKey": "9i5FpMUFCwhogG5euZDBZKV6NehQN4xX83qvNr8NWipE", "proofs": [ "3zngR1kozgn7TaEv3KNqfBNQyzmuNZZwhiAiDLetg26i7UXpyPLnjquSk9z2odKBTq2z4SFx614rEV7m1femkh4T" ], "script": "base64:AAIDAAAAAAAAAAAAAABTAAAAAAROT05FAgAAAARub25lAQAAAA5nZXROdW1iZXJCeUtleQAAAAEAAAADa2V5BAAAAANudW0EAAAAByRtYXRjaDAJAAQaAAAAAgUAAAAEdGhpcwUAAAADa2V5AwkAAAEAAAACBQAAAAckbWF0Y2gwAgAAAANJbnQEAAAAAWEFAAAAByRtYXRjaDAFAAAAAWEAAAAAAAAAAAAFAAAAA251bQEAAAALZ2V0U3RyQnlLZXkAAAABAAAAA2tleQQAAAADc3RyBAAAAAckbWF0Y2gwCQAEHQAAAAIFAAAABHRoaXMFAAAAA2tleQMJAAABAAAAAgUAAAAHJG1hdGNoMAIAAAAGU3RyaW5nBAAAAAFhBQAAAAckbWF0Y2gwBQAAAAFhBQAAAAROT05FBQAAAANzdHIBAAAAEmdldEtleVdoaXRlbGlzdFJlZgAAAAEAAAAHYWNjb3VudAkAASwAAAACAgAAAAd3bF9yZWZfBQAAAAdhY2NvdW50AQAAABVnZXRLZXlXaGl0ZWxpc3RTdGF0dXMAAAABAAAAB2FjY291bnQJAAEsAAAAAgIAAAAHd2xfc3RzXwUAAAAH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sYW5jZQAAAAEFAAAAB2FjY291bnQFAAAACWJldHByb2ZpdAUAAAAJcm9pcHJvZml0BQAAAAxhdXRob3Jwcm9maXQJAARMAAAAAgkBAAAACURhdGFFbnRyeQAAAAIJAQAAABBnZXRLZXlJdGVtU3RhdHVzAAAAAQUAAAAEaXRlbQMJAABmAAAAAgUAAAAMYXV0aG9ycHJvZml0AAAAAAAAAAAABQAAAAdDQVNIT1VUBQAAAAZzdGF0dXMJAARMAAAAAgkBAAAACURhdGFFbnRyeQAAAAIJAQAAABJnZXRLZXlJdGVtQWNjRmluYWwAAAACBQAAAARpdGVtBQAAAAdhY2NvdW50BQAAAAdDTEFJTUVEBQAAAANuaWwAAAAAw0mn7g==", "chainId": 84, "height": 555055, "spentComplexity": 0 } View: original | compacted Prev: DpJ6F73LB42TawkjWSnaymnFSo8ZYetqZfrNZ7DQ9gKS Next: 9inPjLbZ3doqYzt11ts8SUTnkQDPYyugrn79mhWfBMrP Diff:
Old | New | Differences | |
---|---|---|---|
26 | 26 | ||
27 | 27 | ||
28 | 28 | func getKeyWhitelistRef (account) = ("wl_ref_" + account) | |
29 | - | ||
30 | - | ||
31 | - | func getKeyWhitelistInvitationData (account) = ("wl_invdata_" + account) | |
32 | 29 | ||
33 | 30 | ||
34 | 31 | func getKeyWhitelistStatus (account) = ("wl_sts_" + account) | |
205 | 202 | func getValueItemAccWinnings (item,account) = getNumberByKey(getKeyItemAccWinnings(item, account)) | |
206 | 203 | ||
207 | 204 | ||
208 | - | let WHITELISTED = "whitelisted" | |
205 | + | let WHITELISTED = "registered" | |
206 | + | ||
207 | + | let INVITED = "invited" | |
208 | + | ||
209 | + | let WHALE = "whale" | |
209 | 210 | ||
210 | 211 | let NEW = "new" | |
211 | 212 | ||
252 | 253 | then (account != GENESIS) | |
253 | 254 | else false) | |
254 | 255 | then throw("Your account should be whitelisted") | |
255 | - | else WriteSet([DataEntry(getKeyWhitelistRef(newaccount), account), DataEntry( | |
256 | + | else WriteSet([DataEntry(getKeyWhitelistRef(newaccount), account), DataEntry(getKeyWhitelistBio(newaccount), data), DataEntry(getKeyWhitelistStatus(newaccount), INVITED)]) | |
256 | 257 | } | |
257 | 258 | ||
258 | 259 | ||
259 | 260 | ||
260 | 261 | @Callable(i) | |
261 | - | func signup (data) = { | |
262 | + | func signup (data,isWhale) = { | |
262 | 263 | let account = toBase58String(i.caller.bytes) | |
263 | - | if (( | |
264 | + | if ((getValueWhitelistStatus(account) != INVITED)) | |
264 | 265 | then throw("Referral invite needed") | |
265 | - | else WriteSet([DataEntry(getKeyWhitelistBio(account), data), DataEntry(getKeyWhitelistBlock(account), height), DataEntry(getKeyWhitelistStatus(account), WHITELISTED)]) | |
266 | + | else WriteSet([DataEntry(getKeyWhitelistBio(account), data), DataEntry(getKeyWhitelistBlock(account), height), DataEntry(getKeyWhitelistStatus(account), if (isWhale) | |
267 | + | then WHALE | |
268 | + | else WHITELISTED)]) | |
266 | 269 | } | |
267 | 270 | ||
268 | 271 |
Old | New | Differences | |
---|---|---|---|
1 | 1 | {-# STDLIB_VERSION 3 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | 4 | let NONE = "none" | |
5 | 5 | ||
6 | 6 | func getNumberByKey (key) = { | |
7 | 7 | let num = match getInteger(this, key) { | |
8 | 8 | case a: Int => | |
9 | 9 | a | |
10 | 10 | case _ => | |
11 | 11 | 0 | |
12 | 12 | } | |
13 | 13 | num | |
14 | 14 | } | |
15 | 15 | ||
16 | 16 | ||
17 | 17 | func getStrByKey (key) = { | |
18 | 18 | let str = match getString(this, key) { | |
19 | 19 | case a: String => | |
20 | 20 | a | |
21 | 21 | case _ => | |
22 | 22 | NONE | |
23 | 23 | } | |
24 | 24 | str | |
25 | 25 | } | |
26 | 26 | ||
27 | 27 | ||
28 | 28 | func getKeyWhitelistRef (account) = ("wl_ref_" + account) | |
29 | - | ||
30 | - | ||
31 | - | func getKeyWhitelistInvitationData (account) = ("wl_invdata_" + account) | |
32 | 29 | ||
33 | 30 | ||
34 | 31 | func getKeyWhitelistStatus (account) = ("wl_sts_" + account) | |
35 | 32 | ||
36 | 33 | ||
37 | 34 | func getKeyBalance (account) = ("balance_" + account) | |
38 | 35 | ||
39 | 36 | ||
40 | 37 | func getKeyWhitelistBio (account) = ("wl_bio_" + account) | |
41 | 38 | ||
42 | 39 | ||
43 | 40 | func getKeyWhitelistBlock (account) = ("wl_blk_" + account) | |
44 | 41 | ||
45 | 42 | ||
46 | 43 | func getKeyItemAuthor (item) = ("author_" + item) | |
47 | 44 | ||
48 | 45 | ||
49 | 46 | func getKeyItemBlock (item) = ("block_" + item) | |
50 | 47 | ||
51 | 48 | ||
52 | 49 | func getKeyItemVotingExpiration (item) = ("expiration_block_" + item) | |
53 | 50 | ||
54 | 51 | ||
55 | 52 | func getKeyItemBank (item) = ("bank_" + item) | |
56 | 53 | ||
57 | 54 | ||
58 | 55 | func getKeyItemStatus (item) = ("status_" + item) | |
59 | 56 | ||
60 | 57 | ||
61 | 58 | func getKeyItemData (item) = ("datajson_" + item) | |
62 | 59 | ||
63 | 60 | ||
64 | 61 | func getKeyItemCrowdExpiration (item) = ("expiration_one_" + item) | |
65 | 62 | ||
66 | 63 | ||
67 | 64 | func getKeyItemWhaleExpiration (item) = ("expiration_two_" + item) | |
68 | 65 | ||
69 | 66 | ||
70 | 67 | func getKeyItemNCommits (item) = ("ncommits_" + item) | |
71 | 68 | ||
72 | 69 | ||
73 | 70 | func getKeyItemAccCommit (item,account) = ((("commit_" + item) + "_") + account) | |
74 | 71 | ||
75 | 72 | ||
76 | 73 | func getKeyItemAccReveal (item,account) = ((("reveal_" + item) + "_") + account) | |
77 | 74 | ||
78 | 75 | ||
79 | 76 | func getKeyItemVotesYes (item) = ("cnt_yes_" + item) | |
80 | 77 | ||
81 | 78 | ||
82 | 79 | func getKeyItemVotesNo (item) = ("cnt_no_" + item) | |
83 | 80 | ||
84 | 81 | ||
85 | 82 | func getKeyItemAccFinal (item,account) = ((("final_" + item) + "_") + account) | |
86 | 83 | ||
87 | 84 | ||
88 | 85 | func getKeyItemFundPositive (item) = ("positive_fund_" + item) | |
89 | 86 | ||
90 | 87 | ||
91 | 88 | func getKeyItemFundNegative (item) = ("negative_fund_" + item) | |
92 | 89 | ||
93 | 90 | ||
94 | 91 | func getKeyItemAccFundPositive (item,account) = ((getKeyItemFundPositive(item) + "_") + account) | |
95 | 92 | ||
96 | 93 | ||
97 | 94 | func getKeyItemAccFundNegative (item,account) = ((getKeyItemFundNegative(item) + "_") + account) | |
98 | 95 | ||
99 | 96 | ||
100 | 97 | func getKeyItemAccReviewsCnt (item,account) = ((("reviews_cnt_" + item) + "_") + account) | |
101 | 98 | ||
102 | 99 | ||
103 | 100 | func getKeyItemAccReview (item,account) = ((("review_" + item) + "_") + account) | |
104 | 101 | ||
105 | 102 | ||
106 | 103 | func getKeyItemAccReviewText (item,account,cnt) = ((getKeyItemAccReview(item, account) + "_text_id:") + cnt) | |
107 | 104 | ||
108 | 105 | ||
109 | 106 | func getKeyItemAccReviewMode (item,account,cnt) = ((getKeyItemAccReview(item, account) + "_mode_id:") + cnt) | |
110 | 107 | ||
111 | 108 | ||
112 | 109 | func getKeyItemAccReviewTier (item,account,cnt) = ((getKeyItemAccReview(item, account) + "_tier_id:") + cnt) | |
113 | 110 | ||
114 | 111 | ||
115 | 112 | func getKeyItemBuyoutAmount (item) = ("buyout_amount_" + item) | |
116 | 113 | ||
117 | 114 | ||
118 | 115 | func getKeyItemAccWinnings (item,account) = ((("winnings_" + item) + "_") + account) | |
119 | 116 | ||
120 | 117 | ||
121 | 118 | func getValueWhitelistRef (account) = getStrByKey(getKeyWhitelistRef(account)) | |
122 | 119 | ||
123 | 120 | ||
124 | 121 | func getValueWhitelistStatus (account) = getStrByKey(getKeyWhitelistStatus(account)) | |
125 | 122 | ||
126 | 123 | ||
127 | 124 | func getValueBalance (account) = getNumberByKey(getKeyBalance(account)) | |
128 | 125 | ||
129 | 126 | ||
130 | 127 | func getValueWhitelistBio (account) = getStrByKey(getKeyWhitelistBio(account)) | |
131 | 128 | ||
132 | 129 | ||
133 | 130 | func getValueWhitelistBlock (account) = getStrByKey(getKeyWhitelistBlock(account)) | |
134 | 131 | ||
135 | 132 | ||
136 | 133 | func getValueItemAuthor (item) = getStrByKey(getKeyItemAuthor(item)) | |
137 | 134 | ||
138 | 135 | ||
139 | 136 | func getValueItemBlock (item) = getNumberByKey(getKeyItemBlock(item)) | |
140 | 137 | ||
141 | 138 | ||
142 | 139 | func getValueItemVotingExpiration (item) = getNumberByKey(getKeyItemVotingExpiration(item)) | |
143 | 140 | ||
144 | 141 | ||
145 | 142 | func getValueItemBank (item) = getNumberByKey(getKeyItemBank(item)) | |
146 | 143 | ||
147 | 144 | ||
148 | 145 | func getValueItemStatus (item) = getStrByKey(getKeyItemStatus(item)) | |
149 | 146 | ||
150 | 147 | ||
151 | 148 | func getValueItemData (item) = getStrByKey(getKeyItemData(item)) | |
152 | 149 | ||
153 | 150 | ||
154 | 151 | func getValueItemCrowdExpiration (item) = getNumberByKey(getKeyItemCrowdExpiration(item)) | |
155 | 152 | ||
156 | 153 | ||
157 | 154 | func getValueItemWhaleExpiration (item) = getNumberByKey(getKeyItemWhaleExpiration(item)) | |
158 | 155 | ||
159 | 156 | ||
160 | 157 | func getValueItemNCommits (item) = getNumberByKey(getKeyItemNCommits(item)) | |
161 | 158 | ||
162 | 159 | ||
163 | 160 | func getValueItemAccCommit (item,account) = getStrByKey(getKeyItemAccCommit(item, account)) | |
164 | 161 | ||
165 | 162 | ||
166 | 163 | func getValueItemAccReveal (item,account) = getStrByKey(getKeyItemAccReveal(item, account)) | |
167 | 164 | ||
168 | 165 | ||
169 | 166 | func getValueItemVotesYes (item) = getNumberByKey(getKeyItemVotesYes(item)) | |
170 | 167 | ||
171 | 168 | ||
172 | 169 | func getValueItemVotesNo (item) = getNumberByKey(getKeyItemVotesNo(item)) | |
173 | 170 | ||
174 | 171 | ||
175 | 172 | func getValueItemAccFinal (item,account) = getStrByKey(getKeyItemAccFinal(item, account)) | |
176 | 173 | ||
177 | 174 | ||
178 | 175 | func getValueItemFundPositive (item) = getNumberByKey(getKeyItemFundPositive(item)) | |
179 | 176 | ||
180 | 177 | ||
181 | 178 | func getValueItemFundNegative (item) = getNumberByKey(getKeyItemFundNegative(item)) | |
182 | 179 | ||
183 | 180 | ||
184 | 181 | func getValueItemAccFundPositive (item,account) = getNumberByKey(getKeyItemAccFundPositive(item, account)) | |
185 | 182 | ||
186 | 183 | ||
187 | 184 | func getValueItemAccFundNegative (item,account) = getNumberByKey(getKeyItemAccFundNegative(item, account)) | |
188 | 185 | ||
189 | 186 | ||
190 | 187 | func getValueItemAccReviewsCnt (item,account) = getNumberByKey(getKeyItemAccReviewsCnt(item, account)) | |
191 | 188 | ||
192 | 189 | ||
193 | 190 | func getValueItemAccReviewText (item,account,cnt) = getStrByKey(getKeyItemAccReviewText(item, account, cnt)) | |
194 | 191 | ||
195 | 192 | ||
196 | 193 | func getValueItemAccReviewMode (item,account,cnt) = getStrByKey(getKeyItemAccReviewMode(item, account, cnt)) | |
197 | 194 | ||
198 | 195 | ||
199 | 196 | func getValueItemAccReviewTier (item,account,cnt) = getNumberByKey(getKeyItemAccReviewTier(item, account, cnt)) | |
200 | 197 | ||
201 | 198 | ||
202 | 199 | func getValueItemBuyoutAmount (item) = getNumberByKey(getKeyItemBuyoutAmount(item)) | |
203 | 200 | ||
204 | 201 | ||
205 | 202 | func getValueItemAccWinnings (item,account) = getNumberByKey(getKeyItemAccWinnings(item, account)) | |
206 | 203 | ||
207 | 204 | ||
208 | - | let WHITELISTED = "whitelisted" | |
205 | + | let WHITELISTED = "registered" | |
206 | + | ||
207 | + | let INVITED = "invited" | |
208 | + | ||
209 | + | let WHALE = "whale" | |
209 | 210 | ||
210 | 211 | let NEW = "new" | |
211 | 212 | ||
212 | 213 | let COMMIT = "voting_commit" | |
213 | 214 | ||
214 | 215 | let REVEAL = "voting_reveal" | |
215 | 216 | ||
216 | 217 | let FEATURED = "featured" | |
217 | 218 | ||
218 | 219 | let DELISTED = "delisted" | |
219 | 220 | ||
220 | 221 | let CASHOUT = "cashout" | |
221 | 222 | ||
222 | 223 | let BUYOUT = "buyout" | |
223 | 224 | ||
224 | 225 | let FINISHED = "finished" | |
225 | 226 | ||
226 | 227 | let CLAIMED = "claimed" | |
227 | 228 | ||
228 | 229 | let POSITIVE = "positive" | |
229 | 230 | ||
230 | 231 | let NEGATIVE = "negative" | |
231 | 232 | ||
232 | 233 | let GENESIS = "3Ms9dv5wrt3kPXeT2g9yLM2LhS33CT7iuiQ" | |
233 | 234 | ||
234 | 235 | let VOTERS = 3 | |
235 | 236 | ||
236 | 237 | let QUORUM = 2 | |
237 | 238 | ||
238 | 239 | let LISTINGFEE = (500000000 / 1000) | |
239 | 240 | ||
240 | 241 | let VOTEBET = (150000000 / 1000) | |
241 | 242 | ||
242 | 243 | let TIERS = [10, 50, 250, 1250, 6250] | |
243 | 244 | ||
244 | 245 | let MULTIPLIER = 150 | |
245 | 246 | ||
246 | 247 | @Callable(i) | |
247 | 248 | func inviteuser (newaccount,data) = { | |
248 | 249 | let account = toBase58String(i.caller.bytes) | |
249 | 250 | if ((getValueWhitelistRef(newaccount) != NONE)) | |
250 | 251 | then throw("User has already been invited") | |
251 | 252 | else if (if ((getKeyWhitelistStatus(account) != WHITELISTED)) | |
252 | 253 | then (account != GENESIS) | |
253 | 254 | else false) | |
254 | 255 | then throw("Your account should be whitelisted") | |
255 | - | else WriteSet([DataEntry(getKeyWhitelistRef(newaccount), account), DataEntry( | |
256 | + | else WriteSet([DataEntry(getKeyWhitelistRef(newaccount), account), DataEntry(getKeyWhitelistBio(newaccount), data), DataEntry(getKeyWhitelistStatus(newaccount), INVITED)]) | |
256 | 257 | } | |
257 | 258 | ||
258 | 259 | ||
259 | 260 | ||
260 | 261 | @Callable(i) | |
261 | - | func signup (data) = { | |
262 | + | func signup (data,isWhale) = { | |
262 | 263 | let account = toBase58String(i.caller.bytes) | |
263 | - | if (( | |
264 | + | if ((getValueWhitelistStatus(account) != INVITED)) | |
264 | 265 | then throw("Referral invite needed") | |
265 | - | else WriteSet([DataEntry(getKeyWhitelistBio(account), data), DataEntry(getKeyWhitelistBlock(account), height), DataEntry(getKeyWhitelistStatus(account), WHITELISTED)]) | |
266 | + | else WriteSet([DataEntry(getKeyWhitelistBio(account), data), DataEntry(getKeyWhitelistBlock(account), height), DataEntry(getKeyWhitelistStatus(account), if (isWhale) | |
267 | + | then WHALE | |
268 | + | else WHITELISTED)]) | |
266 | 269 | } | |
267 | 270 | ||
268 | 271 | ||
269 | 272 | ||
270 | 273 | @Callable(i) | |
271 | 274 | func withdraw () = { | |
272 | 275 | let currentKey = toBase58String(i.caller.bytes) | |
273 | 276 | let amount = getValueBalance(currentKey) | |
274 | 277 | if ((0 >= amount)) | |
275 | 278 | then throw("Not enough balance") | |
276 | 279 | else ScriptResult(WriteSet([DataEntry(getKeyBalance(currentKey), 0)]), TransferSet([ScriptTransfer(i.caller, amount, unit)])) | |
277 | 280 | } | |
278 | 281 | ||
279 | 282 | ||
280 | 283 | ||
281 | 284 | @Callable(i) | |
282 | 285 | func additem (item,expVoting,expCrowd,expWhale,data) = { | |
283 | 286 | let account = toBase58String(i.caller.bytes) | |
284 | 287 | let pmt = extract(i.payment) | |
285 | 288 | if (isDefined(pmt.assetId)) | |
286 | 289 | then throw("can use waves only at the moment") | |
287 | 290 | else if ((pmt.amount != LISTINGFEE)) | |
288 | 291 | then throw("Please pay exact amount for the listing") | |
289 | 292 | else if (if (if ((expVoting > 2)) | |
290 | 293 | then (expCrowd > 3) | |
291 | 294 | else false) | |
292 | 295 | then (expWhale > 4) | |
293 | 296 | else false) | |
294 | 297 | then throw("Incorrect time parameters") | |
295 | 298 | else if ((getValueItemAuthor(item) != NONE)) | |
296 | 299 | then throw("Item already exist") | |
297 | 300 | else WriteSet([DataEntry(getKeyItemAuthor(item), account), DataEntry(getKeyItemBlock(item), height), DataEntry(getKeyItemVotingExpiration(item), (height + expVoting)), DataEntry(getKeyItemBank(item), LISTINGFEE), DataEntry(getKeyItemStatus(item), NEW), DataEntry(getKeyItemData(item), data), DataEntry(getKeyItemCrowdExpiration(item), (height + expCrowd)), DataEntry(getKeyItemWhaleExpiration(item), (height + expWhale))]) | |
298 | 301 | } | |
299 | 302 | ||
300 | 303 | ||
301 | 304 | ||
302 | 305 | @Callable(i) | |
303 | 306 | func votecommit (item,hash) = { | |
304 | 307 | let account = toBase58String(i.caller.bytes) | |
305 | 308 | let commits = getValueItemNCommits(item) | |
306 | 309 | let status = getValueItemStatus(item) | |
307 | 310 | let pmt = extract(i.payment) | |
308 | 311 | if (isDefined(pmt.assetId)) | |
309 | 312 | then throw("can use waves only at the moment") | |
310 | 313 | else if ((pmt.amount != (2 * VOTEBET))) | |
311 | 314 | then throw("Not enough funds to vote for a new item") | |
312 | 315 | else if ((height > getValueItemVotingExpiration(item))) | |
313 | 316 | then throw("The voting has expired") | |
314 | 317 | else if ((getValueItemAuthor(item) == account)) | |
315 | 318 | then throw("Cannot vote for own proposal") | |
316 | 319 | else if (if ((status != NEW)) | |
317 | 320 | then (status != COMMIT) | |
318 | 321 | else false) | |
319 | 322 | then throw("Wrong item status for 'commit' action") | |
320 | 323 | else if ((commits >= VOTERS)) | |
321 | 324 | then throw("No more voters for this item") | |
322 | 325 | else if ((getValueItemAccCommit(item, account) != NONE)) | |
323 | 326 | then throw("Can't vote twice") | |
324 | 327 | else WriteSet([DataEntry(getKeyItemStatus(item), if (((commits + 1) == VOTERS)) | |
325 | 328 | then REVEAL | |
326 | 329 | else COMMIT), DataEntry(getKeyItemAccCommit(item, account), hash), DataEntry(getKeyItemNCommits(item), (commits + 1))]) | |
327 | 330 | } | |
328 | 331 | ||
329 | 332 | ||
330 | 333 | ||
331 | 334 | @Callable(i) | |
332 | 335 | func votereveal (item,vote,salt) = { | |
333 | 336 | let ridehash = toBase58String(sha256(toBytes((vote + salt)))) | |
334 | 337 | let account = toBase58String(i.caller.bytes) | |
335 | 338 | let yesmltp = if ((vote == FEATURED)) | |
336 | 339 | then 1 | |
337 | 340 | else 0 | |
338 | 341 | let notmltp = if ((vote == DELISTED)) | |
339 | 342 | then 1 | |
340 | 343 | else 0 | |
341 | 344 | let yescnt = getValueItemVotesYes(item) | |
342 | 345 | let notcnt = getValueItemVotesNo(item) | |
343 | 346 | let newstatus = if ((yescnt >= QUORUM)) | |
344 | 347 | then FEATURED | |
345 | 348 | else if ((notcnt >= QUORUM)) | |
346 | 349 | then DELISTED | |
347 | 350 | else REVEAL | |
348 | 351 | if ((getValueItemAccCommit(item, account) != ridehash)) | |
349 | 352 | then throw("Hashes don't match") | |
350 | 353 | else if ((height > getValueItemVotingExpiration(item))) | |
351 | 354 | then throw("The challenge has expired") | |
352 | 355 | else if ((VOTERS > getValueItemNCommits(item))) | |
353 | 356 | then throw("It's still commit stage") | |
354 | 357 | else if (if ((getValueItemStatus(item) != REVEAL)) | |
355 | 358 | then (getValueItemStatus(item) != newstatus) | |
356 | 359 | else false) | |
357 | 360 | then throw("Wrong item status for 'reveal' action") | |
358 | 361 | else if ((getValueItemAccReveal(item, account) != NONE)) | |
359 | 362 | then throw("Can't vote twice") | |
360 | 363 | else if (if ((vote != FEATURED)) | |
361 | 364 | then (vote != DELISTED) | |
362 | 365 | else false) | |
363 | 366 | then throw("Bad vote result format") | |
364 | 367 | else WriteSet([DataEntry(getKeyItemAccReveal(item, account), vote), DataEntry(getKeyItemVotesYes(item), (yescnt + yesmltp)), DataEntry(getKeyItemVotesNo(item), (notcnt + notmltp)), DataEntry(getKeyItemStatus(item), newstatus), DataEntry(getKeyBalance(account), (getValueBalance(account) + VOTEBET))]) | |
365 | 368 | } | |
366 | 369 | ||
367 | 370 | ||
368 | 371 | ||
369 | 372 | @Callable(i) | |
370 | 373 | func finalizevoting (item,account) = { | |
371 | 374 | let yescnt = getValueItemVotesYes(item) | |
372 | 375 | let notcnt = getValueItemVotesNo(item) | |
373 | 376 | let accvote = getValueItemAccReveal(item, account) | |
374 | 377 | let isauthor = (account == getValueItemAuthor(item)) | |
375 | 378 | let finalstatus = if ((yescnt > QUORUM)) | |
376 | 379 | then FEATURED | |
377 | 380 | else if ((notcnt > QUORUM)) | |
378 | 381 | then DELISTED | |
379 | 382 | else NONE | |
380 | 383 | let mltisnotfullmajority = if (if ((yescnt == VOTERS)) | |
381 | 384 | then true | |
382 | 385 | else (notcnt == VOTERS)) | |
383 | 386 | then 0 | |
384 | 387 | else 1 | |
385 | 388 | let nwinners = if ((finalstatus == FEATURED)) | |
386 | 389 | then yescnt | |
387 | 390 | else if ((finalstatus == DELISTED)) | |
388 | 391 | then notcnt | |
389 | 392 | else 0 | |
390 | 393 | let nloosers = (VOTERS - nwinners) | |
391 | 394 | let mltacciswinner = if ((finalstatus == accvote)) | |
392 | 395 | then 1 | |
393 | 396 | else 0 | |
394 | 397 | let voteprofit = if ((nwinners == 0)) | |
395 | 398 | then 0 | |
396 | 399 | else (mltacciswinner * (VOTEBET + ((mltisnotfullmajority * ((nloosers * VOTEBET) + LISTINGFEE)) / nwinners))) | |
397 | 400 | let authorreturn = (((LISTINGFEE * (if (isauthor) | |
398 | 401 | then 1 | |
399 | 402 | else 0)) * (if ((mltisnotfullmajority == 1)) | |
400 | 403 | then 0 | |
401 | 404 | else 1)) * (if ((finalstatus == FEATURED)) | |
402 | 405 | then 1 | |
403 | 406 | else 0)) | |
404 | 407 | if ((getValueItemVotingExpiration(item) > height)) | |
405 | 408 | then throw("The voting hasn't finished yet") | |
406 | 409 | else if ((getValueItemAccFinal(item, account) == FINISHED)) | |
407 | 410 | then throw("Account has already claimed") | |
408 | 411 | else if (if ((accvote == NONE)) | |
409 | 412 | then !(isauthor) | |
410 | 413 | else false) | |
411 | 414 | then throw("Account hasnot voted, hasnot reveal or isnot author") | |
412 | 415 | else if ((finalstatus == NONE)) | |
413 | 416 | then throw("Voting has expired") | |
414 | 417 | else WriteSet([DataEntry(getKeyItemAccFinal(item, account), FINISHED), DataEntry(getKeyBalance(account), ((getValueBalance(account) + voteprofit) + authorreturn))]) | |
415 | 418 | } | |
416 | 419 | ||
417 | 420 | ||
418 | 421 | ||
419 | 422 | @Callable(i) | |
420 | 423 | func closeexpiredvoting (item,account) = { | |
421 | 424 | let finalstatus = if ((getValueItemVotesYes(item) > QUORUM)) | |
422 | 425 | then FEATURED | |
423 | 426 | else if ((getValueItemVotesNo(item) > QUORUM)) | |
424 | 427 | then DELISTED | |
425 | 428 | else NONE | |
426 | 429 | let accvote = getValueItemAccReveal(item, account) | |
427 | 430 | let isauthor = (account == getValueItemAuthor(item)) | |
428 | 431 | let acccomi = getValueItemAccCommit(item, account) | |
429 | 432 | let hasrevealstage = (getValueItemNCommits(item) == VOTERS) | |
430 | 433 | let authorreturn = (LISTINGFEE * (if (isauthor) | |
431 | 434 | then 1 | |
432 | 435 | else 0)) | |
433 | 436 | let votersreturn1 = ((VOTEBET * (if (hasrevealstage) | |
434 | 437 | then 1 | |
435 | 438 | else 0)) * (if ((accvote != NONE)) | |
436 | 439 | then 1 | |
437 | 440 | else 0)) | |
438 | 441 | let votersreturn2 = (((2 * VOTEBET) * (if (hasrevealstage) | |
439 | 442 | then 0 | |
440 | 443 | else 1)) * (if ((acccomi != NONE)) | |
441 | 444 | then 1 | |
442 | 445 | else 0)) | |
443 | 446 | if ((getValueItemVotingExpiration(item) > height)) | |
444 | 447 | then throw("The voting hasn't finished yet") | |
445 | 448 | else if (if (!(isauthor)) | |
446 | 449 | then (acccomi == NONE) | |
447 | 450 | else false) | |
448 | 451 | then throw("Wrong account or item") | |
449 | 452 | else if ((getValueItemAccFinal(item, account) == FINISHED)) | |
450 | 453 | then throw("Account has already claimed") | |
451 | 454 | else if ((finalstatus != NONE)) | |
452 | 455 | then throw("Wrong item status") | |
453 | 456 | else WriteSet([DataEntry(getKeyItemAccFinal(item, account), FINISHED), DataEntry(getKeyBalance(account), (((getValueBalance(account) + authorreturn) + votersreturn1) + votersreturn2))]) | |
454 | 457 | } | |
455 | 458 | ||
456 | 459 | ||
457 | 460 | ||
458 | 461 | @Callable(i) | |
459 | 462 | func donate (item,tier,mode,review) = { | |
460 | 463 | let account = toBase58String(i.caller.bytes) | |
461 | 464 | let pmt = extract(i.payment) | |
462 | 465 | if (isDefined(pmt.assetId)) | |
463 | 466 | then throw("can use waves only at the moment") | |
464 | 467 | else { | |
465 | 468 | let cnt = (getValueItemAccReviewsCnt(item, account) + 1) | |
466 | 469 | let newnegativefund = (getValueItemFundNegative(item) + ((if ((mode == NEGATIVE)) | |
467 | 470 | then 1 | |
468 | 471 | else 0) * pmt.amount)) | |
469 | 472 | let newpositivefund = (getValueItemFundPositive(item) + ((if ((mode == POSITIVE)) | |
470 | 473 | then 1 | |
471 | 474 | else 0) * pmt.amount)) | |
472 | 475 | if ((getValueItemStatus(item) != FEATURED)) | |
473 | 476 | then throw("The project hasn't accepted by community") | |
474 | 477 | else if ((height >= getValueItemCrowdExpiration(item))) | |
475 | 478 | then throw("The time for crowdfunding has expired") | |
476 | 479 | else if ((newnegativefund >= newpositivefund)) | |
477 | 480 | then throw("Negative fund can't be higher than positive fund") | |
478 | 481 | else if (if ((mode != POSITIVE)) | |
479 | 482 | then (mode != NEGATIVE) | |
480 | 483 | else false) | |
481 | 484 | then throw("Wrong mode parameter") | |
482 | 485 | else if ((getValueItemAuthor(item) == account)) | |
483 | 486 | then throw("Can't donate own project") | |
484 | 487 | else if ((pmt.amount != TIERS[(tier - 1)])) | |
485 | 488 | then throw(("The payment must be equal to tier amount: " + toString(TIERS[(tier - 1)]))) | |
486 | 489 | else WriteSet([DataEntry(getKeyItemAccReviewsCnt(item, account), cnt), DataEntry(getKeyItemAccFundPositive(item, account), (getValueItemAccFundPositive(item, account) + ((if ((mode == POSITIVE)) | |
487 | 490 | then 1 | |
488 | 491 | else 0) * pmt.amount))), DataEntry(getKeyItemAccFundNegative(item, account), (getValueItemAccFundNegative(item, account) + ((if ((mode == NEGATIVE)) | |
489 | 492 | then 1 | |
490 | 493 | else 0) * pmt.amount))), DataEntry(getKeyItemFundPositive(item), newpositivefund), DataEntry(getKeyItemFundNegative(item), newnegativefund), DataEntry(getKeyItemAccReviewText(item, account, toString(cnt)), review), DataEntry(getKeyItemAccReviewMode(item, account, toString(cnt)), mode), DataEntry(getKeyItemAccReviewTier(item, account, toString(cnt)), tier)]) | |
491 | 494 | } | |
492 | 495 | } | |
493 | 496 | ||
494 | 497 | ||
495 | 498 | ||
496 | 499 | @Callable(i) | |
497 | 500 | func whale (item) = { | |
498 | 501 | let pmt = extract(i.payment) | |
499 | 502 | if (isDefined(pmt.assetId)) | |
500 | 503 | then throw("can use waves only at the moment") | |
501 | 504 | else if ((getValueItemStatus(item) != FEATURED)) | |
502 | 505 | then throw("The project hasn't accepted by community") | |
503 | 506 | else if ((getValueItemCrowdExpiration(item) > height)) | |
504 | 507 | then throw("The time for crowdfunding has not expired yet") | |
505 | 508 | else if ((height > getValueItemWhaleExpiration(item))) | |
506 | 509 | then throw("The time for grant has expired") | |
507 | 510 | else if ((getValueItemStatus(item) == BUYOUT)) | |
508 | 511 | then throw("Investement has already done") | |
509 | 512 | else if ((((getValueItemFundPositive(item) * MULTIPLIER) / 100) > pmt.amount)) | |
510 | 513 | then throw((("Investement must be more than " + toString(MULTIPLIER)) + "% of supportes funds")) | |
511 | 514 | else WriteSet([DataEntry(getKeyItemStatus(item), BUYOUT), DataEntry(getKeyBalance(getValueItemAuthor(item)), (getValueBalance(getValueItemAuthor(item)) + getValueItemFundPositive(item))), DataEntry(getKeyItemBuyoutAmount(item), pmt.amount)]) | |
512 | 515 | } | |
513 | 516 | ||
514 | 517 | ||
515 | 518 | ||
516 | 519 | @Callable(i) | |
517 | 520 | func claimwinnings (item,account) = { | |
518 | 521 | let status = getValueItemStatus(item) | |
519 | 522 | let isbayout = if ((status == BUYOUT)) | |
520 | 523 | then 1 | |
521 | 524 | else 0 | |
522 | 525 | let iscrowdf = if ((status != BUYOUT)) | |
523 | 526 | then 1 | |
524 | 527 | else 0 | |
525 | 528 | let positivefund = getValueItemFundPositive(item) | |
526 | 529 | let negativefund = getValueItemFundNegative(item) | |
527 | 530 | let share = (((isbayout * (getValueItemAccFundPositive(item, account) * 100)) / (if ((0 >= positivefund)) | |
528 | 531 | then 1 | |
529 | 532 | else positivefund)) + ((iscrowdf * (getValueItemAccFundNegative(item, account) * 100)) / (if ((0 >= negativefund)) | |
530 | 533 | then 1 | |
531 | 534 | else negativefund))) | |
532 | 535 | let tmpnegwin = ((negativefund * MULTIPLIER) / 100) | |
533 | 536 | let betprofit = ((isbayout * ((share * negativefund) / 100)) + (iscrowdf * ((share * (if ((positivefund > tmpnegwin)) | |
534 | 537 | then tmpnegwin | |
535 | 538 | else positivefund)) / 100))) | |
536 | 539 | let roiprofit = (isbayout * ((share * getValueItemBuyoutAmount(item)) / 100)) | |
537 | 540 | let authorprofit = (((if ((getValueItemAuthor(item) == account)) | |
538 | 541 | then 1 | |
539 | 542 | else 0) * positivefund) * (if ((status != BUYOUT)) | |
540 | 543 | then 1 | |
541 | 544 | else 0)) | |
542 | 545 | if ((status == DELISTED)) | |
543 | 546 | then throw("The project hasn't accepted by community") | |
544 | 547 | else if (if ((status != BUYOUT)) | |
545 | 548 | then (getValueItemWhaleExpiration(item) >= height) | |
546 | 549 | else false) | |
547 | 550 | then throw("The time for grant has not expired yet") | |
548 | 551 | else if ((0 >= (positivefund + negativefund))) | |
549 | 552 | then throw("The campaign wasn't active") | |
550 | 553 | else WriteSet([DataEntry(getKeyBalance(account), (((getValueBalance(account) + betprofit) + roiprofit) + authorprofit)), DataEntry(getKeyItemStatus(item), if ((authorprofit > 0)) | |
551 | 554 | then CASHOUT | |
552 | 555 | else status), DataEntry(getKeyItemAccFinal(item, account), CLAIMED)]) | |
553 | 556 | } | |
554 | 557 | ||
555 | 558 |
github/deemru/w8io/169f3d6 82.93 ms ◑