tx · 4FUjXe68xDAhr1gnzRmuPBYENxxrTnJ9rQaGN6tmbVyU

3MqySDQxn5jzBUc144oks9fQzAXCBvJ2B8Y:  -0.01000000 Waves

2021.08.24 18:15 [1672571] smart account 3MqySDQxn5jzBUc144oks9fQzAXCBvJ2B8Y > SELF 0.00000000 Waves

{ "type": 13, "id": "4FUjXe68xDAhr1gnzRmuPBYENxxrTnJ9rQaGN6tmbVyU", "fee": 1000000, "feeAssetId": null, "timestamp": 1629818146330, "version": 1, "sender": "3MqySDQxn5jzBUc144oks9fQzAXCBvJ2B8Y", "senderPublicKey": "3YcAqsm6P2UYnzeZng9DPfjNQbEcHithbYzPy3ZMzLMk", "proofs": [ "5pSQAasMStsSfHaMYkG3MiuM2W8cfLViStAk8L6cPafKBVXDcUmNhEMkHKBNqAkMqFky7BP9gBcYhwDkTbUVAxbF" ], "script": "base64:AAIFAAAAAAAAABsIAhIJCgcBAQEBAQgBEgASBAoCCAgSBAoCCAgAAAArAQAAAA9nZXRTdHJpbmdPckZhaWwAAAABAAAAA2tleQkBAAAAE3ZhbHVlT3JFcnJvck1lc3NhZ2UAAAACCQAEIgAAAAEFAAAAA2tleQkAASwAAAACCQABLAAAAAICAAAAD21hbmRhdG9yeSB0aGlzLgUAAAADa2V5AgAAAA8gaXMgbm90IGRlZmluZWQAAAAAA1NFUAIAAAACX18AAAAACEJVRlNDQUxFCQABNgAAAAEADeC2s6dkAAABAAAAHWNvbnZlcnRQcmljZUFzc2V0SW50b0lkb0Fzc2V0AAAABQAAABBwcmljZUFzc2V0QW1vdW50AAAADnByaWNlQXNzZXRNVUxUAAAABXByaWNlAAAACXByaWNlTVVMVAAAAAxpZG9Bc3NldE1VTFQEAAAACmJQcmljZU1VTFQJAAE2AAAAAQUAAAAOcHJpY2VBc3NldE1VTFQEAAAADmJQcmljZUFzc2V0QlVGCQABPAAAAAMJAAE2AAAAAQUAAAAQcHJpY2VBc3NldEFtb3VudAUAAAAIQlVGU0NBTEUFAAAACmJQcmljZU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ZAkABRQAAAACCQEAAAANaW50ZXJuYWxDbGFpbQAAAAMFAAAAEGNsYWltZWRBc3NldElkNTgIBQAAAAFpAAAABmNhbGxlcggFAAAAAWkAAAANdHJhbnNhY3Rpb25JZAUAAAAEdW5pdAAAAAFpAQAAAA1jbGFpbVJFQURPTkxZAAAAAgAAABBjbGFpbWVkQXNzZXRJZDU4AAAADXVzZXJBZGRyZXNzNTgJAAUUAAAAAgUAAAADbmlsCQEAAAANaW50ZXJuYWxDbGFpbQAAAAMFAAAAEGNsYWltZWRBc3NldElkNTgJAQAAABFAZXh0ck5hdGl2ZSgxMDYyKQAAAAEFAAAADXVzZXJBZGRyZXNzNTgJAAJZAAAAAQIAAAAAAAAAAFqHk6Q=", "chainId": 84, "height": 1672571, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: 8emc4e4wAfEvFr8C7w5cvS2zpgZyGkmUAZ5ty73E98v8 Next: J7teaWohvqdtLqRFwkWHtSZ62YgprYcBYiH7CLaHEgpF Diff:
OldNewDifferences
247247
248248
249249 @Callable(i)
250-func claimREADONLY (claimedAssetId58,userAddress58) = $Tuple2(nil, internalClaim(claimedAssetId58, i.caller, fromBase58String("")))
250+func claimREADONLY (claimedAssetId58,userAddress58) = $Tuple2(nil, internalClaim(claimedAssetId58, addressFromStringValue(userAddress58), fromBase58String("")))
251251
252252
Full:
OldNewDifferences
11 {-# STDLIB_VERSION 5 #-}
22 {-# SCRIPT_TYPE ACCOUNT #-}
33 {-# CONTENT_TYPE DAPP #-}
44 func getStringOrFail (key) = valueOrErrorMessage(getString(key), (("mandatory this." + key) + " is not defined"))
55
66
77 let SEP = "__"
88
99 let BUFSCALE = toBigInt(1000000000000000000)
1010
1111 func convertPriceAssetIntoIdoAsset (priceAssetAmount,priceAssetMULT,price,priceMULT,idoAssetMULT) = {
1212 let bPriceMULT = toBigInt(priceAssetMULT)
1313 let bPriceAssetBUF = fraction(toBigInt(priceAssetAmount), BUFSCALE, bPriceMULT)
1414 let bAmountAssetBUF = fraction(bPriceAssetBUF, bPriceMULT, toBigInt(price))
1515 toInt(fraction(bAmountAssetBUF, toBigInt(idoAssetMULT), BUFSCALE))
1616 }
1717
1818
1919 let IdxCfgIdoStart = 1
2020
2121 let IdxCfgIdoDuration = 2
2222
2323 let IdxCfgClaimStart = 3
2424
2525 let IdxCfgClaimDuration = 4
2626
2727 let IdxCfgPrice = 5
2828
2929 let IdxCfgPriceMult = 6
3030
3131 let IdxCfgIdoAssetId = 7
3232
3333 let IdxCfgIdoAssetMult = 8
3434
3535 let IdxCfgPriceAssetId = 9
3636
3737 let IdxCfgPriceAssetMult = 10
3838
3939 let IdxCfgMinInvestAmount = 11
4040
4141 func fromatConfigS (idoStart,idoDuration,claimStart,claimDuration,price,priceMult,idoAssetId58,idoAssetMult,priceAssetId58,priceAssetMult,minInvestAmount) = makeString(["%d%d%d%d%d%d%s%d%s%d%d", idoStart, idoDuration, claimStart, claimDuration, price, priceMult, idoAssetId58, idoAssetMult, priceAssetId58, priceAssetMult, minInvestAmount], SEP)
4242
4343
4444 func fromatConfig (idoStart,idoDuration,claimStart,claimDuration,price,priceMult,idoAssetId58,idoAssetMult,priceAssetId58,priceAssetMult,minInvestAmount) = fromatConfigS(toString(idoStart), toString(idoDuration), toString(claimStart), toString(claimDuration), toString(price), toString(priceMult), idoAssetId58, toString(idoAssetMult), priceAssetId58, toString(priceAssetMult), toString(minInvestAmount))
4545
4646
4747 let IdxInvTotalAmount = 1
4848
4949 let IdxInvRemainingAmount = 2
5050
5151 let IdxInvClaimedPriceAssetAmount = 3
5252
5353 let IdxInvClaimedIdoAssetAmount = 4
5454
5555 let IdxInvLastClaimedHeight = 5
5656
5757 func formatInvestorS (totalAmount,remainingAmount,claimedPriceAssetAmount,claimedIdoAssetAmount,lastClaimedHeight) = makeString(["%d%d%d%d%d", totalAmount, remainingAmount, claimedPriceAssetAmount, claimedIdoAssetAmount, lastClaimedHeight], SEP)
5858
5959
6060 func formatInvestor (totalAmount,remainingAmount,claimedPriceAssetAmount,claimedIdoAssetAmount,lastClaimedHeight) = formatInvestorS(toString(totalAmount), toString(remainingAmount), toString(claimedPriceAssetAmount), toString(claimedIdoAssetAmount), toString(lastClaimedHeight))
6161
6262
6363 func formatHistoryRecord (priceAssetAmount,idoAssetAmount) = makeString(["%d%d%d%d", toString(height), toString(lastBlock.timestamp), toString(priceAssetAmount), toString(idoAssetAmount)], SEP)
6464
6565
6666 func keyConfig () = "%s__config"
6767
6868
6969 func keyInvestor (userAddress) = ("%s__" + userAddress)
7070
7171
7272 func keyTotals () = "%s__totals"
7373
7474
7575 func keyOperationHistoryRecord (type,userAddress,txId58) = makeString(["%s%s%s%s__history", type, userAddress, txId58], SEP)
7676
7777
7878 func readConfigArray () = split(getStringOrFail(keyConfig()), SEP)
7979
8080
8181 func readTotalsArrayOrDefaultByCustomKey (customKey) = split(valueOrElse(getString(customKey), formatInvestorS("0", "0", "0", "0", "0")), SEP)
8282
8383
8484 func readTotalsArrayOrDefault () = readTotalsArrayOrDefaultByCustomKey(keyTotals())
8585
8686
8787 func readInvestorArrayOrDefault (userAddress) = readTotalsArrayOrDefaultByCustomKey(keyInvestor(userAddress))
8888
8989
9090 func readInvestorArrayOrFail (userAddress) = split(getStringOrFail(keyInvestor(userAddress)), SEP)
9191
9292
9393 let IdxDiffTotalIncrement = 0
9494
9595 let IdxDiffRemainingPriceAmountIncrement = 1
9696
9797 let IdxDiffClaimedPriceAmountIncrement = 2
9898
9999 let IdxDiffClaimedIdoAssetAmountIncrement = 3
100100
101101 func TotalsEntry (key,origArray,incrementDiff,newLastClaimedHeight) = {
102102 let totalAmount = parseIntValue(origArray[IdxInvTotalAmount])
103103 let remainingAmount = parseIntValue(origArray[IdxInvRemainingAmount])
104104 let claimedPriceAssetAmount = parseIntValue(origArray[IdxInvClaimedPriceAssetAmount])
105105 let claimedIdoAssetAmount = parseIntValue(origArray[IdxInvClaimedIdoAssetAmount])
106106 let lastClaimedHeight = parseIntValue(origArray[IdxInvLastClaimedHeight])
107107 let newTotalAmount = (totalAmount + incrementDiff[IdxDiffTotalIncrement])
108108 let newRemainingAmount = (remainingAmount + incrementDiff[IdxDiffRemainingPriceAmountIncrement])
109109 let newClaimedPriceAssetAmount = (claimedPriceAssetAmount + incrementDiff[IdxDiffClaimedPriceAmountIncrement])
110110 let newClaimedIdoAssetAmount = (claimedIdoAssetAmount + incrementDiff[IdxDiffClaimedIdoAssetAmountIncrement])
111111 if ((0 > newRemainingAmount))
112112 then throw("invalid math")
113113 else StringEntry(key, formatInvestor(newTotalAmount, newRemainingAmount, newClaimedPriceAssetAmount, newClaimedIdoAssetAmount, newLastClaimedHeight))
114114 }
115115
116116
117117 func InvestOperationHistoryEntry (userAddress,priceAssetAmount,idoAssetAmount,txId) = StringEntry(keyOperationHistoryRecord("invest", userAddress, toBase58String(txId)), formatHistoryRecord(priceAssetAmount, idoAssetAmount))
118118
119119
120120 func ClaimOperationHistoryEntry (userAddress,priceAssetAmount,idoAssetAmount,txId) = StringEntry(keyOperationHistoryRecord("claim", userAddress, toBase58String(txId)), formatHistoryRecord(priceAssetAmount, idoAssetAmount))
121121
122122
123123 func internalClaim (claimedAssetId58,userAddress,txId) = {
124124 let cfgArray = readConfigArray()
125125 let claimStart = parseIntValue(cfgArray[IdxCfgClaimStart])
126126 let claimDuration = parseIntValue(cfgArray[IdxCfgClaimDuration])
127127 let claimEnd = (claimStart + claimDuration)
128128 let price = parseIntValue(cfgArray[IdxCfgPrice])
129129 let priceMult = parseIntValue(cfgArray[IdxCfgPriceMult])
130130 let idoAssetId58 = cfgArray[IdxCfgIdoAssetId]
131131 let idoAssetId = fromBase58String(idoAssetId58)
132132 let idoAssetMult = parseIntValue(cfgArray[IdxCfgIdoAssetMult])
133133 let priceAssetId58 = cfgArray[IdxCfgPriceAssetId]
134134 let priceAssetId = fromBase58String(priceAssetId58)
135135 let priceAssetMult = parseIntValue(cfgArray[IdxCfgPriceAssetMult])
136136 let userAddress58 = toString(userAddress)
137137 let origInvestArray = readInvestorArrayOrFail(userAddress58)
138138 let investTotalAmount = parseIntValue(origInvestArray[IdxInvTotalAmount])
139139 let investLastClaimedHeight = parseIntValue(origInvestArray[IdxInvLastClaimedHeight])
140140 let newClaimPeriodHeight = if ((height > claimEnd))
141141 then claimEnd
142142 else height
143143 let claimingBlocks = (investLastClaimedHeight - newClaimPeriodHeight)
144144 let claimingPriceAssetAmount = fraction(investTotalAmount, claimingBlocks, claimDuration)
145145 let claimingIdoAssetAmount = convertPriceAssetIntoIdoAsset(claimingPriceAssetAmount, priceAssetMult, price, priceMult, idoAssetMult)
146146 let claimResultTuple = if ((claimedAssetId58 == priceAssetId58))
147147 then $Tuple3([0, -(claimingPriceAssetAmount), claimingPriceAssetAmount, 0], claimingPriceAssetAmount, priceAssetId)
148148 else if ((claimedAssetId58 == idoAssetId58))
149149 then $Tuple3([0, -(claimingPriceAssetAmount), 0, claimingIdoAssetAmount], claimingIdoAssetAmount, idoAssetId)
150150 else throw(("unsupported assetId: " + claimedAssetId58))
151151 let totalsDiff = claimResultTuple._1
152152 let outAmount = claimResultTuple._2
153153 let outAssetId = claimResultTuple._3
154154 let claimedPriceAmountFromDiff = totalsDiff[IdxDiffClaimedPriceAmountIncrement]
155155 let claimedIdoAssetAmountFromDiff = totalsDiff[IdxDiffClaimedIdoAssetAmountIncrement]
156156 [ScriptTransfer(userAddress, outAmount, outAssetId), TotalsEntry(keyInvestor(userAddress58), origInvestArray, totalsDiff, newClaimPeriodHeight), TotalsEntry(keyTotals(), readTotalsArrayOrDefault(), totalsDiff, newClaimPeriodHeight), ClaimOperationHistoryEntry(userAddress58, claimedPriceAmountFromDiff, claimedIdoAssetAmountFromDiff, txId)]
157157 }
158158
159159
160160 func publicClaim (claimedAssetId58,userAddress58) = internalClaim(claimedAssetId58, addressFromStringValue(userAddress58), fromBase58String(""))
161161
162162
163163 @Callable(i)
164164 func constructor (idoStart,idoDuration,claimStart,claimDuration,price,priceAssetId58,minInvestAmount) = {
165165 let priceMult = ((100 * 1000) * 1000)
166166 let idoEnd = (idoStart + idoDuration)
167167 if (isDefined(getString(keyConfig())))
168168 then throw("already initialized")
169169 else if (("3N4Aib5iubWiGMzdTh6wWiVDVbo32oeVUmH" != toString(i.caller)))
170170 then throw("not authorized")
171171 else if ((size(i.payments) != 1))
172172 then throw("exactly 1 payment must be attached")
173173 else if ((idoEnd >= claimStart))
174174 then throw("claimStart must be greater than idoEnd")
175175 else {
176176 let pmt = value(i.payments[0])
177177 let idoAssetId = value(pmt.assetId)
178178 let idoAssetInfo = valueOrErrorMessage(assetInfo(idoAssetId), "fail to load ido asset info")
179179 let idoAssetId58 = toBase58String(idoAssetId)
180180 let idoAssetMult = pow(10, 0, idoAssetInfo.decimals, 0, 0, DOWN)
181181 let priceAssetId = fromBase58String(priceAssetId58)
182182 let priceAssetInfo = valueOrErrorMessage(assetInfo(priceAssetId), "fail to load price asset info")
183183 let priceAssetMult = pow(10, 0, priceAssetInfo.decimals, 0, 0, DOWN)
184184 [StringEntry(keyConfig(), fromatConfig(idoStart, idoDuration, claimStart, claimDuration, price, priceMult, idoAssetId58, idoAssetMult, priceAssetId58, priceAssetMult, minInvestAmount))]
185185 }
186186 }
187187
188188
189189
190190 @Callable(i)
191191 func invest () = {
192192 let cfgArray = readConfigArray()
193193 let idoStart = parseIntValue(cfgArray[IdxCfgIdoStart])
194194 let idoDuration = parseIntValue(cfgArray[IdxCfgIdoDuration])
195195 let idoEnd = (idoStart + idoDuration)
196196 let claimStart = parseIntValue(cfgArray[IdxCfgClaimStart])
197197 let claimDuration = parseIntValue(cfgArray[IdxCfgClaimDuration])
198198 let price = parseIntValue(cfgArray[IdxCfgPrice])
199199 let priceMult = parseIntValue(cfgArray[IdxCfgPriceMult])
200200 let idoAssetId58 = cfgArray[IdxCfgIdoAssetId]
201201 let idoAssetId = fromBase58String(idoAssetId58)
202202 let idoAssetMult = parseIntValue(cfgArray[IdxCfgIdoAssetMult])
203203 let priceAssetId58 = cfgArray[IdxCfgPriceAssetId]
204204 let priceAssetId = fromBase58String(priceAssetId58)
205205 let priceAssetMult = parseIntValue(cfgArray[IdxCfgPriceAssetMult])
206206 let minIvestAmount = parseIntValue(cfgArray[IdxCfgMinInvestAmount])
207207 let userAddress = toString(i.caller)
208208 if ((idoStart > height))
209209 then throw("ido has not been started yet")
210210 else if ((height > idoEnd))
211211 then throw("ido has been already ended")
212212 else if ((size(i.payments) != 1))
213213 then throw("exactly 1 payment is expected")
214214 else {
215215 let pmt = value(i.payments[0])
216216 let pmtAssetId = value(pmt.assetId)
217217 let pmtAmount = pmt.amount
218218 if ((pmtAssetId != priceAssetId))
219219 then throw((("invalid payment asset id: " + toBase58String(pmtAssetId)) + " is expected"))
220220 else if ((minIvestAmount > pmtAmount))
221221 then throw(((("payment amount is less then min allowed: pmtAmount=" + toString(pmtAmount)) + " minIvestAmount=") + toString(minIvestAmount)))
222222 else {
223223 let origInvestorArray = readInvestorArrayOrDefault(userAddress)
224224 let origTotalsArray = readTotalsArrayOrDefault()
225225 let newPriceTotalAmount = (parseIntValue(origTotalsArray[IdxInvTotalAmount]) + pmtAmount)
226226 let requiredIdoAssetAmount = convertPriceAssetIntoIdoAsset(newPriceTotalAmount, priceAssetMult, price, priceMult, idoAssetMult)
227227 if ((requiredIdoAssetAmount > assetBalance(this, idoAssetId)))
228228 then throw("IDO asset has been - sold consider to use smaller payment")
229229 else {
230230 let totalsDiff = [pmtAmount, pmtAmount, 0, 0]
231231 [TotalsEntry(keyInvestor(userAddress), origInvestorArray, totalsDiff, claimStart), TotalsEntry(keyTotals(), origTotalsArray, totalsDiff, claimStart), InvestOperationHistoryEntry(userAddress, pmtAmount, 0, i.transactionId)]
232232 }
233233 }
234234 }
235235 }
236236
237237
238238
239239 @Callable(i)
240240 func claim (claimedAssetId58,userAddress58) = {
241241 let callerAddress58 = toString(i.caller)
242242 if ((userAddress58 != callerAddress58))
243243 then throw("not authorized")
244244 else $Tuple2(internalClaim(claimedAssetId58, i.caller, i.transactionId), unit)
245245 }
246246
247247
248248
249249 @Callable(i)
250-func claimREADONLY (claimedAssetId58,userAddress58) = $Tuple2(nil, internalClaim(claimedAssetId58, i.caller, fromBase58String("")))
250+func claimREADONLY (claimedAssetId58,userAddress58) = $Tuple2(nil, internalClaim(claimedAssetId58, addressFromStringValue(userAddress58), fromBase58String("")))
251251
252252

github/deemru/w8io/169f3d6 
44.88 ms