set deposit() nonReentrant
This commit is contained in:
parent
d27bdda15e
commit
4f63d17eb1
@ -57,7 +57,7 @@ contract P2PIX is BaseUtils {
|
|||||||
ERC20 token,
|
ERC20 token,
|
||||||
uint96 amount,
|
uint96 amount,
|
||||||
bool valid
|
bool valid
|
||||||
) public {
|
) public nonReentrant {
|
||||||
|
|
||||||
if (bytes(pixTarget).length == 0) revert EmptyPixTarget();
|
if (bytes(pixTarget).length == 0) revert EmptyPixTarget();
|
||||||
if (!allowedERC20s(token)) revert TokenDenied();
|
if (!allowedERC20s(token)) revert TokenDenied();
|
||||||
@ -68,8 +68,6 @@ contract P2PIX is BaseUtils {
|
|||||||
if (_newBal > MAXBALANCE_UPPERBOUND)
|
if (_newBal > MAXBALANCE_UPPERBOUND)
|
||||||
revert MaxBalExceeded();
|
revert MaxBalExceeded();
|
||||||
|
|
||||||
setReentrancyGuard();
|
|
||||||
|
|
||||||
if (allowlistRoot != 0) {
|
if (allowlistRoot != 0) {
|
||||||
setRoot(msg.sender, allowlistRoot);
|
setRoot(msg.sender, allowlistRoot);
|
||||||
}
|
}
|
||||||
@ -91,8 +89,6 @@ contract P2PIX is BaseUtils {
|
|||||||
amount
|
amount
|
||||||
);
|
);
|
||||||
|
|
||||||
clearReentrancyGuard();
|
|
||||||
|
|
||||||
emit DepositAdded(msg.sender, token, amount);
|
emit DepositAdded(msg.sender, token, amount);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user