tx · 4okyA9gs8PXLfYhfdto5m9HMC1pvQetxUbfMY5H9S82o

3NBqs2vfpyT5cMdUJ97mEJ1Ycp2y8GbAZDA:  -0.01300000 Waves

2023.04.18 13:16 [2539861] smart account 3NBqs2vfpyT5cMdUJ97mEJ1Ycp2y8GbAZDA > SELF 0.00000000 Waves

{ "type": 13, "id": "4okyA9gs8PXLfYhfdto5m9HMC1pvQetxUbfMY5H9S82o", "fee": 1300000, "feeAssetId": null, "timestamp": 1681812989419, "version": 2, "chainId": 84, "sender": "3NBqs2vfpyT5cMdUJ97mEJ1Ycp2y8GbAZDA", "senderPublicKey": "H19CeJVbUnfsK8EYs8K6fHxwBH7pLyxw8WCDFu7D4rGQ", "proofs": [ "5aEH93GkvHEPoSTztwm1YuD4ZXtXG86opoD7pCosx9AEMWBzrcgLGE4kUivvuD1iwrwSxWjKVjmVmNgM7j9MqH7j" ], "script": "base64:BgLLDQgCEgkKBwgBAQEBAQgSAwoBCBIDCgEBEgASABIDCgEIEgASACIDU0VQIgd3cmFwRXJyIgNtc2ciCHRocm93RXJyIg9nZXRTdHJpbmdPckZhaWwiB2FkZHJlc3MiA2tleSIRa2V5RmFjdG9yeUFkZHJlc3MiGWtleVZvdGluZ1ZlcmlmaWVkQ29udHJhY3QiImtleVZvdGluZ0VtaXNzaW9uQ2FuZGlkYXRlQ29udHJhY3QiFGtleVVzZXJQb29sc0NvbnRyYWN0IhZ2b3RpbmdWZXJpZmllZENvbnRyYWN0Ih92b3RpbmdFbWlzc2lvbkNhbmRpZGF0ZUNvbnRyYWN0IhF1c2VyUG9vbHNDb250cmFjdCIYSWR4RmFjdG9yeUNmZ1N0YWtpbmdEYXBwIhlJZHhGYWN0b3J5Q2ZnQm9vc3RpbmdEYXBwIhRJZHhGYWN0b3J5Q2ZnSWRvRGFwcCIVSWR4RmFjdG9yeUNmZ1RlYW1EYXBwIhlJZHhGYWN0b3J5Q2ZnRW1pc3Npb25EYXBwIhVJZHhGYWN0b3J5Q2ZnUmVzd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wFAmFmBQJhbAMJAAECBQJhZgIEVW5pdAgFAmFPD3NlbmRlclB1YmxpY0tleQkAAgECC01hdGNoIGVycm9yCQD0AwMIBQJhTwlib2R5Qnl0ZXMJAJEDAggFAmFPBnByb29mcwAABQJhUbB0XpA=", "height": 2539861, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: 4M8AEUuhVe2LGh2AJayJAGKCnMvfzgTKfU11XeJZbQcC Next: 9vzsiqofpS5Cj8Ny4cxoArxyzgs9jg7YRVSWb5bUC3tW Diff:
OldNewDifferences
238238 then {
239239 let gwxHolderRewardCurrent = valueOrElse(getInteger(keyGwxHoldersRewardCurrent()), 0)
240240 let gwxHolderRewardNext = valueOrElse(getInteger(keyGwxHoldersRewardNext()), gwxHolderRewardCurrent)
241- let actions = if ((gwxHolderRewardCurrent == gwxHolderRewardNext))
242- then nil
243- else [IntegerEntry(keyGwxHoldersRewardCurrent(), gwxHolderRewardNext), DeleteEntry(keyGwxHoldersRewardNext())]
244- $Tuple2(actions, unit)
241+ let shouldBeUpdated = (gwxHolderRewardCurrent != gwxHolderRewardNext)
242+ let actions = if (shouldBeUpdated)
243+ then [IntegerEntry(keyGwxHoldersRewardCurrent(), gwxHolderRewardNext), DeleteEntry(keyGwxHoldersRewardNext())]
244+ else nil
245+ $Tuple2(actions, shouldBeUpdated)
245246 }
246247 else throw("Strict value is not equal to itself.")
247248 }
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 votingVerifiedContract = addressFromStringValue(getStringOrFail(this, keyVotingVerifiedContract))
2525
2626 let votingEmissionCandidateContract = addressFromStringValue(getStringOrFail(this, keyVotingEmissionCandidateContract))
2727
2828 let userPoolsContract = addressFromStringValue(getStringOrFail(this, keyUserPoolsContract))
2929
3030 let IdxFactoryCfgStakingDapp = 1
3131
3232 let IdxFactoryCfgBoostingDapp = 2
3333
3434 let IdxFactoryCfgIdoDapp = 3
3535
3636 let IdxFactoryCfgTeamDapp = 4
3737
3838 let IdxFactoryCfgEmissionDapp = 5
3939
4040 let IdxFactoryCfgRestDapp = 6
4141
4242 let IdxFactoryCfgSlippageDapp = 7
4343
4444 let IdxFactoryCfgGwxRewardDapp = 10
4545
4646 func keyFactoryCfg () = "%s__factoryConfig"
4747
4848
4949 func keyFactoryLp2AssetsMapping (lpAssetStr) = makeString(["%s%s%s", lpAssetStr, "mappings__lpAsset2PoolContract"], SEP)
5050
5151
5252 func keyFactoryLpList () = "%s__lpTokensList"
5353
5454
5555 func keyFactoryLpAssetToPoolContractAddress (lpAssetStr) = makeString(["%s%s%s", lpAssetStr, "mappings__lpAsset2PoolContract"], SEP)
5656
5757
5858 func keyFactoryPoolWeight (contractAddress) = makeString(["%s%s", "poolWeight", contractAddress], SEP)
5959
6060
6161 func readFactoryAddressOrFail () = addressFromStringValue(getStringOrFail(this, keyFactoryAddress()))
6262
6363
6464 func readLpList () = split(valueOrElse(getString(readFactoryAddressOrFail(), keyFactoryLpList()), ""), SEP)
6565
6666
6767 func readFactoryCfgOrFail (factory) = split(getStringOrFail(factory, keyFactoryCfg()), SEP)
6868
6969
7070 func getBoostingAddressOrFail (factoryCfg) = addressFromStringValue(factoryCfg[IdxFactoryCfgBoostingDapp])
7171
7272
7373 func getEmissionAddressOrFail (factoryCfg) = addressFromStringValue(factoryCfg[IdxFactoryCfgEmissionDapp])
7474
7575
7676 func getStakingAddressOrFail (factoryCfg) = addressFromStringValue(factoryCfg[IdxFactoryCfgStakingDapp])
7777
7878
7979 func getGwxRewardAddressOrFail (factoryCfg) = addressFromStringValue(factoryCfg[IdxFactoryCfgGwxRewardDapp])
8080
8181
8282 func keyConfig () = "%s__config"
8383
8484
8585 func keyRatePerBlockMaxCurrent () = "%s%s__ratePerBlockMax__current"
8686
8787
8888 func keyRatePerBlockMaxStartFrom (timestamp,block) = makeString(["%s%s%d%d__ratePerBlockMax__start", toString(timestamp), toString(block)], SEP)
8989
9090
9191 func keyRatePerBlockCurrent () = "%s%s__ratePerBlock__current"
9292
9393
9494 func keyRatePerBlockNext () = "%s%s__ratePerBlock__next"
9595
9696
9797 func keyRatePerBlockStartFrom (timestamp,block) = makeString(["%s%s%d%d__ratePerBlock__start", toString(timestamp), toString(block)], SEP)
9898
9999
100100 func keyEmissionStartBlock () = "%s%s__emission__startBlock"
101101
102102
103103 func keyEmissionDurationInBlocks () = "%s%s__emission__duration"
104104
105105
106106 func keyEmissionEndBlock () = "%s%s__emission__endBlock"
107107
108108
109109 func keyBoostCoeff () = "%s__boostCoeff"
110110
111111
112112 let boostCoeffDefault = 3
113113
114114 let boostCoeff = valueOrElse(getInteger(this, keyBoostCoeff()), boostCoeffDefault)
115115
116116 func keyGwxHoldersRewardCurrent () = "%s%s__gwxHoldersReward__current"
117117
118118
119119 func keyGwxHoldersRewardNext () = "%s%s__gwxHoldersReward__next"
120120
121121
122122 func keyManagerPublicKey () = "%s__managerPublicKey"
123123
124124
125125 func keyPendingManagerPublicKey () = "%s__pendingManagerPublicKey"
126126
127127
128128 func managerPublicKeyOrUnit () = match getString(keyManagerPublicKey()) {
129129 case s: String =>
130130 fromBase58String(s)
131131 case _: Unit =>
132132 unit
133133 case _ =>
134134 throw("Match error")
135135 }
136136
137137
138138 func pendingManagerPublicKeyOrUnit () = match getString(keyPendingManagerPublicKey()) {
139139 case s: String =>
140140 fromBase58String(s)
141141 case _: Unit =>
142142 unit
143143 case _ =>
144144 throw("Match error")
145145 }
146146
147147
148148 func mustManager (i) = {
149149 let pd = throwErr("Permission denied")
150150 match managerPublicKeyOrUnit() {
151151 case pk: ByteVector =>
152152 if ((i.callerPublicKey == pk))
153153 then true
154154 else pd
155155 case _: Unit =>
156156 if ((i.caller == this))
157157 then true
158158 else pd
159159 case _ =>
160160 throw("Match error")
161161 }
162162 }
163163
164164
165165 @Callable(i)
166166 func constructor (factoryAddress,ratePerBlockMax,ratePerBlock,emissionStartBlock,emissionDuration,emissionStartTimestamp,wxAssetIdStr) = {
167167 let checkCaller = mustManager(i)
168168 if ((checkCaller == checkCaller))
169169 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))]
170170 else throw("Strict value is not equal to itself.")
171171 }
172172
173173
174174
175175 @Callable(i)
176176 func constructorV2 (votingVerifiedContractPrm) = {
177177 let checkCaller = mustManager(i)
178178 if ((checkCaller == checkCaller))
179179 then $Tuple2([StringEntry(keyVotingVerifiedContract, votingVerifiedContractPrm)], unit)
180180 else throw("Strict value is not equal to itself.")
181181 }
182182
183183
184184
185185 @Callable(i)
186186 func emit (amount) = if ((0 >= amount))
187187 then $Tuple2(nil, nil)
188188 else {
189189 let factoryContract = readFactoryAddressOrFail()
190190 let factoryCfg = readFactoryCfgOrFail(factoryContract)
191191 let stakingContract = getStakingAddressOrFail(factoryCfg)
192192 let gwxRewardsContract = getGwxRewardAddressOrFail(factoryCfg)
193193 let caller = i.caller
194194 if (if ((caller != stakingContract))
195195 then (caller != gwxRewardsContract)
196196 else false)
197197 then throwErr("permissions denied")
198198 else {
199199 let wxAssetIdStr = split(getStringOrFail(this, keyConfig()), SEP)[1]
200200 let wxAssetId = fromBase58String(wxAssetIdStr)
201201 $Tuple2([ScriptTransfer(caller, amount, wxAssetId)], [wxAssetId])
202202 }
203203 }
204204
205205
206206
207207 @Callable(i)
208208 func burn () = {
209209 let factoryContract = readFactoryAddressOrFail()
210210 let factoryCfg = readFactoryCfgOrFail(factoryContract)
211211 let boostingContract = getBoostingAddressOrFail(factoryCfg)
212212 if ((size(i.payments) != 1))
213213 then throwErr("exact one payment is allowed")
214214 else {
215215 let pmt = i.payments[0]
216216 let assetId = value(pmt.assetId)
217217 let pmtAmount = pmt.amount
218218 let wxAssetId = fromBase58String(split(getStringOrFail(this, keyConfig()), SEP)[1])
219219 if ((assetId != wxAssetId))
220220 then throwErr("invalid wxAssetId is passed")
221221 else if (!(containsElement([boostingContract, votingVerifiedContract, votingEmissionCandidateContract, userPoolsContract], i.caller)))
222222 then throwErr("permissions denied")
223223 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))]
224224 }
225225 }
226226
227227
228228
229229 @Callable(i)
230230 func gwxHoldersRewardUpdate () = {
231231 let factoryContract = readFactoryAddressOrFail()
232232 let factoryCfg = readFactoryCfgOrFail(factoryContract)
233233 let gwxRewardsContract = getGwxRewardAddressOrFail(factoryCfg)
234234 let checkCaller = if ((i.caller == gwxRewardsContract))
235235 then true
236236 else mustManager(i)
237237 if ((checkCaller == checkCaller))
238238 then {
239239 let gwxHolderRewardCurrent = valueOrElse(getInteger(keyGwxHoldersRewardCurrent()), 0)
240240 let gwxHolderRewardNext = valueOrElse(getInteger(keyGwxHoldersRewardNext()), gwxHolderRewardCurrent)
241- let actions = if ((gwxHolderRewardCurrent == gwxHolderRewardNext))
242- then nil
243- else [IntegerEntry(keyGwxHoldersRewardCurrent(), gwxHolderRewardNext), DeleteEntry(keyGwxHoldersRewardNext())]
244- $Tuple2(actions, unit)
241+ let shouldBeUpdated = (gwxHolderRewardCurrent != gwxHolderRewardNext)
242+ let actions = if (shouldBeUpdated)
243+ then [IntegerEntry(keyGwxHoldersRewardCurrent(), gwxHolderRewardNext), DeleteEntry(keyGwxHoldersRewardNext())]
244+ else nil
245+ $Tuple2(actions, shouldBeUpdated)
245246 }
246247 else throw("Strict value is not equal to itself.")
247248 }
248249
249250
250251
251252 @Callable(i)
252253 func setManager (pendingManagerPublicKey) = {
253254 let checkCaller = mustManager(i)
254255 if ((checkCaller == checkCaller))
255256 then {
256257 let checkManagerPublicKey = fromBase58String(pendingManagerPublicKey)
257258 if ((checkManagerPublicKey == checkManagerPublicKey))
258259 then [StringEntry(keyPendingManagerPublicKey(), pendingManagerPublicKey)]
259260 else throw("Strict value is not equal to itself.")
260261 }
261262 else throw("Strict value is not equal to itself.")
262263 }
263264
264265
265266
266267 @Callable(i)
267268 func confirmManager () = {
268269 let pm = pendingManagerPublicKeyOrUnit()
269270 let hasPM = if (isDefined(pm))
270271 then true
271272 else throwErr("No pending manager")
272273 if ((hasPM == hasPM))
273274 then {
274275 let checkPM = if ((i.callerPublicKey == value(pm)))
275276 then true
276277 else throwErr("You are not pending manager")
277278 if ((checkPM == checkPM))
278279 then [StringEntry(keyManagerPublicKey(), toBase58String(value(pm))), DeleteEntry(keyPendingManagerPublicKey())]
279280 else throw("Strict value is not equal to itself.")
280281 }
281282 else throw("Strict value is not equal to itself.")
282283 }
283284
284285
285286
286287 @Callable(i)
287288 func getBoostCoeffREADONLY () = $Tuple2(nil, boostCoeff)
288289
289290
290291 @Verifier(tx)
291292 func verify () = {
292293 let targetPublicKey = match managerPublicKeyOrUnit() {
293294 case pk: ByteVector =>
294295 pk
295296 case _: Unit =>
296297 tx.senderPublicKey
297298 case _ =>
298299 throw("Match error")
299300 }
300301 sigVerify(tx.bodyBytes, tx.proofs[0], targetPublicKey)
301302 }
302303

github/deemru/w8io/026f985 
54.20 ms