@sentio/sdk 2.40.0-rc.4 → 2.40.0-rc.41

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (224) hide show
  1. package/lib/aptos/aptos-processor.d.ts +1 -1
  2. package/lib/aptos/aptos-processor.d.ts.map +1 -1
  3. package/lib/aptos/aptos-processor.js +1 -1
  4. package/lib/aptos/aptos-processor.js.map +1 -1
  5. package/lib/aptos/context.d.ts +2 -2
  6. package/lib/aptos/context.d.ts.map +1 -1
  7. package/lib/aptos/context.js +1 -1
  8. package/lib/aptos/ext/aptos-dex.d.ts +1 -1
  9. package/lib/aptos/ext/aptos-dex.d.ts.map +1 -1
  10. package/lib/aptos/ext/aptos-dex.js +1 -1
  11. package/lib/aptos/ext/aptos-dex.js.map +1 -1
  12. package/lib/aptos/ext/coin-event.d.ts +1 -1
  13. package/lib/aptos/ext/coin-event.d.ts.map +1 -1
  14. package/lib/aptos/ext/coin.js +2 -2
  15. package/lib/aptos/ext/coin.js.map +1 -1
  16. package/lib/aptos/move-coder.d.ts.map +1 -1
  17. package/lib/aptos/move-coder.js +6 -5
  18. package/lib/aptos/move-coder.js.map +1 -1
  19. package/lib/aptos/network.d.ts +2 -0
  20. package/lib/aptos/network.d.ts.map +1 -1
  21. package/lib/aptos/network.js +7 -1
  22. package/lib/aptos/network.js.map +1 -1
  23. package/lib/eth/account-processor.d.ts +21 -7
  24. package/lib/eth/account-processor.d.ts.map +1 -1
  25. package/lib/eth/account-processor.js +2 -2
  26. package/lib/eth/account-processor.js.map +1 -1
  27. package/lib/eth/base-processor-template.d.ts +24 -8
  28. package/lib/eth/base-processor-template.d.ts.map +1 -1
  29. package/lib/eth/base-processor-template.js.map +1 -1
  30. package/lib/eth/base-processor.d.ts +30 -10
  31. package/lib/eth/base-processor.d.ts.map +1 -1
  32. package/lib/eth/base-processor.js +6 -6
  33. package/lib/eth/base-processor.js.map +1 -1
  34. package/lib/eth/builtin/internal/eacaggregatorproxy-processor.d.ts +100 -31
  35. package/lib/eth/builtin/internal/eacaggregatorproxy-processor.d.ts.map +1 -1
  36. package/lib/eth/builtin/internal/eacaggregatorproxy-processor.js +1226 -46
  37. package/lib/eth/builtin/internal/eacaggregatorproxy-processor.js.map +1 -1
  38. package/lib/eth/builtin/internal/erc1155-processor.d.ts +55 -16
  39. package/lib/eth/builtin/internal/erc1155-processor.d.ts.map +1 -1
  40. package/lib/eth/builtin/internal/erc1155-processor.js +486 -16
  41. package/lib/eth/builtin/internal/erc1155-processor.js.map +1 -1
  42. package/lib/eth/builtin/internal/erc20-processor.d.ts +79 -24
  43. package/lib/eth/builtin/internal/erc20-processor.d.ts.map +1 -1
  44. package/lib/eth/builtin/internal/erc20-processor.js +985 -36
  45. package/lib/eth/builtin/internal/erc20-processor.js.map +1 -1
  46. package/lib/eth/builtin/internal/erc20bytes-processor.d.ts +46 -13
  47. package/lib/eth/builtin/internal/erc20bytes-processor.d.ts.map +1 -1
  48. package/lib/eth/builtin/internal/erc20bytes-processor.js +485 -18
  49. package/lib/eth/builtin/internal/erc20bytes-processor.js.map +1 -1
  50. package/lib/eth/builtin/internal/erc721-processor.d.ts +67 -20
  51. package/lib/eth/builtin/internal/erc721-processor.d.ts.map +1 -1
  52. package/lib/eth/builtin/internal/erc721-processor.js +784 -28
  53. package/lib/eth/builtin/internal/erc721-processor.js.map +1 -1
  54. package/lib/eth/builtin/internal/weth9-processor.d.ts +64 -19
  55. package/lib/eth/builtin/internal/weth9-processor.d.ts.map +1 -1
  56. package/lib/eth/builtin/internal/weth9-processor.js +574 -22
  57. package/lib/eth/builtin/internal/weth9-processor.js.map +1 -1
  58. package/lib/eth/codegen/event-handler.js +1 -1
  59. package/lib/eth/codegen/file.d.ts.map +1 -1
  60. package/lib/eth/codegen/file.js +21 -3
  61. package/lib/eth/codegen/file.js.map +1 -1
  62. package/lib/eth/codegen/function-calls.d.ts +4 -0
  63. package/lib/eth/codegen/function-calls.d.ts.map +1 -1
  64. package/lib/eth/codegen/function-calls.js +80 -5
  65. package/lib/eth/codegen/function-calls.js.map +1 -1
  66. package/lib/eth/codegen/types.d.ts +1 -0
  67. package/lib/eth/codegen/types.d.ts.map +1 -1
  68. package/lib/eth/codegen/types.js +13 -0
  69. package/lib/eth/codegen/types.js.map +1 -1
  70. package/lib/eth/context.d.ts +4 -0
  71. package/lib/eth/context.d.ts.map +1 -1
  72. package/lib/eth/context.js +4 -0
  73. package/lib/eth/context.js.map +1 -1
  74. package/lib/eth/eth-plugin.d.ts +27 -9
  75. package/lib/eth/eth-plugin.d.ts.map +1 -1
  76. package/lib/eth/eth-plugin.js +20 -17
  77. package/lib/eth/eth-plugin.js.map +1 -1
  78. package/lib/eth/eth.d.ts.map +1 -1
  79. package/lib/eth/eth.js +1 -1
  80. package/lib/eth/eth.js.map +1 -1
  81. package/lib/eth/generic-processor.js +1 -1
  82. package/lib/eth/generic-processor.js.map +1 -1
  83. package/lib/eth/generic-processor.test.js.map +1 -1
  84. package/lib/eth/index.d.ts +2 -1
  85. package/lib/eth/index.d.ts.map +1 -1
  86. package/lib/eth/index.js +2 -1
  87. package/lib/eth/index.js.map +1 -1
  88. package/lib/solana/builtin/spl-token-processor.d.ts +1 -1
  89. package/lib/solana/builtin/spl-token-processor.d.ts.map +1 -1
  90. package/lib/solana/builtin/spl-token-processor.js +1 -1
  91. package/lib/solana/builtin/spl-token-processor.js.map +1 -1
  92. package/lib/solana/solana-context.d.ts +1 -1
  93. package/lib/solana/solana-context.js +2 -2
  94. package/lib/stark/codegen/codegen.d.ts +2 -0
  95. package/lib/stark/codegen/codegen.d.ts.map +1 -0
  96. package/lib/stark/codegen/codegen.js +109 -0
  97. package/lib/stark/codegen/codegen.js.map +1 -0
  98. package/lib/stark/codegen/index.d.ts +2 -0
  99. package/lib/stark/codegen/index.d.ts.map +1 -0
  100. package/lib/stark/codegen/index.js +2 -0
  101. package/lib/stark/codegen/index.js.map +1 -0
  102. package/lib/stark/codegen/run.d.ts +2 -0
  103. package/lib/stark/codegen/run.d.ts.map +1 -0
  104. package/lib/stark/codegen/run.js +11 -0
  105. package/lib/stark/codegen/run.js.map +1 -0
  106. package/lib/stark/codegen/utils.d.ts +2 -0
  107. package/lib/stark/codegen/utils.d.ts.map +1 -0
  108. package/lib/stark/codegen/utils.js +4 -0
  109. package/lib/stark/codegen/utils.js.map +1 -0
  110. package/lib/stark/context.d.ts +28 -0
  111. package/lib/stark/context.d.ts.map +1 -0
  112. package/lib/stark/context.js +59 -0
  113. package/lib/stark/context.js.map +1 -0
  114. package/lib/stark/contract.d.ts +12 -0
  115. package/lib/stark/contract.d.ts.map +1 -0
  116. package/lib/stark/contract.js +43 -0
  117. package/lib/stark/contract.js.map +1 -0
  118. package/lib/stark/event.d.ts +7 -0
  119. package/lib/stark/event.d.ts.map +1 -0
  120. package/lib/stark/event.js +11 -0
  121. package/lib/stark/event.js.map +1 -0
  122. package/lib/stark/index.d.ts +7 -0
  123. package/lib/stark/index.d.ts.map +1 -0
  124. package/lib/stark/index.js +7 -0
  125. package/lib/stark/index.js.map +1 -0
  126. package/lib/stark/starknet-plugin.d.ts +17 -0
  127. package/lib/stark/starknet-plugin.d.ts.map +1 -0
  128. package/lib/stark/starknet-plugin.js +78 -0
  129. package/lib/stark/starknet-plugin.js.map +1 -0
  130. package/lib/stark/starknet-processor.d.ts +32 -0
  131. package/lib/stark/starknet-processor.d.ts.map +1 -0
  132. package/lib/stark/starknet-processor.js +111 -0
  133. package/lib/stark/starknet-processor.js.map +1 -0
  134. package/lib/stark/types.d.ts +11 -0
  135. package/lib/stark/types.d.ts.map +1 -0
  136. package/lib/stark/types.js +2 -0
  137. package/lib/stark/types.js.map +1 -0
  138. package/lib/store/cache.d.ts +14 -0
  139. package/lib/store/cache.d.ts.map +1 -0
  140. package/lib/store/cache.js +35 -0
  141. package/lib/store/cache.js.map +1 -0
  142. package/lib/store/store.d.ts +2 -3
  143. package/lib/store/store.d.ts.map +1 -1
  144. package/lib/store/store.js +34 -9
  145. package/lib/store/store.js.map +1 -1
  146. package/lib/sui/context.d.ts +1 -1
  147. package/lib/sui/context.d.ts.map +1 -1
  148. package/lib/sui/sui-processor.d.ts +1 -1
  149. package/lib/sui/sui-processor.d.ts.map +1 -1
  150. package/lib/sui/sui-processor.js +1 -1
  151. package/lib/sui/sui-processor.js.map +1 -1
  152. package/lib/testing/aptos-facet.d.ts +1 -1
  153. package/lib/testing/aptos-facet.js +2 -2
  154. package/lib/testing/starknet-facet.d.ts +9 -0
  155. package/lib/testing/starknet-facet.d.ts.map +1 -0
  156. package/lib/testing/starknet-facet.js +52 -0
  157. package/lib/testing/starknet-facet.js.map +1 -0
  158. package/lib/testing/sui-facet.js +1 -1
  159. package/lib/testing/test-processor-server.d.ts +2 -0
  160. package/lib/testing/test-processor-server.d.ts.map +1 -1
  161. package/lib/testing/test-processor-server.js +3 -0
  162. package/lib/testing/test-processor-server.js.map +1 -1
  163. package/lib/tsup.config.ts +3 -15
  164. package/lib/utils/dex-price.d.ts +1 -0
  165. package/lib/utils/dex-price.d.ts.map +1 -1
  166. package/lib/utils/dex-price.js +13 -2
  167. package/lib/utils/dex-price.js.map +1 -1
  168. package/package.json +21 -10
  169. package/src/aptos/aptos-processor.ts +1 -1
  170. package/src/aptos/context.ts +2 -2
  171. package/src/aptos/ext/aptos-dex.ts +1 -1
  172. package/src/aptos/ext/coin-event.ts +1 -1
  173. package/src/aptos/ext/coin.ts +2 -2
  174. package/src/aptos/move-coder.ts +7 -5
  175. package/src/aptos/network.ts +7 -1
  176. package/src/bundle.config.ts +23 -0
  177. package/src/eth/account-processor.ts +28 -12
  178. package/src/eth/base-processor-template.ts +16 -8
  179. package/src/eth/base-processor.ts +25 -16
  180. package/src/eth/builtin/internal/eacaggregatorproxy-processor.ts +1554 -123
  181. package/src/eth/builtin/internal/erc1155-processor.ts +659 -42
  182. package/src/eth/builtin/internal/erc20-processor.ts +1266 -90
  183. package/src/eth/builtin/internal/erc20bytes-processor.ts +639 -49
  184. package/src/eth/builtin/internal/erc721-processor.ts +1035 -70
  185. package/src/eth/builtin/internal/weth9-processor.ts +758 -63
  186. package/src/eth/codegen/event-handler.ts +1 -1
  187. package/src/eth/codegen/file.ts +26 -3
  188. package/src/eth/codegen/function-calls.ts +96 -8
  189. package/src/eth/codegen/types.ts +22 -1
  190. package/src/eth/context.ts +7 -0
  191. package/src/eth/eth-plugin.ts +34 -26
  192. package/src/eth/eth.ts +1 -2
  193. package/src/eth/generic-processor.ts +1 -1
  194. package/src/eth/index.ts +5 -1
  195. package/src/solana/builtin/spl-token-processor.ts +1 -1
  196. package/src/solana/solana-context.ts +2 -2
  197. package/src/stark/codegen/codegen.ts +124 -0
  198. package/src/stark/codegen/index.ts +1 -0
  199. package/src/stark/codegen/run.ts +10 -0
  200. package/src/stark/codegen/utils.ts +3 -0
  201. package/src/stark/context.ts +78 -0
  202. package/src/stark/contract.ts +55 -0
  203. package/src/stark/event.ts +7 -0
  204. package/src/stark/index.ts +9 -0
  205. package/src/stark/starknet-plugin.ts +108 -0
  206. package/src/stark/starknet-processor.ts +140 -0
  207. package/src/stark/types.ts +11 -0
  208. package/src/store/cache.ts +46 -0
  209. package/src/store/store.ts +40 -22
  210. package/src/sui/context.ts +1 -1
  211. package/src/sui/sui-processor.ts +1 -1
  212. package/src/testing/aptos-facet.ts +2 -2
  213. package/src/testing/starknet-facet.ts +61 -0
  214. package/src/testing/sui-facet.ts +1 -1
  215. package/src/testing/test-processor-server.ts +3 -0
  216. package/src/tsup.config.ts +3 -15
  217. package/src/utils/dex-price.ts +15 -2
  218. package/lib/eth/provider.d.ts +0 -5
  219. package/lib/eth/provider.d.ts.map +0 -1
  220. package/lib/eth/provider.js +0 -134
  221. package/lib/eth/provider.js.map +0 -1
  222. package/lib/utils/chainlink-oracles-sepolia.csv +0 -19
  223. package/lib/utils/chainlink-oracles.csv +0 -217
  224. package/src/eth/provider.ts +0 -163
