|
2 | 2 |
|
3 | 3 | ### TheGraph integration |
4 | 4 |
|
5 | | -| | Status | Description | |
6 | | -| ----------- | ----------- | ----------- | |
7 | | -| Catch & handle events emitted from EthereumTransactions | ✅ | |
8 | | -| Catch & handle events emitted from ContractCall & ContractCreate | ✅ | |
9 | | -| Capture ERC transfers through HTS precompile | ✅ | |
10 | | -| Execute contract calls during subgraph event processing | ✅ | |
11 | | -| Being able to specify the startBlock from which the graph sync | ✅ | |
12 | | -| Support for multiple dataSources | ✅ | |
13 | | -| Support for dynamic dataSource templates | ✅ | |
14 | | -| Block Handlers WITHOUT filters | ✅ | |
15 | | -| Can index anonymous events | ✅ | |
16 | | -| Block Handlers WITH filters | ❌ | Requires Parity's [trace_filter](https://openethereum.github.io/JSONRPC-trace-module#trace_filter) |
17 | | -| Call Handlers | ❌ | Requires Parity's [trace_filter](https://openethereum.github.io/JSONRPC-trace-module#trace_filter) |
18 | | -| Capture HTS transfers through HTS precompile | ❌ | Depends on [4127](https://github.com/hashgraph/hedera-services/issues/4127) |
19 | | -| Capture HTS token transfers through HAPI | ❌ | Depends on [4337](https://github.com/hashgraph/hedera-mirror-node/issues/4337), [4738](https://github.com/hashgraph/hedera-mirror-node/issues/4738) |
| 5 | +| | Status | Description | |
| 6 | +| ---------------------------------------------------------------- | ------ | --------------------------------------------------------------------------------------------------------------------------------------------------- | |
| 7 | +| Catch & handle events emitted from EthereumTransactions | ✅ | |
| 8 | +| Catch & handle events emitted from ContractCall & ContractCreate | ✅ | |
| 9 | +| Capture ERC transfers through HTS precompile | ✅ | |
| 10 | +| Execute contract calls during subgraph event processing | ✅ | |
| 11 | +| Being able to specify the startBlock from which the graph sync | ✅ | |
| 12 | +| Support for multiple dataSources | ✅ | |
| 13 | +| Support for dynamic dataSource templates | ✅ | |
| 14 | +| Block Handlers WITHOUT filters | ✅ | |
| 15 | +| Can index anonymous events | ✅ | |
| 16 | +| Block Handlers WITH filters | ❌ | Requires Parity's [trace_filter](https://openethereum.github.io/JSONRPC-trace-module#trace_filter) | |
| 17 | +| Call Handlers | ❌ | Requires Parity's [trace_filter](https://openethereum.github.io/JSONRPC-trace-module#trace_filter) | |
| 18 | +| Capture HTS transfers through HTS precompile | ❌ | Depends on [4127](https://github.com/hashgraph/hedera-services/issues/4127) | |
| 19 | +| Capture HTS token transfers through HAPI | ❌ | Depends on [4337](https://github.com/hashgraph/hedera-mirror-node/issues/4337), [4738](https://github.com/hashgraph/hedera-mirror-node/issues/4738) | |
20 | 20 |
|
21 | 21 | ### Supported tools |
22 | | -| | web3js | Truffle | ethers | Hardhat | |
23 | | -|----------------------------------------------------------------------|--------|---------|--------|---------| |
24 | | -| Transfer HBARS | ✅ | ✅ | ✅ | ✅ | |
25 | | -| Contract Deployment | ✅ | ✅ | ✅ | ✅ | |
26 | | -| Can use the contract instance after deploy without re-initialization | ✅ | ✅ | ⚠️ | ⚠️ | |
27 | | -| Contract View Function Call | ✅ | ✅ | ✅ | ✅ | |
28 | | -| Contract Function Call | ✅ | ✅ | ✅ | ✅ | |
29 | 22 |
|
30 | | -Note: |
31 | | -On contract deployment, most of the tools (e.g. [ethersjs](https://docs.ethers.io/v5/api/utils/address/#utils--contract-addresses)) pre-compute the contract address on the client-side, based |
32 | | -on sender address and nonce. In the Hedera ecosystem, it's not like that, where it's just the next available id. |
33 | | -[ethersjs](https://docs.ethers.io/v5/) and therefore Hardhat usage are impacted by this address calculation difference with the details captured [here](https://github.com/ethers-io/ethers.js/discussions/3141). |
34 | | -An extra step to retrieve the valid Hedera contract address is required to workaround this challenge, example workarounds are provided below. |
| 23 | +| | web3js | Truffle | ethers | Hardhat | |
| 24 | +| -------------------------------------------------------------------- | ------ | ------- | ------ | ------- | |
| 25 | +| Transfer HBARS | ✅ | ✅ | ✅ | ✅ | |
| 26 | +| Contract Deployment | ✅ | ✅ | ✅ | ✅ | |
| 27 | +| Can use the contract instance after deploy without re-initialization | ✅ | ✅ | ✅ | ✅ | |
| 28 | +| Contract View Function Call | ✅ | ✅ | ✅ | ✅ | |
| 29 | +| Contract Function Call | ✅ | ✅ | ✅ | ✅ | |
35 | 30 |
|
36 | 31 | Note: |
37 | 32 | Development tools are usually making a lot of requests to certain endpoints, especially during contract deployment. Be aware about rate limiting, when deploying multiple large contracts. |
38 | 33 |
|
39 | 34 | Note: |
40 | 35 | Enable [`development mode`](../docs/dev-mode.md) to correctly assert revert messages of contract calls with `hardhat-chai-matchers`. |
41 | | - |
42 | | -#### Option 1 |
43 | | -```typescript |
44 | | -// init the contract factory |
45 | | -const factory = new ethers.ContractFactory(contractJson.abi, contractJson.bytecode, wallet); |
46 | | -// deploy the contract |
47 | | -let contract = await factory.deploy(); |
48 | | - |
49 | | -// wait till the transaction has reached consensus and get the contract address from the receipt |
50 | | -const { contractAddress } = await contract.deployTransaction.wait(); |
51 | | - |
52 | | -// re-init the contract with the deployed address |
53 | | -contract = new ethers.Contract(contractAddress, contractJson.abi, wallet); |
54 | | -``` |
55 | | - |
56 | | -#### Option 2 |
57 | | -```typescript |
58 | | -// init the contract factory |
59 | | -const factory = new ethers.ContractFactory(contractJson.abi, contractJson.bytecode, wallet); |
60 | | -// deploy the contract |
61 | | -let contract = await factory.deploy(); |
62 | | - |
63 | | -// wait for transaction to reach consensus |
64 | | -await contract.deployed(); |
65 | | - |
66 | | -// get the transaction receipt |
67 | | -const receipt = await provider.getTransactionReceipt(contract.deployTransaction.hash); |
68 | | - |
69 | | -// re-init the contract with the deployed address |
70 | | -contract = new ethers.Contract(receipt.contractAddress, contractJson.abi, wallet); |
71 | | -``` |
0 commit comments