diff --git a/src/voting/Question.sol b/src/voting/Question.sol index 25e0d64..5fb1d68 100644 --- a/src/voting/Question.sol +++ b/src/voting/Question.sol @@ -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; @@ -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; @@ -93,7 +95,8 @@ abstract contract Question is Ownable, IQuestion { totalVoteCount: totalVotes, options: optionViews, status: getStatus(), - owner: owner() + owner: owner(), + started: deploymentTime }); } diff --git a/src/voting/interfaces/IQuestion.sol b/src/voting/interfaces/IQuestion.sol index e980d7b..cb9ebdd 100644 --- a/src/voting/interfaces/IQuestion.sol +++ b/src/voting/interfaces/IQuestion.sol @@ -35,6 +35,7 @@ interface IQuestion { OptionView[] options; Status status; address owner; + uint256 started; } // Events @@ -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); }