If the artifact becomes an illegal target before resolution, then no damage is done.

Artwork
Loading artwork…
Detonate
The List · #MRD-88 · EN
Nonfoil—Foil—
Card rules
Destroy target artifact with mana value X. It can't be regenerated. Detonate deals X damage to that artifact's controller.
The goblins have forty-two different words for "ow."
Uncommon · Illustrated by Dave Dorman
Format legality
Commander Legal
Duel Legal
Legacy Legal
Modern Legal
Oathbreaker Legal
Penny Legal
PreDH Legal
Premodern Legal
Tlr Legal
Vintage Legal
Alchemy Not Legal
Brawl Not Legal
Competitive Brawl Not Legal
Future Not Legal
Gladiator Not Legal
Historic Not Legal
Old School Not Legal
Pauper Not Legal
Pauper Commander Not Legal
Pioneer Not Legal
Standard Not Legal
Standard Brawl Not Legal
Timeless Not Legal
Rulings
Published rulings from the downloaded Scryfall catalog. Source card record · Rules and interactions