Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feat support alternative gas token #124

Merged
merged 4 commits into from
Aug 19, 2024
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
6 changes: 4 additions & 2 deletions conf/config.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,13 @@
"erc1155_gateway": "0xa5Df8530766A85936EE3E139dECE3bF081c83146",
"dai_gateway": "0x0000000000000000000000000000000000000000",
"usdc_gateway": "0x0000000000000000000000000000000000000000",
"lido_gateway": "0x0000000000000000000000000000000000000000"
"lido_gateway": "0x0000000000000000000000000000000000000000",
colinlyguo marked this conversation as resolved.
Show resolved Hide resolved
"gas_token_gateway": "0x8587FE761F1669Fa75C444c8BC959c28a64AD822"
},
"scroll_messenger": "0x50c7d3e7f7c656493D1D76aaa1a836CedfCBB16A",
"message_queue": "0xF0B2293F5D834eAe920c6974D50957A1732de763",
"scroll_chain": "0x2D567EcE699Eabe5afCd141eDB7A4f2D0D6ce8a0"
"scroll_chain": "0x2D567EcE699Eabe5afCd141eDB7A4f2D0D6ce8a0",
"gas_token": "0x0000000000000000000000000000000000000000"
colinlyguo marked this conversation as resolved.
Show resolved Hide resolved
},
"start_messenger_balance": 10000000000000000000,
"ignored_tokens": [
Expand Down
2 changes: 2 additions & 0 deletions internal/config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ type Gateway struct {
USDCGateway common.Address `json:"usdc_gateway"`
LIDOGateway common.Address `json:"lido_gateway"`
PufferGateway common.Address `json:"puffer_gateway"`
GasTokenGateway common.Address `json:"gas_token_gateway"`

// erc721
ERC721Gateway common.Address `json:"erc721_gateway"`
Expand All @@ -33,6 +34,7 @@ type Gateway struct {
type L1Contracts struct {
Gateway `json:"l1_gateways"`
ScrollMessenger common.Address `json:"scroll_messenger"`
GasToken common.Address `json:"gas_token"`
}

// L1Config l1 chain config.
Expand Down
4 changes: 3 additions & 1 deletion internal/controller/cross_chain.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,13 @@ type CrossChainController struct {
func NewCrossChainController(cfg *config.Config, db *gorm.DB, l1Client, l2Client *ethclient.Client) *CrossChainController {
l1MessengerAddr := cfg.L1Config.L1Contracts.ScrollMessenger
l2MessengerAddr := cfg.L2Config.L2Contracts.ScrollMessenger
gasTokenGatewayAddr := cfg.L1Config.L1Contracts.GasTokenGateway
gasTokenAddr := cfg.L1Config.L1Contracts.GasToken
return &CrossChainController{
stopL1CrossChainChan: make(chan struct{}),
stopL2CrossChainChan: make(chan struct{}),
gatewayCrossChainLogic: crosschain.NewLogicGatewayCrossChain(db),
messengerCrossChainLogic: crosschain.NewLogicMessengerCrossChain(db, l1Client, l2Client, l1MessengerAddr, l2MessengerAddr, cfg.L1Config.StartMessengerBalance),
messengerCrossChainLogic: crosschain.NewLogicMessengerCrossChain(db, l1Client, l2Client, l1MessengerAddr, l2MessengerAddr, gasTokenGatewayAddr, gasTokenAddr, cfg.L1Config.StartMessengerBalance),
crossChainControllerRunningTotal: promauto.With(prometheus.DefaultRegisterer).NewCounterVec(prometheus.CounterOpts{
Name: "cross_chain_check_controller_running_total",
Help: "The total number of cross chain controllers running.",
Expand Down
Loading
Loading