tx · AD5UWq5nKzAXeJPzYNrEthHKX1QXJqeakH2taHE5CY6h 3N9GKCsktAL7oPFmaKsgPBoDfu3ijk23Vmm: -0.01400000 Waves 2020.04.03 16:49 [938072] smart account 3N9GKCsktAL7oPFmaKsgPBoDfu3ijk23Vmm > SELF 0.00000000 Waves
{ "type": 13, "id": "AD5UWq5nKzAXeJPzYNrEthHKX1QXJqeakH2taHE5CY6h", "fee": 1400000, "feeAssetId": null, "timestamp": 1585918199132, "version": 1, "sender": "3N9GKCsktAL7oPFmaKsgPBoDfu3ijk23Vmm", "senderPublicKey": "BjzUYgMDny7cYArZdjtnVo62UoVZKiCEeCoKYFnevrWU", "proofs": [ "5kwrFTHBu5PAvMCDha3mp7m2ArC2WPYY1MGezPHpgXvWgFg3NkpSabgRL2ddTzhBnNvJ69CPBZdjaCoBVLUxeP5m" ], "script": "base64:AAIDAAAAAAAAABgIARIDCgEBEgkKBwgICAgBCAgSBAoCCAEAAAAtAAAAAAdhQml0Q08yAQAAACDH+HoAnTdQnyoybLskiHPdWM4Tg4veh8IaLSgbZ8EolgAAAAAIc3RhcnRRdHkAAAAAAAACSfAAAAAACG5vbVByaWNlAAAAAAAAAAABAAAAAAN3dnMAAAAAAAX14QAAAAAABE5PTkUCAAAABG5vbmUAAAAAC093bmVyUHViS2V5AQAAACCfmEAXldMf/BjZSW6/ZEf7k5r0z4tisH8Gw1nNGq2ESQAAAAAGaXNzdWVyCQEAAAAHQWRkcmVzcwAAAAEBAAAAGgFU1D3rjtmNadk6Svjh9eFrA7lQldo3DBRUAAAAAANpZ3YAAAAAAAAAABIAAAAAA2NQQgAAAAAABT7GAAAAAAADdUlQAAAAAAAAAAAFAAAAAANwSVAAAAAAAAAAAAoAAAAAA3NJUAAAAAAAAAAAAQAAAAADZUlQAAAAAAAAAAABAAAAAAJwQQkBAAAAB0FkZHJlc3MAAAABAQAAABoBVMr3Oz7nL9FV4g+t+EWzLN77jdANRWt9bwEAAAAOZ2V0TnVtYmVyQnlLZXk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gAAACBZb3UgY2FuJ3QgdHJhbnNmZXJyZWQgdGhpcyB0b2tlbgfKXPp0", "chainId": 84, "height": 938072, "spentComplexity": 0 } View: original | compacted Prev: EiuNdYiHDCqeJ2Nk1Tzg736wH54ByhDWPCzcsUnV9CLU Next: QNNEduriH5HPUxyGvEwxaJssa3KDC578ZCz4597CT7B Diff:
Old | New | Differences | |
---|---|---|---|
178 | 178 | } | |
179 | 179 | let userAddress = toBase58String(i.caller.bytes) | |
180 | 180 | let subTotal = (totalAmount - ((igv * totalAmount) / 100)) | |
181 | - | let uI = ((subTotal * uIP) / | |
181 | + | let uI = ((subTotal * uIP) / 100) | |
182 | 182 | let pI = ((subTotal * pIP) / 100) | |
183 | 183 | let eI = ((subTotal * eIP) / 100) | |
184 | - | let eBI = ((subTotal * eIP) / | |
184 | + | let eBI = ((subTotal * eIP) / 100) | |
185 | 185 | let sI = ((totalAmount - pIP) - eI) | |
186 | - | let sBI = ((subTotal * sIP) / | |
186 | + | let sBI = ((subTotal * sIP) / 100) | |
187 | 187 | if ((totalAmount > pmt.amount)) | |
188 | 188 | then throw("Payment Amount can't be less than item Purchase Order") | |
189 | 189 | else if ((pmt.amount > totalAmount)) |
Old | New | Differences | |
---|---|---|---|
1 | 1 | {-# STDLIB_VERSION 3 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | 4 | let aBitCO2 = base58'ETbtNp6MBuSM9EfjmLDwctrYEBBiq8CZ7ti7zbwTktry' | |
5 | 5 | ||
6 | 6 | let startQty = 150000 | |
7 | 7 | ||
8 | 8 | let nomPrice = 1 | |
9 | 9 | ||
10 | 10 | let wvs = 100000000 | |
11 | 11 | ||
12 | 12 | let NONE = "none" | |
13 | 13 | ||
14 | 14 | let OwnerPubKey = base58'BjzUYgMDny7cYArZdjtnVo62UoVZKiCEeCoKYFnevrWU' | |
15 | 15 | ||
16 | 16 | let issuer = Address(base58'3N9GKCsktAL7oPFmaKsgPBoDfu3ijk23Vmm') | |
17 | 17 | ||
18 | 18 | let igv = 18 | |
19 | 19 | ||
20 | 20 | let cPB = 88000000 | |
21 | 21 | ||
22 | 22 | let uIP = 5 | |
23 | 23 | ||
24 | 24 | let pIP = 10 | |
25 | 25 | ||
26 | 26 | let sIP = 1 | |
27 | 27 | ||
28 | 28 | let eIP = 1 | |
29 | 29 | ||
30 | 30 | let pA = Address(base58'3N8RGScPyKYySaXd5Z3VcpnttH2uBeMpSy4') | |
31 | 31 | ||
32 | 32 | func getNumberByKey (key) = { | |
33 | 33 | let num = match getInteger(this, key) { | |
34 | 34 | case a: Int => | |
35 | 35 | a | |
36 | 36 | case _ => | |
37 | 37 | 0 | |
38 | 38 | } | |
39 | 39 | num | |
40 | 40 | } | |
41 | 41 | ||
42 | 42 | ||
43 | 43 | func getStrByKey (key) = { | |
44 | 44 | let str = match getString(this, key) { | |
45 | 45 | case a: String => | |
46 | 46 | a | |
47 | 47 | case _ => | |
48 | 48 | NONE | |
49 | 49 | } | |
50 | 50 | str | |
51 | 51 | } | |
52 | 52 | ||
53 | 53 | ||
54 | 54 | func getKeyItem (supplier,title) = ("A y G:" + toBase58String(sha256(toBytes((supplier + title))))) | |
55 | 55 | ||
56 | 56 | ||
57 | 57 | func getKeyItemSupplier (item) = (item + "_P SAC") | |
58 | 58 | ||
59 | 59 | ||
60 | 60 | func getValueItemSupplier (item) = getStrByKey(getKeyItemSupplier(item)) | |
61 | 61 | ||
62 | 62 | ||
63 | 63 | func getKeyProject (pA) = (pA + "_A-PreICO") | |
64 | 64 | ||
65 | 65 | ||
66 | 66 | func getValueProject (pA) = getStrByKey(getKeyProject(pA)) | |
67 | 67 | ||
68 | 68 | ||
69 | 69 | func getKeyUserItemCounter (user,item) = "Order_№:" | |
70 | 70 | ||
71 | 71 | ||
72 | 72 | func getValueUserItemCounter (user,item) = getNumberByKey(getKeyUserItemCounter(user, item)) | |
73 | 73 | ||
74 | 74 | ||
75 | 75 | func getKeyItemUser (item) = "UserName:" | |
76 | 76 | ||
77 | 77 | ||
78 | 78 | func getValueItemUser (item) = getStrByKey(getKeyItemUser(item)) | |
79 | 79 | ||
80 | 80 | ||
81 | 81 | func getKeyUserCountry (item) = "UserPais:" | |
82 | 82 | ||
83 | 83 | ||
84 | 84 | func getValueUserCountry (item) = getStrByKey(getKeyUserCountry(item)) | |
85 | 85 | ||
86 | 86 | ||
87 | 87 | func getKeyItemUD (item) = "UD:" | |
88 | 88 | ||
89 | 89 | ||
90 | 90 | func getKeyBalanceSupplier (supplier) = "Seller_Balance,_aBitCO2" | |
91 | 91 | ||
92 | 92 | ||
93 | 93 | func getValueBalanceSupplier (supplier) = getNumberByKey(getKeyBalanceSupplier(supplier)) | |
94 | 94 | ||
95 | 95 | ||
96 | 96 | func getKeyUI (item) = "UI,_%:" | |
97 | 97 | ||
98 | 98 | ||
99 | 99 | func getValueUI (item) = getNumberByKey(getKeyUI(item)) | |
100 | 100 | ||
101 | 101 | ||
102 | 102 | func getKeyPI (item) = "PI,_%:" | |
103 | 103 | ||
104 | 104 | ||
105 | 105 | func getValuePI (item) = getNumberByKey(getKeyPI(item)) | |
106 | 106 | ||
107 | 107 | ||
108 | 108 | func getKeySI (item) = "SI,_%:" | |
109 | 109 | ||
110 | 110 | ||
111 | 111 | func getValueSI (item) = getNumberByKey(getKeySI(item)) | |
112 | 112 | ||
113 | 113 | ||
114 | 114 | func getKeyEI (eA) = "EI,_%:" | |
115 | 115 | ||
116 | 116 | ||
117 | 117 | func getValueEI (eA) = getNumberByKey(getKeyEI(eA)) | |
118 | 118 | ||
119 | 119 | ||
120 | 120 | func getKeyItemUserData (item) = "UserCountry:" | |
121 | 121 | ||
122 | 122 | ||
123 | 123 | func getKeyItemDiscountUser (item) = "UserDiscount, %:" | |
124 | 124 | ||
125 | 125 | ||
126 | 126 | func getValueItemDiscountUser (item) = getNumberByKey(getKeyItemDiscountUser(item)) | |
127 | 127 | ||
128 | 128 | ||
129 | 129 | func getKeyItemUserOrderQty (item) = "Order_qty,_tokens:" | |
130 | 130 | ||
131 | 131 | ||
132 | 132 | func getValueItemUserOrderQty (item) = getNumberByKey(getKeyItemUserOrderQty(item)) | |
133 | 133 | ||
134 | 134 | ||
135 | 135 | func getKeyBalanceQtySupplier (item) = "Balance/Saldo, tokens:" | |
136 | 136 | ||
137 | 137 | ||
138 | 138 | func getValueBalanceQtySupplier (item) = getNumberByKey(getKeyBalanceQtySupplier(item)) | |
139 | 139 | ||
140 | 140 | ||
141 | 141 | @Callable(i) | |
142 | 142 | func deposit (amount) = { | |
143 | 143 | let pmt = extract(i.payment) | |
144 | 144 | if ((pmt.assetId != aBitCO2)) | |
145 | 145 | then throw("Use cBitCO2 tokens only for the wallet deposit") | |
146 | 146 | else { | |
147 | 147 | let supplier = toBase58String(i.caller.bytes) | |
148 | 148 | let currentAmount = match getInteger(this, supplier) { | |
149 | 149 | case a: Int => | |
150 | 150 | a | |
151 | 151 | case _ => | |
152 | 152 | startQty | |
153 | 153 | } | |
154 | 154 | let newAmount = (currentAmount + pmt.amount) | |
155 | 155 | WriteSet([DataEntry(supplier, newAmount)]) | |
156 | 156 | } | |
157 | 157 | } | |
158 | 158 | ||
159 | 159 | ||
160 | 160 | ||
161 | 161 | @Callable(i) | |
162 | 162 | func purchaseGTS (item,userName,userCountry,uD,totalAmount,pA,eA) = { | |
163 | 163 | let pmt = extract(i.payment) | |
164 | 164 | if (isDefined(pmt.assetId)) | |
165 | 165 | then throw("you can adquire cBitCO2 only by Waves tokens") | |
166 | 166 | else { | |
167 | 167 | let supplier = match getString(this, getKeyItemSupplier(item)) { | |
168 | 168 | case a: String => | |
169 | 169 | a | |
170 | 170 | case _ => | |
171 | 171 | NONE | |
172 | 172 | } | |
173 | 173 | let balanceSupplier = match getInteger(this, getKeyBalanceSupplier(supplier)) { | |
174 | 174 | case a: Int => | |
175 | 175 | a | |
176 | 176 | case _ => | |
177 | 177 | 0 | |
178 | 178 | } | |
179 | 179 | let userAddress = toBase58String(i.caller.bytes) | |
180 | 180 | let subTotal = (totalAmount - ((igv * totalAmount) / 100)) | |
181 | - | let uI = ((subTotal * uIP) / | |
181 | + | let uI = ((subTotal * uIP) / 100) | |
182 | 182 | let pI = ((subTotal * pIP) / 100) | |
183 | 183 | let eI = ((subTotal * eIP) / 100) | |
184 | - | let eBI = ((subTotal * eIP) / | |
184 | + | let eBI = ((subTotal * eIP) / 100) | |
185 | 185 | let sI = ((totalAmount - pIP) - eI) | |
186 | - | let sBI = ((subTotal * sIP) / | |
186 | + | let sBI = ((subTotal * sIP) / 100) | |
187 | 187 | if ((totalAmount > pmt.amount)) | |
188 | 188 | then throw("Payment Amount can't be less than item Purchase Order") | |
189 | 189 | else if ((pmt.amount > totalAmount)) | |
190 | 190 | then throw("Payment Amount can't be higher than item Purchase Order") | |
191 | 191 | else ScriptResult(WriteSet([DataEntry(getKeyUserItemCounter(userAddress, item), (getValueUserItemCounter(userAddress, item) + 1)), DataEntry(getKeyItemUser(item), userName), DataEntry(getKeyUserCountry(item), userCountry), DataEntry(getKeyItemUD(item), uD), DataEntry("Payment_amount,_wvs", totalAmount), DataEntry("Imp, %", igv), DataEntry("STtl, wvs", subTotal), DataEntry("CP 1 B, wvs", cPB), DataEntry(getKeyUI(item), uI), DataEntry(getKeyPI(item), pI), DataEntry(getKeySI(item), sI), DataEntry(getKeyEI(eA), eI), DataEntry("EcSys", eBI), DataEntry(("Order_Status:_" + userAddress), "confirmed"), DataEntry(getKeyBalanceSupplier(supplier), (balanceSupplier + pmt.amount))]), TransferSet(nil)) | |
192 | 192 | } | |
193 | 193 | } | |
194 | 194 | ||
195 | 195 | ||
196 | 196 | ||
197 | 197 | @Callable(i) | |
198 | 198 | func withdraw (item,amount) = { | |
199 | 199 | let userAddress = toBase58String(i.caller.bytes) | |
200 | 200 | let supplier = match getString(this, getKeyItemSupplier(item)) { | |
201 | 201 | case a: String => | |
202 | 202 | a | |
203 | 203 | case _ => | |
204 | 204 | NONE | |
205 | 205 | } | |
206 | 206 | let preIcoQty = match getInteger(this, getKeyBalanceQtySupplier(item)) { | |
207 | 207 | case a: Int => | |
208 | 208 | a | |
209 | 209 | case _ => | |
210 | 210 | startQty | |
211 | 211 | } | |
212 | 212 | let newAmount = (preIcoQty - amount) | |
213 | 213 | if ((0 > amount)) | |
214 | 214 | then throw("Can't withdraw negative amount") | |
215 | 215 | else if ((0 > newAmount)) | |
216 | 216 | then throw("Not enought /suficiente balance") | |
217 | 217 | else ScriptResult(WriteSet([DataEntry(item, newAmount)]), TransferSet([ScriptTransfer(i.caller, amount, aBitCO2)])) | |
218 | 218 | } | |
219 | 219 | ||
220 | 220 | ||
221 | 221 | @Verifier(tx) | |
222 | 222 | func verify () = match tx { | |
223 | 223 | case t: SetScriptTransaction => | |
224 | 224 | sigVerify(tx.bodyBytes, tx.proofs[0], OwnerPubKey) | |
225 | 225 | case d: DataTransaction => | |
226 | 226 | true | |
227 | 227 | case tx: TransferTransaction => | |
228 | 228 | let recipient = toBase58String(addressFromRecipient(tx.recipient).bytes) | |
229 | 229 | if ((tx.sender == issuer)) | |
230 | 230 | then true | |
231 | 231 | else throw("You can't transferred this token") | |
232 | 232 | case _ => | |
233 | 233 | false | |
234 | 234 | } | |
235 | 235 |
github/deemru/w8io/169f3d6 67.35 ms ◑