# Contracts

This module exports several contract factories and types that are autogenerated from ABI files. Below is a summary of each export:

* **FeeContract**: This is a type representing the FeeContract, which is used for handling fee-related operations within the blockchain.
* **ProofOfIdentity**: This type represents the ProofOfIdentity contract, which is used for getting and verifying the identity of users on the blockchain.
* **ProofOfIdentityV2**: This is an updated version of the ProofOfIdentity contract, providing enhanced features for identity verification.

## Typechain Generated ABI with Ethers.js

The autogenerated ABI files are ready to be used with Ethers.js, providing a seamless integration for interacting with Ethereum smart contracts. The Typechain-generated types ensure type safety and autocompletion in your IDE, making it easier to work with contract methods and events.

### Using the Factories

Each contract has a corresponding factory class that can be used to create instances of the contract. These factories are designed to work with Ethers.js, allowing you to connect to contracts using a signer or provider.

Example usage:

```typescript
import { ethers } from 'ethers';

import { ProofOfIdentity__factory } from '@haven1/blockchain-sdk/contract';

const provider = new ethers.providers.JsonRpcProvider('YOUR_RPC_URL');
const contractAddress = 'YOUR_CONTRACT_ADDRESS';
const proofOfIdentity = ProofOfIdentity__factory.connect(
  contractAddress,
  provider,
);

// Now you can call contract methods
const balance = await proofOfIdentity.balanceOf('0xYourAddress');
console.log(balance.toString());
```

This setup allows you to interact with the blockchain efficiently, leveraging the power of TypeScript for better code quality and maintainability.
