tx · 4Ec9jXGPbgeFMgLFotmguau9CGrYp8mnT4SdNdVk1jnF

3N3g7W8FPoQ7g5EadbAD2GVjrZT5RWpHZZh:  -0.01300000 Waves

2023.05.10 13:17 [2571657] smart account 3N3g7W8FPoQ7g5EadbAD2GVjrZT5RWpHZZh > SELF 0.00000000 Waves

{ "type": 13, "id": "4Ec9jXGPbgeFMgLFotmguau9CGrYp8mnT4SdNdVk1jnF", "fee": 1300000, "feeAssetId": null, "timestamp": 1683713846972, "version": 2, "chainId": 84, "sender": "3N3g7W8FPoQ7g5EadbAD2GVjrZT5RWpHZZh", "senderPublicKey": "Ap7CkWd6fzBU34kGo4GJJzC5q4qWXuLVunzE25PchdGS", "proofs": [ "u935n3RUM4cZmRgThhL2WcfsuqENxFu596zCxTnjkpL2mdLTurkiur9Te1pwjpnrgBuPExz5inaRg3wQwVDyxFT" ], "script": "base64:BgLiDwgCEgkKBwgICBgBCAESABIICgYICAgICAgSAwoBGBIAEgQKAggIIhBjb250cmFjdEZpbGVuYW1lIgNTRVAiDHdhdmVzQXNzZXRJZCIRaW52YWxpZFByaWNlQXNzZXQiB3dyYXBFcnIiA21zZyIIdGhyb3dFcnIiB3Rocm93UEQiFHRocm93Q3JlYXRlTm90Q2FsbGVkIhF0aHJvd1lvdU5vdElzc3VlciIPdGhyb3dQb29sRXhpc3RzIhV0aHJvd0Fzc2V0Tm90VmVyaWZpZWQiFnRocm93SW52YWxpZFByaWNlQXNzZXQiFHRocm93SW52YWxpZEZlZUFzc2V0Ihd0aHJvd0ludmFsaWRBbW91bnRBc3NldCISdGhyb3dJbnZhbGlkU3RhdHVzIh90aHJvd0NhbkFjdGl2YXRlT25seVBlbmRpbmdQb29sIh10aHJvd0ZhY3RvcnlSZXR1cm5lZE5vdFN0cmluZyIcdGhyb3dJbnZhbGlkUHJpY2VBc3NldEFtb3VudCIPdGhyb3dJbnZhbGlkRmVlIhV0aHJvd0ludmFsaWRBc3NldFBhaXIiE2tleU1hbmFnZXJQdWJsaW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AlAoCBQNuaWwFAmF5AQJidQECYnYABAJidwQBVwkBAmFqAAMJAAECBQFXAgpCeXRlVmVjdG9yBAJhbgUBVwUCYW4DCQABAgUBVwIEVW5pdAgFAmJ1D3NlbmRlclB1YmxpY0tleQkAAgECC01hdGNoIGVycm9yCQD0AwMIBQJidQlib2R5Qnl0ZXMJAJEDAggFAmJ1BnByb29mcwAABQJid0ZWy58=", "height": 2571657, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: 4pAh3mrJUeHMi8nxU6tiKTbUTDVovY6CR5E5STvVv8sc Next: Bcqq9bGEuN49RvHfog8bCyPom58HDDuTAGPCW6xYYaGT Diff:
OldNewDifferences
6060 func keyManagerPublicKey () = makeString(["%s", "managerPublicKey"], SEP)
6161
6262
63-func keyPendingManagerPublicKey () = makeString(["%s", "pendingManagerPublicKey"], SEP)
63+func keyManagerVaultAddress () = "%s__managerVaultAddress"
6464
6565
6666 func keyAdminPubKeys () = makeString(["%s", "adminPubKeys"], SEP)
124124 func keyPriceAssets () = makeString(["%s", "priceAssets"], SEP)
125125
126126
127+func getManagerVaultAddressOrThis () = match getString(keyManagerVaultAddress()) {
128+ case s: String =>
129+ addressFromStringValue(s)
130+ case _ =>
131+ this
132+}
133+
134+
127135 func getStringOrFail (key) = valueOrErrorMessage(getString(this, key), (key + " is not defined"))
128136
129137
157165 else throwCreateNotCalled()
158166
159167
160-func managerPublicKeyOrUnit () = match getString(keyManagerPublicKey()) {
161- case s: String =>
162- fromBase58String(s)
163- case _: Unit =>
164- unit
165- case _ =>
166- throw("Match error")
167-}
168-
169-
170-func pendingManagerPublicKeyOrUnit () = match getString(keyPendingManagerPublicKey()) {
171- case s: String =>
172- fromBase58String(s)
173- case _: Unit =>
174- unit
175- case _ =>
176- throw("Match error")
177-}
168+func managerPublicKeyOrUnit () = {
169+ let managerVaultAddress = getManagerVaultAddressOrThis()
170+ match getString(managerVaultAddress, keyManagerPublicKey()) {
171+ case s: String =>
172+ fromBase58String(s)
173+ case _: Unit =>
174+ unit
175+ case _ =>
176+ throw("Match error")
177+ }
178+ }
178179
179180
180181 func isManager (i) = match managerPublicKeyOrUnit() {
229230
230231 @Callable(i)
231232 func create () = {
232- let amountAssetPayment = value(i.payments[0])
233- let priceAssetPayment = value(i.payments[1])
233+ let asset1Payment = value(i.payments[0])
234+ let asset2Payment = value(i.payments[1])
234235 let feeAssetPayment = value(i.payments[2])
235- let $t074737545 = getIdAndInfo(amountAssetPayment)
236- let amountAssetId = $t074737545._1
237- let amountAssetInfo = $t074737545._2
238- let $t075487617 = getIdAndInfo(priceAssetPayment)
239- let priceAssetId = $t075487617._1
240- let priceAssetInfo = $t075487617._2
241- let $t076207683 = getIdAndInfo(feeAssetPayment)
242- let feeAssetId = $t076207683._1
243- let feeAssetInfo = $t076207683._2
244- let amountAssetAmount = amountAssetPayment.amount
245- let priceAssetAmount = priceAssetPayment.amount
246- let feeAssetAmount = feeAssetPayment.amount
236+ let $t075317588 = getIdAndInfo(asset1Payment)
237+ let asset1Id = $t075317588._1
238+ let asset1Info = $t075317588._2
239+ let $t075917648 = getIdAndInfo(asset2Payment)
240+ let asset2Id = $t075917648._1
241+ let asset2Info = $t075917648._2
242+ let $t076517714 = getIdAndInfo(feeAssetPayment)
243+ let feeAssetId = $t076517714._1
244+ let feeAssetInfo = $t076517714._2
247245 let priceAssetsList = stringOptionToList(getString(factoryContract, keyPriceAssets()))
248- let assetMinAmountDefault = getIntegerValue(keyAmountAssetMinAmount())
249- let allowedAssetsMinAmounts = stringOptionToList(getString(keyPriceAssetsMinAmount()))
250- let amountAssetMinAmount = if (containsElement(priceAssetsList, amountAssetId))
246+ let checkAssetsNotEqual = if ((asset1Id != asset2Id))
247+ then true
248+ else throwInvalidAssetPair()
249+ if ((checkAssetsNotEqual == checkAssetsNotEqual))
251250 then {
252- let priceAssetsIndex = valueOrErrorMessage(indexOf(priceAssetsList, amountAssetId), invalidPriceAsset)
253- value(parseInt(allowedAssetsMinAmounts[priceAssetsIndex]))
254- }
255- else assetMinAmountDefault
256- let priceAssetMinAmount = if (containsElement(priceAssetsList, priceAssetId))
257- then {
258- let priceAssetsIndex = valueOrErrorMessage(indexOf(priceAssetsList, priceAssetId), invalidPriceAsset)
259- value(parseInt(allowedAssetsMinAmounts[priceAssetsIndex]))
260- }
261- else assetMinAmountDefault
262- let lastIndex = valueOrElse(getInteger(keyLastIndex()), 0)
263- let curIndex = (lastIndex + 1)
264- let emissionContract = addressFromStringValue(getStringOrFail(keyEmissionContract()))
265- let poolExists = {
266- let @ = invoke(factoryContract, "poolExistsREADONLY", [amountAssetId, priceAssetId], nil)
267- if ($isInstanceOf(@, "Boolean"))
268- then @
269- else throw(($getType(@) + " couldn't be cast to Boolean"))
270- }
271- let checks = [if (!(isCreateCalled(amountAssetId, priceAssetId)))
272- then true
273- else throwPoolExists(), if (!(poolExists))
274- then true
275- else throwPoolExists(), if ((amountAssetId != priceAssetId))
276- then true
277- else throwInvalidAssetPair(), if (if (isVerified(amountAssetId))
278- then isVerified(priceAssetId)
279- else false)
280- then true
281- else throwInvalidAssetPair(), if (if (containsElement(priceAssetsList, amountAssetId))
282- then true
283- else containsElement(priceAssetsList, priceAssetId))
284- then true
285- else throwInvalidAssetPair(), if (if (isManager(i))
286- then true
287- else (getString(keyFeeAssetId()) == feeAssetId))
288- then true
289- else throwInvalidFeeAsset(), if (if (isManager(i))
290- then true
291- else (amountAssetAmount >= getIntegerValue(keyAmountAssetMinAmount())))
292- then true
293- else throwInvalidAmountAsset(), if (if (isManager(i))
294- then true
295- else (priceAssetAmount >= priceAssetMinAmount))
296- then true
297- else throwInvalidPriceAssetAmount(), if (if (isManager(i))
298- then true
299- else (feeAssetAmount == getInteger(keyFeeAmount())))
300- then true
301- else throwInvalidFee()]
302- if ((checks == checks))
303- then {
304- let paymentsWithFeeSize = 3
305- let burnEmissionInv = if ((size(i.payments) >= paymentsWithFeeSize))
306- then invoke(emissionContract, "burn", nil, [AttachedPayment(fromBase58String(feeAssetId), feeAssetAmount)])
307- else unit
308- if ((burnEmissionInv == burnEmissionInv))
309- then [BooleanEntry(keyCreateCalled(amountAssetId, priceAssetId), true), StringEntry(keyCreateCaller(amountAssetId, priceAssetId), toString(i.caller)), IntegerEntry(keyLastIndex(), curIndex), StringEntry(keySuffix(amountAssetId, priceAssetId), (toString(curIndex) + indexSuffix)), IntegerEntry(keyHeight(amountAssetId, priceAssetId), height), StringEntry(keyStatus(amountAssetId, priceAssetId), statusPending), IntegerEntry(keyAmountAssetAmount(amountAssetId, priceAssetId), amountAssetAmount), IntegerEntry(keyPriceAssetAmount(amountAssetId, priceAssetId), priceAssetAmount)]
251+ let $t078888349 = if (if (isManager(i))
252+ then true
253+ else if (containsElement(priceAssetsList, asset2Id))
254+ then isVerified(asset1Id)
255+ else false)
256+ then $Tuple4(asset1Id, asset1Payment.amount, asset2Id, asset2Payment.amount)
257+ else if (if (containsElement(priceAssetsList, asset1Id))
258+ then isVerified(asset2Id)
259+ else false)
260+ then $Tuple4(asset2Id, asset2Payment.amount, asset1Id, asset1Payment.amount)
261+ else throwInvalidAssetPair()
262+ let amountAssetId = $t078888349._1
263+ let amountAssetAmount = $t078888349._2
264+ let priceAssetId = $t078888349._3
265+ let priceAssetAmount = $t078888349._4
266+ let managerPriceAssetMinAmount = 1
267+ let priceAssetMinAmount = if (isManager(i))
268+ then managerPriceAssetMinAmount
269+ else {
270+ let priceAssetsIndex = valueOrErrorMessage(indexOf(priceAssetsList, priceAssetId), invalidPriceAsset)
271+ value(parseInt(stringOptionToList(getString(keyPriceAssetsMinAmount()))[priceAssetsIndex]))
272+ }
273+ let lastIndex = valueOrElse(getInteger(keyLastIndex()), 0)
274+ let curIndex = (lastIndex + 1)
275+ let emissionContract = addressFromStringValue(getStringOrFail(keyEmissionContract()))
276+ let poolExists = {
277+ let @ = invoke(factoryContract, "poolExistsREADONLY", [amountAssetId, priceAssetId], nil)
278+ if ($isInstanceOf(@, "Boolean"))
279+ then @
280+ else throw(($getType(@) + " couldn't be cast to Boolean"))
281+ }
282+ let checks = [if (!(isCreateCalled(amountAssetId, priceAssetId)))
283+ then true
284+ else throwPoolExists(), if (!(poolExists))
285+ then true
286+ else throwPoolExists(), if (if (isManager(i))
287+ then true
288+ else (getString(keyFeeAssetId()) == feeAssetId))
289+ then true
290+ else throwInvalidFeeAsset(), if (if (isManager(i))
291+ then true
292+ else (amountAssetAmount >= getIntegerValue(keyAmountAssetMinAmount())))
293+ then true
294+ else throwInvalidAmountAsset(), if (if (isManager(i))
295+ then true
296+ else (priceAssetAmount >= priceAssetMinAmount))
297+ then true
298+ else throwInvalidPriceAssetAmount(), if (if (isManager(i))
299+ then true
300+ else (feeAssetPayment.amount == getInteger(keyFeeAmount())))
301+ then true
302+ else throwInvalidFee()]
303+ if ((checks == checks))
304+ then {
305+ let paymentsWithFeeSize = 3
306+ let burnEmissionInv = if ((size(i.payments) >= paymentsWithFeeSize))
307+ then invoke(emissionContract, "burn", nil, [AttachedPayment(fromBase58String(feeAssetId), feeAssetPayment.amount)])
308+ else unit
309+ if ((burnEmissionInv == burnEmissionInv))
310+ then [BooleanEntry(keyCreateCalled(amountAssetId, priceAssetId), true), StringEntry(keyCreateCaller(amountAssetId, priceAssetId), toString(i.caller)), IntegerEntry(keyLastIndex(), curIndex), StringEntry(keySuffix(amountAssetId, priceAssetId), (toString(curIndex) + indexSuffix)), IntegerEntry(keyHeight(amountAssetId, priceAssetId), height), StringEntry(keyStatus(amountAssetId, priceAssetId), statusPending), IntegerEntry(keyAmountAssetAmount(amountAssetId, priceAssetId), amountAssetAmount), IntegerEntry(keyPriceAssetAmount(amountAssetId, priceAssetId), priceAssetAmount)]
311+ else throw("Strict value is not equal to itself.")
312+ }
310313 else throw("Strict value is not equal to itself.")
311314 }
312315 else throw("Strict value is not equal to itself.")
379382
380383
381384 @Callable(i)
382-func setManager (pendingManagerPublicKey) = {
383- let checkCaller = mustManager(i)
384- if ((checkCaller == checkCaller))
385- then {
386- let checkManagerPublicKey = fromBase58String(pendingManagerPublicKey)
387- if ((checkManagerPublicKey == checkManagerPublicKey))
388- then [StringEntry(keyPendingManagerPublicKey(), pendingManagerPublicKey)]
389- else throw("Strict value is not equal to itself.")
390- }
391- else throw("Strict value is not equal to itself.")
392- }
393-
394-
395-
396-@Callable(i)
397-func confirmManager () = {
398- let pm = pendingManagerPublicKeyOrUnit()
399- let hasPM = if (isDefined(pm))
400- then true
401- else throw("No pending manager")
402- if ((hasPM == hasPM))
403- then {
404- let checkPM = if ((i.callerPublicKey == value(pm)))
405- then true
406- else throw("You are not pending manager")
407- if ((checkPM == checkPM))
408- then [StringEntry(keyManagerPublicKey(), toBase58String(value(pm))), DeleteEntry(keyPendingManagerPublicKey())]
409- else throw("Strict value is not equal to itself.")
410- }
411- else throw("Strict value is not equal to itself.")
412- }
413-
414-
415-
416-@Callable(i)
417385 func priceAssetsREADONLY () = $Tuple2(nil, stringOptionToList(getString(keyPriceAssets())))
418386
419387
Full:
OldNewDifferences
11 {-# STDLIB_VERSION 6 #-}
22 {-# SCRIPT_TYPE ACCOUNT #-}
33 {-# CONTENT_TYPE DAPP #-}
44 let contractFilename = "user_pools.ride"
55
66 let SEP = "__"
77
88 let wavesAssetId = "WAVES"
99
1010 let invalidPriceAsset = "Invalid price asset"
1111
1212 func wrapErr (msg) = makeString([contractFilename, ": ", msg], "")
1313
1414
1515 func throwErr (msg) = throw(wrapErr(msg))
1616
1717
1818 func throwPD () = throwErr("Permission denied")
1919
2020
2121 func throwCreateNotCalled () = throwErr("Create is not called for assets pair")
2222
2323
2424 func throwYouNotIssuer () = throwErr("You are not amountAsset issuer")
2525
2626
2727 func throwPoolExists () = throwErr("Pool with such assets already exists")
2828
2929
3030 func throwAssetNotVerified () = throwErr("Asset is not verified")
3131
3232
3333 func throwInvalidPriceAsset () = throwErr(invalidPriceAsset)
3434
3535
3636 func throwInvalidFeeAsset () = throwErr("Invalid fee asset")
3737
3838
3939 func throwInvalidAmountAsset () = throwErr("Invalid amount asset attached")
4040
4141
4242 func throwInvalidStatus () = throwErr("Invalid status")
4343
4444
4545 func throwCanActivateOnlyPendingPool () = throwErr("Can activate pool only in 'pending' status")
4646
4747
4848 func throwFactoryReturnedNotString () = throwErr("FactoryV2 returned not string")
4949
5050
5151 func throwInvalidPriceAssetAmount () = throwErr("invalid price asset amount")
5252
5353
5454 func throwInvalidFee () = throwErr("invalid fee")
5555
5656
5757 func throwInvalidAssetPair () = throwErr("invalid asset pair")
5858
5959
6060 func keyManagerPublicKey () = makeString(["%s", "managerPublicKey"], SEP)
6161
6262
63-func keyPendingManagerPublicKey () = makeString(["%s", "pendingManagerPublicKey"], SEP)
63+func keyManagerVaultAddress () = "%s__managerVaultAddress"
6464
6565
6666 func keyAdminPubKeys () = makeString(["%s", "adminPubKeys"], SEP)
6767
6868
6969 func keyStatus (amountAssetId,priceAssetId) = makeString(["%s%s%s", "status", amountAssetId, priceAssetId], SEP)
7070
7171
7272 func keyFactoryContract () = makeString(["%s", "factoryContract"], SEP)
7373
7474
7575 func keyAssetsStoreContract () = makeString(["%s", "assetsStoreContract"], SEP)
7676
7777
7878 func keyEmissionContract () = makeString(["%s", "emissionContract"], SEP)
7979
8080
8181 func keySuffix (amountAssetId,priceAssetId) = makeString(["%s%s%s", "suffix", amountAssetId, priceAssetId], SEP)
8282
8383
8484 func keyLastIndex () = makeString(["%s", "lastIndex"], SEP)
8585
8686
8787 let indexSuffix = "u"
8888
8989 let statusPending = "pending"
9090
9191 let statusDeclined = "declined"
9292
9393 let statusActive = "active"
9494
9595 let statuses = [statusPending, statusDeclined, statusActive]
9696
9797 func keyCreateCalled (amountAssetId,priceAssetId) = makeString(["%s%s%s", "createCalled", amountAssetId, priceAssetId], SEP)
9898
9999
100100 func keyCreateCaller (amountAssetId,priceAssetId) = makeString(["%s%s%s", "createCaller", amountAssetId, priceAssetId], SEP)
101101
102102
103103 func keyAmountAssetAmount (amountAssetId,priceAssetId) = makeString(["%s%s%s", "amountAssetAmount", amountAssetId, priceAssetId], SEP)
104104
105105
106106 func keyPriceAssetAmount (amountAssetId,priceAssetId) = makeString(["%s%s%s", "priceAssetAmount", amountAssetId, priceAssetId], SEP)
107107
108108
109109 func keyHeight (amountAssetId,priceAssetId) = makeString(["%s%s%s", "height", amountAssetId, priceAssetId], SEP)
110110
111111
112112 func keyFeeAssetId () = makeString(["%s", "feeAssetId"], SEP)
113113
114114
115115 func keyFeeAmount () = makeString(["%s", "feeAmount"], SEP)
116116
117117
118118 func keyAmountAssetMinAmount () = makeString(["%s", "amountAssetMinAmount"], SEP)
119119
120120
121121 func keyPriceAssetsMinAmount () = makeString(["%s", "priceAssetsMinAmount"], SEP)
122122
123123
124124 func keyPriceAssets () = makeString(["%s", "priceAssets"], SEP)
125125
126126
127+func getManagerVaultAddressOrThis () = match getString(keyManagerVaultAddress()) {
128+ case s: String =>
129+ addressFromStringValue(s)
130+ case _ =>
131+ this
132+}
133+
134+
127135 func getStringOrFail (key) = valueOrErrorMessage(getString(this, key), (key + " is not defined"))
128136
129137
130138 func stringOptionToList (stringOrUnit) = match stringOrUnit {
131139 case s: String =>
132140 if ((size(s) == 0))
133141 then nil
134142 else split(s, SEP)
135143 case _: Unit =>
136144 nil
137145 case _ =>
138146 throw("Match error")
139147 }
140148
141149
142150 let factoryContract = addressFromStringValue(getStringOrFail(keyFactoryContract()))
143151
144152 let keyVotingEmissionContract = makeString(["%s", "votingEmissionContract"], SEP)
145153
146154 let votingEmissionContract = addressFromStringValue(valueOrErrorMessage(getString(factoryContract, keyVotingEmissionContract), wrapErr("voting emission contract address is required")))
147155
148156 let keyVotingEmissionCandidateContract = makeString(["%s", "votingEmissionCandidateContract"], SEP)
149157
150158 let votingEmissionCandidateContract = addressFromStringValue(valueOrErrorMessage(getString(votingEmissionContract, keyVotingEmissionCandidateContract), wrapErr("voting emission candidate contract address is required")))
151159
152160 func isCreateCalled (amountAssetId,priceAssetId) = valueOrElse(getBoolean(keyCreateCalled(amountAssetId, priceAssetId)), false)
153161
154162
155163 func mustCreateCalled (amountAssetId,priceAssetId) = if (isCreateCalled(amountAssetId, priceAssetId))
156164 then true
157165 else throwCreateNotCalled()
158166
159167
160-func managerPublicKeyOrUnit () = match getString(keyManagerPublicKey()) {
161- case s: String =>
162- fromBase58String(s)
163- case _: Unit =>
164- unit
165- case _ =>
166- throw("Match error")
167-}
168-
169-
170-func pendingManagerPublicKeyOrUnit () = match getString(keyPendingManagerPublicKey()) {
171- case s: String =>
172- fromBase58String(s)
173- case _: Unit =>
174- unit
175- case _ =>
176- throw("Match error")
177-}
168+func managerPublicKeyOrUnit () = {
169+ let managerVaultAddress = getManagerVaultAddressOrThis()
170+ match getString(managerVaultAddress, keyManagerPublicKey()) {
171+ case s: String =>
172+ fromBase58String(s)
173+ case _: Unit =>
174+ unit
175+ case _ =>
176+ throw("Match error")
177+ }
178+ }
178179
179180
180181 func isManager (i) = match managerPublicKeyOrUnit() {
181182 case pk: ByteVector =>
182183 (i.callerPublicKey == pk)
183184 case _: Unit =>
184185 (i.caller == this)
185186 case _ =>
186187 throw("Match error")
187188 }
188189
189190
190191 func mustManager (i) = if (isManager(i))
191192 then true
192193 else throwPD()
193194
194195
195196 func mustAdmin (i) = {
196197 let adminPKs = stringOptionToList(getString(keyAdminPubKeys()))
197198 if (containsElement(adminPKs, toBase58String(i.callerPublicKey)))
198199 then true
199200 else mustManager(i)
200201 }
201202
202203
203204 func isVerified (assetId) = (valueOrElse(getInteger(addressFromStringValue(getStringOrFail(keyAssetsStoreContract())), (("status_<" + assetId) + ">")), 0) == 2)
204205
205206
206207 func getIdAndInfo (payment) = match payment.assetId {
207208 case id: ByteVector =>
208209 let info = value(assetInfo(id))
209210 $Tuple2(toBase58String(id), info)
210211 case _: Unit =>
211212 $Tuple2(wavesAssetId, unit)
212213 case _ =>
213214 throw("Match error")
214215 }
215216
216217
217218 func validStatus (status) = containsElement(statuses, status)
218219
219220
220221 @Callable(i)
221222 func constructor (factoryV2Address,assetsStoreAddress,emissionAddress,priceAssetsMinAmount,amountAssetMinAmount,feeAssetId,feeAmount) = {
222223 let checkCaller = mustManager(i)
223224 if ((checkCaller == checkCaller))
224225 then [StringEntry(keyFactoryContract(), factoryV2Address), StringEntry(keyAssetsStoreContract(), assetsStoreAddress), StringEntry(keyEmissionContract(), emissionAddress), StringEntry(keyPriceAssetsMinAmount(), makeString(priceAssetsMinAmount, SEP)), IntegerEntry(keyAmountAssetMinAmount(), amountAssetMinAmount), StringEntry(keyFeeAssetId(), feeAssetId), IntegerEntry(keyFeeAmount(), feeAmount)]
225226 else throw("Strict value is not equal to itself.")
226227 }
227228
228229
229230
230231 @Callable(i)
231232 func create () = {
232- let amountAssetPayment = value(i.payments[0])
233- let priceAssetPayment = value(i.payments[1])
233+ let asset1Payment = value(i.payments[0])
234+ let asset2Payment = value(i.payments[1])
234235 let feeAssetPayment = value(i.payments[2])
235- let $t074737545 = getIdAndInfo(amountAssetPayment)
236- let amountAssetId = $t074737545._1
237- let amountAssetInfo = $t074737545._2
238- let $t075487617 = getIdAndInfo(priceAssetPayment)
239- let priceAssetId = $t075487617._1
240- let priceAssetInfo = $t075487617._2
241- let $t076207683 = getIdAndInfo(feeAssetPayment)
242- let feeAssetId = $t076207683._1
243- let feeAssetInfo = $t076207683._2
244- let amountAssetAmount = amountAssetPayment.amount
245- let priceAssetAmount = priceAssetPayment.amount
246- let feeAssetAmount = feeAssetPayment.amount
236+ let $t075317588 = getIdAndInfo(asset1Payment)
237+ let asset1Id = $t075317588._1
238+ let asset1Info = $t075317588._2
239+ let $t075917648 = getIdAndInfo(asset2Payment)
240+ let asset2Id = $t075917648._1
241+ let asset2Info = $t075917648._2
242+ let $t076517714 = getIdAndInfo(feeAssetPayment)
243+ let feeAssetId = $t076517714._1
244+ let feeAssetInfo = $t076517714._2
247245 let priceAssetsList = stringOptionToList(getString(factoryContract, keyPriceAssets()))
248- let assetMinAmountDefault = getIntegerValue(keyAmountAssetMinAmount())
249- let allowedAssetsMinAmounts = stringOptionToList(getString(keyPriceAssetsMinAmount()))
250- let amountAssetMinAmount = if (containsElement(priceAssetsList, amountAssetId))
246+ let checkAssetsNotEqual = if ((asset1Id != asset2Id))
247+ then true
248+ else throwInvalidAssetPair()
249+ if ((checkAssetsNotEqual == checkAssetsNotEqual))
251250 then {
252- let priceAssetsIndex = valueOrErrorMessage(indexOf(priceAssetsList, amountAssetId), invalidPriceAsset)
253- value(parseInt(allowedAssetsMinAmounts[priceAssetsIndex]))
254- }
255- else assetMinAmountDefault
256- let priceAssetMinAmount = if (containsElement(priceAssetsList, priceAssetId))
257- then {
258- let priceAssetsIndex = valueOrErrorMessage(indexOf(priceAssetsList, priceAssetId), invalidPriceAsset)
259- value(parseInt(allowedAssetsMinAmounts[priceAssetsIndex]))
260- }
261- else assetMinAmountDefault
262- let lastIndex = valueOrElse(getInteger(keyLastIndex()), 0)
263- let curIndex = (lastIndex + 1)
264- let emissionContract = addressFromStringValue(getStringOrFail(keyEmissionContract()))
265- let poolExists = {
266- let @ = invoke(factoryContract, "poolExistsREADONLY", [amountAssetId, priceAssetId], nil)
267- if ($isInstanceOf(@, "Boolean"))
268- then @
269- else throw(($getType(@) + " couldn't be cast to Boolean"))
270- }
271- let checks = [if (!(isCreateCalled(amountAssetId, priceAssetId)))
272- then true
273- else throwPoolExists(), if (!(poolExists))
274- then true
275- else throwPoolExists(), if ((amountAssetId != priceAssetId))
276- then true
277- else throwInvalidAssetPair(), if (if (isVerified(amountAssetId))
278- then isVerified(priceAssetId)
279- else false)
280- then true
281- else throwInvalidAssetPair(), if (if (containsElement(priceAssetsList, amountAssetId))
282- then true
283- else containsElement(priceAssetsList, priceAssetId))
284- then true
285- else throwInvalidAssetPair(), if (if (isManager(i))
286- then true
287- else (getString(keyFeeAssetId()) == feeAssetId))
288- then true
289- else throwInvalidFeeAsset(), if (if (isManager(i))
290- then true
291- else (amountAssetAmount >= getIntegerValue(keyAmountAssetMinAmount())))
292- then true
293- else throwInvalidAmountAsset(), if (if (isManager(i))
294- then true
295- else (priceAssetAmount >= priceAssetMinAmount))
296- then true
297- else throwInvalidPriceAssetAmount(), if (if (isManager(i))
298- then true
299- else (feeAssetAmount == getInteger(keyFeeAmount())))
300- then true
301- else throwInvalidFee()]
302- if ((checks == checks))
303- then {
304- let paymentsWithFeeSize = 3
305- let burnEmissionInv = if ((size(i.payments) >= paymentsWithFeeSize))
306- then invoke(emissionContract, "burn", nil, [AttachedPayment(fromBase58String(feeAssetId), feeAssetAmount)])
307- else unit
308- if ((burnEmissionInv == burnEmissionInv))
309- then [BooleanEntry(keyCreateCalled(amountAssetId, priceAssetId), true), StringEntry(keyCreateCaller(amountAssetId, priceAssetId), toString(i.caller)), IntegerEntry(keyLastIndex(), curIndex), StringEntry(keySuffix(amountAssetId, priceAssetId), (toString(curIndex) + indexSuffix)), IntegerEntry(keyHeight(amountAssetId, priceAssetId), height), StringEntry(keyStatus(amountAssetId, priceAssetId), statusPending), IntegerEntry(keyAmountAssetAmount(amountAssetId, priceAssetId), amountAssetAmount), IntegerEntry(keyPriceAssetAmount(amountAssetId, priceAssetId), priceAssetAmount)]
251+ let $t078888349 = if (if (isManager(i))
252+ then true
253+ else if (containsElement(priceAssetsList, asset2Id))
254+ then isVerified(asset1Id)
255+ else false)
256+ then $Tuple4(asset1Id, asset1Payment.amount, asset2Id, asset2Payment.amount)
257+ else if (if (containsElement(priceAssetsList, asset1Id))
258+ then isVerified(asset2Id)
259+ else false)
260+ then $Tuple4(asset2Id, asset2Payment.amount, asset1Id, asset1Payment.amount)
261+ else throwInvalidAssetPair()
262+ let amountAssetId = $t078888349._1
263+ let amountAssetAmount = $t078888349._2
264+ let priceAssetId = $t078888349._3
265+ let priceAssetAmount = $t078888349._4
266+ let managerPriceAssetMinAmount = 1
267+ let priceAssetMinAmount = if (isManager(i))
268+ then managerPriceAssetMinAmount
269+ else {
270+ let priceAssetsIndex = valueOrErrorMessage(indexOf(priceAssetsList, priceAssetId), invalidPriceAsset)
271+ value(parseInt(stringOptionToList(getString(keyPriceAssetsMinAmount()))[priceAssetsIndex]))
272+ }
273+ let lastIndex = valueOrElse(getInteger(keyLastIndex()), 0)
274+ let curIndex = (lastIndex + 1)
275+ let emissionContract = addressFromStringValue(getStringOrFail(keyEmissionContract()))
276+ let poolExists = {
277+ let @ = invoke(factoryContract, "poolExistsREADONLY", [amountAssetId, priceAssetId], nil)
278+ if ($isInstanceOf(@, "Boolean"))
279+ then @
280+ else throw(($getType(@) + " couldn't be cast to Boolean"))
281+ }
282+ let checks = [if (!(isCreateCalled(amountAssetId, priceAssetId)))
283+ then true
284+ else throwPoolExists(), if (!(poolExists))
285+ then true
286+ else throwPoolExists(), if (if (isManager(i))
287+ then true
288+ else (getString(keyFeeAssetId()) == feeAssetId))
289+ then true
290+ else throwInvalidFeeAsset(), if (if (isManager(i))
291+ then true
292+ else (amountAssetAmount >= getIntegerValue(keyAmountAssetMinAmount())))
293+ then true
294+ else throwInvalidAmountAsset(), if (if (isManager(i))
295+ then true
296+ else (priceAssetAmount >= priceAssetMinAmount))
297+ then true
298+ else throwInvalidPriceAssetAmount(), if (if (isManager(i))
299+ then true
300+ else (feeAssetPayment.amount == getInteger(keyFeeAmount())))
301+ then true
302+ else throwInvalidFee()]
303+ if ((checks == checks))
304+ then {
305+ let paymentsWithFeeSize = 3
306+ let burnEmissionInv = if ((size(i.payments) >= paymentsWithFeeSize))
307+ then invoke(emissionContract, "burn", nil, [AttachedPayment(fromBase58String(feeAssetId), feeAssetPayment.amount)])
308+ else unit
309+ if ((burnEmissionInv == burnEmissionInv))
310+ then [BooleanEntry(keyCreateCalled(amountAssetId, priceAssetId), true), StringEntry(keyCreateCaller(amountAssetId, priceAssetId), toString(i.caller)), IntegerEntry(keyLastIndex(), curIndex), StringEntry(keySuffix(amountAssetId, priceAssetId), (toString(curIndex) + indexSuffix)), IntegerEntry(keyHeight(amountAssetId, priceAssetId), height), StringEntry(keyStatus(amountAssetId, priceAssetId), statusPending), IntegerEntry(keyAmountAssetAmount(amountAssetId, priceAssetId), amountAssetAmount), IntegerEntry(keyPriceAssetAmount(amountAssetId, priceAssetId), priceAssetAmount)]
311+ else throw("Strict value is not equal to itself.")
312+ }
310313 else throw("Strict value is not equal to itself.")
311314 }
312315 else throw("Strict value is not equal to itself.")
313316 }
314317
315318
316319
317320 @Callable(i)
318321 func activate (poolAddress,amountAssetId,amountAssetTicker,priceAssetId,priceAssetTicker,logo) = {
319322 let checks = [mustAdmin(i), if (isCreateCalled(amountAssetId, priceAssetId))
320323 then true
321324 else throwCreateNotCalled(), if ((value(getString(keyStatus(amountAssetId, priceAssetId))) == statusPending))
322325 then true
323326 else throwCanActivateOnlyPendingPool()]
324327 if ((checks == checks))
325328 then {
326329 let activateNewPoolInv = invoke(factoryContract, "activateNewPool", [poolAddress, amountAssetId, priceAssetId, ((amountAssetTicker + priceAssetTicker) + "LP"), (((amountAssetTicker + "/") + priceAssetTicker) + " pool liquidity provider token"), 0, "VLTPOOL", logo], nil)
327330 if ((activateNewPoolInv == activateNewPoolInv))
328331 then {
329332 let lpAssetId = match activateNewPoolInv {
330333 case id: String =>
331334 id
332335 case _ =>
333336 throwFactoryReturnedNotString()
334337 }
335338 if ((lpAssetId == lpAssetId))
336339 then {
337340 let beforePut = assetBalance(this, fromBase58String(lpAssetId))
338341 if ((beforePut == beforePut))
339342 then {
340343 let put = invoke(addressFromStringValue(poolAddress), "put", [0, false], [AttachedPayment(if ((amountAssetId == "WAVES"))
341344 then unit
342345 else fromBase58String(amountAssetId), value(getInteger(keyAmountAssetAmount(amountAssetId, priceAssetId)))), AttachedPayment(if ((priceAssetId == "WAVES"))
343346 then unit
344347 else fromBase58String(priceAssetId), value(getInteger(keyPriceAssetAmount(amountAssetId, priceAssetId))))])
345348 if ((put == put))
346349 then {
347350 let afterPut = assetBalance(this, fromBase58String(lpAssetId))
348351 if ((afterPut == afterPut))
349352 then {
350353 let user = value(addressFromString(value(getString(keyCreateCaller(amountAssetId, priceAssetId)))))
351354 let res = invoke(votingEmissionCandidateContract, "approve", [amountAssetId, priceAssetId], nil)
352355 if ((res == res))
353356 then [StringEntry(keyStatus(amountAssetId, priceAssetId), statusActive), ScriptTransfer(user, (afterPut - beforePut), fromBase58String(lpAssetId))]
354357 else throw("Strict value is not equal to itself.")
355358 }
356359 else throw("Strict value is not equal to itself.")
357360 }
358361 else throw("Strict value is not equal to itself.")
359362 }
360363 else throw("Strict value is not equal to itself.")
361364 }
362365 else throw("Strict value is not equal to itself.")
363366 }
364367 else throw("Strict value is not equal to itself.")
365368 }
366369 else throw("Strict value is not equal to itself.")
367370 }
368371
369372
370373
371374 @Callable(i)
372375 func setAdmins (adminPubKeys) = {
373376 let checkCaller = mustManager(i)
374377 if ((checkCaller == checkCaller))
375378 then [StringEntry(keyAdminPubKeys(), makeString(adminPubKeys, SEP))]
376379 else throw("Strict value is not equal to itself.")
377380 }
378381
379382
380383
381384 @Callable(i)
382-func setManager (pendingManagerPublicKey) = {
383- let checkCaller = mustManager(i)
384- if ((checkCaller == checkCaller))
385- then {
386- let checkManagerPublicKey = fromBase58String(pendingManagerPublicKey)
387- if ((checkManagerPublicKey == checkManagerPublicKey))
388- then [StringEntry(keyPendingManagerPublicKey(), pendingManagerPublicKey)]
389- else throw("Strict value is not equal to itself.")
390- }
391- else throw("Strict value is not equal to itself.")
392- }
393-
394-
395-
396-@Callable(i)
397-func confirmManager () = {
398- let pm = pendingManagerPublicKeyOrUnit()
399- let hasPM = if (isDefined(pm))
400- then true
401- else throw("No pending manager")
402- if ((hasPM == hasPM))
403- then {
404- let checkPM = if ((i.callerPublicKey == value(pm)))
405- then true
406- else throw("You are not pending manager")
407- if ((checkPM == checkPM))
408- then [StringEntry(keyManagerPublicKey(), toBase58String(value(pm))), DeleteEntry(keyPendingManagerPublicKey())]
409- else throw("Strict value is not equal to itself.")
410- }
411- else throw("Strict value is not equal to itself.")
412- }
413-
414-
415-
416-@Callable(i)
417385 func priceAssetsREADONLY () = $Tuple2(nil, stringOptionToList(getString(keyPriceAssets())))
418386
419387
420388
421389 @Callable(i)
422390 func statusREADONLY (amountAssetId,priceAssetId) = {
423391 let status = match getString(keyStatus(amountAssetId, priceAssetId)) {
424392 case s: String =>
425393 s
426394 case _ =>
427395 unit
428396 }
429397 $Tuple2(nil, status)
430398 }
431399
432400
433401 @Verifier(tx)
434402 func verify () = {
435403 let targetPublicKey = match managerPublicKeyOrUnit() {
436404 case pk: ByteVector =>
437405 pk
438406 case _: Unit =>
439407 tx.senderPublicKey
440408 case _ =>
441409 throw("Match error")
442410 }
443411 sigVerify(tx.bodyBytes, tx.proofs[0], targetPublicKey)
444412 }
445413

github/deemru/w8io/026f985 
48.87 ms