tx · BqMAkFU9AWozCyNuz8h8rFKcT3e2vpdScyn3RTyYf9aE

3N1ytAUyhtig9X6F2hHHs1jbzYxr47Yp8Fr:  -0.00500000 Waves

2024.10.10 12:13 [3320549] smart account 3N1ytAUyhtig9X6F2hHHs1jbzYxr47Yp8Fr > SELF 0.00000000 Waves

{ "type": 13, "id": "BqMAkFU9AWozCyNuz8h8rFKcT3e2vpdScyn3RTyYf9aE", "fee": 500000, "feeAssetId": null, "timestamp": 1728551643786, "version": 2, "chainId": 84, "sender": "3N1ytAUyhtig9X6F2hHHs1jbzYxr47Yp8Fr", "senderPublicKey": "jXCTQV8PjX2uC9UHBFveupYy9cjhY7stHbzE9cptymw", "proofs": [ "4CD2maHVSsa2ccd6xyxGLStWR9GU6ph2XRDqy94A6U2ovgkjS8sey1scoSvffmR8RUZHgGfZTZruJf6MESmpkzr5" ], "script": "base64:BwITCAISAwoBCBIECgICGBIECgICGCAACXNlcGFyYXRvcgICX18AC3dhdmVzU3RyaW5nAgVXQVZFUwAQY29udHJhY3RGaWxlbmFtZQIXbWVtZV9pbV9jYWxjdWxhdG9yLnJpZGUABW11bHQ4AIDC1y8BB3dyYXBFcnIBAXMJAKwCAgkArAICBRBjb250cmFjdEZpbGVuYW1lAgI6IAUBcwEIdGhyb3dFcnIBAXMJAAIBCQEHd3JhcEVycgEFAXMBD3ZhbGlkYXRlQWRkcmVzcwEHYWRkcmVzcwkBCWlzRGVmaW5lZAEJAKYIAQUHYWRkcmVzcwAMU1RBVFVTX0VNUFRZAAAADFNUQVRVU19SRUFEWQABAAlrU2h1dGRvd24CDnNodXRkb3duX19mbGFnAAtrUHJpY2VBc3NldAIMcHJpY2VfX2Fzc2V0AA5rTGlzdGluZ1ZvbHVtZQIPbGlzdGluZ19fdm9sdW1lABFrUG9vbENvbnRyYWN0SGFzaAIUcG9vbF9fY29udHJhY3RfX2hhc2gAE2tMYXN0RW1wdHlQb29sSW5kZXgCF2xhc3RfX2VtcHR5X3Bvb2xfX2luZGV4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kVBRFkFA25pbAUDbmlsBQNuaWwJAJQKAgUDbmlsBQ5mYWN0b3J5QWN0aW9ucwkAAgECJFN0cmljdCB2YWx1ZSBpcyBub3QgZXF1YWwgdG8gaXRzZWxmLgkAAgECJFN0cmljdCB2YWx1ZSBpcyBub3QgZXF1YWwgdG8gaXRzZWxmLgCdj211", "height": 3320549, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: F8DFHvD1uyhN1a6wQ2qMP7LNVSveS95K67AmvoS3rYRN Next: 7HhGoX2KGrwQJWc9LaBuDMmvHpLNsCrLd6o8dnoh7w5s Diff:
OldNewDifferences
148148 let tokenName = args[0]
149149 let tokenDesc = args[1]
150150 let tokenQuantity = args[2]
151- let initPoolInvoke = invoke(factoryAddress, "initPoolInvoke", [poolAddress.bytes, [poolDomain, poolOwner, tokenName, tokenDesc, tokenQuantity]], [AttachedPayment(i.payments[0].assetId, i.payments[0].amount)])
151+ let initPoolInvoke = invoke(factoryAddress, "initPoolInvoke", [poolAddressString, [poolDomain, poolOwner, tokenName, tokenDesc, tokenQuantity]], [AttachedPayment(i.payments[0].assetId, i.payments[0].amount)])
152152 if ((initPoolInvoke == initPoolInvoke))
153153 then {
154154 let factoryActions = [invoke(factoryAddress, "integerEntry", [kFirstEmptyPoolIndex, poolIndex], nil), invoke(factoryAddress, "integerEntry", [kPoolStatus(poolIndex), STATUS_READY], nil)]
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 kPoolContractHash = "pool__contract__hash"
3232
3333 let kLastEmptyPoolIndex = "last__empty_pool__index"
3434
3535 let kFirstEmptyPoolIndex = "first__empty__pool__index"
3636
3737 func kPoolAddressFromIndex (index) = makeString(["pool", toString(index)], separator)
3838
3939
4040 func kPoolIndexFromAddress (address) = makeString(["pool", toString(address)], separator)
4141
4242
4343 func kPoolAsset (address) = makeString(["asset", toString(address)], separator)
4444
4545
4646 func kPoolStatus (index) = makeString(["pool", "status", toString(index)], separator)
4747
4848
4949 let kFactoryAddress = "factory__address"
5050
5151 let factoryAddressOption = match getString(this, kFactoryAddress) {
5252 case s: String =>
5353 addressFromString(s)
5454 case _: Unit =>
5555 unit
5656 case _ =>
5757 throw("Match error")
5858 }
5959
6060 let factoryAddress = valueOrErrorMessage(factoryAddressOption, wrapErr("invalid factory address"))
6161
6262 let shutdown = valueOrElse(getBoolean(factoryAddress, kShutdown), false)
6363
6464 let lastEmptyIndex = valueOrElse(getInteger(factoryAddress, kLastEmptyPoolIndex), 0)
6565
6666 let firstEmptyIndex = valueOrElse(getInteger(factoryAddress, kFirstEmptyPoolIndex), 0)
6767
6868 let listingVolume = valueOrElse(getInteger(factoryAddress, kListingVolume), 0)
6969
7070 func parseAssetId (input) = if ((input == wavesString))
7171 then unit
7272 else fromBase58String(input)
7373
7474
7575 func assetIdToString (input) = if ((input == unit))
7676 then wavesString
7777 else toBase58String(value(input))
7878
7979
8080 func mustAddress (caller,address) = if ((caller == address))
8181 then true
8282 else throwErr("permission denied")
8383
8484
8585 func mustThis (caller) = mustAddress(caller, this)
8686
8787
8888 func mustFactory (caller) = mustAddress(caller, factoryAddress)
8989
9090
9191 func poolContractHash () = valueOrErrorMessage(getBinary(factoryAddress, kPoolContractHash), wrapErr("pool contract script hash is not set"))
9292
9393
9494 @Callable(i)
9595 func init (factoryAddressStr) = {
9696 let checkCaller = mustThis(i.caller)
9797 if ((checkCaller == checkCaller))
9898 then [StringEntry(kFactoryAddress, factoryAddressStr)]
9999 else throw("Strict value is not equal to itself.")
100100 }
101101
102102
103103
104104 @Callable(i)
105105 func addEmptyPool (callerPublicKey,args) = {
106106 let newPoolAddress = addressFromPublicKey(callerPublicKey)
107107 let newPoolIndex = (lastEmptyIndex + 1)
108108 let checks = [if (!(shutdown))
109109 then true
110110 else throwErr("not allowed (shutdown)"), if (!(isDefined(getInteger(factoryAddress, kPoolIndexFromAddress(newPoolAddress)))))
111111 then true
112112 else throwErr("pool address is already registered")]
113113 if ((checks == checks))
114114 then {
115115 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)]
116116 $Tuple2(nil, factoryActions)
117117 }
118118 else throw("Strict value is not equal to itself.")
119119 }
120120
121121
122122
123123 @Callable(i)
124124 func createPool (callerPublicKey,args) = {
125125 let checks = [if (!(shutdown))
126126 then true
127127 else throwErr("not allowed (shutdown)"), mustFactory(i.caller), if (((lastEmptyIndex - firstEmptyIndex) > 0))
128128 then true
129129 else throwErr("no empty pools available"), if ((i.payments[0].assetId == unit))
130130 then true
131131 else throwErr("payment should be in WAVES"), if ((i.payments[0].amount > listingVolume))
132132 then true
133133 else throwErr("payment amount should be greater than listing volume"), if (isDefined(args[0]))
134134 then true
135135 else throwErr("tokenName is not provided"), if (isDefined(args[1]))
136136 then true
137137 else throwErr("tokenDescription is not provided"), if (isDefined(args[2]))
138138 then true
139139 else throwErr("tokenQuantity is not provided")]
140140 if ((checks == checks))
141141 then {
142142 let poolIndex = (firstEmptyIndex + 1)
143143 let poolAddressString = getStringValue(factoryAddress, kPoolAddressFromIndex(poolIndex))
144144 let poolAddress = addressFromStringValue(poolAddressString)
145145 let callerAddress = addressFromPublicKey(callerPublicKey)
146146 let poolDomain = take(poolAddressString, 8)
147147 let poolOwner = toString(callerAddress)
148148 let tokenName = args[0]
149149 let tokenDesc = args[1]
150150 let tokenQuantity = args[2]
151- let initPoolInvoke = invoke(factoryAddress, "initPoolInvoke", [poolAddress.bytes, [poolDomain, poolOwner, tokenName, tokenDesc, tokenQuantity]], [AttachedPayment(i.payments[0].assetId, i.payments[0].amount)])
151+ let initPoolInvoke = invoke(factoryAddress, "initPoolInvoke", [poolAddressString, [poolDomain, poolOwner, tokenName, tokenDesc, tokenQuantity]], [AttachedPayment(i.payments[0].assetId, i.payments[0].amount)])
152152 if ((initPoolInvoke == initPoolInvoke))
153153 then {
154154 let factoryActions = [invoke(factoryAddress, "integerEntry", [kFirstEmptyPoolIndex, poolIndex], nil), invoke(factoryAddress, "integerEntry", [kPoolStatus(poolIndex), STATUS_READY], nil)]
155155 $Tuple2(nil, factoryActions)
156156 }
157157 else throw("Strict value is not equal to itself.")
158158 }
159159 else throw("Strict value is not equal to itself.")
160160 }
161161
162162

github/deemru/w8io/026f985 
103.78 ms