If the target creature is an illegal target by the time Code of Constraint tries to resolve, the spell doesn't resolve. You don't draw a card.

Artwork
Loading artwork…
Code of Constraint
The List · #RNA-35 · EN
Nonfoil—Foil—
Card rules
Target creature gets -4/-0 until end of turn.
Draw a card.
Addendum — If you cast this spell during your main phase, tap that creature and it doesn't untap during its controller's next untap step.
Uncommon · Illustrated by Ekaterina Burmak
Format legality
Brawl Legal
Commander Legal
Competitive Brawl Legal
Duel Legal
Gladiator Legal
Historic Legal
Legacy Legal
Modern Legal
Oathbreaker Legal
Pioneer Legal
Timeless Legal
Tlr Legal
Vintage Legal
Alchemy Not Legal
Future Not Legal
Old School Not Legal
Pauper Not Legal
Pauper Commander Not Legal
Penny Not Legal
PreDH Not Legal
Premodern Not Legal
Standard Not Legal
Standard Brawl Not Legal
Rulings
Published rulings from the downloaded Scryfall catalog. Source card record · Rules and interactions
Code of Constraint can target a creature that's already tapped. If you cast it during your main phase, that creature won't untap during its controller's next untap step.
Addendum abilities of instant spells apply while the spell is resolving, not immediately after casting it. If the spell is countered, you don't get the addendum bonus.
If an effect copies a spell with an addendum ability while it's on the stack, the copy wasn't cast at all, so you won't get the addendum bonus.