tx · Eh52Cg3tEoteQCsW3X17rjqMpGjubyTRTNvMbQH8jKVR 3Ms38PbYnARMUMorWK8SqRBhKKQq2yhXPB1: -0.01300000 Waves 2022.10.20 11:14 [2280469] smart account 3Ms38PbYnARMUMorWK8SqRBhKKQq2yhXPB1 > SELF 0.00000000 Waves
{ "type": 13, "id": "Eh52Cg3tEoteQCsW3X17rjqMpGjubyTRTNvMbQH8jKVR", "fee": 1300000, "feeAssetId": null, "timestamp": 1666253777606, "version": 1, "sender": "3Ms38PbYnARMUMorWK8SqRBhKKQq2yhXPB1", "senderPublicKey": "3EfudNNQNACtTotZKwkRu97fZW5fFjUPwuP1gd3oBHJs", "proofs": [ "4nrDiN3PpfXRYd3zxqF73RZqtxW6pKGQwLSjTZDwgyfQyccgPSayuWutP35bBjWTbUXDQikg9ZW8qreMXL64RmPK" ], "script": "base64:AAIFAAAAAAAABs8IAhIFCgMBAQgSAwoBARIAEgMKAQESAwoBCBIAIgNTRVAiC2tleVJlZmVycmFsIgxrZXlXeEFzc2V0SWQiE2tleU1hbmFnZXJQdWJsaWNLZXkiGmtleVBlbmRpbmdNYW5hZ2VyUHVibGljS2V5IhVJZHhDZmdDbGFpbVN0YXJ0QmxvY2siGElkeENmZ0NsYWltVmVzdGluZ1BlcmlvZCISSWR4Q2ZnQ2xhaW1Bc3NldElkIhRJZHhDZmdDbGFpbUFzc2V0TXVsdCIVSWR4Q2ZnQ2xhaW1Bc3NldE93bmVyIhtJZHhDZmdDbGFpbUFzc2V0VG90YWxBbW91bnQiG0lkeFRvdGFsc1RvdGFsQ2xhaW1lZEFtb3VudCIYSWR4VG90YWxzUmVtYWluaW5nQW1vdW50IhpJZHhUb3RhbHNMYXN0Q2xhaW1lZEhlaWdodCIIdGhyb3dFcnIiA21zZyIPZ2V0U3RyaW5nT3JGYWlsIgNrZXkiEmZvcm1hdENvbmZpZ1N0cmluZyIPY2xhaW1TdGFydEJsb2NrIg12ZXN0aW5nUGVyaW9kIg1hc3NldElkQmFzZT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AAAAFAAAAA25pbAkAAAIAAAABAgAAACRTdHJpY3QgdmFsdWUgaXMgbm90IGVxdWFsIHRvIGl0c2VsZi4JAAACAAAAAQIAAAAkU3RyaWN0IHZhbHVlIGlzIG5vdCBlcXVhbCB0byBpdHNlbGYuAAAAAQAAAAJhWAEAAAACYVkAAAAABAAAAAJhWgQAAAACYWcJAQAAAAJhZgAAAAADCQAAAQAAAAIFAAAAAmFnAgAAAApCeXRlVmVjdG9yBAAAAAJhbQUAAAACYWcFAAAAAmFtAwkAAAEAAAACBQAAAAJhZwIAAAAEVW5pdAgFAAAAAmFYAAAAD3NlbmRlclB1YmxpY0tleQkAAAIAAAABAgAAAAtNYXRjaCBlcnJvcgkAAfQAAAADCAUAAAACYVgAAAAJYm9keUJ5dGVzCQABkQAAAAIIBQAAAAJhWAAAAAZwcm9vZnMAAAAAAAAAAAAFAAAAAmFa8JgnUw==", "chainId": 84, "height": 2280469, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: FuAM13VtSqt6ZEoxLHxtWqk71LZR751juqjjTyXX9KSb Next: 6B9y1Sydv8etjJdJT95VQm2Gv7N1LSobBKjirc9MBNDJ Full:
Old | New | Differences | |
---|---|---|---|
1 | 1 | {-# STDLIB_VERSION 5 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | 4 | let SEP = "__" | |
5 | 5 | ||
6 | 6 | let keyReferral = makeString(["%s", "referral"], SEP) | |
7 | 7 | ||
8 | 8 | let keyWxAssetId = makeString(["%s", "wxAssetId"], SEP) | |
9 | 9 | ||
10 | 10 | func keyManagerPublicKey () = "%s__managerPublicKey" | |
11 | 11 | ||
12 | 12 | ||
13 | 13 | func keyPendingManagerPublicKey () = "%s__pendingManagerPublicKey" | |
14 | 14 | ||
15 | 15 | ||
16 | 16 | let IdxCfgClaimStartBlock = 1 | |
17 | 17 | ||
18 | 18 | let IdxCfgClaimVestingPeriod = 2 | |
19 | 19 | ||
20 | 20 | let IdxCfgClaimAssetId = 3 | |
21 | 21 | ||
22 | 22 | let IdxCfgClaimAssetMult = 4 | |
23 | 23 | ||
24 | 24 | let IdxCfgClaimAssetOwner = 5 | |
25 | 25 | ||
26 | 26 | let IdxCfgClaimAssetTotalAmount = 6 | |
27 | 27 | ||
28 | 28 | let IdxTotalsTotalClaimedAmount = 1 | |
29 | 29 | ||
30 | 30 | let IdxTotalsRemainingAmount = 2 | |
31 | 31 | ||
32 | 32 | let IdxTotalsLastClaimedHeight = 3 | |
33 | 33 | ||
34 | 34 | func throwErr (msg) = throw(makeString(["marketing.ride:", msg], " ")) | |
35 | 35 | ||
36 | 36 | ||
37 | 37 | func getStringOrFail (key) = valueOrErrorMessage(getString(key), (("mandatory this." + key) + " is not defined")) | |
38 | 38 | ||
39 | 39 | ||
40 | 40 | func formatConfigString (claimStartBlock,vestingPeriod,assetIdBase58,assetMult,assetOwner,assetTotalAmt) = makeString(["%d%d%s%d%s%d%", claimStartBlock, vestingPeriod, assetIdBase58, assetMult, assetOwner, assetTotalAmt], SEP) | |
41 | 41 | ||
42 | 42 | ||
43 | 43 | func formatConfig (claimStartBlock,vestingPeriod,assetIdBase58,assetMult,claimAssetOwner,claimAssetTotalAmount) = formatConfigString(toString(claimStartBlock), toString(vestingPeriod), assetIdBase58, toString(assetMult), claimAssetOwner, toString(claimAssetTotalAmount)) | |
44 | 44 | ||
45 | 45 | ||
46 | 46 | func formatTotalsString (totalClaimedAmount,remainingAmountForClaim,lastClaimedHeight) = makeString(["%d%d%d", totalClaimedAmount, remainingAmountForClaim, lastClaimedHeight], SEP) | |
47 | 47 | ||
48 | 48 | ||
49 | 49 | func formatHistoryRecord (claimedAssetAmount,claimingBlocks,firstCalulationBlock,lastCalulationBlock) = makeString(["%d%d%d%d%d%d", toString(height), toString(lastBlock.timestamp), toString(claimedAssetAmount), toString(claimingBlocks), toString(firstCalulationBlock), toString(lastCalulationBlock)], SEP) | |
50 | 50 | ||
51 | 51 | ||
52 | 52 | func keyConfig () = "%s__config" | |
53 | 53 | ||
54 | 54 | ||
55 | 55 | func keyTotals () = "%s__totals" | |
56 | 56 | ||
57 | 57 | ||
58 | 58 | let keyAmountUnclaimed = makeString(["%s", "amountUnclaimed"], SEP) | |
59 | 59 | ||
60 | 60 | func keyOperationHistoryRecord (type,userAddress,txId58) = makeString(["%s%s%s%s__history", type, userAddress, txId58], SEP) | |
61 | 61 | ||
62 | 62 | ||
63 | 63 | func readConfigArray () = split(getStringOrFail(keyConfig()), SEP) | |
64 | 64 | ||
65 | 65 | ||
66 | 66 | func readTotalsArray () = split(getStringOrFail(keyTotals()), SEP) | |
67 | 67 | ||
68 | 68 | ||
69 | 69 | func TotalsEntry (key,origArray,claimedAmt,newLastClaimedHeight) = { | |
70 | 70 | let totalClaimedAmount = parseIntValue(origArray[IdxTotalsTotalClaimedAmount]) | |
71 | 71 | let remainingAmount = parseIntValue(origArray[IdxTotalsRemainingAmount]) | |
72 | 72 | let lastClaimedHeight = parseIntValue(origArray[IdxTotalsLastClaimedHeight]) | |
73 | 73 | let newTotalClaimedAmount = (totalClaimedAmount + claimedAmt) | |
74 | 74 | let newRemainingAmount = (remainingAmount - claimedAmt) | |
75 | 75 | if ((0 > newRemainingAmount)) | |
76 | 76 | then throw("invalid math") | |
77 | 77 | else StringEntry(key, formatTotalsString(toString(newTotalClaimedAmount), toString(newRemainingAmount), toString(newLastClaimedHeight))) | |
78 | 78 | } | |
79 | 79 | ||
80 | 80 | ||
81 | 81 | func ClaimOperationHistoryEntry (userAddress,claimedAssetAmount,claimingBlocks,firstCalculationBlock,lastCalculationBlock,txId) = StringEntry(keyOperationHistoryRecord("claim", userAddress, toBase58String(txId)), formatHistoryRecord(claimedAssetAmount, claimingBlocks, firstCalculationBlock, lastCalculationBlock)) | |
82 | 82 | ||
83 | 83 | ||
84 | 84 | func managerPublicKeyOrUnit () = match getString(keyManagerPublicKey()) { | |
85 | 85 | case s: String => | |
86 | 86 | fromBase58String(s) | |
87 | 87 | case _: Unit => | |
88 | 88 | unit | |
89 | 89 | case _ => | |
90 | 90 | throw("Match error") | |
91 | 91 | } | |
92 | 92 | ||
93 | 93 | ||
94 | 94 | func pendingManagerPublicKeyOrUnit () = match getString(keyPendingManagerPublicKey()) { | |
95 | 95 | case s: String => | |
96 | 96 | fromBase58String(s) | |
97 | 97 | case _: Unit => | |
98 | 98 | unit | |
99 | 99 | case _ => | |
100 | 100 | throw("Match error") | |
101 | 101 | } | |
102 | 102 | ||
103 | 103 | ||
104 | 104 | func mustManager (i) = { | |
105 | 105 | let pd = throwErr("permission denied") | |
106 | 106 | match managerPublicKeyOrUnit() { | |
107 | 107 | case pk: ByteVector => | |
108 | 108 | if ((i.callerPublicKey == pk)) | |
109 | 109 | then true | |
110 | 110 | else pd | |
111 | 111 | case _: Unit => | |
112 | 112 | if ((i.caller == this)) | |
113 | 113 | then true | |
114 | 114 | else pd | |
115 | 115 | case _ => | |
116 | 116 | throw("Match error") | |
117 | 117 | } | |
118 | 118 | } | |
119 | 119 | ||
120 | 120 | ||
121 | 121 | func claimCommon (i,amount) = { | |
122 | 122 | let cfgArray = readConfigArray() | |
123 | 123 | let cfgClaimStartHeight = parseIntValue(cfgArray[IdxCfgClaimStartBlock]) | |
124 | 124 | let cfgClaimDuration = parseIntValue(cfgArray[IdxCfgClaimVestingPeriod]) | |
125 | 125 | let cfgClaimEnd = (cfgClaimStartHeight + cfgClaimDuration) | |
126 | 126 | let cfgClaimAssetId = fromBase58String(cfgArray[IdxCfgClaimAssetId]) | |
127 | 127 | let cfgClaimAssetOwner = addressFromStringValue(cfgArray[IdxCfgClaimAssetOwner]) | |
128 | 128 | let cfgClaimAssetTotalAmount = parseIntValue(cfgArray[IdxCfgClaimAssetTotalAmount]) | |
129 | 129 | let origTotalsArray = readTotalsArray() | |
130 | 130 | let totalClaimedAmount = parseIntValue(origTotalsArray[IdxTotalsTotalClaimedAmount]) | |
131 | 131 | let totalRemainingAmount = parseIntValue(origTotalsArray[IdxTotalsRemainingAmount]) | |
132 | 132 | let lastClaimedHeight = parseIntValue(origTotalsArray[IdxTotalsLastClaimedHeight]) | |
133 | 133 | if ((i.caller != cfgClaimAssetOwner)) | |
134 | 134 | then throw("permissions denied") | |
135 | 135 | else if ((cfgClaimStartHeight > height)) | |
136 | 136 | then throw(("Wait claim start block: " + toString(cfgClaimStartHeight))) | |
137 | 137 | else { | |
138 | 138 | let lastCalulationBlock = if ((height > cfgClaimEnd)) | |
139 | 139 | then cfgClaimEnd | |
140 | 140 | else height | |
141 | 141 | let firstCalulationBlock = if ((lastClaimedHeight == 0)) | |
142 | 142 | then cfgClaimStartHeight | |
143 | 143 | else lastClaimedHeight | |
144 | 144 | let claimingBlocks = (lastCalulationBlock - firstCalulationBlock) | |
145 | 145 | let amountAvailable = fraction(cfgClaimAssetTotalAmount, claimingBlocks, cfgClaimDuration) | |
146 | 146 | let amountUnclaimed = valueOrElse(getInteger(this, keyAmountUnclaimed), 0) | |
147 | 147 | let amountAvailableTotal = (amountAvailable + amountUnclaimed) | |
148 | 148 | let amountToClaim = if (if ((0 >= amount)) | |
149 | 149 | then true | |
150 | 150 | else (amount >= amountAvailableTotal)) | |
151 | 151 | then amountAvailableTotal | |
152 | 152 | else amount | |
153 | 153 | let amountUnclaimedNew = (amountAvailableTotal - amountToClaim) | |
154 | 154 | $Tuple2([IntegerEntry(keyAmountUnclaimed, amountUnclaimedNew), ScriptTransfer(cfgClaimAssetOwner, amountToClaim, cfgClaimAssetId), TotalsEntry(keyTotals(), readTotalsArray(), amountToClaim, lastCalulationBlock), ClaimOperationHistoryEntry(toString(cfgClaimAssetOwner), amountToClaim, claimingBlocks, firstCalulationBlock, lastCalulationBlock, i.transactionId)], amountToClaim) | |
155 | 155 | } | |
156 | 156 | } | |
157 | 157 | ||
158 | 158 | ||
159 | 159 | @Callable(i) | |
160 | 160 | func constructor (claimStartBlock,vestingPeriodBlocks,beneficiaryAddress) = { | |
161 | 161 | let vestingEnd = (claimStartBlock + vestingPeriodBlocks) | |
162 | 162 | if (isDefined(getString(keyConfig()))) | |
163 | 163 | then throw("already initialized") | |
164 | 164 | else if ((size(i.payments) != 1)) | |
165 | 165 | then throw("exactly 1 payment must be attached") | |
166 | 166 | else if ((i.callerPublicKey != base58'2Cbd8ozG7A1RyRNC3nNnZgHu7Ru4K3JCfpyPkhqr9zxq')) | |
167 | 167 | then throw("not authorized") | |
168 | 168 | else { | |
169 | 169 | let beneficiaryAddressParsed = valueOrErrorMessage(addressFromString(beneficiaryAddress), "Invalid beneficiarAddress passed") | |
170 | 170 | let pmt = value(i.payments[0]) | |
171 | 171 | let claimAssetId = value(pmt.assetId) | |
172 | 172 | let claimAssetInfo = valueOrErrorMessage(assetInfo(claimAssetId), "fail to load ido asset info") | |
173 | 173 | let claimAssetId58 = toBase58String(claimAssetId) | |
174 | 174 | let claimAssetMult = pow(10, 0, claimAssetInfo.decimals, 0, 0, DOWN) | |
175 | 175 | let claimAssetAmount = pmt.amount | |
176 | 176 | [StringEntry(keyConfig(), formatConfig(claimStartBlock, vestingPeriodBlocks, claimAssetId58, claimAssetMult, toString(beneficiaryAddressParsed), claimAssetAmount)), StringEntry(keyTotals(), formatTotalsString("0", toString(claimAssetAmount), "0"))] | |
177 | 177 | } | |
178 | 178 | } | |
179 | 179 | ||
180 | 180 | ||
181 | 181 | ||
182 | 182 | @Callable(i) | |
183 | 183 | func claimAmount (amount) = claimCommon(i, amount) | |
184 | 184 | ||
185 | 185 | ||
186 | 186 | ||
187 | 187 | @Callable(i) | |
188 | 188 | func claim () = claimCommon(i, -1) | |
189 | 189 | ||
190 | 190 | ||
191 | 191 | ||
192 | 192 | @Callable(i) | |
193 | 193 | func withdrawReferralReward (wxAmount) = { | |
194 | 194 | let referralContractAddress = value(getString(keyReferral)) | |
195 | 195 | let mustReferral = if ((toString(i.caller) == referralContractAddress)) | |
196 | 196 | then true | |
197 | 197 | else throwErr("permission denied") | |
198 | 198 | if ((mustReferral == mustReferral)) | |
199 | 199 | then { | |
200 | 200 | let wxAssetId = fromBase58String(value(getString(keyWxAssetId))) | |
201 | 201 | $Tuple2([ScriptTransfer(i.caller, wxAmount, wxAssetId), ClaimOperationHistoryEntry(referralContractAddress, wxAmount, 0, 0, 0, i.transactionId)], unit) | |
202 | 202 | } | |
203 | 203 | else throw("Strict value is not equal to itself.") | |
204 | 204 | } | |
205 | 205 | ||
206 | 206 | ||
207 | 207 | ||
208 | 208 | @Callable(i) | |
209 | 209 | func setManager (pendingManagerPublicKey) = { | |
210 | 210 | let checkCaller = mustManager(i) | |
211 | 211 | if ((checkCaller == checkCaller)) | |
212 | 212 | then { | |
213 | 213 | let checkManagerPublicKey = fromBase58String(pendingManagerPublicKey) | |
214 | 214 | if ((checkManagerPublicKey == checkManagerPublicKey)) | |
215 | 215 | then [StringEntry(keyPendingManagerPublicKey(), pendingManagerPublicKey)] | |
216 | 216 | else throw("Strict value is not equal to itself.") | |
217 | 217 | } | |
218 | 218 | else throw("Strict value is not equal to itself.") | |
219 | 219 | } | |
220 | 220 | ||
221 | 221 | ||
222 | 222 | ||
223 | 223 | @Callable(i) | |
224 | 224 | func confirmManager () = { | |
225 | 225 | let pm = pendingManagerPublicKeyOrUnit() | |
226 | 226 | let hasPM = if (isDefined(pm)) | |
227 | 227 | then true | |
228 | 228 | else throwErr("no pending manager") | |
229 | 229 | if ((hasPM == hasPM)) | |
230 | 230 | then { | |
231 | 231 | let checkPM = if ((i.callerPublicKey == value(pm))) | |
232 | 232 | then true | |
233 | 233 | else throwErr("you are not pending manager") | |
234 | 234 | if ((checkPM == checkPM)) | |
235 | 235 | then [StringEntry(keyManagerPublicKey(), toBase58String(value(pm))), DeleteEntry(keyPendingManagerPublicKey())] | |
236 | 236 | else throw("Strict value is not equal to itself.") | |
237 | 237 | } | |
238 | 238 | else throw("Strict value is not equal to itself.") | |
239 | 239 | } | |
240 | 240 | ||
241 | 241 | ||
242 | 242 | @Verifier(tx) | |
243 | 243 | func verify () = { | |
244 | 244 | let targetPublicKey = match managerPublicKeyOrUnit() { | |
245 | 245 | case pk: ByteVector => | |
246 | 246 | pk | |
247 | 247 | case _: Unit => | |
248 | 248 | tx.senderPublicKey | |
249 | 249 | case _ => | |
250 | 250 | throw("Match error") | |
251 | 251 | } | |
252 | 252 | sigVerify(tx.bodyBytes, tx.proofs[0], targetPublicKey) | |
253 | 253 | } | |
254 | 254 |
github/deemru/w8io/fabc49c 92.18 ms ◑