Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions op-deployer/pkg/deployer/pipeline/l2genesis.go
Original file line number Diff line number Diff line change
Expand Up @@ -102,10 +102,10 @@ func GenerateL2Genesis(pEnv *Env, intent *state.Intent, bundle ArtifactsBundle,
EnableGovernance: overrides.EnableGovernance,
FundDevAccounts: overrides.FundDevAccounts,
// Custom Gas Token (CGT) configuration passed to L2Genesis script
UseCustomGasToken: thisIntent.CustomGasToken.Enabled, // CGT: Enable/disable custom gas token
GasPayingTokenName: thisIntent.CustomGasToken.Name, // CGT: Token name (e.g., "Custom Gas Token")
GasPayingTokenSymbol: thisIntent.CustomGasToken.Symbol, // CGT: Token symbol (e.g., "CGT")
NativeAssetLiquidityAmount: thisIntent.CustomGasToken.NativeAssetLiquidityAmount.ToInt(), // CGT: Liquidity amount for NativeAssetLiquidity contract
UseCustomGasToken: thisIntent.CustomGasToken.Enabled, // CGT: Enable/disable custom gas token
GasPayingTokenName: thisIntent.CustomGasToken.Name, // CGT: Token name (e.g., "Custom Gas Token")
GasPayingTokenSymbol: thisIntent.CustomGasToken.Symbol, // CGT: Token symbol (e.g., "CGT")
NativeAssetLiquidityAmount: thisIntent.GetNativeAssetLiquidityAmount(), // CGT: Liquidity amount for NativeAssetLiquidity contract
}); err != nil {
return fmt.Errorf("failed to call L2Genesis script: %w", err)
}
Expand Down
11 changes: 11 additions & 0 deletions op-deployer/pkg/deployer/state/chain_intent.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package state

import (
"fmt"
"math/big"

"github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/common/hexutil"
Expand Down Expand Up @@ -145,3 +146,13 @@ func (c *ChainIntent) Check() error {

return nil
}

// GetNativeAssetLiquidityAmount returns the native asset liquidity amount for the chain.
// If not set, returns the default value of zero.
func (c *ChainIntent) GetNativeAssetLiquidityAmount() *big.Int {
if c.CustomGasToken != nil && c.CustomGasToken.NativeAssetLiquidityAmount != nil {
return c.CustomGasToken.NativeAssetLiquidityAmount.ToInt()
}

return (*hexutil.Big)(big.NewInt(0)).ToInt()
}