Prerequisites
Before deploying a CGT chain, ensure you have: todo: provide op-deployer release version- OP Deployer installed: See OP Deployer installation for setup instructions
- L1 RPC endpoint: Access to an Ethereum L1 node for deployment
- Funded deployer account: ETH for L1 gas costs during deployment
- Token design: Clear plan for your native asset (supply, distribution, bridging mechanism)
- Security audit: Thorough review of any authorized minters or bridge contracts you plan to deploy
Deployment steps
Deploying a CGT chain follows the standard OP Stack deployment process with additional configuration for Custom Gas Token specific parameters.1
Initialize your intent file
2
Configure Custom Gas Token parameters
Open your
intent.toml file and add the Custom Gas Token configuration. Below is an example with CGT-specific fields:Key CGT configuration fields
| Field | Description | Required |
|---|---|---|
customGasTokenName | Name of the native asset (e.g., “My Custom Token”) | Yes |
customGasTokenSymbol | Symbol for the native asset (e.g., “MCT”) | Yes |
initialLiquiditySupply | Initial supply minted to NativeAssetLiquidity at genesis | No, default: type(uint248).max |
liquidityControllerOwner | Manages the asset supply | No, L2ProxyAdminOwner will be used as default |
Decimal support: CGT v2 currently supports only 18-decimal tokens. Support for other decimals may be added in future releases.
3
Deploy L1 contracts
Deploy your L1 contracts using OP Deployer’s apply commandThis deploys all necessary L1 contracts including
SystemConfig with the isCustomGasToken flag enabled, which instructs L1 contracts to reject ETH-value transactions.The deployment process will automatically deploy the CGT-specific predeploys (
NativeAssetLiquidity and LiquidityController) during genesis initialization.4
(Optional) Verify L1 contracts
Optionally you can use OP Deployer’s verify command to verify your L1 contracts on Blockscout or Etherscan.
5
Create genesis file with CGT configuration
After L1 deployment completes, initialize your L2 genesis with OP Deployer’s apply command:The genesis configuration is applied based on your
initent.toml.6
Start your chain services
Start your OP Stack services to start sequencing your CGT chain:
- Sequencer Execution Client
- Sequencer Consensus Client
- Batcher
- Proposer
- Challenger
Your rollup configuration file must include
"isCustomGasToken": true to ensure all services correctly handle CGT mode.7
Verify and test
Before going live, thoroughly test your CGT chain. The following are some key areas to check:Verify flag alignment
- Check L1 SystemConfig.isCustomGasToken() returns true
- Check L2 L1Block.isCustomGasToken() returns true
- Verify both flags match
- Test minting native assets via authorized minter
- Test burning native assets
- Test fee payments in native token
- Verify fee vault accumulation
- Attempt ETH deposit via OptimismPortal (should fail)
- Attempt ETH withdrawal via L2ToL1MessagePasser (should fail)
- Verify ETH operations are properly blocked
- Test deposits (L1 → L2 native asset minting)
- Test withdrawals (L2 native → L1 token)
- Verify proper locking/unlocking in liquidity contract
Post-deployment considerations
Supply management
After deployment, you can:- Withdraw excess liquidity: If genesis created more supply than needed, withdraw and burn via
L2ToL1MessagePasser - Add new minters: Authorize additional contracts to mint native assets as your ecosystem grows
- Revoke minters: Remove authorization from compromised or deprecated contracts
- Implement rate limits: Add safeguards to control minting velocity
Fee parameter adjustments
Monitor your chain’s operational costs and adjust fee parameters as needed:- minBaseFee: Adjust based on L1 gas costs and your token’s value
- operatorFee: Adjust based on data availability costs
- Use
SystemConfig.setGasConfig()to update parameters
Developer documentation
Create clear documentation for your users covering:- How to acquire native assets (bridge, DEX, faucet, etc.)
- Bridge contract addresses and interfaces
- Fee structure and token economics
- Wallet configuration (RPC endpoints, chain ID, token metadata)
Troubleshooting
Flag mismatch errors
Symptom: Transactions failing with “custom gas token mismatch” errors Solution: Verify thatSystemConfig.isCustomGasToken() on L1 and L1Block.isCustomGasToken() on L2 return the same value. If mismatched, this indicates a critical configuration error.
Fee parameter issues
Symptom: Chain operator losing money on transaction costs or users complaining about excessive fees Solution: Review and recalculate yourminBaseFee and operatorFee parameters based on:
- Current L1 gas prices
- Your token’s market value or peg
- Data availability costs
- Target fee structure for users
Liquidity depletion
Symptom: Minting transactions failing due to insufficient liquidity Solution:- Check
NativeAssetLiquiditybalance - If depleted, this indicates an imbalance between minting and burning
- Review bridge logic to ensure burns are occurring correctly
- Consider increasing initial liquidity supply in future deployments
Unauthorized minting attempts
Symptom: Unauthorized addresses attempting to mint native assets Solution:- Review access control configuration on
LiquidityController - Ensure only audited and secured contracts are authorized
- Implement rate limiting if not already in place
- Consider revoking and re-authorizing with additional safeguards