Flaw in _beforeTokenTransfer call chain and missing tests
In OpenZeppelin's ERC-20 implementation, the virtual `_beforeTokenTransfer` function provides a hook that is called before tokens are transferred, minted, or burned. In the Gluwacoin codebase, it is used to check whether the unreserved balance (as opposed to the regular balance, which is checked by the ERC-20 implementation) of the sender is sufficient to allow this transfer or burning.\\nIn `ERC20WrapperGluwacoin`, `ERC20Reservable`, and `ERC20Wrapper`, the `_beforeTokenTransfer` function is implemented in the following way:\\n```\\nfunction \\_beforeTokenTransfer(\\n    address from,\\n    address to,\\n    uint256 amount\\n) internal override(ERC20Upgradeable, ERC20Wrapper, ERC20Reservable) {\\n    ERC20Wrapper.\\_beforeTokenTransfer(from, to, amount);\\n    ERC20Reservable.\\_beforeTokenTransfer(from, to, amount);\\n}\\n```\\n\\n```\\nfunction \\_beforeTokenTransfer(address from, address to, uint256 amount) internal virtual override (ERC20Upgradeable) {\\n    if (from != address(0)) {\\n        require(\\_unreservedBalance(from) >= amount, "ERC20Reservable: transfer amount exceeds unreserved balance");\\n    }\\n\\n    super.\\_beforeTokenTransfer(from, to, amount);\\n}\\n```\\n\\n```\\nfunction \\_beforeTokenTransfer(address from, address to, uint256 amount) internal virtual override (ERC20Upgradeable) {\\n    super.\\_beforeTokenTransfer(from, to, amount);\\n}\\n```\\n\\nFinally, the C3-linearization of the contracts is:\\n```\\nERC20WrapperGluwacoin\\n  ↖ ERC20Reservable\\n  ↖ ERC20ETHless\\n  ↖ ERC20Wrapper\\n  ↖ ERC20Upgradeable\\n  ↖ IERC20MetadataUpgradeable\\n  ↖ IERC20Upgradeable\\n  ↖ AccessControlEnumerableUpgradeable\\n  ↖ AccessControlUpgradeable\\n  ↖ ERC165Upgradeable\\n  ↖ IERC165Upgradeable\\n  ↖ IAccessControlEnumerableUpgradeable\\n  ↖ IAccessControlUpgradeable\\n  ↖ ContextUpgradeable\\n  ↖ Initializable\\n```\\n\\nThis means `ERC20Wrapper._beforeTokenTransfer` is ultimately called twice - once directly in `ERC20WrapperGluwacoin._beforeTokenTransfer` and then a second time because the `super._beforeTokenTransfer` call in `ERC20Reservable._beforeTokenTransfer` resolves to `ERC20Wrapper._beforeTokenTransfer`. (ERC20ETHless doesn't override _beforeTokenTransfer.)\\nMoreover, while reviewing the correctness and coverage of the tests is not in scope for this engagement, we happened to notice that there are no tests that check whether the unreserved balance is sufficient for transferring or burning tokens.
`ERC20WrapperGluwacoin._beforeTokenTransfer` should just call `super._beforeTokenTransfer`. Moreover, the `_beforeTokenTransfer` implementation can be removed from `ERC20Wrapper`.\\nWe would like to stress the importance of careful and comprehensive testing in general and of this functionality in particular, as it is crucial for the system's integrity. We also encourage investigating whether there are more such omissions and an evaluation of the test quality and coverage in general.
```\\nfunction \\_beforeTokenTransfer(\\n    address from,\\n    address to,\\n    uint256 amount\\n) internal override(ERC20Upgradeable, ERC20Wrapper, ERC20Reservable) {\\n    ERC20Wrapper.\\_beforeTokenTransfer(from, to, amount);\\n    ERC20Reservable.\\_beforeTokenTransfer(from, to, amount);\\n}\\n```\\n