tx · C2hc99UQQvsSa1kNPUao8NaMtvoJwspCXEYGbq83Lr2v 3NAg879tKUJh949h21umkwiaRQhwZftz1BE: -0.05000000 Waves 2019.09.06 16:42 [664274] smart account 3NAg879tKUJh949h21umkwiaRQhwZftz1BE > SELF 0.00000000 Waves
{ "type": 13, "id": "C2hc99UQQvsSa1kNPUao8NaMtvoJwspCXEYGbq83Lr2v", "fee": 5000000, "feeAssetId": null, "timestamp": 1567777329604, "version": 1, "sender": "3NAg879tKUJh949h21umkwiaRQhwZftz1BE", "senderPublicKey": "BqY2jhkQCcbidtQdQZu6f9RV3AkFAS8VPToHxwYu1KdJ", "proofs": [ "2mrJmMMJjhRaHpxe7annhz9i2nWxV2CyRovzoJHzoGXBQjXtkdJ6AbzDn8SDttCD8S1bF9qs1T8GyFh1oFfpJjBB" ], "script": "base64:AAIDAAAAAAAAAAAAAAAdAAAAAAN3dnMAAAAAAAX14QAAAAAAGW5vdFN1cHBvcnRlZEN1cnJlbmN5RXJyb3ICAAAAGzxub3RTdXBwb3J0ZWRDdXJyZW5jeUVycm9yPgAAAAAXaXNzdWVyQWNjZXNzRGVuaWVkRXJyb3ICAAAAGTxpc3N1ZXJBY2Nlc3NEZW5pZWRFcnJvcj4AAAAAFW5vdEVub3VnaFBheW1lbnRFcnJvcgIAAAAXPG5vdEVub3VnaFBheW1lbnRFcnJvcj4AAAAAJHRpY2tlclZhbGlkYXRpb25Ob3RFbm91Z2hSYXRpbmdFcnJvcgIAAAAmPHRpY2tlclZhbGlkYXRpb25Ob3RFbm91Z2hSYXRpbmdFcnJvcj4AAAAAInRpY2tlclZhbGlkYXRpb25UaWNrZXJJc0V4aXN0RXJyb3ICAAAAJDx0aWNrZXJWYWxpZGF0aW9uVGlja2VySXNFeGlzdEVycm9yPgAAAAAgdGlja2VyVmFsaWRhdGlvbldyb25nRm9ybWF0RXJyb3ICAAAAIjx0aWNrZXJWYWxpZGF0aW9uV3JvbmdGb3JtYXRFcnJvcj4AAAAAFW5vbkV4a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AAAAIJAQAAAAlEYXRhRW50cnkAAAACBQAAABRpc3N1ZXJEZXNjcmlwdGlvbktleQUAAAALZGVzY3JpcHRpb24FAAAAA25pbAkAAAIAAAABBQAAABdpc3N1ZXJBY2Nlc3NEZW5pZWRFcnJvcgkAAAIAAAABBQAAABVub3RFbm91Z2hQYXltZW50RXJyb3IJAAACAAAAAQUAAAAZbm90U3VwcG9ydGVkQ3VycmVuY3lFcnJvcgAAAAFpAQAAAAp1cGRhdGVMaW5rAAAAAgAAAAdhc3NldElkAAAABGxpbmsEAAAADWlzc3VlckxpbmtLZXkJAAEsAAAAAgkAASwAAAACCQABLAAAAAICAAAAC2lzc3VlckxpbmtfAgAAAAE8BQAAAAdhc3NldElkAgAAAAE+AwkBAAAAEGlzUGF5bWVudEluV2F2ZXMAAAABBQAAAAFpAwkBAAAAD2lzRW5vdWdoUGF5bWVudAAAAAIFAAAAAWkFAAAAD2xpbmtVcGRhdGVQcmljZQMJAQAAABNpc0NhbGxlckFzc2V0SXNzdWVyAAAAAgUAAAABaQUAAAAHYXNzZXRJZAkBAAAACFdyaXRlU2V0AAAAAQkABEwAAAACCQEAAAAJRGF0YUVudHJ5AAAAAgUAAAANaXNzdWVyTGlua0tleQUAAAAEbGluawUAAAADbmlsCQAAAgAAAAEFAAAAF2lzc3VlckFjY2Vzc0RlbmllZEVycm9yCQAAAgAAAAEFAAAAFW5vdEVub3VnaFBheW1lbnRFcnJvcgkAAAIAAAABBQAAABlub3RTdXBwb3J0ZWRDdXJyZW5jeUVycm9yAAAAALjUxA0=", "chainId": 84, "height": 664274, "spentComplexity": 0 } View: original | compacted Prev: 4tz8FRfnpt8iJi6FJ17T1XgEeSKZC2bj6sx6ZKrCSZsu Next: 72S48YsSEKC7urFci1L8py3koXBs3DudgdUdt49PVyx6 Diff:
Old | New | Differences | |
---|---|---|---|
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | 4 | let wvs = 100000000 | |
5 | 5 | ||
6 | - | let notSupportedCurrencyError = "< | |
6 | + | let notSupportedCurrencyError = "<notSupportedCurrencyError>" | |
7 | 7 | ||
8 | - | let | |
8 | + | let issuerAccessDeniedError = "<issuerAccessDeniedError>" | |
9 | 9 | ||
10 | - | ||
10 | + | let notEnoughPaymentError = "<notEnoughPaymentError>" | |
11 | 11 | ||
12 | + | let tickerValidationNotEnoughRatingError = "<tickerValidationNotEnoughRatingError>" | |
13 | + | ||
14 | + | let tickerValidationTickerIsExistError = "<tickerValidationTickerIsExistError>" | |
15 | + | ||
16 | + | let tickerValidationWrongFormatError = "<tickerValidationWrongFormatError>" | |
17 | + | ||
18 | + | let nonExistentAssetError = "<nonExistentAssetError>" | |
19 | + | ||
20 | + | let noPaymentError = "<noPaymentError>" | |
12 | 21 | ||
13 | 22 | let descriptionUpdatePrice = (1 * wvs) | |
14 | 23 | ||
136 | 145 | else false | |
137 | 146 | ||
138 | 147 | ||
139 | - | func getAssetIssuerAddressFromAssetId (assetId) = toString(valueOrErrorMessage(assetInfo(fromBase58String(assetId)), | |
148 | + | func getAssetIssuerAddressFromAssetId (assetId) = toString(valueOrErrorMessage(assetInfo(fromBase58String(assetId)), nonExistentAssetError).issuer) | |
140 | 149 | ||
141 | 150 | ||
142 | - | func getPayment (i) = valueOrErrorMessage(i.payment, | |
151 | + | func getPayment (i) = valueOrErrorMessage(i.payment, noPaymentError) | |
143 | 152 | ||
144 | 153 | ||
145 | 154 | func isPaymentInWaves (i) = { | |
185 | 194 | then if (isTickerFree) | |
186 | 195 | then if (isValidTicker(ticker)) | |
187 | 196 | then WriteSet([DataEntry(issuerTickerKey, ticker)]) | |
188 | - | else throw( | |
189 | - | else throw( | |
190 | - | else throw( | |
191 | - | else throw( | |
192 | - | else throw( | |
197 | + | else throw(tickerValidationWrongFormatError) | |
198 | + | else throw(tickerValidationTickerIsExistError) | |
199 | + | else throw(tickerValidationNotEnoughRatingError) | |
200 | + | else throw(issuerAccessDeniedError) | |
201 | + | else throw(notEnoughPaymentError) | |
193 | 202 | else throw(notSupportedCurrencyError) | |
194 | 203 | } | |
195 | 204 | ||
202 | 211 | then if (isEnoughPayment(i, descriptionUpdatePrice)) | |
203 | 212 | then if (isCallerAssetIssuer(i, assetId)) | |
204 | 213 | then WriteSet([DataEntry(issuerDescriptionKey, description)]) | |
205 | - | else throw( | |
206 | - | else throw( | |
214 | + | else throw(issuerAccessDeniedError) | |
215 | + | else throw(notEnoughPaymentError) | |
207 | 216 | else throw(notSupportedCurrencyError) | |
208 | 217 | } | |
209 | 218 | ||
216 | 225 | then if (isEnoughPayment(i, linkUpdatePrice)) | |
217 | 226 | then if (isCallerAssetIssuer(i, assetId)) | |
218 | 227 | then WriteSet([DataEntry(issuerLinkKey, link)]) | |
219 | - | else throw( | |
220 | - | else throw( | |
228 | + | else throw(issuerAccessDeniedError) | |
229 | + | else throw(notEnoughPaymentError) | |
221 | 230 | else throw(notSupportedCurrencyError) | |
222 | 231 | } | |
223 | 232 |
Old | New | Differences | |
---|---|---|---|
1 | 1 | {-# STDLIB_VERSION 3 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | 4 | let wvs = 100000000 | |
5 | 5 | ||
6 | - | let notSupportedCurrencyError = "< | |
6 | + | let notSupportedCurrencyError = "<notSupportedCurrencyError>" | |
7 | 7 | ||
8 | - | let | |
8 | + | let issuerAccessDeniedError = "<issuerAccessDeniedError>" | |
9 | 9 | ||
10 | - | ||
10 | + | let notEnoughPaymentError = "<notEnoughPaymentError>" | |
11 | 11 | ||
12 | + | let tickerValidationNotEnoughRatingError = "<tickerValidationNotEnoughRatingError>" | |
13 | + | ||
14 | + | let tickerValidationTickerIsExistError = "<tickerValidationTickerIsExistError>" | |
15 | + | ||
16 | + | let tickerValidationWrongFormatError = "<tickerValidationWrongFormatError>" | |
17 | + | ||
18 | + | let nonExistentAssetError = "<nonExistentAssetError>" | |
19 | + | ||
20 | + | let noPaymentError = "<noPaymentError>" | |
12 | 21 | ||
13 | 22 | let descriptionUpdatePrice = (1 * wvs) | |
14 | 23 | ||
15 | 24 | let linkUpdatePrice = (1 * wvs) | |
16 | 25 | ||
17 | 26 | let tickerUpdatePrice = (2 * wvs) | |
18 | 27 | ||
19 | 28 | let tickerMinLength = 1 | |
20 | 29 | ||
21 | 30 | let tickerMaxLength = 6 | |
22 | 31 | ||
23 | 32 | let tickerAllowedLetters = "ABCDEFGHIJKLMNOPQRSTUVWXYZ" | |
24 | 33 | ||
25 | 34 | let tickerCatalogueOracleAddress = addressFromStringValue("3MxHxW5VWq4KrWcbhFfxKrafXm4mL6rZHfj") | |
26 | 35 | ||
27 | 36 | let tokenRatingOracleAddress = addressFromStringValue("3NADqHoLMbMTfXdP2TeBBSx5mQXePVj3KZm") | |
28 | 37 | ||
29 | 38 | func getIntegerFromAccount (accountAddress,key) = match getInteger(accountAddress, key) { | |
30 | 39 | case i: Int => | |
31 | 40 | i | |
32 | 41 | case _ => | |
33 | 42 | 0 | |
34 | 43 | } | |
35 | 44 | ||
36 | 45 | ||
37 | 46 | func isSubstrExist (str,substr) = match indexOf(str, substr) { | |
38 | 47 | case index: Int => | |
39 | 48 | true | |
40 | 49 | case index: Unit => | |
41 | 50 | false | |
42 | 51 | case _ => | |
43 | 52 | throw() | |
44 | 53 | } | |
45 | 54 | ||
46 | 55 | ||
47 | 56 | func isValidTicker (ticker) = { | |
48 | 57 | let tickerLetters = split(ticker, "") | |
49 | 58 | let tickerLength = size(tickerLetters) | |
50 | 59 | let isLetter1Valid = isSubstrExist(tickerAllowedLetters, tickerLetters[0]) | |
51 | 60 | let isLetter2Valid = isSubstrExist(tickerAllowedLetters, tickerLetters[1]) | |
52 | 61 | let isLetter3Valid = isSubstrExist(tickerAllowedLetters, tickerLetters[2]) | |
53 | 62 | let isLetter4Valid = isSubstrExist(tickerAllowedLetters, tickerLetters[3]) | |
54 | 63 | let isLetter5Valid = isSubstrExist(tickerAllowedLetters, tickerLetters[4]) | |
55 | 64 | let isLetter6Valid = isSubstrExist(tickerAllowedLetters, tickerLetters[5]) | |
56 | 65 | if ((ticker != "")) | |
57 | 66 | then if (if ((tickerLength >= tickerMinLength)) | |
58 | 67 | then (tickerMaxLength >= tickerLength) | |
59 | 68 | else false) | |
60 | 69 | then if ((1 == tickerLength)) | |
61 | 70 | then isLetter1Valid | |
62 | 71 | else if ((2 == tickerLength)) | |
63 | 72 | then if (isLetter1Valid) | |
64 | 73 | then isLetter2Valid | |
65 | 74 | else false | |
66 | 75 | else if ((3 == tickerLength)) | |
67 | 76 | then if (if (isLetter1Valid) | |
68 | 77 | then isLetter2Valid | |
69 | 78 | else false) | |
70 | 79 | then isLetter3Valid | |
71 | 80 | else false | |
72 | 81 | else if ((4 == tickerLength)) | |
73 | 82 | then if (if (if (isLetter1Valid) | |
74 | 83 | then isLetter2Valid | |
75 | 84 | else false) | |
76 | 85 | then isLetter3Valid | |
77 | 86 | else false) | |
78 | 87 | then isLetter4Valid | |
79 | 88 | else false | |
80 | 89 | else if ((5 == tickerLength)) | |
81 | 90 | then if (if (if (if (isLetter1Valid) | |
82 | 91 | then isLetter2Valid | |
83 | 92 | else false) | |
84 | 93 | then isLetter3Valid | |
85 | 94 | else false) | |
86 | 95 | then isLetter4Valid | |
87 | 96 | else false) | |
88 | 97 | then isLetter5Valid | |
89 | 98 | else false | |
90 | 99 | else if ((6 == tickerLength)) | |
91 | 100 | then if (if (if (if (if (isLetter1Valid) | |
92 | 101 | then isLetter2Valid | |
93 | 102 | else false) | |
94 | 103 | then isLetter3Valid | |
95 | 104 | else false) | |
96 | 105 | then isLetter4Valid | |
97 | 106 | else false) | |
98 | 107 | then isLetter5Valid | |
99 | 108 | else false) | |
100 | 109 | then isLetter6Valid | |
101 | 110 | else false | |
102 | 111 | else false | |
103 | 112 | else false | |
104 | 113 | else false | |
105 | 114 | } | |
106 | 115 | ||
107 | 116 | ||
108 | 117 | func isAssetUpdateAllowedByRating (assetId) = { | |
109 | 118 | let assetRatingKey = (("assetRating_" + assetId) + "_1") | |
110 | 119 | let assetRatingValue = getIntegerFromAccount(tokenRatingOracleAddress, assetRatingKey) | |
111 | 120 | let assetRatingTreshold = getIntegerFromAccount(tokenRatingOracleAddress, "tickerRating_1") | |
112 | 121 | (assetRatingValue >= assetRatingTreshold) | |
113 | 122 | } | |
114 | 123 | ||
115 | 124 | ||
116 | 125 | func isAssetUpdateAllowedByWeight (assetId) = { | |
117 | 126 | let assetWeightKey = "assetWeight" | |
118 | 127 | let assetWeightValue = getIntegerFromAccount(tokenRatingOracleAddress, assetWeightKey) | |
119 | 128 | let assetWeightTreshold = getIntegerFromAccount(tokenRatingOracleAddress, "tickerWeight") | |
120 | 129 | (assetWeightValue >= assetWeightTreshold) | |
121 | 130 | } | |
122 | 131 | ||
123 | 132 | ||
124 | 133 | func isAssetUpdateAllowedByVotes (assetId) = { | |
125 | 134 | let assetVotesKey = "assetVotes" | |
126 | 135 | let assetVotesValue = getIntegerFromAccount(tokenRatingOracleAddress, assetVotesKey) | |
127 | 136 | let assetVotesTreshold = getIntegerFromAccount(tokenRatingOracleAddress, "tickerVotes") | |
128 | 137 | (assetVotesValue >= assetVotesTreshold) | |
129 | 138 | } | |
130 | 139 | ||
131 | 140 | ||
132 | 141 | func isUpdateAllowedByRating (assetId) = if (if (isAssetUpdateAllowedByRating(assetId)) | |
133 | 142 | then isAssetUpdateAllowedByWeight(assetId) | |
134 | 143 | else false) | |
135 | 144 | then isAssetUpdateAllowedByVotes(assetId) | |
136 | 145 | else false | |
137 | 146 | ||
138 | 147 | ||
139 | - | func getAssetIssuerAddressFromAssetId (assetId) = toString(valueOrErrorMessage(assetInfo(fromBase58String(assetId)), | |
148 | + | func getAssetIssuerAddressFromAssetId (assetId) = toString(valueOrErrorMessage(assetInfo(fromBase58String(assetId)), nonExistentAssetError).issuer) | |
140 | 149 | ||
141 | 150 | ||
142 | - | func getPayment (i) = valueOrErrorMessage(i.payment, | |
151 | + | func getPayment (i) = valueOrErrorMessage(i.payment, noPaymentError) | |
143 | 152 | ||
144 | 153 | ||
145 | 154 | func isPaymentInWaves (i) = { | |
146 | 155 | let payment = getPayment(i) | |
147 | 156 | if (!(isDefined(payment.assetId))) | |
148 | 157 | then true | |
149 | 158 | else false | |
150 | 159 | } | |
151 | 160 | ||
152 | 161 | ||
153 | 162 | func isEnoughPayment (i,requiredPayment) = { | |
154 | 163 | let payment = getPayment(i) | |
155 | 164 | if ((payment.amount >= requiredPayment)) | |
156 | 165 | then true | |
157 | 166 | else false | |
158 | 167 | } | |
159 | 168 | ||
160 | 169 | ||
161 | 170 | func isCallerAssetIssuer (i,assetId) = { | |
162 | 171 | let callerAddress = toBase58String(i.caller.bytes) | |
163 | 172 | let assetIssuerAdress = getAssetIssuerAddressFromAssetId(assetId) | |
164 | 173 | if ((callerAddress == assetIssuerAdress)) | |
165 | 174 | then true | |
166 | 175 | else false | |
167 | 176 | } | |
168 | 177 | ||
169 | 178 | ||
170 | 179 | @Callable(i) | |
171 | 180 | func updateTicker (assetId,ticker) = { | |
172 | 181 | let issuerTickerKey = ((("issuerTicker_" + "<") + assetId) + ">") | |
173 | 182 | let isTickerFree = match getString(tickerCatalogueOracleAddress, ticker) { | |
174 | 183 | case t: String => | |
175 | 184 | false | |
176 | 185 | case t: Unit => | |
177 | 186 | true | |
178 | 187 | case _ => | |
179 | 188 | throw() | |
180 | 189 | } | |
181 | 190 | if (isPaymentInWaves(i)) | |
182 | 191 | then if (isEnoughPayment(i, tickerUpdatePrice)) | |
183 | 192 | then if (isCallerAssetIssuer(i, assetId)) | |
184 | 193 | then if (isUpdateAllowedByRating(assetId)) | |
185 | 194 | then if (isTickerFree) | |
186 | 195 | then if (isValidTicker(ticker)) | |
187 | 196 | then WriteSet([DataEntry(issuerTickerKey, ticker)]) | |
188 | - | else throw( | |
189 | - | else throw( | |
190 | - | else throw( | |
191 | - | else throw( | |
192 | - | else throw( | |
197 | + | else throw(tickerValidationWrongFormatError) | |
198 | + | else throw(tickerValidationTickerIsExistError) | |
199 | + | else throw(tickerValidationNotEnoughRatingError) | |
200 | + | else throw(issuerAccessDeniedError) | |
201 | + | else throw(notEnoughPaymentError) | |
193 | 202 | else throw(notSupportedCurrencyError) | |
194 | 203 | } | |
195 | 204 | ||
196 | 205 | ||
197 | 206 | ||
198 | 207 | @Callable(i) | |
199 | 208 | func updateDescription (assetId,description) = { | |
200 | 209 | let issuerDescriptionKey = ((("issuerDescription_" + "<") + assetId) + ">") | |
201 | 210 | if (isPaymentInWaves(i)) | |
202 | 211 | then if (isEnoughPayment(i, descriptionUpdatePrice)) | |
203 | 212 | then if (isCallerAssetIssuer(i, assetId)) | |
204 | 213 | then WriteSet([DataEntry(issuerDescriptionKey, description)]) | |
205 | - | else throw( | |
206 | - | else throw( | |
214 | + | else throw(issuerAccessDeniedError) | |
215 | + | else throw(notEnoughPaymentError) | |
207 | 216 | else throw(notSupportedCurrencyError) | |
208 | 217 | } | |
209 | 218 | ||
210 | 219 | ||
211 | 220 | ||
212 | 221 | @Callable(i) | |
213 | 222 | func updateLink (assetId,link) = { | |
214 | 223 | let issuerLinkKey = ((("issuerLink_" + "<") + assetId) + ">") | |
215 | 224 | if (isPaymentInWaves(i)) | |
216 | 225 | then if (isEnoughPayment(i, linkUpdatePrice)) | |
217 | 226 | then if (isCallerAssetIssuer(i, assetId)) | |
218 | 227 | then WriteSet([DataEntry(issuerLinkKey, link)]) | |
219 | - | else throw( | |
220 | - | else throw( | |
228 | + | else throw(issuerAccessDeniedError) | |
229 | + | else throw(notEnoughPaymentError) | |
221 | 230 | else throw(notSupportedCurrencyError) | |
222 | 231 | } | |
223 | 232 | ||
224 | 233 |
github/deemru/w8io/169f3d6 43.13 ms ◑