tx · Hg1REEvqGoUr5kM6CBimu5ALGxSF6Q2n6oJYSurCtdXE 3N6kziqYXDVeBZNh1kgivuNAyE3ZUbtTEUE: -0.00600000 Waves 2022.08.07 20:57 [2174376] smart account 3N6kziqYXDVeBZNh1kgivuNAyE3ZUbtTEUE > SELF 0.00000000 Waves
{ "type": 13, "id": "Hg1REEvqGoUr5kM6CBimu5ALGxSF6Q2n6oJYSurCtdXE", "fee": 600000, "feeAssetId": null, "timestamp": 1659895056352, "version": 2, "chainId": 84, "sender": "3N6kziqYXDVeBZNh1kgivuNAyE3ZUbtTEUE", "senderPublicKey": "8Ke8yBSwfTe96WE2kgmsub8kEh8Tagivfu2owUN5XtiH", "proofs": [ "4aBDJk4s5xeuSr32X3K1radEyAp7m73NQ5MF7DuPstkeHj2PSNm8nL7UPszZnxX1quCQF3h3QxodjVxdYDRxY5ti" ], "script": "base64:AAIFAAAAAAAAAAsIAhIHCgUICAgBAQAAACAAAAAAA1ZHVAEAAAAgAPs5y/R2CqiyWSxNldt26J/wx9NuUlms6dNVusQnAScAAAAADXN0YXJ0VG90YWxRdHkAAAAAAAABhqAAAAAAA3d2cwAAAAAABfXhAAAAAAAETk9ORQIAAAAEbm9uZQAAAAAHbm9tdmd0dQAAAAAAAAAACgAAAAAFdXNkbncAAAAAAAAAAkEAAAAACmFkbU4wOFZHVFcJAQAAAAdBZGRyZXNzAAAAAQEAAAAaAVTKeThQrvvDrWGkMeVpzgs/5Fgxxu4vmzkAAAAAEWFkbU4wOHN5c1ZHVFBhaXNXCQEAAAAHQWRkcmVzcwAAAAEBAAAAGgFUG42MU8k/EO/lsJ2kJuUo/2dXidK3DcsEAQAAAA5nZXROdW1iZXJCeUtleQAAAAEAAAADa2V5BAAAAANudW0EAAAAByRtYXRjaDAJAAQaAAAAAgUAAAAEdGhpcwUAAAADa2V5AwkAAAEAAAACBQAAAAckbWF0Y2gwAgAAAANJbnQEAAAAAWEFAAAAByRtYXRjaDAFAAAAAWEAAAAAAAAAAAAFA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dHJOYXRpdmUoMTA2MikAAAABBQAAAAt1c2VyQWRkcmVzcwkAAGgAAAACAAAAAAAAACcQBQAAAAhvcmRlclF0eQUAAAADVkdUCQAETAAAAAIJAQAAAA5TY3JpcHRUcmFuc2ZlcgAAAAMFAAAACmFkbU4wOFZHVFcJAABpAAAAAgkAAGgAAAACAAAAAAAAAABaCAUAAAADcG10AAAABmFtb3VudAAAAAAAAAAAZAUAAAAEdW5pdAkABEwAAAACCQEAAAAOU2NyaXB0VHJhbnNmZXIAAAADBQAAABFhZG1OMDhzeXNWR1RQYWlzVwkAAGkAAAACCQAAaAAAAAIAAAAAAAAAAAoIBQAAAANwbXQAAAAGYW1vdW50AAAAAAAAAABkBQAAAAR1bml0BQAAAANuaWwFAAAABHVuaXQAAAABAAAAAnR4AQAAAAZ2ZXJpZnkAAAAABAAAAAckbWF0Y2gwBQAAAAJ0eAMJAAABAAAAAgUAAAAHJG1hdGNoMAIAAAAUU2V0U2NyaXB0VHJhbnNhY3Rpb24EAAAAAXQFAAAAByRtYXRjaDAJAAH0AAAAAwgFAAAAAnR4AAAACWJvZHlCeXRlcwkAAZEAAAACCAUAAAACdHgAAAAGcHJvb2ZzAAAAAAAAAAAACQACWQAAAAECAAAALDhLZTh5QlN3ZlRlOTZXRTJrZ21zdWI4a0VoOFRhZ2l2ZnUyb3dVTjVYdGlIB5SJkCo=", "height": 2174376, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: none Next: 7JaNqCmAifDSnNHYbke8wmQQH2eiHX4eeokoRmbA2SpV Full:
Old | New | Differences | |
---|---|---|---|
1 | - | # no script | |
1 | + | {-# STDLIB_VERSION 5 #-} | |
2 | + | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | + | {-# CONTENT_TYPE DAPP #-} | |
4 | + | let VGT = base58'14qBkVfMxkWyR4sjgXVfDanaemoCbhuwy9ptGtUt53Xc' | |
5 | + | ||
6 | + | let startTotalQty = 100000 | |
7 | + | ||
8 | + | let wvs = 100000000 | |
9 | + | ||
10 | + | let NONE = "none" | |
11 | + | ||
12 | + | let nomvgtu = 10 | |
13 | + | ||
14 | + | let usdnw = 577 | |
15 | + | ||
16 | + | let admN08VGTW = Address(base58'3N8NfVBXHM7yKRy92ghKc5MJYFuyFXhsDXn') | |
17 | + | ||
18 | + | let admN08sysVGTPaisW = Address(base58'3MrRmb3ANQy1o15LbHRNhiNHjYvXnoSLMCo') | |
19 | + | ||
20 | + | func getNumberByKey (key) = { | |
21 | + | let num = match getInteger(this, key) { | |
22 | + | case a: Int => | |
23 | + | a | |
24 | + | case _ => | |
25 | + | 0 | |
26 | + | } | |
27 | + | num | |
28 | + | } | |
29 | + | ||
30 | + | ||
31 | + | func getStrByKey (key) = { | |
32 | + | let str = match getString(this, key) { | |
33 | + | case a: String => | |
34 | + | a | |
35 | + | case _ => | |
36 | + | NONE | |
37 | + | } | |
38 | + | str | |
39 | + | } | |
40 | + | ||
41 | + | ||
42 | + | func getKeyEmisor (item) = "Emisor " | |
43 | + | ||
44 | + | ||
45 | + | func getValueEmisor (item) = getStrByKey(getKeyEmisor(item)) | |
46 | + | ||
47 | + | ||
48 | + | func getKeyItemSupplier (supplier) = (supplier + "Nodo-08") | |
49 | + | ||
50 | + | ||
51 | + | func getKeyEmisionCountry (item) = "Nodo-País " | |
52 | + | ||
53 | + | ||
54 | + | func getValueEmisionCountry (item) = getStrByKey(getKeyEmisionCountry(item)) | |
55 | + | ||
56 | + | ||
57 | + | func getKeyEmisionCode (item) = "Código " | |
58 | + | ||
59 | + | ||
60 | + | func getValueEmisionCode (item) = getStrByKey(getKeyEmisionCode(item)) | |
61 | + | ||
62 | + | ||
63 | + | func getKeyNomTokenPrice (item) = "Precio Nominal, 1 VGT " | |
64 | + | ||
65 | + | ||
66 | + | func getKeystartTotalQty (item) = "Cantidad de tokens emitidos " | |
67 | + | ||
68 | + | ||
69 | + | func getValuestartTotalQty (item) = getStrByKey(getKeystartTotalQty(item)) | |
70 | + | ||
71 | + | ||
72 | + | func getKeyBalanceSupplier (supplier) = "Fondos | Monto recaudado, wvs " | |
73 | + | ||
74 | + | ||
75 | + | func getValueBalanceSupplier (supplier) = getNumberByKey(getKeyBalanceSupplier(supplier)) | |
76 | + | ||
77 | + | ||
78 | + | func getKeyUserItemCounter (user,item) = "Order_№ " | |
79 | + | ||
80 | + | ||
81 | + | func getValueUserItemCounter (user,item) = getNumberByKey(getKeyUserItemCounter(user, item)) | |
82 | + | ||
83 | + | ||
84 | + | func getKeyUserDocument (item) = "Documento Nacional de Identidad, DNI " | |
85 | + | ||
86 | + | ||
87 | + | func getValueUserDocument (item) = getStrByKey(getKeyUserDocument(item)) | |
88 | + | ||
89 | + | ||
90 | + | func getKeyUserCountry (item) = "País de Residencia del Usuario " | |
91 | + | ||
92 | + | ||
93 | + | func getValueUserCountry (item) = getStrByKey(getKeyUserCountry(item)) | |
94 | + | ||
95 | + | ||
96 | + | func getKeyItemUserOrderQty (item) = "Cantidad de tokens adquiridos " | |
97 | + | ||
98 | + | ||
99 | + | func getValueItemUserOrderQty (item) = getNumberByKey(getKeyItemUserOrderQty(item)) | |
100 | + | ||
101 | + | ||
102 | + | func getKeySaldoTokenQtyStartEtapa (item) = "Cantidad de tokens VGT realizados " | |
103 | + | ||
104 | + | ||
105 | + | func getValueSaldoTokenQtyStartEtapa (item) = getNumberByKey(getKeySaldoTokenQtyStartEtapa(item)) | |
106 | + | ||
107 | + | ||
108 | + | @Callable(i) | |
109 | + | func purchaseVGT (item,userDocument,userCountry,orderQty,totalAmount) = { | |
110 | + | let pmt = if ((size(i.payments) == 1)) | |
111 | + | then i.payments[0] | |
112 | + | else throw("Se requiere pago adjunto.") | |
113 | + | if (isDefined(pmt.assetId)) | |
114 | + | then throw("Ud. solo puede adquirir VGT usando WavesKeeper y su token de pago Waves.") | |
115 | + | else { | |
116 | + | let supplier = match getString(this, getKeyItemSupplier(item)) { | |
117 | + | case a: String => | |
118 | + | a | |
119 | + | case _ => | |
120 | + | NONE | |
121 | + | } | |
122 | + | let preIcoQty = match getInteger(this, getKeySaldoTokenQtyStartEtapa(item)) { | |
123 | + | case a: Int => | |
124 | + | a | |
125 | + | case _ => | |
126 | + | 0 | |
127 | + | } | |
128 | + | let balanceSupplier = match getInteger(this, getKeyBalanceSupplier(supplier)) { | |
129 | + | case a: Int => | |
130 | + | a | |
131 | + | case _ => | |
132 | + | 0 | |
133 | + | } | |
134 | + | let userAddress = toBase58String(i.caller.bytes) | |
135 | + | let currentTokenPrice = ((nomvgtu * wvs) / usdnw) | |
136 | + | if ((0 >= ((startTotalQty - preIcoQty) - orderQty))) | |
137 | + | then throw("Lo sentimos, por ahora no hay oferta de tokens para su transacción.") | |
138 | + | else if ((totalAmount > pmt.amount)) | |
139 | + | then throw("El monto del pago no puede ser inferior a la orden de compra del artículo.") | |
140 | + | else if ((pmt.amount > totalAmount)) | |
141 | + | then throw("El monto del pago no puede ser mayor que la orden de compra del artículo.") | |
142 | + | else $Tuple2([StringEntry(getKeyEmisor(item), "Ecosistema Bit-CO2"), StringEntry(getKeyEmisionCountry(item), "E2E | N08-PE"), StringEntry(getKeyEmisionCode(item), "N08PE-VGT-01"), StringEntry(getKeyNomTokenPrice(item), "10.00 USD"), IntegerEntry(getKeystartTotalQty(item), startTotalQty), IntegerEntry(getKeyUserItemCounter(userAddress, item), (getValueUserItemCounter(userAddress, item) + 1)), StringEntry(getKeyUserCountry(item), userCountry), StringEntry(getKeyUserDocument(item), userDocument), IntegerEntry(getKeyItemUserOrderQty(item), orderQty), IntegerEntry("Monto de Inversión | Participación, wvs", totalAmount), StringEntry("Estado de su pedido, tokens ", "¡Adquisición Confirmada!"), IntegerEntry(getKeySaldoTokenQtyStartEtapa(item), (getValueSaldoTokenQtyStartEtapa(item) + orderQty)), IntegerEntry("Saldo de Tokens VGT", ((startTotalQty - getValueSaldoTokenQtyStartEtapa(item)) - orderQty)), IntegerEntry(getKeyBalanceSupplier(supplier), (getValueBalanceSupplier(supplier) + pmt.amount)), ScriptTransfer(addressFromStringValue(userAddress), (10000 * orderQty), VGT), ScriptTransfer(admN08VGTW, ((90 * pmt.amount) / 100), unit), ScriptTransfer(admN08sysVGTPaisW, ((10 * pmt.amount) / 100), unit)], unit) | |
143 | + | } | |
144 | + | } | |
145 | + | ||
146 | + | ||
147 | + | @Verifier(tx) | |
148 | + | func verify () = match tx { | |
149 | + | case t: SetScriptTransaction => | |
150 | + | sigVerify(tx.bodyBytes, tx.proofs[0], fromBase58String("8Ke8yBSwfTe96WE2kgmsub8kEh8Tagivfu2owUN5XtiH")) | |
151 | + | case _ => | |
152 | + | false | |
153 | + | } | |
154 | + |
github/deemru/w8io/169f3d6 30.01 ms ◑