tx · ceK4SEa6ABcUedxNKJsTDHWuhboD313v3YK5wxmMfMr 3N9DpWDvNPnq3wuuyh2cGk9hcKfoke9CCfL: -0.01000000 Waves 2021.10.28 14:07 [1766065] smart account 3N9DpWDvNPnq3wuuyh2cGk9hcKfoke9CCfL > SELF 0.00000000 Waves
{ "type": 13, "id": "ceK4SEa6ABcUedxNKJsTDHWuhboD313v3YK5wxmMfMr", "fee": 1000000, "feeAssetId": null, "timestamp": 1635419270092, "version": 2, "chainId": 84, "sender": "3N9DpWDvNPnq3wuuyh2cGk9hcKfoke9CCfL", "senderPublicKey": "A695BnQcmLqEPwcN5kdhv4bHipgdE4FnM5CBEMtA95Mo", "proofs": [ "FnWRrJPcFNr4VE6zJdh1khZ2xrrH2H14HN4DRKgN93u7cBSjUqiCu8zc3kqzSsiVPMigNtp4YdkQcPmQvD6WSDp" ], "script": "base64:AAIDAAAAAAAAABEIARIECgIICBIHCgUICAgBAQAAADQAAAAAB3hCaXRDTzIBAAAAICAEZKaqA3sNb6aq+pclWLOWiXpTDP/vusZoh2yDVNyNAAAAAAhzdGFydFF0eQAAAAAAAASqHQAAAAAMRmlyc3RGYXNlUXR5AAAAAAAAAHnZAAAAAA1TZWNvbmRGYXNlUXR5AAAAAAAABDBEAAAAAAhub21QcmljZQAAAAAAAAAAAQAAAAADd3ZzAAAAAAAF9eEAAAAAABBzdXBwbGllckRpc2NvdW50AAAAAAAAAAAMAAAAAAROT05FAgAAAARub25lAAAAAAtPd25lclB1YktleQEAAAAghwo2r32S4n1Z60PhHNuoYGhC3c/vioX75j3CW29sfHYAAAAABmlzc3VlcgkBAAAAB0FkZHJlc3MAAAABAQAAABoBVEtIFY+5IU8slvHa3AYnimNvIdHW5z2X2gAAAAAEZUFkZAkBAAAAB0FkZHJlc3MAAAABAQAAABoBVEwWqDv2xgQzga5tOuDFjQrGc4MHZcTC8gAAAAAEcEFkZAkBAAAAB0FkZHJlc3MAAAABAQAAABoBVNPFIUJMxXdBxNnhCNkHVKgXH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AAAAJ0eAAAAAlib2R5Qnl0ZXMJAAGRAAAAAggFAAAAAnR4AAAABnByb29mcwAAAAAAAAAAAAUAAAALT3duZXJQdWJLZXkDAwkAAAEAAAACBQAAAAckbWF0Y2gwAgAAABJSZWlzc3VlVHJhbnNhY3Rpb24GCQAAAQAAAAIFAAAAByRtYXRjaDACAAAAD0RhdGFUcmFuc2FjdGlvbgQAAAABZAUAAAAHJG1hdGNoMAYDCQAAAQAAAAIFAAAAByRtYXRjaDACAAAAE1RyYW5zZmVyVHJhbnNhY3Rpb24EAAAAAnR4BQAAAAckbWF0Y2gwBgMJAAABAAAAAgUAAAAHJG1hdGNoMAIAAAATRXhjaGFuZ2VUcmFuc2FjdGlvbgQAAAACdHgFAAAAByRtYXRjaDAEAAAACXdpdGhXYXZlcwMJAQAAAAEhAAAAAQkBAAAACWlzRGVmaW5lZAAAAAEICAgFAAAAAnR4AAAACXNlbGxPcmRlcgAAAAlhc3NldFBhaXIAAAAKcHJpY2VBc3NldAYJAQAAAAEhAAAAAQkBAAAACWlzRGVmaW5lZAAAAAEICAgFAAAAAnR4AAAACXNlbGxPcmRlcgAAAAlhc3NldFBhaXIAAAALYW1vdW50QXNzZXQFAAAACXdpdGhXYXZlcwevVb2+", "height": 1766065, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: EY2WkrsHVZeAzkZV1xjJ2exFQffCunHSYJgygcHUSVXV Next: 2L9Yvfhyuxss3yEEn4CMEC1nKzbMhWkPNWBwUW1gMFRb Diff:
Old | New | Differences | |
---|---|---|---|
98 | 98 | func getValueProjectDev (supplier) = getStrByKey(getKeyProjectDev(supplier)) | |
99 | 99 | ||
100 | 100 | ||
101 | - | func getKeyProjectEtapa (projectAddress) = "AchuarKapawi, I Etapa: PreICO" | |
102 | - | ||
103 | - | ||
104 | - | func getValueProjectEtapa (projectAddress) = getStrByKey(getKeyProjectEtapa(projectAddress)) | |
105 | - | ||
106 | - | ||
107 | - | func getKeyFirstFaseQty (item) = "Total tokens emitidos en I Fase Pre-ICO" | |
101 | + | func getKeyFirstFaseQty (item) = "Tokens ofertados al 6% en la I Fase Pre-ICO:" | |
108 | 102 | ||
109 | 103 | ||
110 | 104 | func getValueFirstFaseQty (item) = getStrByKey(getKeyFirstFaseQty(item)) | |
111 | 105 | ||
112 | 106 | ||
113 | - | func getKeyNomTokenPrice (item) = " | |
107 | + | func getKeyNomTokenPrice (item) = "Precio Nominal, 1 token Bit-CO2:" | |
114 | 108 | ||
115 | 109 | ||
116 | - | func | |
110 | + | func getKeyDescuento6TokPrice (item) = "Precio de 1 token Bit-CO2 con el 6% de descuento" | |
117 | 111 | ||
118 | 112 | ||
119 | - | func | |
113 | + | func getValueDescuento6TokPrice (item) = getNumberByKey(getKeyDescuento6TokPrice(item)) | |
120 | 114 | ||
121 | 115 | ||
122 | - | func | |
116 | + | func getKeySaldoTokenQtyStartEtapa (item) = "Saldo de tokens al 6% en oferta, actual:" | |
123 | 117 | ||
124 | 118 | ||
125 | - | func getValueMaxDescuento (item) = getNumberByKey(getKeyMaxDescuento(item)) | |
126 | - | ||
127 | - | ||
128 | - | func getKeyMinTokenPrice (item) = "8.80 Euros por 1 token Bit-CO2" | |
119 | + | func getValueSaldoTokenQtyStartEtapa (item) = getNumberByKey(getKeySaldoTokenQtyStartEtapa(item)) | |
129 | 120 | ||
130 | 121 | ||
131 | 122 | func getKeyUserItemCounter (user,item) = "Order_№:" | |
134 | 125 | func getValueUserItemCounter (user,item) = getNumberByKey(getKeyUserItemCounter(user, item)) | |
135 | 126 | ||
136 | 127 | ||
137 | - | func getKeyUserName (item) = "Nombre del Usuario:" | |
138 | - | ||
139 | - | ||
140 | - | func getValueUserName (item) = getStrByKey(getKeyUserName(item)) | |
141 | - | ||
142 | - | ||
143 | 128 | func getKeyUserDocument (item) = "№ de Documento Nacional de Identidad / DNI del Usuario:" | |
144 | 129 | ||
145 | 130 | ||
146 | 131 | func getValueUserDocument (item) = getStrByKey(getKeyUserDocument(item)) | |
147 | 132 | ||
148 | 133 | ||
149 | - | func getKeyUserCountry (item) = "País del Usuario:" | |
134 | + | func getKeyUserCountry (item) = "País de Residencia del Usuario:" | |
150 | 135 | ||
151 | 136 | ||
152 | 137 | func getValueUserCountry (item) = getStrByKey(getKeyUserCountry(item)) | |
153 | 138 | ||
154 | 139 | ||
155 | - | func | |
140 | + | func getKeyDiscount6User (item) = "Descuento para el Usuario, 6%:" | |
156 | 141 | ||
157 | 142 | ||
158 | - | func getValueItemDiscountUser (item) = getNumberByKey(getKeyItemDiscountUser(item)) | |
159 | - | ||
160 | - | ||
161 | - | func getKeyItemDiscountSupplier (item) = "SupplierDiscount, max_%:" | |
162 | - | ||
163 | - | ||
164 | - | func getValueItemDiscountSupplier (item) = getNumberByKey(getKeyItemDiscountSupplier(item)) | |
143 | + | func getValueDiscount6User (item) = getNumberByKey(getKeyDiscount6User(item)) | |
165 | 144 | ||
166 | 145 | ||
167 | 146 | func getKeyItemUserOrderQty (item) = "Orden de Compra, cantidad solicitada:" | |
168 | 147 | ||
169 | 148 | ||
170 | 149 | func getValueItemUserOrderQty (item) = getNumberByKey(getKeyItemUserOrderQty(item)) | |
171 | - | ||
172 | - | ||
173 | - | func getKeySaldoTokenQtyStartEtapa (item) = "Tokens Ofertados en la presente etapa / Saldo:" | |
174 | - | ||
175 | - | ||
176 | - | func getValueSaldoTokenQtyStartEtapa (item) = getNumberByKey(getKeySaldoTokenQtyStartEtapa(item)) | |
177 | - | ||
178 | - | ||
179 | - | func getKeyBalanceQtySupplier (item) = "Balance/Saldo, tokens:" | |
180 | - | ||
181 | - | ||
182 | - | func getValueBalanceQtySupplier (item) = getNumberByKey(getKeyBalanceQtySupplier(item)) | |
183 | 150 | ||
184 | 151 | ||
185 | 152 | func getKeyBalanceSupplier (supplier) = "Ingresos por Venta Directa / BlockChain:" | |
211 | 178 | ||
212 | 179 | ||
213 | 180 | @Callable(i) | |
214 | - | func purchase (item, | |
181 | + | func purchase (item,userDocument,userCountry,userDiscount,orderQty) = { | |
215 | 182 | let pmt = extract(i.payment) | |
216 | 183 | if (isDefined(pmt.assetId)) | |
217 | 184 | then throw("En la presente Plastaforma Ud. puede adquirir sus tokens xBitCO2 usando WavesKeeper y su token de pago Waves.") | |
222 | 189 | case _ => | |
223 | 190 | NONE | |
224 | 191 | } | |
225 | - | let preIcoQty = match getInteger(this, | |
192 | + | let preIcoQty = match getInteger(this, getKeySaldoTokenQtyStartEtapa(item)) { | |
226 | 193 | case a: Int => | |
227 | 194 | a | |
228 | 195 | case _ => | |
241 | 208 | then throw("Payment Amount can't be less than item Purchase Order") | |
242 | 209 | else if ((pmt.amount > totalAmount)) | |
243 | 210 | then throw("Payment Amount can't be higher than item Purchase Order") | |
244 | - | else ScriptResult(WriteSet([DataEntry(getKeyProjectCategory(item), "Conservación Forestal Amazónica"), DataEntry(getKeyProjectName(item), "Reserva Amazónica Achuar-Kapawi"), DataEntry(getKeyProjectCountry(item), "Ecuador"), DataEntry(getKeyProjectCode(item), "01-EC_ACH-KAPAWI_01PREICO"), DataEntry(getKeyProjectPropietary(item), "Comunidad Achuar Kapawi"), DataEntry(getKeyProjectDev(supplier), "Fundación Alianza Ecológica 'NASE'"), DataEntry(" | |
211 | + | else ScriptResult(WriteSet([DataEntry(getKeyProjectCategory(item), "Conservación Forestal Amazónica"), DataEntry(getKeyProjectName(item), "Reserva Amazónica Achuar-Kapawi"), DataEntry(getKeyProjectCountry(item), "Ecuador"), DataEntry(getKeyProjectCode(item), "01-EC_ACH-KAPAWI_01PREICO"), DataEntry(getKeyProjectPropietary(item), "Comunidad Achuar Kapawi"), DataEntry(getKeyProjectDev(supplier), "Fundación Alianza Ecológica 'NASE'"), DataEntry("Cantidad de Tokens Bit-CO2 a Emitir, I y II Fase Pre-ICO", startQty), DataEntry(getKeyFirstFaseQty(item), FirstFaseQty), DataEntry(getKeyNomTokenPrice(item), "10.00 Euros"), DataEntry(getKeyDescuento6TokPrice(item), currentTokenPrice), DataEntry(getKeyUserItemCounter(userAddress, item), (getValueUserItemCounter(userAddress, item) + 1)), DataEntry(getKeyUserDocument(item), userDocument), DataEntry(getKeyUserCountry(item), userCountry), DataEntry(getKeyDiscount6User(item), userDiscount), DataEntry(getKeyItemUserOrderQty(item), orderQty), DataEntry("purchaseOrder/Status:", "¡Adquisición Confirmada!"), DataEntry(getKeySaldoTokenQtyStartEtapa(item), ((getValueSaldoTokenQtyStartEtapa(item) + preIcoQty) - orderQty)), DataEntry(getKeyBalanceSupplier(supplier), (getValueBalanceSupplier(supplier) + pmt.amount)), DataEntry("Dirección del Proyecto en Waves-BlockChain:", "3N9DpWDvNPnq3wuuyh2cGk9hcKfoke9CCfL")]), TransferSet([ScriptTransfer(addressFromStringValue(userAddress), orderQty, xBitCO2)])) | |
245 | 212 | } | |
246 | - | } | |
247 | - | ||
248 | - | ||
249 | - | ||
250 | - | @Callable(i) | |
251 | - | func withdraw (item,amount) = { | |
252 | - | let userAddress = toBase58String(i.caller.bytes) | |
253 | - | let supplier = match getString(this, getKeyItemSupplier(item)) { | |
254 | - | case a: String => | |
255 | - | a | |
256 | - | case _ => | |
257 | - | NONE | |
258 | - | } | |
259 | - | let preIcoQty = match getInteger(this, getKeyBalanceQtySupplier(item)) { | |
260 | - | case a: Int => | |
261 | - | a | |
262 | - | case _ => | |
263 | - | startQty | |
264 | - | } | |
265 | - | let newAmount = (preIcoQty - amount) | |
266 | - | if ((0 > amount)) | |
267 | - | then throw("El balance de retiro no puede ser negativo!") | |
268 | - | else if ((0 >= newAmount)) | |
269 | - | then throw("Ooppss.. Insuficiente balance!") | |
270 | - | else ScriptResult(WriteSet([DataEntry(item, newAmount)]), TransferSet([ScriptTransfer(i.caller, amount, xBitCO2)])) | |
271 | 213 | } | |
272 | 214 | ||
273 | 215 |
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 startQty = 305693 | |
7 | 7 | ||
8 | 8 | let FirstFaseQty = 31193 | |
9 | 9 | ||
10 | 10 | let SecondFaseQty = 274500 | |
11 | 11 | ||
12 | 12 | let nomPrice = 1 | |
13 | 13 | ||
14 | 14 | let wvs = 100000000 | |
15 | 15 | ||
16 | 16 | let supplierDiscount = 12 | |
17 | 17 | ||
18 | 18 | let NONE = "none" | |
19 | 19 | ||
20 | 20 | let OwnerPubKey = base58'A695BnQcmLqEPwcN5kdhv4bHipgdE4FnM5CBEMtA95Mo' | |
21 | 21 | ||
22 | 22 | let issuer = Address(base58'3Mvn8oonnpiasA3bkq36N9qeqqXWfFW437o') | |
23 | 23 | ||
24 | 24 | let eAdd = Address(base58'3MvrQGkHQtyLTC2QXgPnQ6oCEWhHyUJpU4q') | |
25 | 25 | ||
26 | 26 | let pAdd = Address(base58'3N9DpWDvNPnq3wuuyh2cGk9hcKfoke9CCfL') | |
27 | 27 | ||
28 | 28 | let igv = 18 | |
29 | 29 | ||
30 | 30 | let cPB = 88 | |
31 | 31 | ||
32 | 32 | let uIP = 5 | |
33 | 33 | ||
34 | 34 | let pIP = 10 | |
35 | 35 | ||
36 | 36 | let sIP = 1 | |
37 | 37 | ||
38 | 38 | let eIP = 1 | |
39 | 39 | ||
40 | 40 | func getNumberByKey (key) = { | |
41 | 41 | let num = match getInteger(this, key) { | |
42 | 42 | case a: Int => | |
43 | 43 | a | |
44 | 44 | case _ => | |
45 | 45 | 0 | |
46 | 46 | } | |
47 | 47 | num | |
48 | 48 | } | |
49 | 49 | ||
50 | 50 | ||
51 | 51 | func getStrByKey (key) = { | |
52 | 52 | let str = match getString(this, key) { | |
53 | 53 | case a: String => | |
54 | 54 | a | |
55 | 55 | case _ => | |
56 | 56 | NONE | |
57 | 57 | } | |
58 | 58 | str | |
59 | 59 | } | |
60 | 60 | ||
61 | 61 | ||
62 | 62 | func getKeyProjectCategory (item) = "Categoría:" | |
63 | 63 | ||
64 | 64 | ||
65 | 65 | func getValueProjectCategory (item) = getStrByKey(getKeyProjectCategory(item)) | |
66 | 66 | ||
67 | 67 | ||
68 | 68 | func getKeyItemSupplier (supplier) = (supplier + "Comunidad Achuar Kapawi del Ecuador") | |
69 | 69 | ||
70 | 70 | ||
71 | 71 | func getKeyProjectName (item) = "Nombre del Proyecto:" | |
72 | 72 | ||
73 | 73 | ||
74 | 74 | func getValueProjectName (item) = getStrByKey(getKeyProjectName(item)) | |
75 | 75 | ||
76 | 76 | ||
77 | 77 | func getKeyProjectCountry (item) = "País | Ubicación:" | |
78 | 78 | ||
79 | 79 | ||
80 | 80 | func getValueProjectCountry (item) = getStrByKey(getKeyProjectCountry(item)) | |
81 | 81 | ||
82 | 82 | ||
83 | 83 | func getKeyProjectCode (item) = "Código:" | |
84 | 84 | ||
85 | 85 | ||
86 | 86 | func getValueProjectCode (item) = getStrByKey(getKeyProjectCode(item)) | |
87 | 87 | ||
88 | 88 | ||
89 | 89 | func getKeyProjectPropietary (item) = "Propietario | Beneficiario del Proyecto:" | |
90 | 90 | ||
91 | 91 | ||
92 | 92 | func getValueProjectPropietary (item) = getStrByKey(getKeyProjectPropietary(item)) | |
93 | 93 | ||
94 | 94 | ||
95 | 95 | func getKeyProjectDev (supplier) = "Desarrollador | Responsable Legal:" | |
96 | 96 | ||
97 | 97 | ||
98 | 98 | func getValueProjectDev (supplier) = getStrByKey(getKeyProjectDev(supplier)) | |
99 | 99 | ||
100 | 100 | ||
101 | - | func getKeyProjectEtapa (projectAddress) = "AchuarKapawi, I Etapa: PreICO" | |
102 | - | ||
103 | - | ||
104 | - | func getValueProjectEtapa (projectAddress) = getStrByKey(getKeyProjectEtapa(projectAddress)) | |
105 | - | ||
106 | - | ||
107 | - | func getKeyFirstFaseQty (item) = "Total tokens emitidos en I Fase Pre-ICO" | |
101 | + | func getKeyFirstFaseQty (item) = "Tokens ofertados al 6% en la I Fase Pre-ICO:" | |
108 | 102 | ||
109 | 103 | ||
110 | 104 | func getValueFirstFaseQty (item) = getStrByKey(getKeyFirstFaseQty(item)) | |
111 | 105 | ||
112 | 106 | ||
113 | - | func getKeyNomTokenPrice (item) = " | |
107 | + | func getKeyNomTokenPrice (item) = "Precio Nominal, 1 token Bit-CO2:" | |
114 | 108 | ||
115 | 109 | ||
116 | - | func | |
110 | + | func getKeyDescuento6TokPrice (item) = "Precio de 1 token Bit-CO2 con el 6% de descuento" | |
117 | 111 | ||
118 | 112 | ||
119 | - | func | |
113 | + | func getValueDescuento6TokPrice (item) = getNumberByKey(getKeyDescuento6TokPrice(item)) | |
120 | 114 | ||
121 | 115 | ||
122 | - | func | |
116 | + | func getKeySaldoTokenQtyStartEtapa (item) = "Saldo de tokens al 6% en oferta, actual:" | |
123 | 117 | ||
124 | 118 | ||
125 | - | func getValueMaxDescuento (item) = getNumberByKey(getKeyMaxDescuento(item)) | |
126 | - | ||
127 | - | ||
128 | - | func getKeyMinTokenPrice (item) = "8.80 Euros por 1 token Bit-CO2" | |
119 | + | func getValueSaldoTokenQtyStartEtapa (item) = getNumberByKey(getKeySaldoTokenQtyStartEtapa(item)) | |
129 | 120 | ||
130 | 121 | ||
131 | 122 | func getKeyUserItemCounter (user,item) = "Order_№:" | |
132 | 123 | ||
133 | 124 | ||
134 | 125 | func getValueUserItemCounter (user,item) = getNumberByKey(getKeyUserItemCounter(user, item)) | |
135 | 126 | ||
136 | 127 | ||
137 | - | func getKeyUserName (item) = "Nombre del Usuario:" | |
138 | - | ||
139 | - | ||
140 | - | func getValueUserName (item) = getStrByKey(getKeyUserName(item)) | |
141 | - | ||
142 | - | ||
143 | 128 | func getKeyUserDocument (item) = "№ de Documento Nacional de Identidad / DNI del Usuario:" | |
144 | 129 | ||
145 | 130 | ||
146 | 131 | func getValueUserDocument (item) = getStrByKey(getKeyUserDocument(item)) | |
147 | 132 | ||
148 | 133 | ||
149 | - | func getKeyUserCountry (item) = "País del Usuario:" | |
134 | + | func getKeyUserCountry (item) = "País de Residencia del Usuario:" | |
150 | 135 | ||
151 | 136 | ||
152 | 137 | func getValueUserCountry (item) = getStrByKey(getKeyUserCountry(item)) | |
153 | 138 | ||
154 | 139 | ||
155 | - | func | |
140 | + | func getKeyDiscount6User (item) = "Descuento para el Usuario, 6%:" | |
156 | 141 | ||
157 | 142 | ||
158 | - | func getValueItemDiscountUser (item) = getNumberByKey(getKeyItemDiscountUser(item)) | |
159 | - | ||
160 | - | ||
161 | - | func getKeyItemDiscountSupplier (item) = "SupplierDiscount, max_%:" | |
162 | - | ||
163 | - | ||
164 | - | func getValueItemDiscountSupplier (item) = getNumberByKey(getKeyItemDiscountSupplier(item)) | |
143 | + | func getValueDiscount6User (item) = getNumberByKey(getKeyDiscount6User(item)) | |
165 | 144 | ||
166 | 145 | ||
167 | 146 | func getKeyItemUserOrderQty (item) = "Orden de Compra, cantidad solicitada:" | |
168 | 147 | ||
169 | 148 | ||
170 | 149 | func getValueItemUserOrderQty (item) = getNumberByKey(getKeyItemUserOrderQty(item)) | |
171 | - | ||
172 | - | ||
173 | - | func getKeySaldoTokenQtyStartEtapa (item) = "Tokens Ofertados en la presente etapa / Saldo:" | |
174 | - | ||
175 | - | ||
176 | - | func getValueSaldoTokenQtyStartEtapa (item) = getNumberByKey(getKeySaldoTokenQtyStartEtapa(item)) | |
177 | - | ||
178 | - | ||
179 | - | func getKeyBalanceQtySupplier (item) = "Balance/Saldo, tokens:" | |
180 | - | ||
181 | - | ||
182 | - | func getValueBalanceQtySupplier (item) = getNumberByKey(getKeyBalanceQtySupplier(item)) | |
183 | 150 | ||
184 | 151 | ||
185 | 152 | func getKeyBalanceSupplier (supplier) = "Ingresos por Venta Directa / BlockChain:" | |
186 | 153 | ||
187 | 154 | ||
188 | 155 | func getValueBalanceSupplier (supplier) = getNumberByKey(getKeyBalanceSupplier(supplier)) | |
189 | 156 | ||
190 | 157 | ||
191 | 158 | @Callable(i) | |
192 | 159 | func deposit (title,supplierData) = { | |
193 | 160 | let pmt = extract(i.payment) | |
194 | 161 | if ((pmt.assetId != xBitCO2)) | |
195 | 162 | then throw("deposito permitido solo en xBitCO2 tokens") | |
196 | 163 | else { | |
197 | 164 | let supplier = toBase58String(i.caller.bytes) | |
198 | 165 | let currentAmount = match getInteger(this, supplier) { | |
199 | 166 | case a: Int => | |
200 | 167 | a | |
201 | 168 | case _ => | |
202 | 169 | startQty | |
203 | 170 | } | |
204 | 171 | let newAmount = (currentAmount + pmt.amount) | |
205 | 172 | if ((0 >= newAmount)) | |
206 | 173 | then throw("No hay xBitCO2 en su balance") | |
207 | 174 | else WriteSet([DataEntry(supplier, newAmount)]) | |
208 | 175 | } | |
209 | 176 | } | |
210 | 177 | ||
211 | 178 | ||
212 | 179 | ||
213 | 180 | @Callable(i) | |
214 | - | func purchase (item, | |
181 | + | func purchase (item,userDocument,userCountry,userDiscount,orderQty) = { | |
215 | 182 | let pmt = extract(i.payment) | |
216 | 183 | if (isDefined(pmt.assetId)) | |
217 | 184 | then throw("En la presente Plastaforma Ud. puede adquirir sus tokens xBitCO2 usando WavesKeeper y su token de pago Waves.") | |
218 | 185 | else { | |
219 | 186 | let supplier = match getString(this, getKeyItemSupplier(item)) { | |
220 | 187 | case a: String => | |
221 | 188 | a | |
222 | 189 | case _ => | |
223 | 190 | NONE | |
224 | 191 | } | |
225 | - | let preIcoQty = match getInteger(this, | |
192 | + | let preIcoQty = match getInteger(this, getKeySaldoTokenQtyStartEtapa(item)) { | |
226 | 193 | case a: Int => | |
227 | 194 | a | |
228 | 195 | case _ => | |
229 | 196 | startQty | |
230 | 197 | } | |
231 | 198 | let balanceSupplier = match getInteger(this, getKeyBalanceSupplier(supplier)) { | |
232 | 199 | case a: Int => | |
233 | 200 | a | |
234 | 201 | case _ => | |
235 | 202 | 0 | |
236 | 203 | } | |
237 | 204 | let userAddress = toBase58String(i.caller.bytes) | |
238 | 205 | let currentTokenPrice = ((((100 - userDiscount) * nomPrice) * wvs) / 100) | |
239 | 206 | let totalAmount = (orderQty * currentTokenPrice) | |
240 | 207 | if ((totalAmount > pmt.amount)) | |
241 | 208 | then throw("Payment Amount can't be less than item Purchase Order") | |
242 | 209 | else if ((pmt.amount > totalAmount)) | |
243 | 210 | then throw("Payment Amount can't be higher than item Purchase Order") | |
244 | - | else ScriptResult(WriteSet([DataEntry(getKeyProjectCategory(item), "Conservación Forestal Amazónica"), DataEntry(getKeyProjectName(item), "Reserva Amazónica Achuar-Kapawi"), DataEntry(getKeyProjectCountry(item), "Ecuador"), DataEntry(getKeyProjectCode(item), "01-EC_ACH-KAPAWI_01PREICO"), DataEntry(getKeyProjectPropietary(item), "Comunidad Achuar Kapawi"), DataEntry(getKeyProjectDev(supplier), "Fundación Alianza Ecológica 'NASE'"), DataEntry(" | |
211 | + | else ScriptResult(WriteSet([DataEntry(getKeyProjectCategory(item), "Conservación Forestal Amazónica"), DataEntry(getKeyProjectName(item), "Reserva Amazónica Achuar-Kapawi"), DataEntry(getKeyProjectCountry(item), "Ecuador"), DataEntry(getKeyProjectCode(item), "01-EC_ACH-KAPAWI_01PREICO"), DataEntry(getKeyProjectPropietary(item), "Comunidad Achuar Kapawi"), DataEntry(getKeyProjectDev(supplier), "Fundación Alianza Ecológica 'NASE'"), DataEntry("Cantidad de Tokens Bit-CO2 a Emitir, I y II Fase Pre-ICO", startQty), DataEntry(getKeyFirstFaseQty(item), FirstFaseQty), DataEntry(getKeyNomTokenPrice(item), "10.00 Euros"), DataEntry(getKeyDescuento6TokPrice(item), currentTokenPrice), DataEntry(getKeyUserItemCounter(userAddress, item), (getValueUserItemCounter(userAddress, item) + 1)), DataEntry(getKeyUserDocument(item), userDocument), DataEntry(getKeyUserCountry(item), userCountry), DataEntry(getKeyDiscount6User(item), userDiscount), DataEntry(getKeyItemUserOrderQty(item), orderQty), DataEntry("purchaseOrder/Status:", "¡Adquisición Confirmada!"), DataEntry(getKeySaldoTokenQtyStartEtapa(item), ((getValueSaldoTokenQtyStartEtapa(item) + preIcoQty) - orderQty)), DataEntry(getKeyBalanceSupplier(supplier), (getValueBalanceSupplier(supplier) + pmt.amount)), DataEntry("Dirección del Proyecto en Waves-BlockChain:", "3N9DpWDvNPnq3wuuyh2cGk9hcKfoke9CCfL")]), TransferSet([ScriptTransfer(addressFromStringValue(userAddress), orderQty, xBitCO2)])) | |
245 | 212 | } | |
246 | - | } | |
247 | - | ||
248 | - | ||
249 | - | ||
250 | - | @Callable(i) | |
251 | - | func withdraw (item,amount) = { | |
252 | - | let userAddress = toBase58String(i.caller.bytes) | |
253 | - | let supplier = match getString(this, getKeyItemSupplier(item)) { | |
254 | - | case a: String => | |
255 | - | a | |
256 | - | case _ => | |
257 | - | NONE | |
258 | - | } | |
259 | - | let preIcoQty = match getInteger(this, getKeyBalanceQtySupplier(item)) { | |
260 | - | case a: Int => | |
261 | - | a | |
262 | - | case _ => | |
263 | - | startQty | |
264 | - | } | |
265 | - | let newAmount = (preIcoQty - amount) | |
266 | - | if ((0 > amount)) | |
267 | - | then throw("El balance de retiro no puede ser negativo!") | |
268 | - | else if ((0 >= newAmount)) | |
269 | - | then throw("Ooppss.. Insuficiente balance!") | |
270 | - | else ScriptResult(WriteSet([DataEntry(item, newAmount)]), TransferSet([ScriptTransfer(i.caller, amount, xBitCO2)])) | |
271 | 213 | } | |
272 | 214 | ||
273 | 215 | ||
274 | 216 | @Verifier(tx) | |
275 | 217 | func verify () = match tx { | |
276 | 218 | case t: SetScriptTransaction => | |
277 | 219 | sigVerify(tx.bodyBytes, tx.proofs[0], OwnerPubKey) | |
278 | 220 | case d: ReissueTransaction|DataTransaction => | |
279 | 221 | true | |
280 | 222 | case tx: TransferTransaction => | |
281 | 223 | true | |
282 | 224 | case tx: ExchangeTransaction => | |
283 | 225 | let withWaves = if (!(isDefined(tx.sellOrder.assetPair.priceAsset))) | |
284 | 226 | then true | |
285 | 227 | else !(isDefined(tx.sellOrder.assetPair.amountAsset)) | |
286 | 228 | withWaves | |
287 | 229 | case _ => | |
288 | 230 | false | |
289 | 231 | } | |
290 | 232 |
github/deemru/w8io/169f3d6 67.39 ms ◑