ChainPortalChainPortal Docs
SDK Reference
SDK Reference

Factory Contracts

Look up factory addresses, check deployment status, and interact with ChainPortal factories across every ecosystem.

Factory Contracts

ChainPortal deploys factory contracts per chain. Tokens and NFT collections are created by calling a factory rather than deploying bytecode yourself — this keeps gas low (EVM uses the EIP-1167 minimal proxy pattern) and the deployed contract audited-by-construction.

Factory addresses live in @chainportal/config. Always check that a factory is deployed on the target chain before calling it — coverage differs per ecosystem and network.

Not every chain has a factory yet. EVM Arc testnet is fully wired; Aptos / SUI / NEAR are live on testnet; Cosmos and most EVM mainnets are pending. The helpers below return undefined/false where a factory isn't deployed, and the UI surfaces a "factory not deployed" state in those cases.

EVM

EVMEVM

Address getters take a numeric chainId and return the address or undefined:

import {
  getContractAddresses,
  getERC20FactoryAddress,
  getERC721FactoryAddress,
  getERC1155FactoryAddress,
  getTaxableERC20FactoryAddress,
  getAirdropAddress,
  getReferralRegistryAddress,
} from '@chainportal/config';
 
const erc20Factory = getERC20FactoryAddress(5042002); // Arc testnet
if (!erc20Factory) {
  // factory not deployed on this chain — disable the create flow
}
 
// Or grab every address for a chain at once:
const addresses = getContractAddresses(5042002);
GetterReturnsContract
getERC20FactoryAddress(chainId)string | undefinedStandard ERC-20 factory
getTaxableERC20FactoryAddress(chainId)string | undefinedTax/reflection ERC-20 factory
getERC721FactoryAddress(chainId)string | undefinedERC-721 collection factory
getERC1155FactoryAddress(chainId)string | undefinedERC-1155 collection factory
getAirdropAddress(chainId)string | undefinedAirdrop / batch-transfer contract
getReferralRegistryAddress(chainId)string | undefinedReferral registry
getContractAddresses(chainId)ContractAddresses | undefinedAll addresses for the chain

Interact via the EVM services (which wrap the ABIs and the factory address lookup), or directly with viem/wagmi using the exported ABIs:

import { ERC20_FACTORY_ABI } from '@chainportal/sdk/abis';
import { getERC20FactoryAddress } from '@chainportal/config';
 
const address = getERC20FactoryAddress(chainId);
const { request } = await publicClient.simulateContract({
  address,
  abi: ERC20_FACTORY_ABI,
  functionName: 'createToken',
  args: [name, symbol, decimals, initialSupply],
  account,
});
const hash = await walletClient.writeContract(request);

Non-EVM

Non-EVM ecosystems key off a string network id and expose both an address getter and a deployment-status check.

Aptos / SUI

AptosAptos SUISUI
import { getSuiFactoryAddresses, isSuiFactoryDeployed } from '@chainportal/config';
 
if (isSuiFactoryDeployed('testnet')) {
  const { packageId /* , ... */ } = getSuiFactoryAddresses('testnet');
}
HelperSignatureDescription
getSuiFactoryAddresses(networkName)(string) => SuiFactoryAddressesPackage/module IDs for SUI
isSuiFactoryDeployed(networkName)(string) => booleanWhether SUI factories are wired

Aptos uses the equivalent module-address getters exported from @chainportal/config; SUI coin creation additionally follows the guided publish→register flow (see the in-app SuiCoinGuide).

NEAR

NEARNEAR
import {
  getNearFactoryAddresses,
  isNearFTFactoryDeployed,
  isNearNFTFactoryDeployed,
} from '@chainportal/config';
 
if (isNearFTFactoryDeployed('testnet')) {
  const { ftFactory, nftFactory /* , ... */ } = getNearFactoryAddresses('testnet');
}
HelperSignatureDescription
getNearFactoryAddresses(networkId)(string) => NearFactoryAddressesFT/NFT factory account IDs
isNearFTFactoryDeployed(networkId)(string) => booleanFT factory wired
isNearNFTFactoryDeployed(networkId)(string) => booleanNFT factory wired

Solana SolanaSolana & Cosmos CosmosCosmos

  • Solana creates SPL tokens and Metaplex NFTs without a custom factory — there's no address to look up. (A dedicated anti-bot program is not yet deployed, so anti-bot limits aren't enforced on-chain for SPL tokens.)
  • Cosmos factories (CW20/CW721) are pending deployment to CosmWasm-capable chains (Osmosis / Juno / Neutron). The create flow only lists chains that can run CosmWasm.

Gate every create flow on the deployment check, then hand off to the service or hook:

import { isSuiFactoryDeployed } from '@chainportal/config';
 
function SuiCreateButton({ network }: { network: string }) {
  if (!isSuiFactoryDeployed(network)) {
    return <p>Factory not deployed on {network} yet.</p>;
  }
  return <CreateForm />; // uses the SUI service / hook
}

See also

  • Services — wrap factory addresses + ABIs for you
  • Hooksuse*TokenCreation / use*NFTCreation per ecosystem
  • Supported chains — per-chain coverage

On this page

Edit on GitHub