tx · 9ZsGgdMa9AwbW9TacU7RyQ3ihsRYvuugN67aSaByNe4r

3N1ytAUyhtig9X6F2hHHs1jbzYxr47Yp8Fr:  -0.01000000 Waves

2024.11.26 12:09 [3388185] smart account 3N1ytAUyhtig9X6F2hHHs1jbzYxr47Yp8Fr > SELF 0.00000000 Waves

{ "type": 13, "id": "9ZsGgdMa9AwbW9TacU7RyQ3ihsRYvuugN67aSaByNe4r", "fee": 1000000, "feeAssetId": null, "timestamp": 1732612251737, "version": 2, "chainId": 84, "sender": "3N1ytAUyhtig9X6F2hHHs1jbzYxr47Yp8Fr", "senderPublicKey": "jXCTQV8PjX2uC9UHBFveupYy9cjhY7stHbzE9cptymw", "proofs": [ "4gv1VEH67rq4r6V5SP8FtN78YLff9ZiPfdiroJvgL9oYxNoSG3QGxtrE86WLKXR6YNuJN3sepD6PkXKJW8fV7HYH" ], "script": "base64:BwIZCAISAwoBCBIECgICGBIECgICGBIECgICGCYACXNlcGFyYXRvcgICX18AC3dhdmVzU3RyaW5nAgVXQVZFUwAQY29udHJhY3RGaWxlbmFtZQIXbWVtZV9pbV9jYWxjdWxhdG9yLnJpZGUABW11bHQ4AIDC1y8BB3dyYXBFcnIBAXMJAKwCAgkArAICBRBjb250cmFjdEZpbGVuYW1lAgI6IAUBcwEIdGhyb3dFcnIBAXMJAAIBCQEHd3JhcEVycgEFAXMBD3ZhbGlkYXRlQWRkcmVzcwEHYWRkcmVzcwkBCWlzRGVmaW5lZAEJAKYIAQUHYWRkcmVzcwAMU1RBVFVTX0VNUFRZAAAADFNUQVRVU19SRUFEWQABAAlrU2h1dGRvd24CDnNodXRkb3duX19mbGFnAAtrUHJpY2VBc3NldAIMcHJpY2VfX2Fzc2V0AA5rTGlzdGluZ1ZvbHVtZQIPbGlzdGluZ19fdm9sdW1lAAxrQ3JlYXRpb25GZWUCEnNldHVwX19jcmVhdGlvbkZlZQAMa0N1cnZlVGFyZ2V0AhJzZXR1cF9fY3VydmVUYXJnZXQAEWtWaXJ0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eWtXfwGc5cjj89BdcPAWYkS4qy5f69 Next: none Diff:
OldNewDifferences
201201 }
202202
203203
204+@Verifier(tx)
205+func verify () = {
206+ let keyAdminAddressList = "%s__adminAddressList"
207+ let keyAllowedTxId = "%s__txId"
208+ let adminList = split(valueOrElse(getString(factoryAddress, keyAdminAddressList), ""), "__")
209+ let byOwner = if ((size(adminList) >= 3))
210+ then false
211+ else sigVerify(tx.bodyBytes, tx.proofs[0], tx.senderPublicKey)
212+ let byAdmins = (tx.id == fromBase58String(valueOrElse(getString(factoryAddress, keyAllowedTxId), "")))
213+ if (byAdmins)
214+ then true
215+ else byOwner
216+ }
217+
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 kShutdown = "shutdown__flag"
2626
2727 let kPriceAsset = "price__asset"
2828
2929 let kListingVolume = "listing__volume"
3030
3131 let kCreationFee = "setup__creationFee"
3232
3333 let kCurveTarget = "setup__curveTarget"
3434
3535 let kVirtualLiquidity = "setup__virtualLiquidity"
3636
3737 let kPoolContractHash = "pool__contract__hash"
3838
3939 let kLastEmptyPoolIndex = "last__empty_pool__index"
4040
4141 let kFirstEmptyPoolIndex = "first__empty__pool__index"
4242
4343 func kPoolAddressFromIndex (index) = makeString(["pool", toString(index)], separator)
4444
4545
4646 func kPoolIndexFromAddress (address) = makeString(["pool", toString(address)], separator)
4747
4848
4949 func kPoolAsset (address) = makeString(["asset", toString(address)], separator)
5050
5151
5252 func kPoolStatus (index) = makeString(["pool", "status", toString(index)], separator)
5353
5454
5555 let kFactoryAddress = "factory__address"
5656
5757 let factoryAddressOption = match getString(this, kFactoryAddress) {
5858 case s: String =>
5959 addressFromString(s)
6060 case _: Unit =>
6161 unit
6262 case _ =>
6363 throw("Match error")
6464 }
6565
6666 let factoryAddress = valueOrErrorMessage(factoryAddressOption, wrapErr("invalid factory address"))
6767
6868 let shutdown = valueOrElse(getBoolean(factoryAddress, kShutdown), false)
6969
7070 let lastEmptyIndex = valueOrElse(getInteger(factoryAddress, kLastEmptyPoolIndex), 0)
7171
7272 let firstEmptyIndex = valueOrElse(getInteger(factoryAddress, kFirstEmptyPoolIndex), 0)
7373
7474 let listingVolume = valueOrElse(getInteger(factoryAddress, kListingVolume), 0)
7575
7676 let creationFee = valueOrElse(getInteger(factoryAddress, kCreationFee), 0)
7777
7878 let poolContractHash = getBinary(factoryAddress, kPoolContractHash)
7979
8080 func parseAssetId (input) = if ((input == wavesString))
8181 then unit
8282 else fromBase58String(input)
8383
8484
8585 func assetIdToString (input) = if ((input == unit))
8686 then wavesString
8787 else toBase58String(value(input))
8888
8989
9090 func mustAddress (caller,address) = if ((caller == address))
9191 then true
9292 else throwErr("permission denied")
9393
9494
9595 func mustThis (caller) = mustAddress(caller, this)
9696
9797
9898 func mustFactory (caller) = mustAddress(caller, factoryAddress)
9999
100100
101101 func checkContractScript (address) = match poolContractHash {
102102 case hash: ByteVector =>
103103 (scriptHash(address) == hash)
104104 case _ =>
105105 true
106106 }
107107
108108
109109 func isPoolExists (poolAddress) = isDefined(getInteger(factoryAddress, kPoolIndexFromAddress(poolAddress)))
110110
111111
112112 @Callable(i)
113113 func init (factoryAddressStr) = {
114114 let checkCaller = mustThis(i.caller)
115115 if ((checkCaller == checkCaller))
116116 then [StringEntry(kFactoryAddress, factoryAddressStr)]
117117 else throw("Strict value is not equal to itself.")
118118 }
119119
120120
121121
122122 @Callable(i)
123123 func addEmptyPool (callerPublicKey,args) = {
124124 let newPoolAddress = addressFromPublicKey(callerPublicKey)
125125 let newPoolIndex = (lastEmptyIndex + 1)
126126 let checks = [if (!(shutdown))
127127 then true
128128 else throwErr("not allowed (shutdown)"), if (checkContractScript(newPoolAddress))
129129 then true
130130 else throwErr("pool script is not allowed"), if (!(isPoolExists(newPoolAddress)))
131131 then true
132132 else throwErr("pool address is already registered")]
133133 if ((checks == checks))
134134 then {
135135 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)]
136136 $Tuple2(nil, factoryActions)
137137 }
138138 else throw("Strict value is not equal to itself.")
139139 }
140140
141141
142142
143143 @Callable(i)
144144 func createPool (callerPublicKey,args) = {
145145 let minPayment = (listingVolume + creationFee)
146146 let checks = [if (!(shutdown))
147147 then true
148148 else throwErr("Temporary shutdown"), mustFactory(i.caller), if (((lastEmptyIndex - firstEmptyIndex) > 0))
149149 then true
150150 else throwErr("No empty pool available"), if ((i.payments[0].assetId == unit))
151151 then true
152152 else throwErr("Payment should be in WAVES"), if ((i.payments[0].amount >= minPayment))
153153 then true
154154 else throwErr((("Payment should be greater or equal " + toString(minPayment)) + " WAVELET")), if (isDefined(args[0]))
155155 then true
156156 else throwErr("Token name is not provided"), if (isDefined(args[1]))
157157 then true
158158 else throwErr("Token description is not provided"), if (isDefined(args[2]))
159159 then true
160160 else throwErr("Token quantity is not provided"), if ((parseInt(args[2]) != unit))
161161 then true
162162 else throwErr("Token quantity should be a number")]
163163 if ((checks == checks))
164164 then {
165165 let poolIndex = (firstEmptyIndex + 1)
166166 let poolAddressString = getStringValue(factoryAddress, kPoolAddressFromIndex(poolIndex))
167167 let poolAddress = addressFromStringValue(poolAddressString)
168168 let callerAddress = addressFromPublicKey(callerPublicKey)
169169 let poolDomain = take(poolAddressString, 8)
170170 let poolOwner = toString(callerAddress)
171171 let tokenName = args[0]
172172 let tokenDesc = args[1]
173173 let tokenQuantity = args[2]
174174 let initPoolInvoke = invoke(factoryAddress, "initPoolInvoke", [poolAddressString, [poolDomain, poolOwner, tokenName, tokenDesc, tokenQuantity]], [AttachedPayment(i.payments[0].assetId, i.payments[0].amount)])
175175 if ((initPoolInvoke == initPoolInvoke))
176176 then {
177177 let factoryActions = [invoke(factoryAddress, "integerEntry", [kFirstEmptyPoolIndex, poolIndex], nil), invoke(factoryAddress, "integerEntry", [kPoolStatus(poolIndex), STATUS_READY], nil)]
178178 $Tuple2(nil, factoryActions)
179179 }
180180 else throw("Strict value is not equal to itself.")
181181 }
182182 else throw("Strict value is not equal to itself.")
183183 }
184184
185185
186186
187187 @Callable(i)
188188 func notifyStatusUpdate (callerPublicKey,args) = {
189189 let poolAddress = addressFromPublicKey(callerPublicKey)
190190 let checks = [if (isPoolExists(poolAddress))
191191 then true
192192 else throwErr("pool not found"), mustFactory(i.caller)]
193193 if ((checks == checks))
194194 then {
195195 let poolIndex = getIntegerValue(factoryAddress, kPoolIndexFromAddress(poolAddress))
196196 let newStatus = parseIntValue(args[0])
197197 let factoryActions = [invoke(factoryAddress, "integerEntry", [kPoolStatus(poolIndex), newStatus], nil)]
198198 $Tuple2(nil, factoryActions)
199199 }
200200 else throw("Strict value is not equal to itself.")
201201 }
202202
203203
204+@Verifier(tx)
205+func verify () = {
206+ let keyAdminAddressList = "%s__adminAddressList"
207+ let keyAllowedTxId = "%s__txId"
208+ let adminList = split(valueOrElse(getString(factoryAddress, keyAdminAddressList), ""), "__")
209+ let byOwner = if ((size(adminList) >= 3))
210+ then false
211+ else sigVerify(tx.bodyBytes, tx.proofs[0], tx.senderPublicKey)
212+ let byAdmins = (tx.id == fromBase58String(valueOrElse(getString(factoryAddress, keyAllowedTxId), "")))
213+ if (byAdmins)
214+ then true
215+ else byOwner
216+ }
217+

github/deemru/w8io/026f985 
28.95 ms