Skip to content

Commit

Permalink
fix: checks address proposer
Browse files Browse the repository at this point in the history
  • Loading branch information
ashitakah committed Jul 9, 2024
1 parent 8a5f3f3 commit a5b3e20
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
3 changes: 2 additions & 1 deletion solidity/contracts/modules/dispute/BondedDisputeModule.sol
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ contract BondedDisputeModule is Module, IBondedDisputeModule {
function onDisputeStatusChange(
bytes32 _disputeId,
IOracle.Request calldata _request,
IOracle.Response calldata, /* _response */
IOracle.Response calldata _response, /* _response */
IOracle.Dispute calldata _dispute
) external onlyOracle {
RequestParameters memory _params = decodeRequestData(_request.disputeModuleData);
Expand All @@ -70,6 +70,7 @@ contract BondedDisputeModule is Module, IBondedDisputeModule {
_amount: _params.bondSize
});
} else if (_status == IOracle.DisputeStatus.Won) {
if (_dispute.proposer != _response.proposer) revert BondedDisputeModule_OnlyResponseProposer();
// Disputer won, we pay the disputer and release their bond
_params.accountingExtension.pay({
_requestId: _dispute.requestId,
Expand Down
8 changes: 8 additions & 0 deletions solidity/interfaces/modules/dispute/IBondedDisputeModule.sol
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,14 @@ import {IAccountingExtension} from '../../extensions/IAccountingExtension.sol';
* the tokens are either returned to the disputer or to the proposer.
*/
interface IBondedDisputeModule is IDisputeModule {
/*///////////////////////////////////////////////////////////////
ERRORS
//////////////////////////////////////////////////////////////*/

/**
* @notice Thrown when the response proposer tries to dispute the response
*/
error BondedDisputeModule_OnlyResponseProposer();
/*///////////////////////////////////////////////////////////////
STRUCTS
//////////////////////////////////////////////////////////////*/
Expand Down

0 comments on commit a5b3e20

Please sign in to comment.