tx · 8GErbYVutPd2bEsD7Es37T4tz8Q7Pq1GRf6eNoRiR2YL

3NALbZy5kRMnNmHrP7WUsgWUf3tCX7vsbAs:  -0.00600000 Waves

2022.07.28 23:14 [2160145] smart account 3NALbZy5kRMnNmHrP7WUsgWUf3tCX7vsbAs > SELF 0.00000000 Waves

{ "type": 13, "id": "8GErbYVutPd2bEsD7Es37T4tz8Q7Pq1GRf6eNoRiR2YL", "fee": 600000, "feeAssetId": null, "timestamp": 1659039285505, "version": 2, "chainId": 84, "sender": "3NALbZy5kRMnNmHrP7WUsgWUf3tCX7vsbAs", "senderPublicKey": "FCs6gVPFo4sbN8f7nW2gEm36jeUPWyYdt51xzCTY1Lgi", "proofs": [ "57oUTavP3fUxwuwfCDcjddnw1odYn3YgXaySsk3wQQwSoaTUBV3iHVvbJpAGdmWxw4zD3MxKErwgPMYuZNMMotH7" ], "script": "base64:AAIDAAAAAAAAAAsIARIHCgUICAgBAQAAACEAAAAAA1ZHVAEAAAAgAPs5y/R2CqiyWSxNldt26J/wx9NuUlms6dNVusQnAScAAAAADXN0YXJ0VG90YWxRdHkAAAAAAAAPQkAAAAAAA3d2cwAAAAAABfXhAAAAAAAETk9ORQIAAAAEbm9uZQAAAAAHbm9tdmd0dQAAAAAAAAAACgAAAAAFdXNkbncAAAAAAAAAAd4AAAAAC093bmVyUHViS2V5AQAAACDTDabcI8LzB9tWS9lEjmA4w1eYCLI6b207rRBMqkJEGwAAAAAKYWRtTjA4VkdUVwkBAAAAB0FkZHJlc3MAAAABAQAAABoBVMp5OFCu+8OtYaQx5WnOCz/kWDHG7i+bOQAAAAARYWRtTjA4c3lzVkdUUGFpc1cJAQAAAAdBZGRyZXNzAAAAAQEAAAAaAVQbjYxTyT8Q7+WwnaQm5Sj/Z1eJ0rcNywQBAAAADmdldE51bWJlckJ5S2V5AAAAAQAAAANrZXkEAAAAA251bQQAAAAHJG1hdGNoMAkABBoAAAACBQAAAAR0aGlzBQAAAANrZXkDCQAAAQAAAAIFAA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ODZhOTFtclVxTHh0c1lwd3hjN2hnM3c1CQAETAAAAAIJAQAAAAlEYXRhRW50cnkAAAACAgAAACZDdGEuIFZHVCBBZG1pbiBkZWwgRTJFIE4wOCwgYmxvY2tjaGFpbgIAAAAjM1BSNUFnN2pQQkdwZnI3VVVVYWNCUlQ1VzVXZVBDOTFCTVcFAAAAA25pbAkBAAAAC1RyYW5zZmVyU2V0AAAAAQkABEwAAAACCQEAAAAOU2NyaXB0VHJhbnNmZXIAAAADCQEAAAAcQGV4dHJVc2VyKGFkZHJlc3NGcm9tU3RyaW5nKQAAAAEFAAAAC3VzZXJBZGRyZXNzCQAAaAAAAAIAAAAAAAAAAGQFAAAACG9yZGVyUXR5BQAAAANWR1QJAARMAAAAAgkBAAAADlNjcmlwdFRyYW5zZmVyAAAAAwUAAAAKYWRtTjA4VkdUVwkAAGkAAAACCQAAaAAAAAIAAAAAAAAAAF8IBQAAAANwbXQAAAAGYW1vdW50AAAAAAAAAABkBQAAAAR1bml0CQAETAAAAAIJAQAAAA5TY3JpcHRUcmFuc2ZlcgAAAAMFAAAAEWFkbU4wOHN5c1ZHVFBhaXNXCQAAaQAAAAIJAABoAAAAAgAAAAAAAAAABQgFAAAAA3BtdAAAAAZhbW91bnQAAAAAAAAAAGQFAAAABHVuaXQFAAAAA25pbAAAAAEAAAACdHgBAAAABnZlcmlmeQAAAAAEAAAAByRtYXRjaDAFAAAAAnR4AwkAAAEAAAACBQAAAAckbWF0Y2gwAgAAABRTZXRTY3JpcHRUcmFuc2FjdGlvbgQAAAABdAUAAAAHJG1hdGNoMAkAAfQAAAADCAUAAAACdHgAAAAJYm9keUJ5dGVzCQABkQAAAAIIBQAAAAJ0eAAAAAZwcm9vZnMAAAAAAAAAAAAFAAAAC093bmVyUHViS2V5B8nupUs=", "height": 2160145, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: 8yS4MxgrzC9oo39xkWNZihNLUpCSAK753D1bFjUzrxBP Next: CFvn7S7jCJRbhbw74AAp4Ent4udUGGQV5QHEr7YJLS2s Diff:
OldNewDifferences
139139 then throw("El monto del pago no puede ser menor que la orden de compra del artículo")
140140 else if ((pmt.amount > totalAmount))
141141 then throw("El monto del pago no puede ser mayor que la orden de compra del artículo")
142- else ScriptResult(WriteSet([DataEntry(getKeyEmisor(item), "Ecosistema Bit-CO2"), DataEntry(getKeyEmisionCountry(item), "E2E/N08PE"), DataEntry(getKeyEmisionCode(item), "E2E_N00-VGT-01"), DataEntry(getKeyNomTokenPrice(item), "10.00 USD"), DataEntry(getKeystartTotalQty(item), startTotalQty), DataEntry(getKeyUserItemCounter(userAddress, item), (getValueUserItemCounter(userAddress, item) + 1)), DataEntry(getKeyUserDocument(item), userDocument), DataEntry(getKeyUserCountry(item), userCountry), DataEntry(getKeyItemUserOrderQty(item), orderQty), DataEntry("Monto de Inversión | Participación, wvs", totalAmount), DataEntry("Estado de su pedido, tokens:", "¡Adquisición Confirmada!"), DataEntry(getKeySaldoTokenQtyStartEtapa(item), (getValueSaldoTokenQtyStartEtapa(item) + orderQty)), DataEntry("Saldo de Tokens VGT", ((startTotalQty - getValueSaldoTokenQtyStartEtapa(item)) - orderQty)), DataEntry(getKeyBalanceSupplier(supplier), (getValueBalanceSupplier(supplier) + pmt.amount)), DataEntry("Cta. VGT Admin del N08-PE, blockchain", "3PNRormQTw186a91mrUqLxtsYpwxc7hg3w5"), DataEntry("Cta. VGT Admin del E2E N08, blockchain", "3PR5Ag7jPBGpfr7UUUacBRT5W5WePC91BMW")]), TransferSet([ScriptTransfer(addressFromStringValue(userAddress), (100 * orderQty), VGT), ScriptTransfer(admN08VGTW, ((94 * pmt.amount) / 100), unit), ScriptTransfer(admN08sysVGTPaisW, ((5 * pmt.amount) / 100), unit)]))
142+ else ScriptResult(WriteSet([DataEntry(getKeyEmisor(item), "Ecosistema Bit-CO2"), DataEntry(getKeyEmisionCountry(item), "E2E/N08PE"), DataEntry(getKeyEmisionCode(item), "E2E_N00-VGT-01"), DataEntry(getKeyNomTokenPrice(item), "10.00 USD"), DataEntry(getKeystartTotalQty(item), startTotalQty), DataEntry(getKeyUserItemCounter(userAddress, item), (getValueUserItemCounter(userAddress, item) + 1)), DataEntry(getKeyUserDocument(item), userDocument), DataEntry(getKeyUserCountry(item), userCountry), DataEntry(getKeyItemUserOrderQty(item), orderQty), DataEntry("Monto de Inversión | Participación, wvs", totalAmount), DataEntry("Estado de su pedido, tokens:", "¡Adquisición Confirmada!"), DataEntry(getKeySaldoTokenQtyStartEtapa(item), (getValueSaldoTokenQtyStartEtapa(item) + orderQty)), DataEntry("Saldo de Tokens VGT", ((startTotalQty - getValueSaldoTokenQtyStartEtapa(item)) - orderQty)), DataEntry(getKeyBalanceSupplier(supplier), (getValueBalanceSupplier(supplier) + pmt.amount)), DataEntry("Cta. VGT Admin del N08-PE, blockchain", "3PNRormQTw186a91mrUqLxtsYpwxc7hg3w5"), DataEntry("Cta. VGT Admin del E2E N08, blockchain", "3PR5Ag7jPBGpfr7UUUacBRT5W5WePC91BMW")]), TransferSet([ScriptTransfer(addressFromStringValue(userAddress), (100 * orderQty), VGT), ScriptTransfer(admN08VGTW, ((95 * pmt.amount) / 100), unit), ScriptTransfer(admN08sysVGTPaisW, ((5 * pmt.amount) / 100), unit)]))
143143 }
144144 }
145145
Full:
OldNewDifferences
11 {-# STDLIB_VERSION 3 #-}
22 {-# SCRIPT_TYPE ACCOUNT #-}
33 {-# CONTENT_TYPE DAPP #-}
44 let VGT = base58'14qBkVfMxkWyR4sjgXVfDanaemoCbhuwy9ptGtUt53Xc'
55
66 let startTotalQty = 1000000
77
88 let wvs = 100000000
99
1010 let NONE = "none"
1111
1212 let nomvgtu = 10
1313
1414 let usdnw = 478
1515
1616 let OwnerPubKey = base58'FCs6gVPFo4sbN8f7nW2gEm36jeUPWyYdt51xzCTY1Lgi'
1717
1818 let admN08VGTW = Address(base58'3N8NfVBXHM7yKRy92ghKc5MJYFuyFXhsDXn')
1919
2020 let admN08sysVGTPaisW = Address(base58'3MrRmb3ANQy1o15LbHRNhiNHjYvXnoSLMCo')
2121
2222 func getNumberByKey (key) = {
2323 let num = match getInteger(this, key) {
2424 case a: Int =>
2525 a
2626 case _ =>
2727 0
2828 }
2929 num
3030 }
3131
3232
3333 func getStrByKey (key) = {
3434 let str = match getString(this, key) {
3535 case a: String =>
3636 a
3737 case _ =>
3838 NONE
3939 }
4040 str
4141 }
4242
4343
4444 func getKeyEmisor (item) = "Emisor:"
4545
4646
4747 func getValueEmisor (item) = getStrByKey(getKeyEmisor(item))
4848
4949
5050 func getKeyItemSupplier (supplier) = (supplier + "Nodo-08")
5151
5252
5353 func getKeyEmisionCountry (item) = "Nodo-País:"
5454
5555
5656 func getValueEmisionCountry (item) = getStrByKey(getKeyEmisionCountry(item))
5757
5858
5959 func getKeyEmisionCode (item) = "Código:"
6060
6161
6262 func getValueEmisionCode (item) = getStrByKey(getKeyEmisionCode(item))
6363
6464
6565 func getKeyNomTokenPrice (item) = "Precio Nominal, 1 VGT:"
6666
6767
6868 func getKeystartTotalQty (item) = "Cantidad de tokens emitidos:"
6969
7070
7171 func getValuestartTotalQty (item) = getStrByKey(getKeystartTotalQty(item))
7272
7373
7474 func getKeyBalanceSupplier (supplier) = "Fondos | Monto recaudado, wvs"
7575
7676
7777 func getValueBalanceSupplier (supplier) = getNumberByKey(getKeyBalanceSupplier(supplier))
7878
7979
8080 func getKeyUserItemCounter (user,item) = "Order_№:"
8181
8282
8383 func getValueUserItemCounter (user,item) = getNumberByKey(getKeyUserItemCounter(user, item))
8484
8585
8686 func getKeyUserDocument (item) = "Documento Nacional de Identidad, DNI:"
8787
8888
8989 func getValueUserDocument (item) = getStrByKey(getKeyUserDocument(item))
9090
9191
9292 func getKeyUserCountry (item) = "País de Residencia del Usuario:"
9393
9494
9595 func getValueUserCountry (item) = getStrByKey(getKeyUserCountry(item))
9696
9797
9898 func getKeyItemUserOrderQty (item) = "Cantidad de tokens adquiridos:"
9999
100100
101101 func getValueItemUserOrderQty (item) = getNumberByKey(getKeyItemUserOrderQty(item))
102102
103103
104104 func getKeySaldoTokenQtyStartEtapa (item) = "Cantidad de tokens VGT realizados:"
105105
106106
107107 func getValueSaldoTokenQtyStartEtapa (item) = getNumberByKey(getKeySaldoTokenQtyStartEtapa(item))
108108
109109
110110 @Callable(i)
111111 func purchaseVGT (item,userDocument,userCountry,orderQty,totalAmount) = {
112112 let pmt = extract(i.payment)
113113 if (isDefined(pmt.assetId))
114114 then throw("Ud. puede adquirir tokens VGT usando WavesKeeper y su token de pago en Waves.")
115115 else {
116116 let supplier = match getString(this, getKeyItemSupplier(item)) {
117117 case a: String =>
118118 a
119119 case _ =>
120120 NONE
121121 }
122122 let preIcoQty = match getInteger(this, getKeySaldoTokenQtyStartEtapa(item)) {
123123 case a: Int =>
124124 a
125125 case _ =>
126126 0
127127 }
128128 let balanceSupplier = match getInteger(this, getKeyBalanceSupplier(supplier)) {
129129 case a: Int =>
130130 a
131131 case _ =>
132132 0
133133 }
134134 let userAddress = toBase58String(i.caller.bytes)
135135 let currentTokenPrice = ((nomvgtu * wvs) / usdnw)
136136 if ((0 >= ((startTotalQty - preIcoQty) - orderQty)))
137137 then throw("Lo sentimos, por ahora no hay oferta de tokens para su transacción")
138138 else if ((totalAmount > pmt.amount))
139139 then throw("El monto del pago no puede ser menor que la orden de compra del artículo")
140140 else if ((pmt.amount > totalAmount))
141141 then throw("El monto del pago no puede ser mayor que la orden de compra del artículo")
142- else ScriptResult(WriteSet([DataEntry(getKeyEmisor(item), "Ecosistema Bit-CO2"), DataEntry(getKeyEmisionCountry(item), "E2E/N08PE"), DataEntry(getKeyEmisionCode(item), "E2E_N00-VGT-01"), DataEntry(getKeyNomTokenPrice(item), "10.00 USD"), DataEntry(getKeystartTotalQty(item), startTotalQty), DataEntry(getKeyUserItemCounter(userAddress, item), (getValueUserItemCounter(userAddress, item) + 1)), DataEntry(getKeyUserDocument(item), userDocument), DataEntry(getKeyUserCountry(item), userCountry), DataEntry(getKeyItemUserOrderQty(item), orderQty), DataEntry("Monto de Inversión | Participación, wvs", totalAmount), DataEntry("Estado de su pedido, tokens:", "¡Adquisición Confirmada!"), DataEntry(getKeySaldoTokenQtyStartEtapa(item), (getValueSaldoTokenQtyStartEtapa(item) + orderQty)), DataEntry("Saldo de Tokens VGT", ((startTotalQty - getValueSaldoTokenQtyStartEtapa(item)) - orderQty)), DataEntry(getKeyBalanceSupplier(supplier), (getValueBalanceSupplier(supplier) + pmt.amount)), DataEntry("Cta. VGT Admin del N08-PE, blockchain", "3PNRormQTw186a91mrUqLxtsYpwxc7hg3w5"), DataEntry("Cta. VGT Admin del E2E N08, blockchain", "3PR5Ag7jPBGpfr7UUUacBRT5W5WePC91BMW")]), TransferSet([ScriptTransfer(addressFromStringValue(userAddress), (100 * orderQty), VGT), ScriptTransfer(admN08VGTW, ((94 * pmt.amount) / 100), unit), ScriptTransfer(admN08sysVGTPaisW, ((5 * pmt.amount) / 100), unit)]))
142+ else ScriptResult(WriteSet([DataEntry(getKeyEmisor(item), "Ecosistema Bit-CO2"), DataEntry(getKeyEmisionCountry(item), "E2E/N08PE"), DataEntry(getKeyEmisionCode(item), "E2E_N00-VGT-01"), DataEntry(getKeyNomTokenPrice(item), "10.00 USD"), DataEntry(getKeystartTotalQty(item), startTotalQty), DataEntry(getKeyUserItemCounter(userAddress, item), (getValueUserItemCounter(userAddress, item) + 1)), DataEntry(getKeyUserDocument(item), userDocument), DataEntry(getKeyUserCountry(item), userCountry), DataEntry(getKeyItemUserOrderQty(item), orderQty), DataEntry("Monto de Inversión | Participación, wvs", totalAmount), DataEntry("Estado de su pedido, tokens:", "¡Adquisición Confirmada!"), DataEntry(getKeySaldoTokenQtyStartEtapa(item), (getValueSaldoTokenQtyStartEtapa(item) + orderQty)), DataEntry("Saldo de Tokens VGT", ((startTotalQty - getValueSaldoTokenQtyStartEtapa(item)) - orderQty)), DataEntry(getKeyBalanceSupplier(supplier), (getValueBalanceSupplier(supplier) + pmt.amount)), DataEntry("Cta. VGT Admin del N08-PE, blockchain", "3PNRormQTw186a91mrUqLxtsYpwxc7hg3w5"), DataEntry("Cta. VGT Admin del E2E N08, blockchain", "3PR5Ag7jPBGpfr7UUUacBRT5W5WePC91BMW")]), TransferSet([ScriptTransfer(addressFromStringValue(userAddress), (100 * orderQty), VGT), ScriptTransfer(admN08VGTW, ((95 * pmt.amount) / 100), unit), ScriptTransfer(admN08sysVGTPaisW, ((5 * pmt.amount) / 100), unit)]))
143143 }
144144 }
145145
146146
147147 @Verifier(tx)
148148 func verify () = match tx {
149149 case t: SetScriptTransaction =>
150150 sigVerify(tx.bodyBytes, tx.proofs[0], OwnerPubKey)
151151 case _ =>
152152 false
153153 }
154154

github/deemru/w8io/026f985 
43.75 ms