tx · 2r1pMMbvY2SayHU6Q9bLG2vvKAW8Nd8Et7pK4q1eeSgY

3NBqs2vfpyT5cMdUJ97mEJ1Ycp2y8GbAZDA:  -0.01300000 Waves

2023.05.10 13:07 [2571648] smart account 3NBqs2vfpyT5cMdUJ97mEJ1Ycp2y8GbAZDA > SELF 0.00000000 Waves

{ "type": 13, "id": "2r1pMMbvY2SayHU6Q9bLG2vvKAW8Nd8Et7pK4q1eeSgY", "fee": 1300000, "feeAssetId": null, "timestamp": 1683713280287, "version": 2, "chainId": 84, "sender": "3NBqs2vfpyT5cMdUJ97mEJ1Ycp2y8GbAZDA", "senderPublicKey": "H19CeJVbUnfsK8EYs8K6fHxwBH7pLyxw8WCDFu7D4rGQ", "proofs": [ "1UvLoEGvb6tX69A6kPygnLfdTnaf3wCtBqKNnbFPobM6S9LE45i49A8LYXxSZs9ALkapdhJByQUJ7xM6xkbUi4P" ], "script": "base64:AAIFAAAAAAAABf0IAhIJCgcIAQEBAQEIEgMKAQgSAwoBARIAEgAiA1NFUCIHd3JhcEVyciIDbXNnIgh0aHJvd0VyciIPZ2V0U3RyaW5nT3JGYWlsIgdhZGRyZXNzIgNrZXkiEWtleUZhY3RvcnlBZGRyZXNzIhlrZXlWb3RpbmdWZXJpZmllZENvbnRyYWN0IiJrZXlWb3RpbmdFbWlzc2lvbkNhbmRpZGF0ZUNvbnRyYWN0IhRrZXlVc2VyUG9vbHNDb250cmFjdCIWdm90aW5nVmVyaWZpZWRDb250cmFjdCIfdm90aW5nRW1pc3Npb25DYW5kaWRhdGVDb250cmFjdCIRdXNlclBvb2xzQ29udHJhY3QiGElkeEZhY3RvcnlDZmdTdGFraW5nRGFwcCIZSWR4RmFjdG9yeUNmZ0Jvb3N0aW5nRGFwcCIUSWR4RmFjdG9yeUNmZ0lkb0RhcHAiFUlkeEZhY3RvcnlDZmdUZWFtRGFwcCIZSWR4RmFjdG9yeUNmZ0VtaXNzaW9uRGFwcCIVSWR4RmFjdG9yeUNmZ1Jlc3RE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 2571648, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: 9vzsiqofpS5Cj8Ny4cxoArxyzgs9jg7YRVSWb5bUC3tW Next: 9idrWeaZjmVTjCAjpG4LDD2d6okaYVXCToR5NXtFwch3 Diff:
OldNewDifferences
113113 func keyManagerPublicKey () = "%s__managerPublicKey"
114114
115115
116-func keyPendingManagerPublicKey () = "%s__pendingManagerPublicKey"
116+func keyManagerVaultAddress () = "%s__managerVaultAddress"
117117
118118
119-func managerPublicKeyOrUnit () = match getString(keyManagerPublicKey()) {
119+func getManagerVaultAddressOrThis () = match getString(keyManagerVaultAddress()) {
120120 case s: String =>
121- fromBase58String(s)
122- case _: Unit =>
123- unit
121+ addressFromStringValue(s)
124122 case _ =>
125- throw("Match error")
123+ this
126124 }
127125
128126
129-func pendingManagerPublicKeyOrUnit () = match getString(keyPendingManagerPublicKey()) {
130- case s: String =>
131- fromBase58String(s)
132- case _: Unit =>
133- unit
134- case _ =>
135- throw("Match error")
136-}
127+func managerPublicKeyOrUnit () = {
128+ let managerVaultAddress = getManagerVaultAddressOrThis()
129+ match getString(managerVaultAddress, keyManagerPublicKey()) {
130+ case s: String =>
131+ fromBase58String(s)
132+ case _: Unit =>
133+ unit
134+ case _ =>
135+ throw("Match error")
136+ }
137+ }
137138
138139
139140 func mustManager (i) = {
218219
219220
220221 @Callable(i)
221-func setManager (pendingManagerPublicKey) = {
222- let checkCaller = mustManager(i)
223- if ((checkCaller == checkCaller))
224- then {
225- let checkManagerPublicKey = fromBase58String(pendingManagerPublicKey)
226- if ((checkManagerPublicKey == checkManagerPublicKey))
227- then [StringEntry(keyPendingManagerPublicKey(), pendingManagerPublicKey)]
228- else throw("Strict value is not equal to itself.")
229- }
230- else throw("Strict value is not equal to itself.")
231- }
232-
233-
234-
235-@Callable(i)
236-func confirmManager () = {
237- let pm = pendingManagerPublicKeyOrUnit()
238- let hasPM = if (isDefined(pm))
239- then true
240- else throwErr("No pending manager")
241- if ((hasPM == hasPM))
242- then {
243- let checkPM = if ((i.callerPublicKey == value(pm)))
244- then true
245- else throwErr("You are not pending manager")
246- if ((checkPM == checkPM))
247- then [StringEntry(keyManagerPublicKey(), toBase58String(value(pm))), DeleteEntry(keyPendingManagerPublicKey())]
248- else throw("Strict value is not equal to itself.")
249- }
250- else throw("Strict value is not equal to itself.")
251- }
252-
253-
254-
255-@Callable(i)
256222 func getBoostCoeffREADONLY () = $Tuple2(nil, boostCoeff)
257223
258224
Full:
OldNewDifferences
11 {-# 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
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 keyRatePerBlockStartFrom (timestamp,block) = makeString(["%s%s%d%d__ratePerBlock__start", toString(timestamp), toString(block)], SEP)
9595
9696
9797 func keyEmissionStartBlock () = "%s%s__emission__startBlock"
9898
9999
100100 func keyEmissionDurationInBlocks () = "%s%s__emission__duration"
101101
102102
103103 func keyEmissionEndBlock () = "%s%s__emission__endBlock"
104104
105105
106106 func keyBoostCoeff () = "%s__boostCoeff"
107107
108108
109109 let boostCoeffDefault = 3
110110
111111 let boostCoeff = valueOrElse(getInteger(this, keyBoostCoeff()), boostCoeffDefault)
112112
113113 func keyManagerPublicKey () = "%s__managerPublicKey"
114114
115115
116-func keyPendingManagerPublicKey () = "%s__pendingManagerPublicKey"
116+func keyManagerVaultAddress () = "%s__managerVaultAddress"
117117
118118
119-func managerPublicKeyOrUnit () = match getString(keyManagerPublicKey()) {
119+func getManagerVaultAddressOrThis () = match getString(keyManagerVaultAddress()) {
120120 case s: String =>
121- fromBase58String(s)
122- case _: Unit =>
123- unit
121+ addressFromStringValue(s)
124122 case _ =>
125- throw("Match error")
123+ this
126124 }
127125
128126
129-func pendingManagerPublicKeyOrUnit () = match getString(keyPendingManagerPublicKey()) {
130- case s: String =>
131- fromBase58String(s)
132- case _: Unit =>
133- unit
134- case _ =>
135- throw("Match error")
136-}
127+func managerPublicKeyOrUnit () = {
128+ let managerVaultAddress = getManagerVaultAddressOrThis()
129+ match getString(managerVaultAddress, keyManagerPublicKey()) {
130+ case s: String =>
131+ fromBase58String(s)
132+ case _: Unit =>
133+ unit
134+ case _ =>
135+ throw("Match error")
136+ }
137+ }
137138
138139
139140 func mustManager (i) = {
140141 let pd = throwErr("Permission denied")
141142 match managerPublicKeyOrUnit() {
142143 case pk: ByteVector =>
143144 if ((i.callerPublicKey == pk))
144145 then true
145146 else pd
146147 case _: Unit =>
147148 if ((i.caller == this))
148149 then true
149150 else pd
150151 case _ =>
151152 throw("Match error")
152153 }
153154 }
154155
155156
156157 @Callable(i)
157158 func constructor (factoryAddress,ratePerBlockMax,ratePerBlock,emissionStartBlock,emissionDuration,emissionStartTimestamp,wxAssetIdStr) = {
158159 let checkCaller = mustManager(i)
159160 if ((checkCaller == checkCaller))
160161 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))]
161162 else throw("Strict value is not equal to itself.")
162163 }
163164
164165
165166
166167 @Callable(i)
167168 func constructorV2 (votingVerifiedContractPrm) = {
168169 let checkCaller = mustManager(i)
169170 if ((checkCaller == checkCaller))
170171 then $Tuple2([StringEntry(keyVotingVerifiedContract, votingVerifiedContractPrm)], unit)
171172 else throw("Strict value is not equal to itself.")
172173 }
173174
174175
175176
176177 @Callable(i)
177178 func emit (amount) = if ((0 >= amount))
178179 then $Tuple2(nil, nil)
179180 else {
180181 let factoryContract = readFactoryAddressOrFail()
181182 let factoryCfg = readFactoryCfgOrFail(factoryContract)
182183 let stakingContract = getStakingAddressOrFail(factoryCfg)
183184 let gwxRewardsContract = getGwxRewardAddressOrFail(factoryCfg)
184185 let caller = i.caller
185186 if (if ((caller != stakingContract))
186187 then (caller != gwxRewardsContract)
187188 else false)
188189 then throwErr("permissions denied")
189190 else {
190191 let wxAssetIdStr = split(getStringOrFail(this, keyConfig()), SEP)[1]
191192 let wxAssetId = fromBase58String(wxAssetIdStr)
192193 $Tuple2([ScriptTransfer(caller, amount, wxAssetId)], [wxAssetId])
193194 }
194195 }
195196
196197
197198
198199 @Callable(i)
199200 func burn () = {
200201 let factoryContract = readFactoryAddressOrFail()
201202 let factoryCfg = readFactoryCfgOrFail(factoryContract)
202203 let boostingContract = getBoostingAddressOrFail(factoryCfg)
203204 if ((size(i.payments) != 1))
204205 then throwErr("exact one payment is allowed")
205206 else {
206207 let pmt = i.payments[0]
207208 let assetId = value(pmt.assetId)
208209 let pmtAmount = pmt.amount
209210 let wxAssetId = fromBase58String(split(getStringOrFail(this, keyConfig()), SEP)[1])
210211 if ((assetId != wxAssetId))
211212 then throwErr("invalid wxAssetId is passed")
212213 else if (!(containsElement([boostingContract, votingVerifiedContract, votingEmissionCandidateContract, userPoolsContract], i.caller)))
213214 then throwErr("permissions denied")
214215 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))]
215216 }
216217 }
217218
218219
219220
220221 @Callable(i)
221-func setManager (pendingManagerPublicKey) = {
222- let checkCaller = mustManager(i)
223- if ((checkCaller == checkCaller))
224- then {
225- let checkManagerPublicKey = fromBase58String(pendingManagerPublicKey)
226- if ((checkManagerPublicKey == checkManagerPublicKey))
227- then [StringEntry(keyPendingManagerPublicKey(), pendingManagerPublicKey)]
228- else throw("Strict value is not equal to itself.")
229- }
230- else throw("Strict value is not equal to itself.")
231- }
232-
233-
234-
235-@Callable(i)
236-func confirmManager () = {
237- let pm = pendingManagerPublicKeyOrUnit()
238- let hasPM = if (isDefined(pm))
239- then true
240- else throwErr("No pending manager")
241- if ((hasPM == hasPM))
242- then {
243- let checkPM = if ((i.callerPublicKey == value(pm)))
244- then true
245- else throwErr("You are not pending manager")
246- if ((checkPM == checkPM))
247- then [StringEntry(keyManagerPublicKey(), toBase58String(value(pm))), DeleteEntry(keyPendingManagerPublicKey())]
248- else throw("Strict value is not equal to itself.")
249- }
250- else throw("Strict value is not equal to itself.")
251- }
252-
253-
254-
255-@Callable(i)
256222 func getBoostCoeffREADONLY () = $Tuple2(nil, boostCoeff)
257223
258224
259225 @Verifier(tx)
260226 func verify () = {
261227 let targetPublicKey = match managerPublicKeyOrUnit() {
262228 case pk: ByteVector =>
263229 pk
264230 case _: Unit =>
265231 tx.senderPublicKey
266232 case _ =>
267233 throw("Match error")
268234 }
269235 sigVerify(tx.bodyBytes, tx.proofs[0], targetPublicKey)
270236 }
271237

github/deemru/w8io/026f985 
33.52 ms