Skip to content

Commit 2d35a38

Browse files
committed
feat: add a function to stop new articles
1 parent 5638d75 commit 2d35a38

File tree

2 files changed

+12
-0
lines changed

2 files changed

+12
-0
lines changed

contracts/ITruthPost.sol

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ abstract contract ITruthPost {
1616
Debunked
1717
}
1818

19+
bool isPublishingEnabled = true;
1920
address payable public TREASURY;
2021
uint256 public treasuryBalance;
2122
uint256 public constant NUMBER_OF_RULING_OPTIONS = 2;
@@ -231,4 +232,9 @@ abstract contract ITruthPost {
231232
/// @param _disputeID The dispute ID as in arbitrator.
232233
/// @return Winning ruling option.
233234
function getLastRoundWinner(uint256 _disputeID) public view virtual returns (uint256);
235+
236+
/// @notice Switches publishing lock.
237+
/// @dev Useful when it's no longer safe or secure to use this contract.
238+
/// Prevents new articles to be published. Only intended for privileges users.
239+
function switchPublishingLock() public virtual;
234240
}

contracts/TruthPost.sol

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -377,6 +377,11 @@ contract TruthPost is ITruthPost, IArbitrable, IEvidence {
377377
TREASURY.send(amount);
378378
}
379379

380+
/// @inheritdoc ITruthPost
381+
function switchPublishingLock() public override onlyAdmin {
382+
isPublishingEnabled = !isPublishingEnabled;
383+
}
384+
380385
/// @notice Changes the administrator of the contract to a new address.
381386
/// @dev Only the current administrator can call this function.
382387
/// @param _newAdmin The address of the new administrator.
@@ -567,4 +572,5 @@ contract TruthPost is ITruthPost, IArbitrable, IEvidence {
567572

568573
return totalCost - raisedSoFar;
569574
}
575+
570576
}

0 commit comments

Comments
 (0)