tx · 7Ktd1GMJqhJoTnvCqPv3mYm5Do93LmyExNG4U6vYBCF1 3NALbZy5kRMnNmHrP7WUsgWUf3tCX7vsbAs: -0.00600000 Waves 2022.07.17 11:48 [2143530] smart account 3NALbZy5kRMnNmHrP7WUsgWUf3tCX7vsbAs > SELF 0.00000000 Waves
{ "type": 13, "id": "7Ktd1GMJqhJoTnvCqPv3mYm5Do93LmyExNG4U6vYBCF1", "fee": 600000, "feeAssetId": null, "timestamp": 1658047699673, "version": 2, "chainId": 84, "sender": "3NALbZy5kRMnNmHrP7WUsgWUf3tCX7vsbAs", "senderPublicKey": "FCs6gVPFo4sbN8f7nW2gEm36jeUPWyYdt51xzCTY1Lgi", "proofs": [ "h9sVTNyvyuYJJtEYgTVGUYAqDZW6PXZNJSKfyhGjJJZqmCxkW4sJSnzMp3psSvTLuJ5rm1zWPKXUjDLCFRhm9xF" ], "script": "base64:AAIDAAAAAAAAAAsIARIHCgUICAgBAQAAACEAAAAAA1ZHVAEAAAAgAPs5y/R2CqiyWSxNldt26J/wx9NuUlms6dNVusQnAScAAAAADXN0YXJ0VG90YWxRdHkAAAAAAAAPQkAAAAAAA3d2cwAAAAAABfXhAAAAAAAETk9ORQIAAAAEbm9uZQAAAAAHbm9tdmd0dQAAAAAAAAAACgAAAAAFdXNkbncAAAAAAAAAAd4AAAAAC093bmVyUHViS2V5AQAAACDTDabcI8LzB9tWS9lEjmA4w1eYCLI6b207rRBMqkJEGwAAAAAKYWRtTjA4VkdUVwkBAAAAB0FkZHJlc3MAAAABAQAAABoBVMp5OFCu+8OtYaQx5WnOCz/kWDHG7i+bOQAAAAARYWRtTjA4c3lzVkdUUGFpc1cJAQAAAAdBZGRyZXNzAAAAAQEAAAAaAVQbjYxTyT8Q7+WwnaQm5Sj/Z1eJ0rcNywQBAAAADmdldE51bWJlckJ5S2V5AAAAAQAAAANrZXkEAAAAA251bQQAAAAHJG1hdGNoMAkABBoAAAACBQAAAAR0aGlzBQAAAANrZXkDCQAAAQAAA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AAAC1RyYW5zZmVyU2V0AAAAAQkABEwAAAACCQEAAAAOU2NyaXB0VHJhbnNmZXIAAAADCQEAAAAcQGV4dHJVc2VyKGFkZHJlc3NGcm9tU3RyaW5nKQAAAAEFAAAAC3VzZXJBZGRyZXNzBQAAAAhvcmRlclF0eQUAAAADVkdUCQAETAAAAAIJAQAAAA5TY3JpcHRUcmFuc2ZlcgAAAAMFAAAACmFkbU4wOFZHVFcJAABpAAAAAgkAAGgAAAACAAAAAAAAAABfCAUAAAADcG10AAAABmFtb3VudAAAAAAAAAAAZAUAAAAEdW5pdAkABEwAAAACCQEAAAAOU2NyaXB0VHJhbnNmZXIAAAADBQAAABFhZG1OMDhzeXNWR1RQYWlzVwkAAGkAAAACCQAAaAAAAAIAAAAAAAAAAAUIBQAAAANwbXQAAAAGYW1vdW50AAAAAAAAAABkBQAAAAR1bml0BQAAAANuaWwAAAABAAAAAnR4AQAAAAZ2ZXJpZnkAAAAABAAAAAckbWF0Y2gwBQAAAAJ0eAMJAAABAAAAAgUAAAAHJG1hdGNoMAIAAAAUU2V0U2NyaXB0VHJhbnNhY3Rpb24EAAAAAXQFAAAAByRtYXRjaDAJAAH0AAAAAwgFAAAAAnR4AAAACWJvZHlCeXRlcwkAAZEAAAACCAUAAAACdHgAAAAGcHJvb2ZzAAAAAAAAAAAABQAAAAtPd25lclB1YktleQMJAAABAAAAAgUAAAAHJG1hdGNoMAIAAAAPRGF0YVRyYW5zYWN0aW9uBAAAAAFkBQAAAAckbWF0Y2gwBgMJAAABAAAAAgUAAAAHJG1hdGNoMAIAAAATVHJhbnNmZXJUcmFuc2FjdGlvbgQAAAACdHgFAAAAByRtYXRjaDAGBx82IXo=", "height": 2143530, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: none Next: FV9d1YBDwV1JZd482PBtmStBhavETMCsGcYXRrzPxdig Full:
Old | New | Differences | |
---|---|---|---|
1 | - | # no script | |
1 | + | {-# STDLIB_VERSION 3 #-} | |
2 | + | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | + | {-# CONTENT_TYPE DAPP #-} | |
4 | + | let VGT = base58'14qBkVfMxkWyR4sjgXVfDanaemoCbhuwy9ptGtUt53Xc' | |
5 | + | ||
6 | + | let startTotalQty = 1000000 | |
7 | + | ||
8 | + | let wvs = 100000000 | |
9 | + | ||
10 | + | let NONE = "none" | |
11 | + | ||
12 | + | let nomvgtu = 10 | |
13 | + | ||
14 | + | let usdnw = 478 | |
15 | + | ||
16 | + | let OwnerPubKey = base58'FCs6gVPFo4sbN8f7nW2gEm36jeUPWyYdt51xzCTY1Lgi' | |
17 | + | ||
18 | + | let admN08VGTW = Address(base58'3N8NfVBXHM7yKRy92ghKc5MJYFuyFXhsDXn') | |
19 | + | ||
20 | + | let admN08sysVGTPaisW = Address(base58'3MrRmb3ANQy1o15LbHRNhiNHjYvXnoSLMCo') | |
21 | + | ||
22 | + | func getNumberByKey (key) = { | |
23 | + | let num = match getInteger(this, key) { | |
24 | + | case a: Int => | |
25 | + | a | |
26 | + | case _ => | |
27 | + | 0 | |
28 | + | } | |
29 | + | num | |
30 | + | } | |
31 | + | ||
32 | + | ||
33 | + | func getStrByKey (key) = { | |
34 | + | let str = match getString(this, key) { | |
35 | + | case a: String => | |
36 | + | a | |
37 | + | case _ => | |
38 | + | NONE | |
39 | + | } | |
40 | + | str | |
41 | + | } | |
42 | + | ||
43 | + | ||
44 | + | func getKeyEmisor (item) = "Emisor:" | |
45 | + | ||
46 | + | ||
47 | + | func getValueEmisor (item) = getStrByKey(getKeyEmisor(item)) | |
48 | + | ||
49 | + | ||
50 | + | func getKeyItemSupplier (supplier) = (supplier + "Nodo-08") | |
51 | + | ||
52 | + | ||
53 | + | func getKeyEmisionCountry (item) = "Nodo-País:" | |
54 | + | ||
55 | + | ||
56 | + | func getValueEmisionCountry (item) = getStrByKey(getKeyEmisionCountry(item)) | |
57 | + | ||
58 | + | ||
59 | + | func getKeyEmisionCode (item) = "Código:" | |
60 | + | ||
61 | + | ||
62 | + | func getValueEmisionCode (item) = getStrByKey(getKeyEmisionCode(item)) | |
63 | + | ||
64 | + | ||
65 | + | func getKeyNomTokenPrice (item) = "Precio Nominal, 1 VGT:" | |
66 | + | ||
67 | + | ||
68 | + | func getKeystartTotalQty (item) = "Cantidad de tokens emitidos:" | |
69 | + | ||
70 | + | ||
71 | + | func getValuestartTotalQty (item) = getStrByKey(getKeystartTotalQty(item)) | |
72 | + | ||
73 | + | ||
74 | + | func getKeyBalanceSupplier (supplier) = "Fondos | Monto recaudado:" | |
75 | + | ||
76 | + | ||
77 | + | func getValueBalanceSupplier (supplier) = getNumberByKey(getKeyBalanceSupplier(supplier)) | |
78 | + | ||
79 | + | ||
80 | + | func getKeyUserItemCounter (user,item) = "Order_№:" | |
81 | + | ||
82 | + | ||
83 | + | func getValueUserItemCounter (user,item) = getNumberByKey(getKeyUserItemCounter(user, item)) | |
84 | + | ||
85 | + | ||
86 | + | func getKeyUserDocument (item) = "Documento Nacional de Identidad, DNI:" | |
87 | + | ||
88 | + | ||
89 | + | func getValueUserDocument (item) = getStrByKey(getKeyUserDocument(item)) | |
90 | + | ||
91 | + | ||
92 | + | func getKeyUserCountry (item) = "País de Residencia del Usuario:" | |
93 | + | ||
94 | + | ||
95 | + | func getValueUserCountry (item) = getStrByKey(getKeyUserCountry(item)) | |
96 | + | ||
97 | + | ||
98 | + | func getKeyItemUserOrderQty (item) = "Cantidad de tokens adquiridos:" | |
99 | + | ||
100 | + | ||
101 | + | func getValueItemUserOrderQty (item) = getNumberByKey(getKeyItemUserOrderQty(item)) | |
102 | + | ||
103 | + | ||
104 | + | func getKeySaldoTokenQtyStartEtapa (item) = "Cantidad de tokens VGT realizados:" | |
105 | + | ||
106 | + | ||
107 | + | func getValueSaldoTokenQtyStartEtapa (item) = getNumberByKey(getKeySaldoTokenQtyStartEtapa(item)) | |
108 | + | ||
109 | + | ||
110 | + | @Callable(i) | |
111 | + | func purchaseVGT (item,userDocument,userCountry,orderQty,totalAmount) = { | |
112 | + | let pmt = extract(i.payment) | |
113 | + | if (isDefined(pmt.assetId)) | |
114 | + | then throw("Ud. puede adquirir tokens VGT usando WavesKeeper y su token de pago en 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("Payment Amount can't be less than item Purchase Order") | |
140 | + | else if ((pmt.amount > totalAmount)) | |
141 | + | then throw("Payment Amount can't be higher than item Purchase Order") | |
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("Suma transmitida a E2E/Nodo-08, 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. del Progr-VGT-01 en BlockChain:", "3NALbZy5kRMnNmHrP7WUsgWUf3tCX7vsbAs")]), TransferSet([ScriptTransfer(addressFromStringValue(userAddress), orderQty, VGT), ScriptTransfer(admN08VGTW, ((95 * pmt.amount) / 100), unit), ScriptTransfer(admN08sysVGTPaisW, ((5 * pmt.amount) / 100), unit)])) | |
143 | + | } | |
144 | + | } | |
145 | + | ||
146 | + | ||
147 | + | @Verifier(tx) | |
148 | + | func verify () = match tx { | |
149 | + | case t: SetScriptTransaction => | |
150 | + | sigVerify(tx.bodyBytes, tx.proofs[0], OwnerPubKey) | |
151 | + | case d: DataTransaction => | |
152 | + | true | |
153 | + | case tx: TransferTransaction => | |
154 | + | true | |
155 | + | case _ => | |
156 | + | false | |
157 | + | } | |
158 | + |
github/deemru/w8io/169f3d6 21.65 ms ◑