tx · C3yQmtNtPD7bBjDKFGDsFu7mGuXps9dL5hsWEWorzyjX 3Mynj79w9PikhwUwMwFPk2vifkm8zkDt2Zt: -0.01000000 Waves 2021.11.25 18:27 [1806748] smart account 3Mynj79w9PikhwUwMwFPk2vifkm8zkDt2Zt > SELF 0.00000000 Waves
{ "type": 13, "id": "C3yQmtNtPD7bBjDKFGDsFu7mGuXps9dL5hsWEWorzyjX", "fee": 1000000, "feeAssetId": null, "timestamp": 1637854106663, "version": 1, "sender": "3Mynj79w9PikhwUwMwFPk2vifkm8zkDt2Zt", "senderPublicKey": "5195SwZ4ifX6bBstZ6tN31kEQFVHaKpFYLc1GCa3Myrh", "proofs": [ "5hvKDKJLnbRpmLagxYBn9TRTYWE9RyEnMmPf12mp4Wini434viwU41faCGgDMM6mWjr9wGzKBsGevHKBPcf6sakE" ], "script": "base64:AAIFAAAAAAAAABsIAhIJCgcBAQEBAQgBEgASBAoCCAgSBAoCCAgAAAAqAQAAAA9nZXRTdHJpbmdPckZhaWwAAAABAAAAA2tleQkBAAAAE3ZhbHVlT3JFcnJvck1lc3NhZ2UAAAACCQAEIgAAAAEFAAAAA2tleQkAASwAAAACCQABLAAAAAICAAAAD21hbmRhdG9yeSB0aGlzLgUAAAADa2V5AgAAAA8gaXMgbm90IGRlZmluZWQAAAAAA1NFUAIAAAACX18AAAAACEJVRlNDQUxFCQABNgAAAAEADeC2s6dkAAABAAAAHWNvbnZlcnRQcmljZUFzc2V0SW50b0lkb0Fzc2V0AAAABQAAABBwcmljZUFzc2V0QW1vdW50AAAADnByaWNlQXNzZXRNVUxUAAAABXByaWNlAAAACXByaWNlTVVMVAAAAAxpZG9Bc3NldE1VTFQEAAAAD2JQcmljZUFzc2V0TVVMVAkAATYAAAABBQAAAA5wcmljZUFzc2V0TVVMVAQAAAANYklkb0Fzc2V0TVVMVAkAATYAAAABBQAAAAxpZG9Bc3NldE1VTFQEAAAADmJQcmljZUFzc2V0QlVGCQABPAAAAAMJAAE2AAAAAQUAA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xBAAAAAlvdXRBbW91bnQIBQAAABBjbGFpbVJlc3VsdFR1cGxlAAAAAl8yBAAAAApvdXRBc3NldElkCAUAAAAQY2xhaW1SZXN1bHRUdXBsZQAAAAJfMwQAAAAPb3JpZ0ludmVzdEFycmF5CAUAAAAQY2xhaW1SZXN1bHRUdXBsZQAAAAJfNAQAAAAUbmV3Q2xhaW1QZXJpb2RIZWlnaHQIBQAAABBjbGFpbVJlc3VsdFR1cGxlAAAAAl81BAAAABVhdmFpbGFibGVUb0NsYWltQXJyYXkIBQAAABBjbGFpbVJlc3VsdFR1cGxlAAAAAl82BAAAABthdmFpbGFibGVQcmljZUFtb3VudFRvQ2xhaW0JAAGRAAAAAgUAAAAVYXZhaWxhYmxlVG9DbGFpbUFycmF5AAAAAAAAAAAABAAAABlhdmFpbGFibGVJZG9BbW91bnRUb0NsYWltCQABkQAAAAIFAAAAFWF2YWlsYWJsZVRvQ2xhaW1BcnJheQAAAAAAAAAAAQkABRQAAAACBQAAAANuaWwJAAS5AAAAAgkABEwAAAACAgAAAAYlcyVkJWQJAARMAAAAAgUAAAANdXNlckFkZHJlc3M1OAkABEwAAAACCQABpAAAAAEFAAAAG2F2YWlsYWJsZVByaWNlQW1vdW50VG9DbGFpbQkABEwAAAACCQABpAAAAAEFAAAAGWF2YWlsYWJsZUlkb0Ftb3VudFRvQ2xhaW0FAAAAA25pbAUAAAADU0VQAAAAABsuTwI=", "chainId": 84, "height": 1806748, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: 4RGPxqm36XZGUBTe7ueSDai7vRgmAWJAoZ5Bkhqik1qW Next: EHbSD6dXeg7kS87sMpVXv8YQrtE1mgNYus1H6CRwgzGm Full:
Old | New | Differences | |
---|---|---|---|
1 | 1 | {-# STDLIB_VERSION 5 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | 4 | func getStringOrFail (key) = valueOrErrorMessage(getString(key), (("mandatory this." + key) + " is not defined")) | |
5 | 5 | ||
6 | 6 | ||
7 | 7 | let SEP = "__" | |
8 | 8 | ||
9 | 9 | let BUFSCALE = toBigInt(1000000000000000000) | |
10 | 10 | ||
11 | 11 | func convertPriceAssetIntoIdoAsset (priceAssetAmount,priceAssetMULT,price,priceMULT,idoAssetMULT) = { | |
12 | 12 | let bPriceAssetMULT = toBigInt(priceAssetMULT) | |
13 | 13 | let bIdoAssetMULT = toBigInt(idoAssetMULT) | |
14 | 14 | let bPriceAssetBUF = fraction(toBigInt(priceAssetAmount), BUFSCALE, bPriceAssetMULT) | |
15 | 15 | let bAmountAssetBUF = fraction(bPriceAssetBUF, toBigInt(priceMULT), toBigInt(price)) | |
16 | 16 | toInt(fraction(bAmountAssetBUF, toBigInt(idoAssetMULT), BUFSCALE)) | |
17 | 17 | } | |
18 | 18 | ||
19 | 19 | ||
20 | 20 | let IdxCfgIdoStart = 1 | |
21 | 21 | ||
22 | 22 | let IdxCfgIdoDuration = 2 | |
23 | 23 | ||
24 | 24 | let IdxCfgClaimStart = 3 | |
25 | 25 | ||
26 | 26 | let IdxCfgClaimDuration = 4 | |
27 | 27 | ||
28 | 28 | let IdxCfgPrice = 5 | |
29 | 29 | ||
30 | 30 | let IdxCfgPriceMult = 6 | |
31 | 31 | ||
32 | 32 | let IdxCfgIdoAssetId = 7 | |
33 | 33 | ||
34 | 34 | let IdxCfgIdoAssetMult = 8 | |
35 | 35 | ||
36 | 36 | let IdxCfgPriceAssetId = 9 | |
37 | 37 | ||
38 | 38 | let IdxCfgPriceAssetMult = 10 | |
39 | 39 | ||
40 | 40 | let IdxCfgMinInvestAmount = 11 | |
41 | 41 | ||
42 | 42 | func fromatConfigS (idoStart,idoDuration,claimStart,claimDuration,price,priceMult,idoAssetId58,idoAssetMult,priceAssetId58,priceAssetMult,minInvestAmount,totalIdoAssetToSell) = makeString(["%d%d%d%d%d%d%s%d%s%d%d%d", idoStart, idoDuration, claimStart, claimDuration, price, priceMult, idoAssetId58, idoAssetMult, priceAssetId58, priceAssetMult, minInvestAmount, totalIdoAssetToSell], SEP) | |
43 | 43 | ||
44 | 44 | ||
45 | 45 | func fromatConfig (idoStart,idoDuration,claimStart,claimDuration,price,priceMult,idoAssetId58,idoAssetMult,priceAssetId58,priceAssetMult,minInvestAmount,totalIdoAssetToSell) = fromatConfigS(toString(idoStart), toString(idoDuration), toString(claimStart), toString(claimDuration), toString(price), toString(priceMult), idoAssetId58, toString(idoAssetMult), priceAssetId58, toString(priceAssetMult), toString(minInvestAmount), toString(totalIdoAssetToSell)) | |
46 | 46 | ||
47 | 47 | ||
48 | 48 | let IdxInvTotalAmount = 1 | |
49 | 49 | ||
50 | 50 | let IdxInvRemainingAmount = 2 | |
51 | 51 | ||
52 | 52 | let IdxInvClaimedPriceAssetAmount = 3 | |
53 | 53 | ||
54 | 54 | let IdxInvClaimedIdoAssetAmount = 4 | |
55 | 55 | ||
56 | 56 | let IdxInvLastClaimedHeight = 5 | |
57 | 57 | ||
58 | 58 | func formatInvestorS (totalAmount,remainingAmount,claimedPriceAssetAmount,claimedIdoAssetAmount,lastClaimedHeight) = makeString(["%d%d%d%d%d", totalAmount, remainingAmount, claimedPriceAssetAmount, claimedIdoAssetAmount, lastClaimedHeight], SEP) | |
59 | 59 | ||
60 | 60 | ||
61 | 61 | func formatInvestor (totalAmount,remainingAmount,claimedPriceAssetAmount,claimedIdoAssetAmount,lastClaimedHeight) = formatInvestorS(toString(totalAmount), toString(remainingAmount), toString(claimedPriceAssetAmount), toString(claimedIdoAssetAmount), toString(lastClaimedHeight)) | |
62 | 62 | ||
63 | 63 | ||
64 | 64 | func formatHistoryRecord (priceAssetAmount,idoAssetAmount) = makeString(["%d%d%d%d", toString(height), toString(lastBlock.timestamp), toString(priceAssetAmount), toString(idoAssetAmount)], SEP) | |
65 | 65 | ||
66 | 66 | ||
67 | 67 | func keyConfig () = "%s__config" | |
68 | 68 | ||
69 | 69 | ||
70 | 70 | func keyInvestor (userAddress) = ("%s__" + userAddress) | |
71 | 71 | ||
72 | 72 | ||
73 | 73 | func keyTotals () = "%s__totals" | |
74 | 74 | ||
75 | 75 | ||
76 | 76 | func keyOperationHistoryRecord (type,userAddress,txId58) = makeString(["%s%s%s%s__history", type, userAddress, txId58], SEP) | |
77 | 77 | ||
78 | 78 | ||
79 | 79 | func readConfigArray () = split(getStringOrFail(keyConfig()), SEP) | |
80 | 80 | ||
81 | 81 | ||
82 | 82 | func readTotalsArrayOrDefaultByCustomKey (customKey) = split(valueOrElse(getString(customKey), formatInvestorS("0", "0", "0", "0", "0")), SEP) | |
83 | 83 | ||
84 | 84 | ||
85 | 85 | func readTotalsArrayOrDefault () = readTotalsArrayOrDefaultByCustomKey(keyTotals()) | |
86 | 86 | ||
87 | 87 | ||
88 | 88 | func readInvestorArrayOrDefault (userAddress) = readTotalsArrayOrDefaultByCustomKey(keyInvestor(userAddress)) | |
89 | 89 | ||
90 | 90 | ||
91 | 91 | func readInvestorArrayOrFail (userAddress) = split(getStringOrFail(keyInvestor(userAddress)), SEP) | |
92 | 92 | ||
93 | 93 | ||
94 | 94 | let IdxDiffTotalIncrement = 0 | |
95 | 95 | ||
96 | 96 | let IdxDiffRemainingPriceAmountIncrement = 1 | |
97 | 97 | ||
98 | 98 | let IdxDiffClaimedPriceAmountIncrement = 2 | |
99 | 99 | ||
100 | 100 | let IdxDiffClaimedIdoAssetAmountIncrement = 3 | |
101 | 101 | ||
102 | 102 | func TotalsEntry (key,origArray,incrementDiff,newLastClaimedHeight) = { | |
103 | 103 | let totalAmount = parseIntValue(origArray[IdxInvTotalAmount]) | |
104 | 104 | let remainingAmount = parseIntValue(origArray[IdxInvRemainingAmount]) | |
105 | 105 | let claimedPriceAssetAmount = parseIntValue(origArray[IdxInvClaimedPriceAssetAmount]) | |
106 | 106 | let claimedIdoAssetAmount = parseIntValue(origArray[IdxInvClaimedIdoAssetAmount]) | |
107 | 107 | let lastClaimedHeight = parseIntValue(origArray[IdxInvLastClaimedHeight]) | |
108 | 108 | let newTotalAmount = (totalAmount + incrementDiff[IdxDiffTotalIncrement]) | |
109 | 109 | let newRemainingAmount = (remainingAmount + incrementDiff[IdxDiffRemainingPriceAmountIncrement]) | |
110 | 110 | let newClaimedPriceAssetAmount = (claimedPriceAssetAmount + incrementDiff[IdxDiffClaimedPriceAmountIncrement]) | |
111 | 111 | let newClaimedIdoAssetAmount = (claimedIdoAssetAmount + incrementDiff[IdxDiffClaimedIdoAssetAmountIncrement]) | |
112 | 112 | if ((0 > newRemainingAmount)) | |
113 | 113 | then throw("invalid math") | |
114 | 114 | else StringEntry(key, formatInvestor(newTotalAmount, newRemainingAmount, newClaimedPriceAssetAmount, newClaimedIdoAssetAmount, newLastClaimedHeight)) | |
115 | 115 | } | |
116 | 116 | ||
117 | 117 | ||
118 | 118 | func InvestOperationHistoryEntry (userAddress,priceAssetAmount,idoAssetAmount,txId) = StringEntry(keyOperationHistoryRecord("invest", userAddress, toBase58String(txId)), formatHistoryRecord(priceAssetAmount, idoAssetAmount)) | |
119 | 119 | ||
120 | 120 | ||
121 | 121 | func ClaimOperationHistoryEntry (userAddress,priceAssetAmount,idoAssetAmount,txId) = StringEntry(keyOperationHistoryRecord("claim", userAddress, toBase58String(txId)), formatHistoryRecord(priceAssetAmount, idoAssetAmount)) | |
122 | 122 | ||
123 | 123 | ||
124 | 124 | func internalClaim (claimedAssetId58,userAddress,txId) = { | |
125 | 125 | let cfgArray = readConfigArray() | |
126 | 126 | let claimStart = parseIntValue(cfgArray[IdxCfgClaimStart]) | |
127 | 127 | let claimDuration = parseIntValue(cfgArray[IdxCfgClaimDuration]) | |
128 | 128 | let claimEnd = (claimStart + claimDuration) | |
129 | 129 | let price = parseIntValue(cfgArray[IdxCfgPrice]) | |
130 | 130 | let priceMult = parseIntValue(cfgArray[IdxCfgPriceMult]) | |
131 | 131 | let idoAssetId58 = cfgArray[IdxCfgIdoAssetId] | |
132 | 132 | let idoAssetId = fromBase58String(idoAssetId58) | |
133 | 133 | let idoAssetMult = parseIntValue(cfgArray[IdxCfgIdoAssetMult]) | |
134 | 134 | let priceAssetId58 = cfgArray[IdxCfgPriceAssetId] | |
135 | 135 | let priceAssetId = fromBase58String(priceAssetId58) | |
136 | 136 | let priceAssetMult = parseIntValue(cfgArray[IdxCfgPriceAssetMult]) | |
137 | 137 | let userAddress58 = toString(userAddress) | |
138 | 138 | let origInvestArray = readInvestorArrayOrFail(userAddress58) | |
139 | 139 | let investTotalAmount = parseIntValue(origInvestArray[IdxInvTotalAmount]) | |
140 | 140 | let investLastClaimedHeight = parseIntValue(origInvestArray[IdxInvLastClaimedHeight]) | |
141 | 141 | let newClaimPeriodHeight = if ((height > claimEnd)) | |
142 | 142 | then claimEnd | |
143 | 143 | else if ((claimStart > height)) | |
144 | 144 | then claimStart | |
145 | 145 | else height | |
146 | 146 | if ((claimStart > height)) | |
147 | 147 | then throw("failure") | |
148 | 148 | else { | |
149 | 149 | let claimingBlocks = (newClaimPeriodHeight - investLastClaimedHeight) | |
150 | 150 | let claimingPriceAssetAmount = fraction(investTotalAmount, claimingBlocks, claimDuration) | |
151 | 151 | let claimingIdoAssetAmount = convertPriceAssetIntoIdoAsset(claimingPriceAssetAmount, priceAssetMult, price, priceMult, idoAssetMult) | |
152 | 152 | if ((claimedAssetId58 == priceAssetId58)) | |
153 | 153 | then $Tuple6([0, -(claimingPriceAssetAmount), claimingPriceAssetAmount, 0], claimingPriceAssetAmount, priceAssetId, origInvestArray, newClaimPeriodHeight, [claimingPriceAssetAmount, claimingIdoAssetAmount]) | |
154 | 154 | else if ((claimedAssetId58 == idoAssetId58)) | |
155 | 155 | then $Tuple6([0, -(claimingPriceAssetAmount), 0, claimingIdoAssetAmount], claimingIdoAssetAmount, idoAssetId, origInvestArray, newClaimPeriodHeight, [claimingPriceAssetAmount, claimingIdoAssetAmount]) | |
156 | 156 | else throw(("unsupported assetId: " + claimedAssetId58)) | |
157 | 157 | } | |
158 | 158 | } | |
159 | 159 | ||
160 | 160 | ||
161 | 161 | @Callable(i) | |
162 | 162 | func constructor (idoStart,idoDuration,claimStart,claimDuration,price,priceAssetId58,minInvestAmount) = { | |
163 | 163 | let priceMult = ((100 * 1000) * 1000) | |
164 | 164 | let idoEnd = (idoStart + idoDuration) | |
165 | 165 | if (isDefined(getString(keyConfig()))) | |
166 | 166 | then throw("already initialized") | |
167 | 167 | else if (("3N4Aib5iubWiGMzdTh6wWiVDVbo32oeVUmH" != toString(i.caller))) | |
168 | 168 | then throw("not authorized") | |
169 | 169 | else if ((size(i.payments) != 1)) | |
170 | 170 | then throw("exactly 1 payment must be attached") | |
171 | 171 | else if ((idoEnd >= claimStart)) | |
172 | 172 | then throw("claimStart must be greater than idoEnd") | |
173 | 173 | else { | |
174 | 174 | let pmt = value(i.payments[0]) | |
175 | 175 | let idoAssetId = value(pmt.assetId) | |
176 | 176 | let idoAssetInfo = valueOrErrorMessage(assetInfo(idoAssetId), "fail to load ido asset info") | |
177 | 177 | let idoAssetId58 = toBase58String(idoAssetId) | |
178 | 178 | let idoAssetMult = pow(10, 0, idoAssetInfo.decimals, 0, 0, DOWN) | |
179 | 179 | let priceAssetId = fromBase58String(priceAssetId58) | |
180 | 180 | let priceAssetInfo = valueOrErrorMessage(assetInfo(priceAssetId), "fail to load price asset info") | |
181 | 181 | let priceAssetMult = pow(10, 0, priceAssetInfo.decimals, 0, 0, DOWN) | |
182 | 182 | let origTotalsArray = readTotalsArrayOrDefault() | |
183 | 183 | let totalsDiff = [0, 0, 0, 0] | |
184 | 184 | [StringEntry(keyConfig(), fromatConfig(idoStart, idoDuration, claimStart, claimDuration, price, priceMult, idoAssetId58, idoAssetMult, priceAssetId58, priceAssetMult, minInvestAmount, pmt.amount)), TotalsEntry(keyTotals(), origTotalsArray, totalsDiff, claimStart)] | |
185 | 185 | } | |
186 | 186 | } | |
187 | 187 | ||
188 | 188 | ||
189 | 189 | ||
190 | 190 | @Callable(i) | |
191 | 191 | func invest () = { | |
192 | 192 | let cfgArray = readConfigArray() | |
193 | 193 | let idoStart = parseIntValue(cfgArray[IdxCfgIdoStart]) | |
194 | 194 | let idoDuration = parseIntValue(cfgArray[IdxCfgIdoDuration]) | |
195 | 195 | let idoEnd = (idoStart + idoDuration) | |
196 | 196 | let claimStart = parseIntValue(cfgArray[IdxCfgClaimStart]) | |
197 | 197 | let claimDuration = parseIntValue(cfgArray[IdxCfgClaimDuration]) | |
198 | 198 | let price = parseIntValue(cfgArray[IdxCfgPrice]) | |
199 | 199 | let priceMult = parseIntValue(cfgArray[IdxCfgPriceMult]) | |
200 | 200 | let idoAssetId58 = cfgArray[IdxCfgIdoAssetId] | |
201 | 201 | let idoAssetId = fromBase58String(idoAssetId58) | |
202 | 202 | let idoAssetMult = parseIntValue(cfgArray[IdxCfgIdoAssetMult]) | |
203 | 203 | let priceAssetId58 = cfgArray[IdxCfgPriceAssetId] | |
204 | 204 | let priceAssetId = fromBase58String(priceAssetId58) | |
205 | 205 | let priceAssetMult = parseIntValue(cfgArray[IdxCfgPriceAssetMult]) | |
206 | 206 | let minIvestAmount = parseIntValue(cfgArray[IdxCfgMinInvestAmount]) | |
207 | 207 | let userAddress = toString(i.caller) | |
208 | 208 | if ((idoStart > height)) | |
209 | 209 | then throw("ido has not been started yet") | |
210 | 210 | else if ((height > idoEnd)) | |
211 | 211 | then throw("ido has been already ended") | |
212 | 212 | else if ((size(i.payments) != 1)) | |
213 | 213 | then throw("exactly 1 payment is expected") | |
214 | 214 | else { | |
215 | 215 | let pmt = value(i.payments[0]) | |
216 | 216 | let pmtAssetId = value(pmt.assetId) | |
217 | 217 | let pmtAmount = pmt.amount | |
218 | 218 | if ((pmtAssetId != priceAssetId)) | |
219 | 219 | then throw((("invalid payment asset id: " + toBase58String(pmtAssetId)) + " is expected")) | |
220 | 220 | else { | |
221 | 221 | let origInvestorArray = readInvestorArrayOrDefault(userAddress) | |
222 | 222 | let origTotalsArray = readTotalsArrayOrDefault() | |
223 | 223 | let newPriceTotalAmount = (parseIntValue(origTotalsArray[IdxInvTotalAmount]) + pmtAmount) | |
224 | 224 | let requiredIdoAssetAmount = (newPriceTotalAmount * 100) | |
225 | 225 | if ((requiredIdoAssetAmount > assetBalance(this, idoAssetId))) | |
226 | 226 | then throw("IDO asset has been - sold consider to use smaller payment") | |
227 | 227 | else { | |
228 | 228 | let totalsDiff = [pmtAmount, pmtAmount, 0, 0] | |
229 | 229 | [TotalsEntry(keyInvestor(userAddress), origInvestorArray, totalsDiff, claimStart), TotalsEntry(keyTotals(), origTotalsArray, totalsDiff, claimStart), InvestOperationHistoryEntry(userAddress, pmtAmount, 0, i.transactionId)] | |
230 | 230 | } | |
231 | 231 | } | |
232 | 232 | } | |
233 | 233 | } | |
234 | 234 | ||
235 | 235 | ||
236 | 236 | ||
237 | 237 | @Callable(i) | |
238 | 238 | func claim (claimedAssetId58,userAddress58) = { | |
239 | 239 | let callerAddress58 = toString(i.caller) | |
240 | 240 | if ((userAddress58 != callerAddress58)) | |
241 | 241 | then throw("not authorized") | |
242 | 242 | else { | |
243 | 243 | let claimResultTuple = internalClaim(claimedAssetId58, i.caller, i.transactionId) | |
244 | 244 | let totalsDiff = claimResultTuple._1 | |
245 | 245 | let outAmount = claimResultTuple._2 | |
246 | 246 | let outAssetId = claimResultTuple._3 | |
247 | 247 | let origInvestArray = claimResultTuple._4 | |
248 | 248 | let newClaimPeriodHeight = claimResultTuple._5 | |
249 | 249 | let claimedPriceAmountFromDiff = totalsDiff[IdxDiffClaimedPriceAmountIncrement] | |
250 | 250 | let claimedIdoAssetAmountFromDiff = totalsDiff[IdxDiffClaimedIdoAssetAmountIncrement] | |
251 | 251 | $Tuple2([ScriptTransfer(i.caller, outAmount, outAssetId), TotalsEntry(keyInvestor(userAddress58), origInvestArray, totalsDiff, newClaimPeriodHeight), TotalsEntry(keyTotals(), readTotalsArrayOrDefault(), totalsDiff, newClaimPeriodHeight), ClaimOperationHistoryEntry(userAddress58, claimedPriceAmountFromDiff, claimedIdoAssetAmountFromDiff, i.transactionId)], unit) | |
252 | 252 | } | |
253 | 253 | } | |
254 | 254 | ||
255 | 255 | ||
256 | 256 | ||
257 | 257 | @Callable(i) | |
258 | 258 | func claimREADONLY (claimedAssetId58,userAddress58) = { | |
259 | 259 | let claimResultTuple = internalClaim(claimedAssetId58, addressFromStringValue(userAddress58), fromBase58String("")) | |
260 | 260 | let totalsDiff = claimResultTuple._1 | |
261 | 261 | let outAmount = claimResultTuple._2 | |
262 | 262 | let outAssetId = claimResultTuple._3 | |
263 | 263 | let origInvestArray = claimResultTuple._4 | |
264 | 264 | let newClaimPeriodHeight = claimResultTuple._5 | |
265 | 265 | let availableToClaimArray = claimResultTuple._6 | |
266 | 266 | let availablePriceAmountToClaim = availableToClaimArray[0] | |
267 | 267 | let availableIdoAmountToClaim = availableToClaimArray[1] | |
268 | 268 | $Tuple2(nil, makeString(["%s%d%d", userAddress58, toString(availablePriceAmountToClaim), toString(availableIdoAmountToClaim)], SEP)) | |
269 | 269 | } | |
270 | 270 | ||
271 | 271 |
github/deemru/w8io/026f985 35.06 ms ◑