tx · 2CzjvoHPZLMLNtM6QUGNoCiyTJXzB4RVubssaRy2dspt

3NBqs2vfpyT5cMdUJ97mEJ1Ycp2y8GbAZDA:  -0.01300000 Waves

2023.06.01 12:20 [2603409] smart account 3NBqs2vfpyT5cMdUJ97mEJ1Ycp2y8GbAZDA > SELF 0.00000000 Waves

{ "type": 13, "id": "2CzjvoHPZLMLNtM6QUGNoCiyTJXzB4RVubssaRy2dspt", "fee": 1300000, "feeAssetId": null, "timestamp": 1685611288923, "version": 2, "chainId": 84, "sender": "3NBqs2vfpyT5cMdUJ97mEJ1Ycp2y8GbAZDA", "senderPublicKey": "H19CeJVbUnfsK8EYs8K6fHxwBH7pLyxw8WCDFu7D4rGQ", "proofs": [ "52TjFx4JQr3dUWYeh9uSZWu7ELEx65dZBttEYGDCcL5wovv3UNMGjuucXDU6vidH5ezGtqx8jyMCgz8FWwr6fR4T" ], "script": "base64:BgKQDQgCEgkKBwgBAQEBAQgSAwoBCBIDCgEBEgASABIAIgNTRVAiB3dyYXBFcnIiA21zZyIIdGhyb3dFcnIiD2dldFN0cmluZ09yRmFpbCIHYWRkcmVzcyIDa2V5IhFrZXlGYWN0b3J5QWRkcmVzcyIZa2V5Vm90aW5nVmVyaWZpZWRDb250cmFjdCIia2V5Vm90aW5nRW1pc3Npb25DYW5kaWRhdGVDb250cmFjdCIUa2V5VXNlclBvb2xzQ29udHJhY3QiFnZvdGluZ1ZlcmlmaWVkQ29udHJhY3QiH3ZvdGluZ0VtaXNzaW9uQ2FuZGlkYXRlQ29udHJhY3QiEXVzZXJQb29sc0NvbnRyYWN0IhhJZHhGYWN0b3J5Q2ZnU3Rha2luZ0RhcHAiGUlkeEZhY3RvcnlDZmdCb29zdGluZ0RhcHAiFElkeEZhY3RvcnlDZmdJZG9EYXBwIhVJZHhGYWN0b3J5Q2ZnVGVhbURhcHAiGUlkeEZhY3RvcnlDZmdFbWlzc2lvbkRhcHAiFUlkeEZhY3RvcnlDZmdSZXN0RGFwcCIZSWR4Rm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bnRyeQIJAQJhYQAFAmFICQDMCAIJAQtEZWxldGVFbnRyeQEJAQJhYgAFA25pbAUDbmlsCQCUCgIFAmFKBQJhSQkAAgECJFN0cmljdCB2YWx1ZSBpcyBub3QgZXF1YWwgdG8gaXRzZWxmLgJhawEVZ2V0Qm9vc3RDb2VmZlJFQURPTkxZAAkAlAoCBQNuaWwFAVoBAmFLAQJhTAAEAmFNBAJhZgkBAmFoAAMJAAECBQJhZgIKQnl0ZVZlY3RvcgQCYW0FAmFmBQJhbQMJAAECBQJhZgIEVW5pdAgFAmFLD3NlbmRlclB1YmxpY0tleQkAAgECC01hdGNoIGVycm9yCQD0AwMIBQJhSwlib2R5Qnl0ZXMJAJEDAggFAmFLBnByb29mcwAABQJhTRrHjZQ=", "height": 2603409, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: HWT6NzsmXriRuHQUfHQ9evVxFu7ys1HLPbjSjrgJ3xSQ Next: 2rxraDTTFq3rweUev6MxU4iLMTQRyo6WNDYk5qUgpUMT Diff:
OldNewDifferences
2121
2222 let keyUserPoolsContract = "%s%s__config__userPoolsContract"
2323
24-let keyVotingEmissionRateContract = "%s%s__config__votingEmissionRateContract"
25-
2624 let votingVerifiedContract = addressFromStringValue(getStringOrFail(this, keyVotingVerifiedContract))
2725
2826 let votingEmissionCandidateContract = addressFromStringValue(getStringOrFail(this, keyVotingEmissionCandidateContract))
2927
3028 let userPoolsContract = addressFromStringValue(getStringOrFail(this, keyUserPoolsContract))
31-
32-let votingEmissionRateContract = addressFromStringValue(getStringOrFail(this, keyVotingEmissionRateContract))
3329
3430 let IdxFactoryCfgStakingDapp = 1
3531
9389
9490
9591 func keyRatePerBlockCurrent () = "%s%s__ratePerBlock__current"
92+
93+
94+func keyRatePerBlockNext () = "%s%s__ratePerBlock__next"
9695
9796
9897 func keyRatePerBlockStartFrom (timestamp,block) = makeString(["%s%s%d%d__ratePerBlock__start", toString(timestamp), toString(block)], SEP)
255254 func getBoostCoeffREADONLY () = $Tuple2(nil, boostCoeff)
256255
257256
258-
259-@Callable(i)
260-func changeRatePerBlock (newRatePerBlock) = {
261- let check = if (if ((i.caller == votingEmissionRateContract))
262- then true
263- else mustManager(i))
264- then true
265- else throwErr("should be invoked by votingEmissionRateContract")
266- if ((check == check))
267- then {
268- let factoryContract = readFactoryAddressOrFail()
269- let factoryCfg = readFactoryCfgOrFail(factoryContract)
270- let boostingContract = getBoostingAddressOrFail(factoryCfg)
271- let boostingInvoke = reentrantInvoke(boostingContract, "onBoostEmissionUpdate", nil, nil)
272- if ((boostingInvoke == boostingInvoke))
273- then {
274- let blockTimestamp = match blockInfoByHeight(height) {
275- case bi: BlockInfo =>
276- bi.timestamp
277- case _ =>
278- throwErr("BlockInfo.timestamp error")
279- }
280-[IntegerEntry(keyRatePerBlockStartFrom(blockTimestamp, height), newRatePerBlock), IntegerEntry(keyRatePerBlockCurrent(), newRatePerBlock)]
281- }
282- else throw("Strict value is not equal to itself.")
283- }
284- else throw("Strict value is not equal to itself.")
285- }
286-
287-
288257 @Verifier(tx)
289258 func verify () = {
290259 let targetPublicKey = match managerPublicKeyOrUnit() {
Full:
OldNewDifferences
11 {-# STDLIB_VERSION 6 #-}
22 {-# SCRIPT_TYPE ACCOUNT #-}
33 {-# CONTENT_TYPE DAPP #-}
44 let SEP = "__"
55
66 func wrapErr (msg) = makeString(["emission.ride:", toString(this), msg], " ")
77
88
99 func throwErr (msg) = throw(wrapErr(msg))
1010
1111
1212 func getStringOrFail (address,key) = valueOrErrorMessage(getString(address, key), wrapErr((("mandatory this." + key) + " is not defined")))
1313
1414
1515 func keyFactoryAddress () = "%s%s__config__factoryAddress"
1616
1717
1818 let keyVotingVerifiedContract = "%s%s__config__votingVerifiedContract"
1919
2020 let keyVotingEmissionCandidateContract = "%s%s__config__votingEmissionCandidateContract"
2121
2222 let keyUserPoolsContract = "%s%s__config__userPoolsContract"
2323
24-let keyVotingEmissionRateContract = "%s%s__config__votingEmissionRateContract"
25-
2624 let votingVerifiedContract = addressFromStringValue(getStringOrFail(this, keyVotingVerifiedContract))
2725
2826 let votingEmissionCandidateContract = addressFromStringValue(getStringOrFail(this, keyVotingEmissionCandidateContract))
2927
3028 let userPoolsContract = addressFromStringValue(getStringOrFail(this, keyUserPoolsContract))
31-
32-let votingEmissionRateContract = addressFromStringValue(getStringOrFail(this, keyVotingEmissionRateContract))
3329
3430 let IdxFactoryCfgStakingDapp = 1
3531
3632 let IdxFactoryCfgBoostingDapp = 2
3733
3834 let IdxFactoryCfgIdoDapp = 3
3935
4036 let IdxFactoryCfgTeamDapp = 4
4137
4238 let IdxFactoryCfgEmissionDapp = 5
4339
4440 let IdxFactoryCfgRestDapp = 6
4541
4642 let IdxFactoryCfgSlippageDapp = 7
4743
4844 let IdxFactoryCfgGwxRewardDapp = 10
4945
5046 func keyFactoryCfg () = "%s__factoryConfig"
5147
5248
5349 func keyFactoryLp2AssetsMapping (lpAssetStr) = makeString(["%s%s%s", lpAssetStr, "mappings__lpAsset2PoolContract"], SEP)
5450
5551
5652 func keyFactoryLpList () = "%s__lpTokensList"
5753
5854
5955 func keyFactoryLpAssetToPoolContractAddress (lpAssetStr) = makeString(["%s%s%s", lpAssetStr, "mappings__lpAsset2PoolContract"], SEP)
6056
6157
6258 func keyFactoryPoolWeight (contractAddress) = makeString(["%s%s", "poolWeight", contractAddress], SEP)
6359
6460
6561 func readFactoryAddressOrFail () = addressFromStringValue(getStringOrFail(this, keyFactoryAddress()))
6662
6763
6864 func readLpList () = split(valueOrElse(getString(readFactoryAddressOrFail(), keyFactoryLpList()), ""), SEP)
6965
7066
7167 func readFactoryCfgOrFail (factory) = split(getStringOrFail(factory, keyFactoryCfg()), SEP)
7268
7369
7470 func getBoostingAddressOrFail (factoryCfg) = addressFromStringValue(factoryCfg[IdxFactoryCfgBoostingDapp])
7571
7672
7773 func getEmissionAddressOrFail (factoryCfg) = addressFromStringValue(factoryCfg[IdxFactoryCfgEmissionDapp])
7874
7975
8076 func getStakingAddressOrFail (factoryCfg) = addressFromStringValue(factoryCfg[IdxFactoryCfgStakingDapp])
8177
8278
8379 func getGwxRewardAddressOrFail (factoryCfg) = addressFromStringValue(factoryCfg[IdxFactoryCfgGwxRewardDapp])
8480
8581
8682 func keyConfig () = "%s__config"
8783
8884
8985 func keyRatePerBlockMaxCurrent () = "%s%s__ratePerBlockMax__current"
9086
9187
9288 func keyRatePerBlockMaxStartFrom (timestamp,block) = makeString(["%s%s%d%d__ratePerBlockMax__start", toString(timestamp), toString(block)], SEP)
9389
9490
9591 func keyRatePerBlockCurrent () = "%s%s__ratePerBlock__current"
92+
93+
94+func keyRatePerBlockNext () = "%s%s__ratePerBlock__next"
9695
9796
9897 func keyRatePerBlockStartFrom (timestamp,block) = makeString(["%s%s%d%d__ratePerBlock__start", toString(timestamp), toString(block)], SEP)
9998
10099
101100 func keyEmissionStartBlock () = "%s%s__emission__startBlock"
102101
103102
104103 func keyEmissionDurationInBlocks () = "%s%s__emission__duration"
105104
106105
107106 func keyEmissionEndBlock () = "%s%s__emission__endBlock"
108107
109108
110109 func keyBoostCoeff () = "%s__boostCoeff"
111110
112111
113112 let boostCoeffDefault = 3
114113
115114 let boostCoeff = valueOrElse(getInteger(this, keyBoostCoeff()), boostCoeffDefault)
116115
117116 func keyGwxHoldersRewardCurrent () = "%s%s__gwxHoldersReward__current"
118117
119118
120119 func keyGwxHoldersRewardNext () = "%s%s__gwxHoldersReward__next"
121120
122121
123122 func keyManagerPublicKey () = "%s__managerPublicKey"
124123
125124
126125 func keyManagerVaultAddress () = "%s__managerVaultAddress"
127126
128127
129128 func getManagerVaultAddressOrThis () = match getString(keyManagerVaultAddress()) {
130129 case s: String =>
131130 addressFromStringValue(s)
132131 case _ =>
133132 this
134133 }
135134
136135
137136 func managerPublicKeyOrUnit () = {
138137 let managerVaultAddress = getManagerVaultAddressOrThis()
139138 match getString(managerVaultAddress, keyManagerPublicKey()) {
140139 case s: String =>
141140 fromBase58String(s)
142141 case _: Unit =>
143142 unit
144143 case _ =>
145144 throw("Match error")
146145 }
147146 }
148147
149148
150149 func mustManager (i) = {
151150 let pd = throwErr("Permission denied")
152151 match managerPublicKeyOrUnit() {
153152 case pk: ByteVector =>
154153 if ((i.callerPublicKey == pk))
155154 then true
156155 else pd
157156 case _: Unit =>
158157 if ((i.caller == this))
159158 then true
160159 else pd
161160 case _ =>
162161 throw("Match error")
163162 }
164163 }
165164
166165
167166 @Callable(i)
168167 func constructor (factoryAddress,ratePerBlockMax,ratePerBlock,emissionStartBlock,emissionDuration,emissionStartTimestamp,wxAssetIdStr) = {
169168 let checkCaller = mustManager(i)
170169 if ((checkCaller == checkCaller))
171170 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))]
172171 else throw("Strict value is not equal to itself.")
173172 }
174173
175174
176175
177176 @Callable(i)
178177 func constructorV2 (votingVerifiedContractPrm) = {
179178 let checkCaller = mustManager(i)
180179 if ((checkCaller == checkCaller))
181180 then $Tuple2([StringEntry(keyVotingVerifiedContract, votingVerifiedContractPrm)], unit)
182181 else throw("Strict value is not equal to itself.")
183182 }
184183
185184
186185
187186 @Callable(i)
188187 func emit (amount) = if ((0 >= amount))
189188 then $Tuple2(nil, nil)
190189 else {
191190 let factoryContract = readFactoryAddressOrFail()
192191 let factoryCfg = readFactoryCfgOrFail(factoryContract)
193192 let stakingContract = getStakingAddressOrFail(factoryCfg)
194193 let gwxRewardsContract = getGwxRewardAddressOrFail(factoryCfg)
195194 let caller = i.caller
196195 if (if ((caller != stakingContract))
197196 then (caller != gwxRewardsContract)
198197 else false)
199198 then throwErr("permissions denied")
200199 else {
201200 let wxAssetIdStr = split(getStringOrFail(this, keyConfig()), SEP)[1]
202201 let wxAssetId = fromBase58String(wxAssetIdStr)
203202 $Tuple2([ScriptTransfer(caller, amount, wxAssetId)], [wxAssetId])
204203 }
205204 }
206205
207206
208207
209208 @Callable(i)
210209 func burn () = {
211210 let factoryContract = readFactoryAddressOrFail()
212211 let factoryCfg = readFactoryCfgOrFail(factoryContract)
213212 let boostingContract = getBoostingAddressOrFail(factoryCfg)
214213 if ((size(i.payments) != 1))
215214 then throwErr("exact one payment is allowed")
216215 else {
217216 let pmt = i.payments[0]
218217 let assetId = value(pmt.assetId)
219218 let pmtAmount = pmt.amount
220219 let wxAssetId = fromBase58String(split(getStringOrFail(this, keyConfig()), SEP)[1])
221220 if ((assetId != wxAssetId))
222221 then throwErr("invalid wxAssetId is passed")
223222 else if (!(containsElement([boostingContract, votingVerifiedContract, votingEmissionCandidateContract, userPoolsContract], i.caller)))
224223 then throwErr("permissions denied")
225224 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))]
226225 }
227226 }
228227
229228
230229
231230 @Callable(i)
232231 func gwxHoldersRewardUpdate () = {
233232 let factoryContract = readFactoryAddressOrFail()
234233 let factoryCfg = readFactoryCfgOrFail(factoryContract)
235234 let gwxRewardsContract = getGwxRewardAddressOrFail(factoryCfg)
236235 let checkCaller = if ((i.caller == gwxRewardsContract))
237236 then true
238237 else mustManager(i)
239238 if ((checkCaller == checkCaller))
240239 then {
241240 let gwxHolderRewardCurrent = valueOrElse(getInteger(keyGwxHoldersRewardCurrent()), 0)
242241 let gwxHolderRewardNext = valueOrElse(getInteger(keyGwxHoldersRewardNext()), gwxHolderRewardCurrent)
243242 let shouldBeUpdated = (gwxHolderRewardCurrent != gwxHolderRewardNext)
244243 let actions = if (shouldBeUpdated)
245244 then [IntegerEntry(keyGwxHoldersRewardCurrent(), gwxHolderRewardNext), DeleteEntry(keyGwxHoldersRewardNext())]
246245 else nil
247246 $Tuple2(actions, shouldBeUpdated)
248247 }
249248 else throw("Strict value is not equal to itself.")
250249 }
251250
252251
253252
254253 @Callable(i)
255254 func getBoostCoeffREADONLY () = $Tuple2(nil, boostCoeff)
256255
257256
258-
259-@Callable(i)
260-func changeRatePerBlock (newRatePerBlock) = {
261- let check = if (if ((i.caller == votingEmissionRateContract))
262- then true
263- else mustManager(i))
264- then true
265- else throwErr("should be invoked by votingEmissionRateContract")
266- if ((check == check))
267- then {
268- let factoryContract = readFactoryAddressOrFail()
269- let factoryCfg = readFactoryCfgOrFail(factoryContract)
270- let boostingContract = getBoostingAddressOrFail(factoryCfg)
271- let boostingInvoke = reentrantInvoke(boostingContract, "onBoostEmissionUpdate", nil, nil)
272- if ((boostingInvoke == boostingInvoke))
273- then {
274- let blockTimestamp = match blockInfoByHeight(height) {
275- case bi: BlockInfo =>
276- bi.timestamp
277- case _ =>
278- throwErr("BlockInfo.timestamp error")
279- }
280-[IntegerEntry(keyRatePerBlockStartFrom(blockTimestamp, height), newRatePerBlock), IntegerEntry(keyRatePerBlockCurrent(), newRatePerBlock)]
281- }
282- else throw("Strict value is not equal to itself.")
283- }
284- else throw("Strict value is not equal to itself.")
285- }
286-
287-
288257 @Verifier(tx)
289258 func verify () = {
290259 let targetPublicKey = match managerPublicKeyOrUnit() {
291260 case pk: ByteVector =>
292261 pk
293262 case _: Unit =>
294263 tx.senderPublicKey
295264 case _ =>
296265 throw("Match error")
297266 }
298267 sigVerify(tx.bodyBytes, tx.proofs[0], targetPublicKey)
299268 }
300269

github/deemru/w8io/026f985 
41.16 ms