Skip to content

Commit 0e2fa6f

Browse files
davidcauchiHelloKashif
authored andcommitted
Adds Botanix config
Signed-off-by: Kashif Siddiqui <[email protected]>
1 parent 6e384b2 commit 0e2fa6f

File tree

3 files changed

+62
-0
lines changed

3 files changed

+62
-0
lines changed

lib/blockchain/botanix.go

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
package blockchain
2+
3+
import (
4+
"math/big"
5+
6+
"github.com/ethereum/go-ethereum"
7+
)
8+
9+
10+
// BotanixMultinodeClient represents a multi-node, EVM compatible client for the Botanix network
11+
type BotanixMultinodeClient struct {
12+
*EthereumMultinodeClient
13+
}
14+
15+
// BotanixClient represents a single node, EVM compatible client for the Botanix network
16+
type BotanixClient struct {
17+
*EthereumClient
18+
}
19+
20+
func (b *BotanixClient) EstimateGas(callData ethereum.CallMsg) (GasEstimations, error) {
21+
gasEstimations, err := b.EthereumClient.EstimateGas(callData)
22+
if err != nil {
23+
return GasEstimations{}, err
24+
}
25+
gasEstimations.GasTipCap = big.NewInt(0)
26+
27+
return gasEstimations, err
28+
}

lib/blockchain/known_networks.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ const (
2626
WeMixClientImplementation ClientImplementation = "WeMix"
2727
KromaClientImplementation ClientImplementation = "Kroma"
2828
GnosisClientImplementation ClientImplementation = "Gnosis"
29+
BotanixClientImplementation ClientImplementation="Botanix"
2930
)
3031

3132
// wrapSingleClient Wraps a single EVM client in its appropriate implementation, based on the chain ID
@@ -66,6 +67,8 @@ func wrapSingleClient(networkSettings EVMNetwork, client *EthereumClient) EVMCli
6667
wrappedEc = &KromaClient{client}
6768
case GnosisClientImplementation:
6869
wrappedEc = &GnosisClient{client}
70+
case BotanixClientImplementation:
71+
wrappedEc = &BotanixClient{client}
6972
default:
7073
wrappedEc = client
7174
}
@@ -128,6 +131,9 @@ func wrapMultiClient(networkSettings EVMNetwork, client *EthereumMultinodeClient
128131
case GnosisClientImplementation:
129132
logMsg.Msg("Using Gnosis Client")
130133
wrappedEc = &GnosisMultinodeClient{client}
134+
case BotanixClientImplementation:
135+
logMsg.Msg("Using Botanix Client")
136+
wrappedEc = &BotanixMultinodeClient{client}
131137
default:
132138
log.Warn().Str("Network", networkSettings.Name).Msg("Unknown client implementation, defaulting to standard Ethereum client")
133139
wrappedEc = client

lib/networks/known_networks.go

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1007,6 +1007,32 @@ var (
10071007
DefaultGasLimit: 6000000,
10081008
}
10091009

1010+
BotanixMainnet = blockchain.EVMNetwork{
1011+
Name: "Botanix Mainnet",
1012+
SupportsEIP1559: true,
1013+
ClientImplementation: blockchain.BotanixClientImplementation,
1014+
ChainID: 3637,
1015+
Simulated: false,
1016+
ChainlinkTransactionLimit: 5000,
1017+
Timeout: blockchain.StrDuration{Duration: 3 * time.Minute},
1018+
MinimumConfirmations: 1,
1019+
GasEstimationBuffer: 10000,
1020+
DefaultGasLimit: 6000000,
1021+
}
1022+
1023+
BotanixTestnet = blockchain.EVMNetwork{
1024+
Name: "Botanix Testnet",
1025+
SupportsEIP1559: true,
1026+
ClientImplementation: blockchain.BotanixClientImplementation,
1027+
ChainID: 3636,
1028+
Simulated: false,
1029+
ChainlinkTransactionLimit: 5000,
1030+
Timeout: blockchain.StrDuration{Duration: 3 * time.Minute},
1031+
MinimumConfirmations: 1,
1032+
GasEstimationBuffer: 10000,
1033+
DefaultGasLimit: 6000000,
1034+
}
1035+
10101036
MappedNetworks = map[string]blockchain.EVMNetwork{
10111037
"SIMULATED": SimulatedEVM,
10121038
"ANVIL": Anvil,
@@ -1076,6 +1102,8 @@ var (
10761102
"XLAYER_SEPOLIA": XLayerSepolia,
10771103
"XLAYER_MAINNET": XLayerMainnet,
10781104
"TREASURE_RUBY": TreasureRuby,
1105+
"BOTANIX_MAINNET": BotanixMainnet,
1106+
"BOTANIX_TESTNET": BotanixTestnet,
10791107
}
10801108
)
10811109

0 commit comments

Comments
 (0)