An owner rescue/sweep function can withdraw the protocol's core token or user deposits, not just accidentally-sent stray tokens. This is a rug-pull primitive: the admin can drain everything under the guise of 'recovering' tokens.
// function sweep(address t) external onlyOwner { IERC20(t).transfer(owner, bal); } // owner: sweep(stakingToken) -> every staker's deposit sent to owner.
function rescue(IERC20 t) external onlyOwner {
require(t != stakingToken && t != rewardToken, "protected");
t.safeTransfer(owner(), t.balanceOf(address(this)));
}
Largest recorded losses in the same failure class — related, not the same bug:
The SaferICO scanner runs 201 detectors over your Solidity source, SAFE-0225 among them. Paste an address or the source itself — a small per-scan fee, shown before you sign, or unlimited on any plan.