onflow / onflow/flow-cli

Out of bounds bug on contract removal

Open
#843 1 comment 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

Bug
Dominant language
Go
Stars
209
Forks
87
Avg merge
1d 17h
Merged PRs (30d)
3

Description

Sentry Issue: FLOW-CLI-1J

runtime.boundsError: runtime error: slice bounds out of range [3:1]
  File "github.com/onflow/flow-cli/pkg/flowkit@v0.0.0-20230125123057-e0006d2ef2f6/config/contract.go", line 106, in (*Contracts).Remove
  File "github.com/onflow/flow-cli/internal/super/project.go", line 118, in (*project).cleanState
  File "github.com/onflow/flow-cli/internal/super/project.go", line 76, in (*project).startup
  File "github.com/onflow/flow-cli/internal/super/dev.go", line 90, in dev
  File "github.com/onflow/flow-cli/internal/command/command.go", line 141, in Command.AddToParent.func1
...
(4 additional frame(s) were not displayed)

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with pkg/flowkit/config/contract.go at line 106, then follow the callers in internal/super/project.go, especially cleanState and startup. Reproduce the contract-removal path that produced the Sentry slice-bounds error and trace the invalid range. Done means contract removal completes without this panic, with a regression check if the existing test structure supports it.

Written by the indexing model from the issue text.

Assessment

Tech stack
go
Domain
cli
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.