mirror of
https://github.com/status-im/status-go.git
synced 2025-02-23 12:18:38 +00:00
- A new contract is used for estimating L1 fee. - New contract's addresses are known only for Optimims and Sepolia Optimimsm. - Old contract and addresses per chain are kept so far, but not in use anymore. Comparing to other wallets, seems L1 fee is added to the total fee only for the Optimims chain. So we're doing the same in this commit, disabling L1 fees for other than the Optimism.
32 lines
1.3 KiB
Go
32 lines
1.3 KiB
Go
package gaspriceoracle
|
|
|
|
import (
|
|
"errors"
|
|
|
|
"github.com/ethereum/go-ethereum/common"
|
|
|
|
wallet_common "github.com/status-im/status-go/services/wallet/common"
|
|
)
|
|
|
|
var ErrorNotAvailableOnChainID = errors.New("not available for chainID")
|
|
|
|
// Addresses of the gas price oracle contract `OVM_GasPriceOracle` on different chains.
|
|
var contractAddressByChainID = map[uint64]common.Address{
|
|
wallet_common.OptimismMainnet: common.HexToAddress("0x8527c030424728cF93E72bDbf7663281A44Eeb22"),
|
|
wallet_common.OptimismSepolia: common.HexToAddress("0x5230210c2b4995FD5084b0F5FD0D7457aebb5010"),
|
|
wallet_common.ArbitrumMainnet: common.HexToAddress("0x8527c030424728cF93E72bDbf7663281A44Eeb22"),
|
|
wallet_common.ArbitrumSepolia: common.HexToAddress("0x5230210c2b4995FD5084b0F5FD0D7457aebb5010"),
|
|
wallet_common.BaseMainnet: common.HexToAddress("0x8527c030424728cF93E72bDbf7663281A44Eeb22"),
|
|
wallet_common.BaseSepolia: common.HexToAddress("0x5230210c2b4995FD5084b0F5FD0D7457aebb5010"),
|
|
}
|
|
|
|
// We stopped uisng `OVM_GasPriceOracle` contract, cause it returns significantly higher gas prices than the actual ones.
|
|
// But we don't remove this code for now.
|
|
func ContractAddress(chainID uint64) (common.Address, error) {
|
|
addr, exists := contractAddressByChainID[chainID]
|
|
if !exists {
|
|
return common.Address{}, ErrorNotAvailableOnChainID
|
|
}
|
|
return addr, nil
|
|
}
|