tx · Ayb9pKfxTvDWNPNkn58SfFd2bbHqSTPHM2WBLwGnm4MQ

3NBqs2vfpyT5cMdUJ97mEJ1Ycp2y8GbAZDA:  -0.01300000 Waves

2023.01.19 12:35 [2411635] smart account 3NBqs2vfpyT5cMdUJ97mEJ1Ycp2y8GbAZDA > SELF 0.00000000 Waves

{ "type": 13, "id": "Ayb9pKfxTvDWNPNkn58SfFd2bbHqSTPHM2WBLwGnm4MQ", "fee": 1300000, "feeAssetId": null, "timestamp": 1674120948934, "version": 1, "sender": "3NBqs2vfpyT5cMdUJ97mEJ1Ycp2y8GbAZDA", "senderPublicKey": "H19CeJVbUnfsK8EYs8K6fHxwBH7pLyxw8WCDFu7D4rGQ", "proofs": [ "2au37BqbhSm9MU2ChQuBSLkjXGBktyZuprBgvy4SZAxzYwDc9HG4tN7XqWkfkVxFGScJF15ACjsgTx5RgzXV7kHp" ], "script": "base64:AAIFAAAAAAAABccIAhIJCgcIAQEBAQEIEgMKAQgSAwoBARIAEgMKAQgSACIDU0VQIg9nZXRTdHJpbmdPckZhaWwiB2FkZHJlc3MiA2tleSIRa2V5RmFjdG9yeUFkZHJlc3MiGWtleVZvdGluZ1ZlcmlmaWVkQ29udHJhY3QiImtleVZvdGluZ0VtaXNzaW9uQ2FuZGlkYXRlQ29udHJhY3QiFnZvdGluZ1ZlcmlmaWVkQ29udHJhY3QiH3ZvdGluZ0VtaXNzaW9uQ2FuZGlkYXRlQ29udHJhY3QiGElkeEZhY3RvcnlDZmdTdGFraW5nRGFwcCIZSWR4RmFjdG9yeUNmZ0Jvb3N0aW5nRGFwcCIUSWR4RmFjdG9yeUNmZ0lkb0RhcHAiFUlkeEZhY3RvcnlDZmdUZWFtRGFwcCIZSWR4RmFjdG9yeUNmZ0VtaXNzaW9uRGFwcCIVSWR4RmFjdG9yeUNmZ1Jlc3REYXBwIhlJZHhGYWN0b3J5Q2ZnU2xpcHBhZ2VEYXBwIhpJZHhGYWN0b3J5Q2ZnR3d4UmV3YXJkRGF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BAAAAAVQAAAAAAwkAAAEAAAACBQAAAAFVAgAAAApCeXRlVmVjdG9yBAAAAAJhYQUAAAABVQUAAAACYWEDCQAAAQAAAAIFAAAAAVUCAAAABFVuaXQIBQAAAAJhegAAAA9zZW5kZXJQdWJsaWNLZXkJAAACAAAAAQIAAAALTWF0Y2ggZXJyb3IJAAH0AAAAAwgFAAAAAmF6AAAACWJvZHlCeXRlcwkAAZEAAAACCAUAAAACYXoAAAAGcHJvb2ZzAAAAAAAAAAAABQAAAAJhQhK4wBM=", "chainId": 84, "height": 2411635, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: GEwEFzibKCDXtAtV7KGiifN6KR3ARsg55brdcDWRsw29 Next: AB1FNxsKPjePuX88Pr6Bxbm5Nk27vKgsPujTT5XFYvGP Diff:
OldNewDifferences
1313
1414 let keyVotingEmissionCandidateContract = "%s%s__config__votingEmissionCandidateContract"
1515
16-let keyUserPoolsContract = "%s%s__config__userPoolsContract"
17-
1816 let votingVerifiedContract = addressFromStringValue(getStringOrFail(this, keyVotingVerifiedContract))
1917
2018 let votingEmissionCandidateContract = addressFromStringValue(getStringOrFail(this, keyVotingEmissionCandidateContract))
21-
22-let userPoolsContract = addressFromStringValue(getStringOrFail(this, keyUserPoolsContract))
2319
2420 let IdxFactoryCfgStakingDapp = 1
2521
196192 let wxAssetId = fromBase58String(split(getStringOrFail(this, keyConfig()), SEP)[1])
197193 if ((assetId != wxAssetId))
198194 then throw("invalid wxAssetId is passed")
199- else if (!(containsElement([boostingContract, votingVerifiedContract, votingEmissionCandidateContract, userPoolsContract], i.caller)))
195+ else if (!(containsElement([boostingContract, votingVerifiedContract, votingEmissionCandidateContract], i.caller)))
200196 then throw("permissions denied")
201197 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))]
202198 }
Full:
OldNewDifferences
11 {-# STDLIB_VERSION 5 #-}
22 {-# SCRIPT_TYPE ACCOUNT #-}
33 {-# CONTENT_TYPE DAPP #-}
44 let SEP = "__"
55
66 func getStringOrFail (address,key) = valueOrErrorMessage(getString(address, key), (("mandatory this." + key) + " is not defined"))
77
88
99 func keyFactoryAddress () = "%s%s__config__factoryAddress"
1010
1111
1212 let keyVotingVerifiedContract = "%s%s__config__votingVerifiedContract"
1313
1414 let keyVotingEmissionCandidateContract = "%s%s__config__votingEmissionCandidateContract"
1515
16-let keyUserPoolsContract = "%s%s__config__userPoolsContract"
17-
1816 let votingVerifiedContract = addressFromStringValue(getStringOrFail(this, keyVotingVerifiedContract))
1917
2018 let votingEmissionCandidateContract = addressFromStringValue(getStringOrFail(this, keyVotingEmissionCandidateContract))
21-
22-let userPoolsContract = addressFromStringValue(getStringOrFail(this, keyUserPoolsContract))
2319
2420 let IdxFactoryCfgStakingDapp = 1
2521
2622 let IdxFactoryCfgBoostingDapp = 2
2723
2824 let IdxFactoryCfgIdoDapp = 3
2925
3026 let IdxFactoryCfgTeamDapp = 4
3127
3228 let IdxFactoryCfgEmissionDapp = 5
3329
3430 let IdxFactoryCfgRestDapp = 6
3531
3632 let IdxFactoryCfgSlippageDapp = 7
3733
3834 let IdxFactoryCfgGwxRewardDapp = 10
3935
4036 func keyFactoryCfg () = "%s__factoryConfig"
4137
4238
4339 func keyFactoryLp2AssetsMapping (lpAssetStr) = makeString(["%s%s%s", lpAssetStr, "mappings__lpAsset2PoolContract"], SEP)
4440
4541
4642 func keyFactoryLpList () = "%s__lpTokensList"
4743
4844
4945 func keyFactoryLpAssetToPoolContractAddress (lpAssetStr) = makeString(["%s%s%s", lpAssetStr, "mappings__lpAsset2PoolContract"], SEP)
5046
5147
5248 func keyFactoryPoolWeight (contractAddress) = makeString(["%s%s", "poolWeight", contractAddress], SEP)
5349
5450
5551 func readFactoryAddressOrFail () = addressFromStringValue(getStringOrFail(this, keyFactoryAddress()))
5652
5753
5854 func readLpList () = split(valueOrElse(getString(readFactoryAddressOrFail(), keyFactoryLpList()), ""), SEP)
5955
6056
6157 func readFactoryCfgOrFail (factory) = split(getStringOrFail(factory, keyFactoryCfg()), SEP)
6258
6359
6460 func getBoostingAddressOrFail (factoryCfg) = addressFromStringValue(factoryCfg[IdxFactoryCfgBoostingDapp])
6561
6662
6763 func getEmissionAddressOrFail (factoryCfg) = addressFromStringValue(factoryCfg[IdxFactoryCfgEmissionDapp])
6864
6965
7066 func getStakingAddressOrFail (factoryCfg) = addressFromStringValue(factoryCfg[IdxFactoryCfgStakingDapp])
7167
7268
7369 func getGwxRewardAddressOrFail (factoryCfg) = addressFromStringValue(factoryCfg[IdxFactoryCfgGwxRewardDapp])
7470
7571
7672 func keyConfig () = "%s__config"
7773
7874
7975 func keyRatePerBlockMaxCurrent () = "%s%s__ratePerBlockMax__current"
8076
8177
8278 func keyRatePerBlockMaxStartFrom (timestamp,block) = makeString(["%s%s%d%d__ratePerBlockMax__start", toString(timestamp), toString(block)], SEP)
8379
8480
8581 func keyRatePerBlockCurrent () = "%s%s__ratePerBlock__current"
8682
8783
8884 func keyRatePerBlockStartFrom (timestamp,block) = makeString(["%s%s%d%d__ratePerBlock__start", toString(timestamp), toString(block)], SEP)
8985
9086
9187 func keyEmissionStartBlock () = "%s%s__emission__startBlock"
9288
9389
9490 func keyEmissionDurationInBlocks () = "%s%s__emission__duration"
9591
9692
9793 func keyEmissionEndBlock () = "%s%s__emission__endBlock"
9894
9995
10096 func keyManagerPublicKey () = "%s__managerPublicKey"
10197
10298
10399 func keyPendingManagerPublicKey () = "%s__pendingManagerPublicKey"
104100
105101
106102 func managerPublicKeyOrUnit () = match getString(keyManagerPublicKey()) {
107103 case s: String =>
108104 fromBase58String(s)
109105 case _: Unit =>
110106 unit
111107 case _ =>
112108 throw("Match error")
113109 }
114110
115111
116112 func pendingManagerPublicKeyOrUnit () = match getString(keyPendingManagerPublicKey()) {
117113 case s: String =>
118114 fromBase58String(s)
119115 case _: Unit =>
120116 unit
121117 case _ =>
122118 throw("Match error")
123119 }
124120
125121
126122 func mustManager (i) = {
127123 let pd = throw("Permission denied")
128124 match managerPublicKeyOrUnit() {
129125 case pk: ByteVector =>
130126 if ((i.callerPublicKey == pk))
131127 then true
132128 else pd
133129 case _: Unit =>
134130 if ((i.caller == this))
135131 then true
136132 else pd
137133 case _ =>
138134 throw("Match error")
139135 }
140136 }
141137
142138
143139 @Callable(i)
144140 func constructor (factoryAddress,ratePerBlockMax,ratePerBlock,emissionStartBlock,emissionDuration,emissionStartTimestamp,wxAssetIdStr) = {
145141 let checkCaller = mustManager(i)
146142 if ((checkCaller == checkCaller))
147143 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))]
148144 else throw("Strict value is not equal to itself.")
149145 }
150146
151147
152148
153149 @Callable(i)
154150 func constructorV2 (votingVerifiedContractPrm) = {
155151 let checkCaller = mustManager(i)
156152 if ((checkCaller == checkCaller))
157153 then $Tuple2([StringEntry(keyVotingVerifiedContract, votingVerifiedContractPrm)], unit)
158154 else throw("Strict value is not equal to itself.")
159155 }
160156
161157
162158
163159 @Callable(i)
164160 func emit (amount) = if ((0 >= amount))
165161 then $Tuple2(nil, nil)
166162 else {
167163 let factoryContract = readFactoryAddressOrFail()
168164 let factoryCfg = readFactoryCfgOrFail(factoryContract)
169165 let stakingContract = getStakingAddressOrFail(factoryCfg)
170166 let gwxRewardsContract = getGwxRewardAddressOrFail(factoryCfg)
171167 let caller = i.caller
172168 if (if ((caller != stakingContract))
173169 then (caller != gwxRewardsContract)
174170 else false)
175171 then throw("permissions denied")
176172 else {
177173 let wxAssetIdStr = split(getStringOrFail(this, keyConfig()), SEP)[1]
178174 let wxAssetId = fromBase58String(wxAssetIdStr)
179175 $Tuple2([ScriptTransfer(caller, amount, wxAssetId)], [wxAssetId])
180176 }
181177 }
182178
183179
184180
185181 @Callable(i)
186182 func burn () = {
187183 let factoryContract = readFactoryAddressOrFail()
188184 let factoryCfg = readFactoryCfgOrFail(factoryContract)
189185 let boostingContract = getBoostingAddressOrFail(factoryCfg)
190186 if ((size(i.payments) != 1))
191187 then throw("exact one payment is allowed")
192188 else {
193189 let pmt = i.payments[0]
194190 let assetId = value(pmt.assetId)
195191 let pmtAmount = pmt.amount
196192 let wxAssetId = fromBase58String(split(getStringOrFail(this, keyConfig()), SEP)[1])
197193 if ((assetId != wxAssetId))
198194 then throw("invalid wxAssetId is passed")
199- else if (!(containsElement([boostingContract, votingVerifiedContract, votingEmissionCandidateContract, userPoolsContract], i.caller)))
195+ else if (!(containsElement([boostingContract, votingVerifiedContract, votingEmissionCandidateContract], i.caller)))
200196 then throw("permissions denied")
201197 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))]
202198 }
203199 }
204200
205201
206202
207203 @Callable(i)
208204 func setManager (pendingManagerPublicKey) = {
209205 let checkCaller = mustManager(i)
210206 if ((checkCaller == checkCaller))
211207 then {
212208 let checkManagerPublicKey = fromBase58String(pendingManagerPublicKey)
213209 if ((checkManagerPublicKey == checkManagerPublicKey))
214210 then [StringEntry(keyPendingManagerPublicKey(), pendingManagerPublicKey)]
215211 else throw("Strict value is not equal to itself.")
216212 }
217213 else throw("Strict value is not equal to itself.")
218214 }
219215
220216
221217
222218 @Callable(i)
223219 func confirmManager () = {
224220 let pm = pendingManagerPublicKeyOrUnit()
225221 let hasPM = if (isDefined(pm))
226222 then true
227223 else throw("No pending manager")
228224 if ((hasPM == hasPM))
229225 then {
230226 let checkPM = if ((i.callerPublicKey == value(pm)))
231227 then true
232228 else throw("You are not pending manager")
233229 if ((checkPM == checkPM))
234230 then [StringEntry(keyManagerPublicKey(), toBase58String(value(pm))), DeleteEntry(keyPendingManagerPublicKey())]
235231 else throw("Strict value is not equal to itself.")
236232 }
237233 else throw("Strict value is not equal to itself.")
238234 }
239235
240236
241237 @Verifier(tx)
242238 func verify () = {
243239 let targetPublicKey = match managerPublicKeyOrUnit() {
244240 case pk: ByteVector =>
245241 pk
246242 case _: Unit =>
247243 tx.senderPublicKey
248244 case _ =>
249245 throw("Match error")
250246 }
251247 sigVerify(tx.bodyBytes, tx.proofs[0], targetPublicKey)
252248 }
253249

github/deemru/w8io/026f985 
49.75 ms