Skip to content

Commit

Permalink
Disallow invalid forced exit amounts (#89)
Browse files Browse the repository at this point in the history
  • Loading branch information
k1rill-fedoseev committed Oct 18, 2023
1 parent 9b54085 commit 17f2adf
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 17f2adf

Please sign in to comment.