tx · 4nNS2LtTdcXrMoXYLqX8SsB26bY77pWpXQgxdA4tuW7p 3MsgzbtRg8NEkbTcHBywtwTdCe9BRxMQo5T: -0.00400000 Waves 2024.09.24 20:51 [3298003] smart account 3MsgzbtRg8NEkbTcHBywtwTdCe9BRxMQo5T > SELF 0.00000000 Waves
{ "type": 13, "id": "4nNS2LtTdcXrMoXYLqX8SsB26bY77pWpXQgxdA4tuW7p", "fee": 400000, "feeAssetId": null, "timestamp": 1727200287610, "version": 2, "chainId": 84, "sender": "3MsgzbtRg8NEkbTcHBywtwTdCe9BRxMQo5T", "senderPublicKey": "iTiQR3Kvxn7i8PFgEbZn36n5iFLxFwkTA6M3wi846Vx", "proofs": [ "4UecEBdjS2XGWEsqmgoCYe5Py7QiTpYXWRmQzN1BRApbuFJKHgGWCAmCeAyZg13fYgsS1yiuh36hALGZzfyAttBG" ], "script": "base64:BwJLCAISAwoBCBIECgIICBIECgIIARIECgIIBBIECgIIAhIDCgEIEgUKAwIBBBIECgICARIFCgMCAQISBQoDAhIREgQKAgIBEgQKAggYEAAJc2VwYXJhdG9yAgJfXwALd2F2ZXNTdHJpbmcCBVdBVkVTABBjb250cmFjdEZpbGVuYW1lAhRtZW1lX2ltX2ZhY3RvcnkucmlkZQAJa1NodXRkb3duAgwlc19fc2h1dGRvd24ACHNodXRkb3duCQELdmFsdWVPckVsc2UCCQCgCAEFCWtTaHV0ZG93bgcBB3dyYXBFcnIBAXMJAKwCAgkArAICBRBjb250cmFjdEZpbGVuYW1lAgI6IAUBcwEIdGhyb3dFcnIBAXMJAAIBCQEHd3JhcEVycgEFAXMBD3ZhbGlkYXRlQWRkcmVzcwEHYWRkcmVzcwkBCWlzRGVmaW5lZAEJAKYIAQUHYWRkcmVzcwASa0NhbGN1bGF0b3JBZGRyZXNzAhNjYWxjdWxhdG9yX19hZGRyZXNzABdjYWxjdWxhdG9yQWRkcmVzc09wdGlvbgQHJG1hdGNoMAkAnQgCBQR0aGlzBRJrQ2FsY3VsYXRv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rCeJbJDRRaMErQkXSZHZrF163HfBrMhP7n2 Next: 2LULERT82JxbzAQWMgwmPPeP9p61SJe4f88sMZ5oqksS Full:
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 | 61 | then $Tuple2([StringEntry(kCalculatorAddress, calculatorAddressStr)], 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 | 145 | let $t031043128 = acc | |
146 | 146 | let transfers = $t031043128._1 | |
147 | 147 | let j = $t031043128._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 | 153 | let $t033543435 = { | |
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 | 167 | let assetsTransfers = $t033543435._1 | |
168 | 168 | let _lastIndex = $t033543435._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 37.17 ms ◑