tx · FrzfEmvF6NsmnQgL6XhG7ek18aansEEi78GSPrKRVWht 3NB412VeXkiWqruYpeEEWkm364Xc9MskZ2k: -0.01400000 Waves 2020.08.18 22:30 [1138733] smart account 3NB412VeXkiWqruYpeEEWkm364Xc9MskZ2k > SELF 0.00000000 Waves
{ "type": 13, "id": "FrzfEmvF6NsmnQgL6XhG7ek18aansEEi78GSPrKRVWht", "fee": 1400000, "feeAssetId": null, "timestamp": 1597779025315, "version": 1, "sender": "3NB412VeXkiWqruYpeEEWkm364Xc9MskZ2k", "senderPublicKey": "7FQufF9XhJBsTdvrn67eWxYT7ZxDwzjuXAprkWiHrS3Y", "proofs": [ "2BxkQMQN1mHB7N9yBEGUBbwY1omQnLbaF2KT2gddB75DaJFqdNByt6Qns9HTFwdGao7DiujJtwXdA9r34gDukJ7J" ], "script": "base64:AAIDAAAAAAAAACEIARIECgIICBIGCgQICAgBEgkKBwgICAgBCAgSBAoCCAEAAAArAAAAAAd4Qml0Q08yAQAAACAgBGSmqgN7DW+mqvqXJVizlol6Uwz/77rGaIdsg1TcjQAAAAAHYkJpdENPMgEAAAAgJLm895AWDUgjXTQGcnf0M2daVOHTTVkxMY+I6LgJ4NEAAAAACHN0YXJ0UXR5AAAAAAAABKodAAAAAAxGaXJzdEZhc2VRdHkAAAAAAAAAedkAAAAADVNlY29uZEZhc2VRdHkAAAAAAAAEMEQAAAAACG5vbVByaWNlAAAAAAAAAAABAAAAAAN3dnMAAAAAAAX14QAAAAAAEHN1cHBsaWVyRGlzY291bnQAAAAAAAAAAAwAAAAABE5PTkUCAAAABG5vbmUAAAAAC093bmVyUHViS2V5AQAAACBc10kgzntLYC3wdTXyP6D5J32rgBzym30loQrY6e/2HwAAAAAGaXNzdWVyCQEAAAAHQWRkcmVzcwAAAAEBAAAAGgFUsZ/LLWvSicGFXkptOa6Ov7Vyb4KJ2haTAAAAAARlQWRkCQEAAAAHQWRkcmVzcwAAAAEBAAAAGgFUmX0sM+4Li4VQQQ26bfB7j/XU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AZhbW91bnQFAAAAB3hCaXRDTzIFAAAAA25pbAAAAAEAAAACdHgBAAAABnZlcmlmeQAAAAAEAAAAByRtYXRjaDAFAAAAAnR4AwkAAAEAAAACBQAAAAckbWF0Y2gwAgAAABRTZXRTY3JpcHRUcmFuc2FjdGlvbgQAAAABdAUAAAAHJG1hdGNoMAkAAfQAAAADCAUAAAACdHgAAAAJYm9keUJ5dGVzCQABkQAAAAIIBQAAAAJ0eAAAAAZwcm9vZnMAAAAAAAAAAAAFAAAAC093bmVyUHViS2V5AwMJAAABAAAAAgUAAAAHJG1hdGNoMAIAAAAPRGF0YVRyYW5zYWN0aW9uBgkAAAEAAAACBQAAAAckbWF0Y2gwAgAAABJSZWlzc3VlVHJhbnNhY3Rpb24EAAAAAWQFAAAAByRtYXRjaDAGAwkAAAEAAAACBQAAAAckbWF0Y2gwAgAAABNUcmFuc2ZlclRyYW5zYWN0aW9uBAAAAAJ0eAUAAAAHJG1hdGNoMAYDCQAAAQAAAAIFAAAAByRtYXRjaDACAAAAE0V4Y2hhbmdlVHJhbnNhY3Rpb24EAAAAAnR4BQAAAAckbWF0Y2gwBAAAAAl3aXRoV2F2ZXMDCQEAAAABIQAAAAEJAQAAAAlpc0RlZmluZWQAAAABCAgIBQAAAAJ0eAAAAAlzZWxsT3JkZXIAAAAJYXNzZXRQYWlyAAAACnByaWNlQXNzZXQGCQEAAAABIQAAAAEJAQAAAAlpc0RlZmluZWQAAAABCAgIBQAAAAJ0eAAAAAlzZWxsT3JkZXIAAAAJYXNzZXRQYWlyAAAAC2Ftb3VudEFzc2V0BQAAAAl3aXRoV2F2ZXMHPHQ1Gg==", "chainId": 84, "height": 1138733, "spentComplexity": 0 } View: original | compacted Prev: G7yd65Z7CM17UtgBE7Cn4MeLqAiAzWXG9fTdPyH6Hic2 Next: 7M9ADWTUxzAuu5YHYnYA8XaXWEKnCHejiNCLd3ZkCbpa Diff:
Old | New | Differences | |
---|---|---|---|
225 | 225 | let eBI = ((subTotal * eIP) / (cPB * 100)) | |
226 | 226 | let sI = ((totalAmount - pI) - eI) | |
227 | 227 | let sBI = ((subTotal * sIP) / (cPB * 100)) | |
228 | + | let QVentasgts = ((subTotal * 11) / (cPB * 100)) | |
228 | 229 | if ((totalAmount > pmt.amount)) | |
229 | 230 | then throw("Payment Amount can't be less than item Purchase Order") | |
230 | 231 | else if ((pmt.amount > totalAmount)) | |
231 | 232 | then throw("Payment Amount can't be higher than item Purchase Order") | |
232 | - | else ScriptResult(WriteSet([DataEntry(getKeyUserItemGtsCounter(userAddress, item), (getValueUserItemGtsCounter(userAddress, item) + 1)), DataEntry(getKeyItem(supplier, item), item), DataEntry(getKeyItemName(item), itemName), DataEntry(getKeyUserName(item), userName), DataEntry(getKeyUserDocument(item), userDocument), DataEntry("Payment_amount,_wvs", totalAmount), DataEntry("Imp, %", igv), DataEntry("STtl, wvs", subTotal), DataEntry("CP 1 B, wvs", (cPB * 1000000)), DataEntry(getKeyUI(item), uI), DataEntry("UBI", uBI), DataEntry(getKeyPI(item), pI), DataEntry("EcSys", eBI), DataEntry(getKeySI(item), sI), DataEntry("SBI: b", sBI), DataEntry(("Order_Status:_" + userAddress), "Adquisición Confirmada!"), DataEntry(getKeyBalanceSupplier(supplier), (balanceSupplier + pmt.amount))]), TransferSet([ScriptTransfer(issuer, sI, unit), ScriptTransfer(issuer, sBI, xBitCO2)])) | |
233 | + | else ScriptResult(WriteSet([DataEntry(getKeyUserItemGtsCounter(userAddress, item), (getValueUserItemGtsCounter(userAddress, item) + 1)), DataEntry(getKeyItem(supplier, item), item), DataEntry(getKeyItemName(item), itemName), DataEntry(getKeyUserName(item), userName), DataEntry(getKeyUserDocument(item), userDocument), DataEntry("Payment_amount,_wvs", totalAmount), DataEntry("Imp, %", igv), DataEntry("STtl, wvs", subTotal), DataEntry("CP 1 B, wvs", (cPB * 1000000)), DataEntry(getKeyUI(item), uI), DataEntry("UBI", uBI), DataEntry(getKeyPI(item), pI), DataEntry("EcSys", eBI), DataEntry(getKeySI(item), sI), DataEntry("SBI: b", sBI), DataEntry(("Order_Status:_" + userAddress), "Adquisición Confirmada!"), DataEntry("QporVentasGTS", QVentasgts), DataEntry(getKeyBalanceQtySupplier(item), (SecondFaseQty - QVentasgts)), DataEntry(getKeyBalanceSupplier(supplier), (balanceSupplier + pmt.amount))]), TransferSet([ScriptTransfer(i.caller, uBI, xBitCO2), ScriptTransfer(issuer, sI, unit), ScriptTransfer(issuer, sBI, xBitCO2)])) | |
233 | 234 | } | |
234 | 235 | } | |
235 | 236 |
Old | New | Differences | |
---|---|---|---|
1 | 1 | {-# STDLIB_VERSION 3 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | 4 | let xBitCO2 = base58'39yw38hm342hiK43SqELTaZRkTWJoBc22XpxmsSiBrsN' | |
5 | 5 | ||
6 | 6 | let bBitCO2 = base58'3UMwob2PDKVYmDMZZdT9ijK7EdRJZKFoBLCAXnwKtNN4' | |
7 | 7 | ||
8 | 8 | let startQty = 305693 | |
9 | 9 | ||
10 | 10 | let FirstFaseQty = 31193 | |
11 | 11 | ||
12 | 12 | let SecondFaseQty = 274500 | |
13 | 13 | ||
14 | 14 | let nomPrice = 1 | |
15 | 15 | ||
16 | 16 | let wvs = 100000000 | |
17 | 17 | ||
18 | 18 | let supplierDiscount = 12 | |
19 | 19 | ||
20 | 20 | let NONE = "none" | |
21 | 21 | ||
22 | 22 | let OwnerPubKey = base58'7FQufF9XhJBsTdvrn67eWxYT7ZxDwzjuXAprkWiHrS3Y' | |
23 | 23 | ||
24 | 24 | let issuer = Address(base58'3N67GoXrZo4iwmEjLhS9iNUCbzpPEjoYgNW') | |
25 | 25 | ||
26 | 26 | let eAdd = Address(base58'3N3uf7RK8Aed4v5ufGB8xV2Wsz4WNoHj21c') | |
27 | 27 | ||
28 | 28 | let pAdd = Address(base58'3Mv5mXTRhpWZxZxstmnsBhckWNgErMTFEaD') | |
29 | 29 | ||
30 | 30 | let igv = 18 | |
31 | 31 | ||
32 | 32 | let cPB = 88 | |
33 | 33 | ||
34 | 34 | let uIP = 7 | |
35 | 35 | ||
36 | 36 | let pIP = 10 | |
37 | 37 | ||
38 | 38 | let sIP = 1 | |
39 | 39 | ||
40 | 40 | let eIP = 1 | |
41 | 41 | ||
42 | 42 | func getNumberByKey (key) = { | |
43 | 43 | let num = match getInteger(this, key) { | |
44 | 44 | case a: Int => | |
45 | 45 | a | |
46 | 46 | case _ => | |
47 | 47 | 0 | |
48 | 48 | } | |
49 | 49 | num | |
50 | 50 | } | |
51 | 51 | ||
52 | 52 | ||
53 | 53 | func getStrByKey (key) = { | |
54 | 54 | let str = match getString(this, key) { | |
55 | 55 | case a: String => | |
56 | 56 | a | |
57 | 57 | case _ => | |
58 | 58 | NONE | |
59 | 59 | } | |
60 | 60 | str | |
61 | 61 | } | |
62 | 62 | ||
63 | 63 | ||
64 | 64 | func getKeyItemSupplier (supplier) = (supplier + "Bit-CO2 Shop, Lima-Perú") | |
65 | 65 | ||
66 | 66 | ||
67 | 67 | func getKeyItem (supplier,item) = (("Producto-GTS: " + " ") + toBase58String(sha256(toBytes((supplier + item))))) | |
68 | 68 | ||
69 | 69 | ||
70 | 70 | func getKeyUserItemGtsCounter (user,item) = "Order_№:" | |
71 | 71 | ||
72 | 72 | ||
73 | 73 | func getValueUserItemGtsCounter (user,item) = getNumberByKey(getKeyUserItemGtsCounter(user, item)) | |
74 | 74 | ||
75 | 75 | ||
76 | 76 | func getKeyItemName (item) = "Categoría del Producto:" | |
77 | 77 | ||
78 | 78 | ||
79 | 79 | func getValueItemName (item) = getStrByKey(getKeyItemName(item)) | |
80 | 80 | ||
81 | 81 | ||
82 | 82 | func getKeyUserName (item) = "Nombre del Usuario:" | |
83 | 83 | ||
84 | 84 | ||
85 | 85 | func getValueUserName (item) = getStrByKey(getKeyUserName(item)) | |
86 | 86 | ||
87 | 87 | ||
88 | 88 | func getKeyUserDocument (item) = "№ de Documento / DNI del Usuario:" | |
89 | 89 | ||
90 | 90 | ||
91 | 91 | func getValueUserDocument (item) = getStrByKey(getKeyUserDocument(item)) | |
92 | 92 | ||
93 | 93 | ||
94 | 94 | func getKeySaldoTokenQtyStartEtapa (item) = "Tokens Ofertados en la presente etapa / Saldo:" | |
95 | 95 | ||
96 | 96 | ||
97 | 97 | func getValueSaldoTokenQtyStartEtapa (item) = getNumberByKey(getKeySaldoTokenQtyStartEtapa(item)) | |
98 | 98 | ||
99 | 99 | ||
100 | 100 | func getKeyBalanceQtySupplier (item) = "Balance/Saldo GTS, tokens:" | |
101 | 101 | ||
102 | 102 | ||
103 | 103 | func getValueBalanceQtySupplier (item) = getNumberByKey(getKeyBalanceQtySupplier(item)) | |
104 | 104 | ||
105 | 105 | ||
106 | 106 | func getKeyBalanceSupplier (supplier) = "Ingresos por VentaGTS:" | |
107 | 107 | ||
108 | 108 | ||
109 | 109 | func getValueBalanceSupplier (supplier) = getNumberByKey(getKeyBalanceSupplier(supplier)) | |
110 | 110 | ||
111 | 111 | ||
112 | 112 | func getKeyUI (item) = "UI,_wvs:" | |
113 | 113 | ||
114 | 114 | ||
115 | 115 | func getValueUI (item) = getNumberByKey(getKeyUI(item)) | |
116 | 116 | ||
117 | 117 | ||
118 | 118 | func getKeyPI (item) = "PI,_%:" | |
119 | 119 | ||
120 | 120 | ||
121 | 121 | func getValuePI (item) = getNumberByKey(getKeyPI(item)) | |
122 | 122 | ||
123 | 123 | ||
124 | 124 | func getKeySI (item) = "SI,_%:" | |
125 | 125 | ||
126 | 126 | ||
127 | 127 | func getValueSI (item) = getNumberByKey(getKeySI(item)) | |
128 | 128 | ||
129 | 129 | ||
130 | 130 | @Callable(i) | |
131 | 131 | func deposit (title,supplierData) = { | |
132 | 132 | let pmt = extract(i.payment) | |
133 | 133 | if ((pmt.assetId != xBitCO2)) | |
134 | 134 | then throw("deposito permitido solo en xBitCO2 tokens") | |
135 | 135 | else { | |
136 | 136 | let supplier = toBase58String(i.caller.bytes) | |
137 | 137 | let currentAmount = match getInteger(this, supplier) { | |
138 | 138 | case a: Int => | |
139 | 139 | a | |
140 | 140 | case _ => | |
141 | 141 | startQty | |
142 | 142 | } | |
143 | 143 | let newAmount = (currentAmount + pmt.amount) | |
144 | 144 | if ((0 >= newAmount)) | |
145 | 145 | then throw("No hay xBitCO2 en su balance") | |
146 | 146 | else WriteSet([DataEntry(supplier, newAmount)]) | |
147 | 147 | } | |
148 | 148 | } | |
149 | 149 | ||
150 | 150 | ||
151 | 151 | ||
152 | 152 | @Callable(i) | |
153 | 153 | func purchaseGTS2 (item,userName,userDocument,totalAmount) = { | |
154 | 154 | let pmt = extract(i.payment) | |
155 | 155 | if (isDefined(pmt.assetId)) | |
156 | 156 | then throw("you can adquire Products only by Waves tokens") | |
157 | 157 | else { | |
158 | 158 | let supplier = match getString(this, getKeyItemSupplier(item)) { | |
159 | 159 | case a: String => | |
160 | 160 | a | |
161 | 161 | case _ => | |
162 | 162 | NONE | |
163 | 163 | } | |
164 | 164 | let preIcoQty = match getInteger(this, getKeyBalanceQtySupplier(item)) { | |
165 | 165 | case a: Int => | |
166 | 166 | a | |
167 | 167 | case _ => | |
168 | 168 | startQty | |
169 | 169 | } | |
170 | 170 | let balanceSupplier = match getInteger(this, getKeyBalanceSupplier(supplier)) { | |
171 | 171 | case a: Int => | |
172 | 172 | a | |
173 | 173 | case _ => | |
174 | 174 | 0 | |
175 | 175 | } | |
176 | 176 | let userAddress = toBase58String(i.caller.bytes) | |
177 | 177 | let subTotal = (totalAmount - ((igv * totalAmount) / 100)) | |
178 | 178 | let uI = ((subTotal * uIP) / 100) | |
179 | 179 | let uBI = (uI / cPB) | |
180 | 180 | let pI = ((subTotal * pIP) / 100) | |
181 | 181 | let eI = ((subTotal * eIP) / 100) | |
182 | 182 | let eBI = ((subTotal * eIP) / (cPB * 100)) | |
183 | 183 | let sI = ((totalAmount - pI) - eI) | |
184 | 184 | let sBI = ((subTotal * sIP) / (cPB * 100)) | |
185 | 185 | if ((totalAmount > pmt.amount)) | |
186 | 186 | then throw("Payment Amount can't be less than item Purchase Order") | |
187 | 187 | else if ((pmt.amount > totalAmount)) | |
188 | 188 | then throw("Payment Amount can't be higher than item Purchase Order") | |
189 | 189 | else ScriptResult(WriteSet([DataEntry(getKeyUserItemGtsCounter(userAddress, item), (getValueUserItemGtsCounter(userAddress, item) + 1)), DataEntry(getKeyUserName(item), userName), DataEntry(getKeyUserDocument(item), userDocument), DataEntry("Payment_amount,_wvs", totalAmount), DataEntry("Imp, %", igv), DataEntry("STtl, wvs", subTotal), DataEntry("CP 1 B, wvs", (cPB * 1000000)), DataEntry(getKeyUI(item), uI), DataEntry("UBI", uBI), DataEntry(getKeyPI(item), pI), DataEntry("EcSys", eBI), DataEntry(("Order_Status:_" + userAddress), "confirmed"), DataEntry(getKeySI(item), sI), DataEntry("SBI: b", sBI), DataEntry(getKeyBalanceSupplier(supplier), (balanceSupplier + pmt.amount))]), TransferSet([ScriptTransfer(i.caller, uBI, bBitCO2), ScriptTransfer(pAdd, pI, unit), ScriptTransfer(issuer, sI, unit), ScriptTransfer(issuer, sBI, bBitCO2), ScriptTransfer(eAdd, eI, unit), ScriptTransfer(eAdd, eBI, bBitCO2)])) | |
190 | 190 | } | |
191 | 191 | } | |
192 | 192 | ||
193 | 193 | ||
194 | 194 | ||
195 | 195 | @Callable(i) | |
196 | 196 | func purchaseGTS (item,itemName,userName,userDocument,totalAmount,pAdd,eAdd) = { | |
197 | 197 | let pmt = extract(i.payment) | |
198 | 198 | if (isDefined(pmt.assetId)) | |
199 | 199 | then throw("El Precio en waves.") | |
200 | 200 | else { | |
201 | 201 | let supplier = match getString(this, getKeyItemSupplier(item)) { | |
202 | 202 | case a: String => | |
203 | 203 | a | |
204 | 204 | case _ => | |
205 | 205 | NONE | |
206 | 206 | } | |
207 | 207 | let preIcoQty = match getInteger(this, getKeyBalanceQtySupplier(item)) { | |
208 | 208 | case a: Int => | |
209 | 209 | a | |
210 | 210 | case _ => | |
211 | 211 | SecondFaseQty | |
212 | 212 | } | |
213 | 213 | let balanceSupplier = match getInteger(this, getKeyBalanceSupplier(supplier)) { | |
214 | 214 | case a: Int => | |
215 | 215 | a | |
216 | 216 | case _ => | |
217 | 217 | 0 | |
218 | 218 | } | |
219 | 219 | let userAddress = toBase58String(i.caller.bytes) | |
220 | 220 | let subTotal = (totalAmount - ((igv * totalAmount) / 100)) | |
221 | 221 | let uI = ((subTotal * uIP) / 100) | |
222 | 222 | let uBI = (uI / cPB) | |
223 | 223 | let pI = ((subTotal * pIP) / 100) | |
224 | 224 | let eI = ((subTotal * eIP) / 100) | |
225 | 225 | let eBI = ((subTotal * eIP) / (cPB * 100)) | |
226 | 226 | let sI = ((totalAmount - pI) - eI) | |
227 | 227 | let sBI = ((subTotal * sIP) / (cPB * 100)) | |
228 | + | let QVentasgts = ((subTotal * 11) / (cPB * 100)) | |
228 | 229 | if ((totalAmount > pmt.amount)) | |
229 | 230 | then throw("Payment Amount can't be less than item Purchase Order") | |
230 | 231 | else if ((pmt.amount > totalAmount)) | |
231 | 232 | then throw("Payment Amount can't be higher than item Purchase Order") | |
232 | - | else ScriptResult(WriteSet([DataEntry(getKeyUserItemGtsCounter(userAddress, item), (getValueUserItemGtsCounter(userAddress, item) + 1)), DataEntry(getKeyItem(supplier, item), item), DataEntry(getKeyItemName(item), itemName), DataEntry(getKeyUserName(item), userName), DataEntry(getKeyUserDocument(item), userDocument), DataEntry("Payment_amount,_wvs", totalAmount), DataEntry("Imp, %", igv), DataEntry("STtl, wvs", subTotal), DataEntry("CP 1 B, wvs", (cPB * 1000000)), DataEntry(getKeyUI(item), uI), DataEntry("UBI", uBI), DataEntry(getKeyPI(item), pI), DataEntry("EcSys", eBI), DataEntry(getKeySI(item), sI), DataEntry("SBI: b", sBI), DataEntry(("Order_Status:_" + userAddress), "Adquisición Confirmada!"), DataEntry(getKeyBalanceSupplier(supplier), (balanceSupplier + pmt.amount))]), TransferSet([ScriptTransfer(issuer, sI, unit), ScriptTransfer(issuer, sBI, xBitCO2)])) | |
233 | + | else ScriptResult(WriteSet([DataEntry(getKeyUserItemGtsCounter(userAddress, item), (getValueUserItemGtsCounter(userAddress, item) + 1)), DataEntry(getKeyItem(supplier, item), item), DataEntry(getKeyItemName(item), itemName), DataEntry(getKeyUserName(item), userName), DataEntry(getKeyUserDocument(item), userDocument), DataEntry("Payment_amount,_wvs", totalAmount), DataEntry("Imp, %", igv), DataEntry("STtl, wvs", subTotal), DataEntry("CP 1 B, wvs", (cPB * 1000000)), DataEntry(getKeyUI(item), uI), DataEntry("UBI", uBI), DataEntry(getKeyPI(item), pI), DataEntry("EcSys", eBI), DataEntry(getKeySI(item), sI), DataEntry("SBI: b", sBI), DataEntry(("Order_Status:_" + userAddress), "Adquisición Confirmada!"), DataEntry("QporVentasGTS", QVentasgts), DataEntry(getKeyBalanceQtySupplier(item), (SecondFaseQty - QVentasgts)), DataEntry(getKeyBalanceSupplier(supplier), (balanceSupplier + pmt.amount))]), TransferSet([ScriptTransfer(i.caller, uBI, xBitCO2), ScriptTransfer(issuer, sI, unit), ScriptTransfer(issuer, sBI, xBitCO2)])) | |
233 | 234 | } | |
234 | 235 | } | |
235 | 236 | ||
236 | 237 | ||
237 | 238 | ||
238 | 239 | @Callable(i) | |
239 | 240 | func withdraw (item,amount) = { | |
240 | 241 | let userAddress = toBase58String(i.caller.bytes) | |
241 | 242 | let supplier = match getString(this, getKeyItemSupplier(item)) { | |
242 | 243 | case a: String => | |
243 | 244 | a | |
244 | 245 | case _ => | |
245 | 246 | NONE | |
246 | 247 | } | |
247 | 248 | let preIcoQty = match getInteger(this, getKeyBalanceQtySupplier(item)) { | |
248 | 249 | case a: Int => | |
249 | 250 | a | |
250 | 251 | case _ => | |
251 | 252 | startQty | |
252 | 253 | } | |
253 | 254 | let newAmount = (preIcoQty - amount) | |
254 | 255 | if ((0 > amount)) | |
255 | 256 | then throw("El balance de retiro no puede ser negativo!") | |
256 | 257 | else if ((0 >= newAmount)) | |
257 | 258 | then throw("Ooppss.. Insuficiente balance!") | |
258 | 259 | else ScriptResult(WriteSet([DataEntry(item, newAmount)]), TransferSet([ScriptTransfer(i.caller, amount, xBitCO2)])) | |
259 | 260 | } | |
260 | 261 | ||
261 | 262 | ||
262 | 263 | @Verifier(tx) | |
263 | 264 | func verify () = match tx { | |
264 | 265 | case t: SetScriptTransaction => | |
265 | 266 | sigVerify(tx.bodyBytes, tx.proofs[0], OwnerPubKey) | |
266 | 267 | case d: DataTransaction|ReissueTransaction => | |
267 | 268 | true | |
268 | 269 | case tx: TransferTransaction => | |
269 | 270 | true | |
270 | 271 | case tx: ExchangeTransaction => | |
271 | 272 | let withWaves = if (!(isDefined(tx.sellOrder.assetPair.priceAsset))) | |
272 | 273 | then true | |
273 | 274 | else !(isDefined(tx.sellOrder.assetPair.amountAsset)) | |
274 | 275 | withWaves | |
275 | 276 | case _ => | |
276 | 277 | false | |
277 | 278 | } | |
278 | 279 |
github/deemru/w8io/026f985 42.60 ms ◑