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