hiero-ledger / hiero-ledger/hiero-enterprise-java
Migrate contract verification from server-verify.hashscan.io Sourcify to sourcify.dev
- Dominant language
- Java
- Stars
- 6
- Forks
- 21
- Avg merge
- 10h 27m
- Merged PRs (30d)
- 37
Description
**Description**
The `ContractVerificationClient` currently uses the `server-verify.hashscan.io` service:
```java
private static final String CONTRACT_VERIFICATION_URL =
"https://server-verify.hashscan.io";
```
The [Hiero Mirror Node Explorer #2410](https://github.com/hiero-ledger/hiero-mirror-node-explorer/issues/2410) epic documents this migration. The Explorer has already transitioned its contract-verification integration to `sourcify.dev`.
**Why is this migration necessary?**
The current server-verify.hashscan.io endpoint is no longer the appropriate service to depend on. Requests to the endpoint currently result in a `308 Permanent Redirect` response.
**Step to Reproduce**
Run the following snippet
```java
void test() throws Exception {
final String contractName = "HelloWorld";
final Path binPath = getResource("/HelloWorld.bin");
final Path solPath = getResource("/HelloWorld.sol");
final String contractSource = Files.readString(solPath, StandardCharsets.UTF_8);
final Path metadataPath = getResource("/HelloWorld.metadata.json");
final String contractMetadata = Files.readString(metadataPath, StandardCharsets.UTF_8);
final ContractId contractId = smartContractClient.createContract(binPath, Hbar.from(100), 15_000_000);
final ContractVerificationState state =
verificationClient.verify(contractId, contractName, contractSource, contractMetadata);
}
```
Output:
```bash
00:17:37.539 o.h.b.i.ProtocolLayerClientImpl - Waiting for receipt of transaction '0.0.6105114@1789066047.293000749' of type FileDeleteTransaction
308 Permanent Redirect
308 Permanent Redirect
cloudflare
org.hiero.base.HieroException: Error verification step
```
**Proposed change**
Migrate `ContractVerificationClient` to the official Sourcify service `https://sourcify.dev/server` and update the implementation to use the Sourcify v2 API.
**Refrences**
- [Verification Docs](https://docs.hedera.com/reference/verification-api)
Contributor guide
Assessment
This issue has not been assessed yet.