-
Notifications
You must be signed in to change notification settings - Fork 54
Description
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:
- Deploy the Contest smart contract.
- Call the changeState function with a state value that is not the immediate next phase (e.g., changing from reg directly to done).
- 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.