Module: Smart Contracts (Flare Network – Solidity)
Description:
Introduce a Status enum to clearly define the lifecycle of an issue. Update the Issue struct to use this enum and implement a function that allows authorized entities to update the status of a given issue.
✅ Tasks
1. Define the Status Enum
enum Status { Pending, UnderReview, Resolved, Rejected }
2. Update the Issue Struct
3. Implement updateIssueStatus Function
function updateIssueStatus(uint256 _issueId, Status _newStatus) public onlyOwner // or onlyAuthorized
4. Declare the Event
event StatusUpdated(
uint256 indexed issueId,
Status newStatus,
address indexed updater,
uint256 timestamp
);
5. Access Control
6. Testing
✅ Acceptance Criteria
Status enum is defined and used in the Issue struct.
reportIssue initializes the issue with Status.Pending.
updateIssueStatus modifies the issue status securely and updates timestamp.
- Event logs are correctly emitted.
- All logic is tested and passes.
Module: Smart Contracts (Flare Network – Solidity)
Description:
Introduce a
Statusenum to clearly define the lifecycle of an issue. Update theIssuestruct to use this enum and implement a function that allows authorized entities to update the status of a given issue.✅ Tasks
1. Define the
StatusEnumGroundUpIssue.sol:enum Status { Pending, UnderReview, Resolved, Rejected }2. Update the
IssueStructstatusfield type fromstringtoStatus:Status.Pendingwhen reporting an issue (reportIssue).3. Implement
updateIssueStatusFunctionRequirements:
statusfield in the correspondingIssuestruct.latestStatusUpdateTimestamptoblock.timestamp.StatusUpdatedevent.4. Declare the Event
5. Access Control
updateIssueStatustoonlyOwneror use a customonlyAuthorizedmodifier, if already implemented.6. Testing
Unit test the following:
StatusUpdatedevent is emitted.✅ Acceptance Criteria
Statusenum is defined and used in theIssuestruct.reportIssueinitializes the issue withStatus.Pending.updateIssueStatusmodifies the issue status securely and updates timestamp.