2024-01-19 15:57:04 +00:00
|
|
|
package balancechecker
|
|
|
|
|
|
|
|
import (
|
|
|
|
"errors"
|
|
|
|
|
|
|
|
"github.com/ethereum/go-ethereum/common"
|
|
|
|
)
|
|
|
|
|
|
|
|
var errorNotAvailableOnChainID = errors.New("BalanceChecker not available for chainID")
|
|
|
|
|
|
|
|
var contractDataByChainID = map[uint64]common.Address{
|
|
|
|
1: common.HexToAddress("0x040EA8bFE441597849A9456182fa46D38B75BC05"), // mainnet
|
|
|
|
10: common.HexToAddress("0x55bD303eA3D50FC982A8a5b43972d7f38D129bbF"), // optimism
|
2024-02-02 11:52:52 +00:00
|
|
|
42161: common.HexToAddress("0x54764eF12d29b249fDC7FC3caDc039955A396A8e"), // arbitrum
|
2024-01-25 17:23:06 +00:00
|
|
|
11155111: common.HexToAddress("0x55bD303eA3D50FC982A8a5b43972d7f38D129bbF"), // sepolia
|
2024-02-02 11:52:52 +00:00
|
|
|
421614: common.HexToAddress("0x54764eF12d29b249fDC7FC3caDc039955A396A8e"), // sepolia arbitrum
|
2024-01-25 17:23:06 +00:00
|
|
|
11155420: common.HexToAddress("0x55bD303eA3D50FC982A8a5b43972d7f38D129bbF"), // sepolia optimism
|
2024-01-19 15:57:04 +00:00
|
|
|
777333: common.HexToAddress("0x0000000000000000000000000000000010777333"), // unit tests
|
|
|
|
}
|
|
|
|
|
|
|
|
func ContractAddress(chainID uint64) (common.Address, error) {
|
|
|
|
contract, exists := contractDataByChainID[chainID]
|
|
|
|
if !exists {
|
|
|
|
return *new(common.Address), errorNotAvailableOnChainID
|
|
|
|
}
|
|
|
|
return contract, nil
|
|
|
|
}
|