Is it shady? Hell yes.
Is it legal? Yes. Because the league looked at these antics a few years ago with Tampa's stashing of Kucherov, shrugged, and said 'no problem'. So now we have teams doing it as a standard course- Toronto is just the latest. Tampa, Vegas, and Boston all have pulled similar shenanigans, even Philly (though being as bad as they've been, no one cared).
I wish it was a loophole that got closed off, but the league is, for whatever reason, happy to let teams pull this- so, expect Toronto to not only get any flak for it, but expect them to keep doing it if they can while they try to get that cap mess under control again.