Unregulated joining fees
Observe the _deposit function\\nThis makes call to join function\\n```\\nfunction join(uint256 amount) external override joiningNotPaused {\\n        uint256 fee = amount.mul(joiningFee).div(BASIS_PRECISION);\\n        uint256 mintedAmount = mint(amount.sub(fee));\\n        claimableFees = claimableFees.add(fee);\\n\\n        // TODO: tx.origin will be deprecated in a future ethereum upgrade\\n        latestJoinBlock[tx.origin] = block.number;\\n        token.safeTransferFrom(msg.sender, address(this), amount);\\n\\n        emit Joined(msg.sender, amount, mintedAmount);\\n    }\\n```\\n\\nAs we can see this join function deducts a fees from the deposited amount before minting. Lets see this joining fees\\nThe joining fees is introduced using setJoiningFee function\\n```\\nfunction setJoiningFee(uint256 fee) external onlyOwner {\\n        require(fee <= BASIS_PRECISION, "TrueFiPool: Fee cannot exceed transaction value");\\n        joiningFee = fee;\\n        emit JoiningFeeChanged(fee);\\n    }\\n```\\n\\nThis means the joiningFee will always be in between 0 to BASIS_PRECISION. This BASIS_PRECISION can be 100% as shown\\n```\\nuint256 private constant BASIS_PRECISION = 10000;\\n```\\n\\nThis means if joiningFee is set to BASIS_PRECISION then all user deposit will goto joining fees with user getting nothing
Issue Unregulated joining fees\\nPost calling join, check amount of shares minted for this user (use balanceOF on TrueFiPool2.sol) and if it is below minimum expected revert the transaction\\n```\\nuint256 tfUsdcBalance = tfUSDC.balanceOf(address(this));\\nrequire(tfUsdcBalance>=minSharesExpected, "Too high fees");\\n```\\n
Contract will lose all deposited funds
```\\nfunction join(uint256 amount) external override joiningNotPaused {\\n        uint256 fee = amount.mul(joiningFee).div(BASIS_PRECISION);\\n        uint256 mintedAmount = mint(amount.sub(fee));\\n        claimableFees = claimableFees.add(fee);\\n\\n        // TODO: tx.origin will be deprecated in a future ethereum upgrade\\n        latestJoinBlock[tx.origin] = block.number;\\n        token.safeTransferFrom(msg.sender, address(this), amount);\\n\\n        emit Joined(msg.sender, amount, mintedAmount);\\n    }\\n```\\n