Quick smart contract fixes

This commit is contained in:
PedroCailleret 2022-12-03 01:04:40 -03:00
parent ac9bc6fa46
commit 4403541660
2 changed files with 9 additions and 2 deletions

View File

@ -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();
}

View File

@ -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)
}
}
}