Skip to content

Commit

Permalink
chore(communities)_: update curated communities testnet contract
Browse files Browse the repository at this point in the history
  • Loading branch information
osmaczko committed Aug 29, 2024
1 parent 666f07f commit 71c9299
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
5 changes: 3 additions & 2 deletions contracts/directory/address.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,14 @@ 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")

var contractAddressByChainID = map[uint64]common.Address{
10: common.HexToAddress("0xA8d270048a086F5807A8dc0a9ae0e96280C41e3A"), // optimism mainnet
420: common.HexToAddress("0xB3Ef5B0825D5f665bE14394eea41E684CE96A4c5"), // optimism goerli testnet
wallet_common.OptimismMainnet: common.HexToAddress("0xA8d270048a086F5807A8dc0a9ae0e96280C41e3A"),
wallet_common.OptimismSepolia: common.HexToAddress("0x6B94e21FAB8Af38E8d89dd4A0480C04e9a5c53Ab"),
}

func ContractAddress(chainID uint64) (common.Address, error) {
Expand Down
5 changes: 3 additions & 2 deletions protocol/messenger_curated_communities.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import (
"github.com/ethereum/go-ethereum/accounts/abi/bind"
"github.com/status-im/status-go/eth-node/types"
"github.com/status-im/status-go/protocol/communities"
"github.com/status-im/status-go/services/wallet/common"
)

const (
Expand Down Expand Up @@ -89,9 +90,9 @@ func (m *Messenger) getCuratedCommunitiesFromContract() (*communities.CuratedCom
return nil, err
}

chainID := uint64(10) // Optimism Mainnet
chainID := common.OptimismMainnet
if testNetworksEnabled {
chainID = 420 // Optimism Goerli
chainID = common.OptimismSepolia
}

directory, err := m.contractMaker.NewDirectory(chainID)
Expand Down

0 comments on commit 71c9299

Please sign in to comment.