tx · HGW6D3CpavRxM9jodJHUydkjwT4bSZPe9Q7FqUJwMTMd

3N8bnD2caKnxdcTqvrJUEkDe3XebgfwWjSV:  -0.01100000 Waves

2022.08.30 15:24 [2207178] smart account 3N8bnD2caKnxdcTqvrJUEkDe3XebgfwWjSV > SELF 0.00000000 Waves

{ "type": 13, "id": "HGW6D3CpavRxM9jodJHUydkjwT4bSZPe9Q7FqUJwMTMd", "fee": 1100000, "feeAssetId": null, "timestamp": 1661862206980, "version": 2, "chainId": 84, "sender": "3N8bnD2caKnxdcTqvrJUEkDe3XebgfwWjSV", "senderPublicKey": "8KXPjDuC8ffL9qjNuDBLnkvJKbMojhZYcnm2o75UCyun", "proofs": [ "4WjLp9go5923CL5Afvu2zCweVwmGkrKdKReQoq8VSYo8kCQ2YsTL7TzUSYhcGc8phRrhre9k5prBP2hKJsKrpLMh" ], "script": "base64:AAIFAAAAAAAAACIIAhIDCgEIEgMKAQgSABIDCgEYEggKBgEBAQEIARIDCgEIAAAAHwAAAAADU0VQAgAAAAJfXwAAAAAFRU1QVFkCAAAAAAAAAAAOaWR4UG9vbEFkZHJlc3MAAAAAAAAAAAEAAAAACWlkeExQQXNJZAAAAAAAAAAAAwAAAAAJaWR4QW1Bc0lkAAAAAAAAAAAEAAAAAAlpZHhQckFzSWQAAAAAAAAAAAUAAAAAD2lkeEZhY3RTdGFrQ250cgAAAAAAAAAAAQEAAAALa2V5RmFjdENudHIAAAAAAgAAABMlc19fZmFjdG9yeUNvbnRyYWN0AQAAABNrZXlNYW5hZ2VyUHVibGljS2V5AAAAAAIAAAAUJXNfX21hbmFnZXJQdWJsaWNLZXkBAAAAGmtleVBlbmRpbmdNYW5hZ2VyUHVibGljS2V5AAAAAAIAAAAbJXNfX3BlbmRpbmdNYW5hZ2VyUHVibGljS2V5AQAAAAtrZXlQb29sQWRkcgAAAAACAAAADyVzX19wb29sQWRkcmVzcwEAAAALa2V5QW10QXNzZXQAAAAAAgAAAA8lc19fYW1vdW50QXNzZXQBA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AAACCQEAAAAGa2V5QW1wAAAAAAkABEwAAAACBQAAAANhbXAFAAAAA25pbAUAAAADbmlsBAAAAARyZXMyCQAD/AAAAAQFAAAADHBvb2xDb250cmFjdAIAAAAEc2V0UwkABEwAAAACCQEAAAANa2V5QW1wSGlzdG9yeQAAAAEFAAAABmhlaWdodAkABEwAAAACBQAAAANhbXAFAAAAA25pbAUAAAADbmlsCQAFFAAAAAIFAAAAA25pbAkABRQAAAACBQAAAARyZXMxBQAAAARyZXMyCQAAAgAAAAECAAAAJFN0cmljdCB2YWx1ZSBpcyBub3QgZXF1YWwgdG8gaXRzZWxmLgAAAAEAAAACdHgBAAAABnZlcmlmeQAAAAAEAAAAD3RhcmdldFB1YmxpY0tleQQAAAAHJG1hdGNoMAkBAAAAFm1hbmFnZXJQdWJsaWNLZXlPclVuaXQAAAAAAwkAAAEAAAACBQAAAAckbWF0Y2gwAgAAAApCeXRlVmVjdG9yBAAAAAJwawUAAAAHJG1hdGNoMAUAAAACcGsDCQAAAQAAAAIFAAAAByRtYXRjaDACAAAABFVuaXQIBQAAAAJ0eAAAAA9zZW5kZXJQdWJsaWNLZXkJAAACAAAAAQIAAAALTWF0Y2ggZXJyb3IJAAH0AAAAAwgFAAAAAnR4AAAACWJvZHlCeXRlcwkAAZEAAAACCAUAAAACdHgAAAAGcHJvb2ZzAAAAAAAAAAAABQAAAA90YXJnZXRQdWJsaWNLZXmJkpk6", "height": 2207178, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: HXgDLo4yBsEhitcdPERtKjbVDU34XHKAG2KerUa7KsED Next: 8ymj6hzeVJHuMzMvKGZC62TPWBytjr1WRWoRtavBd6WH Full:
OldNewDifferences
11 {-# STDLIB_VERSION 5 #-}
22 {-# SCRIPT_TYPE ACCOUNT #-}
33 {-# CONTENT_TYPE DAPP #-}
44 let SEP = "__"
55
66 let EMPTY = ""
77
88 let idxPoolAddress = 1
99
1010 let idxLPAsId = 3
1111
1212 let idxAmAsId = 4
1313
1414 let idxPrAsId = 5
1515
1616 let idxFactStakCntr = 1
1717
1818 func keyFactCntr () = "%s__factoryContract"
1919
2020
2121 func keyManagerPublicKey () = "%s__managerPublicKey"
2222
2323
2424 func keyPendingManagerPublicKey () = "%s__pendingManagerPublicKey"
2525
2626
2727 func keyPoolAddr () = "%s__poolAddress"
2828
2929
3030 func keyAmtAsset () = "%s__amountAsset"
3131
3232
3333 func keyPriceAsset () = "%s__priceAsset"
3434
3535
3636 func keyAdminPubKeys () = "%s__adminPubKeys"
3737
3838
3939 func keyAmp () = "%s__amp"
4040
4141
4242 func keyAmpHistory (height) = ("%s%d__amp__" + toString(height))
4343
4444
4545 func keyFactoryConfig () = "%s__factoryConfig"
4646
4747
4848 func keyPoolConfig (iAmtAs,iPrAs) = (((("%d%d%s__" + iAmtAs) + "__") + iPrAs) + "__config")
4949
5050
5151 func keyMappingsBaseAsset2internalId (bAStr) = ("%s%s%s__mappings__baseAsset2internalId__" + bAStr)
5252
5353
5454 func getStringOrFail (addr,key) = valueOrErrorMessage(getString(addr, key), makeString(["mandatory ", toString(addr), ".", key, " not defined"], ""))
5555
5656
5757 func getIntOrFail (addr,key) = valueOrErrorMessage(getInteger(addr, key), makeString(["mandatory ", toString(addr), ".", key, " not defined"], ""))
5858
5959
6060 let poolContract = addressFromStringValue(getStringOrFail(this, keyPoolAddr()))
6161
6262 let factoryContract = addressFromStringValue(getStringOrFail(poolContract, keyFactCntr()))
6363
6464 func getPoolConfig () = {
6565 let amtAs = getStringOrFail(poolContract, keyAmtAsset())
6666 let priceAs = getStringOrFail(poolContract, keyPriceAsset())
6767 let iPriceAs = getIntOrFail(factoryContract, keyMappingsBaseAsset2internalId(priceAs))
6868 let iAmtAs = getIntOrFail(factoryContract, keyMappingsBaseAsset2internalId(amtAs))
6969 split(getStringOrFail(factoryContract, keyPoolConfig(toString(iAmtAs), toString(iPriceAs))), SEP)
7070 }
7171
7272
7373 func getFactoryConfig () = split(getStringOrFail(factoryContract, keyFactoryConfig()), SEP)
7474
7575
7676 func managerPublicKeyOrUnit () = match getString(keyManagerPublicKey()) {
7777 case s: String =>
7878 fromBase58String(s)
7979 case _: Unit =>
8080 unit
8181 case _ =>
8282 throw("Match error")
8383 }
8484
8585
8686 func pendingManagerPublicKeyOrUnit () = match getString(keyPendingManagerPublicKey()) {
8787 case s: String =>
8888 fromBase58String(s)
8989 case _: Unit =>
9090 unit
9191 case _ =>
9292 throw("Match error")
9393 }
9494
9595
9696 func mustManager (i) = {
9797 let pd = throw("Permission denied")
9898 match managerPublicKeyOrUnit() {
9999 case pk: ByteVector =>
100100 if ((i.callerPublicKey == pk))
101101 then true
102102 else pd
103103 case _: Unit =>
104104 if ((i.caller == this))
105105 then true
106106 else pd
107107 case _ =>
108108 throw("Match error")
109109 }
110110 }
111111
112112
113113 func getAdmins () = match getString(keyAdminPubKeys()) {
114114 case s: String =>
115115 if ((size(s) == 0))
116116 then nil
117117 else split(s, SEP)
118118 case _ =>
119119 nil
120120 }
121121
122122
123123 func mustAdmin (i) = if (containsElement(getAdmins(), toBase58String(i.callerPublicKey)))
124124 then true
125125 else mustManager(i)
126126
127127
128128 func mustPool (i) = if ((i.caller == poolContract))
129129 then true
130130 else throw("caller must be the pool")
131131
132132
133133 @Callable(i)
134134 func constructor (poolAddress) = {
135135 let checkCaller = mustManager(i)
136136 if ((checkCaller == checkCaller))
137137 then [StringEntry(keyPoolAddr(), poolAddress)]
138138 else throw("Strict value is not equal to itself.")
139139 }
140140
141141
142142
143143 @Callable(i)
144144 func setManager (pendingManagerPublicKey) = {
145145 let checkCaller = mustManager(i)
146146 if ((checkCaller == checkCaller))
147147 then {
148148 let checkManagerPublicKey = fromBase58String(pendingManagerPublicKey)
149149 if ((checkManagerPublicKey == checkManagerPublicKey))
150150 then [StringEntry(keyPendingManagerPublicKey(), pendingManagerPublicKey)]
151151 else throw("Strict value is not equal to itself.")
152152 }
153153 else throw("Strict value is not equal to itself.")
154154 }
155155
156156
157157
158158 @Callable(i)
159159 func confirmManager () = {
160160 let pm = pendingManagerPublicKeyOrUnit()
161161 let hasPM = if (isDefined(pm))
162162 then true
163163 else throw("No pending manager")
164164 if ((hasPM == hasPM))
165165 then {
166166 let checkPM = if ((i.callerPublicKey == value(pm)))
167167 then true
168168 else throw("You are not pending manager")
169169 if ((checkPM == checkPM))
170170 then [StringEntry(keyManagerPublicKey(), toBase58String(value(pm))), DeleteEntry(keyPendingManagerPublicKey())]
171171 else throw("Strict value is not equal to itself.")
172172 }
173173 else throw("Strict value is not equal to itself.")
174174 }
175175
176176
177177
178178 @Callable(i)
179179 func setAdmins (adminPubKeys) = {
180180 let checkCaller = mustManager(i)
181181 if ((checkCaller == checkCaller))
182182 then [StringEntry(keyAdminPubKeys(), makeString(adminPubKeys, SEP))]
183183 else throw("Strict value is not equal to itself.")
184184 }
185185
186186
187187
188188 @Callable(i)
189189 func unstakeAndGetOneTkn (amount,exchResult,notUsed,outAmount,outAssetId,slippage) = {
190190 let checkPayments = if ((size(i.payments) != 0))
191191 then throw("No pmnts expd")
192192 else true
193193 if ((checkPayments == checkPayments))
194194 then {
195195 let cfg = getPoolConfig()
196196 let factoryCfg = getFactoryConfig()
197197 let lpAssetId = fromBase58String(cfg[idxLPAsId])
198198 let staking = valueOrErrorMessage(addressFromString(factoryCfg[idxFactStakCntr]), "Wr st addr")
199199 let unstakeInv = invoke(staking, "unstake", [toBase58String(lpAssetId), amount], nil)
200200 if ((unstakeInv == unstakeInv))
201201 then {
202202 let getOneTkn = invoke(poolContract, "getOneTkn", [exchResult, notUsed, outAmount, outAssetId, slippage], [AttachedPayment(lpAssetId, amount)])
203203 if ((getOneTkn == getOneTkn))
204204 then nil
205205 else throw("Strict value is not equal to itself.")
206206 }
207207 else throw("Strict value is not equal to itself.")
208208 }
209209 else throw("Strict value is not equal to itself.")
210210 }
211211
212212
213213
214214 @Callable(i)
215215 func setAmp (amp) = {
216216 let checkCaller = mustAdmin(i)
217217 if ((checkCaller == checkCaller))
218218 then {
219219 let res1 = invoke(poolContract, "setS", [keyAmp(), amp], nil)
220220 let res2 = invoke(poolContract, "setS", [keyAmpHistory(height), amp], nil)
221221 $Tuple2(nil, $Tuple2(res1, res2))
222222 }
223223 else throw("Strict value is not equal to itself.")
224224 }
225225
226226
227227 @Verifier(tx)
228228 func verify () = {
229229 let targetPublicKey = match managerPublicKeyOrUnit() {
230230 case pk: ByteVector =>
231231 pk
232232 case _: Unit =>
233233 tx.senderPublicKey
234234 case _ =>
235235 throw("Match error")
236236 }
237237 sigVerify(tx.bodyBytes, tx.proofs[0], targetPublicKey)
238238 }
239239

github/deemru/w8io/169f3d6 
41.32 ms