Vesting contract cannot work with ETH, although it's supposed to.
Vesting contract cannot work with native token, although it's supposed to.\\nWithin the claim function, we can see that if `token` is set to address(1), the contract should operate with ETH\\n```\\n    function claim() external {\\n        address sender = msg.sender;\\n\\n        UserDetails storage s = userdetails[sender];\\n        require(s.userDeposit != 0, "No Deposit");\\n        require(s.index != vestingPoints.length, "already claimed");\\n        uint256 pctAmount;\\n        uint256 i = s.index;\\n        for (i; i <= vestingPoints.length - 1; i++) {\\n            if (block.timestamp >= vestingPoints[i][0]) {\\n                pctAmount += (s.userDeposit * vestingPoints[i][1]) / 10000;\\n            } else {\\n                break;\\n            }\\n        }\\n        if (pctAmount != 0) {\\n            if (address(token) == address(1)) {\\n                (bool sent, ) = payable(sender).call{value: pctAmount}("");  // @audit - here\\n                require(sent, "Failed to send BNB to receiver");\\n            } else {\\n                token.safeTransfer(sender, pctAmount);\\n            }\\n            s.index = uint128(i);\\n            s.amountClaimed += pctAmount;\\n        }\\n    }\\n```\\n\\nHowever, it is actually impossible for the contract to operate with ETH, since `updateUserDeposit` always attempts to do a token transfer.\\n```\\n    function updateUserDeposit(\\n        address[] memory _users,\\n        uint256[] memory _amount\\n    ) public onlyRole(DEFAULT_ADMIN_ROLE) {\\n        require(_users.length <= 250, "array length should be less than 250");\\n        require(_users.length == _amount.length, "array length should match");\\n        uint256 amount;\\n        for (uint256 i = 0; i < _users.length; i++) {\\n            userdetails[_users[i]].userDeposit = _amount[i];\\n            amount += _amount[i];\\n        }\\n        token.safeTransferFrom(distributionWallet, address(this), amount); // @audit - this will revert\\n    }\\n```\\n\\nSince when the contract is supposed to work with ETH, token is set to address(1), calling `safeTransferFrom` on that address will always revert, thus making it impossible to call this function.
make the following check\\n```\\n        if (address(token) != address(1)) token.safeTransferFrom(distributionWallet, address(this), amount);\\n```\\n
Vesting contract is unusable with ETH
```\\n    function claim() external {\\n        address sender = msg.sender;\\n\\n        UserDetails storage s = userdetails[sender];\\n        require(s.userDeposit != 0, "No Deposit");\\n        require(s.index != vestingPoints.length, "already claimed");\\n        uint256 pctAmount;\\n        uint256 i = s.index;\\n        for (i; i <= vestingPoints.length - 1; i++) {\\n            if (block.timestamp >= vestingPoints[i][0]) {\\n                pctAmount += (s.userDeposit * vestingPoints[i][1]) / 10000;\\n            } else {\\n                break;\\n            }\\n        }\\n        if (pctAmount != 0) {\\n            if (address(token) == address(1)) {\\n                (bool sent, ) = payable(sender).call{value: pctAmount}("");  // @audit - here\\n                require(sent, "Failed to send BNB to receiver");\\n            } else {\\n                token.safeTransfer(sender, pctAmount);\\n            }\\n            s.index = uint128(i);\\n            s.amountClaimed += pctAmount;\\n        }\\n    }\\n```\\n