tx · CvbEKPABuvZ6ARxhi2SkzVXjkgkhT2nJmVsdauMkjoKS

3N8RGScPyKYySaXd5Z3VcpnttH2uBeMpSy4:  -0.01400000 Waves

2020.03.09 23:35 [902081] smart account 3N8RGScPyKYySaXd5Z3VcpnttH2uBeMpSy4 > SELF 0.00000000 Waves

{ "type": 13, "id": "CvbEKPABuvZ6ARxhi2SkzVXjkgkhT2nJmVsdauMkjoKS", "fee": 1400000, "feeAssetId": null, "timestamp": 1583786106356, "version": 1, "sender": "3N8RGScPyKYySaXd5Z3VcpnttH2uBeMpSy4", "senderPublicKey": "4AHsCbS9QYVdKNvxrPWwsMwwy3KqXaCMXeAscExJZk9L", "proofs": [ "2FFgRVvw2xtxdjv5MtJ5BfAwTmitamPVbCLW4jYFWcvAHQdmGJFGKm2hD4BVQYVyCA6Tw8QZC5EcZnKrdhk9rdwo" ], "script": "base64:AAIDAAAAAAAAAA8IARIECgIICBIFCgMICAgAAAAlAAAAAAdjQml0Q08yAQAAACDH+HoAnTdQnyoybLskiHPdWM4Tg4veh8IaLSgbZ8EolgAAAAAIc3RhcnRRdHkAAAAAAAAFFAAAAAAACG5vbVByaWNlAAAAAAAF9eEAAAAAABZkaXNjb3VudFByZUljb1N1cHBsaWVyAAAAAAAAAAAMAAAAAA5Pd25lckVjb1B1YktleQEAAAAgLvRbo0AJGg7wNzBbRHjrN75s0YuvS2DdwCQ0/xY2QB8AAAAAA3d2cwAAAAAABfXhAAAAAAAETk9ORQIAAAAEbm9uZQAAAAAGaXNzdWVyCQEAAAAHQWRkcmVzcwAAAAEBAAAAGgFUyvc7Pucv0VXiD634RbMs3vuN0A1Fa31vAQAAAA5nZXROdW1iZXJCeUtleQAAAAEAAAADa2V5BAAAAANudW0EAAAAByRtYXRjaDAJAAQaAAAAAgUAAAAEdGhpcwUAAAADa2V5AwkAAAEAAAACBQAAAAckbWF0Y2gwAgAAAANJbnQEAAAAAWEFAAAAByRtYXRjaDAFAAAAAWEAAAAAAAAAAAAFAAAAA251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DACAAAAD0RhdGFUcmFuc2FjdGlvbgQAAAABZAUAAAAHJG1hdGNoMAYDCQAAAQAAAAIFAAAAByRtYXRjaDACAAAAE1RyYW5zZmVyVHJhbnNhY3Rpb24EAAAAAnR4BQAAAAckbWF0Y2gwBgMJAAABAAAAAgUAAAAHJG1hdGNoMAIAAAATRXhjaGFuZ2VUcmFuc2FjdGlvbgQAAAACdHgFAAAAByRtYXRjaDAEAAAACXdpdGhXYXZlcwMJAQAAAAEhAAAAAQkBAAAACWlzRGVmaW5lZAAAAAEICAgFAAAAAnR4AAAACXNlbGxPcmRlcgAAAAlhc3NldFBhaXIAAAAKcHJpY2VBc3NldAYJAQAAAAEhAAAAAQkBAAAACWlzRGVmaW5lZAAAAAEICAgFAAAAAnR4AAAACXNlbGxPcmRlcgAAAAlhc3NldFBhaXIAAAALYW1vdW50QXNzZXQFAAAACXdpdGhXYXZlcwMJAAABAAAAAgUAAAAHJG1hdGNoMAIAAAAXSW52b2tlU2NyaXB0VHJhbnNhY3Rpb24EAAAAAWMFAAAAByRtYXRjaDAGB6G66ZU=", "chainId": 84, "height": 902081, "spentComplexity": 0 } View: original | compacted Prev: GdXBXJ7JdwKA6jiox4223Ps1qfrETUShSJnVdtonZy2h Next: A6n8FZhX6R7VnnYBs9wawuQSpSs232CSumHTbMuZomyx Full:
OldNewDifferences
11 {-# STDLIB_VERSION 3 #-}
22 {-# SCRIPT_TYPE ACCOUNT #-}
33 {-# CONTENT_TYPE DAPP #-}
44 let cBitCO2 = base58'ETbtNp6MBuSM9EfjmLDwctrYEBBiq8CZ7ti7zbwTktry'
55
66 let startQty = 332800
77
88 let nomPrice = 100000000
99
1010 let discountPreIcoSupplier = 12
1111
1212 let OwnerEcoPubKey = base58'4AHsCbS9QYVdKNvxrPWwsMwwy3KqXaCMXeAscExJZk9L'
1313
1414 let wvs = 100000000
1515
1616 let NONE = "none"
1717
1818 let issuer = Address(base58'3N8RGScPyKYySaXd5Z3VcpnttH2uBeMpSy4')
1919
2020 func getNumberByKey (key) = {
2121 let num = match getInteger(this, key) {
2222 case a: Int =>
2323 a
2424 case _ =>
2525 0
2626 }
2727 num
2828 }
2929
3030
3131 func getStrByKey (key) = {
3232 let str = match getString(this, key) {
3333 case a: String =>
3434 a
3535 case _ =>
3636 NONE
3737 }
3838 str
3939 }
4040
4141
4242 func getKeyItem (supplier,title) = ("BitCO2:_" + toBase58String(sha256(toBytes((supplier + title)))))
4343
4444
4545 func getKeyItemSupplier (item) = (item + "_Amaz")
4646
4747
4848 func getValueItemSupplier (item) = getStrByKey(getKeyItemSupplier(item))
4949
5050
5151 func getKeyItemQty (item) = (item + "_tok.amount")
5252
5353
5454 func getValueItemQty (item) = getNumberByKey(getKeyItemQty(item))
5555
5656
5757 func getKeyBalanceQtySupplier (item) = (item + "_tokens")
5858
5959
6060 func getValueBalanceQtySupplier (item) = getNumberByKey(getKeyBalanceQtySupplier(item))
6161
6262
6363 func getKeyItemData (item) = (item + "_description")
6464
6565
6666 func getKeyUserItemCounter (user,item) = (((item + "_") + user) + "_cnt")
6767
6868
6969 func getValueUserItemCounter (user,item) = getNumberByKey(getKeyUserItemCounter(user, item))
7070
7171
7272 func getKeyItemUserData (item) = (item + "_userdata")
7373
7474
7575 func getKeyBalanceUser (item) = (item + "_saldwvsuser")
7676
7777
7878 func getValueBalanceUser (item) = getNumberByKey(getKeyBalanceUser(item))
7979
8080
8181 func getKeyPaymentUser (item) = (item + "_user.pmt")
8282
8383
8484 func getValuePaymentUser (item) = getNumberByKey(getKeyPaymentUser(item))
8585
8686
8787 func getKeyBalanceQtyUser (item) = (item + "_saldqty")
8888
8989
9090 func getValueBalanceQtyUser (item) = getNumberByKey(getKeyBalanceQtyUser(item))
9191
9292
9393 func getKeyItemUserOrderQty (item) = (item + "_qty")
9494
9595
9696 func getValueItemUserOrderQty (item) = getNumberByKey(getKeyItemUserOrderQty(item))
9797
9898
9999 func getKeyBalanceSupplier (account) = (account + "_balance")
100100
101101
102102 func getValueBalanceSupplier (account) = getNumberByKey(getKeyBalanceSupplier(account))
103103
104104
105105 func getKeyItemUser (item) = (("name:_" + item) + "_")
106106
107107
108108 func getValueItemUser (item) = getStrByKey(getKeyItemUser(item))
109109
110110
111111 func getKeyItemDiscountSupplier (item) = (("disc:_" + item) + "_")
112112
113113
114114 func getValueItemDiscountSupplier (item) = getNumberByKey(getKeyItemDiscountSupplier(item))
115115
116116
117117 func getKeyItemPriceSupplier (item) = (("Nom:_" + item) + "_")
118118
119119
120120 func getValueItemPriceSupplier (item) = getNumberByKey(getKeyItemPriceSupplier(item))
121121
122122
123123 @Callable(i)
124124 func AddSupplierToken (title,supplierData) = {
125125 let supplier = toBase58String(i.caller.bytes)
126126 let item = getKeyItem(supplier, title)
127127 let preIcoQty = match getInteger(this, supplier) {
128128 case a: Int =>
129129 a
130130 case _ =>
131131 startQty
132132 }
133133 if ((0 >= preIcoQty))
134134 then throw("Sorry, insufficient token offer")
135135 else WriteSet([DataEntry(getKeyItemSupplier(item), supplier), DataEntry(getKeyBalanceQtySupplier(item), preIcoQty), DataEntry(("Precio_Nominal_de_1 token_cBitCO2:_" + getKeyItemPriceSupplier(item)), nomPrice), DataEntry(getKeyItemDiscountSupplier(item), discountPreIcoSupplier), DataEntry(getKeyItemData(item), supplierData)])
136136 }
137137
138138
139139
140140 @Callable(i)
141141 func PurchaseToken (item,projectName,userData) = {
142142 let pmt = extract(i.payment)
143143 if (isDefined(pmt.assetId))
144144 then throw("you can adquire cBitCO2 only by Waves tokens")
145145 else {
146146 let account = getValueItemSupplier(item)
147147 let currentQty = getValueBalanceQtySupplier(item)
148148 let userAddress = toBase58String(i.caller.bytes)
149149 let buyerTokenPrice = ((nomPrice * (100 - discountPreIcoSupplier)) / 100)
150150 let orderAmount = (pmt.amount / buyerTokenPrice)
151151 let newQty = (currentQty - orderAmount)
152152 let totalAmount = (orderAmount * buyerTokenPrice)
153153 if ((totalAmount > pmt.amount))
154154 then throw("Payment Amount cannot be less than item Purchase Order")
155155 else if ((pmt.amount > totalAmount))
156156 then throw("Payment Amount can't be higher than item Purchase Order")
157157 else ScriptResult(WriteSet([DataEntry(getKeyUserItemCounter(userAddress, item), (getValueUserItemCounter(userAddress, item) + 1)), DataEntry(getKeyItemSupplier(item), projectName), DataEntry(getKeyItemUserData(item), userData), DataEntry("Cantidad_de_tokens_a_comprar:_", orderAmount), DataEntry(("Investment_Amount,_waves_" + getKeyPaymentUser(item)), totalAmount), DataEntry(("Pago_en__waves_del_Inversor" + getKeyBalanceUser(item)), pmt.amount), DataEntry((("Request_Status:_" + userAddress) + "_"), "sold"), DataEntry((("User_Balance:_" + getKeyBalanceQtyUser(item)) + "_"), orderAmount), DataEntry(("Saldo_tokens_del_Proyecto" + getKeyBalanceQtySupplier(item)), newQty), DataEntry(("Saldo_waves_del_vendedor" + getKeyBalanceSupplier(account)), (getValueBalanceSupplier(account) + pmt.amount))]), TransferSet(nil))
158158 }
159159 }
160160
161161
162162 @Verifier(tx)
163163 func verify () = match tx {
164164 case t: SetScriptTransaction =>
165165 sigVerify(tx.bodyBytes, tx.proofs[0], OwnerEcoPubKey)
166166 case d: DataTransaction =>
167167 true
168168 case tx: TransferTransaction =>
169169 true
170170 case tx: ExchangeTransaction =>
171171 let withWaves = if (!(isDefined(tx.sellOrder.assetPair.priceAsset)))
172172 then true
173173 else !(isDefined(tx.sellOrder.assetPair.amountAsset))
174174 withWaves
175175 case c: InvokeScriptTransaction =>
176176 true
177177 case _ =>
178178 false
179179 }
180180

github/deemru/w8io/026f985 
58.08 ms