tx · 7M6xNLj1zm1W1yaEdCw9GWWAiBV7SaybFVaSbc4NnhuG

3N6D1fPBTu4QuZenU7hKNuxEKsxd13USum8:  -0.01000000 Waves

2021.11.01 23:12 [1772399] smart account 3N6D1fPBTu4QuZenU7hKNuxEKsxd13USum8 > SELF 0.00000000 Waves

{ "type": 13, "id": "7M6xNLj1zm1W1yaEdCw9GWWAiBV7SaybFVaSbc4NnhuG", "fee": 1000000, "feeAssetId": null, "timestamp": 1635797602835, "version": 2, "chainId": 84, "sender": "3N6D1fPBTu4QuZenU7hKNuxEKsxd13USum8", "senderPublicKey": "8xCH82jKi2DM7HXXD45fmftPUDjr3TJpjanUATKMK37U", "proofs": [ "4NecPMv1LU2DDvqG2EyKTx4ToJEcrjMyDBjc7MpkM59L2Wva9viLvH1JsN7qSoS9q3bGHYe6GHu6nYEoUJxZa7G1" ], "script": "base64:AAIDAAAAAAAAAAwIARIICgYBCAgICAgAAAAtAAAAAAd5Qml0Q08yAQAAACBpjNT/200BfejLeLffs4/BXDw5W+kMeWgNIY5n6ZtLrQAAAAAQVG9rVG9WZW5kZWRvclF0eQAAAAAAAAAnEAAAAAAETk9ORQIAAAAEbm9uZQAAAAALT3duZXJQdWJLZXkBAAAAIHYlgUf22Lk37u4at3MrCWteEN5n68yQc4q5Um14SA8PAAAAABZlY3hhY2h4a2FwYXdpeDAxcHJlaWNvCQEAAAAHQWRkcmVzcwAAAAEBAAAAGgFU3xPba43MIrTdBzkj1KIh5RJhI+0VJu6nAAAAABxlTTN4TjA4eE4wOHBleHByb2R4YWNBcHB4d3ZzCQEAAAAHQWRkcmVzcwAAAAEBAAAAGgFUZXtlAwFojd9til2zY8ueY3NTvHmic+ofAAAAAAp0eGFjeE4wOHBlCQEAAAAHQWRkcmVzcwAAAAEBAAAAGgFU2H+zv6hoVfC6umL2/Iw6/XNeoYjeAvgKAAAAAApOMDhwZXhwcm9kCQEAAAAHQWRkcmVzcwAAAAEBAAAAGgFUoSOcBtKbP7i/nEoP0XqH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xsZXIFAAAAA3VJYgUAAAAHeUJpdENPMgkABEwAAAACCQEAAAAOU2NyaXB0VHJhbnNmZXIAAAADBQAAAAp0eGFjeE4wOHBlBQAAAANzSWIFAAAAB3lCaXRDTzIJAARMAAAAAgkBAAAADlNjcmlwdFRyYW5zZmVyAAAAAwUAAAAKTjA4cGV4cHJvZAUAAAADZUliBQAAAAd5Qml0Q08yBQAAAANuaWwAAAABAAAAAnR4AQAAAAZ2ZXJpZnkAAAAABAAAAAckbWF0Y2gwBQAAAAJ0eAMJAAABAAAAAgUAAAAHJG1hdGNoMAIAAAAUU2V0U2NyaXB0VHJhbnNhY3Rpb24EAAAAAXQFAAAAByRtYXRjaDAJAAH0AAAAAwgFAAAAAnR4AAAACWJvZHlCeXRlcwkAAZEAAAACCAUAAAACdHgAAAAGcHJvb2ZzAAAAAAAAAAAABQAAAAtPd25lclB1YktleQMDCQAAAQAAAAIFAAAAByRtYXRjaDACAAAAElJlaXNzdWVUcmFuc2FjdGlvbgYJAAABAAAAAgUAAAAHJG1hdGNoMAIAAAAPRGF0YVRyYW5zYWN0aW9uBAAAAAFkBQAAAAckbWF0Y2gwBgMJAAABAAAAAgUAAAAHJG1hdGNoMAIAAAATVHJhbnNmZXJUcmFuc2FjdGlvbgQAAAACdHgFAAAAByRtYXRjaDAGB35kyxo=", "height": 1772399, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: 7ekSFAKMaVtvS8AvtVBZxp9KtsXrdNYsKF89jm24h7tV Next: 2Ps9Ti3csqKi3534QJ7MwTPPmNhpXN3oSc5Pjjhm7bLv Diff:
OldNewDifferences
173173 if ((saldoTienda1 >= (TokToVendedorQty * 10000)))
174174 then throw("Lo sentimos, por ahora no hay oferta de tokens para su transacción")
175175 else {
176- let amountBCO2 = ((TokToVendedorQty * 10000) - saldoTienda1)
176+ let amountBCO2 = (TokToVendedorQty * 10000)
177177 if ((totalAmount > pmt.amount))
178178 then throw("Payment Amount can't be less than item Purchase Order")
179179 else if ((pmt.amount > totalAmount))
180180 then throw("Payment Amount can't be higher than item Purchase Order")
181- else ScriptResult(WriteSet([DataEntry(getKeyUserItemGtsCounter(userAddress, item), (getValueUserItemGtsCounter(userAddress, item) + 1)), DataEntry(getKeyUserDocument(item), userDocument), DataEntry(getKeyprojectName(item), projectName), DataEntry("Monto de apoyo ecológico, wvls", totalAmount), DataEntry(getKeyItemName(item), itemName), DataEntry(getKeyTName(item), tName), DataEntry(getKeySupplier(item), item), DataEntry("usdn", usdnw), DataEntry("eurou", eurou), DataEntry("Precio de 1 token con dscto, 10e-4 usd", bco2menosdcto), DataEntry("Total de tokens a distribuir, 10e-4 bit-co2", subTotalb), DataEntry(("Order_Status:_" + userAddress), "Transacción Confirmada!"), DataEntry(getKeyBalanceProyecto(proyecto), (getValueBalanceProyecto(proyecto) + pIw)), DataEntry(getKeyBalanceToken(tienda), (getValueBalanceToken(tienda) + subTotalb)), DataEntry("Saldo de tokens en oferta, 10e-04 bit-co2", (amountBCO2 - ((getValueBalanceToken(tienda) - saldoTienda1) + subTotalb)))]), TransferSet([ScriptTransfer(ecxachxkapawix01preico, pIw, unit), ScriptTransfer(eM3xN08xN08pexprodxacAppxwvs, eIw, unit), ScriptTransfer(i.caller, uIb, yBitCO2), ScriptTransfer(txacxN08pe, sIb, yBitCO2), ScriptTransfer(N08pexprod, eIb, yBitCO2)]))
181+ else ScriptResult(WriteSet([DataEntry(getKeyUserItemGtsCounter(userAddress, item), (getValueUserItemGtsCounter(userAddress, item) + 1)), DataEntry(getKeyUserDocument(item), userDocument), DataEntry(getKeyprojectName(item), projectName), DataEntry("Monto de apoyo ecológico, wvls", totalAmount), DataEntry(getKeyItemName(item), itemName), DataEntry(getKeyTName(item), tName), DataEntry(getKeySupplier(item), item), DataEntry("usdn", usdnw), DataEntry("eurou", eurou), DataEntry("Precio de 1 token con dscto, 10e-4 usd", bco2menosdcto), DataEntry("Total de tokens a distribuir, 10e-4 bit-co2", subTotalb), DataEntry(("Order_Status:_" + userAddress), "Transacción Confirmada!"), DataEntry(getKeyBalanceProyecto(proyecto), 0), DataEntry(getKeyBalanceToken(tienda), 0), DataEntry("Saldo BCO2 en oferta, 10e-04", amountBCO2)]), TransferSet([ScriptTransfer(ecxachxkapawix01preico, pIw, unit), ScriptTransfer(eM3xN08xN08pexprodxacAppxwvs, eIw, unit), ScriptTransfer(i.caller, uIb, yBitCO2), ScriptTransfer(txacxN08pe, sIb, yBitCO2), ScriptTransfer(N08pexprod, eIb, yBitCO2)]))
182182 }
183183 }
184184 }
Full:
OldNewDifferences
11 {-# STDLIB_VERSION 3 #-}
22 {-# SCRIPT_TYPE ACCOUNT #-}
33 {-# CONTENT_TYPE DAPP #-}
44 let yBitCO2 = base58'872MvpMoQx7SnV58HMcR9hd6vBWDtQvqmt5javCmYwpx'
55
66 let TokToVendedorQty = 10000
77
88 let NONE = "none"
99
1010 let OwnerPubKey = base58'8xCH82jKi2DM7HXXD45fmftPUDjr3TJpjanUATKMK37U'
1111
1212 let ecxachxkapawix01preico = Address(base58'3NAFcFPrj1wWrVMcsJMLvWBzmBt93oLh6w8')
1313
1414 let eM3xN08xN08pexprodxacAppxwvs = Address(base58'3MyAfquD1K4mvWJNDLVPRG4BWiAW3RQUpXG')
1515
1616 let txacxN08pe = Address(base58'3N9epiFphbL3Sf25xMASL1jAPxDH5D8vX85')
1717
1818 let N08pexprod = Address(base58'3N4c7DzgBcyVWTEv9N11vNpg4B1bfg5ryfJ')
1919
2020 let eurou = 116
2121
2222 let usdnw = 2539
2323
2424 let bco2e = 100000
2525
2626 let bitdscto = 3
2727
2828 let pIP = 10
2929
3030 let eIP = 1
3131
3232 let uBP = 7
3333
3434 let sBP = 2
3535
3636 let eBP = 2
3737
3838 let relacdcto = 11
3939
4040 func getNumberByKey (key) = {
4141 let num = match getInteger(this, key) {
4242 case a: Int =>
4343 a
4444 case _ =>
4545 0
4646 }
4747 num
4848 }
4949
5050
5151 func getStrByKey (key) = {
5252 let str = match getString(this, key) {
5353 case a: String =>
5454 a
5555 case _ =>
5656 NONE
5757 }
5858 str
5959 }
6060
6161
6262 func getKeyUserItemGtsCounter (user,item) = "Order_№:"
6363
6464
6565 func getValueUserItemGtsCounter (user,item) = getNumberByKey(getKeyUserItemGtsCounter(user, item))
6666
6767
6868 func getKeyprojectName (item) = "Proyecto de Apoyo | Inversión"
6969
7070
7171 func getValueprojectName (item) = getStrByKey(getKeyprojectName(item))
7272
7373
7474 func getKeyUserDocument (item) = "№ de Documento | DNI del Comprador:"
7575
7676
7777 func getValueUserDocument (item) = getStrByKey(getKeyUserDocument(item))
7878
7979
8080 func getKeyItemName (item) = "Producto-GTS adquirido | Categoría:"
8181
8282
8383 func getValueItemName (item) = getStrByKey(getKeyItemName(item))
8484
8585
8686 func getKeyTName (item) = "Tienda | Vendedor-GTS:"
8787
8888
8989 func getValueTName (item) = getStrByKey(getKeyTName(item))
9090
9191
9292 func getKeySupplier (item) = "Nodo-Activo Participante"
9393
9494
9595 func getKeyPI (item) = "PI, wvls:"
9696
9797
9898 func getValuePI (item) = getNumberByKey(getKeyPI(item))
9999
100100
101101 func getKeyNIw (item) = "NIw, wvls:"
102102
103103
104104 func getValueNIw (item) = getNumberByKey(getKeyNIw(item))
105105
106106
107107 func getKeyUI (item) = "UI, 10e-4 bit-co2:"
108108
109109
110110 func getValueUI (item) = getNumberByKey(getKeyUI(item))
111111
112112
113113 func getKeySI (item) = "SI, 10e-4 bit-co2:"
114114
115115
116116 func getValueSI (item) = getNumberByKey(getKeySI(item))
117117
118118
119119 func getKeyNIb (item) = "NIb, 10e-4 bit-co2:"
120120
121121
122122 func getValueNIb (item) = getNumberByKey(getKeyNIb(item))
123123
124124
125125 func getKeyBalanceToken (tienda) = "Tokens entregados desde Tienda1, 10e-4 bit-co2:"
126126
127127
128128 func getValueBalanceToken (tienda) = getNumberByKey(getKeyBalanceToken(tienda))
129129
130130
131131 func getKeyBalanceProyecto (proyecto) = "Fondos en Programa-03gts para F1 PreICO, wvls:"
132132
133133
134134 func getValueBalanceProyecto (proyecto) = getNumberByKey(getKeyBalanceProyecto(proyecto))
135135
136136
137137 @Callable(i)
138138 func purchaseGTS (totalAmount,userDocument,projectName,itemName,tName,item) = {
139139 let pmt = extract(i.payment)
140140 if (isDefined(pmt.assetId))
141141 then throw("El Precio en waves.")
142142 else {
143143 let supplier = match getString(this, getKeySupplier(item)) {
144144 case a: String =>
145145 a
146146 case _ =>
147147 NONE
148148 }
149149 let tienda = toBase58String(txacxN08pe.bytes)
150150 let saldoTienda1 = match getInteger(this, getKeyBalanceToken(tienda)) {
151151 case a: Int =>
152152 a
153153 case _ =>
154154 0
155155 }
156156 let proyecto = toBase58String(ecxachxkapawix01preico.bytes)
157157 let saldoProj = match getInteger(this, getKeyBalanceProyecto(proyecto)) {
158158 case a: Int =>
159159 a
160160 case _ =>
161161 0
162162 }
163163 let userAddress = toBase58String(i.caller.bytes)
164164 let subTotal = totalAmount
165165 let pIw = ((pIP * subTotal) / relacdcto)
166166 let eIw = ((eIP * subTotal) / relacdcto)
167167 let bco2menosdcto = (((100 - bitdscto) * (eurou * bco2e)) / 10000)
168168 let subTotalb = (((totalAmount * usdnw) / 100) / bco2menosdcto)
169169 let totalb = (subTotalb * 10000)
170170 let uIb = ((uBP * subTotalb) / relacdcto)
171171 let sIb = ((sBP * subTotalb) / relacdcto)
172172 let eIb = ((eBP * subTotalb) / relacdcto)
173173 if ((saldoTienda1 >= (TokToVendedorQty * 10000)))
174174 then throw("Lo sentimos, por ahora no hay oferta de tokens para su transacción")
175175 else {
176- let amountBCO2 = ((TokToVendedorQty * 10000) - saldoTienda1)
176+ let amountBCO2 = (TokToVendedorQty * 10000)
177177 if ((totalAmount > pmt.amount))
178178 then throw("Payment Amount can't be less than item Purchase Order")
179179 else if ((pmt.amount > totalAmount))
180180 then throw("Payment Amount can't be higher than item Purchase Order")
181- else ScriptResult(WriteSet([DataEntry(getKeyUserItemGtsCounter(userAddress, item), (getValueUserItemGtsCounter(userAddress, item) + 1)), DataEntry(getKeyUserDocument(item), userDocument), DataEntry(getKeyprojectName(item), projectName), DataEntry("Monto de apoyo ecológico, wvls", totalAmount), DataEntry(getKeyItemName(item), itemName), DataEntry(getKeyTName(item), tName), DataEntry(getKeySupplier(item), item), DataEntry("usdn", usdnw), DataEntry("eurou", eurou), DataEntry("Precio de 1 token con dscto, 10e-4 usd", bco2menosdcto), DataEntry("Total de tokens a distribuir, 10e-4 bit-co2", subTotalb), DataEntry(("Order_Status:_" + userAddress), "Transacción Confirmada!"), DataEntry(getKeyBalanceProyecto(proyecto), (getValueBalanceProyecto(proyecto) + pIw)), DataEntry(getKeyBalanceToken(tienda), (getValueBalanceToken(tienda) + subTotalb)), DataEntry("Saldo de tokens en oferta, 10e-04 bit-co2", (amountBCO2 - ((getValueBalanceToken(tienda) - saldoTienda1) + subTotalb)))]), TransferSet([ScriptTransfer(ecxachxkapawix01preico, pIw, unit), ScriptTransfer(eM3xN08xN08pexprodxacAppxwvs, eIw, unit), ScriptTransfer(i.caller, uIb, yBitCO2), ScriptTransfer(txacxN08pe, sIb, yBitCO2), ScriptTransfer(N08pexprod, eIb, yBitCO2)]))
181+ else ScriptResult(WriteSet([DataEntry(getKeyUserItemGtsCounter(userAddress, item), (getValueUserItemGtsCounter(userAddress, item) + 1)), DataEntry(getKeyUserDocument(item), userDocument), DataEntry(getKeyprojectName(item), projectName), DataEntry("Monto de apoyo ecológico, wvls", totalAmount), DataEntry(getKeyItemName(item), itemName), DataEntry(getKeyTName(item), tName), DataEntry(getKeySupplier(item), item), DataEntry("usdn", usdnw), DataEntry("eurou", eurou), DataEntry("Precio de 1 token con dscto, 10e-4 usd", bco2menosdcto), DataEntry("Total de tokens a distribuir, 10e-4 bit-co2", subTotalb), DataEntry(("Order_Status:_" + userAddress), "Transacción Confirmada!"), DataEntry(getKeyBalanceProyecto(proyecto), 0), DataEntry(getKeyBalanceToken(tienda), 0), DataEntry("Saldo BCO2 en oferta, 10e-04", amountBCO2)]), TransferSet([ScriptTransfer(ecxachxkapawix01preico, pIw, unit), ScriptTransfer(eM3xN08xN08pexprodxacAppxwvs, eIw, unit), ScriptTransfer(i.caller, uIb, yBitCO2), ScriptTransfer(txacxN08pe, sIb, yBitCO2), ScriptTransfer(N08pexprod, eIb, yBitCO2)]))
182182 }
183183 }
184184 }
185185
186186
187187 @Verifier(tx)
188188 func verify () = match tx {
189189 case t: SetScriptTransaction =>
190190 sigVerify(tx.bodyBytes, tx.proofs[0], OwnerPubKey)
191191 case d: ReissueTransaction|DataTransaction =>
192192 true
193193 case tx: TransferTransaction =>
194194 true
195195 case _ =>
196196 false
197197 }
198198

github/deemru/w8io/026f985 
55.51 ms