revamped lock conditionals
This commit is contained in:
parent
ce5f3e4265
commit
6c5b784782
@ -179,6 +179,18 @@ contract P2PIX is BaseUtils, ReentrancyGuard {
|
|||||||
mapLocks[cCounter].expirationBlock >= block.number
|
mapLocks[cCounter].expirationBlock >= block.number
|
||||||
) revert NotExpired();
|
) revert NotExpired();
|
||||||
|
|
||||||
|
if (merkleProof.length != 0) {
|
||||||
|
_merkleVerify( merkleProof, sellerAllowList(k), msg.sender);
|
||||||
|
|
||||||
|
} else if (_amount > REPUTATION_LOWERBOUND) {
|
||||||
|
|
||||||
|
uint256 userCredit = userRecord[_castAddrToKey(msg.sender)];
|
||||||
|
uint256 spendLimit; (spendLimit) = _limiter(userCredit / WAD);
|
||||||
|
if (
|
||||||
|
_amount > (spendLimit * WAD) || _amount > LOCKAMOUNT_UPPERBOUND
|
||||||
|
) revert AmountNotAllowed();
|
||||||
|
}
|
||||||
|
|
||||||
DT.Lock memory l = DT.Lock(
|
DT.Lock memory l = DT.Lock(
|
||||||
k,
|
k,
|
||||||
cCounter,
|
cCounter,
|
||||||
@ -191,23 +203,7 @@ contract P2PIX is BaseUtils, ReentrancyGuard {
|
|||||||
address(t)
|
address(t)
|
||||||
);
|
);
|
||||||
|
|
||||||
if (merkleProof.length != 0) {
|
lockID = _addLock(bal, _amount, cCounter, l, t, k);
|
||||||
_merkleVerify( merkleProof, sellerAllowList(k), msg.sender);
|
|
||||||
lockID = _addLock(bal, _amount, cCounter, l, t, k);
|
|
||||||
|
|
||||||
} else {
|
|
||||||
if (l.amount <= REPUTATION_LOWERBOUND) {
|
|
||||||
lockID = _addLock(bal, _amount, cCounter, l, t, k);
|
|
||||||
|
|
||||||
} else {
|
|
||||||
uint256 userCredit = userRecord[_castAddrToKey(msg.sender)];
|
|
||||||
uint256 spendLimit; (spendLimit) = _limiter(userCredit / WAD);
|
|
||||||
if (
|
|
||||||
l.amount > (spendLimit * WAD) || l.amount > LOCKAMOUNT_UPPERBOUND
|
|
||||||
) revert AmountNotAllowed();
|
|
||||||
lockID = _addLock(bal, _amount, cCounter, l, t, k);
|
|
||||||
|
|
||||||
/* */}/* */}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/// @notice Lock release method that liquidate lock
|
/// @notice Lock release method that liquidate lock
|
||||||
|
Loading…
x
Reference in New Issue
Block a user