set deposit() nonReentrant

This commit is contained in:
hueso 2024-02-29 20:09:54 -03:00
parent d27bdda15e
commit 4f63d17eb1

View File

@ -57,7 +57,7 @@ contract P2PIX is BaseUtils {
ERC20 token,
uint96 amount,
bool valid
) public {
) public nonReentrant {
if (bytes(pixTarget).length == 0) revert EmptyPixTarget();
if (!allowedERC20s(token)) revert TokenDenied();
@ -68,8 +68,6 @@ contract P2PIX is BaseUtils {
if (_newBal > MAXBALANCE_UPPERBOUND)
revert MaxBalExceeded();
setReentrancyGuard();
if (allowlistRoot != 0) {
setRoot(msg.sender, allowlistRoot);
}
@ -91,8 +89,6 @@ contract P2PIX is BaseUtils {
amount
);
clearReentrancyGuard();
emit DepositAdded(msg.sender, token, amount);
}