Skip to content

Commit

Permalink
question: add deployment time
Browse files Browse the repository at this point in the history
  • Loading branch information
NicoAcosta committed Oct 12, 2024
1 parent a4cbc89 commit 830cb99
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/voting/Question.sol
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import { IPoints } from "../points/interfaces/IPoints.sol";

abstract contract Question is Ownable, IQuestion {
// State variables
uint256 public immutable deploymentTime;
string public title;
string public description;
uint256 public deadline;
Expand All @@ -22,6 +23,7 @@ abstract contract Question is Ownable, IQuestion {
uint256 _deadline,
address _pointsAddress
) Ownable(initialOwner) {
deploymentTime = block.timestamp;
title = _title;
description = _description;
deadline = _deadline;
Expand Down Expand Up @@ -93,7 +95,8 @@ abstract contract Question is Ownable, IQuestion {
totalVoteCount: totalVotes,
options: optionViews,
status: getStatus(),
owner: owner()
owner: owner(),
started: deploymentTime
});
}

Expand Down
3 changes: 3 additions & 0 deletions src/voting/interfaces/IQuestion.sol
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ interface IQuestion {
OptionView[] options;
Status status;
address owner;
uint256 started;
}

// Events
Expand Down Expand Up @@ -79,4 +80,6 @@ interface IQuestion {
function getOptionPointsAccrued(uint256 optionId) external view returns (uint256);

function hasVoted(address voter, uint256 optionId) external view returns (bool);

function deploymentTime() external view returns (uint256);
}

0 comments on commit 830cb99

Please sign in to comment.