diff --git a/protocol/communities/manager.go b/protocol/communities/manager.go index c668ec71a..901ad0290 100644 --- a/protocol/communities/manager.go +++ b/protocol/communities/manager.go @@ -4712,7 +4712,6 @@ func (m *Manager) HandleCommunityTokensMetadata(community *Community) error { if len(communityTokens) == 0 { return nil } - for _, tokenMetadata := range communityTokens { for chainID, address := range tokenMetadata.ContractAddresses { exists, err := m.persistence.HasCommunityToken(communityID, address, int(chainID)) @@ -4726,7 +4725,10 @@ func (m *Manager) HandleCommunityTokensMetadata(community *Community) error { return err } - return m.persistence.AddCommunityToken(communityToken) + err = m.persistence.AddCommunityToken(communityToken) + if err != nil { + return err + } } } } diff --git a/services/communitytokens/manager.go b/services/communitytokens/manager.go index eee24e871..4219b55ec 100644 --- a/services/communitytokens/manager.go +++ b/services/communitytokens/manager.go @@ -78,7 +78,7 @@ func (m *Manager) GetCollectibleContractData(chainID uint64, contractAddress str if err != nil { return nil, err } - totalSupply, err := contract.TotalSupply(callOpts) + totalSupply, err := contract.MaxSupply(callOpts) if err != nil { return nil, err } @@ -105,7 +105,7 @@ func (m *Manager) GetAssetContractData(chainID uint64, contractAddress string) ( if err != nil { return nil, err } - totalSupply, err := contract.TotalSupply(callOpts) + totalSupply, err := contract.MaxSupply(callOpts) if err != nil { return nil, err }