Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Invalid State Transitions in Contest Smart Contract Allow Bypassing Critical Phases #76

Open
Swapnilden opened this issue Jun 12, 2024 · 0 comments
Assignees
Labels
enhancement New feature or request gssoc Level 1

Comments

@Swapnilden
Copy link

Describe the bug
The changeState function in the Contest smart contract allows for non-sequential state transitions, which can lead to invalid state changes and potentially bypass critical phases of the contest.

To Reproduce
Steps to reproduce the behavior:

  1. Deploy the Contest smart contract.
  2. Call the changeState function with a state value that is not the immediate next phase (e.g., changing from reg directly to done).
  3. Observe that the state transition occurs without error.

Expected behavior
The changeState function should only allow transitions to the next immediate phase to ensure the contest proceeds in a valid and sequential manner (i.e., from reg to voting to done).

Screenshots
N/A

Desktop (please complete the following information):

  • OS: Any
  • Browser Any
  • Version Any

Smartphone (please complete the following information):

  • Device: Any
  • OS: Any
  • Browser Any
  • Version Any

Additional context
This issue can lead to scenarios where voting can be skipped entirely if the state is changed from reg to done directly. To prevent this, the changeState function should include a check to ensure only the next phase can be transitioned to.

Please assign me this issue under GSSOC'24.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request gssoc Level 1
Projects
None yet
Development

No branches or pull requests

2 participants