When tokenX is an ERC777 token, users can bypass maxLiquidity
When tokenX is an ERC777 token, users can use callbacks to provide liquidity exceeding maxLiquidity\\nIn BufferBinaryPool._provide, when tokenX is an ERC777 token, the tokensToSend function of account will be called in tokenX.transferFrom before sending tokens. When the user calls provide again in tokensToSend, since BufferBinaryPool has not received tokens at this time, totalTokenXBalance() has not increased, and the following checks can be bypassed, so that users can provide liquidity exceeding maxLiquidity.\\n```\\n         require(\\n             balance + tokenXAmount <= maxLiquidity,\\n             "Pool has already reached it's max limit"\\n         );\\n```\\n
Change to\\n```\\n    function _provide(\\n        uint256 tokenXAmount,\\n        uint256 minMint,\\n        address account\\n    ) internal returns (uint256 mint) {\\n// Add the line below\\n        bool success = tokenX.transferFrom(\\n// Add the line below\\n            account,\\n// Add the line below\\n            address(this),\\n// Add the line below\\n            tokenXAmount\\n// Add the line below\\n        );\\n        uint256 supply = totalSupply();\\n        uint256 balance = totalTokenXBalance();\\n\\n        require(\\n            balance // Add the line below\\n tokenXAmount <= maxLiquidity,\\n            "Pool has already reached it's max limit"\\n        );\\n\\n        if (supply > 0 && balance > 0)\\n            mint = (tokenXAmount * supply) / (balance);\\n        else mint = tokenXAmount * INITIAL_RATE;\\n\\n        require(mint >= minMint, "Pool: Mint limit is too large");\\n        require(mint > 0, "Pool: Amount is too small");\\n\\n// Remove the line below\\n        bool success = tokenX.transferFrom(\\n// Remove the line below\\n            account,\\n// Remove the line below\\n            address(this),\\n// Remove the line below\\n            tokenXAmount\\n// Remove the line below\\n        );\\n```\\n
users can provide liquidity exceeding maxLiquidity.
```\\n         require(\\n             balance + tokenXAmount <= maxLiquidity,\\n             "Pool has already reached it's max limit"\\n         );\\n```\\n