Compare commits

..

2 Commits

Author SHA1 Message Date
hueso
3b6dd8ba9b use ERC20 datatype 2023-02-25 13:55:19 -03:00
hueso
e412897f11 revamped lock conditionals 2023-02-24 16:39:04 -03:00

View File

@@ -215,27 +215,6 @@ contract P2PIX is
mapLocks[cCounter].expirationBlock >= block.number
) revert NotExpired();
if (merkleProof.length != 0) {
merkleVerify(
merkleProof,
sellerAllowList[k],
msg.sender
);
} else if (_amount > 1e2 ether) {
uint256 userCredit = userRecord[
_castAddrToKey(msg.sender)
];
uint256 spendLimit;
(spendLimit) = _limiter(userCredit / WAD);
if (
_amount > (spendLimit * WAD) ||
_amount > 1e6 ether
) revert AmountNotAllowed();
}
DT.Lock memory l = DT.Lock(
k,
cCounter,
@@ -249,6 +228,27 @@ contract P2PIX is
t
);
if (merkleProof.length != 0) {
merkleVerify(
merkleProof,
sellerAllowList[k],
msg.sender
);
} else if (l.amount > 1e2 ether) {
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++;