tx · FW4ZLacr9kopQfi3kMg33eHdeiBUkYphzmTEDq5SyXMQ

3N1ytAUyhtig9X6F2hHHs1jbzYxr47Yp8Fr:  -0.01200000 Waves

2024.12.16 08:01 [3416859] smart account 3N1ytAUyhtig9X6F2hHHs1jbzYxr47Yp8Fr > SELF 0.00000000 Waves

{ "type": 13, "id": "FW4ZLacr9kopQfi3kMg33eHdeiBUkYphzmTEDq5SyXMQ", "fee": 1200000, "feeAssetId": null, "timestamp": 1734336071901, "version": 2, "chainId": 84, "sender": "3N1ytAUyhtig9X6F2hHHs1jbzYxr47Yp8Fr", "senderPublicKey": "jXCTQV8PjX2uC9UHBFveupYy9cjhY7stHbzE9cptymw", "proofs": [ "5p13BWnfzj91duFJRd4roAjdLDDhXjhfgU77ZUenVFy2Nx1Pe47VkX5G6YhrYW2us7pXv84s81a8d2oQbZmRyafA" ], "script": "base64:BwIfCAISAwoBCBIECgICGBIECgICGBIECgICGBIECgICGCwACXNlcGFyYXRvcgICX18AC3dhdmVzU3RyaW5nAgVXQVZFUwAQY29udHJhY3RGaWxlbmFtZQIXbWVtZV9pbV9jYWxjdWxhdG9yLnJpZGUABW11bHQ4AIDC1y8BB3dyYXBFcnIBAXMJAKwCAgkArAICBRBjb250cmFjdEZpbGVuYW1lAgI6IAUBcwEIdGhyb3dFcnIBAXMJAAIBCQEHd3JhcEVycgEFAXMBD3ZhbGlkYXRlQWRkcmVzcwEHYWRkcmVzcwkBCWlzRGVmaW5lZAEJAKYIAQUHYWRkcmVzcwAMU1RBVFVTX0VNUFRZAAAADFNUQVRVU19SRUFEWQABABVTVEFUVVNfVEFSR0VUX1JFQUNIRUQAAgAJa1NodXRkb3duAg5zaHV0ZG93bl9fZmxhZwALa1ByaWNlQXNzZXQCDHByaWNlX19hc3NldAAOa0xpc3RpbmdWb2x1bWUCD2xpc3RpbmdfX3ZvbHVtZQAMa0NyZWF0aW9uRmVlAhJzZXR1cF9fY3JlYXRpb25GZWUADGtDdXJ2ZVRhcmdldAISc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AMwIAgUTYW1vdW50QXNzZXRJZFN0cmluZwkAzAgCBRJwcmljZUFzc2V0SWRTdHJpbmcJAMwIAgUGYW1vdW50BQNuaWwFA25pbAMJAAECBQFAAgNJbnQFAUAJAAIBCQCsAgIJAAMBBQFAAhggY291bGRuJ3QgYmUgY2FzdCB0byBJbnQJAJQKAgUDbmlsCQCUCgIFDnBvb2xTd2FwUmVzdWx0AglpTWVtZVBvb2wJAAIBAiRTdHJpY3QgdmFsdWUgaXMgbm90IGVxdWFsIHRvIGl0c2VsZi4BAnR4AQZ2ZXJpZnkABBNrZXlBZG1pbkFkZHJlc3NMaXN0AhQlc19fYWRtaW5BZGRyZXNzTGlzdAQOa2V5QWxsb3dlZFR4SWQCCCVzX190eElkBAlhZG1pbkxpc3QJALUJAgkBC3ZhbHVlT3JFbHNlAgkAnQgCBQ5mYWN0b3J5QWRkcmVzcwUTa2V5QWRtaW5BZGRyZXNzTGlzdAIAAgJfXwQHYnlPd25lcgMJAGcCCQCQAwEFCWFkbWluTGlzdAADBwkA9AMDCAUCdHgJYm9keUJ5dGVzCQCRAwIIBQJ0eAZwcm9vZnMAAAgFAnR4D3NlbmRlclB1YmxpY0tleQQIYnlBZG1pbnMJAAACCAUCdHgCaWQJANkEAQkBC3ZhbHVlT3JFbHNlAgkAnQgCBQ5mYWN0b3J5QWRkcmVzcwUOa2V5QWxsb3dlZFR4SWQCAAMFCGJ5QWRtaW5zBgUHYnlPd25lcqv5Jb8=", "height": 3416859, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: CUqJU9AeeQBkd7QRf35k2gP43aGZx4FVx8YyX6uJ2oeA Next: HG5LGg2bxYLNvihRSyQYjQ4cLPNLC1tJVxvDWyriRVPa Diff:
OldNewDifferences
241241 then @
242242 else throw(($getType(@) + " couldn't be cast to Int"))
243243 }
244- $Tuple2(nil, wxSwapResult)
244+ $Tuple2(nil, $Tuple2(wxSwapResult, "WxSwap"))
245245 }
246246 else {
247247 let poolSwapResult = {
250250 then @
251251 else throw(($getType(@) + " couldn't be cast to Int"))
252252 }
253- $Tuple2(nil, poolSwapResult)
253+ $Tuple2(nil, $Tuple2(poolSwapResult, "iMemePool"))
254254 }
255255 else throw("Strict value is not equal to itself.")
256256 }
Full:
OldNewDifferences
11 {-# STDLIB_VERSION 7 #-}
22 {-# SCRIPT_TYPE ACCOUNT #-}
33 {-# CONTENT_TYPE DAPP #-}
44 let separator = "__"
55
66 let wavesString = "WAVES"
77
88 let contractFilename = "meme_im_calculator.ride"
99
1010 let mult8 = 100000000
1111
1212 func wrapErr (s) = ((contractFilename + ": ") + s)
1313
1414
1515 func throwErr (s) = throw(wrapErr(s))
1616
1717
1818 func validateAddress (address) = isDefined(addressFromString(address))
1919
2020
2121 let STATUS_EMPTY = 0
2222
2323 let STATUS_READY = 1
2424
2525 let STATUS_TARGET_REACHED = 2
2626
2727 let kShutdown = "shutdown__flag"
2828
2929 let kPriceAsset = "price__asset"
3030
3131 let kListingVolume = "listing__volume"
3232
3333 let kCreationFee = "setup__creationFee"
3434
3535 let kCurveTarget = "setup__curveTarget"
3636
3737 let kVirtualLiquidity = "setup__virtualLiquidity"
3838
3939 let kPoolContractHash = "pool__contract__hash"
4040
4141 let kLastEmptyPoolIndex = "last__empty_pool__index"
4242
4343 let kFirstEmptyPoolIndex = "first__empty__pool__index"
4444
4545 func kPoolAddressFromIndex (index) = makeString(["pool", toString(index)], separator)
4646
4747
4848 func kPoolIndexFromAddress (address) = makeString(["pool", toString(address)], separator)
4949
5050
5151 func kPoolAsset (address) = makeString(["asset", toString(address)], separator)
5252
5353
5454 func kPoolStatus (index) = makeString(["pool", "status", toString(index)], separator)
5555
5656
5757 let kFactoryAddress = "factory__address"
5858
5959 let factoryAddressOption = match getString(this, kFactoryAddress) {
6060 case s: String =>
6161 addressFromString(s)
6262 case _: Unit =>
6363 unit
6464 case _ =>
6565 throw("Match error")
6666 }
6767
6868 let factoryAddress = valueOrErrorMessage(factoryAddressOption, wrapErr("invalid factory address"))
6969
7070 let kWxSwapAddress = "wxswap__address"
7171
7272 let wxSwapAddressOption = match getString(factoryAddress, kWxSwapAddress) {
7373 case s: String =>
7474 addressFromString(s)
7575 case _: Unit =>
7676 unit
7777 case _ =>
7878 throw("Match error")
7979 }
8080
8181 let wxSwapAddress = valueOrErrorMessage(wxSwapAddressOption, wrapErr("invalid wx swap address"))
8282
8383 let shutdown = valueOrElse(getBoolean(factoryAddress, kShutdown), false)
8484
8585 let lastEmptyIndex = valueOrElse(getInteger(factoryAddress, kLastEmptyPoolIndex), 0)
8686
8787 let firstEmptyIndex = valueOrElse(getInteger(factoryAddress, kFirstEmptyPoolIndex), 0)
8888
8989 let listingVolume = valueOrElse(getInteger(factoryAddress, kListingVolume), 0)
9090
9191 let creationFee = valueOrElse(getInteger(factoryAddress, kCreationFee), 0)
9292
9393 let poolContractHash = getBinary(factoryAddress, kPoolContractHash)
9494
9595 func parseAssetId (input) = if ((input == wavesString))
9696 then unit
9797 else fromBase58String(input)
9898
9999
100100 func assetIdToString (input) = if ((input == unit))
101101 then wavesString
102102 else toBase58String(value(input))
103103
104104
105105 func mustAddress (caller,address) = if ((caller == address))
106106 then true
107107 else throwErr("permission denied")
108108
109109
110110 func mustThis (caller) = mustAddress(caller, this)
111111
112112
113113 func mustFactory (caller) = mustAddress(caller, factoryAddress)
114114
115115
116116 func checkContractScript (address) = match poolContractHash {
117117 case hash: ByteVector =>
118118 (scriptHash(address) == hash)
119119 case _ =>
120120 true
121121 }
122122
123123
124124 func isPoolExists (poolAddress) = isDefined(getInteger(factoryAddress, kPoolIndexFromAddress(poolAddress)))
125125
126126
127127 func getPoolId (poolAddress) = valueOrErrorMessage(getInteger(factoryAddress, kPoolIndexFromAddress(poolAddress)), "pool doesn't exists")
128128
129129
130130 func isPoolTargetReached (poolAddress) = (valueOrElse(getInteger(factoryAddress, kPoolStatus(getPoolId(poolAddress))), -1) == STATUS_TARGET_REACHED)
131131
132132
133133 @Callable(i)
134134 func init (factoryAddressStr) = {
135135 let checkCaller = mustThis(i.caller)
136136 if ((checkCaller == checkCaller))
137137 then [StringEntry(kFactoryAddress, factoryAddressStr)]
138138 else throw("Strict value is not equal to itself.")
139139 }
140140
141141
142142
143143 @Callable(i)
144144 func addEmptyPool (callerPublicKey,args) = {
145145 let newPoolAddress = addressFromPublicKey(callerPublicKey)
146146 let newPoolIndex = (lastEmptyIndex + 1)
147147 let checks = [if (!(shutdown))
148148 then true
149149 else throwErr("not allowed (shutdown)"), if (checkContractScript(newPoolAddress))
150150 then true
151151 else throwErr("pool script is not allowed"), if (!(isPoolExists(newPoolAddress)))
152152 then true
153153 else throwErr("pool address is already registered")]
154154 if ((checks == checks))
155155 then {
156156 let factoryActions = [invoke(factoryAddress, "integerEntry", [kLastEmptyPoolIndex, newPoolIndex], nil), invoke(factoryAddress, "stringEntry", [kPoolAddressFromIndex(newPoolIndex), toString(newPoolAddress)], nil), invoke(factoryAddress, "integerEntry", [kPoolIndexFromAddress(newPoolAddress), newPoolIndex], nil), invoke(factoryAddress, "integerEntry", [kPoolStatus(newPoolIndex), STATUS_EMPTY], nil)]
157157 $Tuple2(nil, factoryActions)
158158 }
159159 else throw("Strict value is not equal to itself.")
160160 }
161161
162162
163163
164164 @Callable(i)
165165 func createPool (callerPublicKey,args) = {
166166 let minPayment = (listingVolume + creationFee)
167167 let checks = [if (!(shutdown))
168168 then true
169169 else throwErr("Temporary shutdown"), mustFactory(i.caller), if (((lastEmptyIndex - firstEmptyIndex) > 0))
170170 then true
171171 else throwErr("No empty pool available"), if ((i.payments[0].assetId == unit))
172172 then true
173173 else throwErr("Payment should be in WAVES"), if ((i.payments[0].amount >= minPayment))
174174 then true
175175 else throwErr((("Payment should be greater or equal " + toString(minPayment)) + " WAVELET")), if (isDefined(args[0]))
176176 then true
177177 else throwErr("Token name is not provided"), if (isDefined(args[1]))
178178 then true
179179 else throwErr("Token description is not provided"), if (isDefined(args[2]))
180180 then true
181181 else throwErr("Token quantity is not provided"), if ((parseInt(args[2]) != unit))
182182 then true
183183 else throwErr("Token quantity should be a number")]
184184 if ((checks == checks))
185185 then {
186186 let poolIndex = (firstEmptyIndex + 1)
187187 let poolAddressString = getStringValue(factoryAddress, kPoolAddressFromIndex(poolIndex))
188188 let poolAddress = addressFromStringValue(poolAddressString)
189189 let callerAddress = addressFromPublicKey(callerPublicKey)
190190 let poolDomain = take(poolAddressString, 8)
191191 let poolOwner = toString(callerAddress)
192192 let tokenName = args[0]
193193 let tokenDesc = args[1]
194194 let tokenQuantity = args[2]
195195 let initPoolInvoke = invoke(factoryAddress, "initPoolInvoke", [poolAddressString, [poolDomain, poolOwner, tokenName, tokenDesc, tokenQuantity]], [AttachedPayment(i.payments[0].assetId, i.payments[0].amount)])
196196 if ((initPoolInvoke == initPoolInvoke))
197197 then {
198198 let factoryActions = [invoke(factoryAddress, "integerEntry", [kFirstEmptyPoolIndex, poolIndex], nil), invoke(factoryAddress, "integerEntry", [kPoolStatus(poolIndex), STATUS_READY], nil)]
199199 $Tuple2(nil, factoryActions)
200200 }
201201 else throw("Strict value is not equal to itself.")
202202 }
203203 else throw("Strict value is not equal to itself.")
204204 }
205205
206206
207207
208208 @Callable(i)
209209 func notifyStatusUpdate (callerPublicKey,args) = {
210210 let poolAddress = addressFromPublicKey(callerPublicKey)
211211 let checks = [if (isPoolExists(poolAddress))
212212 then true
213213 else throwErr("pool not found"), mustFactory(i.caller)]
214214 if ((checks == checks))
215215 then {
216216 let poolIndex = getIntegerValue(factoryAddress, kPoolIndexFromAddress(poolAddress))
217217 let newStatus = parseIntValue(args[0])
218218 let factoryActions = [invoke(factoryAddress, "integerEntry", [kPoolStatus(poolIndex), newStatus], nil)]
219219 $Tuple2(nil, factoryActions)
220220 }
221221 else throw("Strict value is not equal to itself.")
222222 }
223223
224224
225225
226226 @Callable(i)
227227 func swapREADONLY (callerPublicKey,args) = {
228228 let poolAddress = addressFromStringValue(args[0])
229229 let amountAssetIdString = args[1]
230230 let priceAssetIdString = args[2]
231231 let amount = parseIntValue(args[3])
232232 let checks = [if (!(shutdown))
233233 then true
234234 else throwErr("Temporary shutdown"), mustFactory(i.caller)]
235235 if ((checks == checks))
236236 then if (isPoolTargetReached(poolAddress))
237237 then {
238238 let wxSwapResult = {
239239 let @ = invoke(wxSwapAddress, "swapCalculateREADONLY", [amount, amountAssetIdString, priceAssetIdString], nil)
240240 if ($isInstanceOf(@, "Int"))
241241 then @
242242 else throw(($getType(@) + " couldn't be cast to Int"))
243243 }
244- $Tuple2(nil, wxSwapResult)
244+ $Tuple2(nil, $Tuple2(wxSwapResult, "WxSwap"))
245245 }
246246 else {
247247 let poolSwapResult = {
248248 let @ = invoke(poolAddress, "swapReadOnly", [amountAssetIdString, priceAssetIdString, amount], nil)
249249 if ($isInstanceOf(@, "Int"))
250250 then @
251251 else throw(($getType(@) + " couldn't be cast to Int"))
252252 }
253- $Tuple2(nil, poolSwapResult)
253+ $Tuple2(nil, $Tuple2(poolSwapResult, "iMemePool"))
254254 }
255255 else throw("Strict value is not equal to itself.")
256256 }
257257
258258
259259 @Verifier(tx)
260260 func verify () = {
261261 let keyAdminAddressList = "%s__adminAddressList"
262262 let keyAllowedTxId = "%s__txId"
263263 let adminList = split(valueOrElse(getString(factoryAddress, keyAdminAddressList), ""), "__")
264264 let byOwner = if ((size(adminList) >= 3))
265265 then false
266266 else sigVerify(tx.bodyBytes, tx.proofs[0], tx.senderPublicKey)
267267 let byAdmins = (tx.id == fromBase58String(valueOrElse(getString(factoryAddress, keyAllowedTxId), "")))
268268 if (byAdmins)
269269 then true
270270 else byOwner
271271 }
272272

github/deemru/w8io/169f3d6 
33.55 ms