tx · 6r8HQkvAwb32enqjhE2LZ1TPNT2UGrA3WXgdeycsLTVq 3MvTtCYbWDMVJJc6e1rTYPRzh6JBnYkiBZ8: -0.05000000 Waves 2019.09.03 18:04 [659958] smart account 3MvTtCYbWDMVJJc6e1rTYPRzh6JBnYkiBZ8 > SELF 0.00000000 Waves
{ "type": 13, "id": "6r8HQkvAwb32enqjhE2LZ1TPNT2UGrA3WXgdeycsLTVq", "fee": 5000000, "feeAssetId": null, "timestamp": 1567523085009, "version": 1, "sender": "3MvTtCYbWDMVJJc6e1rTYPRzh6JBnYkiBZ8", "senderPublicKey": "Dm9NvzmfYXhfemNB9kmWcSzVk5Ni7puk7qLGm2FZryDS", "proofs": [ "26rtfkpx3tLPs2escpHGYVwvjCr8bcvzHxBm7NNzvtJsusTLE5bBB3C95aycaSyymV2ob2RyJA2idfnUSEe7Rf6H" ], "script": "base64:AAIDAAAAAAAAAAAAAAATAAAAAAN3dnMAAAAAAAX14QAAAAAAFHRpY2tlckFsbG93ZWRMZXR0ZXJzAgAAABpBQkNERUZHSElKS0xNTk9QUVJTVFVWV1hZWgAAAAANdGlja2VyRXhhbXBsZQIAAAADQlRDAAAAAA90aWNrZXJNaW5MZW5ndGgAAAAAAAAAAAEAAAAAD3RpY2tlck1heExlbmd0aAAAAAAAAAAABgAAAAAWZGVzY3JpcHRpb25VcGRhdGVQcmljZQkAAGgAAAACAAAAAAAAAAABBQAAAAN3dnMAAAAAD2xpbmtVcGRhdGVQcmljZQkAAGgAAAACAAAAAAAAAAABBQAAAAN3dnMAAAAAEXRpY2tlclVwZGF0ZVByaWNlCQAAaAAAAAIAAAAAAAAAAAIFAAAAA3d2cwAAAAAcdGlja2VyQ2F0YWxvZ3VlT3JhY2xlQWRkcmVzcwkBAAAAHEBleHRyVXNlcihhZGRyZXNzRnJvbVN0cmluZykAAAABAgAAACMzTXhIeFc1VldxNEtyV2NiaEZmeEtyYWZYbTRtTDZyWkhmagAAAAAYdG9rZW5SYXRpbmdPcmFjbG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Old | New | Differences | |
---|---|---|---|
1 | 1 | {-# STDLIB_VERSION 3 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | - | let | |
4 | + | let wvs = 100000000 | |
5 | 5 | ||
6 | - | let | |
6 | + | let tickerAllowedLetters = "ABCDEFGHIJKLMNOPQRSTUVWXYZ" | |
7 | 7 | ||
8 | - | let tickerUpdatePrice = 200000000 | |
8 | + | let tickerExample = "BTC" | |
9 | + | ||
10 | + | let tickerMinLength = 1 | |
11 | + | ||
12 | + | let tickerMaxLength = 6 | |
13 | + | ||
14 | + | let descriptionUpdatePrice = (1 * wvs) | |
15 | + | ||
16 | + | let linkUpdatePrice = (1 * wvs) | |
17 | + | ||
18 | + | let tickerUpdatePrice = (2 * wvs) | |
19 | + | ||
20 | + | let tickerCatalogueOracleAddress = addressFromStringValue("3MxHxW5VWq4KrWcbhFfxKrafXm4mL6rZHfj") | |
21 | + | ||
22 | + | let tokenRatingOracleAddress = addressFromStringValue("3NADqHoLMbMTfXdP2TeBBSx5mQXePVj3KZm") | |
23 | + | ||
24 | + | func getIntegerFromAccount (accountAddress,key) = match getInteger(accountAddress, key) { | |
25 | + | case i: Int => | |
26 | + | i | |
27 | + | case _ => | |
28 | + | 0 | |
29 | + | } | |
30 | + | ||
31 | + | ||
32 | + | func isSubstrExist (str,substr) = match indexOf(str, substr) { | |
33 | + | case index: Int => | |
34 | + | true | |
35 | + | case index: Unit => | |
36 | + | false | |
37 | + | case _ => | |
38 | + | throw() | |
39 | + | } | |
40 | + | ||
41 | + | ||
42 | + | func assetIdFromString (assetId) = if (if ((assetId == "WAVES")) | |
43 | + | then true | |
44 | + | else (assetId == "")) | |
45 | + | then unit | |
46 | + | else fromBase58String(assetId) | |
47 | + | ||
48 | + | ||
49 | + | func isValidTicker (ticker) = { | |
50 | + | let tickerLetters = split(ticker, "") | |
51 | + | let tickerLength = size(tickerLetters) | |
52 | + | let isLetter1Valid = isSubstrExist(tickerAllowedLetters, tickerLetters[0]) | |
53 | + | let isLetter2Valid = isSubstrExist(tickerAllowedLetters, tickerLetters[1]) | |
54 | + | let isLetter3Valid = isSubstrExist(tickerAllowedLetters, tickerLetters[2]) | |
55 | + | let isLetter4Valid = isSubstrExist(tickerAllowedLetters, tickerLetters[3]) | |
56 | + | let isLetter5Valid = isSubstrExist(tickerAllowedLetters, tickerLetters[4]) | |
57 | + | let isLetter6Valid = isSubstrExist(tickerAllowedLetters, tickerLetters[5]) | |
58 | + | if ((ticker != "")) | |
59 | + | then if (if ((tickerLength >= tickerMinLength)) | |
60 | + | then (tickerMaxLength >= tickerLength) | |
61 | + | else false) | |
62 | + | then if ((1 == tickerLength)) | |
63 | + | then isLetter1Valid | |
64 | + | else if ((2 == tickerLength)) | |
65 | + | then if (isLetter1Valid) | |
66 | + | then isLetter2Valid | |
67 | + | else false | |
68 | + | else if ((3 == tickerLength)) | |
69 | + | then if (if (isLetter1Valid) | |
70 | + | then isLetter2Valid | |
71 | + | else false) | |
72 | + | then isLetter3Valid | |
73 | + | else false | |
74 | + | else if ((4 == tickerLength)) | |
75 | + | then if (if (if (isLetter1Valid) | |
76 | + | then isLetter2Valid | |
77 | + | else false) | |
78 | + | then isLetter3Valid | |
79 | + | else false) | |
80 | + | then isLetter4Valid | |
81 | + | else false | |
82 | + | else if ((5 == tickerLength)) | |
83 | + | then if (if (if (if (isLetter1Valid) | |
84 | + | then isLetter2Valid | |
85 | + | else false) | |
86 | + | then isLetter3Valid | |
87 | + | else false) | |
88 | + | then isLetter4Valid | |
89 | + | else false) | |
90 | + | then isLetter5Valid | |
91 | + | else false | |
92 | + | else if ((6 == tickerLength)) | |
93 | + | then if (if (if (if (if (isLetter1Valid) | |
94 | + | then isLetter2Valid | |
95 | + | else false) | |
96 | + | then isLetter3Valid | |
97 | + | else false) | |
98 | + | then isLetter4Valid | |
99 | + | else false) | |
100 | + | then isLetter5Valid | |
101 | + | else false) | |
102 | + | then isLetter6Valid | |
103 | + | else false | |
104 | + | else false | |
105 | + | else false | |
106 | + | else false | |
107 | + | } | |
108 | + | ||
109 | + | ||
110 | + | func isAssetUpdateAllowedByRating (assetId) = { | |
111 | + | let assetRatingKey = (("assetRating_" + assetId) + "_1") | |
112 | + | let assetRatingValue = getIntegerFromAccount(tokenRatingOracleAddress, assetRatingKey) | |
113 | + | let assetRatingTreshold = getIntegerFromAccount(tokenRatingOracleAddress, "tickerRating_1") | |
114 | + | (assetRatingValue >= assetRatingTreshold) | |
115 | + | } | |
116 | + | ||
117 | + | ||
118 | + | func isAssetUpdateAllowedByWeight (assetId) = { | |
119 | + | let assetWeightKey = "assetWeight" | |
120 | + | let assetWeightValue = getIntegerFromAccount(tokenRatingOracleAddress, assetWeightKey) | |
121 | + | let assetWeightTreshold = getIntegerFromAccount(tokenRatingOracleAddress, "tickerWeight") | |
122 | + | (assetWeightValue >= assetWeightTreshold) | |
123 | + | } | |
124 | + | ||
125 | + | ||
126 | + | func isAssetUpdateAllowedByVotes (assetId) = { | |
127 | + | let assetVotesKey = "assetVotes" | |
128 | + | let assetVotesValue = getIntegerFromAccount(tokenRatingOracleAddress, assetVotesKey) | |
129 | + | let assetVotesTreshold = getIntegerFromAccount(tokenRatingOracleAddress, "tickerVotes") | |
130 | + | (assetVotesValue >= assetVotesTreshold) | |
131 | + | } | |
132 | + | ||
133 | + | ||
134 | + | func isUpdateAllowedByRating (assetId) = if (if (isAssetUpdateAllowedByRating(assetId)) | |
135 | + | then isAssetUpdateAllowedByWeight(assetId) | |
136 | + | else false) | |
137 | + | then isAssetUpdateAllowedByVotes(assetId) | |
138 | + | else false | |
139 | + | ||
140 | + | ||
141 | + | func getAssetIssuerFromAssetId (assetId) = match assetInfo(fromBase58String(assetId)) { | |
142 | + | case a: Asset => | |
143 | + | a | |
144 | + | case _ => | |
145 | + | unit | |
146 | + | } | |
147 | + | ||
9 | 148 | ||
10 | 149 | @Callable(i) | |
11 | - | func updateDescription (assetId,issuerAddress,description) = { | |
12 | - | let asset = assetInfo(value(fromBase58String(assetId))) | |
150 | + | func updateTicker (assetId,ticker) = { | |
151 | + | let payment = extract(i.payment) | |
152 | + | let callerAddress = toBase58String(i.caller.bytes) | |
153 | + | let issuerTickerKey = ((("issuerTicker_" + "<") + assetId) + ">") | |
154 | + | let tickerFromOracle = getString(tickerCatalogueOracleAddress, ticker) | |
155 | + | let assetIssuerAdress = toString(valueOrErrorMessage(assetInfo(fromBase58String(assetId)), "error#6. there is no asset with such id").issuer) | |
156 | + | if (!(isDefined(payment.assetId))) | |
157 | + | then if ((payment.amount >= tickerUpdatePrice)) | |
158 | + | then if ((callerAddress == assetIssuerAdress)) | |
159 | + | then if (isUpdateAllowedByRating(assetId)) | |
160 | + | then if ((tickerFromOracle == unit)) | |
161 | + | then if (isValidTicker(ticker)) | |
162 | + | then WriteSet([DataEntry(issuerTickerKey, ticker)]) | |
163 | + | else throw("error#5. Ticker should consist of 1-6 capital Latin characters.") | |
164 | + | else throw("error#4. Asset with such ticker is already exist") | |
165 | + | else throw("error#3. Too little rating") | |
166 | + | else throw("error#2. Only asset issuer can update asset ticker") | |
167 | + | else throw("error#2. Insufficient payment for asset ticker update service.") | |
168 | + | else throw("error#1. The service can only be paid in waves") | |
169 | + | } | |
170 | + | ||
171 | + | ||
172 | + | ||
173 | + | @Callable(i) | |
174 | + | func updateDescription (assetId,description) = { | |
13 | 175 | let payment = extract(i.payment) | |
14 | 176 | let callerAddress = toBase58String(i.caller.bytes) | |
15 | 177 | let issuerDescriptionKey = ((("issuerDescription_" + "<") + assetId) + ">") | |
16 | - | if (isDefined(payment.assetId)) | |
17 | - | then throw("error#1. The service can only be paid in waves") | |
18 | - | else if ((payment.amount >= descriptionUpdatePrice)) | |
19 | - | then if ((callerAddress == issuerAddress)) | |
20 | - | then WriteSet([DataEntry("issuerDescriptionKey", description)]) | |
21 | - | else throw("error#3. Only asset issuer can update asset description") | |
22 | - | else throw("error#2. Only asset issuer can update asset description") | |
178 | + | let assetIssuerAdress = toString(valueOrErrorMessage(assetInfo(fromBase58String(assetId)), "error#6. there is no asset with such id").issuer) | |
179 | + | if (!(isDefined(payment.assetId))) | |
180 | + | then if ((payment.amount >= descriptionUpdatePrice)) | |
181 | + | then if ((callerAddress == assetIssuerAdress)) | |
182 | + | then WriteSet([DataEntry(issuerDescriptionKey, description)]) | |
183 | + | else throw("error#6. Only asset issuer can update asset description") | |
184 | + | else throw("error#7. Insufficient payment for asset description update service.") | |
185 | + | else throw("error#1. The service can only be paid in waves") | |
186 | + | } | |
187 | + | ||
188 | + | ||
189 | + | ||
190 | + | @Callable(i) | |
191 | + | func updateLink (assetId,link) = { | |
192 | + | let payment = extract(i.payment) | |
193 | + | let callerAddress = toBase58String(i.caller.bytes) | |
194 | + | let issuerLinkKey = ((("issuerLink_" + "<") + assetId) + ">") | |
195 | + | let assetIssuerAdress = toString(valueOrErrorMessage(assetInfo(fromBase58String(assetId)), "error#6. there is no asset with such id").issuer) | |
196 | + | if (!(isDefined(payment.assetId))) | |
197 | + | then if ((payment.amount >= linkUpdatePrice)) | |
198 | + | then if ((callerAddress == assetIssuerAdress)) | |
199 | + | then WriteSet([DataEntry(issuerLinkKey, link)]) | |
200 | + | else throw("error#6. Only asset issuer can update asset link") | |
201 | + | else throw("error#7. Insufficient payment for asset link update service.") | |
202 | + | else throw("error#1. The service can only be paid in waves") | |
23 | 203 | } | |
24 | 204 | ||
25 | 205 |
github/deemru/w8io/026f985 46.42 ms ◑