Skip to content

Commit

Permalink
Enable Gnosis chain (#830)
Browse files Browse the repository at this point in the history
  • Loading branch information
davidcauchi authored Feb 19, 2024
1 parent 343484e commit 34a7ad4
Show file tree
Hide file tree
Showing 3 changed files with 47 additions and 0 deletions.
11 changes: 11 additions & 0 deletions blockchain/gnosis.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
package blockchain

// GnosisMultinodeClient represents a multi-node, EVM compatible client for the Gnosis network
type GnosisMultinodeClient struct {
*EthereumMultinodeClient
}

// GnosisClient represents a single node, EVM compatible client for the Gnosis network
type GnosisClient struct {
*EthereumClient
}
6 changes: 6 additions & 0 deletions blockchain/known_networks.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ const (
FantomClientImplementation ClientImplementation = "Fantom"
WeMixClientImplementation ClientImplementation = "WeMix"
KromaClientImplementation ClientImplementation = "Kroma"
GnosisClientImplementation ClientImplementation = "Gnosis"
)

// wrapSingleClient Wraps a single EVM client in its appropriate implementation, based on the chain ID
Expand Down Expand Up @@ -63,6 +64,8 @@ func wrapSingleClient(networkSettings EVMNetwork, client *EthereumClient) EVMCli
wrappedEc = &WeMixClient{client}
case KromaClientImplementation:
wrappedEc = &KromaClient{client}
case GnosisClientImplementation:
wrappedEc = &GnosisClient{client}
default:
wrappedEc = client
}
Expand Down Expand Up @@ -122,6 +125,9 @@ func wrapMultiClient(networkSettings EVMNetwork, client *EthereumMultinodeClient
case KromaClientImplementation:
logMsg.Msg("Using Kroma Client")
wrappedEc = &KromaMultinodeClient{client}
case GnosisClientImplementation:
logMsg.Msg("Using Gnosis Client")
wrappedEc = &GnosisMultinodeClient{client}
default:
log.Warn().Str("Network", networkSettings.Name).Msg("Unknown client implementation, defaulting to standard Ethereum client")
wrappedEc = client
Expand Down
30 changes: 30 additions & 0 deletions networks/known_networks.go
Original file line number Diff line number Diff line change
Expand Up @@ -731,6 +731,34 @@ var (
DefaultGasLimit: 6000000,
}

GnosisChiado blockchain.EVMNetwork = blockchain.EVMNetwork{
Name: "Gnosis Chiado",
SupportsEIP1559: true,
ClientImplementation: blockchain.GnosisClientImplementation,
ChainID: 10200,
Simulated: false,
ChainlinkTransactionLimit: 5000,
Timeout: blockchain.StrDuration{Duration: time.Minute},
MinimumConfirmations: 1,
GasEstimationBuffer: 1000,
FinalityTag: true,
DefaultGasLimit: 6000000,
}

GnosisMainnet blockchain.EVMNetwork = blockchain.EVMNetwork{
Name: "Gnosis Mainnet",
SupportsEIP1559: true,
ClientImplementation: blockchain.GnosisClientImplementation,
ChainID: 100,
Simulated: false,
ChainlinkTransactionLimit: 5000,
Timeout: blockchain.StrDuration{Duration: time.Minute},
MinimumConfirmations: 1,
GasEstimationBuffer: 1000,
FinalityTag: true,
DefaultGasLimit: 6000000,
}

MappedNetworks = map[string]blockchain.EVMNetwork{
"SIMULATED": SimulatedEVM,
"SIMULATED_1": SimulatedEVMNonDev1,
Expand Down Expand Up @@ -782,6 +810,8 @@ var (
"NEXON_TEST": NexonTest,
"NEXON_QA": NexonQa,
"NEXON_STAGE": NexonStage,
"GNOSIS_CHIADO": GnosisChiado,
"GNOSIS_MAINNET": GnosisMainnet,
}
)

Expand Down

0 comments on commit 34a7ad4

Please sign in to comment.