hashgraph / hashgraph/hedera-forking

Evaluate whether to include the `hedera-smart-contracts` repo as a dependency

Open
#140 0 comments 0 reactions 0 assignees View on GitHub
dependencies
Dominant language
Solidity
Stars
3
Forks
4
PR merge metrics
No merged PRs in 30d

Description

As we are starting to include more and more HTS functionality, we need more type and interface definitions. See for example,

- https://github.com/hashgraph/hedera-forking/pull/128
- https://github.com/hashgraph/hedera-forking/pull/120

Most of these definitions are already present in the `hedera-smart-contracts` repo. We should evaluate whether to include this repo as a dependency. One minor drawback is the `import` paths are quite long, for example

```solidity
import {IHRC719} from "hedera-smart-contracts/system-contracts/hedera-token-service/IHRC719.sol";
```

This could be changed locally by adding a remapping to `remappings.txt` like

```
hedera/system/hts/=lib/hedera-smart-contracts/contracts/system-contracts/hedera-token-service/
```

so the above `import` looks like

```solidity
import {IHRC719} from "hedera/system/hts/IHRC719.sol";
```

> [!NOTE]
> If we adopt this solution, we need to exclude the `lib/` folder from `tsconfig.json` to avoid unrelated type-checking issues.

Related issues to consume the smart contracts repo from an npm package
- https://github.com/hashgraph/hedera-smart-contracts/issues/115
- https://github.com/hashgraph/hedera-smart-contracts/discussions/1019

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.