CCIP v2.0.0 FactoryBurnMintERC20 API Reference
Summary
FactoryBurnMintERC20 is a factory-deployable ERC20 implementation designed for CCIP token workflows.
It provides:
- Separate allowlists for minters and burners.
- Optional maximum total supply.
- Configurable decimals.
- Owner-managed CCIP admin pointer.
Contract
chains/evm/contracts/tokenAdminRegistry/TokenPoolFactory/FactoryBurnMintERC20.sol
Import
import {FactoryBurnMintERC20} from "chainlink-ccip/chains/evm/contracts/tokenAdminRegistry/TokenPoolFactory/FactoryBurnMintERC20.sol";
Inheritance
IBurnMintERC20IGetCCIPAdminIERC165ERC20BurnableOwnable2StepMsgSenderITypeAndVersion
typeAndVersion
function typeAndVersion()
external
pure
returns (string memory)
Returns canonical type string:
"FactoryBurnMintERC20 1.5.0"
State
Constants
None declared.
Immutables
uint8 internal immutable i_decimals;
uint256 internal immutable i_maxSupply;
Storage
address internal s_ccipAdmin;
EnumerableSet.AddressSet internal s_minters;
EnumerableSet.AddressSet internal s_burners;
Constructor
constructor(
string memory name,
string memory symbol,
uint8 decimals_,
uint256 maxSupply_,
uint256 preMint,
address newOwner
)
Behavior:
- Sets
i_decimals = decimals_. - Sets
i_maxSupply = maxSupply_. - Sets
s_ccipAdmin = newOwner. - If
maxSupply_ != 0andpreMint > maxSupply_, reverts:
error MaxSupplyExceeded(uint256 supplyAfterMint);
- If
preMint != 0, mintspreMinttonewOwner.
External API
supportsInterface
function supportsInterface(bytes4 interfaceId)
public
pure
returns (bool)
Supports:
IERC20IBurnMintERC20IERC165IOwnableIGetCCIPAdmin
decimals
function decimals()
public
view
returns (uint8)
Returns i_decimals.
maxSupply
function maxSupply()
public
view
returns (uint256)
Returns i_maxSupply.
mint
function mint(address account, uint256 amount)
external
onlyMinter
validAddress(account)
Reverts MaxSupplyExceeded(totalSupply() + amount) if exceeding max supply.
burn(uint256)
function burn(uint256 amount)
public
onlyBurner
Burns from msg.sender.
burn(address,uint256)
function burn(address account, uint256 amount)
public
onlyBurner
Aliases to burnFrom.
burnFrom
function burnFrom(address account, uint256 amount)
public
onlyBurner
Consumes allowance and burns tokens.
grantMintRole
function grantMintRole(address minter)
public
onlyOwner
Emits MintAccessGranted(minter).
grantBurnRole
function grantBurnRole(address burner)
public
onlyOwner
Emits BurnAccessGranted(burner).
revokeMintRole
function revokeMintRole(address minter)
external
onlyOwner
Emits MintAccessRevoked(minter).
revokeBurnRole
function revokeBurnRole(address burner)
external
onlyOwner
Emits BurnAccessRevoked(burner).
grantMintAndBurnRoles
function grantMintAndBurnRoles(address burnAndMinter)
external
Calls grantMintRole and grantBurnRole.
getMinters
function getMinters()
external
view
returns (address[] memory)
getBurners
function getBurners()
external
view
returns (address[] memory)
getCCIPAdmin
function getCCIPAdmin()
external
view
returns (address)
setCCIPAdmin
function setCCIPAdmin(address newAdmin)
public
onlyOwner
Emits:
event CCIPAdminTransferred(
address indexed previousAdmin,
address indexed newAdmin
);
Events
event MintAccessGranted(address minter);
event BurnAccessGranted(address burner);
event MintAccessRevoked(address minter);
event BurnAccessRevoked(address burner);
event CCIPAdminTransferred(
address indexed previousAdmin,
address indexed newAdmin
);
Errors
error SenderNotMinter(address sender);
error SenderNotBurner(address sender);
error MaxSupplyExceeded(uint256 supplyAfterMint);
Modifiers
modifier onlyMinter();
modifier onlyBurner();
modifier validAddress(address recipient);
Security model
- Owner controls mint and burn role assignments.
- Separate allowlists reduce blast radius.
- Optional hard max supply enforced on mint.
validAddressprevents minting/transferring to token contract itself.s_ccipAdminhas no privileged execution rights; it is a registry pointer.