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