tx · 2LULERT82JxbzAQWMgwmPPeP9p61SJe4f88sMZ5oqksS 3MsgzbtRg8NEkbTcHBywtwTdCe9BRxMQo5T: -0.00400000 Waves 2024.09.25 09:35 [3298779] smart account 3MsgzbtRg8NEkbTcHBywtwTdCe9BRxMQo5T > SELF 0.00000000 Waves
{ "type": 13, "id": "2LULERT82JxbzAQWMgwmPPeP9p61SJe4f88sMZ5oqksS", "fee": 400000, "feeAssetId": null, "timestamp": 1727246165705, "version": 2, "chainId": 84, "sender": "3MsgzbtRg8NEkbTcHBywtwTdCe9BRxMQo5T", "senderPublicKey": "iTiQR3Kvxn7i8PFgEbZn36n5iFLxFwkTA6M3wi846Vx", "proofs": [ "4N2xAwRVpP3oYYTUYjVjRPfGju2sk1okjSAj23Wo4hTseBTDHsVLrjvAhWFFmbW4Xe6bUABRoRC19mcsEr8uf7bf" ], "script": "base64:BwJLCAISAwoBCBIECgIICBIECgIIARIECgIIBBIECgIIAhIDCgEIEgUKAwIBBBIECgICARIFCgMCAQISBQoDAhIREgQKAgIBEgQKAggYEAAJc2VwYXJhdG9yAgJfXwALd2F2ZXNTdHJpbmcCBVdBVkVTABBjb250cmFjdEZpbGVuYW1lAhRtZW1lX2ltX2ZhY3RvcnkucmlkZQAJa1NodXRkb3duAgwlc19fc2h1dGRvd24ACHNodXRkb3duCQELdmFsdWVPckVsc2UCCQCgCAEFCWtTaHV0ZG93bgcBB3dyYXBFcnIBAXMJAKwCAgkArAICBRBjb250cmFjdEZpbGVuYW1lAgI6IAUBcwEIdGhyb3dFcnIBAXMJAAIBCQEHd3JhcEVycgEFAXMBD3ZhbGlkYXRlQWRkcmVzcwEHYWRkcmVzcwkBCWlzRGVmaW5lZAEJAKYIAQUHYWRkcmVzcwASa0NhbGN1bGF0b3JBZGRyZXNzAhNjYWxjdWxhdG9yX19hZGRyZXNzABdjYWxjdWxhdG9yQWRkcmVzc09wdGlvbgQHJG1hdGNoMAkAnQgCBQR0aGlzBRJrQ2FsY3VsYXRvckFkZ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ationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: 4nNS2LtTdcXrMoXYLqX8SsB26bY77pWpXQgxdA4tuW7p Next: kRCDW286NqnJjmQ3Nt1MuK4xUYDmTFjP7f5jmcPvEED Diff:
Old | New | Differences | |
---|---|---|---|
58 | 58 | func init (calculatorAddressStr) = { | |
59 | 59 | let checkCaller = mustThis(i) | |
60 | 60 | if ((checkCaller == checkCaller)) | |
61 | - | then $Tuple2([StringEntry(kCalculatorAddress, calculatorAddressStr)], unit) | |
61 | + | then $Tuple2([StringEntry(kCalculatorAddress, calculatorAddressStr), StringEntry("price__asset", wavesString)], unit) | |
62 | 62 | else throw("Strict value is not equal to itself.") | |
63 | 63 | } | |
64 | 64 | ||
142 | 142 | else false) | |
143 | 143 | then { | |
144 | 144 | func addNewTransfer (acc,nextAssetId) = { | |
145 | - | let $ | |
146 | - | let transfers = $ | |
147 | - | let j = $ | |
145 | + | let $t031543178 = acc | |
146 | + | let transfers = $t031543178._1 | |
147 | + | let j = $t031543178._2 | |
148 | 148 | let newTransfer = ScriptTransfer(Address(recipientBytes), amountsList[j], assetsList[j]) | |
149 | 149 | let updatedTransfers = (transfers :+ newTransfer) | |
150 | 150 | $Tuple2(updatedTransfers, (j + 1)) | |
151 | 151 | } | |
152 | 152 | ||
153 | - | let $ | |
153 | + | let $t034043485 = { | |
154 | 154 | let $l = assetsList | |
155 | 155 | let $s = size($l) | |
156 | 156 | let $acc0 = $Tuple2(nil, 0) | |
164 | 164 | ||
165 | 165 | $f0_2($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($acc0, 0), 1), 2), 3), 4), 5), 6), 7), 8), 9), 10) | |
166 | 166 | } | |
167 | - | let assetsTransfers = $ | |
168 | - | let _lastIndex = $ | |
167 | + | let assetsTransfers = $t034043485._1 | |
168 | + | let _lastIndex = $t034043485._2 | |
169 | 169 | $Tuple2(assetsTransfers, unit) | |
170 | 170 | } | |
171 | 171 | else throwErr("not allowed") |
Old | New | Differences | |
---|---|---|---|
1 | 1 | {-# STDLIB_VERSION 7 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | 4 | let separator = "__" | |
5 | 5 | ||
6 | 6 | let wavesString = "WAVES" | |
7 | 7 | ||
8 | 8 | let contractFilename = "meme_im_factory.ride" | |
9 | 9 | ||
10 | 10 | let kShutdown = "%s__shutdown" | |
11 | 11 | ||
12 | 12 | let shutdown = valueOrElse(getBoolean(kShutdown), false) | |
13 | 13 | ||
14 | 14 | func wrapErr (s) = ((contractFilename + ": ") + s) | |
15 | 15 | ||
16 | 16 | ||
17 | 17 | func throwErr (s) = throw(wrapErr(s)) | |
18 | 18 | ||
19 | 19 | ||
20 | 20 | func validateAddress (address) = isDefined(addressFromString(address)) | |
21 | 21 | ||
22 | 22 | ||
23 | 23 | let kCalculatorAddress = "calculator__address" | |
24 | 24 | ||
25 | 25 | let calculatorAddressOption = match getString(this, kCalculatorAddress) { | |
26 | 26 | case s: String => | |
27 | 27 | addressFromString(s) | |
28 | 28 | case _: Unit => | |
29 | 29 | unit | |
30 | 30 | case _ => | |
31 | 31 | throw("Match error") | |
32 | 32 | } | |
33 | 33 | ||
34 | 34 | let calculatorAddress = valueOrErrorMessage(calculatorAddressOption, wrapErr("invalid calculator address")) | |
35 | 35 | ||
36 | 36 | func mustAddress (i,address) = if ((i.caller == address)) | |
37 | 37 | then true | |
38 | 38 | else throwErr("permission denied") | |
39 | 39 | ||
40 | 40 | ||
41 | 41 | func mustThis (i) = mustAddress(i, this) | |
42 | 42 | ||
43 | 43 | ||
44 | 44 | func mustCalculator (i) = mustAddress(i, calculatorAddress) | |
45 | 45 | ||
46 | 46 | ||
47 | 47 | func parseAssetId (input) = if ((input == wavesString)) | |
48 | 48 | then unit | |
49 | 49 | else fromBase58String(input) | |
50 | 50 | ||
51 | 51 | ||
52 | 52 | func assetIdToString (input) = if ((input == unit)) | |
53 | 53 | then wavesString | |
54 | 54 | else toBase58String(value(input)) | |
55 | 55 | ||
56 | 56 | ||
57 | 57 | @Callable(i) | |
58 | 58 | func init (calculatorAddressStr) = { | |
59 | 59 | let checkCaller = mustThis(i) | |
60 | 60 | if ((checkCaller == checkCaller)) | |
61 | - | then $Tuple2([StringEntry(kCalculatorAddress, calculatorAddressStr)], unit) | |
61 | + | then $Tuple2([StringEntry(kCalculatorAddress, calculatorAddressStr), StringEntry("price__asset", wavesString)], unit) | |
62 | 62 | else throw("Strict value is not equal to itself.") | |
63 | 63 | } | |
64 | 64 | ||
65 | 65 | ||
66 | 66 | ||
67 | 67 | @Callable(i) | |
68 | 68 | func stringEntry (key,val) = if (if (!(shutdown)) | |
69 | 69 | then mustCalculator(i) | |
70 | 70 | else false) | |
71 | 71 | then $Tuple2([StringEntry(key, val)], key) | |
72 | 72 | else throwErr("not allowed") | |
73 | 73 | ||
74 | 74 | ||
75 | 75 | ||
76 | 76 | @Callable(i) | |
77 | 77 | func integerEntry (key,val) = if (if (!(shutdown)) | |
78 | 78 | then mustCalculator(i) | |
79 | 79 | else false) | |
80 | 80 | then $Tuple2([IntegerEntry(key, val)], key) | |
81 | 81 | else throwErr("not allowed") | |
82 | 82 | ||
83 | 83 | ||
84 | 84 | ||
85 | 85 | @Callable(i) | |
86 | 86 | func booleanEntry (key,val) = if (if (!(shutdown)) | |
87 | 87 | then mustCalculator(i) | |
88 | 88 | else false) | |
89 | 89 | then $Tuple2([BooleanEntry(key, val)], key) | |
90 | 90 | else throwErr("not allowed") | |
91 | 91 | ||
92 | 92 | ||
93 | 93 | ||
94 | 94 | @Callable(i) | |
95 | 95 | func binaryEntry (key,val) = if (if (!(shutdown)) | |
96 | 96 | then mustCalculator(i) | |
97 | 97 | else false) | |
98 | 98 | then $Tuple2([BinaryEntry(key, val)], key) | |
99 | 99 | else throwErr("not allowed") | |
100 | 100 | ||
101 | 101 | ||
102 | 102 | ||
103 | 103 | @Callable(i) | |
104 | 104 | func deleteEntry (key) = if (if (!(shutdown)) | |
105 | 105 | then mustCalculator(i) | |
106 | 106 | else false) | |
107 | 107 | then $Tuple2([DeleteEntry(key)], key) | |
108 | 108 | else throwErr("not allowed") | |
109 | 109 | ||
110 | 110 | ||
111 | 111 | ||
112 | 112 | @Callable(i) | |
113 | 113 | func reissue (assetId,amount,reissuable) = if (if (!(shutdown)) | |
114 | 114 | then mustCalculator(i) | |
115 | 115 | else false) | |
116 | 116 | then $Tuple2([Reissue(assetId, amount, reissuable)], amount) | |
117 | 117 | else throwErr("not allowed") | |
118 | 118 | ||
119 | 119 | ||
120 | 120 | ||
121 | 121 | @Callable(i) | |
122 | 122 | func burn (assetId,amount) = if (if (!(shutdown)) | |
123 | 123 | then mustCalculator(i) | |
124 | 124 | else false) | |
125 | 125 | then $Tuple2([Burn(assetId, amount)], amount) | |
126 | 126 | else throwErr("not allowed") | |
127 | 127 | ||
128 | 128 | ||
129 | 129 | ||
130 | 130 | @Callable(i) | |
131 | 131 | func transferAsset (recipientBytes,amount,assetId) = if (if (!(shutdown)) | |
132 | 132 | then mustCalculator(i) | |
133 | 133 | else false) | |
134 | 134 | then $Tuple2([ScriptTransfer(Address(recipientBytes), amount, assetId)], amount) | |
135 | 135 | else throwErr("not allowed") | |
136 | 136 | ||
137 | 137 | ||
138 | 138 | ||
139 | 139 | @Callable(i) | |
140 | 140 | func transferAssets (recipientBytes,assetsList,amountsList) = if (if (!(shutdown)) | |
141 | 141 | then mustCalculator(i) | |
142 | 142 | else false) | |
143 | 143 | then { | |
144 | 144 | func addNewTransfer (acc,nextAssetId) = { | |
145 | - | let $ | |
146 | - | let transfers = $ | |
147 | - | let j = $ | |
145 | + | let $t031543178 = acc | |
146 | + | let transfers = $t031543178._1 | |
147 | + | let j = $t031543178._2 | |
148 | 148 | let newTransfer = ScriptTransfer(Address(recipientBytes), amountsList[j], assetsList[j]) | |
149 | 149 | let updatedTransfers = (transfers :+ newTransfer) | |
150 | 150 | $Tuple2(updatedTransfers, (j + 1)) | |
151 | 151 | } | |
152 | 152 | ||
153 | - | let $ | |
153 | + | let $t034043485 = { | |
154 | 154 | let $l = assetsList | |
155 | 155 | let $s = size($l) | |
156 | 156 | let $acc0 = $Tuple2(nil, 0) | |
157 | 157 | func $f0_1 ($a,$i) = if (($i >= $s)) | |
158 | 158 | then $a | |
159 | 159 | else addNewTransfer($a, $l[$i]) | |
160 | 160 | ||
161 | 161 | func $f0_2 ($a,$i) = if (($i >= $s)) | |
162 | 162 | then $a | |
163 | 163 | else throw("List size exceeds 10") | |
164 | 164 | ||
165 | 165 | $f0_2($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($acc0, 0), 1), 2), 3), 4), 5), 6), 7), 8), 9), 10) | |
166 | 166 | } | |
167 | - | let assetsTransfers = $ | |
168 | - | let _lastIndex = $ | |
167 | + | let assetsTransfers = $t034043485._1 | |
168 | + | let _lastIndex = $t034043485._2 | |
169 | 169 | $Tuple2(assetsTransfers, unit) | |
170 | 170 | } | |
171 | 171 | else throwErr("not allowed") | |
172 | 172 | ||
173 | 173 | ||
174 | 174 | ||
175 | 175 | @Callable(i) | |
176 | 176 | func transferWaves (recipientBytes,amount) = if (if (!(shutdown)) | |
177 | 177 | then mustCalculator(i) | |
178 | 178 | else false) | |
179 | 179 | then $Tuple2([ScriptTransfer(Address(recipientBytes), amount, unit)], amount) | |
180 | 180 | else throwErr("not allowed") | |
181 | 181 | ||
182 | 182 | ||
183 | 183 | ||
184 | 184 | @Callable(i) | |
185 | 185 | func call (function,args) = { | |
186 | 186 | let cleanPayments = if ((i.callerPublicKey == base58'11111111111111111111111111111111')) | |
187 | 187 | then nil | |
188 | 188 | else i.payments | |
189 | 189 | let result = reentrantInvoke(calculatorAddress, function, [i.callerPublicKey, args], cleanPayments) | |
190 | 190 | $Tuple2(nil, result) | |
191 | 191 | } | |
192 | 192 | ||
193 | 193 |
github/deemru/w8io/026f985 27.88 ms ◑