Skip to content

Commit

Permalink
Use a specific message for approve failing
Browse files Browse the repository at this point in the history
  • Loading branch information
edmundedgar committed Mar 2, 2024
1 parent d4e3ef6 commit 149c4c4
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion contracts/L1ForkArbitrator.sol
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,9 @@ contract L1ForkArbitrator is IArbitratorCore, IArbitratorErrors {
IRealityETH public realitio;
IForkonomicToken public token;

/// @notice Could not approve the transfer for some reason
error CouldNotApproveTransfer();

/// @notice Could not deduct fee
error CouldNotDeductFee();

Expand Down Expand Up @@ -82,7 +85,7 @@ contract L1ForkArbitrator is IArbitratorCore, IArbitratorErrors {

// Now approve so that the fee can be transferred right out to the ForkingManager
if (!token.approve(address(forkmanager), fee))
revert CouldNotDeductFee();
revert CouldNotApproveTransfer();
IForkingManager.DisputeData memory disputeData = IForkingManager
.DisputeData(true, address(this), _questionId);
IForkingManager(forkmanager).initiateFork(disputeData);
Expand Down

0 comments on commit 149c4c4

Please sign in to comment.