tx · 576cyK2GGuxkAgZi5F8P78aX2wnkyf1ASVyz34ayhiES 3MxJx6npysQdoyyxLsCCb3Yg8fTeH3gEQQd: -0.01100000 Waves 2023.12.10 06:54 [2880060] smart account 3MxJx6npysQdoyyxLsCCb3Yg8fTeH3gEQQd > SELF 0.00000000 Waves
{ "type": 13, "id": "576cyK2GGuxkAgZi5F8P78aX2wnkyf1ASVyz34ayhiES", "fee": 1100000, "feeAssetId": null, "timestamp": 1702180445612, "version": 2, "chainId": 84, "sender": "3MxJx6npysQdoyyxLsCCb3Yg8fTeH3gEQQd", "senderPublicKey": "EEhsp9Jd5MwVmYJMGAZJL3tTb5KcurTz8Aw7wksZuw3e", "proofs": [ "4YDA4MGDwo25qPCy4C8YZtynuBfu19X5oFZfLDTZgxtydJqqucZQxaKFDGRsmwB7vnmYKCrC1V4XJK97vBQrteG3" ], "script": "base64:AAIDAAAAAAAAACYIARIDCgEIEgASABIAEgMKAQESBQoDCAEIEgQKAggIEgASAwoBAQAAACIAAAAACmFjYzFQdWJLZXkBAAAAINoqzDs5WpVhYDTUvUDFMunBHoYto6DfGaP0KadDFYl5AAAAAAphY2MyUHViS2V5AQAAACDEqrME/jjBGs4Mrxcvf2rYimlLp6n4e/JFPZGNpxSDUQAAAAAKYWNjM1B1YktleQEAAAAgUNvEPKDCChp09z9n6F1NbPXldSbE9+5rrmMBqTTu7wMAAAAABHdFVVIBAAAAILp8b478B1VT8fhpSbATyQBoC/hLJWa+1+vvX3GNeNSQAAAAAAROT05FAgAAAARub25lAAAAAAdCQUxBTkNFAgAAAAhiYWxhbmNlXwAAAAAGVk9URVJTAAAAAAAAAAADAAAAAAZRVU9SVU0AAAAAAAAAAAIAAAAABlZPVElORwIAAAAGdm90aW5nAAAAAAZSRVZFQUwCAAAABnJldmVhbAAAAAAIRkVBVFVSRUQCAAAACGZlYXR1cmVkAAAAAAhERUxJU1RFRAIAAAAIZGVsaXN0ZWQBAAAADmdldE51bWJlckJ5S2V5AAAAAQAAAANrZX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AAAckbWF0Y2gwAgAAABdJbnZva2VTY3JpcHRUcmFuc2FjdGlvbgQAAAABZAUAAAAHJG1hdGNoMAYDCQAAAQAAAAIFAAAAByRtYXRjaDACAAAAEElzc3VlVHJhbnNhY3Rpb24EAAAAAWQFAAAAByRtYXRjaDAJAAH0AAAAAwgFAAAAAnR4AAAACWJvZHlCeXRlcwkAAZEAAAACCAUAAAACdHgAAAAGcHJvb2ZzAAAAAAAAAAAACAUAAAACdHgAAAAPc2VuZGVyUHVibGljS2V5AwkAAAEAAAACBQAAAAckbWF0Y2gwAgAAABJSZWlzc3VlVHJhbnNhY3Rpb24EAAAAAWQFAAAAByRtYXRjaDAJAAH0AAAAAwgFAAAAAnR4AAAACWJvZHlCeXRlcwkAAZEAAAACCAUAAAACdHgAAAAGcHJvb2ZzAAAAAAAAAAAACAUAAAACdHgAAAAPc2VuZGVyUHVibGljS2V5AwkAAAEAAAACBQAAAAckbWF0Y2gwAgAAAA9CdXJuVHJhbnNhY3Rpb24EAAAAAWQFAAAAByRtYXRjaDAJAAH0AAAAAwgFAAAAAnR4AAAACWJvZHlCeXRlcwkAAZEAAAACCAUAAAACdHgAAAAGcHJvb2ZzAAAAAAAAAAAACAUAAAACdHgAAAAPc2VuZGVyUHVibGljS2V5B51zQJA=", "height": 2880060, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: 49WRt7adAnCwahufxzZaRqU5cYcC6gbpw7CeybRXHGKc Next: DoYfbVnd18zL3fuDw7J6tTcexT4pxAD8WPNkF765HopW Diff:
Old | New | Differences | |
---|---|---|---|
6 | 6 | let acc2PubKey = base58'EEhsp9Jd5MwVmYJMGAZJL3tTb5KcurTz8Aw7wksZuw3e' | |
7 | 7 | ||
8 | 8 | let acc3PubKey = base58'6SdykacJeMCbeNvVJY71gWMJeXt9ZT44X4KexwZxHEYz' | |
9 | + | ||
10 | + | let wEUR = base58'DYxtEoj6wasUX8ddENeh7igtcuAv1WG7BcgZVsmzvAGF' | |
9 | 11 | ||
10 | 12 | let NONE = "none" | |
11 | 13 | ||
127 | 129 | ||
128 | 130 | ||
129 | 131 | @Callable(i) | |
132 | + | func deposit () = { | |
133 | + | let pmt = extract(i.payment) | |
134 | + | if (isDefined(pmt.assetId)) | |
135 | + | then throw("can hodl waves only at the moment") | |
136 | + | else { | |
137 | + | let currentKey = toBase58String(i.caller.bytes) | |
138 | + | let currentAmount = match getInteger(this, currentKey) { | |
139 | + | case a: Int => | |
140 | + | a | |
141 | + | case _ => | |
142 | + | 0 | |
143 | + | } | |
144 | + | let wlStsCurr = match getString(this, ("wl_sts_" + currentKey)) { | |
145 | + | case a: String => | |
146 | + | a | |
147 | + | case _ => | |
148 | + | throw("User has not deen waitlisted") | |
149 | + | } | |
150 | + | let newAmount = (currentAmount + pmt.amount) | |
151 | + | WriteSet([DataEntry((BALANCE + currentKey), newAmount)]) | |
152 | + | } | |
153 | + | } | |
154 | + | ||
155 | + | ||
156 | + | ||
157 | + | @Callable(i) | |
158 | + | func depositEUR () = { | |
159 | + | let pmt = extract(i.payment) | |
160 | + | if ((pmt.assetId != wEUR)) | |
161 | + | then throw("wEUR only please") | |
162 | + | else { | |
163 | + | let currentKey = toBase58String(i.caller.bytes) | |
164 | + | let currentAmount = match getInteger(this, currentKey) { | |
165 | + | case a: Int => | |
166 | + | a | |
167 | + | case _ => | |
168 | + | 0 | |
169 | + | } | |
170 | + | let newAmount = (currentAmount + pmt.amount) | |
171 | + | WriteSet([DataEntry(currentKey, newAmount)]) | |
172 | + | } | |
173 | + | } | |
174 | + | ||
175 | + | ||
176 | + | ||
177 | + | @Callable(i) | |
130 | 178 | func withdraw () = { | |
131 | 179 | let supplierAddress = toBase58String(i.caller.bytes) | |
132 | 180 | let balance = getValueBalanceSupplier(supplierAddress) | |
133 | 181 | if ((0 >= balance)) | |
134 | 182 | then throw("insufficient balance") | |
135 | 183 | else ScriptResult(WriteSet([DataEntry(getKeyBalanceSupplier(supplierAddress), 0)]), TransferSet([ScriptTransfer(addressFromStringValue(supplierAddress), balance, unit)])) | |
184 | + | } | |
185 | + | ||
186 | + | ||
187 | + | ||
188 | + | @Callable(i) | |
189 | + | func withdrawEUR (amount) = { | |
190 | + | let currentKey = toBase58String(i.caller.bytes) | |
191 | + | let currentAmount = match getInteger(this, currentKey) { | |
192 | + | case a: Int => | |
193 | + | a | |
194 | + | case _ => | |
195 | + | 0 | |
196 | + | } | |
197 | + | let newAmount = (currentAmount - amount) | |
198 | + | if ((0 > amount)) | |
199 | + | then throw("Can't withdraw negative balance") | |
200 | + | else if ((0 > newAmount)) | |
201 | + | then throw("Not enough balance") | |
202 | + | else ScriptResult(WriteSet([DataEntry(currentKey, newAmount)]), TransferSet([ScriptTransfer(i.caller, amount, wEUR)])) | |
136 | 203 | } | |
137 | 204 | ||
138 | 205 | ||
173 | 240 | ||
174 | 241 | ||
175 | 242 | @Callable(i) | |
176 | - | func voteReveal (item,vote,salt) = { | |
177 | - | let user = toBase58String(i.caller.bytes) | |
178 | - | let status = getValueItemStatus(item) | |
179 | - | let newVoteCount = (getValueVoteCount(item, vote) + 1) | |
180 | - | if ((toBase58String(sha256(toBytes((vote + salt)))) != getValueCommit(item, user))) | |
181 | - | then throw("reveal data is not valid") | |
182 | - | else if ((VOTERS > getValueCommitsCount(item))) | |
183 | - | then throw("max num of voters hasn't reached yet") | |
184 | - | else if ((getValueReveal(item, user) != NONE)) | |
185 | - | then throw("user has already participated") | |
186 | - | else if (if ((status != VOTING)) | |
187 | - | then (status != REVEAL) | |
188 | - | else false) | |
189 | - | then throw("wrong status") | |
190 | - | else if (if ((vote != FEATURED)) | |
191 | - | then (vote != DELISTED) | |
192 | - | else false) | |
193 | - | then throw("vote has finished") | |
194 | - | else WriteSet([DataEntry(getKeyReveal(item, user), vote), DataEntry(getKeyVoteCount(item, vote), newVoteCount), DataEntry(getKeyItemStatus(item), if ((newVoteCount >= QUORUM)) | |
195 | - | then vote | |
196 | - | else REVEAL)]) | |
197 | - | } | |
198 | - | ||
199 | - | ||
200 | - | ||
201 | - | @Callable(i) | |
202 | 243 | func x_purchase () = { | |
203 | 244 | let pmt = extract(i.payment) | |
204 | 245 | if (isDefined(pmt.assetId)) | |
216 | 257 | else if ((pmt.amount > price)) | |
217 | 258 | then throw("purchase amount cannot be higher than item price") | |
218 | 259 | else WriteSet([DataEntry(("status:purchase_item_A_customer_" + customerAddress), "confirmed"), DataEntry(("price:purchase_item_A_customer_" + customerAddress), price)]) | |
219 | - | } | |
220 | - | } | |
221 | - | ||
222 | - | ||
223 | - | ||
224 | - | @Callable(i) | |
225 | - | func deposit () = { | |
226 | - | let pmt = extract(i.payment) | |
227 | - | if (isDefined(pmt.assetId)) | |
228 | - | then throw("can hodl waves only at the moment") | |
229 | - | else { | |
230 | - | let currentKey = toBase58String(i.caller.bytes) | |
231 | - | let currentAmount = match getInteger(this, currentKey) { | |
232 | - | case a: Int => | |
233 | - | a | |
234 | - | case _ => | |
235 | - | 0 | |
236 | - | } | |
237 | - | let wlStsCurr = match getString(this, ("wl_sts_" + currentKey)) { | |
238 | - | case a: String => | |
239 | - | a | |
240 | - | case _ => | |
241 | - | throw("User has not deen waitlisted") | |
242 | - | } | |
243 | - | let newAmount = (currentAmount + pmt.amount) | |
244 | - | WriteSet([DataEntry((BALANCE + currentKey), newAmount)]) | |
245 | 260 | } | |
246 | 261 | } | |
247 | 262 |
Old | New | Differences | |
---|---|---|---|
1 | 1 | {-# STDLIB_VERSION 3 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | 4 | let acc1PubKey = base58'FgdjGJ4tLFiavKEKf4WkWwkgvU8ARWP1WYZfmUrXo4CY' | |
5 | 5 | ||
6 | 6 | let acc2PubKey = base58'EEhsp9Jd5MwVmYJMGAZJL3tTb5KcurTz8Aw7wksZuw3e' | |
7 | 7 | ||
8 | 8 | let acc3PubKey = base58'6SdykacJeMCbeNvVJY71gWMJeXt9ZT44X4KexwZxHEYz' | |
9 | + | ||
10 | + | let wEUR = base58'DYxtEoj6wasUX8ddENeh7igtcuAv1WG7BcgZVsmzvAGF' | |
9 | 11 | ||
10 | 12 | let NONE = "none" | |
11 | 13 | ||
12 | 14 | let BALANCE = "balance_" | |
13 | 15 | ||
14 | 16 | let VOTERS = 3 | |
15 | 17 | ||
16 | 18 | let QUORUM = 2 | |
17 | 19 | ||
18 | 20 | let VOTING = "voting" | |
19 | 21 | ||
20 | 22 | let REVEAL = "reveal" | |
21 | 23 | ||
22 | 24 | let FEATURED = "featured" | |
23 | 25 | ||
24 | 26 | let DELISTED = "delisted" | |
25 | 27 | ||
26 | 28 | func getNumberByKey (key) = { | |
27 | 29 | let num = match getInteger(this, key) { | |
28 | 30 | case a: Int => | |
29 | 31 | a | |
30 | 32 | case _ => | |
31 | 33 | 0 | |
32 | 34 | } | |
33 | 35 | num | |
34 | 36 | } | |
35 | 37 | ||
36 | 38 | ||
37 | 39 | func getStrByKey (key) = { | |
38 | 40 | let str = match getString(this, key) { | |
39 | 41 | case a: String => | |
40 | 42 | a | |
41 | 43 | case _ => | |
42 | 44 | NONE | |
43 | 45 | } | |
44 | 46 | str | |
45 | 47 | } | |
46 | 48 | ||
47 | 49 | ||
48 | 50 | func getKeyItemPrice (item) = (item + "_price") | |
49 | 51 | ||
50 | 52 | ||
51 | 53 | func getValueItemPrice (item) = getNumberByKey(getKeyItemPrice(item)) | |
52 | 54 | ||
53 | 55 | ||
54 | 56 | func getKeyUserItemCounter (user,item) = (((item + "_") + user) + "_cnt") | |
55 | 57 | ||
56 | 58 | ||
57 | 59 | func getValueUserItemCounter (user,item) = getNumberByKey(getKeyUserItemCounter(user, item)) | |
58 | 60 | ||
59 | 61 | ||
60 | 62 | func getKeyItem (supplier,title) = ("item_" + toBase58String(sha256(toBytes((supplier + title))))) | |
61 | 63 | ||
62 | 64 | ||
63 | 65 | func getKeyItemData (item) = (item + "_data") | |
64 | 66 | ||
65 | 67 | ||
66 | 68 | func getKeyItemSupplier (item) = (item + "_owner") | |
67 | 69 | ||
68 | 70 | ||
69 | 71 | func getValueItemSupplier (item) = getStrByKey(getKeyItemSupplier(item)) | |
70 | 72 | ||
71 | 73 | ||
72 | 74 | func getKeyBalanceSupplier (account) = (account + "_balance") | |
73 | 75 | ||
74 | 76 | ||
75 | 77 | func getValueBalanceSupplier (account) = getNumberByKey(getKeyBalanceSupplier(account)) | |
76 | 78 | ||
77 | 79 | ||
78 | 80 | func getKeyCommit (item,user) = (((item + "_") + user) + "_commit") | |
79 | 81 | ||
80 | 82 | ||
81 | 83 | func getValueCommit (item,user) = getStrByKey(getKeyCommit(item, user)) | |
82 | 84 | ||
83 | 85 | ||
84 | 86 | func getKeyCommitsCount (item) = (item + "_comcnt") | |
85 | 87 | ||
86 | 88 | ||
87 | 89 | func getValueCommitsCount (item) = getNumberByKey(getKeyCommitsCount(item)) | |
88 | 90 | ||
89 | 91 | ||
90 | 92 | func getKeyReveal (item,user) = (((item + "_") + user) + "_reveal") | |
91 | 93 | ||
92 | 94 | ||
93 | 95 | func getValueReveal (item,user) = getStrByKey(getKeyReveal(item, user)) | |
94 | 96 | ||
95 | 97 | ||
96 | 98 | func getKeyItemStatus (item) = (item + "_status") | |
97 | 99 | ||
98 | 100 | ||
99 | 101 | func getValueItemStatus (item) = getStrByKey(getKeyItemStatus(item)) | |
100 | 102 | ||
101 | 103 | ||
102 | 104 | func getKeyVoteCount (item,vote) = ((item + "_res:") + vote) | |
103 | 105 | ||
104 | 106 | ||
105 | 107 | func getValueVoteCount (item,vote) = getNumberByKey(getKeyVoteCount(item, vote)) | |
106 | 108 | ||
107 | 109 | ||
108 | 110 | @Callable(i) | |
109 | 111 | func purchase (item) = { | |
110 | 112 | let pmt = extract(i.payment) | |
111 | 113 | if (isDefined(pmt.assetId)) | |
112 | 114 | then throw("WAVES tokens only at the moment") | |
113 | 115 | else { | |
114 | 116 | let userAddress = toBase58String(i.caller.bytes) | |
115 | 117 | let price = getValueItemPrice(item) | |
116 | 118 | let supplierAddrss = getValueItemSupplier(item) | |
117 | 119 | if ((price > pmt.amount)) | |
118 | 120 | then throw("purchase amount cannot be less than item price") | |
119 | 121 | else if ((pmt.amount > price)) | |
120 | 122 | then throw("purchase amount cannot be higher than item price") | |
121 | 123 | else if ((supplierAddrss == NONE)) | |
122 | 124 | then throw("supplier does not exist") | |
123 | 125 | else WriteSet([DataEntry(getKeyUserItemCounter(userAddress, item), (getValueUserItemCounter(userAddress, item) + 1)), DataEntry(getKeyBalanceSupplier(supplierAddrss), (getValueBalanceSupplier(supplierAddrss) + pmt.amount))]) | |
124 | 126 | } | |
125 | 127 | } | |
126 | 128 | ||
127 | 129 | ||
128 | 130 | ||
129 | 131 | @Callable(i) | |
132 | + | func deposit () = { | |
133 | + | let pmt = extract(i.payment) | |
134 | + | if (isDefined(pmt.assetId)) | |
135 | + | then throw("can hodl waves only at the moment") | |
136 | + | else { | |
137 | + | let currentKey = toBase58String(i.caller.bytes) | |
138 | + | let currentAmount = match getInteger(this, currentKey) { | |
139 | + | case a: Int => | |
140 | + | a | |
141 | + | case _ => | |
142 | + | 0 | |
143 | + | } | |
144 | + | let wlStsCurr = match getString(this, ("wl_sts_" + currentKey)) { | |
145 | + | case a: String => | |
146 | + | a | |
147 | + | case _ => | |
148 | + | throw("User has not deen waitlisted") | |
149 | + | } | |
150 | + | let newAmount = (currentAmount + pmt.amount) | |
151 | + | WriteSet([DataEntry((BALANCE + currentKey), newAmount)]) | |
152 | + | } | |
153 | + | } | |
154 | + | ||
155 | + | ||
156 | + | ||
157 | + | @Callable(i) | |
158 | + | func depositEUR () = { | |
159 | + | let pmt = extract(i.payment) | |
160 | + | if ((pmt.assetId != wEUR)) | |
161 | + | then throw("wEUR only please") | |
162 | + | else { | |
163 | + | let currentKey = toBase58String(i.caller.bytes) | |
164 | + | let currentAmount = match getInteger(this, currentKey) { | |
165 | + | case a: Int => | |
166 | + | a | |
167 | + | case _ => | |
168 | + | 0 | |
169 | + | } | |
170 | + | let newAmount = (currentAmount + pmt.amount) | |
171 | + | WriteSet([DataEntry(currentKey, newAmount)]) | |
172 | + | } | |
173 | + | } | |
174 | + | ||
175 | + | ||
176 | + | ||
177 | + | @Callable(i) | |
130 | 178 | func withdraw () = { | |
131 | 179 | let supplierAddress = toBase58String(i.caller.bytes) | |
132 | 180 | let balance = getValueBalanceSupplier(supplierAddress) | |
133 | 181 | if ((0 >= balance)) | |
134 | 182 | then throw("insufficient balance") | |
135 | 183 | else ScriptResult(WriteSet([DataEntry(getKeyBalanceSupplier(supplierAddress), 0)]), TransferSet([ScriptTransfer(addressFromStringValue(supplierAddress), balance, unit)])) | |
184 | + | } | |
185 | + | ||
186 | + | ||
187 | + | ||
188 | + | @Callable(i) | |
189 | + | func withdrawEUR (amount) = { | |
190 | + | let currentKey = toBase58String(i.caller.bytes) | |
191 | + | let currentAmount = match getInteger(this, currentKey) { | |
192 | + | case a: Int => | |
193 | + | a | |
194 | + | case _ => | |
195 | + | 0 | |
196 | + | } | |
197 | + | let newAmount = (currentAmount - amount) | |
198 | + | if ((0 > amount)) | |
199 | + | then throw("Can't withdraw negative balance") | |
200 | + | else if ((0 > newAmount)) | |
201 | + | then throw("Not enough balance") | |
202 | + | else ScriptResult(WriteSet([DataEntry(currentKey, newAmount)]), TransferSet([ScriptTransfer(i.caller, amount, wEUR)])) | |
136 | 203 | } | |
137 | 204 | ||
138 | 205 | ||
139 | 206 | ||
140 | 207 | @Callable(i) | |
141 | 208 | func addItem (title,price,data) = { | |
142 | 209 | let supplierAddress = toBase58String(i.caller.bytes) | |
143 | 210 | let item = getKeyItem(supplierAddress, title) | |
144 | 211 | if ((0 >= price)) | |
145 | 212 | then throw("purchase amount cannot be less than item price") | |
146 | 213 | else if ((getValueItemSupplier(item) != NONE)) | |
147 | 214 | then throw("an item is already exist") | |
148 | 215 | else WriteSet([DataEntry(getKeyItemSupplier(item), supplierAddress), DataEntry(getKeyItemPrice(item), price), DataEntry(getKeyItemData(item), data)]) | |
149 | 216 | } | |
150 | 217 | ||
151 | 218 | ||
152 | 219 | ||
153 | 220 | @Callable(i) | |
154 | 221 | func voteCommit (item,hash) = { | |
155 | 222 | let user = toBase58String(i.caller.bytes) | |
156 | 223 | let commits = getValueCommitsCount(item) | |
157 | 224 | let status = getValueItemStatus(item) | |
158 | 225 | if ((commits >= VOTERS)) | |
159 | 226 | then throw("reached max num of voters") | |
160 | 227 | else if ((getValueCommit(item, user) != NONE)) | |
161 | 228 | then throw("user has already uch") | |
162 | 229 | else if ((getKeyItemSupplier(item) == NONE)) | |
163 | 230 | then throw("item does not exist") | |
164 | 231 | else if (if ((status != NONE)) | |
165 | 232 | then (status != VOTING) | |
166 | 233 | else false) | |
167 | 234 | then throw("voting is not possible") | |
168 | 235 | else WriteSet([DataEntry(getKeyCommit(item, user), hash), DataEntry(getKeyCommitsCount(item), (commits + 1)), DataEntry(getKeyItemStatus(item), if ((commits == VOTERS)) | |
169 | 236 | then REVEAL | |
170 | 237 | else VOTING)]) | |
171 | 238 | } | |
172 | 239 | ||
173 | 240 | ||
174 | 241 | ||
175 | 242 | @Callable(i) | |
176 | - | func voteReveal (item,vote,salt) = { | |
177 | - | let user = toBase58String(i.caller.bytes) | |
178 | - | let status = getValueItemStatus(item) | |
179 | - | let newVoteCount = (getValueVoteCount(item, vote) + 1) | |
180 | - | if ((toBase58String(sha256(toBytes((vote + salt)))) != getValueCommit(item, user))) | |
181 | - | then throw("reveal data is not valid") | |
182 | - | else if ((VOTERS > getValueCommitsCount(item))) | |
183 | - | then throw("max num of voters hasn't reached yet") | |
184 | - | else if ((getValueReveal(item, user) != NONE)) | |
185 | - | then throw("user has already participated") | |
186 | - | else if (if ((status != VOTING)) | |
187 | - | then (status != REVEAL) | |
188 | - | else false) | |
189 | - | then throw("wrong status") | |
190 | - | else if (if ((vote != FEATURED)) | |
191 | - | then (vote != DELISTED) | |
192 | - | else false) | |
193 | - | then throw("vote has finished") | |
194 | - | else WriteSet([DataEntry(getKeyReveal(item, user), vote), DataEntry(getKeyVoteCount(item, vote), newVoteCount), DataEntry(getKeyItemStatus(item), if ((newVoteCount >= QUORUM)) | |
195 | - | then vote | |
196 | - | else REVEAL)]) | |
197 | - | } | |
198 | - | ||
199 | - | ||
200 | - | ||
201 | - | @Callable(i) | |
202 | 243 | func x_purchase () = { | |
203 | 244 | let pmt = extract(i.payment) | |
204 | 245 | if (isDefined(pmt.assetId)) | |
205 | 246 | then throw("can use WAVES only at the moment") | |
206 | 247 | else { | |
207 | 248 | let customerAddress = toBase58String(i.caller.bytes) | |
208 | 249 | let price = match getInteger(this, "item_A_coupon_price") { | |
209 | 250 | case a: Int => | |
210 | 251 | a | |
211 | 252 | case _ => | |
212 | 253 | 0 | |
213 | 254 | } | |
214 | 255 | if ((price > pmt.amount)) | |
215 | 256 | then throw("purchase amount cannot be less than item price") | |
216 | 257 | else if ((pmt.amount > price)) | |
217 | 258 | then throw("purchase amount cannot be higher than item price") | |
218 | 259 | else WriteSet([DataEntry(("status:purchase_item_A_customer_" + customerAddress), "confirmed"), DataEntry(("price:purchase_item_A_customer_" + customerAddress), price)]) | |
219 | - | } | |
220 | - | } | |
221 | - | ||
222 | - | ||
223 | - | ||
224 | - | @Callable(i) | |
225 | - | func deposit () = { | |
226 | - | let pmt = extract(i.payment) | |
227 | - | if (isDefined(pmt.assetId)) | |
228 | - | then throw("can hodl waves only at the moment") | |
229 | - | else { | |
230 | - | let currentKey = toBase58String(i.caller.bytes) | |
231 | - | let currentAmount = match getInteger(this, currentKey) { | |
232 | - | case a: Int => | |
233 | - | a | |
234 | - | case _ => | |
235 | - | 0 | |
236 | - | } | |
237 | - | let wlStsCurr = match getString(this, ("wl_sts_" + currentKey)) { | |
238 | - | case a: String => | |
239 | - | a | |
240 | - | case _ => | |
241 | - | throw("User has not deen waitlisted") | |
242 | - | } | |
243 | - | let newAmount = (currentAmount + pmt.amount) | |
244 | - | WriteSet([DataEntry((BALANCE + currentKey), newAmount)]) | |
245 | 260 | } | |
246 | 261 | } | |
247 | 262 | ||
248 | 263 | ||
249 | 264 | ||
250 | 265 | @Callable(i) | |
251 | 266 | func x_withdraw (amount) = { | |
252 | 267 | let currentKey = toBase58String(i.caller.bytes) | |
253 | 268 | let currentAmount = match getInteger(this, (BALANCE + currentKey)) { | |
254 | 269 | case a: Int => | |
255 | 270 | a | |
256 | 271 | case _ => | |
257 | 272 | 0 | |
258 | 273 | } | |
259 | 274 | let newAmount = (currentAmount - amount) | |
260 | 275 | if ((0 > amount)) | |
261 | 276 | then throw("Can't withdraw negative amount") | |
262 | 277 | else if ((0 > newAmount)) | |
263 | 278 | then throw("Not enough balance") | |
264 | 279 | else ScriptResult(WriteSet([DataEntry((BALANCE + currentKey), newAmount)]), TransferSet([ScriptTransfer(i.caller, amount, unit)])) | |
265 | 280 | } | |
266 | 281 | ||
267 | 282 | ||
268 | 283 | @Verifier(tx) | |
269 | 284 | func verify () = { | |
270 | 285 | let acc1_1 = sigVerify(tx.bodyBytes, tx.proofs[0], acc1PubKey) | |
271 | 286 | let acc1_2 = sigVerify(tx.bodyBytes, tx.proofs[1], acc1PubKey) | |
272 | 287 | let acc1_3 = sigVerify(tx.bodyBytes, tx.proofs[2], acc1PubKey) | |
273 | 288 | let acc2_1 = sigVerify(tx.bodyBytes, tx.proofs[0], acc2PubKey) | |
274 | 289 | let acc2_2 = sigVerify(tx.bodyBytes, tx.proofs[1], acc2PubKey) | |
275 | 290 | let acc2_3 = sigVerify(tx.bodyBytes, tx.proofs[2], acc2PubKey) | |
276 | 291 | let acc3_1 = sigVerify(tx.bodyBytes, tx.proofs[0], acc3PubKey) | |
277 | 292 | let acc3_2 = sigVerify(tx.bodyBytes, tx.proofs[1], acc3PubKey) | |
278 | 293 | let acc3_3 = sigVerify(tx.bodyBytes, tx.proofs[2], acc3PubKey) | |
279 | 294 | let acc1acc2 = if (if (if (if (if (if (acc1_1) | |
280 | 295 | then acc2_2 | |
281 | 296 | else false) | |
282 | 297 | then true | |
283 | 298 | else if (acc1_1) | |
284 | 299 | then acc2_3 | |
285 | 300 | else false) | |
286 | 301 | then true | |
287 | 302 | else if (acc1_2) | |
288 | 303 | then acc2_1 | |
289 | 304 | else false) | |
290 | 305 | then true | |
291 | 306 | else if (acc1_2) | |
292 | 307 | then acc2_3 | |
293 | 308 | else false) | |
294 | 309 | then true | |
295 | 310 | else if (acc1_3) | |
296 | 311 | then acc2_1 | |
297 | 312 | else false) | |
298 | 313 | then true | |
299 | 314 | else if (acc1_3) | |
300 | 315 | then acc2_2 | |
301 | 316 | else false | |
302 | 317 | let acc1acc3 = if (if (if (if (if (if (acc1_1) | |
303 | 318 | then acc3_2 | |
304 | 319 | else false) | |
305 | 320 | then true | |
306 | 321 | else if (acc1_1) | |
307 | 322 | then acc3_3 | |
308 | 323 | else false) | |
309 | 324 | then true | |
310 | 325 | else if (acc1_2) | |
311 | 326 | then acc3_1 | |
312 | 327 | else false) | |
313 | 328 | then true | |
314 | 329 | else if (acc1_2) | |
315 | 330 | then acc3_3 | |
316 | 331 | else false) | |
317 | 332 | then true | |
318 | 333 | else if (acc1_3) | |
319 | 334 | then acc3_1 | |
320 | 335 | else false) | |
321 | 336 | then true | |
322 | 337 | else if (acc1_3) | |
323 | 338 | then acc3_2 | |
324 | 339 | else false | |
325 | 340 | let acc2acc3 = if (if (if (if (if (if (acc3_1) | |
326 | 341 | then acc2_2 | |
327 | 342 | else false) | |
328 | 343 | then true | |
329 | 344 | else if (acc3_1) | |
330 | 345 | then acc2_3 | |
331 | 346 | else false) | |
332 | 347 | then true | |
333 | 348 | else if (acc3_2) | |
334 | 349 | then acc2_1 | |
335 | 350 | else false) | |
336 | 351 | then true | |
337 | 352 | else if (acc3_2) | |
338 | 353 | then acc2_3 | |
339 | 354 | else false) | |
340 | 355 | then true | |
341 | 356 | else if (acc3_3) | |
342 | 357 | then acc2_1 | |
343 | 358 | else false) | |
344 | 359 | then true | |
345 | 360 | else if (acc3_3) | |
346 | 361 | then acc2_2 | |
347 | 362 | else false | |
348 | 363 | match tx { | |
349 | 364 | case d: SetScriptTransaction => | |
350 | 365 | sigVerify(tx.bodyBytes, tx.proofs[0], tx.senderPublicKey) | |
351 | 366 | case d: DataTransaction => | |
352 | 367 | true | |
353 | 368 | case d: TransferTransaction => | |
354 | 369 | true | |
355 | 370 | case d: InvokeScriptTransaction => | |
356 | 371 | true | |
357 | 372 | case d: IssueTransaction => | |
358 | 373 | sigVerify(tx.bodyBytes, tx.proofs[0], tx.senderPublicKey) | |
359 | 374 | case d: ReissueTransaction => | |
360 | 375 | sigVerify(tx.bodyBytes, tx.proofs[0], tx.senderPublicKey) | |
361 | 376 | case d: BurnTransaction => | |
362 | 377 | sigVerify(tx.bodyBytes, tx.proofs[0], tx.senderPublicKey) | |
363 | 378 | case _ => | |
364 | 379 | false | |
365 | 380 | } | |
366 | 381 | } | |
367 | 382 |
github/deemru/w8io/169f3d6 58.25 ms ◑