tx · 3mudBmfC2Gg7R1eLb5A1bHMnUj2nsF2MtKGJ9G31UExv

3MsQwxepm5q2BG1PYUMwqoD2JLgKrACa3P2:  -0.01400000 Waves

2020.04.03 23:55 [938501] smart account 3MsQwxepm5q2BG1PYUMwqoD2JLgKrACa3P2 > SELF 0.00000000 Waves

{ "type": 13, "id": "3mudBmfC2Gg7R1eLb5A1bHMnUj2nsF2MtKGJ9G31UExv", "fee": 1400000, "feeAssetId": null, "timestamp": 1585943716391, "version": 1, "sender": "3MsQwxepm5q2BG1PYUMwqoD2JLgKrACa3P2", "senderPublicKey": "GQpgNnxYTNNWmyiXVfx9rpMV1hgft2HPhJ3CkWeLuxAt", "proofs": [ "bEVwLa22RGKbvM8mjhJLtASSXw41EvKwCgtuvFGb8VzrabDieo8jwfA4jD9DYQUkEhcqowWhgpBaa5KSsLcpWRX" ], "script": "base64:AAIDAAAAAAAAABgIARIDCgEBEgkKBwgICAgBCAgSBAoCCAEAAAAtAAAAAAdiQml0Q08yAQAAACAkubz3kBYNSCNdNAZyd/QzZ1pU4dNNWTExj4jouAng0QAAAAAIc3RhcnRRdHkAAAAAAAADDUAAAAAACG5vbVByaWNlAAAAAAAAAAABAAAAAAN3dnMAAAAAAAX14QAAAAAABE5PTkUCAAAABG5vbmUAAAAAC093bmVyUHViS2V5AQAAACDk+ZK9KsQFHVZZW7IN9p8J1NIEPNOpQPwtCMeTNH1ZKQAAAAAGaXNzdWVyCQEAAAAHQWRkcmVzcwAAAAEBAAAAGgFUJl3qqTQTlNIF00aC5xcoGj4+wY7a0SD9AAAAAANpZ3YAAAAAAAAAABIAAAAAA2NQQgAAAAAABT7GAAAAAAADdUlQAAAAAAAAAAAFAAAAAANwSVAAAAAAAAAAAAoAAAAAA3NJUAAAAAAAAAAAAQAAAAADZUlQAAAAAAAAAAABAAAAAAJwQQkBAAAAB0FkZHJlc3MAAAABAQAAABoBVMr3Oz7nL9FV4g+t+EWzLN77jdANRWt9bwEAAAAOZ2V0TnVtYmVyQ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AAAAAQgJAAQkAAAAAQgFAAAAAnR4AAAACXJlY2lwaWVudAAAAAVieXRlcwMJAAAAAAAAAggFAAAAAnR4AAAABnNlbmRlcgUAAAAGaXNzdWVyBgkAAAIAAAABAgAAACBZb3UgY2FuJ3QgdHJhbnNmZXJyZWQgdGhpcyB0b2tlbgfU0DxW", "chainId": 84, "height": 938501, "spentComplexity": 0 } View: original | compacted Prev: Fq1kwXvtwcozRt3Whf9nQk5Tb6SAUNi7DZE8WRVwRDNC Next: BY7h43DzG1VyUaRwDXaP8qu5znM1xKWLXaQrYNDviHRL Diff:
OldNewDifferences
188188 then throw("Payment Amount can't be less than item Purchase Order")
189189 else if ((pmt.amount > totalAmount))
190190 then throw("Payment Amount can't be higher than item Purchase Order")
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("UBI", (uI / cPB)), DataEntry(getKeyPI(item), pI), DataEntry(getKeyEI(eA), eI), DataEntry("EcSys", (eBI / cPB)), DataEntry(("Order_Status:_" + userAddress), "confirmed"), DataEntry(getKeySI(item), sI), DataEntry("SBI: b", (sBI / cPB)), DataEntry(getKeyBalanceSupplier(supplier), (balanceSupplier + pmt.amount))]), TransferSet(nil))
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("UBI", uI), DataEntry(getKeyPI(item), pI), DataEntry(getKeyEI(eA), eI), DataEntry("EcSys", eBI), DataEntry(("Order_Status:_" + userAddress), "confirmed"), DataEntry(getKeySI(item), sI), DataEntry("SBI: b", sBI), DataEntry(getKeyBalanceSupplier(supplier), (balanceSupplier + pmt.amount))]), TransferSet(nil))
192192 }
193193 }
194194
Full:
OldNewDifferences
11 {-# STDLIB_VERSION 3 #-}
22 {-# SCRIPT_TYPE ACCOUNT #-}
33 {-# CONTENT_TYPE DAPP #-}
44 let bBitCO2 = base58'3UMwob2PDKVYmDMZZdT9ijK7EdRJZKFoBLCAXnwKtNN4'
55
66 let startQty = 200000
77
88 let nomPrice = 1
99
1010 let wvs = 100000000
1111
1212 let NONE = "none"
1313
1414 let OwnerPubKey = base58'GQpgNnxYTNNWmyiXVfx9rpMV1hgft2HPhJ3CkWeLuxAt'
1515
1616 let issuer = Address(base58'3MsQwxepm5q2BG1PYUMwqoD2JLgKrACa3P2')
1717
1818 let igv = 18
1919
2020 let cPB = 88000000
2121
2222 let uIP = 5
2323
2424 let pIP = 10
2525
2626 let sIP = 1
2727
2828 let eIP = 1
2929
3030 let pA = Address(base58'3N8RGScPyKYySaXd5Z3VcpnttH2uBeMpSy4')
3131
3232 func getNumberByKey (key) = {
3333 let num = match getInteger(this, key) {
3434 case a: Int =>
3535 a
3636 case _ =>
3737 0
3838 }
3939 num
4040 }
4141
4242
4343 func getStrByKey (key) = {
4444 let str = match getString(this, key) {
4545 case a: String =>
4646 a
4747 case _ =>
4848 NONE
4949 }
5050 str
5151 }
5252
5353
5454 func getKeyItem (supplier,title) = ("A y G:" + toBase58String(sha256(toBytes((supplier + title)))))
5555
5656
5757 func getKeyItemSupplier (item) = (item + "_P SAC")
5858
5959
6060 func getValueItemSupplier (item) = getStrByKey(getKeyItemSupplier(item))
6161
6262
6363 func getKeyProject (pA) = (pA + "_A-PreICO")
6464
6565
6666 func getValueProject (pA) = getStrByKey(getKeyProject(pA))
6767
6868
6969 func getKeyUserItemCounter (user,item) = "Order_№:"
7070
7171
7272 func getValueUserItemCounter (user,item) = getNumberByKey(getKeyUserItemCounter(user, item))
7373
7474
7575 func getKeyItemUser (item) = "UserName:"
7676
7777
7878 func getValueItemUser (item) = getStrByKey(getKeyItemUser(item))
7979
8080
8181 func getKeyUserCountry (item) = "UserPais:"
8282
8383
8484 func getValueUserCountry (item) = getStrByKey(getKeyUserCountry(item))
8585
8686
8787 func getKeyItemUD (item) = "UD:"
8888
8989
9090 func getKeyBalanceSupplier (supplier) = "Seller_Balance,_aBitCO2"
9191
9292
9393 func getValueBalanceSupplier (supplier) = getNumberByKey(getKeyBalanceSupplier(supplier))
9494
9595
9696 func getKeyUI (item) = "UI,_%:"
9797
9898
9999 func getValueUI (item) = getNumberByKey(getKeyUI(item))
100100
101101
102102 func getKeyPI (item) = "PI,_%:"
103103
104104
105105 func getValuePI (item) = getNumberByKey(getKeyPI(item))
106106
107107
108108 func getKeySI (item) = "SI,_%:"
109109
110110
111111 func getValueSI (item) = getNumberByKey(getKeySI(item))
112112
113113
114114 func getKeyEI (eA) = "EI,_%:"
115115
116116
117117 func getValueEI (eA) = getNumberByKey(getKeyEI(eA))
118118
119119
120120 func getKeyItemUserData (item) = "UserCountry:"
121121
122122
123123 func getKeyItemDiscountUser (item) = "UserDiscount, %:"
124124
125125
126126 func getValueItemDiscountUser (item) = getNumberByKey(getKeyItemDiscountUser(item))
127127
128128
129129 func getKeyItemUserOrderQty (item) = "Order_qty,_tokens:"
130130
131131
132132 func getValueItemUserOrderQty (item) = getNumberByKey(getKeyItemUserOrderQty(item))
133133
134134
135135 func getKeyBalanceQtySupplier (item) = "Balance/Saldo, tokens:"
136136
137137
138138 func getValueBalanceQtySupplier (item) = getNumberByKey(getKeyBalanceQtySupplier(item))
139139
140140
141141 @Callable(i)
142142 func deposit (amount) = {
143143 let pmt = extract(i.payment)
144144 if ((pmt.assetId != bBitCO2))
145145 then throw("Use bBitCO2 tokens only for the wallet deposit")
146146 else {
147147 let supplier = toBase58String(i.caller.bytes)
148148 let currentAmount = match getInteger(this, supplier) {
149149 case a: Int =>
150150 a
151151 case _ =>
152152 startQty
153153 }
154154 let newAmount = (currentAmount + pmt.amount)
155155 WriteSet([DataEntry(supplier, newAmount)])
156156 }
157157 }
158158
159159
160160
161161 @Callable(i)
162162 func purchaseGTS (item,userName,userCountry,uD,totalAmount,pA,eA) = {
163163 let pmt = extract(i.payment)
164164 if (isDefined(pmt.assetId))
165165 then throw("you can adquire Products only by Waves tokens")
166166 else {
167167 let supplier = match getString(this, getKeyItemSupplier(item)) {
168168 case a: String =>
169169 a
170170 case _ =>
171171 NONE
172172 }
173173 let balanceSupplier = match getInteger(this, getKeyBalanceSupplier(supplier)) {
174174 case a: Int =>
175175 a
176176 case _ =>
177177 0
178178 }
179179 let userAddress = toBase58String(i.caller.bytes)
180180 let subTotal = (totalAmount - ((igv * totalAmount) / 100))
181181 let uI = ((subTotal * uIP) / 100)
182182 let pI = ((subTotal * pIP) / 100)
183183 let eI = ((subTotal * eIP) / 100)
184184 let eBI = ((subTotal * eIP) / 100)
185185 let sI = ((totalAmount - pI) - eI)
186186 let sBI = ((subTotal * sIP) / 100)
187187 if ((totalAmount > pmt.amount))
188188 then throw("Payment Amount can't be less than item Purchase Order")
189189 else if ((pmt.amount > totalAmount))
190190 then throw("Payment Amount can't be higher than item Purchase Order")
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("UBI", (uI / cPB)), DataEntry(getKeyPI(item), pI), DataEntry(getKeyEI(eA), eI), DataEntry("EcSys", (eBI / cPB)), DataEntry(("Order_Status:_" + userAddress), "confirmed"), DataEntry(getKeySI(item), sI), DataEntry("SBI: b", (sBI / cPB)), DataEntry(getKeyBalanceSupplier(supplier), (balanceSupplier + pmt.amount))]), TransferSet(nil))
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("UBI", uI), DataEntry(getKeyPI(item), pI), DataEntry(getKeyEI(eA), eI), DataEntry("EcSys", eBI), DataEntry(("Order_Status:_" + userAddress), "confirmed"), DataEntry(getKeySI(item), sI), DataEntry("SBI: b", sBI), DataEntry(getKeyBalanceSupplier(supplier), (balanceSupplier + pmt.amount))]), TransferSet(nil))
192192 }
193193 }
194194
195195
196196
197197 @Callable(i)
198198 func withdraw (item,amount) = {
199199 let userAddress = toBase58String(i.caller.bytes)
200200 let supplier = match getString(this, getKeyItemSupplier(item)) {
201201 case a: String =>
202202 a
203203 case _ =>
204204 NONE
205205 }
206206 let preIcoQty = match getInteger(this, getKeyBalanceQtySupplier(item)) {
207207 case a: Int =>
208208 a
209209 case _ =>
210210 startQty
211211 }
212212 let newAmount = (preIcoQty - amount)
213213 if ((0 > amount))
214214 then throw("Can't withdraw negative amount")
215215 else if ((0 > newAmount))
216216 then throw("Not enought /insuficiente balance")
217217 else ScriptResult(WriteSet([DataEntry(item, newAmount)]), TransferSet([ScriptTransfer(i.caller, amount, bBitCO2)]))
218218 }
219219
220220
221221 @Verifier(tx)
222222 func verify () = match tx {
223223 case t: SetScriptTransaction =>
224224 sigVerify(tx.bodyBytes, tx.proofs[0], OwnerPubKey)
225225 case d: DataTransaction =>
226226 true
227227 case tx: TransferTransaction =>
228228 let recipient = toBase58String(addressFromRecipient(tx.recipient).bytes)
229229 if ((tx.sender == issuer))
230230 then true
231231 else throw("You can't transferred this token")
232232 case _ =>
233233 false
234234 }
235235

github/deemru/w8io/873ac7e 
33.14 ms