revamped lock conditionals
This commit is contained in:
@@ -234,42 +234,27 @@ contract P2PIX is
|
|||||||
sellerAllowList[k],
|
sellerAllowList[k],
|
||||||
msg.sender
|
msg.sender
|
||||||
);
|
);
|
||||||
|
} else if (l.amount > 1e2 ether) {
|
||||||
|
|
||||||
|
uint256 userCredit = userRecord[
|
||||||
|
_castAddrToKey(msg.sender)
|
||||||
|
];
|
||||||
|
|
||||||
_addLock(bal, _amount, cCounter, l, t, k);
|
uint256 spendLimit;
|
||||||
|
(spendLimit) = _limiter(userCredit / WAD);
|
||||||
|
|
||||||
lockCounter++;
|
if (
|
||||||
|
l.amount > (spendLimit * WAD) ||
|
||||||
// Halt execution and output `lockID`.
|
l.amount > 1e6 ether
|
||||||
return cCounter;
|
) revert AmountNotAllowed();
|
||||||
} 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[
|
|
||||||
_castAddrToKey(msg.sender)
|
|
||||||
];
|
|
||||||
|
|
||||||
uint256 spendLimit;
|
|
||||||
(spendLimit) = _limiter(userCredit / WAD);
|
|
||||||
|
|
||||||
if (
|
|
||||||
l.amount > (spendLimit * WAD) ||
|
|
||||||
l.amount > 1e6 ether
|
|
||||||
) revert AmountNotAllowed();
|
|
||||||
|
|
||||||
_addLock(bal, _amount, cCounter, l, t, k);
|
|
||||||
|
|
||||||
lockCounter++;
|
|
||||||
|
|
||||||
// Halt execution and output `lockID`.
|
|
||||||
return cCounter;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
_addLock(bal, _amount, cCounter, l, t, k);
|
||||||
|
|
||||||
|
lockCounter++;
|
||||||
|
|
||||||
|
// Halt execution and output `lockID`.
|
||||||
|
return cCounter;
|
||||||
}
|
}
|
||||||
|
|
||||||
/// @notice Lock release method that liquidate lock
|
/// @notice Lock release method that liquidate lock
|
||||||
|
|||||||
Reference in New Issue
Block a user