diff --git a/contracts/EventAndErrors.sol b/contracts/EventAndErrors.sol index 8fc13a3..b78a3fc 100644 --- a/contracts/EventAndErrors.sol +++ b/contracts/EventAndErrors.sol @@ -2,7 +2,6 @@ pragma solidity 0.8.9; interface EventAndErrors { - // bytes32 constant DEPOSIT_ADDED_SIGNATURE = /// ███ Events ████████████████████████████████████████████████████████████ @@ -85,4 +84,7 @@ interface EventAndErrors { /// @dev Wished amount to be locked exceeds the limit allowed. /// @dev 0x1c18f846 error AmountNotAllowed(); + /// @dev Reverts when success return value returns false. + /// @dev 0xe10bf1cc + error StaticCallFailed(); } diff --git a/contracts/p2pix.sol b/contracts/p2pix.sol index 9e60e33..d3255c6 100644 --- a/contracts/p2pix.sol +++ b/contracts/p2pix.sol @@ -150,7 +150,7 @@ contract P2PIX is /// from the total `remaining` value. /// @dev Locks can only be performed in valid orders. /// @param _buyerAddress The address of the buyer of a `_depositID`. - /// @param _relayerTarget Target address entitled to the `relayerPremim`. + /// @param _relayerTarget Target address entitled to the `relayerPremium`. /// @param _relayerPremium The refund/premium owed to a relayer. /// @param _amount The deposit's remaining amount wished to be locked. /// @param merkleProof This value should be: @@ -659,6 +659,11 @@ contract P2PIX is returnSize := returndatasize() returnValue := mload(0x00) _spendLimit := returnValue + // reverts if call does not succeed. + if iszero(success) { + mstore(0x00, 0xe10bf1cc) + revert(0x1c, 0x04) + } } }