tx · GY1d3fNpDDQpDPH6wfFoGwHj9uvXXbbXKQUxkzZi5sGX 3N2Z6EjzrzaCpD8ypDYLWDKe2PPVU8y9dJs: -0.01400000 Waves 2019.08.28 00:13 [650129] smart account 3N2Z6EjzrzaCpD8ypDYLWDKe2PPVU8y9dJs > SELF 0.00000000 Waves
{ "type": 13, "id": "GY1d3fNpDDQpDPH6wfFoGwHj9uvXXbbXKQUxkzZi5sGX", "fee": 1400000, "feeAssetId": null, "timestamp": 1566940472872, "version": 1, "sender": "3N2Z6EjzrzaCpD8ypDYLWDKe2PPVU8y9dJs", "senderPublicKey": "HSTmdhPrJF81ozDBaqVn8QVtV76oD7gzDfcHPQRdxdwW", "proofs": [ "2etvVF72EdnaWN1BSDabcjMAg3yXg9n1r7SGUQGAPoWLbmAMaMr1ZoYnhaC9pMsp1azcqV2cgDYSwJzjTXMJCt1P" ], "script": "base64:AAIDAAAAAAAAAAAAAAAQAAAAAAdXQVZFTEVUCQAAaAAAAAIJAABoAAAAAgAAAAAAAAAAZAAAAAAAAAAD6AAAAAAAAAAD6AAAAAAKQ09NTUlTU0lPTgkAAGkAAAACCQAAaAAAAAIAAAAAAAAAAAUFAAAAB1dBVkVMRVQAAAAAAAAAA+gAAAAAClRva2VuUHJpY2UAAAAAAAAAAAoAAAAAEERPTkFURUNPVU5URVJLRVkCAAAACyRET05BVEVfTlVNAAAAAAdCVVlJVEVNAgAAAAkkQlVZX0lURU0AAAAABEJhZzEJAABoAAAAAgAAAAAAAAAAAQUAAAAHV0FWRUxFVAAAAAAEQmFnNQkAAGgAAAACAAAAAAAAAAAFBQAAAAdXQVZFTEVUAAAAAAVCYWcxMAkAAGgAAAACAAAAAAAAAAAKBQAAAAdXQVZFTEVUAAAAAAVCYWcyMAkAAGgAAAACAAAAAAAAAAAUBQAAAAdXQVZFTEVUAAAAAAVCYWc1MAkAAGgAAAACAAAAAAAAAAAyBQAAAAdXQVZFTEVUAAAAAAZCYWcxMDAJAABoAAAAAgAAAAAAAAA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ZXQAAAABBQAAAApkb25hdGVEYXRhCQAAAgAAAAECAAAAGVlvdSBwYWlkIHRoZSB3cm9uZyBhbW91bnQAAAABAAAAAnR4AQAAAAZ2ZXJpZnkAAAAAAwkAAfQAAAADCAUAAAACdHgAAAAJYm9keUJ5dGVzCQABkQAAAAIIBQAAAAJ0eAAAAAZwcm9vZnMAAAAAAAAAAAAIBQAAAAJ0eAAAAA9zZW5kZXJQdWJsaWNLZXkEAAAAByRtYXRjaDAFAAAAAnR4AwkAAAEAAAACBQAAAAckbWF0Y2gwAgAAABNUcmFuc2ZlclRyYW5zYWN0aW9uBAAAAAN0dHgFAAAAByRtYXRjaDAGAwkAAAEAAAACBQAAAAckbWF0Y2gwAgAAABRTZXRTY3JpcHRUcmFuc2FjdGlvbgQAAAADc3R4BQAAAAckbWF0Y2gwBgcHkSncpw==", "chainId": 84, "height": 650129, "spentComplexity": 0 } View: original | compacted Prev: 32kGkj89KUW4ci8NGuHUXTBrGhMScP865vLDZBkySyhT Next: GN8tJPmxbWbXtCRvcWaE56yjth8Czs26jZPd9K6X5FHb Diff:
Old | New | Differences | |
---|---|---|---|
23 | 23 | ||
24 | 24 | let Bag100 = (100 * WAVELET) | |
25 | 25 | ||
26 | + | let itemMax = 20 | |
27 | + | ||
28 | + | let prices = [1, 3, 5, 6, 2, 2, 4, 9, 10, 12, 5, 1, 9, 12, 5, 4, 1, 11, 12, 9] | |
29 | + | ||
26 | 30 | func IncrementDonateNum () = { | |
27 | 31 | let gameNum = match getInteger(this, DONATECOUNTERKEY) { | |
28 | 32 | case num: Int => | |
45 | 49 | } | |
46 | 50 | ||
47 | 51 | ||
48 | - | func ExtractItemsList (key) = { | |
49 | - | let rawDataStr = match getString(this, key) { | |
50 | - | case str: String => | |
51 | - | str | |
52 | - | case _ => | |
53 | - | "" | |
54 | - | } | |
55 | - | rawDataStr | |
56 | - | } | |
57 | - | ||
58 | - | ||
59 | - | func getPriceByItemID (itemId) = if ((itemId == "1")) | |
60 | - | then 1 | |
61 | - | else if ((itemId == "2")) | |
62 | - | then 4 | |
63 | - | else if ((itemId == "3")) | |
64 | - | then 6 | |
65 | - | else throw("Неверный ID item") | |
66 | - | ||
67 | - | ||
68 | 52 | func isItemExist (oldItemsList,itemId) = { | |
69 | 53 | let rawDataStr = match indexOf(oldItemsList, (itemId + ":")) { | |
70 | 54 | case int: Int => | |
77 | 61 | ||
78 | 62 | ||
79 | 63 | @Callable(i) | |
80 | - | func | |
64 | + | func buyItem (itemId) = { | |
81 | 65 | let buyTXId = toBase58String(i.transactionId) | |
82 | 66 | let playerAddress = toString(i.caller) | |
83 | - | let key2Items = (playerAddress + "_items") | |
84 | - | let balanceMinus = getPriceByItemID(itemId) | |
85 | - | let NewBalance = (getBalance((playerAddress + "_balance")) - balanceMinus) | |
86 | - | let newBalanceData = DataEntry((playerAddress + "_balance"), NewBalance) | |
87 | - | let oldItemsList = ExtractItemsList(key2Items) | |
88 | - | let searchResult = isItemExist(oldItemsList, itemId) | |
89 | - | if ((searchResult == "undefined")) | |
90 | - | then throw("This item not exist") | |
91 | - | else throw((("Новый список айтемов: " + itemId) + ":2")) | |
67 | + | if (if ((itemId > 0)) | |
68 | + | then (itemMax >= itemId) | |
69 | + | else false) | |
70 | + | then { | |
71 | + | let balanceMinus = prices[itemId] | |
72 | + | let NewBalance = (getBalance((playerAddress + "_balance")) - balanceMinus) | |
73 | + | let newBalanceData = DataEntry((playerAddress + "_balance"), NewBalance) | |
74 | + | let keyToItem = ((playerAddress + "_itemID_") + toString(itemId)) | |
75 | + | WriteSet([DataEntry(keyToItem, 1), DataEntry(((BUYITEM + "_") + buyTXId), itemId), newBalanceData]) | |
76 | + | } | |
77 | + | else throw("Item has not found") | |
92 | 78 | } | |
93 | 79 | ||
94 | 80 |
Old | New | Differences | |
---|---|---|---|
1 | 1 | {-# STDLIB_VERSION 3 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | 4 | let WAVELET = ((100 * 1000) * 1000) | |
5 | 5 | ||
6 | 6 | let COMMISSION = ((5 * WAVELET) / 1000) | |
7 | 7 | ||
8 | 8 | let TokenPrice = 10 | |
9 | 9 | ||
10 | 10 | let DONATECOUNTERKEY = "$DONATE_NUM" | |
11 | 11 | ||
12 | 12 | let BUYITEM = "$BUY_ITEM" | |
13 | 13 | ||
14 | 14 | let Bag1 = (1 * WAVELET) | |
15 | 15 | ||
16 | 16 | let Bag5 = (5 * WAVELET) | |
17 | 17 | ||
18 | 18 | let Bag10 = (10 * WAVELET) | |
19 | 19 | ||
20 | 20 | let Bag20 = (20 * WAVELET) | |
21 | 21 | ||
22 | 22 | let Bag50 = (50 * WAVELET) | |
23 | 23 | ||
24 | 24 | let Bag100 = (100 * WAVELET) | |
25 | 25 | ||
26 | + | let itemMax = 20 | |
27 | + | ||
28 | + | let prices = [1, 3, 5, 6, 2, 2, 4, 9, 10, 12, 5, 1, 9, 12, 5, 4, 1, 11, 12, 9] | |
29 | + | ||
26 | 30 | func IncrementDonateNum () = { | |
27 | 31 | let gameNum = match getInteger(this, DONATECOUNTERKEY) { | |
28 | 32 | case num: Int => | |
29 | 33 | num | |
30 | 34 | case _ => | |
31 | 35 | 0 | |
32 | 36 | } | |
33 | 37 | (gameNum + 1) | |
34 | 38 | } | |
35 | 39 | ||
36 | 40 | ||
37 | 41 | func getBalance (key) = { | |
38 | 42 | let playerBalanceNum = match getInteger(this, key) { | |
39 | 43 | case playerBalanceNum: Int => | |
40 | 44 | playerBalanceNum | |
41 | 45 | case _ => | |
42 | 46 | 0 | |
43 | 47 | } | |
44 | 48 | playerBalanceNum | |
45 | 49 | } | |
46 | 50 | ||
47 | 51 | ||
48 | - | func ExtractItemsList (key) = { | |
49 | - | let rawDataStr = match getString(this, key) { | |
50 | - | case str: String => | |
51 | - | str | |
52 | - | case _ => | |
53 | - | "" | |
54 | - | } | |
55 | - | rawDataStr | |
56 | - | } | |
57 | - | ||
58 | - | ||
59 | - | func getPriceByItemID (itemId) = if ((itemId == "1")) | |
60 | - | then 1 | |
61 | - | else if ((itemId == "2")) | |
62 | - | then 4 | |
63 | - | else if ((itemId == "3")) | |
64 | - | then 6 | |
65 | - | else throw("Неверный ID item") | |
66 | - | ||
67 | - | ||
68 | 52 | func isItemExist (oldItemsList,itemId) = { | |
69 | 53 | let rawDataStr = match indexOf(oldItemsList, (itemId + ":")) { | |
70 | 54 | case int: Int => | |
71 | 55 | toString(int) | |
72 | 56 | case _ => | |
73 | 57 | "undefined" | |
74 | 58 | } | |
75 | 59 | rawDataStr | |
76 | 60 | } | |
77 | 61 | ||
78 | 62 | ||
79 | 63 | @Callable(i) | |
80 | - | func | |
64 | + | func buyItem (itemId) = { | |
81 | 65 | let buyTXId = toBase58String(i.transactionId) | |
82 | 66 | let playerAddress = toString(i.caller) | |
83 | - | let key2Items = (playerAddress + "_items") | |
84 | - | let balanceMinus = getPriceByItemID(itemId) | |
85 | - | let NewBalance = (getBalance((playerAddress + "_balance")) - balanceMinus) | |
86 | - | let newBalanceData = DataEntry((playerAddress + "_balance"), NewBalance) | |
87 | - | let oldItemsList = ExtractItemsList(key2Items) | |
88 | - | let searchResult = isItemExist(oldItemsList, itemId) | |
89 | - | if ((searchResult == "undefined")) | |
90 | - | then throw("This item not exist") | |
91 | - | else throw((("Новый список айтемов: " + itemId) + ":2")) | |
67 | + | if (if ((itemId > 0)) | |
68 | + | then (itemMax >= itemId) | |
69 | + | else false) | |
70 | + | then { | |
71 | + | let balanceMinus = prices[itemId] | |
72 | + | let NewBalance = (getBalance((playerAddress + "_balance")) - balanceMinus) | |
73 | + | let newBalanceData = DataEntry((playerAddress + "_balance"), NewBalance) | |
74 | + | let keyToItem = ((playerAddress + "_itemID_") + toString(itemId)) | |
75 | + | WriteSet([DataEntry(keyToItem, 1), DataEntry(((BUYITEM + "_") + buyTXId), itemId), newBalanceData]) | |
76 | + | } | |
77 | + | else throw("Item has not found") | |
92 | 78 | } | |
93 | 79 | ||
94 | 80 | ||
95 | 81 | ||
96 | 82 | @Callable(i) | |
97 | 83 | func reset () = { | |
98 | 84 | let playerAddress = toString(i.caller) | |
99 | 85 | let donateData = [DataEntry(DONATECOUNTERKEY, 0), DataEntry((playerAddress + "_balance"), 0)] | |
100 | 86 | WriteSet(donateData) | |
101 | 87 | } | |
102 | 88 | ||
103 | 89 | ||
104 | 90 | ||
105 | 91 | @Callable(i) | |
106 | 92 | func donate () = { | |
107 | 93 | let newGameNum = IncrementDonateNum() | |
108 | 94 | let donateId = toBase58String(i.transactionId) | |
109 | 95 | let pmt = extract(i.payment) | |
110 | 96 | let playerAddress = toString(i.caller) | |
111 | 97 | let betNotInWaves = isDefined(pmt.assetId) | |
112 | 98 | let feeNotInWaves = isDefined(pmt.assetId) | |
113 | 99 | let donateAmt = pmt.amount | |
114 | 100 | if (betNotInWaves) | |
115 | 101 | then throw("Bet amount must be in Waves") | |
116 | 102 | else if (feeNotInWaves) | |
117 | 103 | then throw("Transaction's fee must be in Waves") | |
118 | 104 | else { | |
119 | 105 | let donateAmtValid = if (if (if (if (if (if ((donateAmt == (Bag1 + COMMISSION))) | |
120 | 106 | then true | |
121 | 107 | else (donateAmt == (Bag5 + COMMISSION))) | |
122 | 108 | then true | |
123 | 109 | else (donateAmt == (Bag10 + COMMISSION))) | |
124 | 110 | then true | |
125 | 111 | else (donateAmt == (Bag20 + COMMISSION))) | |
126 | 112 | then true | |
127 | 113 | else (donateAmt == (Bag50 + COMMISSION))) | |
128 | 114 | then true | |
129 | 115 | else (donateAmt == (Bag100 + COMMISSION))) | |
130 | 116 | then true | |
131 | 117 | else false | |
132 | 118 | if (donateAmtValid) | |
133 | 119 | then { | |
134 | 120 | let donateNum = ((donateAmt - COMMISSION) / WAVELET) | |
135 | 121 | let key2Balance = (playerAddress + "_balance") | |
136 | 122 | let newBalance = (getBalance(key2Balance) + (donateNum * TokenPrice)) | |
137 | 123 | let donateData = [DataEntry(DONATECOUNTERKEY, newGameNum), DataEntry(key2Balance, newBalance), DataEntry(donateId, donateNum)] | |
138 | 124 | WriteSet(donateData) | |
139 | 125 | } | |
140 | 126 | else throw("You paid the wrong amount") | |
141 | 127 | } | |
142 | 128 | } | |
143 | 129 | ||
144 | 130 | ||
145 | 131 | @Verifier(tx) | |
146 | 132 | func verify () = if (sigVerify(tx.bodyBytes, tx.proofs[0], tx.senderPublicKey)) | |
147 | 133 | then match tx { | |
148 | 134 | case ttx: TransferTransaction => | |
149 | 135 | true | |
150 | 136 | case stx: SetScriptTransaction => | |
151 | 137 | true | |
152 | 138 | case _ => | |
153 | 139 | false | |
154 | 140 | } | |
155 | 141 | else false | |
156 | 142 |
github/deemru/w8io/026f985 27.12 ms ◑