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