Skip to content

Commit

Permalink
fix: clean if
Browse files Browse the repository at this point in the history
  • Loading branch information
ashitakah committed Jul 12, 2024
1 parent 1b9a059 commit cd86332
Showing 1 changed file with 4 additions and 13 deletions.
17 changes: 4 additions & 13 deletions solidity/contracts/Oracle.sol
Original file line number Diff line number Diff line change
Expand Up @@ -134,22 +134,13 @@ contract Oracle is IOracle {
revert Oracle_InvalidDisputeBody();
}

if (_dispute.disputer != msg.sender) {
if (
_dispute.disputer != msg.sender || createdAt[_dispute.requestId] == 0 || finalizedAt[_response.requestId] != 0
|| disputeOf[_response.requestId] != bytes32(0)
) {
revert Oracle_InvalidDisputeBody();
}

if (createdAt[_dispute.requestId] == 0) {
revert Oracle_InvalidDisputeBody();
}

if (finalizedAt[_response.requestId] != 0) {
revert Oracle_AlreadyFinalized(_response.requestId);
}

if (disputeOf[_dispute.responseId] != bytes32(0)) {
revert Oracle_ResponseAlreadyDisputed(_dispute.responseId);
}

_participants[_response.requestId] = abi.encodePacked(_participants[_response.requestId], msg.sender);
disputeStatus[_disputeId] = DisputeStatus.Active;
disputeOf[_dispute.responseId] = _disputeId;
Expand Down

0 comments on commit cd86332

Please sign in to comment.