Skip to content

Commit

Permalink
fix: disallow invalid forced exit amounts
Browse files Browse the repository at this point in the history
  • Loading branch information
k1rill-fedoseev committed Oct 18, 2023
1 parent 9b54085 commit 5813dee
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/zkbob/ZkBobPool.sol
Original file line number Diff line number Diff line change
Expand Up @@ -364,7 +364,9 @@ abstract contract ZkBobPool is IZkBobPool, EIP1967Admin, Ownable, Parameters, Ex
)
external
{
require(_amount <= 1 << 63, "ZkBobPool: amount too large");
require(
_amount > 0 && _amount % TOKEN_NUMERATOR == 0 && _amount <= 1 << 63, "ZkBobPool: incorrect token amount"
);
require(_index < type(uint48).max, "ZkBobPool: index too large");

uint256 root = roots[_index];
Expand Down

0 comments on commit 5813dee

Please sign in to comment.