@@ -1,7 +1,7 @@
1
1
  /* Autogenerated file. Do not edit manually. */
2
2
  /* tslint:disable */
3
3
  /* eslint-disable */
4
- import { BigNumberish, Overrides } from "ethers";
4
+ import { BigNumberish, Overrides, Interface } from "ethers";
5
5
  import {
6
6
  addContractByABI,
7
7
  getContractByABI,
@@ -21,7 +21,9 @@ import {
21
21
  EthContext,
22
22
  EthFetchConfig,
23
23
  PreprocessResult,
24
+ makeEthCallKey,
24
25
  } from "@sentio/sdk/eth";
26
+ import { EthCallParam, EthCallContext, PreparedData } from "@sentio/protos";
25
27
 
26
28
  import { ERC20__factory } from "./index.js";
27
29
  import {
@@ -174,9 +176,29 @@ export class ERC20ContractView extends ContractView<ERC20> {
174
176
  async allowance(
175
177
  owner: string,
176
178
  spender: string,
177
- overrides?: Overrides
179
+ overrides?: Overrides,
180
+ preparedData?: PreparedData,
181
+ ethCallContext?: EthCallContext
178
182
  ): Promise<bigint> {
179
183
  try {
184
+ if (preparedData?.ethCallResults && ethCallContext) {
185
+ const iface = new Interface([
186
+ "function allowance(address,address) view returns (uint256)",
187
+ ]);
188
+ const calldata = iface.encodeFunctionData("allowance", [
189
+ owner,
190
+ spender,
191
+ ]);
192
+ const key = makeEthCallKey({
193
+ context: ethCallContext,
194
+ calldata,
195
+ });
196
+ const ret = preparedData.ethCallResults[key];
197
+ if (ret) {
198
+ const result = iface.decodeFunctionResult("allowance", ret).toArray();
199
+ return result.length == 1 ? result[0] : result;
200
+ }
201
+ }
180
202
  return await this.contract.getFunction("allowance(address,address)")(
181
203
  owner,
182
204
  spender,
@@ -188,8 +210,28 @@ export class ERC20ContractView extends ContractView<ERC20> {
188
210
  }
189
211
  }
190
212
 
191
- async balanceOf(account: string, overrides?: Overrides): Promise<bigint> {
213
+ async balanceOf(
214
+ account: string,
215
+ overrides?: Overrides,
216
+ preparedData?: PreparedData,
217
+ ethCallContext?: EthCallContext
218
+ ): Promise<bigint> {
192
219
  try {
220
+ if (preparedData?.ethCallResults && ethCallContext) {
221
+ const iface = new Interface([
222
+ "function balanceOf(address) view returns (uint256)",
223
+ ]);
224
+ const calldata = iface.encodeFunctionData("balanceOf", [account]);
225
+ const key = makeEthCallKey({
226
+ context: ethCallContext,
227
+ calldata,
228
+ });
229
+ const ret = preparedData.ethCallResults[key];
230
+ if (ret) {
231
+ const result = iface.decodeFunctionResult("balanceOf", ret).toArray();
232
+ return result.length == 1 ? result[0] : result;
233
+ }
234
+ }
193
235
  return await this.contract.getFunction("balanceOf(address)")(
194
236
  account,
195
237
  overrides || {}
@@ -200,8 +242,27 @@ export class ERC20ContractView extends ContractView<ERC20> {
200
242
  }
201
243
  }
202
244
 
203
- async decimals(overrides?: Overrides): Promise<bigint> {
245
+ async decimals(
246
+ overrides?: Overrides,
247
+ preparedData?: PreparedData,
248
+ ethCallContext?: EthCallContext
249
+ ): Promise<bigint> {
204
250
  try {
251
+ if (preparedData?.ethCallResults && ethCallContext) {
252
+ const iface = new Interface([
253
+ "function decimals() view returns (uint8)",
254
+ ]);
255
+ const calldata = iface.encodeFunctionData("decimals", []);
256
+ const key = makeEthCallKey({
257
+ context: ethCallContext,
258
+ calldata,
259
+ });
260
+ const ret = preparedData.ethCallResults[key];
261
+ if (ret) {
262
+ const result = iface.decodeFunctionResult("decimals", ret).toArray();
263
+ return result.length == 1 ? result[0] : result;
264
+ }
265
+ }
205
266
  return await this.contract.getFunction("decimals()")(overrides || {});
206
267
  } catch (e) {
207
268
  const stack = new Error().stack;
@@ -209,8 +270,27 @@ export class ERC20ContractView extends ContractView<ERC20> {
209
270
  }
210
271
  }
211
272
 
212
- async locker(overrides?: Overrides): Promise<string> {
273
+ async locker(
274
+ overrides?: Overrides,
275
+ preparedData?: PreparedData,
276
+ ethCallContext?: EthCallContext
277
+ ): Promise<string> {
213
278
  try {
279
+ if (preparedData?.ethCallResults && ethCallContext) {
280
+ const iface = new Interface([
281
+ "function locker() view returns (address)",
282
+ ]);
283
+ const calldata = iface.encodeFunctionData("locker", []);
284
+ const key = makeEthCallKey({
285
+ context: ethCallContext,
286
+ calldata,
287
+ });
288
+ const ret = preparedData.ethCallResults[key];
289
+ if (ret) {
290
+ const result = iface.decodeFunctionResult("locker", ret).toArray();
291
+ return result.length == 1 ? result[0] : result;
292
+ }
293
+ }
214
294
  return await this.contract.getFunction("locker()")(overrides || {});
215
295
  } catch (e) {
216
296
  const stack = new Error().stack;
@@ -218,8 +298,25 @@ export class ERC20ContractView extends ContractView<ERC20> {
218
298
  }
219
299
  }
220
300
 
221
- async name(overrides?: Overrides): Promise<string> {
301
+ async name(
302
+ overrides?: Overrides,
303
+ preparedData?: PreparedData,
304
+ ethCallContext?: EthCallContext
305
+ ): Promise<string> {
222
306
  try {
307
+ if (preparedData?.ethCallResults && ethCallContext) {
308
+ const iface = new Interface(["function name() view returns (string)"]);
309
+ const calldata = iface.encodeFunctionData("name", []);
310
+ const key = makeEthCallKey({
311
+ context: ethCallContext,
312
+ calldata,
313
+ });
314
+ const ret = preparedData.ethCallResults[key];
315
+ if (ret) {
316
+ const result = iface.decodeFunctionResult("name", ret).toArray();
317
+ return result.length == 1 ? result[0] : result;
318
+ }
319
+ }
223
320
  return await this.contract.getFunction("name()")(overrides || {});
224
321
  } catch (e) {
225
322
  const stack = new Error().stack;
@@ -227,8 +324,27 @@ export class ERC20ContractView extends ContractView<ERC20> {
227
324
  }
228
325
  }
229
326
 
230
- async owner(overrides?: Overrides): Promise<string> {
327
+ async owner(
328
+ overrides?: Overrides,
329
+ preparedData?: PreparedData,
330
+ ethCallContext?: EthCallContext
331
+ ): Promise<string> {
231
332
  try {
333
+ if (preparedData?.ethCallResults && ethCallContext) {
334
+ const iface = new Interface([
335
+ "function owner() view returns (address)",
336
+ ]);
337
+ const calldata = iface.encodeFunctionData("owner", []);
338
+ const key = makeEthCallKey({
339
+ context: ethCallContext,
340
+ calldata,
341
+ });
342
+ const ret = preparedData.ethCallResults[key];
343
+ if (ret) {
344
+ const result = iface.decodeFunctionResult("owner", ret).toArray();
345
+ return result.length == 1 ? result[0] : result;
346
+ }
347
+ }
232
348
  return await this.contract.getFunction("owner()")(overrides || {});
233
349
  } catch (e) {
234
350
  const stack = new Error().stack;
@@ -236,8 +352,27 @@ export class ERC20ContractView extends ContractView<ERC20> {
236
352
  }
237
353
  }
238
354
 
239
- async symbol(overrides?: Overrides): Promise<string> {
355
+ async symbol(
356
+ overrides?: Overrides,
357
+ preparedData?: PreparedData,
358
+ ethCallContext?: EthCallContext
359
+ ): Promise<string> {
240
360
  try {
361
+ if (preparedData?.ethCallResults && ethCallContext) {
362
+ const iface = new Interface([
363
+ "function symbol() view returns (string)",
364
+ ]);
365
+ const calldata = iface.encodeFunctionData("symbol", []);
366
+ const key = makeEthCallKey({
367
+ context: ethCallContext,
368
+ calldata,
369
+ });
370
+ const ret = preparedData.ethCallResults[key];
371
+ if (ret) {
372
+ const result = iface.decodeFunctionResult("symbol", ret).toArray();
373
+ return result.length == 1 ? result[0] : result;
374
+ }
375
+ }
241
376
  return await this.contract.getFunction("symbol()")(overrides || {});
242
377
  } catch (e) {
243
378
  const stack = new Error().stack;
@@ -245,8 +380,29 @@ export class ERC20ContractView extends ContractView<ERC20> {
245
380
  }
246
381
  }
247
382
 
248
- async totalSupply(overrides?: Overrides): Promise<bigint> {
383
+ async totalSupply(
384
+ overrides?: Overrides,
385
+ preparedData?: PreparedData,
386
+ ethCallContext?: EthCallContext
387
+ ): Promise<bigint> {
249
388
  try {
389
+ if (preparedData?.ethCallResults && ethCallContext) {
390
+ const iface = new Interface([
391
+ "function totalSupply() view returns (uint256)",
392
+ ]);
393
+ const calldata = iface.encodeFunctionData("totalSupply", []);
394
+ const key = makeEthCallKey({
395
+ context: ethCallContext,
396
+ calldata,
397
+ });
398
+ const ret = preparedData.ethCallResults[key];
399
+ if (ret) {
400
+ const result = iface
401
+ .decodeFunctionResult("totalSupply", ret)
402
+ .toArray();
403
+ return result.length == 1 ? result[0] : result;
404
+ }
405
+ }
250
406
  return await this.contract.getFunction("totalSupply()")(overrides || {});
251
407
  } catch (e) {
252
408
  const stack = new Error().stack;
@@ -260,9 +416,29 @@ export class ERC20ContractView extends ContractView<ERC20> {
260
416
  async approve(
261
417
  spender: string,
262
418
  amount: BigNumberish,
263
- overrides?: Overrides
419
+ overrides?: Overrides,
420
+ preparedData?: PreparedData,
421
+ ethCallContext?: EthCallContext
264
422
  ): Promise<boolean> {
265
423
  try {
424
+ if (preparedData?.ethCallResults && ethCallContext) {
425
+ const iface = new Interface([
426
+ "function approve(address,uint256) nonpayable returns (bool)",
427
+ ]);
428
+ const calldata = iface.encodeFunctionData("approve", [
429
+ spender,
430
+ amount,
431
+ ]);
432
+ const key = makeEthCallKey({
433
+ context: ethCallContext,
434
+ calldata,
435
+ });
436
+ const ret = preparedData.ethCallResults[key];
437
+ if (ret) {
438
+ const result = iface.decodeFunctionResult("approve", ret).toArray();
439
+ return result.length == 1 ? result[0] : result;
440
+ }
441
+ }
266
442
  return await this.contract
267
443
  .getFunction("approve(address,uint256)")
268
444
  .staticCall(spender, amount, overrides || {});
@@ -271,8 +447,28 @@ export class ERC20ContractView extends ContractView<ERC20> {
271
447
  throw transformEtherError(e, undefined, stack);
272
448
  }
273
449
  },
274
- async burn(amount: BigNumberish, overrides?: Overrides): Promise<void> {
450
+ async burn(
451
+ amount: BigNumberish,
452
+ overrides?: Overrides,
453
+ preparedData?: PreparedData,
454
+ ethCallContext?: EthCallContext
455
+ ): Promise<void> {
275
456
  try {
457
+ if (preparedData?.ethCallResults && ethCallContext) {
458
+ const iface = new Interface([
459
+ "function burn(uint256) nonpayable returns ()",
460
+ ]);
461
+ const calldata = iface.encodeFunctionData("burn", [amount]);
462
+ const key = makeEthCallKey({
463
+ context: ethCallContext,
464
+ calldata,
465
+ });
466
+ const ret = preparedData.ethCallResults[key];
467
+ if (ret) {
468
+ const result = iface.decodeFunctionResult("burn", ret).toArray();
469
+ return result.length == 1 ? result[0] : result;
470
+ }
471
+ }
276
472
  return await this.contract
277
473
  .getFunction("burn(uint256)")
278
474
  .staticCall(amount, overrides || {});
@@ -284,9 +480,31 @@ export class ERC20ContractView extends ContractView<ERC20> {
284
480
  async burnFrom(
285
481
  account: string,
286
482
  amount: BigNumberish,
287
- overrides?: Overrides
483
+ overrides?: Overrides,
484
+ preparedData?: PreparedData,
485
+ ethCallContext?: EthCallContext
288
486
  ): Promise<void> {
289
487
  try {
488
+ if (preparedData?.ethCallResults && ethCallContext) {
489
+ const iface = new Interface([
490
+ "function burnFrom(address,uint256) nonpayable returns ()",
491
+ ]);
492
+ const calldata = iface.encodeFunctionData("burnFrom", [
493
+ account,
494
+ amount,
495
+ ]);
496
+ const key = makeEthCallKey({
497
+ context: ethCallContext,
498
+ calldata,
499
+ });
500
+ const ret = preparedData.ethCallResults[key];
501
+ if (ret) {
502
+ const result = iface
503
+ .decodeFunctionResult("burnFrom", ret)
504
+ .toArray();
505
+ return result.length == 1 ? result[0] : result;
506
+ }
507
+ }
290
508
  return await this.contract
291
509
  .getFunction("burnFrom(address,uint256)")
292
510
  .staticCall(account, amount, overrides || {});
@@ -298,9 +516,31 @@ export class ERC20ContractView extends ContractView<ERC20> {
298
516
  async decreaseAllowance(
299
517
  spender: string,
300
518
  subtractedValue: BigNumberish,
301
- overrides?: Overrides
519
+ overrides?: Overrides,
520
+ preparedData?: PreparedData,
521
+ ethCallContext?: EthCallContext
302
522
  ): Promise<boolean> {
303
523
  try {
524
+ if (preparedData?.ethCallResults && ethCallContext) {
525
+ const iface = new Interface([
526
+ "function decreaseAllowance(address,uint256) nonpayable returns (bool)",
527
+ ]);
528
+ const calldata = iface.encodeFunctionData("decreaseAllowance", [
529
+ spender,
530
+ subtractedValue,
531
+ ]);
532
+ const key = makeEthCallKey({
533
+ context: ethCallContext,
534
+ calldata,
535
+ });
536
+ const ret = preparedData.ethCallResults[key];
537
+ if (ret) {
538
+ const result = iface
539
+ .decodeFunctionResult("decreaseAllowance", ret)
540
+ .toArray();
541
+ return result.length == 1 ? result[0] : result;
542
+ }
543
+ }
304
544
  return await this.contract
305
545
  .getFunction("decreaseAllowance(address,uint256)")
306
546
  .staticCall(spender, subtractedValue, overrides || {});
@@ -312,9 +552,31 @@ export class ERC20ContractView extends ContractView<ERC20> {
312
552
  async increaseAllowance(
313
553
  spender: string,
314
554
  addedValue: BigNumberish,
315
- overrides?: Overrides
555
+ overrides?: Overrides,
556
+ preparedData?: PreparedData,
557
+ ethCallContext?: EthCallContext
316
558
  ): Promise<boolean> {
317
559
  try {
560
+ if (preparedData?.ethCallResults && ethCallContext) {
561
+ const iface = new Interface([
562
+ "function increaseAllowance(address,uint256) nonpayable returns (bool)",
563
+ ]);
564
+ const calldata = iface.encodeFunctionData("increaseAllowance", [
565
+ spender,
566
+ addedValue,
567
+ ]);
568
+ const key = makeEthCallKey({
569
+ context: ethCallContext,
570
+ calldata,
571
+ });
572
+ const ret = preparedData.ethCallResults[key];
573
+ if (ret) {
574
+ const result = iface
575
+ .decodeFunctionResult("increaseAllowance", ret)
576
+ .toArray();
577
+ return result.length == 1 ? result[0] : result;
578
+ }
579
+ }
318
580
  return await this.contract
319
581
  .getFunction("increaseAllowance(address,uint256)")
320
582
  .staticCall(spender, addedValue, overrides || {});
@@ -323,8 +585,29 @@ export class ERC20ContractView extends ContractView<ERC20> {
323
585
  throw transformEtherError(e, undefined, stack);
324
586
  }
325
587
  },
326
- async renounceOwnership(overrides?: Overrides): Promise<void> {
588
+ async renounceOwnership(
589
+ overrides?: Overrides,
590
+ preparedData?: PreparedData,
591
+ ethCallContext?: EthCallContext
592
+ ): Promise<void> {
327
593
  try {
594
+ if (preparedData?.ethCallResults && ethCallContext) {
595
+ const iface = new Interface([
596
+ "function renounceOwnership() nonpayable returns ()",
597
+ ]);
598
+ const calldata = iface.encodeFunctionData("renounceOwnership", []);
599
+ const key = makeEthCallKey({
600
+ context: ethCallContext,
601
+ calldata,
602
+ });
603
+ const ret = preparedData.ethCallResults[key];
604
+ if (ret) {
605
+ const result = iface
606
+ .decodeFunctionResult("renounceOwnership", ret)
607
+ .toArray();
608
+ return result.length == 1 ? result[0] : result;
609
+ }
610
+ }
328
611
  return await this.contract
329
612
  .getFunction("renounceOwnership()")
330
613
  .staticCall(overrides || {});
@@ -333,8 +616,30 @@ export class ERC20ContractView extends ContractView<ERC20> {
333
616
  throw transformEtherError(e, undefined, stack);
334
617
  }
335
618
  },
336
- async setLocker(_locker: string, overrides?: Overrides): Promise<void> {
619
+ async setLocker(
620
+ _locker: string,
621
+ overrides?: Overrides,
622
+ preparedData?: PreparedData,
623
+ ethCallContext?: EthCallContext
624
+ ): Promise<void> {
337
625
  try {
626
+ if (preparedData?.ethCallResults && ethCallContext) {
627
+ const iface = new Interface([
628
+ "function setLocker(address) nonpayable returns ()",
629
+ ]);
630
+ const calldata = iface.encodeFunctionData("setLocker", [_locker]);
631
+ const key = makeEthCallKey({
632
+ context: ethCallContext,
633
+ calldata,
634
+ });
635
+ const ret = preparedData.ethCallResults[key];
636
+ if (ret) {
637
+ const result = iface
638
+ .decodeFunctionResult("setLocker", ret)
639
+ .toArray();
640
+ return result.length == 1 ? result[0] : result;
641
+ }
642
+ }
338
643
  return await this.contract
339
644
  .getFunction("setLocker(address)")
340
645
  .staticCall(_locker, overrides || {});
@@ -346,9 +651,31 @@ export class ERC20ContractView extends ContractView<ERC20> {
346
651
  async transfer(
347
652
  recipient: string,
348
653
  amount: BigNumberish,
349
- overrides?: Overrides
654
+ overrides?: Overrides,
655
+ preparedData?: PreparedData,
656
+ ethCallContext?: EthCallContext
350
657
  ): Promise<boolean> {
351
658
  try {
659
+ if (preparedData?.ethCallResults && ethCallContext) {
660
+ const iface = new Interface([
661
+ "function transfer(address,uint256) nonpayable returns (bool)",
662
+ ]);
663
+ const calldata = iface.encodeFunctionData("transfer", [
664
+ recipient,
665
+ amount,
666
+ ]);
667
+ const key = makeEthCallKey({
668
+ context: ethCallContext,
669
+ calldata,
670
+ });
671
+ const ret = preparedData.ethCallResults[key];
672
+ if (ret) {
673
+ const result = iface
674
+ .decodeFunctionResult("transfer", ret)
675
+ .toArray();
676
+ return result.length == 1 ? result[0] : result;
677
+ }
678
+ }
352
679
  return await this.contract
353
680
  .getFunction("transfer(address,uint256)")
354
681
  .staticCall(recipient, amount, overrides || {});
@@ -361,9 +688,32 @@ export class ERC20ContractView extends ContractView<ERC20> {
361
688
  sender: string,
362
689
  recipient: string,
363
690
  amount: BigNumberish,
364
- overrides?: Overrides
691
+ overrides?: Overrides,
692
+ preparedData?: PreparedData,
693
+ ethCallContext?: EthCallContext
365
694
  ): Promise<boolean> {
366
695
  try {
696
+ if (preparedData?.ethCallResults && ethCallContext) {
697
+ const iface = new Interface([
698
+ "function transferFrom(address,address,uint256) nonpayable returns (bool)",
699
+ ]);
700
+ const calldata = iface.encodeFunctionData("transferFrom", [
701
+ sender,
702
+ recipient,
703
+ amount,
704
+ ]);
705
+ const key = makeEthCallKey({
706
+ context: ethCallContext,
707
+ calldata,
708
+ });
709
+ const ret = preparedData.ethCallResults[key];
710
+ if (ret) {
711
+ const result = iface
712
+ .decodeFunctionResult("transferFrom", ret)
713
+ .toArray();
714
+ return result.length == 1 ? result[0] : result;
715
+ }
716
+ }
367
717
  return await this.contract
368
718
  .getFunction("transferFrom(address,address,uint256)")
369
719
  .staticCall(sender, recipient, amount, overrides || {});
@@ -374,9 +724,30 @@ export class ERC20ContractView extends ContractView<ERC20> {
374
724
  },
375
725
  async transferOwnership(
376
726
  newOwner: string,
377
- overrides?: Overrides
727
+ overrides?: Overrides,
728
+ preparedData?: PreparedData,
729
+ ethCallContext?: EthCallContext
378
730
  ): Promise<void> {
379
731
  try {
732
+ if (preparedData?.ethCallResults && ethCallContext) {
733
+ const iface = new Interface([
734
+ "function transferOwnership(address) nonpayable returns ()",
735
+ ]);
736
+ const calldata = iface.encodeFunctionData("transferOwnership", [
737
+ newOwner,
738
+ ]);
739
+ const key = makeEthCallKey({
740
+ context: ethCallContext,
741
+ calldata,
742
+ });
743
+ const ret = preparedData.ethCallResults[key];
744
+ if (ret) {
745
+ const result = iface
746
+ .decodeFunctionResult("transferOwnership", ret)
747
+ .toArray();
748
+ return result.length == 1 ? result[0] : result;
749
+ }
750
+ }
380
751
  return await this.contract
381
752
  .getFunction("transferOwnership(address)")
382
753
  .staticCall(newOwner, overrides || {});
@@ -386,6 +757,302 @@ export class ERC20ContractView extends ContractView<ERC20> {
386
757
  }
387
758
  },
388
759
  };
760
+
761
+ encodeCall = {
762
+ allowance(
763
+ owner: string,
764
+ spender: string,
765
+ ethCallContext: EthCallContext
766
+ ): EthCallParam {
767
+ try {
768
+ const iface = new Interface(["function allowance(address,address)"]);
769
+ const calldata = iface.encodeFunctionData("allowance", [
770
+ owner,
771
+ spender,
772
+ ]);
773
+ return {
774
+ context: ethCallContext,
775
+ calldata,
776
+ };
777
+ } catch (e) {
778
+ const stack = new Error().stack;
779
+ throw transformEtherError(e, undefined, stack);
780
+ }
781
+ },
782
+ approve(
783
+ spender: string,
784
+ amount: BigNumberish,
785
+ ethCallContext: EthCallContext
786
+ ): EthCallParam {
787
+ try {
788
+ const iface = new Interface(["function approve(address,uint256)"]);
789
+ const calldata = iface.encodeFunctionData("approve", [spender, amount]);
790
+ return {
791
+ context: ethCallContext,
792
+ calldata,
793
+ };
794
+ } catch (e) {
795
+ const stack = new Error().stack;
796
+ throw transformEtherError(e, undefined, stack);
797
+ }
798
+ },
799
+ balanceOf(account: string, ethCallContext: EthCallContext): EthCallParam {
800
+ try {
801
+ const iface = new Interface(["function balanceOf(address)"]);
802
+ const calldata = iface.encodeFunctionData("balanceOf", [account]);
803
+ return {
804
+ context: ethCallContext,
805
+ calldata,
806
+ };
807
+ } catch (e) {
808
+ const stack = new Error().stack;
809
+ throw transformEtherError(e, undefined, stack);
810
+ }
811
+ },
812
+ burn(amount: BigNumberish, ethCallContext: EthCallContext): EthCallParam {
813
+ try {
814
+ const iface = new Interface(["function burn(uint256)"]);
815
+ const calldata = iface.encodeFunctionData("burn", [amount]);
816
+ return {
817
+ context: ethCallContext,
818
+ calldata,
819
+ };
820
+ } catch (e) {
821
+ const stack = new Error().stack;
822
+ throw transformEtherError(e, undefined, stack);
823
+ }
824
+ },
825
+ burnFrom(
826
+ account: string,
827
+ amount: BigNumberish,
828
+ ethCallContext: EthCallContext
829
+ ): EthCallParam {
830
+ try {
831
+ const iface = new Interface(["function burnFrom(address,uint256)"]);
832
+ const calldata = iface.encodeFunctionData("burnFrom", [
833
+ account,
834
+ amount,
835
+ ]);
836
+ return {
837
+ context: ethCallContext,
838
+ calldata,
839
+ };
840
+ } catch (e) {
841
+ const stack = new Error().stack;
842
+ throw transformEtherError(e, undefined, stack);
843
+ }
844
+ },
845
+ decimals(ethCallContext: EthCallContext): EthCallParam {
846
+ try {
847
+ const iface = new Interface(["function decimals()"]);
848
+ const calldata = iface.encodeFunctionData("decimals", []);
849
+ return {
850
+ context: ethCallContext,
851
+ calldata,
852
+ };
853
+ } catch (e) {
854
+ const stack = new Error().stack;
855
+ throw transformEtherError(e, undefined, stack);
856
+ }
857
+ },
858
+ decreaseAllowance(
859
+ spender: string,
860
+ subtractedValue: BigNumberish,
861
+ ethCallContext: EthCallContext
862
+ ): EthCallParam {
863
+ try {
864
+ const iface = new Interface([
865
+ "function decreaseAllowance(address,uint256)",
866
+ ]);
867
+ const calldata = iface.encodeFunctionData("decreaseAllowance", [
868
+ spender,
869
+ subtractedValue,
870
+ ]);
871
+ return {
872
+ context: ethCallContext,
873
+ calldata,
874
+ };
875
+ } catch (e) {
876
+ const stack = new Error().stack;
877
+ throw transformEtherError(e, undefined, stack);
878
+ }
879
+ },
880
+ increaseAllowance(
881
+ spender: string,
882
+ addedValue: BigNumberish,
883
+ ethCallContext: EthCallContext
884
+ ): EthCallParam {
885
+ try {
886
+ const iface = new Interface([
887
+ "function increaseAllowance(address,uint256)",
888
+ ]);
889
+ const calldata = iface.encodeFunctionData("increaseAllowance", [
890
+ spender,
891
+ addedValue,
892
+ ]);
893
+ return {
894
+ context: ethCallContext,
895
+ calldata,
896
+ };
897
+ } catch (e) {
898
+ const stack = new Error().stack;
899
+ throw transformEtherError(e, undefined, stack);
900
+ }
901
+ },
902
+ locker(ethCallContext: EthCallContext): EthCallParam {
903
+ try {
904
+ const iface = new Interface(["function locker()"]);
905
+ const calldata = iface.encodeFunctionData("locker", []);
906
+ return {
907
+ context: ethCallContext,
908
+ calldata,
909
+ };
910
+ } catch (e) {
911
+ const stack = new Error().stack;
912
+ throw transformEtherError(e, undefined, stack);
913
+ }
914
+ },
915
+ name(ethCallContext: EthCallContext): EthCallParam {
916
+ try {
917
+ const iface = new Interface(["function name()"]);
918
+ const calldata = iface.encodeFunctionData("name", []);
919
+ return {
920
+ context: ethCallContext,
921
+ calldata,
922
+ };
923
+ } catch (e) {
924
+ const stack = new Error().stack;
925
+ throw transformEtherError(e, undefined, stack);
926
+ }
927
+ },
928
+ owner(ethCallContext: EthCallContext): EthCallParam {
929
+ try {
930
+ const iface = new Interface(["function owner()"]);
931
+ const calldata = iface.encodeFunctionData("owner", []);
932
+ return {
933
+ context: ethCallContext,
934
+ calldata,
935
+ };
936
+ } catch (e) {
937
+ const stack = new Error().stack;
938
+ throw transformEtherError(e, undefined, stack);
939
+ }
940
+ },
941
+ renounceOwnership(ethCallContext: EthCallContext): EthCallParam {
942
+ try {
943
+ const iface = new Interface(["function renounceOwnership()"]);
944
+ const calldata = iface.encodeFunctionData("renounceOwnership", []);
945
+ return {
946
+ context: ethCallContext,
947
+ calldata,
948
+ };
949
+ } catch (e) {
950
+ const stack = new Error().stack;
951
+ throw transformEtherError(e, undefined, stack);
952
+ }
953
+ },
954
+ setLocker(_locker: string, ethCallContext: EthCallContext): EthCallParam {
955
+ try {
956
+ const iface = new Interface(["function setLocker(address)"]);
957
+ const calldata = iface.encodeFunctionData("setLocker", [_locker]);
958
+ return {
959
+ context: ethCallContext,
960
+ calldata,
961
+ };
962
+ } catch (e) {
963
+ const stack = new Error().stack;
964
+ throw transformEtherError(e, undefined, stack);
965
+ }
966
+ },
967
+ symbol(ethCallContext: EthCallContext): EthCallParam {
968
+ try {
969
+ const iface = new Interface(["function symbol()"]);
970
+ const calldata = iface.encodeFunctionData("symbol", []);
971
+ return {
972
+ context: ethCallContext,
973
+ calldata,
974
+ };
975
+ } catch (e) {
976
+ const stack = new Error().stack;
977
+ throw transformEtherError(e, undefined, stack);
978
+ }
979
+ },
980
+ totalSupply(ethCallContext: EthCallContext): EthCallParam {
981
+ try {
982
+ const iface = new Interface(["function totalSupply()"]);
983
+ const calldata = iface.encodeFunctionData("totalSupply", []);
984
+ return {
985
+ context: ethCallContext,
986
+ calldata,
987
+ };
988
+ } catch (e) {
989
+ const stack = new Error().stack;
990
+ throw transformEtherError(e, undefined, stack);
991
+ }
992
+ },
993
+ transfer(
994
+ recipient: string,
995
+ amount: BigNumberish,
996
+ ethCallContext: EthCallContext
997
+ ): EthCallParam {
998
+ try {
999
+ const iface = new Interface(["function transfer(address,uint256)"]);
1000
+ const calldata = iface.encodeFunctionData("transfer", [
1001
+ recipient,
1002
+ amount,
1003
+ ]);
1004
+ return {
1005
+ context: ethCallContext,
1006
+ calldata,
1007
+ };
1008
+ } catch (e) {
1009
+ const stack = new Error().stack;
1010
+ throw transformEtherError(e, undefined, stack);
1011
+ }
1012
+ },
1013
+ transferFrom(
1014
+ sender: string,
1015
+ recipient: string,
1016
+ amount: BigNumberish,
1017
+ ethCallContext: EthCallContext
1018
+ ): EthCallParam {
1019
+ try {
1020
+ const iface = new Interface([
1021
+ "function transferFrom(address,address,uint256)",
1022
+ ]);
1023
+ const calldata = iface.encodeFunctionData("transferFrom", [
1024
+ sender,
1025
+ recipient,
1026
+ amount,
1027
+ ]);
1028
+ return {
1029
+ context: ethCallContext,
1030
+ calldata,
1031
+ };
1032
+ } catch (e) {
1033
+ const stack = new Error().stack;
1034
+ throw transformEtherError(e, undefined, stack);
1035
+ }
1036
+ },
1037
+ transferOwnership(
1038
+ newOwner: string,
1039
+ ethCallContext: EthCallContext
1040
+ ): EthCallParam {
1041
+ try {
1042
+ const iface = new Interface(["function transferOwnership(address)"]);
1043
+ const calldata = iface.encodeFunctionData("transferOwnership", [
1044
+ newOwner,
1045
+ ]);
1046
+ return {
1047
+ context: ethCallContext,
1048
+ calldata,
1049
+ };
1050
+ } catch (e) {
1051
+ const stack = new Error().stack;
1052
+ throw transformEtherError(e, undefined, stack);
1053
+ }
1054
+ },
1055
+ };
389
1056
  }
390
1057
 
391
1058
  export class ERC20BoundContractView extends BoundContractView<
@@ -397,59 +1064,134 @@ export class ERC20BoundContractView extends BoundContractView<
397
1064
  spender: string,
398
1065
  overrides?: Overrides
399
1066
  ): Promise<bigint> {
400
- return await this.view.allowance(owner, spender, {
401
- blockTag: this.context.blockNumber,
402
- ...overrides,
403
- });
1067
+ const ethCallContext = {
1068
+ chainId: this.context.chainId,
1069
+ blockTag: "0x" + this.context.blockNumber.toString(16),
1070
+ address: this.context.address,
1071
+ };
1072
+ return await this.view.allowance(
1073
+ owner,
1074
+ spender,
1075
+ {
1076
+ blockTag: this.context.blockNumber,
1077
+ ...overrides,
1078
+ },
1079
+ this.context.preparedData,
1080
+ ethCallContext
1081
+ );
404
1082
  }
405
1083
 
406
1084
  async balanceOf(account: string, overrides?: Overrides): Promise<bigint> {
407
- return await this.view.balanceOf(account, {
408
- blockTag: this.context.blockNumber,
409
- ...overrides,
410
- });
1085
+ const ethCallContext = {
1086
+ chainId: this.context.chainId,
1087
+ blockTag: "0x" + this.context.blockNumber.toString(16),
1088
+ address: this.context.address,
1089
+ };
1090
+ return await this.view.balanceOf(
1091
+ account,
1092
+ {
1093
+ blockTag: this.context.blockNumber,
1094
+ ...overrides,
1095
+ },
1096
+ this.context.preparedData,
1097
+ ethCallContext
1098
+ );
411
1099
  }
412
1100
 
413
1101
  async decimals(overrides?: Overrides): Promise<bigint> {
414
- return await this.view.decimals({
415
- blockTag: this.context.blockNumber,
416
- ...overrides,
417
- });
1102
+ const ethCallContext = {
1103
+ chainId: this.context.chainId,
1104
+ blockTag: "0x" + this.context.blockNumber.toString(16),
1105
+ address: this.context.address,
1106
+ };
1107
+ return await this.view.decimals(
1108
+ {
1109
+ blockTag: this.context.blockNumber,
1110
+ ...overrides,
1111
+ },
1112
+ this.context.preparedData,
1113
+ ethCallContext
1114
+ );
418
1115
  }
419
1116
 
420
1117
  async locker(overrides?: Overrides): Promise<string> {
421
- return await this.view.locker({
422
- blockTag: this.context.blockNumber,
423
- ...overrides,
424
- });
1118
+ const ethCallContext = {
1119
+ chainId: this.context.chainId,
1120
+ blockTag: "0x" + this.context.blockNumber.toString(16),
1121
+ address: this.context.address,
1122
+ };
1123
+ return await this.view.locker(
1124
+ {
1125
+ blockTag: this.context.blockNumber,
1126
+ ...overrides,
1127
+ },
1128
+ this.context.preparedData,
1129
+ ethCallContext
1130
+ );
425
1131
  }
426
1132
 
427
1133
  async name(overrides?: Overrides): Promise<string> {
428
- return await this.view.name({
429
- blockTag: this.context.blockNumber,
430
- ...overrides,
431
- });
1134
+ const ethCallContext = {
1135
+ chainId: this.context.chainId,
1136
+ blockTag: "0x" + this.context.blockNumber.toString(16),
1137
+ address: this.context.address,
1138
+ };
1139
+ return await this.view.name(
1140
+ {
1141
+ blockTag: this.context.blockNumber,
1142
+ ...overrides,
1143
+ },
1144
+ this.context.preparedData,
1145
+ ethCallContext
1146
+ );
432
1147
  }
433
1148
 
434
1149
  async owner(overrides?: Overrides): Promise<string> {
435
- return await this.view.owner({
436
- blockTag: this.context.blockNumber,
437
- ...overrides,
438
- });
1150
+ const ethCallContext = {
1151
+ chainId: this.context.chainId,
1152
+ blockTag: "0x" + this.context.blockNumber.toString(16),
1153
+ address: this.context.address,
1154
+ };
1155
+ return await this.view.owner(
1156
+ {
1157
+ blockTag: this.context.blockNumber,
1158
+ ...overrides,
1159
+ },
1160
+ this.context.preparedData,
1161
+ ethCallContext
1162
+ );
439
1163
  }
440
1164
 
441
1165
  async symbol(overrides?: Overrides): Promise<string> {
442
- return await this.view.symbol({
443
- blockTag: this.context.blockNumber,
444
- ...overrides,
445
- });
1166
+ const ethCallContext = {
1167
+ chainId: this.context.chainId,
1168
+ blockTag: "0x" + this.context.blockNumber.toString(16),
1169
+ address: this.context.address,
1170
+ };
1171
+ return await this.view.symbol(
1172
+ {
1173
+ blockTag: this.context.blockNumber,
1174
+ ...overrides,
1175
+ },
1176
+ this.context.preparedData,
1177
+ ethCallContext
1178
+ );
446
1179
  }
447
1180
 
448
1181
  async totalSupply(overrides?: Overrides): Promise<bigint> {
449
- return await this.view.totalSupply({
450
- blockTag: this.context.blockNumber,
451
- ...overrides,
452
- });
1182
+ const ethCallContext = {
1183
+ chainId: this.context.chainId,
1184
+ blockTag: "0x" + this.context.blockNumber.toString(16),
1185
+ address: this.context.address,
1186
+ };
1187
+ return await this.view.totalSupply(
1188
+ {
1189
+ blockTag: this.context.blockNumber,
1190
+ ...overrides,
1191
+ },
1192
+ this.context.preparedData,
1193
+ ethCallContext
1194
+ );
453
1195
  }
454
1196
 
455
1197
  callStatic = {
@@ -461,39 +1203,78 @@ export class ERC20BoundContractView extends BoundContractView<
461
1203
  amount: BigNumberish,
462
1204
  overrides?: Overrides
463
1205
  ): Promise<boolean> {
464
- return await this.view.callStatic.approve(spender, amount, {
465
- blockTag: this.context.blockNumber,
466
- ...overrides,
467
- });
1206
+ const ethCallContext = {
1207
+ chainId: this.context.chainId,
1208
+ blockTag: "0x" + this.context.blockNumber.toString(16),
1209
+ address: this.context.address,
1210
+ };
1211
+ return await this.view.callStatic.approve(
1212
+ spender,
1213
+ amount,
1214
+ {
1215
+ blockTag: this.context.blockNumber,
1216
+ ...overrides,
1217
+ },
1218
+ this.context.preparedData,
1219
+ ethCallContext
1220
+ );
468
1221
  },
469
1222
  async burn(amount: BigNumberish, overrides?: Overrides): Promise<void> {
470
- return await this.view.callStatic.burn(amount, {
471
- blockTag: this.context.blockNumber,
472
- ...overrides,
473
- });
1223
+ const ethCallContext = {
1224
+ chainId: this.context.chainId,
1225
+ blockTag: "0x" + this.context.blockNumber.toString(16),
1226
+ address: this.context.address,
1227
+ };
1228
+ return await this.view.callStatic.burn(
1229
+ amount,
1230
+ {
1231
+ blockTag: this.context.blockNumber,
1232
+ ...overrides,
1233
+ },
1234
+ this.context.preparedData,
1235
+ ethCallContext
1236
+ );
474
1237
  },
475
1238
  async burnFrom(
476
1239
  account: string,
477
1240
  amount: BigNumberish,
478
1241
  overrides?: Overrides
479
1242
  ): Promise<void> {
480
- return await this.view.callStatic.burnFrom(account, amount, {
481
- blockTag: this.context.blockNumber,
482
- ...overrides,
483
- });
1243
+ const ethCallContext = {
1244
+ chainId: this.context.chainId,
1245
+ blockTag: "0x" + this.context.blockNumber.toString(16),
1246
+ address: this.context.address,
1247
+ };
1248
+ return await this.view.callStatic.burnFrom(
1249
+ account,
1250
+ amount,
1251
+ {
1252
+ blockTag: this.context.blockNumber,
1253
+ ...overrides,
1254
+ },
1255
+ this.context.preparedData,
1256
+ ethCallContext
1257
+ );
484
1258
  },
485
1259
  async decreaseAllowance(
486
1260
  spender: string,
487
1261
  subtractedValue: BigNumberish,
488
1262
  overrides?: Overrides
489
1263
  ): Promise<boolean> {
1264
+ const ethCallContext = {
1265
+ chainId: this.context.chainId,
1266
+ blockTag: "0x" + this.context.blockNumber.toString(16),
1267
+ address: this.context.address,
1268
+ };
490
1269
  return await this.view.callStatic.decreaseAllowance(
491
1270
  spender,
492
1271
  subtractedValue,
493
1272
  {
494
1273
  blockTag: this.context.blockNumber,
495
1274
  ...overrides,
496
- }
1275
+ },
1276
+ this.context.preparedData,
1277
+ ethCallContext
497
1278
  );
498
1279
  },
499
1280
  async increaseAllowance(
@@ -501,32 +1282,73 @@ export class ERC20BoundContractView extends BoundContractView<
501
1282
  addedValue: BigNumberish,
502
1283
  overrides?: Overrides
503
1284
  ): Promise<boolean> {
504
- return await this.view.callStatic.increaseAllowance(spender, addedValue, {
505
- blockTag: this.context.blockNumber,
506
- ...overrides,
507
- });
1285
+ const ethCallContext = {
1286
+ chainId: this.context.chainId,
1287
+ blockTag: "0x" + this.context.blockNumber.toString(16),
1288
+ address: this.context.address,
1289
+ };
1290
+ return await this.view.callStatic.increaseAllowance(
1291
+ spender,
1292
+ addedValue,
1293
+ {
1294
+ blockTag: this.context.blockNumber,
1295
+ ...overrides,
1296
+ },
1297
+ this.context.preparedData,
1298
+ ethCallContext
1299
+ );
508
1300
  },
509
1301
  async renounceOwnership(overrides?: Overrides): Promise<void> {
510
- return await this.view.callStatic.renounceOwnership({
511
- blockTag: this.context.blockNumber,
512
- ...overrides,
513
- });
1302
+ const ethCallContext = {
1303
+ chainId: this.context.chainId,
1304
+ blockTag: "0x" + this.context.blockNumber.toString(16),
1305
+ address: this.context.address,
1306
+ };
1307
+ return await this.view.callStatic.renounceOwnership(
1308
+ {
1309
+ blockTag: this.context.blockNumber,
1310
+ ...overrides,
1311
+ },
1312
+ this.context.preparedData,
1313
+ ethCallContext
1314
+ );
514
1315
  },
515
1316
  async setLocker(_locker: string, overrides?: Overrides): Promise<void> {
516
- return await this.view.callStatic.setLocker(_locker, {
517
- blockTag: this.context.blockNumber,
518
- ...overrides,
519
- });
1317
+ const ethCallContext = {
1318
+ chainId: this.context.chainId,
1319
+ blockTag: "0x" + this.context.blockNumber.toString(16),
1320
+ address: this.context.address,
1321
+ };
1322
+ return await this.view.callStatic.setLocker(
1323
+ _locker,
1324
+ {
1325
+ blockTag: this.context.blockNumber,
1326
+ ...overrides,
1327
+ },
1328
+ this.context.preparedData,
1329
+ ethCallContext
1330
+ );
520
1331
  },
521
1332
  async transfer(
522
1333
  recipient: string,
523
1334
  amount: BigNumberish,
524
1335
  overrides?: Overrides
525
1336
  ): Promise<boolean> {
526
- return await this.view.callStatic.transfer(recipient, amount, {
527
- blockTag: this.context.blockNumber,
528
- ...overrides,
529
- });
1337
+ const ethCallContext = {
1338
+ chainId: this.context.chainId,
1339
+ blockTag: "0x" + this.context.blockNumber.toString(16),
1340
+ address: this.context.address,
1341
+ };
1342
+ return await this.view.callStatic.transfer(
1343
+ recipient,
1344
+ amount,
1345
+ {
1346
+ blockTag: this.context.blockNumber,
1347
+ ...overrides,
1348
+ },
1349
+ this.context.preparedData,
1350
+ ethCallContext
1351
+ );
530
1352
  },
531
1353
  async transferFrom(
532
1354
  sender: string,
@@ -534,6 +1356,11 @@ export class ERC20BoundContractView extends BoundContractView<
534
1356
  amount: BigNumberish,
535
1357
  overrides?: Overrides
536
1358
  ): Promise<boolean> {
1359
+ const ethCallContext = {
1360
+ chainId: this.context.chainId,
1361
+ blockTag: "0x" + this.context.blockNumber.toString(16),
1362
+ address: this.context.address,
1363
+ };
537
1364
  return await this.view.callStatic.transferFrom(
538
1365
  sender,
539
1366
  recipient,
@@ -541,16 +1368,359 @@ export class ERC20BoundContractView extends BoundContractView<
541
1368
  {
542
1369
  blockTag: this.context.blockNumber,
543
1370
  ...overrides,
544
- }
1371
+ },
1372
+ this.context.preparedData,
1373
+ ethCallContext
545
1374
  );
546
1375
  },
547
1376
  async transferOwnership(
548
1377
  newOwner: string,
549
1378
  overrides?: Overrides
550
1379
  ): Promise<void> {
551
- return await this.view.callStatic.transferOwnership(newOwner, {
552
- blockTag: this.context.blockNumber,
553
- ...overrides,
1380
+ const ethCallContext = {
1381
+ chainId: this.context.chainId,
1382
+ blockTag: "0x" + this.context.blockNumber.toString(16),
1383
+ address: this.context.address,
1384
+ };
1385
+ return await this.view.callStatic.transferOwnership(
1386
+ newOwner,
1387
+ {
1388
+ blockTag: this.context.blockNumber,
1389
+ ...overrides,
1390
+ },
1391
+ this.context.preparedData,
1392
+ ethCallContext
1393
+ );
1394
+ },
1395
+ };
1396
+
1397
+ encodeCall = {
1398
+ view: this.view,
1399
+ context: this.context,
1400
+
1401
+ allowance(
1402
+ owner: string,
1403
+ spender: string,
1404
+ overrides?: Overrides
1405
+ ): EthCallParam {
1406
+ const chainId =
1407
+ overrides?.chainId?.toString() ?? this.context.chainId.toString();
1408
+ const address = this.context.address;
1409
+ let blockTag = "0x" + this.context.blockNumber.toString(16);
1410
+ if (overrides?.blockTag) {
1411
+ blockTag =
1412
+ typeof overrides.blockTag == "string"
1413
+ ? overrides.blockTag
1414
+ : "0x" + overrides.blockTag.toString(16);
1415
+ }
1416
+
1417
+ return this.view.encodeCall.allowance(owner, spender, {
1418
+ chainId,
1419
+ address,
1420
+ blockTag,
1421
+ });
1422
+ },
1423
+ approve(
1424
+ spender: string,
1425
+ amount: BigNumberish,
1426
+ overrides?: Overrides
1427
+ ): EthCallParam {
1428
+ const chainId =
1429
+ overrides?.chainId?.toString() ?? this.context.chainId.toString();
1430
+ const address = this.context.address;
1431
+ let blockTag = "0x" + this.context.blockNumber.toString(16);
1432
+ if (overrides?.blockTag) {
1433
+ blockTag =
1434
+ typeof overrides.blockTag == "string"
1435
+ ? overrides.blockTag
1436
+ : "0x" + overrides.blockTag.toString(16);
1437
+ }
1438
+
1439
+ return this.view.encodeCall.approve(spender, amount, {
1440
+ chainId,
1441
+ address,
1442
+ blockTag,
1443
+ });
1444
+ },
1445
+ balanceOf(account: string, overrides?: Overrides): EthCallParam {
1446
+ const chainId =
1447
+ overrides?.chainId?.toString() ?? this.context.chainId.toString();
1448
+ const address = this.context.address;
1449
+ let blockTag = "0x" + this.context.blockNumber.toString(16);
1450
+ if (overrides?.blockTag) {
1451
+ blockTag =
1452
+ typeof overrides.blockTag == "string"
1453
+ ? overrides.blockTag
1454
+ : "0x" + overrides.blockTag.toString(16);
1455
+ }
1456
+
1457
+ return this.view.encodeCall.balanceOf(account, {
1458
+ chainId,
1459
+ address,
1460
+ blockTag,
1461
+ });
1462
+ },
1463
+ burn(amount: BigNumberish, overrides?: Overrides): EthCallParam {
1464
+ const chainId =
1465
+ overrides?.chainId?.toString() ?? this.context.chainId.toString();
1466
+ const address = this.context.address;
1467
+ let blockTag = "0x" + this.context.blockNumber.toString(16);
1468
+ if (overrides?.blockTag) {
1469
+ blockTag =
1470
+ typeof overrides.blockTag == "string"
1471
+ ? overrides.blockTag
1472
+ : "0x" + overrides.blockTag.toString(16);
1473
+ }
1474
+
1475
+ return this.view.encodeCall.burn(amount, { chainId, address, blockTag });
1476
+ },
1477
+ burnFrom(
1478
+ account: string,
1479
+ amount: BigNumberish,
1480
+ overrides?: Overrides
1481
+ ): EthCallParam {
1482
+ const chainId =
1483
+ overrides?.chainId?.toString() ?? this.context.chainId.toString();
1484
+ const address = this.context.address;
1485
+ let blockTag = "0x" + this.context.blockNumber.toString(16);
1486
+ if (overrides?.blockTag) {
1487
+ blockTag =
1488
+ typeof overrides.blockTag == "string"
1489
+ ? overrides.blockTag
1490
+ : "0x" + overrides.blockTag.toString(16);
1491
+ }
1492
+
1493
+ return this.view.encodeCall.burnFrom(account, amount, {
1494
+ chainId,
1495
+ address,
1496
+ blockTag,
1497
+ });
1498
+ },
1499
+ decimals(overrides?: Overrides): EthCallParam {
1500
+ const chainId =
1501
+ overrides?.chainId?.toString() ?? this.context.chainId.toString();
1502
+ const address = this.context.address;
1503
+ let blockTag = "0x" + this.context.blockNumber.toString(16);
1504
+ if (overrides?.blockTag) {
1505
+ blockTag =
1506
+ typeof overrides.blockTag == "string"
1507
+ ? overrides.blockTag
1508
+ : "0x" + overrides.blockTag.toString(16);
1509
+ }
1510
+
1511
+ return this.view.encodeCall.decimals({ chainId, address, blockTag });
1512
+ },
1513
+ decreaseAllowance(
1514
+ spender: string,
1515
+ subtractedValue: BigNumberish,
1516
+ overrides?: Overrides
1517
+ ): EthCallParam {
1518
+ const chainId =
1519
+ overrides?.chainId?.toString() ?? this.context.chainId.toString();
1520
+ const address = this.context.address;
1521
+ let blockTag = "0x" + this.context.blockNumber.toString(16);
1522
+ if (overrides?.blockTag) {
1523
+ blockTag =
1524
+ typeof overrides.blockTag == "string"
1525
+ ? overrides.blockTag
1526
+ : "0x" + overrides.blockTag.toString(16);
1527
+ }
1528
+
1529
+ return this.view.encodeCall.decreaseAllowance(spender, subtractedValue, {
1530
+ chainId,
1531
+ address,
1532
+ blockTag,
1533
+ });
1534
+ },
1535
+ increaseAllowance(
1536
+ spender: string,
1537
+ addedValue: BigNumberish,
1538
+ overrides?: Overrides
1539
+ ): EthCallParam {
1540
+ const chainId =
1541
+ overrides?.chainId?.toString() ?? this.context.chainId.toString();
1542
+ const address = this.context.address;
1543
+ let blockTag = "0x" + this.context.blockNumber.toString(16);
1544
+ if (overrides?.blockTag) {
1545
+ blockTag =
1546
+ typeof overrides.blockTag == "string"
1547
+ ? overrides.blockTag
1548
+ : "0x" + overrides.blockTag.toString(16);
1549
+ }
1550
+
1551
+ return this.view.encodeCall.increaseAllowance(spender, addedValue, {
1552
+ chainId,
1553
+ address,
1554
+ blockTag,
1555
+ });
1556
+ },
1557
+ locker(overrides?: Overrides): EthCallParam {
1558
+ const chainId =
1559
+ overrides?.chainId?.toString() ?? this.context.chainId.toString();
1560
+ const address = this.context.address;
1561
+ let blockTag = "0x" + this.context.blockNumber.toString(16);
1562
+ if (overrides?.blockTag) {
1563
+ blockTag =
1564
+ typeof overrides.blockTag == "string"
1565
+ ? overrides.blockTag
1566
+ : "0x" + overrides.blockTag.toString(16);
1567
+ }
1568
+
1569
+ return this.view.encodeCall.locker({ chainId, address, blockTag });
1570
+ },
1571
+ name(overrides?: Overrides): EthCallParam {
1572
+ const chainId =
1573
+ overrides?.chainId?.toString() ?? this.context.chainId.toString();
1574
+ const address = this.context.address;
1575
+ let blockTag = "0x" + this.context.blockNumber.toString(16);
1576
+ if (overrides?.blockTag) {
1577
+ blockTag =
1578
+ typeof overrides.blockTag == "string"
1579
+ ? overrides.blockTag
1580
+ : "0x" + overrides.blockTag.toString(16);
1581
+ }
1582
+
1583
+ return this.view.encodeCall.name({ chainId, address, blockTag });
1584
+ },
1585
+ owner(overrides?: Overrides): EthCallParam {
1586
+ const chainId =
1587
+ overrides?.chainId?.toString() ?? this.context.chainId.toString();
1588
+ const address = this.context.address;
1589
+ let blockTag = "0x" + this.context.blockNumber.toString(16);
1590
+ if (overrides?.blockTag) {
1591
+ blockTag =
1592
+ typeof overrides.blockTag == "string"
1593
+ ? overrides.blockTag
1594
+ : "0x" + overrides.blockTag.toString(16);
1595
+ }
1596
+
1597
+ return this.view.encodeCall.owner({ chainId, address, blockTag });
1598
+ },
1599
+ renounceOwnership(overrides?: Overrides): EthCallParam {
1600
+ const chainId =
1601
+ overrides?.chainId?.toString() ?? this.context.chainId.toString();
1602
+ const address = this.context.address;
1603
+ let blockTag = "0x" + this.context.blockNumber.toString(16);
1604
+ if (overrides?.blockTag) {
1605
+ blockTag =
1606
+ typeof overrides.blockTag == "string"
1607
+ ? overrides.blockTag
1608
+ : "0x" + overrides.blockTag.toString(16);
1609
+ }
1610
+
1611
+ return this.view.encodeCall.renounceOwnership({
1612
+ chainId,
1613
+ address,
1614
+ blockTag,
1615
+ });
1616
+ },
1617
+ setLocker(_locker: string, overrides?: Overrides): EthCallParam {
1618
+ const chainId =
1619
+ overrides?.chainId?.toString() ?? this.context.chainId.toString();
1620
+ const address = this.context.address;
1621
+ let blockTag = "0x" + this.context.blockNumber.toString(16);
1622
+ if (overrides?.blockTag) {
1623
+ blockTag =
1624
+ typeof overrides.blockTag == "string"
1625
+ ? overrides.blockTag
1626
+ : "0x" + overrides.blockTag.toString(16);
1627
+ }
1628
+
1629
+ return this.view.encodeCall.setLocker(_locker, {
1630
+ chainId,
1631
+ address,
1632
+ blockTag,
1633
+ });
1634
+ },
1635
+ symbol(overrides?: Overrides): EthCallParam {
1636
+ const chainId =
1637
+ overrides?.chainId?.toString() ?? this.context.chainId.toString();
1638
+ const address = this.context.address;
1639
+ let blockTag = "0x" + this.context.blockNumber.toString(16);
1640
+ if (overrides?.blockTag) {
1641
+ blockTag =
1642
+ typeof overrides.blockTag == "string"
1643
+ ? overrides.blockTag
1644
+ : "0x" + overrides.blockTag.toString(16);
1645
+ }
1646
+
1647
+ return this.view.encodeCall.symbol({ chainId, address, blockTag });
1648
+ },
1649
+ totalSupply(overrides?: Overrides): EthCallParam {
1650
+ const chainId =
1651
+ overrides?.chainId?.toString() ?? this.context.chainId.toString();
1652
+ const address = this.context.address;
1653
+ let blockTag = "0x" + this.context.blockNumber.toString(16);
1654
+ if (overrides?.blockTag) {
1655
+ blockTag =
1656
+ typeof overrides.blockTag == "string"
1657
+ ? overrides.blockTag
1658
+ : "0x" + overrides.blockTag.toString(16);
1659
+ }
1660
+
1661
+ return this.view.encodeCall.totalSupply({ chainId, address, blockTag });
1662
+ },
1663
+ transfer(
1664
+ recipient: string,
1665
+ amount: BigNumberish,
1666
+ overrides?: Overrides
1667
+ ): EthCallParam {
1668
+ const chainId =
1669
+ overrides?.chainId?.toString() ?? this.context.chainId.toString();
1670
+ const address = this.context.address;
1671
+ let blockTag = "0x" + this.context.blockNumber.toString(16);
1672
+ if (overrides?.blockTag) {
1673
+ blockTag =
1674
+ typeof overrides.blockTag == "string"
1675
+ ? overrides.blockTag
1676
+ : "0x" + overrides.blockTag.toString(16);
1677
+ }
1678
+
1679
+ return this.view.encodeCall.transfer(recipient, amount, {
1680
+ chainId,
1681
+ address,
1682
+ blockTag,
1683
+ });
1684
+ },
1685
+ transferFrom(
1686
+ sender: string,
1687
+ recipient: string,
1688
+ amount: BigNumberish,
1689
+ overrides?: Overrides
1690
+ ): EthCallParam {
1691
+ const chainId =
1692
+ overrides?.chainId?.toString() ?? this.context.chainId.toString();
1693
+ const address = this.context.address;
1694
+ let blockTag = "0x" + this.context.blockNumber.toString(16);
1695
+ if (overrides?.blockTag) {
1696
+ blockTag =
1697
+ typeof overrides.blockTag == "string"
1698
+ ? overrides.blockTag
1699
+ : "0x" + overrides.blockTag.toString(16);
1700
+ }
1701
+
1702
+ return this.view.encodeCall.transferFrom(sender, recipient, amount, {
1703
+ chainId,
1704
+ address,
1705
+ blockTag,
1706
+ });
1707
+ },
1708
+ transferOwnership(newOwner: string, overrides?: Overrides): EthCallParam {
1709
+ const chainId =
1710
+ overrides?.chainId?.toString() ?? this.context.chainId.toString();
1711
+ const address = this.context.address;
1712
+ let blockTag = "0x" + this.context.blockNumber.toString(16);
1713
+ if (overrides?.blockTag) {
1714
+ blockTag =
1715
+ typeof overrides.blockTag == "string"
1716
+ ? overrides.blockTag
1717
+ : "0x" + overrides.blockTag.toString(16);
1718
+ }
1719
+
1720
+ return this.view.encodeCall.transferOwnership(newOwner, {
1721
+ chainId,
1722
+ address,
1723
+ blockTag,
554
1724
  });
555
1725
  },
556
1726
  };
@@ -568,7 +1738,8 @@ export class ERC20Processor extends BaseProcessor<
568
1738
  fetchConfig?: Partial<EthFetchConfig>,
569
1739
  preprocessHandler?: (
570
1740
  event: ApprovalEvent,
571
- ctx: ERC20Context
1741
+ ctx: ERC20Context,
1742
+ preprocessStore: { [k: string]: any }
572
1743
  ) => Promise<PreprocessResult>
573
1744
  ): this {
574
1745
  if (!filter) {
@@ -589,7 +1760,8 @@ export class ERC20Processor extends BaseProcessor<
589
1760
  fetchConfig?: Partial<EthFetchConfig>,
590
1761
  preprocessHandler?: (
591
1762
  event: OwnershipTransferredEvent,
592
- ctx: ERC20Context
1763
+ ctx: ERC20Context,
1764
+ preprocessStore: { [k: string]: any }
593
1765
  ) => Promise<PreprocessResult>
594
1766
  ): this {
595
1767
  if (!filter) {
@@ -606,7 +1778,8 @@ export class ERC20Processor extends BaseProcessor<
606
1778
  fetchConfig?: Partial<EthFetchConfig>,
607
1779
  preprocessHandler?: (
608
1780
  event: TransferEvent,
609
- ctx: ERC20Context
1781
+ ctx: ERC20Context,
1782
+ preprocessStore: { [k: string]: any }
610
1783
  ) => Promise<PreprocessResult>
611
1784
  ): this {
612
1785
  if (!filter) {
@@ -981,7 +2154,8 @@ export class ERC20ProcessorTemplate extends BaseProcessorTemplate<
981
2154
  fetchConfig?: Partial<EthFetchConfig>,
982
2155
  preprocessHandler?: (
983
2156
  event: ApprovalEvent,
984
- ctx: ERC20Context
2157
+ ctx: ERC20Context,
2158
+ preprocessStore: { [k: string]: any }
985
2159
  ) => Promise<PreprocessResult>
986
2160
  ): this {
987
2161
  if (!filter) {
@@ -1002,7 +2176,8 @@ export class ERC20ProcessorTemplate extends BaseProcessorTemplate<
1002
2176
  fetchConfig?: Partial<EthFetchConfig>,
1003
2177
  preprocessHandler?: (
1004
2178
  event: OwnershipTransferredEvent,
1005
- ctx: ERC20Context
2179
+ ctx: ERC20Context,
2180
+ preprocessStore: { [k: string]: any }
1006
2181
  ) => Promise<PreprocessResult>
1007
2182
  ): this {
1008
2183
  if (!filter) {
@@ -1019,7 +2194,8 @@ export class ERC20ProcessorTemplate extends BaseProcessorTemplate<
1019
2194
  fetchConfig?: Partial<EthFetchConfig>,
1020
2195
  preprocessHandler?: (
1021
2196
  event: TransferEvent,
1022
- ctx: ERC20Context
2197
+ ctx: ERC20Context,
2198
+ preprocessStore: { [k: string]: any }
1023
2199
  ) => Promise<PreprocessResult>
1024
2200
  ): this {
1025
2201
  if (!filter) {