synapsecns/sanguine

View on GitHub

Showing 1,971 of 13,422 total issues

Method Config.validateTokenDecimals has 6 return statements (exceeds 4 allowed).
Open

func (c Config) validateTokenDecimals(ctx context.Context, omniClient omniClient.RPCClient) (err error) {
    for chainID, chainCfg := range c.Chains {
        for tokenName, tokenCFG := range chainCfg.Tokens {
            chainClient, err := omniClient.GetChainClient(ctx, chainID)
            if err != nil {
Severity: Major
Found in services/rfq/relayer/relconfig/config.go - About 40 mins to fix

    Method DeployManager.InitializeRemoteDeployedContracts has 6 return statements (exceeds 4 allowed).
    Open

    func (d *DeployManager) InitializeRemoteDeployedContracts(
        ctx context.Context,
        backend backends.SimulatedTestBackend,
        bondingManagerAgentRoot [32]byte) error {
        d.T().Helper()
    Severity: Major
    Found in agents/testutil/typecast.go - About 40 mins to fix

      Method chainManager.setupMetrics has 6 return statements (exceeds 4 allowed).
      Open

      func (c *chainManager) setupMetrics() error {
          meterMaid := c.handler.Meter(meter)
          blockGauge, err := meterMaid.Int64ObservableGauge(blockNumberMetric)
          if err != nil {
              return fmt.Errorf("could not create histogram: %w", err)
      Severity: Major
      Found in services/omnirpc/chainmanager/manager.go - About 40 mins to fix

        Function NewQuoterManager has 6 return statements (exceeds 4 allowed).
        Open

        func NewQuoterManager(config relconfig.Config, metricsHandler metrics.Handler, inventoryManager inventory.Manager, relayerSigner signer.Signer, feePricer pricer.FeePricer, apiClient rfqAPIClient.AuthenticatedClient) (Quoter, error) {
            qt := make(map[string][]string)
        
            // fix any casing issues.
            var err error
        Severity: Major
        Found in services/rfq/relayer/quoter/quoter.go - About 40 mins to fix

          Method QuoteRequestHandler.getRelayBlockNumber has 6 return statements (exceeds 4 allowed).
          Open

          func (q *QuoteRequestHandler) getRelayBlockNumber(ctx context.Context, request reldb.QuoteRequest) (blockNumber uint64, err error) {
              // fetch the transaction receipt for corresponding tx hash
              var receipt *types.Receipt
              err = retry.WithBackoff(ctx, func(context.Context) error {
                  receipt, err = q.Dest.Client.TransactionReceipt(ctx, request.DestTxHash)
          Severity: Major
          Found in services/rfq/relayer/service/handlers.go - About 40 mins to fix

            Method Forwarder.standardizeBatch has 6 return statements (exceeds 4 allowed).
            Open

            func (f *Forwarder) standardizeBatch(ctx context.Context, body []byte) (res []byte, anyErr bool, err error) {
                dec := json.NewDecoder(bytes.NewReader(body))
            
                _, err = dec.Token() // skip '['
                if err != nil {
            Severity: Major
            Found in services/omnirpc/proxy/forward.go - About 40 mins to fix

              Method Manager.generateQuote has 6 return statements (exceeds 4 allowed).
              Open

              func (m *Manager) generateQuote(ctx context.Context, input QuoteInput) (quote *model.PutRelayerQuoteRequest, err error) {
                  // Calculate the quote amount for this route
                  originAmount, err := m.getOriginAmount(ctx, input)
                  // don't quote if gas exceeds quote
                  if errors.Is(err, errMinGasExceedsQuoteAmount) {
              Severity: Major
              Found in services/rfq/relayer/quoter/quoter.go - About 40 mins to fix

                Method Store.UpdateRebalance has 6 return statements (exceeds 4 allowed).
                Open

                func (s Store) UpdateRebalance(ctx context.Context, rebalance reldb.Rebalance, updateID bool) error {
                    tx := s.DB().WithContext(ctx).Begin()
                    if tx.Error != nil {
                        return fmt.Errorf("could not start transaction: %w", tx.Error)
                    }
                Severity: Major
                Found in services/rfq/relayer/reldb/base/rebalance.go - About 40 mins to fix

                  Method rebalanceManagerCircleCCTP.initContracts has 6 return statements (exceeds 4 allowed).
                  Open

                  func (c *rebalanceManagerCircleCCTP) initContracts(parentCtx context.Context) (err error) {
                      ctx, span := c.handler.Tracer().Start(parentCtx, "initContracts")
                      defer func(err error) {
                          metrics.EndSpanWithErr(span, err)
                      }(err)
                  Severity: Major
                  Found in services/rfq/relayer/inventory/circle.go - About 40 mins to fix

                    Method BridgeRequestModel.ToBridgeRequest has 6 return statements (exceeds 4 allowed).
                    Open

                    func (b BridgeRequestModel) ToBridgeRequest() (*guarddb.BridgeRequest, error) {
                        txID, err := hexutil.Decode(b.TransactionID)
                        if err != nil {
                            return nil, fmt.Errorf("could not get transaction id: %w", err)
                        }
                    Severity: Major
                    Found in services/rfq/guard/guarddb/base/model.go - About 40 mins to fix

                      Method Config.getChainConfigValue has 6 return statements (exceeds 4 allowed).
                      Open

                      func (c Config) getChainConfigValue(chainID int, fieldName string) (interface{}, error) {
                          chainConfig, ok := c.Chains[chainID]
                          if ok {
                              value, err := getFieldValue(chainConfig, fieldName)
                              if err != nil {
                      Severity: Major
                      Found in services/rfq/relayer/relconfig/getters.go - About 40 mins to fix

                        Method rebalanceManagerSynapseCCTP.Execute has 6 return statements (exceeds 4 allowed).
                        Open

                        func (c *rebalanceManagerSynapseCCTP) Execute(parentCtx context.Context, rebalance *RebalanceData) (err error) {
                            contract, ok := c.cctpContracts[rebalance.OriginMetadata.ChainID]
                            if !ok {
                                return fmt.Errorf("could not find cctp contract for chain %d", rebalance.OriginMetadata.ChainID)
                            }
                        Severity: Major
                        Found in services/rfq/relayer/inventory/synapse.go - About 40 mins to fix

                          Method inventoryManagerImpl.initializeTokens has 6 return statements (exceeds 4 allowed).
                          Open

                          func (i *inventoryManagerImpl) initializeTokens(parentCtx context.Context, cfg relconfig.Config) (err error) {
                              i.mux.Lock()
                              defer i.mux.Unlock()
                          
                              ctx, span := i.handler.Tracer().Start(parentCtx, "initializeTokens", trace.WithAttributes(
                          Severity: Major
                          Found in services/rfq/relayer/inventory/manager.go - About 40 mins to fix

                            Method BackfillSuite.withdrawAndRemoveParity has 6 return statements (exceeds 4 allowed).
                            Open

                            func (b *BackfillSuite) withdrawAndRemoveParity(log *types.Log, parser *parser.BridgeParser, chainID uint32, useV1 bool) error {
                                // parse the log
                                if useV1 {
                                    parsedLog, err := parser.Filterer.ParseTokenWithdrawAndRemove(*log)
                                    if err != nil {
                            Severity: Major
                            Found in services/explorer/backfill/chain_test.go - About 40 mins to fix

                              Method Resolver.bwDestinationFallback has 6 return statements (exceeds 4 allowed).
                              Open

                              func (r Resolver) bwDestinationFallback(ctx context.Context, chainID uint32, address string, identifier string, timestamp int, historical bool, bridgeType model.BridgeType) (*model.BridgeWatcherTx, error) {
                                  txFetchContext, cancelTxFetch := context.WithTimeout(ctx, maxTimeToWaitForTx)
                                  defer cancelTxFetch()
                              
                                  b := &backoff.Backoff{
                              Severity: Major
                              Found in services/explorer/graphql/server/graph/fetcher.go - About 40 mins to fix

                                Method queryResolver.GetMessageBusTxs has 6 return statements (exceeds 4 allowed).
                                Open

                                func (r *queryResolver) GetMessageBusTxs(ctx context.Context, chainID []*int, address *string, startTime *int, endTime *int, txHash *string, messageID *string, pending bool, reverted bool, page *int) ([]*model.MessageBusTransaction, error) {
                                    var err error
                                    allMessageBusEvents, err := r.DB.GetAllMessageBusEvents(ctx, generateMessageBusQuery(chainID, address, startTime, endTime, messageID, pending, reverted, txHash, *page))
                                    if err != nil {
                                        return nil, fmt.Errorf("failed to get destinationbridge events from identifiers: %w", err)
                                Severity: Major
                                Found in services/explorer/graphql/server/graph/queryutils.go - About 40 mins to fix

                                  Method BackfillSuite.depositParity has 6 return statements (exceeds 4 allowed).
                                  Open

                                  func (b *BackfillSuite) depositParity(log *types.Log, parser *parser.BridgeParser, chainID uint32, useV1 bool) error {
                                      // parse the log
                                      if useV1 {
                                          parsedLog, err := parser.FiltererV1.ParseTokenDeposit(*log)
                                          _ = parsedLog
                                  Severity: Major
                                  Found in services/explorer/backfill/chain_test.go - About 40 mins to fix

                                    Method clientImpl.SubscribeActiveQuotes has 6 return statements (exceeds 4 allowed).
                                    Open

                                    func (c *clientImpl) SubscribeActiveQuotes(ctx context.Context, req *model.SubscribeActiveRFQRequest, reqChan chan *model.ActiveRFQMessage) (respChan chan *model.ActiveRFQMessage, err error) {
                                        conn, err := c.connectWebsocket(ctx, req)
                                        if err != nil {
                                            return nil, fmt.Errorf("failed to connect to websocket: %w", err)
                                        }
                                    Severity: Major
                                    Found in services/rfq/api/client/client.go - About 40 mins to fix

                                      Method BackfillSuite.redeemAndRemoveParity has 6 return statements (exceeds 4 allowed).
                                      Open

                                      func (b *BackfillSuite) redeemAndRemoveParity(log *types.Log, parser *parser.BridgeParser, chainID uint32, useV1 bool) error {
                                          // parse the log
                                          if useV1 {
                                              parsedLog, err := parser.Filterer.ParseTokenRedeemAndRemove(*log)
                                              if err != nil {
                                      Severity: Major
                                      Found in services/explorer/backfill/chain_test.go - About 40 mins to fix

                                        Method BackfillSuite.redeemAndSwapParity has 6 return statements (exceeds 4 allowed).
                                        Open

                                        func (b *BackfillSuite) redeemAndSwapParity(log *types.Log, parser *parser.BridgeParser, chainID uint32, useV1 bool) error {
                                            // parse the log
                                            if useV1 {
                                                parsedLog, err := parser.Filterer.ParseTokenRedeemAndSwap(*log)
                                                if err != nil {
                                        Severity: Major
                                        Found in services/explorer/backfill/chain_test.go - About 40 mins to fix
                                          Severity
                                          Category
                                          Status
                                          Source
                                          Language