tx · 86V7ovYsNMTAbaA99dhcFUvhMdSrbAGPcYJrXYTf1wpY

3NBqs2vfpyT5cMdUJ97mEJ1Ycp2y8GbAZDA:  -0.01300000 Waves

2023.05.29 10:26 [2598965] smart account 3NBqs2vfpyT5cMdUJ97mEJ1Ycp2y8GbAZDA > SELF 0.00000000 Waves

{ "type": 13, "id": "86V7ovYsNMTAbaA99dhcFUvhMdSrbAGPcYJrXYTf1wpY", "fee": 1300000, "feeAssetId": null, "timestamp": 1685345157814, "version": 2, "chainId": 84, "sender": "3NBqs2vfpyT5cMdUJ97mEJ1Ycp2y8GbAZDA", "senderPublicKey": "H19CeJVbUnfsK8EYs8K6fHxwBH7pLyxw8WCDFu7D4rGQ", "proofs": [ "3MPL9mbA5zAZdfJ7aiu9D1yPHVYpi8vvx6X8yemaBv3boNRDZPXD7B4WUknCxoQ4vrKTfud1jhXkajp18DkeMEBf" ], "script": "base64:AAIFAAAAAAAABf0IAhIJCgcIAQEBAQEIEgMKAQgSAwoBARIAEgAiA1NFUCIHd3JhcEVyciIDbXNnIgh0aHJvd0VyciIPZ2V0U3RyaW5nT3JGYWlsIgdhZGRyZXNzIgNrZXkiEWtleUZhY3RvcnlBZGRyZXNzIhlrZXlWb3RpbmdWZXJpZmllZENvbnRyYWN0IiJrZXlWb3RpbmdFbWlzc2lvbkNhbmRpZGF0ZUNvbnRyYWN0IhRrZXlVc2VyUG9vbHNDb250cmFjdCIWdm90aW5nVmVyaWZpZWRDb250cmFjdCIfdm90aW5nRW1pc3Npb25DYW5kaWRhdGVDb250cmFjdCIRdXNlclBvb2xzQ29udHJhY3QiGElkeEZhY3RvcnlDZmdTdGFraW5nRGFwcCIZSWR4RmFjdG9yeUNmZ0Jvb3N0aW5nRGFwcCIUSWR4RmFjdG9yeUNmZ0lkb0RhcHAiFUlkeEZhY3RvcnlDZmdUZWFtRGFwcCIZSWR4RmFjdG9yeUNmZ0VtaXNzaW9uRGFwcCIVSWR4RmFjdG9yeUNmZ1Jlc3REYXB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965, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: 8b3mA5FnSW2UjPXr1AkwhytFELCBpd2LHDSVDnUkUzfd Next: FEzvvvkhm6XxPJQLEH2u3REURnSBt6rd6JRKNbLXRnWi Diff:
OldNewDifferences
1-{-# STDLIB_VERSION 6 #-}
1+{-# STDLIB_VERSION 5 #-}
22 {-# SCRIPT_TYPE ACCOUNT #-}
33 {-# CONTENT_TYPE DAPP #-}
44 let SEP = "__"
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
113109 let boostCoeffDefault = 3
114110
115111 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-
122112
123113 func keyManagerPublicKey () = "%s__managerPublicKey"
124114
229219
230220
231221 @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)
255222 func getBoostCoeffREADONLY () = $Tuple2(nil, boostCoeff)
256-
257-
258-
259-@Callable(i)
260-func changeRatePerBlockINTERNAL (newRatePerBlock) = {
261- let check = if ((i.caller == this))
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-
277-
278-
279-@Callable(i)
280-func changeRatePerBlock (newRatePerBlock) = {
281- let check = if (if ((i.caller == votingEmissionRateContract))
282- then true
283- else mustManager(i))
284- then true
285- else throwErr("should be invoked by votingEmissionRateContract")
286- if ((check == check))
287- then {
288- let factoryContract = readFactoryAddressOrFail()
289- let factoryCfg = readFactoryCfgOrFail(factoryContract)
290- let boostingContract = getBoostingAddressOrFail(factoryCfg)
291- let internalInv = invoke(this, "changeRatePerBlockINTERNAL", [newRatePerBlock], nil)
292- if ((internalInv == internalInv))
293- then nil
294- else throw("Strict value is not equal to itself.")
295- }
296- else throw("Strict value is not equal to itself.")
297- }
298223
299224
300225 @Verifier(tx)
Full:
OldNewDifferences
1-{-# STDLIB_VERSION 6 #-}
1+{-# STDLIB_VERSION 5 #-}
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"
9692
9793
9894 func keyRatePerBlockStartFrom (timestamp,block) = makeString(["%s%s%d%d__ratePerBlock__start", toString(timestamp), toString(block)], SEP)
9995
10096
10197 func keyEmissionStartBlock () = "%s%s__emission__startBlock"
10298
10399
104100 func keyEmissionDurationInBlocks () = "%s%s__emission__duration"
105101
106102
107103 func keyEmissionEndBlock () = "%s%s__emission__endBlock"
108104
109105
110106 func keyBoostCoeff () = "%s__boostCoeff"
111107
112108
113109 let boostCoeffDefault = 3
114110
115111 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-
122112
123113 func keyManagerPublicKey () = "%s__managerPublicKey"
124114
125115
126116 func keyManagerVaultAddress () = "%s__managerVaultAddress"
127117
128118
129119 func getManagerVaultAddressOrThis () = match getString(keyManagerVaultAddress()) {
130120 case s: String =>
131121 addressFromStringValue(s)
132122 case _ =>
133123 this
134124 }
135125
136126
137127 func managerPublicKeyOrUnit () = {
138128 let managerVaultAddress = getManagerVaultAddressOrThis()
139129 match getString(managerVaultAddress, keyManagerPublicKey()) {
140130 case s: String =>
141131 fromBase58String(s)
142132 case _: Unit =>
143133 unit
144134 case _ =>
145135 throw("Match error")
146136 }
147137 }
148138
149139
150140 func mustManager (i) = {
151141 let pd = throwErr("Permission denied")
152142 match managerPublicKeyOrUnit() {
153143 case pk: ByteVector =>
154144 if ((i.callerPublicKey == pk))
155145 then true
156146 else pd
157147 case _: Unit =>
158148 if ((i.caller == this))
159149 then true
160150 else pd
161151 case _ =>
162152 throw("Match error")
163153 }
164154 }
165155
166156
167157 @Callable(i)
168158 func constructor (factoryAddress,ratePerBlockMax,ratePerBlock,emissionStartBlock,emissionDuration,emissionStartTimestamp,wxAssetIdStr) = {
169159 let checkCaller = mustManager(i)
170160 if ((checkCaller == checkCaller))
171161 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))]
172162 else throw("Strict value is not equal to itself.")
173163 }
174164
175165
176166
177167 @Callable(i)
178168 func constructorV2 (votingVerifiedContractPrm) = {
179169 let checkCaller = mustManager(i)
180170 if ((checkCaller == checkCaller))
181171 then $Tuple2([StringEntry(keyVotingVerifiedContract, votingVerifiedContractPrm)], unit)
182172 else throw("Strict value is not equal to itself.")
183173 }
184174
185175
186176
187177 @Callable(i)
188178 func emit (amount) = if ((0 >= amount))
189179 then $Tuple2(nil, nil)
190180 else {
191181 let factoryContract = readFactoryAddressOrFail()
192182 let factoryCfg = readFactoryCfgOrFail(factoryContract)
193183 let stakingContract = getStakingAddressOrFail(factoryCfg)
194184 let gwxRewardsContract = getGwxRewardAddressOrFail(factoryCfg)
195185 let caller = i.caller
196186 if (if ((caller != stakingContract))
197187 then (caller != gwxRewardsContract)
198188 else false)
199189 then throwErr("permissions denied")
200190 else {
201191 let wxAssetIdStr = split(getStringOrFail(this, keyConfig()), SEP)[1]
202192 let wxAssetId = fromBase58String(wxAssetIdStr)
203193 $Tuple2([ScriptTransfer(caller, amount, wxAssetId)], [wxAssetId])
204194 }
205195 }
206196
207197
208198
209199 @Callable(i)
210200 func burn () = {
211201 let factoryContract = readFactoryAddressOrFail()
212202 let factoryCfg = readFactoryCfgOrFail(factoryContract)
213203 let boostingContract = getBoostingAddressOrFail(factoryCfg)
214204 if ((size(i.payments) != 1))
215205 then throwErr("exact one payment is allowed")
216206 else {
217207 let pmt = i.payments[0]
218208 let assetId = value(pmt.assetId)
219209 let pmtAmount = pmt.amount
220210 let wxAssetId = fromBase58String(split(getStringOrFail(this, keyConfig()), SEP)[1])
221211 if ((assetId != wxAssetId))
222212 then throwErr("invalid wxAssetId is passed")
223213 else if (!(containsElement([boostingContract, votingVerifiedContract, votingEmissionCandidateContract, userPoolsContract], i.caller)))
224214 then throwErr("permissions denied")
225215 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))]
226216 }
227217 }
228218
229219
230220
231221 @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)
255222 func getBoostCoeffREADONLY () = $Tuple2(nil, boostCoeff)
256-
257-
258-
259-@Callable(i)
260-func changeRatePerBlockINTERNAL (newRatePerBlock) = {
261- let check = if ((i.caller == this))
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-
277-
278-
279-@Callable(i)
280-func changeRatePerBlock (newRatePerBlock) = {
281- let check = if (if ((i.caller == votingEmissionRateContract))
282- then true
283- else mustManager(i))
284- then true
285- else throwErr("should be invoked by votingEmissionRateContract")
286- if ((check == check))
287- then {
288- let factoryContract = readFactoryAddressOrFail()
289- let factoryCfg = readFactoryCfgOrFail(factoryContract)
290- let boostingContract = getBoostingAddressOrFail(factoryCfg)
291- let internalInv = invoke(this, "changeRatePerBlockINTERNAL", [newRatePerBlock], nil)
292- if ((internalInv == internalInv))
293- then nil
294- else throw("Strict value is not equal to itself.")
295- }
296- else throw("Strict value is not equal to itself.")
297- }
298223
299224
300225 @Verifier(tx)
301226 func verify () = {
302227 let targetPublicKey = match managerPublicKeyOrUnit() {
303228 case pk: ByteVector =>
304229 pk
305230 case _: Unit =>
306231 tx.senderPublicKey
307232 case _ =>
308233 throw("Match error")
309234 }
310235 sigVerify(tx.bodyBytes, tx.proofs[0], targetPublicKey)
311236 }
312237

github/deemru/w8io/026f985 
44.77 ms