added lock bonds (hardcoded to 6,25%)

This commit is contained in:
hueso 2023-02-27 15:15:51 -03:00
parent 55409a960c
commit 5c989e3596
1 changed files with 12 additions and 5 deletions

View File

@ -222,7 +222,9 @@ contract P2PIX is
msg.sender
);
} else if (_amount > 1e2 ether) {
if (_amount > 1e6 ether)
revert AmountNotAllowed();
uint256 userCredit = userRecord[
_castAddrToKey(msg.sender)
];
@ -230,10 +232,15 @@ contract P2PIX is
uint256 spendLimit;
(spendLimit) = _limiter(userCredit / WAD);
if (
_amount > (spendLimit * WAD) ||
_amount > 1e6 ether
) revert AmountNotAllowed();
if (_amount > (spendLimit * WAD)) {
SafeTransferLib.safeTransferFrom(
t,
msg.sender,
address(this),
_amount >> 4 // 6,25%
);
_amount += _amount >> 4;
}
}
DT.Lock memory l = DT.Lock(