tx · 32kGkj89KUW4ci8NGuHUXTBrGhMScP865vLDZBkySyhT

3N2Z6EjzrzaCpD8ypDYLWDKe2PPVU8y9dJs:  -0.01400000 Waves

2019.08.27 23:35 [650086] smart account 3N2Z6EjzrzaCpD8ypDYLWDKe2PPVU8y9dJs > SELF 0.00000000 Waves

{ "type": 13, "id": "32kGkj89KUW4ci8NGuHUXTBrGhMScP865vLDZBkySyhT", "fee": 1400000, "feeAssetId": null, "timestamp": 1566938242847, "version": 1, "sender": "3N2Z6EjzrzaCpD8ypDYLWDKe2PPVU8y9dJs", "senderPublicKey": "HSTmdhPrJF81ozDBaqVn8QVtV76oD7gzDfcHPQRdxdwW", "proofs": [ "4Wkz3XbdKLqUngXpEZCE41n6LtCyyPhsyMbu8p5YNwKD6kJrpRkJQv3PZkaDqJJjCWA5j748jmPWrcsrdgp6PcFK" ], "script": "base64:AAIDAAAAAAAAAAAAAAAQAAAAAAdXQVZFTEVUCQAAaAAAAAIJAABoAAAAAgAAAAAAAAAAZAAAAAAAAAAD6AAAAAAAAAAD6AAAAAAKQ09NTUlTU0lPTgkAAGkAAAACCQAAaAAAAAIAAAAAAAAAAAUFAAAAB1dBVkVMRVQAAAAAAAAAA+gAAAAAClRva2VuUHJpY2UAAAAAAAAAAAoAAAAAEERPTkFURUNPVU5URVJLRVkCAAAACyRET05BVEVfTlVNAAAAAAdCVVlJVEVNAgAAAAkkQlVZX0lURU0AAAAABEJhZzEJAABoAAAAAgAAAAAAAAAAAQUAAAAHV0FWRUxFVAAAAAAEQmFnNQkAAGgAAAACAAAAAAAAAAAFBQAAAAdXQVZFTEVUAAAAAAVCYWcxMAkAAGgAAAACAAAAAAAAAAAKBQAAAAdXQVZFTEVUAAAAAAVCYWcyMAkAAGgAAAACAAAAAAAAAAAUBQAAAAdXQVZFTEVUAAAAAAVCYWc1MAkAAGgAAAACAAAAAAAAAAAyBQAAAAdXQVZFTEVUAAAAAAZCYWcxMDAJAABoAAAAAgAAAAAAAAAAZAUAAAAHV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AAAnR4AQAAAAZ2ZXJpZnkAAAAAAwkAAfQAAAADCAUAAAACdHgAAAAJYm9keUJ5dGVzCQABkQAAAAIIBQAAAAJ0eAAAAAZwcm9vZnMAAAAAAAAAAAAIBQAAAAJ0eAAAAA9zZW5kZXJQdWJsaWNLZXkEAAAAByRtYXRjaDAFAAAAAnR4AwkAAAEAAAACBQAAAAckbWF0Y2gwAgAAABNUcmFuc2ZlclRyYW5zYWN0aW9uBAAAAAN0dHgFAAAAByRtYXRjaDAGAwkAAAEAAAACBQAAAAckbWF0Y2gwAgAAABRTZXRTY3JpcHRUcmFuc2FjdGlvbgQAAAADc3R4BQAAAAckbWF0Y2gwBgcHR5ju1A==", "chainId": 84, "height": 650086, "spentComplexity": 0 } View: original | compacted Prev: 4qmcCnWVMZvQTufm9pyJ9wWEfX87qxT3TYMtsNQWSAMN Next: GY1d3fNpDDQpDPH6wfFoGwHj9uvXXbbXKQUxkzZi5sGX Diff:
OldNewDifferences
7070 case int: Int =>
7171 toString(int)
7272 case _ =>
73- "not found"
73+ "undefined"
7474 }
7575 rawDataStr
7676 }
8686 let newBalanceData = DataEntry((playerAddress + "_balance"), NewBalance)
8787 let oldItemsList = ExtractItemsList(key2Items)
8888 let searchResult = isItemExist(oldItemsList, itemId)
89- if ((searchResult == ""))
89+ if ((searchResult == "undefined"))
9090 then throw("This item not exist")
91- else throw(searchResult)
91+ else throw((("Новый список айтемов: " + itemId) + ":2"))
9292 }
9393
9494
Full:
OldNewDifferences
11 {-# STDLIB_VERSION 3 #-}
22 {-# SCRIPT_TYPE ACCOUNT #-}
33 {-# CONTENT_TYPE DAPP #-}
44 let WAVELET = ((100 * 1000) * 1000)
55
66 let COMMISSION = ((5 * WAVELET) / 1000)
77
88 let TokenPrice = 10
99
1010 let DONATECOUNTERKEY = "$DONATE_NUM"
1111
1212 let BUYITEM = "$BUY_ITEM"
1313
1414 let Bag1 = (1 * WAVELET)
1515
1616 let Bag5 = (5 * WAVELET)
1717
1818 let Bag10 = (10 * WAVELET)
1919
2020 let Bag20 = (20 * WAVELET)
2121
2222 let Bag50 = (50 * WAVELET)
2323
2424 let Bag100 = (100 * WAVELET)
2525
2626 func IncrementDonateNum () = {
2727 let gameNum = match getInteger(this, DONATECOUNTERKEY) {
2828 case num: Int =>
2929 num
3030 case _ =>
3131 0
3232 }
3333 (gameNum + 1)
3434 }
3535
3636
3737 func getBalance (key) = {
3838 let playerBalanceNum = match getInteger(this, key) {
3939 case playerBalanceNum: Int =>
4040 playerBalanceNum
4141 case _ =>
4242 0
4343 }
4444 playerBalanceNum
4545 }
4646
4747
4848 func ExtractItemsList (key) = {
4949 let rawDataStr = match getString(this, key) {
5050 case str: String =>
5151 str
5252 case _ =>
5353 ""
5454 }
5555 rawDataStr
5656 }
5757
5858
5959 func getPriceByItemID (itemId) = if ((itemId == "1"))
6060 then 1
6161 else if ((itemId == "2"))
6262 then 4
6363 else if ((itemId == "3"))
6464 then 6
6565 else throw("Неверный ID item")
6666
6767
6868 func isItemExist (oldItemsList,itemId) = {
6969 let rawDataStr = match indexOf(oldItemsList, (itemId + ":")) {
7070 case int: Int =>
7171 toString(int)
7272 case _ =>
73- "not found"
73+ "undefined"
7474 }
7575 rawDataStr
7676 }
7777
7878
7979 @Callable(i)
8080 func buy (itemId) = {
8181 let buyTXId = toBase58String(i.transactionId)
8282 let playerAddress = toString(i.caller)
8383 let key2Items = (playerAddress + "_items")
8484 let balanceMinus = getPriceByItemID(itemId)
8585 let NewBalance = (getBalance((playerAddress + "_balance")) - balanceMinus)
8686 let newBalanceData = DataEntry((playerAddress + "_balance"), NewBalance)
8787 let oldItemsList = ExtractItemsList(key2Items)
8888 let searchResult = isItemExist(oldItemsList, itemId)
89- if ((searchResult == ""))
89+ if ((searchResult == "undefined"))
9090 then throw("This item not exist")
91- else throw(searchResult)
91+ else throw((("Новый список айтемов: " + itemId) + ":2"))
9292 }
9393
9494
9595
9696 @Callable(i)
9797 func reset () = {
9898 let playerAddress = toString(i.caller)
9999 let donateData = [DataEntry(DONATECOUNTERKEY, 0), DataEntry((playerAddress + "_balance"), 0)]
100100 WriteSet(donateData)
101101 }
102102
103103
104104
105105 @Callable(i)
106106 func donate () = {
107107 let newGameNum = IncrementDonateNum()
108108 let donateId = toBase58String(i.transactionId)
109109 let pmt = extract(i.payment)
110110 let playerAddress = toString(i.caller)
111111 let betNotInWaves = isDefined(pmt.assetId)
112112 let feeNotInWaves = isDefined(pmt.assetId)
113113 let donateAmt = pmt.amount
114114 if (betNotInWaves)
115115 then throw("Bet amount must be in Waves")
116116 else if (feeNotInWaves)
117117 then throw("Transaction's fee must be in Waves")
118118 else {
119119 let donateAmtValid = if (if (if (if (if (if ((donateAmt == (Bag1 + COMMISSION)))
120120 then true
121121 else (donateAmt == (Bag5 + COMMISSION)))
122122 then true
123123 else (donateAmt == (Bag10 + COMMISSION)))
124124 then true
125125 else (donateAmt == (Bag20 + COMMISSION)))
126126 then true
127127 else (donateAmt == (Bag50 + COMMISSION)))
128128 then true
129129 else (donateAmt == (Bag100 + COMMISSION)))
130130 then true
131131 else false
132132 if (donateAmtValid)
133133 then {
134134 let donateNum = ((donateAmt - COMMISSION) / WAVELET)
135135 let key2Balance = (playerAddress + "_balance")
136136 let newBalance = (getBalance(key2Balance) + (donateNum * TokenPrice))
137137 let donateData = [DataEntry(DONATECOUNTERKEY, newGameNum), DataEntry(key2Balance, newBalance), DataEntry(donateId, donateNum)]
138138 WriteSet(donateData)
139139 }
140140 else throw("You paid the wrong amount")
141141 }
142142 }
143143
144144
145145 @Verifier(tx)
146146 func verify () = if (sigVerify(tx.bodyBytes, tx.proofs[0], tx.senderPublicKey))
147147 then match tx {
148148 case ttx: TransferTransaction =>
149149 true
150150 case stx: SetScriptTransaction =>
151151 true
152152 case _ =>
153153 false
154154 }
155155 else false
156156

github/deemru/w8io/026f985 
32.70 ms