@sentio/sdk 2.40.1-rc.2 → 2.40.1-rc.4
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.
- package/lib/eth/builtin/internal/eacaggregatorproxy-processor.d.ts.map +1 -1
- package/lib/eth/builtin/internal/eacaggregatorproxy-processor.js +25 -69
- package/lib/eth/builtin/internal/eacaggregatorproxy-processor.js.map +1 -1
- package/lib/eth/builtin/internal/erc1155-processor.d.ts.map +1 -1
- package/lib/eth/builtin/internal/erc1155-processor.js +10 -24
- package/lib/eth/builtin/internal/erc1155-processor.js.map +1 -1
- package/lib/eth/builtin/internal/erc20-processor.d.ts.map +1 -1
- package/lib/eth/builtin/internal/erc20-processor.js +20 -52
- package/lib/eth/builtin/internal/erc20-processor.js.map +1 -1
- package/lib/eth/builtin/internal/erc20bytes-processor.d.ts.map +1 -1
- package/lib/eth/builtin/internal/erc20bytes-processor.js +11 -25
- package/lib/eth/builtin/internal/erc20bytes-processor.js.map +1 -1
- package/lib/eth/builtin/internal/erc721-processor.d.ts.map +1 -1
- package/lib/eth/builtin/internal/erc721-processor.js +16 -40
- package/lib/eth/builtin/internal/erc721-processor.js.map +1 -1
- package/lib/eth/builtin/internal/weth9-processor.d.ts.map +1 -1
- package/lib/eth/builtin/internal/weth9-processor.js +13 -31
- package/lib/eth/builtin/internal/weth9-processor.js.map +1 -1
- package/lib/eth/codegen/file.d.ts.map +1 -1
- package/lib/eth/codegen/file.js +5 -1
- package/lib/eth/codegen/file.js.map +1 -1
- package/lib/eth/codegen/function-calls.d.ts +1 -0
- package/lib/eth/codegen/function-calls.d.ts.map +1 -1
- package/lib/eth/codegen/function-calls.js +3 -1
- package/lib/eth/codegen/function-calls.js.map +1 -1
- package/lib/eth/codegen/types.d.ts.map +1 -1
- package/lib/eth/codegen/types.js +23 -6
- package/lib/eth/codegen/types.js.map +1 -1
- package/lib/store/cache.d.ts +0 -3
- package/lib/store/cache.d.ts.map +1 -1
- package/lib/store/cache.js.map +1 -1
- package/lib/store/codegen.d.ts.map +1 -1
- package/lib/store/codegen.js +51 -34
- package/lib/store/codegen.js.map +1 -1
- package/lib/store/store.d.ts +3 -3
- package/lib/store/store.d.ts.map +1 -1
- package/lib/store/store.js +2 -2
- package/lib/store/store.js.map +1 -1
- package/lib/store/types.d.ts +6 -0
- package/lib/store/types.d.ts.map +1 -1
- package/lib/store/types.js +49 -1
- package/lib/store/types.js.map +1 -1
- package/package.json +3 -3
- package/src/eth/builtin/internal/eacaggregatorproxy-processor.ts +26 -69
- package/src/eth/builtin/internal/erc1155-processor.ts +11 -24
- package/src/eth/builtin/internal/erc20-processor.ts +21 -52
- package/src/eth/builtin/internal/erc20bytes-processor.ts +12 -25
- package/src/eth/builtin/internal/erc721-processor.ts +17 -40
- package/src/eth/builtin/internal/weth9-processor.ts +14 -31
- package/src/eth/codegen/file.ts +5 -0
- package/src/eth/codegen/function-calls.ts +4 -1
- package/src/eth/codegen/types.ts +29 -7
- package/src/store/cache.ts +0 -4
- package/src/store/codegen.ts +53 -34
- package/src/store/store.ts +5 -5
- package/src/store/types.ts +57 -0
@@ -193,6 +193,32 @@ const templateContract = EACAggregatorProxy__factory.connect(
|
|
193
193
|
DummyProvider
|
194
194
|
);
|
195
195
|
|
196
|
+
const iface = new Interface([
|
197
|
+
"function acceptOwnership() nonpayable returns ()",
|
198
|
+
"function accessController() view returns (address)",
|
199
|
+
"function aggregator() view returns (address)",
|
200
|
+
"function confirmAggregator(address _aggregator) nonpayable returns ()",
|
201
|
+
"function decimals() view returns (uint8)",
|
202
|
+
"function description() view returns (string)",
|
203
|
+
"function getAnswer(uint256 _roundId) view returns (int256)",
|
204
|
+
"function getRoundData(uint80 _roundId) view returns (uint80 roundId, int256 answer, uint256 startedAt, uint256 updatedAt, uint80 answeredInRound)",
|
205
|
+
"function getTimestamp(uint256 _roundId) view returns (uint256)",
|
206
|
+
"function latestAnswer() view returns (int256)",
|
207
|
+
"function latestRound() view returns (uint256)",
|
208
|
+
"function latestRoundData() view returns (uint80 roundId, int256 answer, uint256 startedAt, uint256 updatedAt, uint80 answeredInRound)",
|
209
|
+
"function latestTimestamp() view returns (uint256)",
|
210
|
+
"function owner() view returns (address)",
|
211
|
+
"function phaseAggregators(uint16) view returns (address)",
|
212
|
+
"function phaseId() view returns (uint16)",
|
213
|
+
"function proposeAggregator(address _aggregator) nonpayable returns ()",
|
214
|
+
"function proposedAggregator() view returns (address)",
|
215
|
+
"function proposedGetRoundData(uint80 _roundId) view returns (uint80 roundId, int256 answer, uint256 startedAt, uint256 updatedAt, uint80 answeredInRound)",
|
216
|
+
"function proposedLatestRoundData() view returns (uint80 roundId, int256 answer, uint256 startedAt, uint256 updatedAt, uint80 answeredInRound)",
|
217
|
+
"function setController(address _accessController) nonpayable returns ()",
|
218
|
+
"function transferOwnership(address _to) nonpayable returns ()",
|
219
|
+
"function version() view returns (uint256)",
|
220
|
+
]);
|
221
|
+
|
196
222
|
export class EACAggregatorProxyContractView extends ContractView<EACAggregatorProxy> {
|
197
223
|
constructor(contract: EACAggregatorProxy) {
|
198
224
|
super(contract);
|
@@ -206,9 +232,6 @@ export class EACAggregatorProxyContractView extends ContractView<EACAggregatorPr
|
|
206
232
|
): Promise<string> {
|
207
233
|
try {
|
208
234
|
if (preparedData?.ethCallResults && ethCallContext) {
|
209
|
-
const iface = new Interface([
|
210
|
-
"function accessController() view returns (address)",
|
211
|
-
]);
|
212
235
|
const calldata = iface.encodeFunctionData("accessController", []);
|
213
236
|
const ethCallKey = makeEthCallKey({
|
214
237
|
context: ethCallContext,
|
@@ -238,9 +261,6 @@ export class EACAggregatorProxyContractView extends ContractView<EACAggregatorPr
|
|
238
261
|
): Promise<string> {
|
239
262
|
try {
|
240
263
|
if (preparedData?.ethCallResults && ethCallContext) {
|
241
|
-
const iface = new Interface([
|
242
|
-
"function aggregator() view returns (address)",
|
243
|
-
]);
|
244
264
|
const calldata = iface.encodeFunctionData("aggregator", []);
|
245
265
|
const ethCallKey = makeEthCallKey({
|
246
266
|
context: ethCallContext,
|
@@ -268,9 +288,6 @@ export class EACAggregatorProxyContractView extends ContractView<EACAggregatorPr
|
|
268
288
|
): Promise<bigint> {
|
269
289
|
try {
|
270
290
|
if (preparedData?.ethCallResults && ethCallContext) {
|
271
|
-
const iface = new Interface([
|
272
|
-
"function decimals() view returns (uint8)",
|
273
|
-
]);
|
274
291
|
const calldata = iface.encodeFunctionData("decimals", []);
|
275
292
|
const ethCallKey = makeEthCallKey({
|
276
293
|
context: ethCallContext,
|
@@ -296,9 +313,6 @@ export class EACAggregatorProxyContractView extends ContractView<EACAggregatorPr
|
|
296
313
|
): Promise<string> {
|
297
314
|
try {
|
298
315
|
if (preparedData?.ethCallResults && ethCallContext) {
|
299
|
-
const iface = new Interface([
|
300
|
-
"function description() view returns (string)",
|
301
|
-
]);
|
302
316
|
const calldata = iface.encodeFunctionData("description", []);
|
303
317
|
const ethCallKey = makeEthCallKey({
|
304
318
|
context: ethCallContext,
|
@@ -327,9 +341,6 @@ export class EACAggregatorProxyContractView extends ContractView<EACAggregatorPr
|
|
327
341
|
): Promise<bigint> {
|
328
342
|
try {
|
329
343
|
if (preparedData?.ethCallResults && ethCallContext) {
|
330
|
-
const iface = new Interface([
|
331
|
-
"function getAnswer(uint256) view returns (int256)",
|
332
|
-
]);
|
333
344
|
const calldata = iface.encodeFunctionData("getAnswer", [_roundId]);
|
334
345
|
const ethCallKey = makeEthCallKey({
|
335
346
|
context: ethCallContext,
|
@@ -367,9 +378,6 @@ export class EACAggregatorProxyContractView extends ContractView<EACAggregatorPr
|
|
367
378
|
> {
|
368
379
|
try {
|
369
380
|
if (preparedData?.ethCallResults && ethCallContext) {
|
370
|
-
const iface = new Interface([
|
371
|
-
"function getRoundData(uint80) view returns (uint80,int256,uint256,uint256,uint80)",
|
372
|
-
]);
|
373
381
|
const calldata = iface.encodeFunctionData("getRoundData", [_roundId]);
|
374
382
|
const ethCallKey = makeEthCallKey({
|
375
383
|
context: ethCallContext,
|
@@ -401,9 +409,6 @@ export class EACAggregatorProxyContractView extends ContractView<EACAggregatorPr
|
|
401
409
|
): Promise<bigint> {
|
402
410
|
try {
|
403
411
|
if (preparedData?.ethCallResults && ethCallContext) {
|
404
|
-
const iface = new Interface([
|
405
|
-
"function getTimestamp(uint256) view returns (uint256)",
|
406
|
-
]);
|
407
412
|
const calldata = iface.encodeFunctionData("getTimestamp", [_roundId]);
|
408
413
|
const ethCallKey = makeEthCallKey({
|
409
414
|
context: ethCallContext,
|
@@ -434,9 +439,6 @@ export class EACAggregatorProxyContractView extends ContractView<EACAggregatorPr
|
|
434
439
|
): Promise<bigint> {
|
435
440
|
try {
|
436
441
|
if (preparedData?.ethCallResults && ethCallContext) {
|
437
|
-
const iface = new Interface([
|
438
|
-
"function latestAnswer() view returns (int256)",
|
439
|
-
]);
|
440
442
|
const calldata = iface.encodeFunctionData("latestAnswer", []);
|
441
443
|
const ethCallKey = makeEthCallKey({
|
442
444
|
context: ethCallContext,
|
@@ -464,9 +466,6 @@ export class EACAggregatorProxyContractView extends ContractView<EACAggregatorPr
|
|
464
466
|
): Promise<bigint> {
|
465
467
|
try {
|
466
468
|
if (preparedData?.ethCallResults && ethCallContext) {
|
467
|
-
const iface = new Interface([
|
468
|
-
"function latestRound() view returns (uint256)",
|
469
|
-
]);
|
470
469
|
const calldata = iface.encodeFunctionData("latestRound", []);
|
471
470
|
const ethCallKey = makeEthCallKey({
|
472
471
|
context: ethCallContext,
|
@@ -502,9 +501,6 @@ export class EACAggregatorProxyContractView extends ContractView<EACAggregatorPr
|
|
502
501
|
> {
|
503
502
|
try {
|
504
503
|
if (preparedData?.ethCallResults && ethCallContext) {
|
505
|
-
const iface = new Interface([
|
506
|
-
"function latestRoundData() view returns (uint80,int256,uint256,uint256,uint80)",
|
507
|
-
]);
|
508
504
|
const calldata = iface.encodeFunctionData("latestRoundData", []);
|
509
505
|
const ethCallKey = makeEthCallKey({
|
510
506
|
context: ethCallContext,
|
@@ -534,9 +530,6 @@ export class EACAggregatorProxyContractView extends ContractView<EACAggregatorPr
|
|
534
530
|
): Promise<bigint> {
|
535
531
|
try {
|
536
532
|
if (preparedData?.ethCallResults && ethCallContext) {
|
537
|
-
const iface = new Interface([
|
538
|
-
"function latestTimestamp() view returns (uint256)",
|
539
|
-
]);
|
540
533
|
const calldata = iface.encodeFunctionData("latestTimestamp", []);
|
541
534
|
const ethCallKey = makeEthCallKey({
|
542
535
|
context: ethCallContext,
|
@@ -566,9 +559,6 @@ export class EACAggregatorProxyContractView extends ContractView<EACAggregatorPr
|
|
566
559
|
): Promise<string> {
|
567
560
|
try {
|
568
561
|
if (preparedData?.ethCallResults && ethCallContext) {
|
569
|
-
const iface = new Interface([
|
570
|
-
"function owner() view returns (address)",
|
571
|
-
]);
|
572
562
|
const calldata = iface.encodeFunctionData("owner", []);
|
573
563
|
const ethCallKey = makeEthCallKey({
|
574
564
|
context: ethCallContext,
|
@@ -595,9 +585,6 @@ export class EACAggregatorProxyContractView extends ContractView<EACAggregatorPr
|
|
595
585
|
): Promise<string> {
|
596
586
|
try {
|
597
587
|
if (preparedData?.ethCallResults && ethCallContext) {
|
598
|
-
const iface = new Interface([
|
599
|
-
"function phaseAggregators(uint16) view returns (address)",
|
600
|
-
]);
|
601
588
|
const calldata = iface.encodeFunctionData("phaseAggregators", [arg0]);
|
602
589
|
const ethCallKey = makeEthCallKey({
|
603
590
|
context: ethCallContext,
|
@@ -628,9 +615,6 @@ export class EACAggregatorProxyContractView extends ContractView<EACAggregatorPr
|
|
628
615
|
): Promise<bigint> {
|
629
616
|
try {
|
630
617
|
if (preparedData?.ethCallResults && ethCallContext) {
|
631
|
-
const iface = new Interface([
|
632
|
-
"function phaseId() view returns (uint16)",
|
633
|
-
]);
|
634
618
|
const calldata = iface.encodeFunctionData("phaseId", []);
|
635
619
|
const ethCallKey = makeEthCallKey({
|
636
620
|
context: ethCallContext,
|
@@ -656,9 +640,6 @@ export class EACAggregatorProxyContractView extends ContractView<EACAggregatorPr
|
|
656
640
|
): Promise<string> {
|
657
641
|
try {
|
658
642
|
if (preparedData?.ethCallResults && ethCallContext) {
|
659
|
-
const iface = new Interface([
|
660
|
-
"function proposedAggregator() view returns (address)",
|
661
|
-
]);
|
662
643
|
const calldata = iface.encodeFunctionData("proposedAggregator", []);
|
663
644
|
const ethCallKey = makeEthCallKey({
|
664
645
|
context: ethCallContext,
|
@@ -697,9 +678,6 @@ export class EACAggregatorProxyContractView extends ContractView<EACAggregatorPr
|
|
697
678
|
> {
|
698
679
|
try {
|
699
680
|
if (preparedData?.ethCallResults && ethCallContext) {
|
700
|
-
const iface = new Interface([
|
701
|
-
"function proposedGetRoundData(uint80) view returns (uint80,int256,uint256,uint256,uint80)",
|
702
|
-
]);
|
703
681
|
const calldata = iface.encodeFunctionData("proposedGetRoundData", [
|
704
682
|
_roundId,
|
705
683
|
]);
|
@@ -740,9 +718,6 @@ export class EACAggregatorProxyContractView extends ContractView<EACAggregatorPr
|
|
740
718
|
> {
|
741
719
|
try {
|
742
720
|
if (preparedData?.ethCallResults && ethCallContext) {
|
743
|
-
const iface = new Interface([
|
744
|
-
"function proposedLatestRoundData() view returns (uint80,int256,uint256,uint256,uint80)",
|
745
|
-
]);
|
746
721
|
const calldata = iface.encodeFunctionData(
|
747
722
|
"proposedLatestRoundData",
|
748
723
|
[]
|
@@ -775,9 +750,6 @@ export class EACAggregatorProxyContractView extends ContractView<EACAggregatorPr
|
|
775
750
|
): Promise<bigint> {
|
776
751
|
try {
|
777
752
|
if (preparedData?.ethCallResults && ethCallContext) {
|
778
|
-
const iface = new Interface([
|
779
|
-
"function version() view returns (uint256)",
|
780
|
-
]);
|
781
753
|
const calldata = iface.encodeFunctionData("version", []);
|
782
754
|
const ethCallKey = makeEthCallKey({
|
783
755
|
context: ethCallContext,
|
@@ -806,9 +778,6 @@ export class EACAggregatorProxyContractView extends ContractView<EACAggregatorPr
|
|
806
778
|
): Promise<void> {
|
807
779
|
try {
|
808
780
|
if (preparedData?.ethCallResults && ethCallContext) {
|
809
|
-
const iface = new Interface([
|
810
|
-
"function acceptOwnership() nonpayable returns ()",
|
811
|
-
]);
|
812
781
|
const calldata = iface.encodeFunctionData("acceptOwnership", []);
|
813
782
|
const ethCallKey = makeEthCallKey({
|
814
783
|
context: ethCallContext,
|
@@ -838,9 +807,6 @@ export class EACAggregatorProxyContractView extends ContractView<EACAggregatorPr
|
|
838
807
|
): Promise<void> {
|
839
808
|
try {
|
840
809
|
if (preparedData?.ethCallResults && ethCallContext) {
|
841
|
-
const iface = new Interface([
|
842
|
-
"function confirmAggregator(address) nonpayable returns ()",
|
843
|
-
]);
|
844
810
|
const calldata = iface.encodeFunctionData("confirmAggregator", [
|
845
811
|
_aggregator,
|
846
812
|
]);
|
@@ -872,9 +838,6 @@ export class EACAggregatorProxyContractView extends ContractView<EACAggregatorPr
|
|
872
838
|
): Promise<void> {
|
873
839
|
try {
|
874
840
|
if (preparedData?.ethCallResults && ethCallContext) {
|
875
|
-
const iface = new Interface([
|
876
|
-
"function proposeAggregator(address) nonpayable returns ()",
|
877
|
-
]);
|
878
841
|
const calldata = iface.encodeFunctionData("proposeAggregator", [
|
879
842
|
_aggregator,
|
880
843
|
]);
|
@@ -906,9 +869,6 @@ export class EACAggregatorProxyContractView extends ContractView<EACAggregatorPr
|
|
906
869
|
): Promise<void> {
|
907
870
|
try {
|
908
871
|
if (preparedData?.ethCallResults && ethCallContext) {
|
909
|
-
const iface = new Interface([
|
910
|
-
"function setController(address) nonpayable returns ()",
|
911
|
-
]);
|
912
872
|
const calldata = iface.encodeFunctionData("setController", [
|
913
873
|
_accessController,
|
914
874
|
]);
|
@@ -940,9 +900,6 @@ export class EACAggregatorProxyContractView extends ContractView<EACAggregatorPr
|
|
940
900
|
): Promise<void> {
|
941
901
|
try {
|
942
902
|
if (preparedData?.ethCallResults && ethCallContext) {
|
943
|
-
const iface = new Interface([
|
944
|
-
"function transferOwnership(address) nonpayable returns ()",
|
945
|
-
]);
|
946
903
|
const calldata = iface.encodeFunctionData("transferOwnership", [_to]);
|
947
904
|
const ethCallKey = makeEthCallKey({
|
948
905
|
context: ethCallContext,
|
@@ -121,6 +121,17 @@ export type UriCallTrace = TypedCallTrace<[bigint], UriCallObject>;
|
|
121
121
|
|
122
122
|
const templateContract = ERC1155__factory.connect("0x0", DummyProvider);
|
123
123
|
|
124
|
+
const iface = new Interface([
|
125
|
+
"function balanceOf(address account, uint256 id) view returns (uint256)",
|
126
|
+
"function balanceOfBatch(address[] accounts, uint256[] ids) view returns (uint256[])",
|
127
|
+
"function isApprovedForAll(address account, address operator) view returns (bool)",
|
128
|
+
"function safeBatchTransferFrom(address from, address to, uint256[] ids, uint256[] amounts, bytes data) nonpayable returns ()",
|
129
|
+
"function safeTransferFrom(address from, address to, uint256 id, uint256 amount, bytes data) nonpayable returns ()",
|
130
|
+
"function setApprovalForAll(address operator, bool approved) nonpayable returns ()",
|
131
|
+
"function supportsInterface(bytes4 interfaceId) view returns (bool)",
|
132
|
+
"function uri(uint256 id) view returns (string)",
|
133
|
+
]);
|
134
|
+
|
124
135
|
export class ERC1155ContractView extends ContractView<ERC1155> {
|
125
136
|
constructor(contract: ERC1155) {
|
126
137
|
super(contract);
|
@@ -136,9 +147,6 @@ export class ERC1155ContractView extends ContractView<ERC1155> {
|
|
136
147
|
): Promise<bigint> {
|
137
148
|
try {
|
138
149
|
if (preparedData?.ethCallResults && ethCallContext) {
|
139
|
-
const iface = new Interface([
|
140
|
-
"function balanceOf(address,uint256) view returns (uint256)",
|
141
|
-
]);
|
142
150
|
const calldata = iface.encodeFunctionData("balanceOf", [account, id]);
|
143
151
|
const ethCallKey = makeEthCallKey({
|
144
152
|
context: ethCallContext,
|
@@ -170,9 +178,6 @@ export class ERC1155ContractView extends ContractView<ERC1155> {
|
|
170
178
|
): Promise<bigint[]> {
|
171
179
|
try {
|
172
180
|
if (preparedData?.ethCallResults && ethCallContext) {
|
173
|
-
const iface = new Interface([
|
174
|
-
"function balanceOfBatch(address[],uint256[]) view returns (uint256[])",
|
175
|
-
]);
|
176
181
|
const calldata = iface.encodeFunctionData("balanceOfBatch", [
|
177
182
|
accounts,
|
178
183
|
ids,
|
@@ -207,9 +212,6 @@ export class ERC1155ContractView extends ContractView<ERC1155> {
|
|
207
212
|
): Promise<boolean> {
|
208
213
|
try {
|
209
214
|
if (preparedData?.ethCallResults && ethCallContext) {
|
210
|
-
const iface = new Interface([
|
211
|
-
"function isApprovedForAll(address,address) view returns (bool)",
|
212
|
-
]);
|
213
215
|
const calldata = iface.encodeFunctionData("isApprovedForAll", [
|
214
216
|
account,
|
215
217
|
operator,
|
@@ -243,9 +245,6 @@ export class ERC1155ContractView extends ContractView<ERC1155> {
|
|
243
245
|
): Promise<boolean> {
|
244
246
|
try {
|
245
247
|
if (preparedData?.ethCallResults && ethCallContext) {
|
246
|
-
const iface = new Interface([
|
247
|
-
"function supportsInterface(bytes4) view returns (bool)",
|
248
|
-
]);
|
249
248
|
const calldata = iface.encodeFunctionData("supportsInterface", [
|
250
249
|
interfaceId,
|
251
250
|
]);
|
@@ -279,9 +278,6 @@ export class ERC1155ContractView extends ContractView<ERC1155> {
|
|
279
278
|
): Promise<string> {
|
280
279
|
try {
|
281
280
|
if (preparedData?.ethCallResults && ethCallContext) {
|
282
|
-
const iface = new Interface([
|
283
|
-
"function uri(uint256) view returns (string)",
|
284
|
-
]);
|
285
281
|
const calldata = iface.encodeFunctionData("uri", [id]);
|
286
282
|
const ethCallKey = makeEthCallKey({
|
287
283
|
context: ethCallContext,
|
@@ -318,9 +314,6 @@ export class ERC1155ContractView extends ContractView<ERC1155> {
|
|
318
314
|
): Promise<void> {
|
319
315
|
try {
|
320
316
|
if (preparedData?.ethCallResults && ethCallContext) {
|
321
|
-
const iface = new Interface([
|
322
|
-
"function safeBatchTransferFrom(address,address,uint256[],uint256[],bytes) nonpayable returns ()",
|
323
|
-
]);
|
324
317
|
const calldata = iface.encodeFunctionData("safeBatchTransferFrom", [
|
325
318
|
from,
|
326
319
|
to,
|
@@ -362,9 +355,6 @@ export class ERC1155ContractView extends ContractView<ERC1155> {
|
|
362
355
|
): Promise<void> {
|
363
356
|
try {
|
364
357
|
if (preparedData?.ethCallResults && ethCallContext) {
|
365
|
-
const iface = new Interface([
|
366
|
-
"function safeTransferFrom(address,address,uint256,uint256,bytes) nonpayable returns ()",
|
367
|
-
]);
|
368
358
|
const calldata = iface.encodeFunctionData("safeTransferFrom", [
|
369
359
|
from,
|
370
360
|
to,
|
@@ -403,9 +393,6 @@ export class ERC1155ContractView extends ContractView<ERC1155> {
|
|
403
393
|
): Promise<void> {
|
404
394
|
try {
|
405
395
|
if (preparedData?.ethCallResults && ethCallContext) {
|
406
|
-
const iface = new Interface([
|
407
|
-
"function setApprovalForAll(address,bool) nonpayable returns ()",
|
408
|
-
]);
|
409
396
|
const calldata = iface.encodeFunctionData("setApprovalForAll", [
|
410
397
|
operator,
|
411
398
|
approved,
|
@@ -167,6 +167,27 @@ export type TransferOwnershipCallTrace = TypedCallTrace<
|
|
167
167
|
|
168
168
|
const templateContract = ERC20__factory.connect("0x0", DummyProvider);
|
169
169
|
|
170
|
+
const iface = new Interface([
|
171
|
+
"function allowance(address owner, address spender) view returns (uint256)",
|
172
|
+
"function approve(address spender, uint256 amount) nonpayable returns (bool)",
|
173
|
+
"function balanceOf(address account) view returns (uint256)",
|
174
|
+
"function burn(uint256 amount) nonpayable returns ()",
|
175
|
+
"function burnFrom(address account, uint256 amount) nonpayable returns ()",
|
176
|
+
"function decimals() view returns (uint8)",
|
177
|
+
"function decreaseAllowance(address spender, uint256 subtractedValue) nonpayable returns (bool)",
|
178
|
+
"function increaseAllowance(address spender, uint256 addedValue) nonpayable returns (bool)",
|
179
|
+
"function locker() view returns (address)",
|
180
|
+
"function name() view returns (string)",
|
181
|
+
"function owner() view returns (address)",
|
182
|
+
"function renounceOwnership() nonpayable returns ()",
|
183
|
+
"function setLocker(address _locker) nonpayable returns ()",
|
184
|
+
"function symbol() view returns (string)",
|
185
|
+
"function totalSupply() view returns (uint256)",
|
186
|
+
"function transfer(address recipient, uint256 amount) nonpayable returns (bool)",
|
187
|
+
"function transferFrom(address sender, address recipient, uint256 amount) nonpayable returns (bool)",
|
188
|
+
"function transferOwnership(address newOwner) nonpayable returns ()",
|
189
|
+
]);
|
190
|
+
|
170
191
|
export class ERC20ContractView extends ContractView<ERC20> {
|
171
192
|
constructor(contract: ERC20) {
|
172
193
|
super(contract);
|
@@ -182,9 +203,6 @@ export class ERC20ContractView extends ContractView<ERC20> {
|
|
182
203
|
): Promise<bigint> {
|
183
204
|
try {
|
184
205
|
if (preparedData?.ethCallResults && ethCallContext) {
|
185
|
-
const iface = new Interface([
|
186
|
-
"function allowance(address,address) view returns (uint256)",
|
187
|
-
]);
|
188
206
|
const calldata = iface.encodeFunctionData("allowance", [
|
189
207
|
owner,
|
190
208
|
spender,
|
@@ -218,9 +236,6 @@ export class ERC20ContractView extends ContractView<ERC20> {
|
|
218
236
|
): Promise<bigint> {
|
219
237
|
try {
|
220
238
|
if (preparedData?.ethCallResults && ethCallContext) {
|
221
|
-
const iface = new Interface([
|
222
|
-
"function balanceOf(address) view returns (uint256)",
|
223
|
-
]);
|
224
239
|
const calldata = iface.encodeFunctionData("balanceOf", [account]);
|
225
240
|
const ethCallKey = makeEthCallKey({
|
226
241
|
context: ethCallContext,
|
@@ -249,9 +264,6 @@ export class ERC20ContractView extends ContractView<ERC20> {
|
|
249
264
|
): Promise<bigint> {
|
250
265
|
try {
|
251
266
|
if (preparedData?.ethCallResults && ethCallContext) {
|
252
|
-
const iface = new Interface([
|
253
|
-
"function decimals() view returns (uint8)",
|
254
|
-
]);
|
255
267
|
const calldata = iface.encodeFunctionData("decimals", []);
|
256
268
|
const ethCallKey = makeEthCallKey({
|
257
269
|
context: ethCallContext,
|
@@ -277,9 +289,6 @@ export class ERC20ContractView extends ContractView<ERC20> {
|
|
277
289
|
): Promise<string> {
|
278
290
|
try {
|
279
291
|
if (preparedData?.ethCallResults && ethCallContext) {
|
280
|
-
const iface = new Interface([
|
281
|
-
"function locker() view returns (address)",
|
282
|
-
]);
|
283
292
|
const calldata = iface.encodeFunctionData("locker", []);
|
284
293
|
const ethCallKey = makeEthCallKey({
|
285
294
|
context: ethCallContext,
|
@@ -305,7 +314,6 @@ export class ERC20ContractView extends ContractView<ERC20> {
|
|
305
314
|
): Promise<string> {
|
306
315
|
try {
|
307
316
|
if (preparedData?.ethCallResults && ethCallContext) {
|
308
|
-
const iface = new Interface(["function name() view returns (string)"]);
|
309
317
|
const calldata = iface.encodeFunctionData("name", []);
|
310
318
|
const ethCallKey = makeEthCallKey({
|
311
319
|
context: ethCallContext,
|
@@ -331,9 +339,6 @@ export class ERC20ContractView extends ContractView<ERC20> {
|
|
331
339
|
): Promise<string> {
|
332
340
|
try {
|
333
341
|
if (preparedData?.ethCallResults && ethCallContext) {
|
334
|
-
const iface = new Interface([
|
335
|
-
"function owner() view returns (address)",
|
336
|
-
]);
|
337
342
|
const calldata = iface.encodeFunctionData("owner", []);
|
338
343
|
const ethCallKey = makeEthCallKey({
|
339
344
|
context: ethCallContext,
|
@@ -359,9 +364,6 @@ export class ERC20ContractView extends ContractView<ERC20> {
|
|
359
364
|
): Promise<string> {
|
360
365
|
try {
|
361
366
|
if (preparedData?.ethCallResults && ethCallContext) {
|
362
|
-
const iface = new Interface([
|
363
|
-
"function symbol() view returns (string)",
|
364
|
-
]);
|
365
367
|
const calldata = iface.encodeFunctionData("symbol", []);
|
366
368
|
const ethCallKey = makeEthCallKey({
|
367
369
|
context: ethCallContext,
|
@@ -387,9 +389,6 @@ export class ERC20ContractView extends ContractView<ERC20> {
|
|
387
389
|
): Promise<bigint> {
|
388
390
|
try {
|
389
391
|
if (preparedData?.ethCallResults && ethCallContext) {
|
390
|
-
const iface = new Interface([
|
391
|
-
"function totalSupply() view returns (uint256)",
|
392
|
-
]);
|
393
392
|
const calldata = iface.encodeFunctionData("totalSupply", []);
|
394
393
|
const ethCallKey = makeEthCallKey({
|
395
394
|
context: ethCallContext,
|
@@ -422,9 +421,6 @@ export class ERC20ContractView extends ContractView<ERC20> {
|
|
422
421
|
): Promise<boolean> {
|
423
422
|
try {
|
424
423
|
if (preparedData?.ethCallResults && ethCallContext) {
|
425
|
-
const iface = new Interface([
|
426
|
-
"function approve(address,uint256) nonpayable returns (bool)",
|
427
|
-
]);
|
428
424
|
const calldata = iface.encodeFunctionData("approve", [
|
429
425
|
spender,
|
430
426
|
amount,
|
@@ -455,9 +451,6 @@ export class ERC20ContractView extends ContractView<ERC20> {
|
|
455
451
|
): Promise<void> {
|
456
452
|
try {
|
457
453
|
if (preparedData?.ethCallResults && ethCallContext) {
|
458
|
-
const iface = new Interface([
|
459
|
-
"function burn(uint256) nonpayable returns ()",
|
460
|
-
]);
|
461
454
|
const calldata = iface.encodeFunctionData("burn", [amount]);
|
462
455
|
const ethCallKey = makeEthCallKey({
|
463
456
|
context: ethCallContext,
|
@@ -486,9 +479,6 @@ export class ERC20ContractView extends ContractView<ERC20> {
|
|
486
479
|
): Promise<void> {
|
487
480
|
try {
|
488
481
|
if (preparedData?.ethCallResults && ethCallContext) {
|
489
|
-
const iface = new Interface([
|
490
|
-
"function burnFrom(address,uint256) nonpayable returns ()",
|
491
|
-
]);
|
492
482
|
const calldata = iface.encodeFunctionData("burnFrom", [
|
493
483
|
account,
|
494
484
|
amount,
|
@@ -522,9 +512,6 @@ export class ERC20ContractView extends ContractView<ERC20> {
|
|
522
512
|
): Promise<boolean> {
|
523
513
|
try {
|
524
514
|
if (preparedData?.ethCallResults && ethCallContext) {
|
525
|
-
const iface = new Interface([
|
526
|
-
"function decreaseAllowance(address,uint256) nonpayable returns (bool)",
|
527
|
-
]);
|
528
515
|
const calldata = iface.encodeFunctionData("decreaseAllowance", [
|
529
516
|
spender,
|
530
517
|
subtractedValue,
|
@@ -558,9 +545,6 @@ export class ERC20ContractView extends ContractView<ERC20> {
|
|
558
545
|
): Promise<boolean> {
|
559
546
|
try {
|
560
547
|
if (preparedData?.ethCallResults && ethCallContext) {
|
561
|
-
const iface = new Interface([
|
562
|
-
"function increaseAllowance(address,uint256) nonpayable returns (bool)",
|
563
|
-
]);
|
564
548
|
const calldata = iface.encodeFunctionData("increaseAllowance", [
|
565
549
|
spender,
|
566
550
|
addedValue,
|
@@ -592,9 +576,6 @@ export class ERC20ContractView extends ContractView<ERC20> {
|
|
592
576
|
): Promise<void> {
|
593
577
|
try {
|
594
578
|
if (preparedData?.ethCallResults && ethCallContext) {
|
595
|
-
const iface = new Interface([
|
596
|
-
"function renounceOwnership() nonpayable returns ()",
|
597
|
-
]);
|
598
579
|
const calldata = iface.encodeFunctionData("renounceOwnership", []);
|
599
580
|
const ethCallKey = makeEthCallKey({
|
600
581
|
context: ethCallContext,
|
@@ -624,9 +605,6 @@ export class ERC20ContractView extends ContractView<ERC20> {
|
|
624
605
|
): Promise<void> {
|
625
606
|
try {
|
626
607
|
if (preparedData?.ethCallResults && ethCallContext) {
|
627
|
-
const iface = new Interface([
|
628
|
-
"function setLocker(address) nonpayable returns ()",
|
629
|
-
]);
|
630
608
|
const calldata = iface.encodeFunctionData("setLocker", [_locker]);
|
631
609
|
const ethCallKey = makeEthCallKey({
|
632
610
|
context: ethCallContext,
|
@@ -657,9 +635,6 @@ export class ERC20ContractView extends ContractView<ERC20> {
|
|
657
635
|
): Promise<boolean> {
|
658
636
|
try {
|
659
637
|
if (preparedData?.ethCallResults && ethCallContext) {
|
660
|
-
const iface = new Interface([
|
661
|
-
"function transfer(address,uint256) nonpayable returns (bool)",
|
662
|
-
]);
|
663
638
|
const calldata = iface.encodeFunctionData("transfer", [
|
664
639
|
recipient,
|
665
640
|
amount,
|
@@ -694,9 +669,6 @@ export class ERC20ContractView extends ContractView<ERC20> {
|
|
694
669
|
): Promise<boolean> {
|
695
670
|
try {
|
696
671
|
if (preparedData?.ethCallResults && ethCallContext) {
|
697
|
-
const iface = new Interface([
|
698
|
-
"function transferFrom(address,address,uint256) nonpayable returns (bool)",
|
699
|
-
]);
|
700
672
|
const calldata = iface.encodeFunctionData("transferFrom", [
|
701
673
|
sender,
|
702
674
|
recipient,
|
@@ -730,9 +702,6 @@ export class ERC20ContractView extends ContractView<ERC20> {
|
|
730
702
|
): Promise<void> {
|
731
703
|
try {
|
732
704
|
if (preparedData?.ethCallResults && ethCallContext) {
|
733
|
-
const iface = new Interface([
|
734
|
-
"function transferOwnership(address) nonpayable returns ()",
|
735
|
-
]);
|
736
705
|
const calldata = iface.encodeFunctionData("transferOwnership", [
|
737
706
|
newOwner,
|
738
707
|
]);
|
@@ -99,6 +99,18 @@ export type AllowanceCallTrace = TypedCallTrace<
|
|
99
99
|
|
100
100
|
const templateContract = ERC20Bytes__factory.connect("0x0", DummyProvider);
|
101
101
|
|
102
|
+
const iface = new Interface([
|
103
|
+
"function name() view returns (bytes32)",
|
104
|
+
"function approve(address spender, uint256 value) nonpayable returns (bool)",
|
105
|
+
"function totalSupply() view returns (uint256)",
|
106
|
+
"function transferFrom(address from, address to, uint256 value) nonpayable returns (bool)",
|
107
|
+
"function decimals() view returns (uint8)",
|
108
|
+
"function balanceOf(address who) view returns (uint256)",
|
109
|
+
"function symbol() view returns (bytes32)",
|
110
|
+
"function transfer(address to, uint256 value) nonpayable returns (bool)",
|
111
|
+
"function allowance(address owner, address spender) view returns (uint256)",
|
112
|
+
]);
|
113
|
+
|
102
114
|
export class ERC20BytesContractView extends ContractView<ERC20Bytes> {
|
103
115
|
constructor(contract: ERC20Bytes) {
|
104
116
|
super(contract);
|
@@ -112,7 +124,6 @@ export class ERC20BytesContractView extends ContractView<ERC20Bytes> {
|
|
112
124
|
): Promise<string> {
|
113
125
|
try {
|
114
126
|
if (preparedData?.ethCallResults && ethCallContext) {
|
115
|
-
const iface = new Interface(["function name() view returns (bytes32)"]);
|
116
127
|
const calldata = iface.encodeFunctionData("name", []);
|
117
128
|
const ethCallKey = makeEthCallKey({
|
118
129
|
context: ethCallContext,
|
@@ -138,9 +149,6 @@ export class ERC20BytesContractView extends ContractView<ERC20Bytes> {
|
|
138
149
|
): Promise<bigint> {
|
139
150
|
try {
|
140
151
|
if (preparedData?.ethCallResults && ethCallContext) {
|
141
|
-
const iface = new Interface([
|
142
|
-
"function totalSupply() view returns (uint256)",
|
143
|
-
]);
|
144
152
|
const calldata = iface.encodeFunctionData("totalSupply", []);
|
145
153
|
const ethCallKey = makeEthCallKey({
|
146
154
|
context: ethCallContext,
|
@@ -168,9 +176,6 @@ export class ERC20BytesContractView extends ContractView<ERC20Bytes> {
|
|
168
176
|
): Promise<bigint> {
|
169
177
|
try {
|
170
178
|
if (preparedData?.ethCallResults && ethCallContext) {
|
171
|
-
const iface = new Interface([
|
172
|
-
"function decimals() view returns (uint8)",
|
173
|
-
]);
|
174
179
|
const calldata = iface.encodeFunctionData("decimals", []);
|
175
180
|
const ethCallKey = makeEthCallKey({
|
176
181
|
context: ethCallContext,
|
@@ -197,9 +202,6 @@ export class ERC20BytesContractView extends ContractView<ERC20Bytes> {
|
|
197
202
|
): Promise<bigint> {
|
198
203
|
try {
|
199
204
|
if (preparedData?.ethCallResults && ethCallContext) {
|
200
|
-
const iface = new Interface([
|
201
|
-
"function balanceOf(address) view returns (uint256)",
|
202
|
-
]);
|
203
205
|
const calldata = iface.encodeFunctionData("balanceOf", [who]);
|
204
206
|
const ethCallKey = makeEthCallKey({
|
205
207
|
context: ethCallContext,
|
@@ -228,9 +230,6 @@ export class ERC20BytesContractView extends ContractView<ERC20Bytes> {
|
|
228
230
|
): Promise<string> {
|
229
231
|
try {
|
230
232
|
if (preparedData?.ethCallResults && ethCallContext) {
|
231
|
-
const iface = new Interface([
|
232
|
-
"function symbol() view returns (bytes32)",
|
233
|
-
]);
|
234
233
|
const calldata = iface.encodeFunctionData("symbol", []);
|
235
234
|
const ethCallKey = makeEthCallKey({
|
236
235
|
context: ethCallContext,
|
@@ -258,9 +257,6 @@ export class ERC20BytesContractView extends ContractView<ERC20Bytes> {
|
|
258
257
|
): Promise<bigint> {
|
259
258
|
try {
|
260
259
|
if (preparedData?.ethCallResults && ethCallContext) {
|
261
|
-
const iface = new Interface([
|
262
|
-
"function allowance(address,address) view returns (uint256)",
|
263
|
-
]);
|
264
260
|
const calldata = iface.encodeFunctionData("allowance", [
|
265
261
|
owner,
|
266
262
|
spender,
|
@@ -298,9 +294,6 @@ export class ERC20BytesContractView extends ContractView<ERC20Bytes> {
|
|
298
294
|
): Promise<boolean> {
|
299
295
|
try {
|
300
296
|
if (preparedData?.ethCallResults && ethCallContext) {
|
301
|
-
const iface = new Interface([
|
302
|
-
"function approve(address,uint256) nonpayable returns (bool)",
|
303
|
-
]);
|
304
297
|
const calldata = iface.encodeFunctionData("approve", [
|
305
298
|
spender,
|
306
299
|
value,
|
@@ -333,9 +326,6 @@ export class ERC20BytesContractView extends ContractView<ERC20Bytes> {
|
|
333
326
|
): Promise<boolean> {
|
334
327
|
try {
|
335
328
|
if (preparedData?.ethCallResults && ethCallContext) {
|
336
|
-
const iface = new Interface([
|
337
|
-
"function transferFrom(address,address,uint256) nonpayable returns (bool)",
|
338
|
-
]);
|
339
329
|
const calldata = iface.encodeFunctionData("transferFrom", [
|
340
330
|
from,
|
341
331
|
to,
|
@@ -370,9 +360,6 @@ export class ERC20BytesContractView extends ContractView<ERC20Bytes> {
|
|
370
360
|
): Promise<boolean> {
|
371
361
|
try {
|
372
362
|
if (preparedData?.ethCallResults && ethCallContext) {
|
373
|
-
const iface = new Interface([
|
374
|
-
"function transfer(address,uint256) nonpayable returns (bool)",
|
375
|
-
]);
|
376
363
|
const calldata = iface.encodeFunctionData("transfer", [to, value]);
|
377
364
|
const ethCallKey = makeEthCallKey({
|
378
365
|
context: ethCallContext,
|