Contract Interaction
Interact directly with ChainPortal factory contracts for advanced use cases.
Direct Contract Interaction
For developers who want to interact with ChainPortal contracts directly (without the SDK or UI), this guide covers the factory contract ABIs, functions, and parameters.
EVM Factory Contracts
ChainPortal deploys three factory contracts per EVM chain:
| Factory | Standard | Description |
|---|---|---|
| ERC20Factory | ERC-20 | Creates fungible tokens |
| ERC721Factory | ERC-721 | Creates NFT collections |
| ERC1155Factory | ERC-1155 | Creates multi-token collections |
All factories use the Minimal Proxy Pattern (EIP-1167) for gas-efficient deployments.
Creating an ERC20 Token
Example with ethers.js:
Example with viem:
Creating an ERC721 Collection
Creating an ERC1155 Collection
Reading Factory State
Events
Fee Structure
All factory contracts charge a creation fee. The fee is:
- Paid in the chain's native token (ETH, MATIC, BNB, etc.)
- Configurable by the factory owner
- Discounted when using a valid referral address
Referral Discounts:
| Tier | Referrals | Discount |
|---|---|---|
| Bronze | 1-9 | 5% |
| Silver | 10-49 | 10% |
| Gold | 50-99 | 15% |
| Platinum | 100-499 | 20% |
| Diamond | 500+ | 25% |
Post-Creation Token Management
After creation, tokens support these management functions:
ERC20 (if features enabled)
ERC721
Contract Addresses
Factory addresses for each chain are available in the SDK config package:
See Supported Chains for the full list of deployed chain IDs.
Verification
All factory-deployed contracts can be verified on block explorers. ChainPortal provides a source verification API to auto-verify your deployed contracts on Etherscan and compatible explorers.