This repository was archived by the owner on Jan 6, 2026. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 4
This repository was archived by the owner on Jan 6, 2026. It is now read-only.
Use human-readable ABI format in smart contract client #118
Copy link
Copy link
Open
Description
Use human-readable ABI format in smart contract client
Description
Following the implementation of smart-contract-based mapping of MinerID to IndexProviderPeerID in #117 , we should improve the developer experience by switching to a human-readable ABI format in the smart contract client.
This issue originated from the discussion in CheckerNetwork/roadmap#250 (comment), where it was noted that:
- The current implementation uses a standard JSON ABI format which lacks type inference
- This results in no autocomplete or type checking when working with the contract
- Ethers.js supports a human-readable ABI format that would improve developer experience
While we decided to stick with ethers.js for now instead of switching to viem (to minimize changes in the time-pressing initial implementation), updating to a human-readable ABI format would be a good improvement for maintainability.
Current ABI format
const contractABI = [
{
inputs: [
{
internalType: 'uint64',
name: 'minerID',
type: 'uint64'
}
],
name: 'getPeerData',
outputs: [
{
components: [
{
internalType: 'string',
name: 'peerID',
type: 'string'
},
{
internalType: 'bytes',
name: 'signature',
type: 'bytes'
}
],
internalType: 'struct MinerPeerIDMapping.PeerData',
name: '',
type: 'tuple'
}
],
stateMutability: 'view',
type: 'function'
}
]Proposed human-readable ABI format
const contractABI = [
"function getPeerData(uint64 minerID) view returns (tuple(string peerID, bytes signature))"
]Related issues/PRs
- #250 - Support smart-contract-based mapping of MinerID to IndexProviderPeerID
- feat: peer id smart contract support #117 - Implement smart-contract-based mapping of MinerID to IndexProviderPeerID
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels
Type
Projects
Status
📥 candidate