Ethers convert Human Readable ABI to Solidity JSON ABI
January 11th, 2023

To convert this type of ABI used in Ethers.js

const humanReadableAbi = [

// hasClaimed mapping

"function hasClaimed(address) public view returns (bool)",

// Claim function

"function claim(address to, uint256 numberTokens, bytes32[] calldata proof) external",

];

you need to use new Interface and convert it like this

const iface = new Interface(humanReadableAbi);

let jsonAbi: any = iface.format(FormatTypes.json);

console.log(JSON.stringify(JSON.parse(jsonAbi), null, 2));
Subscribe to N00b21337
Receive the latest updates directly to your inbox.
Nft graphic
Mint this entry as an NFT to add it to your collection.
Verification
This entry has been permanently stored onchain and signed by its creator.
More from N00b21337

Skeleton

Skeleton

Skeleton