tx · 2iz2AjKJXv8Vdy1kE7Q7JVqjQZXSkvwijgxVUMiNAtne 3N6D1fPBTu4QuZenU7hKNuxEKsxd13USum8: -0.01000000 Waves 2021.10.21 10:52 [1755780] smart account 3N6D1fPBTu4QuZenU7hKNuxEKsxd13USum8 > SELF 0.00000000 Waves
{ "type": 13, "id": "2iz2AjKJXv8Vdy1kE7Q7JVqjQZXSkvwijgxVUMiNAtne", "fee": 1000000, "feeAssetId": null, "timestamp": 1634802811330, "version": 2, "chainId": 84, "sender": "3N6D1fPBTu4QuZenU7hKNuxEKsxd13USum8", "senderPublicKey": "8xCH82jKi2DM7HXXD45fmftPUDjr3TJpjanUATKMK37U", "proofs": [ "3U9uQ9sH5XQdsPwgXoqdWDxx57NLY4aUQ2L2yuECf6GdvTa6cyU1GWDEapuPrhNxKCiP5SLjfdRwXcAsqrpuCFX" ], "script": "base64:AAIDAAAAAAAAABcIARIECgIICBIHCgUICAgIARIECgIIAQAAAEQAAAAAB3lCaXRDTzIBAAAAIGmM1P/bTQF96Mt4t9+zj8FcPDlb6Qx5aA0hjmfpm0utAAAAAAhzdGFydFF0eQAAAAAAAASqHQAAAAAMRmlyc3RGYXNlUXR5AAAAAAAAAHnZAAAAAA1TZWNvbmRGYXNlUXR5AAAAAAAABDBEAAAAABBUb2tUb1ZlbmRlZG9yUXR5AAAAAAAAACcQAAAAAAN3dnMAAAAAAAX14QAAAAAABE5PTkUCAAAABG5vbmUAAAAAC093bmVyUHViS2V5AQAAACB2JYFH9ti5N+7uGrdzKwlrXhDeZ+vMkHOKuVJteEgPDwAAAAAEdEFkZAkBAAAAB0FkZHJlc3MAAAABAQAAABoBVLK1ppj4mummw+7gTK3Ad3Ub4h3efkn0JwAAAAAEYUFkZAkBAAAAB0FkZHJlc3MAAAABAQAAABoBVLGfyy1r0onBhV5KbTmujr+1cm+CidoWkwAAAAAEZUFkZAkBAAAAB0FkZHJlc3MAAAABAQAAABoBVJl9LDPuC4uFUEENum3we4/11P1VuB5sVwAA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ldAAAAAEJAARMAAAAAgkBAAAACURhdGFFbnRyeQAAAAIFAAAABGl0ZW0FAAAACW5ld0Ftb3VudAUAAAADbmlsCQEAAAALVHJhbnNmZXJTZXQAAAABCQAETAAAAAIJAQAAAA5TY3JpcHRUcmFuc2ZlcgAAAAMIBQAAAAFpAAAABmNhbGxlcgUAAAAGYW1vdW50BQAAAAd5Qml0Q08yBQAAAANuaWwAAAABAAAAAnR4AQAAAAZ2ZXJpZnkAAAAABAAAAAckbWF0Y2gwBQAAAAJ0eAMJAAABAAAAAgUAAAAHJG1hdGNoMAIAAAAUU2V0U2NyaXB0VHJhbnNhY3Rpb24EAAAAAXQFAAAAByRtYXRjaDAJAAH0AAAAAwgFAAAAAnR4AAAACWJvZHlCeXRlcwkAAZEAAAACCAUAAAACdHgAAAAGcHJvb2ZzAAAAAAAAAAAABQAAAAtPd25lclB1YktleQMDCQAAAQAAAAIFAAAAByRtYXRjaDACAAAAElJlaXNzdWVUcmFuc2FjdGlvbgYJAAABAAAAAgUAAAAHJG1hdGNoMAIAAAAPRGF0YVRyYW5zYWN0aW9uBAAAAAFkBQAAAAckbWF0Y2gwBgMJAAABAAAAAgUAAAAHJG1hdGNoMAIAAAATVHJhbnNmZXJUcmFuc2FjdGlvbgQAAAACdHgFAAAAByRtYXRjaDAGB1k3dCA=", "height": 1755780, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: 4dckzJLj5qpJgeXFeqteLtCHVVZ51bkjjpZecH7xx2Z8 Next: ENjAymBm3mUjMw8Fku2tdksMLXAGdRQvEJK4yTzqVrND Diff:
Old | New | Differences | |
---|---|---|---|
276 | 276 | then throw("Payment Amount can't be less than item Purchase Order") | |
277 | 277 | else if ((pmt.amount > totalAmount)) | |
278 | 278 | then throw("Payment Amount can't be higher than item Purchase Order") | |
279 | - | else ScriptResult(WriteSet([DataEntry(getKeyUserItemGtsCounter(userAddress, item), (getValueUserItemGtsCounter(userAddress, item) + 1)), DataEntry(getKeyItemSupplier(supplier), supplier), DataEntry(getKeyItem(supplier, item), item), DataEntry(getKeyItemName(item), itemName), DataEntry(getKeyUserName(item), userName), DataEntry(getKeyUserDocument(item), userDocument), DataEntry("Asociado Bit", asociado), DataEntry("usdn", usdnw), DataEntry("eurou", eurou), DataEntry("Apoyo Ecológico, wvls", totalAmount), DataEntry(getKeyPI(item), pIw), DataEntry(getKeyNIw(item), eIw), DataEntry("1 Bit-CO2 Precio Nominal, euros x10e-4", bco2e), DataEntry("1 Bit-CO2 Precio con Descto, usd x10e-4", bco2menosdcto), DataEntry("Total bit-co2 a distribuir, x10e-4", subTotalb), DataEntry(getKeyUI(item), uIb), DataEntry(getKeySI(item), sIb), DataEntry(getKeyNIb(item), eIb), DataEntry(("Order_Status:_" + userAddress), "Transacción Confirmada!"), DataEntry(getKeyBalanceProyecto(proyecto), (getValueBalanceProyecto(proyecto) + pIw)), DataEntry(getKeyBalanceProyecto(proyecto), saldoProj), DataEntry(getKeyBalanceProyecto(proyecto), pIw), DataEntry(getKeyBalanceTokensTienda(tienda), amountBCO2), DataEntry(getKeyBalanceTokensTienda(tienda), ( | |
279 | + | else ScriptResult(WriteSet([DataEntry(getKeyUserItemGtsCounter(userAddress, item), (getValueUserItemGtsCounter(userAddress, item) + 1)), DataEntry(getKeyItemSupplier(supplier), supplier), DataEntry(getKeyItem(supplier, item), item), DataEntry(getKeyItemName(item), itemName), DataEntry(getKeyUserName(item), userName), DataEntry(getKeyUserDocument(item), userDocument), DataEntry("Asociado Bit", asociado), DataEntry("usdn", usdnw), DataEntry("eurou", eurou), DataEntry("Apoyo Ecológico, wvls", totalAmount), DataEntry(getKeyPI(item), pIw), DataEntry(getKeyNIw(item), eIw), DataEntry("1 Bit-CO2 Precio Nominal, euros x10e-4", bco2e), DataEntry("1 Bit-CO2 Precio con Descto, usd x10e-4", bco2menosdcto), DataEntry("Total bit-co2 a distribuir, x10e-4", subTotalb), DataEntry(getKeyUI(item), uIb), DataEntry(getKeySI(item), sIb), DataEntry(getKeyNIb(item), eIb), DataEntry(("Order_Status:_" + userAddress), "Transacción Confirmada!"), DataEntry(getKeyBalanceProyecto(proyecto), (getValueBalanceProyecto(proyecto) + pIw)), DataEntry(getKeyBalanceProyecto(proyecto), saldoProj), DataEntry(getKeyBalanceProyecto(proyecto), pIw), DataEntry(getKeyBalanceTokensTienda(tienda), amountBCO2), DataEntry(getKeyBalanceTokensTienda(tienda), (amountBCO2 - subTotalb)), DataEntry(getKeyBalanceTokensTienda(tienda), ((amountBCO2 * 10000) - subTotalb))]), TransferSet([ScriptTransfer(pAdd, pIw, unit), ScriptTransfer(i.caller, uIb, yBitCO2), ScriptTransfer(aAdd, sIb, yBitCO2), ScriptTransfer(eAdd, eIw, unit), ScriptTransfer(eAdd, eIb, yBitCO2)])) | |
280 | 280 | } | |
281 | 281 | } | |
282 | 282 |
Old | New | Differences | |
---|---|---|---|
1 | 1 | {-# STDLIB_VERSION 3 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | 4 | let yBitCO2 = base58'872MvpMoQx7SnV58HMcR9hd6vBWDtQvqmt5javCmYwpx' | |
5 | 5 | ||
6 | 6 | let startQty = 305693 | |
7 | 7 | ||
8 | 8 | let FirstFaseQty = 31193 | |
9 | 9 | ||
10 | 10 | let SecondFaseQty = 274500 | |
11 | 11 | ||
12 | 12 | let TokToVendedorQty = 10000 | |
13 | 13 | ||
14 | 14 | let wvs = 100000000 | |
15 | 15 | ||
16 | 16 | let NONE = "none" | |
17 | 17 | ||
18 | 18 | let OwnerPubKey = base58'8xCH82jKi2DM7HXXD45fmftPUDjr3TJpjanUATKMK37U' | |
19 | 19 | ||
20 | 20 | let tAdd = Address(base58'3N6D1fPBTu4QuZenU7hKNuxEKsxd13USum8') | |
21 | 21 | ||
22 | 22 | let aAdd = Address(base58'3N67GoXrZo4iwmEjLhS9iNUCbzpPEjoYgNW') | |
23 | 23 | ||
24 | 24 | let eAdd = Address(base58'3N3uf7RK8Aed4v5ufGB8xV2Wsz4WNoHj21c') | |
25 | 25 | ||
26 | 26 | let pAdd = Address(base58'3Mv5mXTRhpWZxZxstmnsBhckWNgErMTFEaD') | |
27 | 27 | ||
28 | 28 | let eurou = 116 | |
29 | 29 | ||
30 | 30 | let usdnw = 2539 | |
31 | 31 | ||
32 | 32 | let bco2e = 100000 | |
33 | 33 | ||
34 | 34 | let bitdscto = 3 | |
35 | 35 | ||
36 | 36 | let pIP = 10 | |
37 | 37 | ||
38 | 38 | let uBP = 7 | |
39 | 39 | ||
40 | 40 | let sBP = 2 | |
41 | 41 | ||
42 | 42 | let eIP = 1 | |
43 | 43 | ||
44 | 44 | let eBP = 2 | |
45 | 45 | ||
46 | 46 | let relacdcto = 11 | |
47 | 47 | ||
48 | 48 | func getNumberByKey (key) = { | |
49 | 49 | let num = match getInteger(this, key) { | |
50 | 50 | case a: Int => | |
51 | 51 | a | |
52 | 52 | case _ => | |
53 | 53 | 0 | |
54 | 54 | } | |
55 | 55 | num | |
56 | 56 | } | |
57 | 57 | ||
58 | 58 | ||
59 | 59 | func getStrByKey (key) = { | |
60 | 60 | let str = match getString(this, key) { | |
61 | 61 | case a: String => | |
62 | 62 | a | |
63 | 63 | case _ => | |
64 | 64 | NONE | |
65 | 65 | } | |
66 | 66 | str | |
67 | 67 | } | |
68 | 68 | ||
69 | 69 | ||
70 | 70 | func getKeyToken (token) = "Token" | |
71 | 71 | ||
72 | 72 | ||
73 | 73 | func getValueToken (token) = getStrByKey(getKeyToken(token)) | |
74 | 74 | ||
75 | 75 | ||
76 | 76 | func getKeyTienda (tienda) = "Tienda / Shop-GTS" | |
77 | 77 | ||
78 | 78 | ||
79 | 79 | func getValueTienda (tienda) = getStrByKey(getKeyTienda(tienda)) | |
80 | 80 | ||
81 | 81 | ||
82 | 82 | func getKeyTokensTienda (tienda,token) = (("Tokens BCO2: " + " ") + toBase58String(sha256(toBytes((tienda + token))))) | |
83 | 83 | ||
84 | 84 | ||
85 | 85 | func getValueTokensTienda (tienda,token) = getNumberByKey(getKeyTokensTienda(tienda, token)) | |
86 | 86 | ||
87 | 87 | ||
88 | 88 | func getKeyItemSupplier (supplier) = (supplier + "Vendedor, Lima-Perú") | |
89 | 89 | ||
90 | 90 | ||
91 | 91 | func getKeyItem (supplier,item) = (("Producto-GTS: " + " ") + toBase58String(sha256(toBytes((supplier + item))))) | |
92 | 92 | ||
93 | 93 | ||
94 | 94 | func getKeyAsociado (asociado) = "Asociado Bit-CO2" | |
95 | 95 | ||
96 | 96 | ||
97 | 97 | func getValueAsociado (asociado) = getStrByKey(getKeyAsociado(asociado)) | |
98 | 98 | ||
99 | 99 | ||
100 | 100 | func getKeyProject (project) = "Project" | |
101 | 101 | ||
102 | 102 | ||
103 | 103 | func getValueProject (project) = getStrByKey(getKeyProject(project)) | |
104 | 104 | ||
105 | 105 | ||
106 | 106 | func getKeyNodo (nodo) = "Nodo-Activo" | |
107 | 107 | ||
108 | 108 | ||
109 | 109 | func getValueNodo (nodo) = getStrByKey(getKeyNodo(nodo)) | |
110 | 110 | ||
111 | 111 | ||
112 | 112 | func getKeyUserItemGtsCounter (user,item) = "Order_№:" | |
113 | 113 | ||
114 | 114 | ||
115 | 115 | func getValueUserItemGtsCounter (user,item) = getNumberByKey(getKeyUserItemGtsCounter(user, item)) | |
116 | 116 | ||
117 | 117 | ||
118 | 118 | func getKeyItemName (item) = "Categoría del Producto:" | |
119 | 119 | ||
120 | 120 | ||
121 | 121 | func getValueItemName (item) = getStrByKey(getKeyItemName(item)) | |
122 | 122 | ||
123 | 123 | ||
124 | 124 | func getKeyUserName (item) = "Nombre del Usuario:" | |
125 | 125 | ||
126 | 126 | ||
127 | 127 | func getValueUserName (item) = getStrByKey(getKeyUserName(item)) | |
128 | 128 | ||
129 | 129 | ||
130 | 130 | func getKeyUserDocument (item) = "№ de Documento / DNI del Usuario:" | |
131 | 131 | ||
132 | 132 | ||
133 | 133 | func getValueUserDocument (item) = getStrByKey(getKeyUserDocument(item)) | |
134 | 134 | ||
135 | 135 | ||
136 | 136 | func getKeyUI (item) = "UI, x10e-04 bit:" | |
137 | 137 | ||
138 | 138 | ||
139 | 139 | func getValueUI (item) = getNumberByKey(getKeyUI(item)) | |
140 | 140 | ||
141 | 141 | ||
142 | 142 | func getKeyPI (item) = "PI, wvls:" | |
143 | 143 | ||
144 | 144 | ||
145 | 145 | func getValuePI (item) = getNumberByKey(getKeyPI(item)) | |
146 | 146 | ||
147 | 147 | ||
148 | 148 | func getKeySI (item) = "SI, x10e-04 bit:" | |
149 | 149 | ||
150 | 150 | ||
151 | 151 | func getValueSI (item) = getNumberByKey(getKeySI(item)) | |
152 | 152 | ||
153 | 153 | ||
154 | 154 | func getKeyNIb (item) = "NIb, x10e-04 bit:" | |
155 | 155 | ||
156 | 156 | ||
157 | 157 | func getValueNIb (item) = getNumberByKey(getKeyNIb(item)) | |
158 | 158 | ||
159 | 159 | ||
160 | 160 | func getKeyNIw (item) = "NIw, wvls:" | |
161 | 161 | ||
162 | 162 | ||
163 | 163 | func getValueNIw (item) = getNumberByKey(getKeyNIw(item)) | |
164 | 164 | ||
165 | 165 | ||
166 | 166 | func getKeyBalanceTokens (token) = "Tokens Ofertados / Balance, ytok:" | |
167 | 167 | ||
168 | 168 | ||
169 | 169 | func getValueBalanceTokens (token) = getNumberByKey(getKeyBalanceTokens(token)) | |
170 | 170 | ||
171 | 171 | ||
172 | 172 | func getKeyBalanceTokensTienda (tienda) = "Saldo del Vendedor, wvls:" | |
173 | 173 | ||
174 | 174 | ||
175 | 175 | func getValueBalanceTokensTienda (tienda) = getNumberByKey(getKeyBalanceTokensTienda(tienda)) | |
176 | 176 | ||
177 | 177 | ||
178 | 178 | func getKeyBalanceProyecto (proyecto) = "Balance del Proyecto, wvs:" | |
179 | 179 | ||
180 | 180 | ||
181 | 181 | func getValueBalanceProyecto (proyecto) = getNumberByKey(getKeyBalanceProyecto(proyecto)) | |
182 | 182 | ||
183 | 183 | ||
184 | 184 | func getKeyBalanceAsociado (asociado) = "Balance del Asociado:" | |
185 | 185 | ||
186 | 186 | ||
187 | 187 | func getValueBalanceAsociado (asociado) = getNumberByKey(getKeyBalanceAsociado(asociado)) | |
188 | 188 | ||
189 | 189 | ||
190 | 190 | func getKeyBalanceNodo (nodo) = "Balance del Nodo:" | |
191 | 191 | ||
192 | 192 | ||
193 | 193 | func getValueBalanceNodo (nodo) = getNumberByKey(getKeyBalanceNodo(nodo)) | |
194 | 194 | ||
195 | 195 | ||
196 | 196 | func getKeyBalanceQtySupplier (item) = "Saldo ytokens Supplier:" | |
197 | 197 | ||
198 | 198 | ||
199 | 199 | func getValueBalanceQtySupplier (item) = getNumberByKey(getKeyBalanceQtySupplier(item)) | |
200 | 200 | ||
201 | 201 | ||
202 | 202 | @Callable(i) | |
203 | 203 | func deposit (title,supplierData) = { | |
204 | 204 | let token = extract(i.payment) | |
205 | 205 | if ((token.assetId != yBitCO2)) | |
206 | 206 | then throw("deposito permitido solo en yBitCO2 tokens") | |
207 | 207 | else { | |
208 | 208 | let tienda = toBase58String(tAdd.bytes) | |
209 | 209 | let currentAmount = match getInteger(this, tienda) { | |
210 | 210 | case a: Int => | |
211 | 211 | a | |
212 | 212 | case _ => | |
213 | 213 | startQty | |
214 | 214 | } | |
215 | 215 | let newAmount = (currentAmount + token.amount) | |
216 | 216 | if ((0 >= newAmount)) | |
217 | 217 | then throw("No hay yBitCO2 en su balance") | |
218 | 218 | else WriteSet([DataEntry(getKeyBalanceTokensTienda(tienda), newAmount)]) | |
219 | 219 | } | |
220 | 220 | } | |
221 | 221 | ||
222 | 222 | ||
223 | 223 | ||
224 | 224 | @Callable(i) | |
225 | 225 | func purchaseGTS (item,itemName,userName,userDocument,totalAmount) = { | |
226 | 226 | let pmt = extract(i.payment) | |
227 | 227 | if (isDefined(pmt.assetId)) | |
228 | 228 | then throw("El Precio en waves.") | |
229 | 229 | else { | |
230 | 230 | let supplier = match getString(this, getKeyItemSupplier(item)) { | |
231 | 231 | case a: String => | |
232 | 232 | a | |
233 | 233 | case _ => | |
234 | 234 | NONE | |
235 | 235 | } | |
236 | 236 | let tienda = toBase58String(tAdd.bytes) | |
237 | 237 | let saldoTienda = match getInteger(this, getKeyBalanceTokens(tienda)) { | |
238 | 238 | case a: Int => | |
239 | 239 | a | |
240 | 240 | case _ => | |
241 | 241 | 0 | |
242 | 242 | } | |
243 | 243 | let amountBCO2 = (TokToVendedorQty - saldoTienda) | |
244 | 244 | let proyecto = toBase58String(pAdd.bytes) | |
245 | 245 | let saldoProj = match getInteger(this, getKeyBalanceProyecto(proyecto)) { | |
246 | 246 | case a: Int => | |
247 | 247 | a | |
248 | 248 | case _ => | |
249 | 249 | 0 | |
250 | 250 | } | |
251 | 251 | let asociado = toBase58String(aAdd.bytes) | |
252 | 252 | let saldoAsociado = match getInteger(this, getKeyBalanceAsociado(asociado)) { | |
253 | 253 | case a: Int => | |
254 | 254 | a | |
255 | 255 | case _ => | |
256 | 256 | FirstFaseQty | |
257 | 257 | } | |
258 | 258 | let nodo = toBase58String(eAdd.bytes) | |
259 | 259 | let saldoNodo = match getInteger(this, getKeyBalanceNodo(nodo)) { | |
260 | 260 | case a: Int => | |
261 | 261 | a | |
262 | 262 | case _ => | |
263 | 263 | 0 | |
264 | 264 | } | |
265 | 265 | let userAddress = toBase58String(i.caller.bytes) | |
266 | 266 | let subTotal = totalAmount | |
267 | 267 | let pIw = ((pIP * subTotal) / relacdcto) | |
268 | 268 | let eIw = ((eIP * subTotal) / relacdcto) | |
269 | 269 | let bco2menosdcto = (((100 - bitdscto) * (eurou * bco2e)) / 10000) | |
270 | 270 | let subTotalb = (((totalAmount * usdnw) / 100) / bco2menosdcto) | |
271 | 271 | let totalb = (subTotalb * 10000) | |
272 | 272 | let uIb = ((uBP * subTotalb) / relacdcto) | |
273 | 273 | let sIb = ((sBP * subTotalb) / relacdcto) | |
274 | 274 | let eIb = ((eBP * subTotalb) / relacdcto) | |
275 | 275 | if ((totalAmount > pmt.amount)) | |
276 | 276 | then throw("Payment Amount can't be less than item Purchase Order") | |
277 | 277 | else if ((pmt.amount > totalAmount)) | |
278 | 278 | then throw("Payment Amount can't be higher than item Purchase Order") | |
279 | - | else ScriptResult(WriteSet([DataEntry(getKeyUserItemGtsCounter(userAddress, item), (getValueUserItemGtsCounter(userAddress, item) + 1)), DataEntry(getKeyItemSupplier(supplier), supplier), DataEntry(getKeyItem(supplier, item), item), DataEntry(getKeyItemName(item), itemName), DataEntry(getKeyUserName(item), userName), DataEntry(getKeyUserDocument(item), userDocument), DataEntry("Asociado Bit", asociado), DataEntry("usdn", usdnw), DataEntry("eurou", eurou), DataEntry("Apoyo Ecológico, wvls", totalAmount), DataEntry(getKeyPI(item), pIw), DataEntry(getKeyNIw(item), eIw), DataEntry("1 Bit-CO2 Precio Nominal, euros x10e-4", bco2e), DataEntry("1 Bit-CO2 Precio con Descto, usd x10e-4", bco2menosdcto), DataEntry("Total bit-co2 a distribuir, x10e-4", subTotalb), DataEntry(getKeyUI(item), uIb), DataEntry(getKeySI(item), sIb), DataEntry(getKeyNIb(item), eIb), DataEntry(("Order_Status:_" + userAddress), "Transacción Confirmada!"), DataEntry(getKeyBalanceProyecto(proyecto), (getValueBalanceProyecto(proyecto) + pIw)), DataEntry(getKeyBalanceProyecto(proyecto), saldoProj), DataEntry(getKeyBalanceProyecto(proyecto), pIw), DataEntry(getKeyBalanceTokensTienda(tienda), amountBCO2), DataEntry(getKeyBalanceTokensTienda(tienda), ( | |
279 | + | else ScriptResult(WriteSet([DataEntry(getKeyUserItemGtsCounter(userAddress, item), (getValueUserItemGtsCounter(userAddress, item) + 1)), DataEntry(getKeyItemSupplier(supplier), supplier), DataEntry(getKeyItem(supplier, item), item), DataEntry(getKeyItemName(item), itemName), DataEntry(getKeyUserName(item), userName), DataEntry(getKeyUserDocument(item), userDocument), DataEntry("Asociado Bit", asociado), DataEntry("usdn", usdnw), DataEntry("eurou", eurou), DataEntry("Apoyo Ecológico, wvls", totalAmount), DataEntry(getKeyPI(item), pIw), DataEntry(getKeyNIw(item), eIw), DataEntry("1 Bit-CO2 Precio Nominal, euros x10e-4", bco2e), DataEntry("1 Bit-CO2 Precio con Descto, usd x10e-4", bco2menosdcto), DataEntry("Total bit-co2 a distribuir, x10e-4", subTotalb), DataEntry(getKeyUI(item), uIb), DataEntry(getKeySI(item), sIb), DataEntry(getKeyNIb(item), eIb), DataEntry(("Order_Status:_" + userAddress), "Transacción Confirmada!"), DataEntry(getKeyBalanceProyecto(proyecto), (getValueBalanceProyecto(proyecto) + pIw)), DataEntry(getKeyBalanceProyecto(proyecto), saldoProj), DataEntry(getKeyBalanceProyecto(proyecto), pIw), DataEntry(getKeyBalanceTokensTienda(tienda), amountBCO2), DataEntry(getKeyBalanceTokensTienda(tienda), (amountBCO2 - subTotalb)), DataEntry(getKeyBalanceTokensTienda(tienda), ((amountBCO2 * 10000) - subTotalb))]), TransferSet([ScriptTransfer(pAdd, pIw, unit), ScriptTransfer(i.caller, uIb, yBitCO2), ScriptTransfer(aAdd, sIb, yBitCO2), ScriptTransfer(eAdd, eIw, unit), ScriptTransfer(eAdd, eIb, yBitCO2)])) | |
280 | 280 | } | |
281 | 281 | } | |
282 | 282 | ||
283 | 283 | ||
284 | 284 | ||
285 | 285 | @Callable(i) | |
286 | 286 | func withdraw (item,amount) = { | |
287 | 287 | let userAddress = toBase58String(i.caller.bytes) | |
288 | 288 | let supplier = match getString(this, getKeyItemSupplier(item)) { | |
289 | 289 | case a: String => | |
290 | 290 | a | |
291 | 291 | case _ => | |
292 | 292 | NONE | |
293 | 293 | } | |
294 | 294 | let preIcoQty = match getInteger(this, getKeyBalanceQtySupplier(item)) { | |
295 | 295 | case a: Int => | |
296 | 296 | a | |
297 | 297 | case _ => | |
298 | 298 | startQty | |
299 | 299 | } | |
300 | 300 | let newAmount = (preIcoQty - amount) | |
301 | 301 | if ((0 > amount)) | |
302 | 302 | then throw("El balance de retiro no puede ser negativo!") | |
303 | 303 | else if ((0 >= newAmount)) | |
304 | 304 | then throw("Ooppss.. Insuficiente balance!") | |
305 | 305 | else ScriptResult(WriteSet([DataEntry(item, newAmount)]), TransferSet([ScriptTransfer(i.caller, amount, yBitCO2)])) | |
306 | 306 | } | |
307 | 307 | ||
308 | 308 | ||
309 | 309 | @Verifier(tx) | |
310 | 310 | func verify () = match tx { | |
311 | 311 | case t: SetScriptTransaction => | |
312 | 312 | sigVerify(tx.bodyBytes, tx.proofs[0], OwnerPubKey) | |
313 | 313 | case d: ReissueTransaction|DataTransaction => | |
314 | 314 | true | |
315 | 315 | case tx: TransferTransaction => | |
316 | 316 | true | |
317 | 317 | case _ => | |
318 | 318 | false | |
319 | 319 | } | |
320 | 320 |
github/deemru/w8io/026f985 60.46 ms ◑