tx · CTsXi4T5zn3gHE44ezhGzyM5cbX64cfZvBRH9yhw3gAM 3NBqs2vfpyT5cMdUJ97mEJ1Ycp2y8GbAZDA: -0.01300000 Waves 2023.05.19 15:30 [2584845] smart account 3NBqs2vfpyT5cMdUJ97mEJ1Ycp2y8GbAZDA > SELF 0.00000000 Waves
{ "type": 13, "id": "CTsXi4T5zn3gHE44ezhGzyM5cbX64cfZvBRH9yhw3gAM", "fee": 1300000, "feeAssetId": null, "timestamp": 1684499412256, "version": 2, "chainId": 84, "sender": "3NBqs2vfpyT5cMdUJ97mEJ1Ycp2y8GbAZDA", "senderPublicKey": "H19CeJVbUnfsK8EYs8K6fHxwBH7pLyxw8WCDFu7D4rGQ", "proofs": [ "5FKXez13Tz1eNmCmbXkLLwEx9bibT7GzGtXtpa5fhaEC6VafqMJfMbJAY2B2FktbxT3XTsY6Bu2ekMrL9Y3KMLr8" ], "script": "base64:AAIFAAAAAAAABf0IAhIJCgcIAQEBAQEIEgMKAQgSAwoBARIAEgAiA1NFUCIHd3JhcEVyciIDbXNnIgh0aHJvd0VyciIPZ2V0U3RyaW5nT3JGYWlsIgdhZGRyZXNzIgNrZXkiEWtleUZhY3RvcnlBZGRyZXNzIhlrZXlWb3RpbmdWZXJpZmllZENvbnRyYWN0IiJrZXlWb3RpbmdFbWlzc2lvbkNhbmRpZGF0ZUNvbnRyYWN0IhRrZXlVc2VyUG9vbHNDb250cmFjdCIWdm90aW5nVmVyaWZpZWRDb250cmFjdCIfdm90aW5nRW1pc3Npb25DYW5kaWRhdGVDb250cmFjdCIRdXNlclBvb2xzQ29udHJhY3QiGElkeEZhY3RvcnlDZmdTdGFraW5nRGFwcCIZSWR4RmFjdG9yeUNmZ0Jvb3N0aW5nRGFwcCIUSWR4RmFjdG9yeUNmZ0lkb0RhcHAiFUlkeEZhY3RvcnlDZmdUZWFtRGFwcCIZSWR4RmFjdG9yeUNmZ0VtaXNzaW9uRGFwcCIVSWR4RmFjdG9yeUNmZ1Jlc3REYXB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845, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: 2Kt552qWbY8Qai6uYCM9mrh16NYbVc1Ao7Qwt1sPfP94 Next: G2Zj4b9i7UYRfpZiDww9hLhskkgkarz92A7arSiWW2hu Diff:
Old | New | Differences | |
---|---|---|---|
1 | - | {-# STDLIB_VERSION | |
1 | + | {-# STDLIB_VERSION 5 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | 4 | let SEP = "__" | |
21 | 21 | ||
22 | 22 | let keyUserPoolsContract = "%s%s__config__userPoolsContract" | |
23 | 23 | ||
24 | - | let keyVotingEmissionRateContract = "%s%s__config__votingEmissionRateContract" | |
25 | - | ||
26 | 24 | let votingVerifiedContract = addressFromStringValue(getStringOrFail(this, keyVotingVerifiedContract)) | |
27 | 25 | ||
28 | 26 | let votingEmissionCandidateContract = addressFromStringValue(getStringOrFail(this, keyVotingEmissionCandidateContract)) | |
29 | 27 | ||
30 | 28 | let userPoolsContract = addressFromStringValue(getStringOrFail(this, keyUserPoolsContract)) | |
31 | - | ||
32 | - | let votingEmissionRateContract = addressFromStringValue(getStringOrFail(this, keyVotingEmissionRateContract)) | |
33 | 29 | ||
34 | 30 | let IdxFactoryCfgStakingDapp = 1 | |
35 | 31 | ||
113 | 109 | let boostCoeffDefault = 3 | |
114 | 110 | ||
115 | 111 | let boostCoeff = valueOrElse(getInteger(this, keyBoostCoeff()), boostCoeffDefault) | |
116 | - | ||
117 | - | func keyGwxHoldersRewardCurrent () = "%s%s__gwxHoldersReward__current" | |
118 | - | ||
119 | - | ||
120 | - | func keyGwxHoldersRewardNext () = "%s%s__gwxHoldersReward__next" | |
121 | - | ||
122 | 112 | ||
123 | 113 | func keyManagerPublicKey () = "%s__managerPublicKey" | |
124 | 114 | ||
229 | 219 | ||
230 | 220 | ||
231 | 221 | @Callable(i) | |
232 | - | func gwxHoldersRewardUpdate () = { | |
233 | - | let factoryContract = readFactoryAddressOrFail() | |
234 | - | let factoryCfg = readFactoryCfgOrFail(factoryContract) | |
235 | - | let gwxRewardsContract = getGwxRewardAddressOrFail(factoryCfg) | |
236 | - | let checkCaller = if ((i.caller == gwxRewardsContract)) | |
237 | - | then true | |
238 | - | else mustManager(i) | |
239 | - | if ((checkCaller == checkCaller)) | |
240 | - | then { | |
241 | - | let gwxHolderRewardCurrent = valueOrElse(getInteger(keyGwxHoldersRewardCurrent()), 0) | |
242 | - | let gwxHolderRewardNext = valueOrElse(getInteger(keyGwxHoldersRewardNext()), gwxHolderRewardCurrent) | |
243 | - | let shouldBeUpdated = (gwxHolderRewardCurrent != gwxHolderRewardNext) | |
244 | - | let actions = if (shouldBeUpdated) | |
245 | - | then [IntegerEntry(keyGwxHoldersRewardCurrent(), gwxHolderRewardNext), DeleteEntry(keyGwxHoldersRewardNext())] | |
246 | - | else nil | |
247 | - | $Tuple2(actions, shouldBeUpdated) | |
248 | - | } | |
249 | - | else throw("Strict value is not equal to itself.") | |
250 | - | } | |
251 | - | ||
252 | - | ||
253 | - | ||
254 | - | @Callable(i) | |
255 | 222 | func getBoostCoeffREADONLY () = $Tuple2(nil, boostCoeff) | |
256 | - | ||
257 | - | ||
258 | - | ||
259 | - | @Callable(i) | |
260 | - | func changeRatePerBlock (newRatePerBlock) = { | |
261 | - | let check = if ((i.caller == votingEmissionRateContract)) | |
262 | - | then true | |
263 | - | else throwErr("should be invoked internally") | |
264 | - | if ((check == check)) | |
265 | - | then { | |
266 | - | let blockTimestamp = match blockInfoByHeight(height) { | |
267 | - | case bi: BlockInfo => | |
268 | - | bi.timestamp | |
269 | - | case _ => | |
270 | - | throwErr("BlockInfo.timestamp error") | |
271 | - | } | |
272 | - | [IntegerEntry(keyRatePerBlockStartFrom(blockTimestamp, height), newRatePerBlock), IntegerEntry(keyRatePerBlockCurrent(), newRatePerBlock)] | |
273 | - | } | |
274 | - | else throw("Strict value is not equal to itself.") | |
275 | - | } | |
276 | 223 | ||
277 | 224 | ||
278 | 225 | @Verifier(tx) |
Old | New | Differences | |
---|---|---|---|
1 | - | {-# STDLIB_VERSION | |
1 | + | {-# STDLIB_VERSION 5 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | 4 | let SEP = "__" | |
5 | 5 | ||
6 | 6 | func wrapErr (msg) = makeString(["emission.ride:", toString(this), msg], " ") | |
7 | 7 | ||
8 | 8 | ||
9 | 9 | func throwErr (msg) = throw(wrapErr(msg)) | |
10 | 10 | ||
11 | 11 | ||
12 | 12 | func getStringOrFail (address,key) = valueOrErrorMessage(getString(address, key), wrapErr((("mandatory this." + key) + " is not defined"))) | |
13 | 13 | ||
14 | 14 | ||
15 | 15 | func keyFactoryAddress () = "%s%s__config__factoryAddress" | |
16 | 16 | ||
17 | 17 | ||
18 | 18 | let keyVotingVerifiedContract = "%s%s__config__votingVerifiedContract" | |
19 | 19 | ||
20 | 20 | let keyVotingEmissionCandidateContract = "%s%s__config__votingEmissionCandidateContract" | |
21 | 21 | ||
22 | 22 | let keyUserPoolsContract = "%s%s__config__userPoolsContract" | |
23 | 23 | ||
24 | - | let keyVotingEmissionRateContract = "%s%s__config__votingEmissionRateContract" | |
25 | - | ||
26 | 24 | let votingVerifiedContract = addressFromStringValue(getStringOrFail(this, keyVotingVerifiedContract)) | |
27 | 25 | ||
28 | 26 | let votingEmissionCandidateContract = addressFromStringValue(getStringOrFail(this, keyVotingEmissionCandidateContract)) | |
29 | 27 | ||
30 | 28 | let userPoolsContract = addressFromStringValue(getStringOrFail(this, keyUserPoolsContract)) | |
31 | - | ||
32 | - | let votingEmissionRateContract = addressFromStringValue(getStringOrFail(this, keyVotingEmissionRateContract)) | |
33 | 29 | ||
34 | 30 | let IdxFactoryCfgStakingDapp = 1 | |
35 | 31 | ||
36 | 32 | let IdxFactoryCfgBoostingDapp = 2 | |
37 | 33 | ||
38 | 34 | let IdxFactoryCfgIdoDapp = 3 | |
39 | 35 | ||
40 | 36 | let IdxFactoryCfgTeamDapp = 4 | |
41 | 37 | ||
42 | 38 | let IdxFactoryCfgEmissionDapp = 5 | |
43 | 39 | ||
44 | 40 | let IdxFactoryCfgRestDapp = 6 | |
45 | 41 | ||
46 | 42 | let IdxFactoryCfgSlippageDapp = 7 | |
47 | 43 | ||
48 | 44 | let IdxFactoryCfgGwxRewardDapp = 10 | |
49 | 45 | ||
50 | 46 | func keyFactoryCfg () = "%s__factoryConfig" | |
51 | 47 | ||
52 | 48 | ||
53 | 49 | func keyFactoryLp2AssetsMapping (lpAssetStr) = makeString(["%s%s%s", lpAssetStr, "mappings__lpAsset2PoolContract"], SEP) | |
54 | 50 | ||
55 | 51 | ||
56 | 52 | func keyFactoryLpList () = "%s__lpTokensList" | |
57 | 53 | ||
58 | 54 | ||
59 | 55 | func keyFactoryLpAssetToPoolContractAddress (lpAssetStr) = makeString(["%s%s%s", lpAssetStr, "mappings__lpAsset2PoolContract"], SEP) | |
60 | 56 | ||
61 | 57 | ||
62 | 58 | func keyFactoryPoolWeight (contractAddress) = makeString(["%s%s", "poolWeight", contractAddress], SEP) | |
63 | 59 | ||
64 | 60 | ||
65 | 61 | func readFactoryAddressOrFail () = addressFromStringValue(getStringOrFail(this, keyFactoryAddress())) | |
66 | 62 | ||
67 | 63 | ||
68 | 64 | func readLpList () = split(valueOrElse(getString(readFactoryAddressOrFail(), keyFactoryLpList()), ""), SEP) | |
69 | 65 | ||
70 | 66 | ||
71 | 67 | func readFactoryCfgOrFail (factory) = split(getStringOrFail(factory, keyFactoryCfg()), SEP) | |
72 | 68 | ||
73 | 69 | ||
74 | 70 | func getBoostingAddressOrFail (factoryCfg) = addressFromStringValue(factoryCfg[IdxFactoryCfgBoostingDapp]) | |
75 | 71 | ||
76 | 72 | ||
77 | 73 | func getEmissionAddressOrFail (factoryCfg) = addressFromStringValue(factoryCfg[IdxFactoryCfgEmissionDapp]) | |
78 | 74 | ||
79 | 75 | ||
80 | 76 | func getStakingAddressOrFail (factoryCfg) = addressFromStringValue(factoryCfg[IdxFactoryCfgStakingDapp]) | |
81 | 77 | ||
82 | 78 | ||
83 | 79 | func getGwxRewardAddressOrFail (factoryCfg) = addressFromStringValue(factoryCfg[IdxFactoryCfgGwxRewardDapp]) | |
84 | 80 | ||
85 | 81 | ||
86 | 82 | func keyConfig () = "%s__config" | |
87 | 83 | ||
88 | 84 | ||
89 | 85 | func keyRatePerBlockMaxCurrent () = "%s%s__ratePerBlockMax__current" | |
90 | 86 | ||
91 | 87 | ||
92 | 88 | func keyRatePerBlockMaxStartFrom (timestamp,block) = makeString(["%s%s%d%d__ratePerBlockMax__start", toString(timestamp), toString(block)], SEP) | |
93 | 89 | ||
94 | 90 | ||
95 | 91 | func keyRatePerBlockCurrent () = "%s%s__ratePerBlock__current" | |
96 | 92 | ||
97 | 93 | ||
98 | 94 | func keyRatePerBlockStartFrom (timestamp,block) = makeString(["%s%s%d%d__ratePerBlock__start", toString(timestamp), toString(block)], SEP) | |
99 | 95 | ||
100 | 96 | ||
101 | 97 | func keyEmissionStartBlock () = "%s%s__emission__startBlock" | |
102 | 98 | ||
103 | 99 | ||
104 | 100 | func keyEmissionDurationInBlocks () = "%s%s__emission__duration" | |
105 | 101 | ||
106 | 102 | ||
107 | 103 | func keyEmissionEndBlock () = "%s%s__emission__endBlock" | |
108 | 104 | ||
109 | 105 | ||
110 | 106 | func keyBoostCoeff () = "%s__boostCoeff" | |
111 | 107 | ||
112 | 108 | ||
113 | 109 | let boostCoeffDefault = 3 | |
114 | 110 | ||
115 | 111 | let boostCoeff = valueOrElse(getInteger(this, keyBoostCoeff()), boostCoeffDefault) | |
116 | - | ||
117 | - | func keyGwxHoldersRewardCurrent () = "%s%s__gwxHoldersReward__current" | |
118 | - | ||
119 | - | ||
120 | - | func keyGwxHoldersRewardNext () = "%s%s__gwxHoldersReward__next" | |
121 | - | ||
122 | 112 | ||
123 | 113 | func keyManagerPublicKey () = "%s__managerPublicKey" | |
124 | 114 | ||
125 | 115 | ||
126 | 116 | func keyManagerVaultAddress () = "%s__managerVaultAddress" | |
127 | 117 | ||
128 | 118 | ||
129 | 119 | func getManagerVaultAddressOrThis () = match getString(keyManagerVaultAddress()) { | |
130 | 120 | case s: String => | |
131 | 121 | addressFromStringValue(s) | |
132 | 122 | case _ => | |
133 | 123 | this | |
134 | 124 | } | |
135 | 125 | ||
136 | 126 | ||
137 | 127 | func managerPublicKeyOrUnit () = { | |
138 | 128 | let managerVaultAddress = getManagerVaultAddressOrThis() | |
139 | 129 | match getString(managerVaultAddress, keyManagerPublicKey()) { | |
140 | 130 | case s: String => | |
141 | 131 | fromBase58String(s) | |
142 | 132 | case _: Unit => | |
143 | 133 | unit | |
144 | 134 | case _ => | |
145 | 135 | throw("Match error") | |
146 | 136 | } | |
147 | 137 | } | |
148 | 138 | ||
149 | 139 | ||
150 | 140 | func mustManager (i) = { | |
151 | 141 | let pd = throwErr("Permission denied") | |
152 | 142 | match managerPublicKeyOrUnit() { | |
153 | 143 | case pk: ByteVector => | |
154 | 144 | if ((i.callerPublicKey == pk)) | |
155 | 145 | then true | |
156 | 146 | else pd | |
157 | 147 | case _: Unit => | |
158 | 148 | if ((i.caller == this)) | |
159 | 149 | then true | |
160 | 150 | else pd | |
161 | 151 | case _ => | |
162 | 152 | throw("Match error") | |
163 | 153 | } | |
164 | 154 | } | |
165 | 155 | ||
166 | 156 | ||
167 | 157 | @Callable(i) | |
168 | 158 | func constructor (factoryAddress,ratePerBlockMax,ratePerBlock,emissionStartBlock,emissionDuration,emissionStartTimestamp,wxAssetIdStr) = { | |
169 | 159 | let checkCaller = mustManager(i) | |
170 | 160 | if ((checkCaller == checkCaller)) | |
171 | 161 | then [IntegerEntry(keyRatePerBlockMaxStartFrom(emissionStartTimestamp, emissionStartBlock), ratePerBlockMax), IntegerEntry(keyRatePerBlockMaxCurrent(), ratePerBlockMax), IntegerEntry(keyRatePerBlockStartFrom(emissionStartTimestamp, emissionStartBlock), ratePerBlock), IntegerEntry(keyRatePerBlockCurrent(), ratePerBlock), IntegerEntry(keyEmissionStartBlock(), emissionStartBlock), IntegerEntry(keyEmissionDurationInBlocks(), emissionDuration), IntegerEntry(keyEmissionEndBlock(), (emissionStartBlock + emissionDuration)), StringEntry(keyFactoryAddress(), factoryAddress), StringEntry(keyConfig(), ("%s__" + wxAssetIdStr))] | |
172 | 162 | else throw("Strict value is not equal to itself.") | |
173 | 163 | } | |
174 | 164 | ||
175 | 165 | ||
176 | 166 | ||
177 | 167 | @Callable(i) | |
178 | 168 | func constructorV2 (votingVerifiedContractPrm) = { | |
179 | 169 | let checkCaller = mustManager(i) | |
180 | 170 | if ((checkCaller == checkCaller)) | |
181 | 171 | then $Tuple2([StringEntry(keyVotingVerifiedContract, votingVerifiedContractPrm)], unit) | |
182 | 172 | else throw("Strict value is not equal to itself.") | |
183 | 173 | } | |
184 | 174 | ||
185 | 175 | ||
186 | 176 | ||
187 | 177 | @Callable(i) | |
188 | 178 | func emit (amount) = if ((0 >= amount)) | |
189 | 179 | then $Tuple2(nil, nil) | |
190 | 180 | else { | |
191 | 181 | let factoryContract = readFactoryAddressOrFail() | |
192 | 182 | let factoryCfg = readFactoryCfgOrFail(factoryContract) | |
193 | 183 | let stakingContract = getStakingAddressOrFail(factoryCfg) | |
194 | 184 | let gwxRewardsContract = getGwxRewardAddressOrFail(factoryCfg) | |
195 | 185 | let caller = i.caller | |
196 | 186 | if (if ((caller != stakingContract)) | |
197 | 187 | then (caller != gwxRewardsContract) | |
198 | 188 | else false) | |
199 | 189 | then throwErr("permissions denied") | |
200 | 190 | else { | |
201 | 191 | let wxAssetIdStr = split(getStringOrFail(this, keyConfig()), SEP)[1] | |
202 | 192 | let wxAssetId = fromBase58String(wxAssetIdStr) | |
203 | 193 | $Tuple2([ScriptTransfer(caller, amount, wxAssetId)], [wxAssetId]) | |
204 | 194 | } | |
205 | 195 | } | |
206 | 196 | ||
207 | 197 | ||
208 | 198 | ||
209 | 199 | @Callable(i) | |
210 | 200 | func burn () = { | |
211 | 201 | let factoryContract = readFactoryAddressOrFail() | |
212 | 202 | let factoryCfg = readFactoryCfgOrFail(factoryContract) | |
213 | 203 | let boostingContract = getBoostingAddressOrFail(factoryCfg) | |
214 | 204 | if ((size(i.payments) != 1)) | |
215 | 205 | then throwErr("exact one payment is allowed") | |
216 | 206 | else { | |
217 | 207 | let pmt = i.payments[0] | |
218 | 208 | let assetId = value(pmt.assetId) | |
219 | 209 | let pmtAmount = pmt.amount | |
220 | 210 | let wxAssetId = fromBase58String(split(getStringOrFail(this, keyConfig()), SEP)[1]) | |
221 | 211 | if ((assetId != wxAssetId)) | |
222 | 212 | then throwErr("invalid wxAssetId is passed") | |
223 | 213 | else if (!(containsElement([boostingContract, votingVerifiedContract, votingEmissionCandidateContract, userPoolsContract], i.caller))) | |
224 | 214 | then throwErr("permissions denied") | |
225 | 215 | else [Burn(assetId, pmtAmount), StringEntry(("%s%s%s__history__burn__" + toBase58String(i.transactionId)), makeString(["%d%d%d", toString(height), toString(lastBlock.timestamp), toString(pmtAmount)], SEP))] | |
226 | 216 | } | |
227 | 217 | } | |
228 | 218 | ||
229 | 219 | ||
230 | 220 | ||
231 | 221 | @Callable(i) | |
232 | - | func gwxHoldersRewardUpdate () = { | |
233 | - | let factoryContract = readFactoryAddressOrFail() | |
234 | - | let factoryCfg = readFactoryCfgOrFail(factoryContract) | |
235 | - | let gwxRewardsContract = getGwxRewardAddressOrFail(factoryCfg) | |
236 | - | let checkCaller = if ((i.caller == gwxRewardsContract)) | |
237 | - | then true | |
238 | - | else mustManager(i) | |
239 | - | if ((checkCaller == checkCaller)) | |
240 | - | then { | |
241 | - | let gwxHolderRewardCurrent = valueOrElse(getInteger(keyGwxHoldersRewardCurrent()), 0) | |
242 | - | let gwxHolderRewardNext = valueOrElse(getInteger(keyGwxHoldersRewardNext()), gwxHolderRewardCurrent) | |
243 | - | let shouldBeUpdated = (gwxHolderRewardCurrent != gwxHolderRewardNext) | |
244 | - | let actions = if (shouldBeUpdated) | |
245 | - | then [IntegerEntry(keyGwxHoldersRewardCurrent(), gwxHolderRewardNext), DeleteEntry(keyGwxHoldersRewardNext())] | |
246 | - | else nil | |
247 | - | $Tuple2(actions, shouldBeUpdated) | |
248 | - | } | |
249 | - | else throw("Strict value is not equal to itself.") | |
250 | - | } | |
251 | - | ||
252 | - | ||
253 | - | ||
254 | - | @Callable(i) | |
255 | 222 | func getBoostCoeffREADONLY () = $Tuple2(nil, boostCoeff) | |
256 | - | ||
257 | - | ||
258 | - | ||
259 | - | @Callable(i) | |
260 | - | func changeRatePerBlock (newRatePerBlock) = { | |
261 | - | let check = if ((i.caller == votingEmissionRateContract)) | |
262 | - | then true | |
263 | - | else throwErr("should be invoked internally") | |
264 | - | if ((check == check)) | |
265 | - | then { | |
266 | - | let blockTimestamp = match blockInfoByHeight(height) { | |
267 | - | case bi: BlockInfo => | |
268 | - | bi.timestamp | |
269 | - | case _ => | |
270 | - | throwErr("BlockInfo.timestamp error") | |
271 | - | } | |
272 | - | [IntegerEntry(keyRatePerBlockStartFrom(blockTimestamp, height), newRatePerBlock), IntegerEntry(keyRatePerBlockCurrent(), newRatePerBlock)] | |
273 | - | } | |
274 | - | else throw("Strict value is not equal to itself.") | |
275 | - | } | |
276 | 223 | ||
277 | 224 | ||
278 | 225 | @Verifier(tx) | |
279 | 226 | func verify () = { | |
280 | 227 | let targetPublicKey = match managerPublicKeyOrUnit() { | |
281 | 228 | case pk: ByteVector => | |
282 | 229 | pk | |
283 | 230 | case _: Unit => | |
284 | 231 | tx.senderPublicKey | |
285 | 232 | case _ => | |
286 | 233 | throw("Match error") | |
287 | 234 | } | |
288 | 235 | sigVerify(tx.bodyBytes, tx.proofs[0], targetPublicKey) | |
289 | 236 | } | |
290 | 237 |
github/deemru/w8io/026f985 36.61 ms ◑