From 343298b3f50c2a44762f4abfb6f9bbf94823d130 Mon Sep 17 00:00:00 2001 From: Nazzareno Massari Date: Fri, 15 May 2020 16:54:11 +0100 Subject: [PATCH] clean up to previous release version --- contracts/AntsReview.sol | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/contracts/AntsReview.sol b/contracts/AntsReview.sol index 3066b09..d3d63b8 100644 --- a/contracts/AntsReview.sol +++ b/contracts/AntsReview.sol @@ -91,13 +91,13 @@ contract AntsReview is Ownable, AccessControl, Pausable { _; } - modifier onlyIssuer() { + modifier onlyIssuer(uint256 _antReviewId) { require(hasRole(ISSUER_ROLE, msg.sender), "Caller is not an issuer"); _; } - modifier notIssuer() { - require(!hasRole(ISSUER_ROLE, msg.sender), "Caller is an issuer"); + modifier notIssuer(uint256 _antReviewId) { + require(msg.sender!= antreviews[_antReviewId].issuer); _; } @@ -148,7 +148,7 @@ contract AntsReview is Ownable, AccessControl, Pausable { function fulfillAntReview(uint256 _antReviewId, string memory _data) public antReviewExists(_antReviewId) - notIssuer + notIssuer(_antReviewId) hasStatus(_antReviewId, AntReviewStatus.CREATED) isBeforeDeadline(_antReviewId) whenNotPaused() @@ -166,7 +166,7 @@ contract AntsReview is Ownable, AccessControl, Pausable { public antReviewExists(_antReviewId) fulfillmentExists(_antReviewId,_fulfillmentId) - onlyIssuer + onlyIssuer(_antReviewId) hasStatus(_antReviewId, AntReviewStatus.CREATED) fulfillmentNotYetAccepted(_antReviewId, _fulfillmentId) whenNotPaused() @@ -188,7 +188,7 @@ contract AntsReview is Ownable, AccessControl, Pausable { function cancelAntReview(uint256 _antReviewId) public antReviewExists(_antReviewId) - onlyIssuer + onlyIssuer(_antReviewId) hasStatus(_antReviewId, AntReviewStatus.CREATED) whenNotPaused() {