revamped lock conditionals

This commit is contained in:
hueso
2023-02-24 16:39:04 -03:00
parent a0e39bafab
commit e412897f11

View File

@@ -234,22 +234,8 @@ contract P2PIX is
sellerAllowList[k], sellerAllowList[k],
msg.sender msg.sender
); );
} else if (l.amount > 1e2 ether) {
_addLock(bal, _amount, cCounter, l, t, k);
lockCounter++;
// Halt execution and output `lockID`.
return cCounter;
} else {
if (l.amount <= 1e2 ether) {
_addLock(bal, _amount, cCounter, l, t, k);
lockCounter++;
// Halt execution and output `lockID`.
return cCounter;
} else {
uint256 userCredit = userRecord[ uint256 userCredit = userRecord[
_castAddrToKey(msg.sender) _castAddrToKey(msg.sender)
]; ];
@@ -261,6 +247,7 @@ contract P2PIX is
l.amount > (spendLimit * WAD) || l.amount > (spendLimit * WAD) ||
l.amount > 1e6 ether l.amount > 1e6 ether
) revert AmountNotAllowed(); ) revert AmountNotAllowed();
}
_addLock(bal, _amount, cCounter, l, t, k); _addLock(bal, _amount, cCounter, l, t, k);
@@ -269,8 +256,6 @@ contract P2PIX is
// Halt execution and output `lockID`. // Halt execution and output `lockID`.
return cCounter; return cCounter;
} }
}
}
/// @notice Lock release method that liquidate lock /// @notice Lock release method that liquidate lock
/// orders and distributes relayer fees. /// orders and distributes relayer fees.