tx · AgGZW6MSatzv6iQWTaWBqxsj7dyLLwqGHqg2wPG5nP5F

3NBqs2vfpyT5cMdUJ97mEJ1Ycp2y8GbAZDA:  -0.01300000 Waves

2023.05.22 10:07 [2588858] smart account 3NBqs2vfpyT5cMdUJ97mEJ1Ycp2y8GbAZDA > SELF 0.00000000 Waves

{ "type": 13, "id": "AgGZW6MSatzv6iQWTaWBqxsj7dyLLwqGHqg2wPG5nP5F", "fee": 1300000, "feeAssetId": null, "timestamp": 1684739242959, "version": 2, "chainId": 84, "sender": "3NBqs2vfpyT5cMdUJ97mEJ1Ycp2y8GbAZDA", "senderPublicKey": "H19CeJVbUnfsK8EYs8K6fHxwBH7pLyxw8WCDFu7D4rGQ", "proofs": [ "5jCScZRacKMD2yQp8Fs5dvNTzr6qn2eKrxecDrxF8wvgMQp3rtYZ2YwB5haHdbCS5BRiGp88fEfqnRzyEzbfACMn" ], "script": "base64:BgKJDggCEgkKBwgBAQEBAQgSAwoBCBIDCgEBEgASABIAEgMKAQESAwoBASIDU0VQIgd3cmFwRXJyIgNtc2ciCHRocm93RXJyIg9nZXRTdHJpbmdPckZhaWwiB2FkZHJlc3MiA2tleSIRa2V5RmFjdG9yeUFkZHJlc3MiGWtleVZvdGluZ1ZlcmlmaWVkQ29udHJhY3QiImtleVZvdGluZ0VtaXNzaW9uQ2FuZGlkYXRlQ29udHJhY3QiFGtleVVzZXJQb29sc0NvbnRyYWN0Ih1rZXlWb3RpbmdFbWlzc2lvblJhdGVDb250cmFjdCIWdm90aW5nVmVyaWZpZWRDb250cmFjdCIfdm90aW5nRW1pc3Npb25DYW5kaWRhdGVDb250cmFjdCIRdXNlclBvb2xzQ29udHJhY3QiGnZvdGluZ0VtaXNzaW9uUmF0ZUNvbnRyYWN0IhhJZHhGYWN0b3J5Q2ZnU3Rha2luZ0RhcHAiGUlkeEZhY3RvcnlDZmdCb29zdGluZ0RhcHAiFElkeEZhY3RvcnlDZmdJZG9EYXBwIhVJZHhGYWN0b3J5Q2Z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YXkEAmFECQEBSgEFAUsEAmFQCQD8BwQFBHRoaXMCGmNoYW5nZVJhdGVQZXJCbG9ja0lOVEVSTkFMCQDMCAIFAmFMBQNuaWwFA25pbAMJAAACBQJhUAUCYVAEAmFRCQD8BwQFAmFEAhVvbkJvb3N0RW1pc3Npb25VcGRhdGUFA25pbAUDbmlsAwkAAAIFAmFRBQJhUQUDbmlsCQACAQIkU3RyaWN0IHZhbHVlIGlzIG5vdCBlcXVhbCB0byBpdHNlbGYuCQACAQIkU3RyaWN0IHZhbHVlIGlzIG5vdCBlcXVhbCB0byBpdHNlbGYuCQACAQIkU3RyaWN0IHZhbHVlIGlzIG5vdCBlcXVhbCB0byBpdHNlbGYuAQJhUgECYVMABAJhVAQCYWcJAQJhaQADCQABAgUCYWcCCkJ5dGVWZWN0b3IEAmFuBQJhZwUCYW4DCQABAgUCYWcCBFVuaXQIBQJhUg9zZW5kZXJQdWJsaWNLZXkJAAIBAgtNYXRjaCBlcnJvcgkA9AMDCAUCYVIJYm9keUJ5dGVzCQCRAwIIBQJhUgZwcm9vZnMAAAUCYVTHIpVx", "height": 2588858, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: G2Zj4b9i7UYRfpZiDww9hLhskkgkarz92A7arSiWW2hu Next: 7KmV8ToB9LfirUM3VZoz2ioATBBNs5vtAkeEkEzVgxdN Diff:
OldNewDifferences
257257
258258
259259 @Callable(i)
260-func changeRatePerBlock (newRatePerBlock) = {
261- let check = if ((i.caller == votingEmissionRateContract))
260+func changeRatePerBlockINTERNAL (newRatePerBlock) = {
261+ let check = if ((i.caller == this))
262262 then true
263263 else throwErr("should be invoked internally")
264264 if ((check == check))
270270 throwErr("BlockInfo.timestamp error")
271271 }
272272 [IntegerEntry(keyRatePerBlockStartFrom(blockTimestamp, height), newRatePerBlock), IntegerEntry(keyRatePerBlockCurrent(), newRatePerBlock)]
273+ }
274+ else throw("Strict value is not equal to itself.")
275+ }
276+
277+
278+
279+@Callable(i)
280+func changeRatePerBlock (newRatePerBlock) = {
281+ let check = if ((i.caller == votingEmissionRateContract))
282+ then true
283+ else throwErr("should be invoked by votingEmissionRateContract")
284+ if ((check == check))
285+ then {
286+ let factoryContract = readFactoryAddressOrFail()
287+ let factoryCfg = readFactoryCfgOrFail(factoryContract)
288+ let boostingContract = getBoostingAddressOrFail(factoryCfg)
289+ let internalInv = invoke(this, "changeRatePerBlockINTERNAL", [newRatePerBlock], nil)
290+ if ((internalInv == internalInv))
291+ then {
292+ let boostingInvoke = invoke(boostingContract, "onBoostEmissionUpdate", nil, nil)
293+ if ((boostingInvoke == boostingInvoke))
294+ then nil
295+ else throw("Strict value is not equal to itself.")
296+ }
297+ else throw("Strict value is not equal to itself.")
273298 }
274299 else throw("Strict value is not equal to itself.")
275300 }
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
2424 let keyVotingEmissionRateContract = "%s%s__config__votingEmissionRateContract"
2525
2626 let votingVerifiedContract = addressFromStringValue(getStringOrFail(this, keyVotingVerifiedContract))
2727
2828 let votingEmissionCandidateContract = addressFromStringValue(getStringOrFail(this, keyVotingEmissionCandidateContract))
2929
3030 let userPoolsContract = addressFromStringValue(getStringOrFail(this, keyUserPoolsContract))
3131
3232 let votingEmissionRateContract = addressFromStringValue(getStringOrFail(this, keyVotingEmissionRateContract))
3333
3434 let IdxFactoryCfgStakingDapp = 1
3535
3636 let IdxFactoryCfgBoostingDapp = 2
3737
3838 let IdxFactoryCfgIdoDapp = 3
3939
4040 let IdxFactoryCfgTeamDapp = 4
4141
4242 let IdxFactoryCfgEmissionDapp = 5
4343
4444 let IdxFactoryCfgRestDapp = 6
4545
4646 let IdxFactoryCfgSlippageDapp = 7
4747
4848 let IdxFactoryCfgGwxRewardDapp = 10
4949
5050 func keyFactoryCfg () = "%s__factoryConfig"
5151
5252
5353 func keyFactoryLp2AssetsMapping (lpAssetStr) = makeString(["%s%s%s", lpAssetStr, "mappings__lpAsset2PoolContract"], SEP)
5454
5555
5656 func keyFactoryLpList () = "%s__lpTokensList"
5757
5858
5959 func keyFactoryLpAssetToPoolContractAddress (lpAssetStr) = makeString(["%s%s%s", lpAssetStr, "mappings__lpAsset2PoolContract"], SEP)
6060
6161
6262 func keyFactoryPoolWeight (contractAddress) = makeString(["%s%s", "poolWeight", contractAddress], SEP)
6363
6464
6565 func readFactoryAddressOrFail () = addressFromStringValue(getStringOrFail(this, keyFactoryAddress()))
6666
6767
6868 func readLpList () = split(valueOrElse(getString(readFactoryAddressOrFail(), keyFactoryLpList()), ""), SEP)
6969
7070
7171 func readFactoryCfgOrFail (factory) = split(getStringOrFail(factory, keyFactoryCfg()), SEP)
7272
7373
7474 func getBoostingAddressOrFail (factoryCfg) = addressFromStringValue(factoryCfg[IdxFactoryCfgBoostingDapp])
7575
7676
7777 func getEmissionAddressOrFail (factoryCfg) = addressFromStringValue(factoryCfg[IdxFactoryCfgEmissionDapp])
7878
7979
8080 func getStakingAddressOrFail (factoryCfg) = addressFromStringValue(factoryCfg[IdxFactoryCfgStakingDapp])
8181
8282
8383 func getGwxRewardAddressOrFail (factoryCfg) = addressFromStringValue(factoryCfg[IdxFactoryCfgGwxRewardDapp])
8484
8585
8686 func keyConfig () = "%s__config"
8787
8888
8989 func keyRatePerBlockMaxCurrent () = "%s%s__ratePerBlockMax__current"
9090
9191
9292 func keyRatePerBlockMaxStartFrom (timestamp,block) = makeString(["%s%s%d%d__ratePerBlockMax__start", toString(timestamp), toString(block)], SEP)
9393
9494
9595 func keyRatePerBlockCurrent () = "%s%s__ratePerBlock__current"
9696
9797
9898 func keyRatePerBlockStartFrom (timestamp,block) = makeString(["%s%s%d%d__ratePerBlock__start", toString(timestamp), toString(block)], SEP)
9999
100100
101101 func keyEmissionStartBlock () = "%s%s__emission__startBlock"
102102
103103
104104 func keyEmissionDurationInBlocks () = "%s%s__emission__duration"
105105
106106
107107 func keyEmissionEndBlock () = "%s%s__emission__endBlock"
108108
109109
110110 func keyBoostCoeff () = "%s__boostCoeff"
111111
112112
113113 let boostCoeffDefault = 3
114114
115115 let boostCoeff = valueOrElse(getInteger(this, keyBoostCoeff()), boostCoeffDefault)
116116
117117 func keyGwxHoldersRewardCurrent () = "%s%s__gwxHoldersReward__current"
118118
119119
120120 func keyGwxHoldersRewardNext () = "%s%s__gwxHoldersReward__next"
121121
122122
123123 func keyManagerPublicKey () = "%s__managerPublicKey"
124124
125125
126126 func keyManagerVaultAddress () = "%s__managerVaultAddress"
127127
128128
129129 func getManagerVaultAddressOrThis () = match getString(keyManagerVaultAddress()) {
130130 case s: String =>
131131 addressFromStringValue(s)
132132 case _ =>
133133 this
134134 }
135135
136136
137137 func managerPublicKeyOrUnit () = {
138138 let managerVaultAddress = getManagerVaultAddressOrThis()
139139 match getString(managerVaultAddress, keyManagerPublicKey()) {
140140 case s: String =>
141141 fromBase58String(s)
142142 case _: Unit =>
143143 unit
144144 case _ =>
145145 throw("Match error")
146146 }
147147 }
148148
149149
150150 func mustManager (i) = {
151151 let pd = throwErr("Permission denied")
152152 match managerPublicKeyOrUnit() {
153153 case pk: ByteVector =>
154154 if ((i.callerPublicKey == pk))
155155 then true
156156 else pd
157157 case _: Unit =>
158158 if ((i.caller == this))
159159 then true
160160 else pd
161161 case _ =>
162162 throw("Match error")
163163 }
164164 }
165165
166166
167167 @Callable(i)
168168 func constructor (factoryAddress,ratePerBlockMax,ratePerBlock,emissionStartBlock,emissionDuration,emissionStartTimestamp,wxAssetIdStr) = {
169169 let checkCaller = mustManager(i)
170170 if ((checkCaller == checkCaller))
171171 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))]
172172 else throw("Strict value is not equal to itself.")
173173 }
174174
175175
176176
177177 @Callable(i)
178178 func constructorV2 (votingVerifiedContractPrm) = {
179179 let checkCaller = mustManager(i)
180180 if ((checkCaller == checkCaller))
181181 then $Tuple2([StringEntry(keyVotingVerifiedContract, votingVerifiedContractPrm)], unit)
182182 else throw("Strict value is not equal to itself.")
183183 }
184184
185185
186186
187187 @Callable(i)
188188 func emit (amount) = if ((0 >= amount))
189189 then $Tuple2(nil, nil)
190190 else {
191191 let factoryContract = readFactoryAddressOrFail()
192192 let factoryCfg = readFactoryCfgOrFail(factoryContract)
193193 let stakingContract = getStakingAddressOrFail(factoryCfg)
194194 let gwxRewardsContract = getGwxRewardAddressOrFail(factoryCfg)
195195 let caller = i.caller
196196 if (if ((caller != stakingContract))
197197 then (caller != gwxRewardsContract)
198198 else false)
199199 then throwErr("permissions denied")
200200 else {
201201 let wxAssetIdStr = split(getStringOrFail(this, keyConfig()), SEP)[1]
202202 let wxAssetId = fromBase58String(wxAssetIdStr)
203203 $Tuple2([ScriptTransfer(caller, amount, wxAssetId)], [wxAssetId])
204204 }
205205 }
206206
207207
208208
209209 @Callable(i)
210210 func burn () = {
211211 let factoryContract = readFactoryAddressOrFail()
212212 let factoryCfg = readFactoryCfgOrFail(factoryContract)
213213 let boostingContract = getBoostingAddressOrFail(factoryCfg)
214214 if ((size(i.payments) != 1))
215215 then throwErr("exact one payment is allowed")
216216 else {
217217 let pmt = i.payments[0]
218218 let assetId = value(pmt.assetId)
219219 let pmtAmount = pmt.amount
220220 let wxAssetId = fromBase58String(split(getStringOrFail(this, keyConfig()), SEP)[1])
221221 if ((assetId != wxAssetId))
222222 then throwErr("invalid wxAssetId is passed")
223223 else if (!(containsElement([boostingContract, votingVerifiedContract, votingEmissionCandidateContract, userPoolsContract], i.caller)))
224224 then throwErr("permissions denied")
225225 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))]
226226 }
227227 }
228228
229229
230230
231231 @Callable(i)
232232 func gwxHoldersRewardUpdate () = {
233233 let factoryContract = readFactoryAddressOrFail()
234234 let factoryCfg = readFactoryCfgOrFail(factoryContract)
235235 let gwxRewardsContract = getGwxRewardAddressOrFail(factoryCfg)
236236 let checkCaller = if ((i.caller == gwxRewardsContract))
237237 then true
238238 else mustManager(i)
239239 if ((checkCaller == checkCaller))
240240 then {
241241 let gwxHolderRewardCurrent = valueOrElse(getInteger(keyGwxHoldersRewardCurrent()), 0)
242242 let gwxHolderRewardNext = valueOrElse(getInteger(keyGwxHoldersRewardNext()), gwxHolderRewardCurrent)
243243 let shouldBeUpdated = (gwxHolderRewardCurrent != gwxHolderRewardNext)
244244 let actions = if (shouldBeUpdated)
245245 then [IntegerEntry(keyGwxHoldersRewardCurrent(), gwxHolderRewardNext), DeleteEntry(keyGwxHoldersRewardNext())]
246246 else nil
247247 $Tuple2(actions, shouldBeUpdated)
248248 }
249249 else throw("Strict value is not equal to itself.")
250250 }
251251
252252
253253
254254 @Callable(i)
255255 func getBoostCoeffREADONLY () = $Tuple2(nil, boostCoeff)
256256
257257
258258
259259 @Callable(i)
260-func changeRatePerBlock (newRatePerBlock) = {
261- let check = if ((i.caller == votingEmissionRateContract))
260+func changeRatePerBlockINTERNAL (newRatePerBlock) = {
261+ let check = if ((i.caller == this))
262262 then true
263263 else throwErr("should be invoked internally")
264264 if ((check == check))
265265 then {
266266 let blockTimestamp = match blockInfoByHeight(height) {
267267 case bi: BlockInfo =>
268268 bi.timestamp
269269 case _ =>
270270 throwErr("BlockInfo.timestamp error")
271271 }
272272 [IntegerEntry(keyRatePerBlockStartFrom(blockTimestamp, height), newRatePerBlock), IntegerEntry(keyRatePerBlockCurrent(), newRatePerBlock)]
273+ }
274+ else throw("Strict value is not equal to itself.")
275+ }
276+
277+
278+
279+@Callable(i)
280+func changeRatePerBlock (newRatePerBlock) = {
281+ let check = if ((i.caller == votingEmissionRateContract))
282+ then true
283+ else throwErr("should be invoked by votingEmissionRateContract")
284+ if ((check == check))
285+ then {
286+ let factoryContract = readFactoryAddressOrFail()
287+ let factoryCfg = readFactoryCfgOrFail(factoryContract)
288+ let boostingContract = getBoostingAddressOrFail(factoryCfg)
289+ let internalInv = invoke(this, "changeRatePerBlockINTERNAL", [newRatePerBlock], nil)
290+ if ((internalInv == internalInv))
291+ then {
292+ let boostingInvoke = invoke(boostingContract, "onBoostEmissionUpdate", nil, nil)
293+ if ((boostingInvoke == boostingInvoke))
294+ then nil
295+ else throw("Strict value is not equal to itself.")
296+ }
297+ else throw("Strict value is not equal to itself.")
273298 }
274299 else throw("Strict value is not equal to itself.")
275300 }
276301
277302
278303 @Verifier(tx)
279304 func verify () = {
280305 let targetPublicKey = match managerPublicKeyOrUnit() {
281306 case pk: ByteVector =>
282307 pk
283308 case _: Unit =>
284309 tx.senderPublicKey
285310 case _ =>
286311 throw("Match error")
287312 }
288313 sigVerify(tx.bodyBytes, tx.proofs[0], targetPublicKey)
289314 }
290315

github/deemru/w8io/026f985 
56.60 ms