tx · 3CBpjNjfvuP7S7HCbJq4t8eDp72gGJeqUHU1mE8ivcai 3N1Epwa6GQuTQr2K9WzeUcqSFCdERwuvL5T: -0.01400000 Waves 2022.05.11 16:32 [2047071] smart account 3N1Epwa6GQuTQr2K9WzeUcqSFCdERwuvL5T > SELF 0.00000000 Waves
{ "type": 13, "id": "3CBpjNjfvuP7S7HCbJq4t8eDp72gGJeqUHU1mE8ivcai", "fee": 1400000, "feeAssetId": null, "timestamp": 1652276025450, "version": 1, "sender": "3N1Epwa6GQuTQr2K9WzeUcqSFCdERwuvL5T", "senderPublicKey": "7iXEgsFNsnbLZ3ca4tmz8jffnyxMu9keuBV6CuQPJLuA", "proofs": [ "5EhmXR2FCtHrKanK1KgKqBKR6FSNeypgEWzV9CvXvwiAyJFcKUb49Ghx8tEYbY1dqwP6xXKGWz7QW2hW7Hk5RJZ3" ], "script": "base64:AAIFAAAAAAAAADQIAhILCgkICAgIAQgBCAESBAoCCAgSBQoDCAgEEgQKAggIEgMKAQESBAoCCAgSAwoBCBIAAAAAHAAAAAAJc2VwYXJhdG9yAgAAAAJfXwAAAAAMa2V5RmVlQW1vdW50CQAEuQAAAAIJAARMAAAAAgIAAAACJXMJAARMAAAAAgIAAAADZmVlBQAAAANuaWwFAAAACXNlcGFyYXRvcgAAAAAOa2V5VXNkbkFzc2V0SWQJAAS5AAAAAgkABEwAAAACAgAAAAIlcwkABEwAAAACAgAAAAt1c2RuQXNzZXRJZAUAAAADbmlsBQAAAAlzZXBhcmF0b3IAAAAAEWtleVZvdGluZ0R1cmF0aW9uCQAEuQAAAAIJAARMAAAAAgIAAAACJXMJAARMAAAAAgIAAAALZXBvY2hMZW5ndGgFAAAAA25pbAUAAAAJc2VwYXJhdG9yAAAAABFrZXlGaW5hbGl6ZVJld2FyZAkABLkAAAACCQAETAAAAAICAAAAAiVzCQAETAAAAAICAAAADmZpbmFsaXplUmV3YXJkBQAAAANuaWwFAAAACXNlcGFyYXRvcgAAAAASa2V5Vm90aW5nV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2V5T3JVbml0AAAAAAMJAAABAAAAAgUAAAAHJG1hdGNoMAIAAAAKQnl0ZVZlY3RvcgQAAAACcGsFAAAAByRtYXRjaDAFAAAAAnBrAwkAAAEAAAACBQAAAAckbWF0Y2gwAgAAAARVbml0CAUAAAACdHgAAAAPc2VuZGVyUHVibGljS2V5CQAAAgAAAAECAAAAC01hdGNoIGVycm9yCQAB9AAAAAMIBQAAAAJ0eAAAAAlib2R5Qnl0ZXMJAAGRAAAAAggFAAAAAnR4AAAABnByb29mcwAAAAAAAAAAAAUAAAAPdGFyZ2V0UHVibGljS2V51Jc6MQ==", "chainId": 84, "height": 2047071, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: 7yXFtrVdX8up8moYTCL1Sqa2A4vs5uJPBjwGh28GWdj3 Next: 6FAX2uLk4oBSHzCdLXJGbGf1Qc4zyNUgQt6zrwRSAz7u Diff:
Old | New | Differences | |
---|---|---|---|
130 | 130 | then true | |
131 | 131 | else throw("Invalid USDN asset ID")] | |
132 | 132 | if ((checks == checks)) | |
133 | - | then $Tuple2([StringEntry(keyAssetsStoreContract, assetsStoreContractPrm), StringEntry(keyuserPoolContract, userPoolContractPrm), StringEntry(keyEmissionContract, emissionContractPrm), IntegerEntry(keyFeeAmount, feeAmountPrm), IntegerEntry(keyVotingDuration, votingDurationPrm), IntegerEntry(keyFinalizeReward, finalizeRewardPrm), StringEntry(keyWxAssetId, wxAssetIdPrm), StringEntry(keyUsdnAssetId, usdnAssetIdPrm)], unit) | |
133 | + | then $Tuple2([StringEntry(keyAssetsStoreContract, assetsStoreContractPrm), StringEntry(keyuserPoolContract, userPoolContractPrm), StringEntry(keyEmissionContract, emissionContractPrm), IntegerEntry(keyFeeAmount, feeAmountPrm), IntegerEntry(keyVotingDuration, votingDurationPrm), IntegerEntry(keyFinalizeReward, finalizeRewardPrm), StringEntry(keyWxAssetId, wxAssetIdPrm), StringEntry(keyUsdnAssetId, usdnAssetIdPrm), StringEntry(keyBoostingContract, boostingContractPrm)], unit) | |
134 | 134 | else throw("Strict value is not equal to itself.") | |
135 | 135 | } | |
136 | 136 | ||
201 | 201 | let positiveVotes = votingResult[1] | |
202 | 202 | let negativeVotes = votingResult[2] | |
203 | 203 | let gwxAmount = invoke(boostingContract, "getUserGwxAmountAtHeightREADONLY", [toString(i.caller), votingFinishHeight], nil) | |
204 | - | let entries = if (inFavor) | |
204 | + | let notZero = if ((asInt(gwxAmount) > 0)) | |
205 | + | then true | |
206 | + | else throw("you don't have gwx") | |
207 | + | if ((notZero == notZero)) | |
205 | 208 | then { | |
206 | - | let newPositiveVotes = (parseIntValue(positiveVotes) + asInt(gwxAmount)) | |
207 | - | let yesVoteKey = keyVote(amountAssetId, priceAssetId, toString(i.caller)) | |
208 | - | let yesVoteValue = keyVoteValue(toString(asInt(gwxAmount)), inFavor) | |
209 | - | $Tuple2([StringEntry(keyVotingResult(amountAssetId, priceAssetId), totalVotes(toString(newPositiveVotes), negativeVotes)), StringEntry(yesVoteKey, yesVoteValue)], unit) | |
209 | + | let entries = if (inFavor) | |
210 | + | then { | |
211 | + | let newPositiveVotes = (parseIntValue(positiveVotes) + asInt(gwxAmount)) | |
212 | + | let yesVoteKey = keyVote(amountAssetId, priceAssetId, toString(i.caller)) | |
213 | + | let yesVoteValue = keyVoteValue(toString(asInt(gwxAmount)), inFavor) | |
214 | + | $Tuple2([StringEntry(keyVotingResult(amountAssetId, priceAssetId), totalVotes(toString(newPositiveVotes), negativeVotes)), StringEntry(yesVoteKey, yesVoteValue)], unit) | |
215 | + | } | |
216 | + | else { | |
217 | + | let newNegativeVotes = (parseIntValue(negativeVotes) + asInt(gwxAmount)) | |
218 | + | let noVoteKey = keyVote(amountAssetId, priceAssetId, toString(i.caller)) | |
219 | + | let noVoteValue = keyVoteValue(toString(asInt(gwxAmount)), inFavor) | |
220 | + | $Tuple2([StringEntry(keyVotingResult(amountAssetId, priceAssetId), totalVotes(positiveVotes, toString(newNegativeVotes))), StringEntry(noVoteKey, noVoteValue)], unit) | |
221 | + | } | |
222 | + | entries | |
210 | 223 | } | |
211 | - | else { | |
212 | - | let newNegativeVotes = (parseIntValue(negativeVotes) + asInt(gwxAmount)) | |
213 | - | let noVoteKey = keyVote(amountAssetId, priceAssetId, toString(i.caller)) | |
214 | - | let noVoteValue = keyVoteValue(toString(asInt(gwxAmount)), inFavor) | |
215 | - | $Tuple2([StringEntry(keyVotingResult(amountAssetId, priceAssetId), totalVotes(positiveVotes, toString(newNegativeVotes))), StringEntry(noVoteKey, noVoteValue)], unit) | |
216 | - | } | |
217 | - | entries | |
224 | + | else throw("Strict value is not equal to itself.") | |
218 | 225 | } | |
219 | 226 | else throw("Strict value is not equal to itself.") | |
220 | 227 | } |
Old | New | Differences | |
---|---|---|---|
1 | 1 | {-# STDLIB_VERSION 5 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | 4 | let separator = "__" | |
5 | 5 | ||
6 | 6 | let keyFeeAmount = makeString(["%s", "fee"], separator) | |
7 | 7 | ||
8 | 8 | let keyUsdnAssetId = makeString(["%s", "usdnAssetId"], separator) | |
9 | 9 | ||
10 | 10 | let keyVotingDuration = makeString(["%s", "epochLength"], separator) | |
11 | 11 | ||
12 | 12 | let keyFinalizeReward = makeString(["%s", "finalizeReward"], separator) | |
13 | 13 | ||
14 | 14 | let keyVotingThreshold = makeString(["%s", "votingThreshold"], separator) | |
15 | 15 | ||
16 | 16 | let keyWxAssetId = makeString(["%s", "wxAssetId"], separator) | |
17 | 17 | ||
18 | 18 | let keyAssetsStoreContract = makeString(["%s", "assetsStoreContract"], separator) | |
19 | 19 | ||
20 | 20 | let keyuserPoolContract = makeString(["%s", "userPoolContract"], separator) | |
21 | 21 | ||
22 | 22 | let keyEmissionContract = makeString(["%s", "emissionContract"], separator) | |
23 | 23 | ||
24 | 24 | let keyBoostingContract = makeString(["%s", "boostingContract"], separator) | |
25 | 25 | ||
26 | 26 | func getStringOrFail (key) = valueOrErrorMessage(getString(this, key), (key + " is not defined")) | |
27 | 27 | ||
28 | 28 | ||
29 | 29 | func keyInListAssetId (amountAssetId,priceAssetId) = makeString(["%s%s%s", "inList", amountAssetId, priceAssetId], separator) | |
30 | 30 | ||
31 | 31 | ||
32 | 32 | func keyStartHeight (amountAssetId,priceAssetId) = makeString(["%s%s%s", "startHeight", amountAssetId, priceAssetId], separator) | |
33 | 33 | ||
34 | 34 | ||
35 | 35 | func keyVotingResult (amountAssetId,priceAssetId) = makeString(["%s%s%s", "votingResult", amountAssetId, priceAssetId], separator) | |
36 | 36 | ||
37 | 37 | ||
38 | 38 | func totalVotes (totalYes,totalNo) = makeString(["%d%d", totalYes, totalNo], separator) | |
39 | 39 | ||
40 | 40 | ||
41 | 41 | func keyVote (amountAssetId,priceAssetId,voterAddress) = makeString(["%s%s%s%s", "vote", amountAssetId, priceAssetId, voterAddress], separator) | |
42 | 42 | ||
43 | 43 | ||
44 | 44 | func keyVoteValue (gwxAmount,vote) = { | |
45 | 45 | let key = if (vote) | |
46 | 46 | then makeString(["%d%s", gwxAmount, "yes"], separator) | |
47 | 47 | else makeString(["%d%s", gwxAmount, "no"], separator) | |
48 | 48 | key | |
49 | 49 | } | |
50 | 50 | ||
51 | 51 | ||
52 | 52 | func keyManagerPublicKey () = "%s__managerPublicKey" | |
53 | 53 | ||
54 | 54 | ||
55 | 55 | func keyPendingManagerPublicKey () = "%s__pendingManagerPublicKey" | |
56 | 56 | ||
57 | 57 | ||
58 | 58 | let emissionContract = addressFromStringValue(getStringOrFail(keyEmissionContract)) | |
59 | 59 | ||
60 | 60 | let userPoolContract = addressFromStringValue(getStringOrFail(keyuserPoolContract)) | |
61 | 61 | ||
62 | 62 | let boostingContract = addressFromStringValue(getStringOrFail(keyBoostingContract)) | |
63 | 63 | ||
64 | 64 | let assetStoreContract = addressFromStringValue(getStringOrFail(keyAssetsStoreContract)) | |
65 | 65 | ||
66 | 66 | func managerPublicKeyOrUnit () = match getString(keyManagerPublicKey()) { | |
67 | 67 | case s: String => | |
68 | 68 | fromBase58String(s) | |
69 | 69 | case _: Unit => | |
70 | 70 | unit | |
71 | 71 | case _ => | |
72 | 72 | throw("Match error") | |
73 | 73 | } | |
74 | 74 | ||
75 | 75 | ||
76 | 76 | func pendingManagerPublicKeyOrUnit () = match getString(keyPendingManagerPublicKey()) { | |
77 | 77 | case s: String => | |
78 | 78 | fromBase58String(s) | |
79 | 79 | case _: Unit => | |
80 | 80 | unit | |
81 | 81 | case _ => | |
82 | 82 | throw("Match error") | |
83 | 83 | } | |
84 | 84 | ||
85 | 85 | ||
86 | 86 | func mustManager (i) = { | |
87 | 87 | let pd = throw("Permission denied") | |
88 | 88 | match managerPublicKeyOrUnit() { | |
89 | 89 | case pk: ByteVector => | |
90 | 90 | if ((i.callerPublicKey == pk)) | |
91 | 91 | then true | |
92 | 92 | else pd | |
93 | 93 | case _: Unit => | |
94 | 94 | if ((i.caller == this)) | |
95 | 95 | then true | |
96 | 96 | else pd | |
97 | 97 | case _ => | |
98 | 98 | throw("Match error") | |
99 | 99 | } | |
100 | 100 | } | |
101 | 101 | ||
102 | 102 | ||
103 | 103 | func asInt (val) = match val { | |
104 | 104 | case valInt: Int => | |
105 | 105 | valInt | |
106 | 106 | case _ => | |
107 | 107 | throw("Failed to cast into Integer") | |
108 | 108 | } | |
109 | 109 | ||
110 | 110 | ||
111 | 111 | @Callable(i) | |
112 | 112 | func constructor (assetsStoreContractPrm,userPoolContractPrm,boostingContractPrm,emissionContractPrm,feeAmountPrm,wxAssetIdPrm,votingDurationPrm,usdnAssetIdPrm,finalizeRewardPrm) = { | |
113 | 113 | let checks = [mustManager(i), if (isDefined(addressFromString(assetsStoreContractPrm))) | |
114 | 114 | then true | |
115 | 115 | else throw("Invalid asset_store contract address"), if (isDefined(addressFromString(boostingContractPrm))) | |
116 | 116 | then true | |
117 | 117 | else throw("Invalid boosting contract address"), if (isDefined(addressFromString(userPoolContractPrm))) | |
118 | 118 | then true | |
119 | 119 | else throw("Invalid user_pools contract address"), if (isDefined(addressFromString(emissionContractPrm))) | |
120 | 120 | then true | |
121 | 121 | else throw("Invalid emission contract address"), if ((feeAmountPrm >= 0)) | |
122 | 122 | then true | |
123 | 123 | else throw("Invalid fee amount"), if ((votingDurationPrm > 0)) | |
124 | 124 | then true | |
125 | 125 | else throw("Invalid voting duration"), if ((finalizeRewardPrm > 0)) | |
126 | 126 | then true | |
127 | 127 | else throw("Invalid finalize reward"), if (isDefined(assetInfo(fromBase58String(wxAssetIdPrm)))) | |
128 | 128 | then true | |
129 | 129 | else throw("Invalid WX asset ID"), if (isDefined(assetInfo(fromBase58String(usdnAssetIdPrm)))) | |
130 | 130 | then true | |
131 | 131 | else throw("Invalid USDN asset ID")] | |
132 | 132 | if ((checks == checks)) | |
133 | - | then $Tuple2([StringEntry(keyAssetsStoreContract, assetsStoreContractPrm), StringEntry(keyuserPoolContract, userPoolContractPrm), StringEntry(keyEmissionContract, emissionContractPrm), IntegerEntry(keyFeeAmount, feeAmountPrm), IntegerEntry(keyVotingDuration, votingDurationPrm), IntegerEntry(keyFinalizeReward, finalizeRewardPrm), StringEntry(keyWxAssetId, wxAssetIdPrm), StringEntry(keyUsdnAssetId, usdnAssetIdPrm)], unit) | |
133 | + | then $Tuple2([StringEntry(keyAssetsStoreContract, assetsStoreContractPrm), StringEntry(keyuserPoolContract, userPoolContractPrm), StringEntry(keyEmissionContract, emissionContractPrm), IntegerEntry(keyFeeAmount, feeAmountPrm), IntegerEntry(keyVotingDuration, votingDurationPrm), IntegerEntry(keyFinalizeReward, finalizeRewardPrm), StringEntry(keyWxAssetId, wxAssetIdPrm), StringEntry(keyUsdnAssetId, usdnAssetIdPrm), StringEntry(keyBoostingContract, boostingContractPrm)], unit) | |
134 | 134 | else throw("Strict value is not equal to itself.") | |
135 | 135 | } | |
136 | 136 | ||
137 | 137 | ||
138 | 138 | ||
139 | 139 | @Callable(i) | |
140 | 140 | func suggest (amountAssetId,priceAssetId) = { | |
141 | 141 | let payment = value(i.payments[0]) | |
142 | 142 | let info = valueOrErrorMessage(assetInfo(fromBase58String(amountAssetId)), "Invalid amountAssetId ID") | |
143 | 143 | let checks = [if ((info.issuer == i.caller)) | |
144 | 144 | then true | |
145 | 145 | else throw("Asset can only be suggested by its issuer"), if ((info.scripted == false)) | |
146 | 146 | then true | |
147 | 147 | else throw("Asset is smart"), if ((toBase58String(value(payment.assetId)) == value(getString(keyWxAssetId)))) | |
148 | 148 | then true | |
149 | 149 | else throw("Invalid fee asset"), if ((payment.amount == value(getInteger(keyFeeAmount)))) | |
150 | 150 | then true | |
151 | 151 | else throw("Invalid fee amount"), if ((priceAssetId == value(getString(keyUsdnAssetId)))) | |
152 | 152 | then true | |
153 | 153 | else throw("priceAssetId is not USDN"), if ((getBoolean(keyInListAssetId(amountAssetId, priceAssetId)) == unit)) | |
154 | 154 | then true | |
155 | 155 | else throw("Already in voting list")] | |
156 | 156 | if ((checks == checks)) | |
157 | 157 | then { | |
158 | 158 | let ensureActive = match invoke(userPoolContract, "statusREADONLY", [amountAssetId, priceAssetId], nil) { | |
159 | 159 | case s: String => | |
160 | 160 | if ((s == "active")) | |
161 | 161 | then true | |
162 | 162 | else throw("User pool is not active") | |
163 | 163 | case _ => | |
164 | 164 | throw("User pool is not active") | |
165 | 165 | } | |
166 | 166 | if ((ensureActive == ensureActive)) | |
167 | 167 | then { | |
168 | 168 | let ensureAmountAssetVerified = match invoke(assetStoreContract, "isVerifiedREADONLY", [amountAssetId], nil) { | |
169 | 169 | case b: Boolean => | |
170 | 170 | b | |
171 | 171 | case _ => | |
172 | 172 | throw("Asset is not verified") | |
173 | 173 | } | |
174 | 174 | if ((ensureAmountAssetVerified == ensureAmountAssetVerified)) | |
175 | 175 | then { | |
176 | 176 | let burnFeeInv = invoke(emissionContract, "burn", nil, [AttachedPayment(payment.assetId, payment.amount)]) | |
177 | 177 | if ((burnFeeInv == burnFeeInv)) | |
178 | 178 | then [BooleanEntry(keyInListAssetId(amountAssetId, priceAssetId), true), IntegerEntry(keyStartHeight(amountAssetId, priceAssetId), height), StringEntry(keyVotingResult(amountAssetId, priceAssetId), totalVotes("0", "0"))] | |
179 | 179 | else throw("Strict value is not equal to itself.") | |
180 | 180 | } | |
181 | 181 | else throw("Strict value is not equal to itself.") | |
182 | 182 | } | |
183 | 183 | else throw("Strict value is not equal to itself.") | |
184 | 184 | } | |
185 | 185 | else throw("Strict value is not equal to itself.") | |
186 | 186 | } | |
187 | 187 | ||
188 | 188 | ||
189 | 189 | ||
190 | 190 | @Callable(i) | |
191 | 191 | func vote (amountAssetId,priceAssetId,inFavor) = { | |
192 | 192 | let votingFinishHeight = (value(getInteger(keyStartHeight(amountAssetId, priceAssetId))) + value(getInteger(keyVotingDuration))) | |
193 | 193 | let checks = [if (valueOrElse(getBoolean(keyInListAssetId(amountAssetId, priceAssetId)), false)) | |
194 | 194 | then true | |
195 | 195 | else throw("The token isn't on the voting list"), if ((votingFinishHeight > height)) | |
196 | 196 | then true | |
197 | 197 | else throw("too late to vote")] | |
198 | 198 | if ((checks == checks)) | |
199 | 199 | then { | |
200 | 200 | let votingResult = split(value(getString(keyVotingResult(amountAssetId, priceAssetId))), separator) | |
201 | 201 | let positiveVotes = votingResult[1] | |
202 | 202 | let negativeVotes = votingResult[2] | |
203 | 203 | let gwxAmount = invoke(boostingContract, "getUserGwxAmountAtHeightREADONLY", [toString(i.caller), votingFinishHeight], nil) | |
204 | - | let entries = if (inFavor) | |
204 | + | let notZero = if ((asInt(gwxAmount) > 0)) | |
205 | + | then true | |
206 | + | else throw("you don't have gwx") | |
207 | + | if ((notZero == notZero)) | |
205 | 208 | then { | |
206 | - | let newPositiveVotes = (parseIntValue(positiveVotes) + asInt(gwxAmount)) | |
207 | - | let yesVoteKey = keyVote(amountAssetId, priceAssetId, toString(i.caller)) | |
208 | - | let yesVoteValue = keyVoteValue(toString(asInt(gwxAmount)), inFavor) | |
209 | - | $Tuple2([StringEntry(keyVotingResult(amountAssetId, priceAssetId), totalVotes(toString(newPositiveVotes), negativeVotes)), StringEntry(yesVoteKey, yesVoteValue)], unit) | |
209 | + | let entries = if (inFavor) | |
210 | + | then { | |
211 | + | let newPositiveVotes = (parseIntValue(positiveVotes) + asInt(gwxAmount)) | |
212 | + | let yesVoteKey = keyVote(amountAssetId, priceAssetId, toString(i.caller)) | |
213 | + | let yesVoteValue = keyVoteValue(toString(asInt(gwxAmount)), inFavor) | |
214 | + | $Tuple2([StringEntry(keyVotingResult(amountAssetId, priceAssetId), totalVotes(toString(newPositiveVotes), negativeVotes)), StringEntry(yesVoteKey, yesVoteValue)], unit) | |
215 | + | } | |
216 | + | else { | |
217 | + | let newNegativeVotes = (parseIntValue(negativeVotes) + asInt(gwxAmount)) | |
218 | + | let noVoteKey = keyVote(amountAssetId, priceAssetId, toString(i.caller)) | |
219 | + | let noVoteValue = keyVoteValue(toString(asInt(gwxAmount)), inFavor) | |
220 | + | $Tuple2([StringEntry(keyVotingResult(amountAssetId, priceAssetId), totalVotes(positiveVotes, toString(newNegativeVotes))), StringEntry(noVoteKey, noVoteValue)], unit) | |
221 | + | } | |
222 | + | entries | |
210 | 223 | } | |
211 | - | else { | |
212 | - | let newNegativeVotes = (parseIntValue(negativeVotes) + asInt(gwxAmount)) | |
213 | - | let noVoteKey = keyVote(amountAssetId, priceAssetId, toString(i.caller)) | |
214 | - | let noVoteValue = keyVoteValue(toString(asInt(gwxAmount)), inFavor) | |
215 | - | $Tuple2([StringEntry(keyVotingResult(amountAssetId, priceAssetId), totalVotes(positiveVotes, toString(newNegativeVotes))), StringEntry(noVoteKey, noVoteValue)], unit) | |
216 | - | } | |
217 | - | entries | |
224 | + | else throw("Strict value is not equal to itself.") | |
218 | 225 | } | |
219 | 226 | else throw("Strict value is not equal to itself.") | |
220 | 227 | } | |
221 | 228 | ||
222 | 229 | ||
223 | 230 | ||
224 | 231 | @Callable(i) | |
225 | 232 | func cancelVote (amountAssetId,priceAssetId) = { | |
226 | 233 | let checks = [if (isDefined(getString(keyVotingResult(amountAssetId, priceAssetId)))) | |
227 | 234 | then true | |
228 | 235 | else throw("No vote for assets pair")] | |
229 | 236 | if ((checks == checks)) | |
230 | 237 | then { | |
231 | 238 | let vote = split(value(getString(keyVote(amountAssetId, priceAssetId, toString(i.caller)))), separator) | |
232 | 239 | let voteValue = vote[1] | |
233 | 240 | let voteType = vote[2] | |
234 | 241 | let votingResult = split(value(getString(keyVotingResult(amountAssetId, priceAssetId))), separator) | |
235 | 242 | let positiveVotes = votingResult[1] | |
236 | 243 | let negativeVotes = votingResult[2] | |
237 | 244 | let actions = if ((voteType == "yes")) | |
238 | 245 | then { | |
239 | 246 | let newPositiveVotes = (parseIntValue(positiveVotes) - parseIntValue(voteValue)) | |
240 | 247 | $Tuple2([StringEntry(keyVotingResult(amountAssetId, priceAssetId), totalVotes(toString(newPositiveVotes), negativeVotes)), DeleteEntry(keyVote(amountAssetId, priceAssetId, toString(i.caller)))], unit) | |
241 | 248 | } | |
242 | 249 | else { | |
243 | 250 | let newNegativeVotes = (parseIntValue(negativeVotes) - parseIntValue(voteValue)) | |
244 | 251 | $Tuple2([StringEntry(keyVotingResult(amountAssetId, priceAssetId), totalVotes(positiveVotes, toString(newNegativeVotes))), DeleteEntry(keyVote(amountAssetId, priceAssetId, toString(i.caller)))], unit) | |
245 | 252 | } | |
246 | 253 | actions | |
247 | 254 | } | |
248 | 255 | else throw("Strict value is not equal to itself.") | |
249 | 256 | } | |
250 | 257 | ||
251 | 258 | ||
252 | 259 | ||
253 | 260 | @Callable(i) | |
254 | 261 | func setFee (newFee) = { | |
255 | 262 | let checks = [mustManager(i)] | |
256 | 263 | if ((checks == checks)) | |
257 | 264 | then [IntegerEntry(keyFeeAmount, newFee)] | |
258 | 265 | else throw("Strict value is not equal to itself.") | |
259 | 266 | } | |
260 | 267 | ||
261 | 268 | ||
262 | 269 | ||
263 | 270 | @Callable(i) | |
264 | 271 | func finalize (amountAssetId,priceAssetId) = { | |
265 | 272 | let votingFinishHeight = (value(getInteger(keyStartHeight(amountAssetId, priceAssetId))) + value(getInteger(keyVotingDuration))) | |
266 | 273 | let checks = [if (isDefined(getBoolean(keyInListAssetId(amountAssetId, priceAssetId)))) | |
267 | 274 | then true | |
268 | 275 | else throw("No assets pair"), if ((height >= votingFinishHeight)) | |
269 | 276 | then true | |
270 | 277 | else throw("insufficient height for completion")] | |
271 | 278 | if ((checks == checks)) | |
272 | 279 | then { | |
273 | 280 | let votingResult = split(value(getString(keyVotingResult(amountAssetId, priceAssetId))), separator) | |
274 | 281 | let positiveVotes = parseIntValue(votingResult[1]) | |
275 | 282 | let negativeVotes = parseIntValue(votingResult[2]) | |
276 | 283 | let actions = if ((positiveVotes > negativeVotes)) | |
277 | 284 | then { | |
278 | 285 | let res = invoke(assetStoreContract, "setPoolLabels", [amountAssetId, priceAssetId, "WX_EMISSION"], nil) | |
279 | 286 | if ((res == res)) | |
280 | 287 | then $Tuple2([DeleteEntry(keyInListAssetId(amountAssetId, priceAssetId))], unit) | |
281 | 288 | else throw("Strict value is not equal to itself.") | |
282 | 289 | } | |
283 | 290 | else $Tuple2([DeleteEntry(keyInListAssetId(amountAssetId, priceAssetId))], unit) | |
284 | 291 | actions | |
285 | 292 | } | |
286 | 293 | else throw("Strict value is not equal to itself.") | |
287 | 294 | } | |
288 | 295 | ||
289 | 296 | ||
290 | 297 | ||
291 | 298 | @Callable(i) | |
292 | 299 | func setManager (pendingManagerPublicKey) = { | |
293 | 300 | let checkCaller = mustManager(i) | |
294 | 301 | if ((checkCaller == checkCaller)) | |
295 | 302 | then { | |
296 | 303 | let checkManagerPublicKey = fromBase58String(pendingManagerPublicKey) | |
297 | 304 | if ((checkManagerPublicKey == checkManagerPublicKey)) | |
298 | 305 | then [StringEntry(keyPendingManagerPublicKey(), pendingManagerPublicKey)] | |
299 | 306 | else throw("Strict value is not equal to itself.") | |
300 | 307 | } | |
301 | 308 | else throw("Strict value is not equal to itself.") | |
302 | 309 | } | |
303 | 310 | ||
304 | 311 | ||
305 | 312 | ||
306 | 313 | @Callable(i) | |
307 | 314 | func confirmManager () = { | |
308 | 315 | let pm = pendingManagerPublicKeyOrUnit() | |
309 | 316 | let hasPM = if (isDefined(pm)) | |
310 | 317 | then true | |
311 | 318 | else throw("No pending manager") | |
312 | 319 | if ((hasPM == hasPM)) | |
313 | 320 | then { | |
314 | 321 | let checkPM = if ((i.callerPublicKey == value(pm))) | |
315 | 322 | then true | |
316 | 323 | else throw("You are not pending manager") | |
317 | 324 | if ((checkPM == checkPM)) | |
318 | 325 | then [StringEntry(keyManagerPublicKey(), toBase58String(value(pm))), DeleteEntry(keyPendingManagerPublicKey())] | |
319 | 326 | else throw("Strict value is not equal to itself.") | |
320 | 327 | } | |
321 | 328 | else throw("Strict value is not equal to itself.") | |
322 | 329 | } | |
323 | 330 | ||
324 | 331 | ||
325 | 332 | @Verifier(tx) | |
326 | 333 | func verify () = { | |
327 | 334 | let targetPublicKey = match managerPublicKeyOrUnit() { | |
328 | 335 | case pk: ByteVector => | |
329 | 336 | pk | |
330 | 337 | case _: Unit => | |
331 | 338 | tx.senderPublicKey | |
332 | 339 | case _ => | |
333 | 340 | throw("Match error") | |
334 | 341 | } | |
335 | 342 | sigVerify(tx.bodyBytes, tx.proofs[0], targetPublicKey) | |
336 | 343 | } | |
337 | 344 |
github/deemru/w8io/169f3d6 65.11 ms ◑