Curse of Opulence's triggered ability resolves after attackers have been declared. Any costs to attack must have already been paid before the attacking player creates the Gold.

Artwork
Loading artwork…
Curse of Opulence
Tarkir: Dragonstorm Commander · #209 · EN
Nonfoil—Foil—
Card rules
Enchant player
Whenever enchanted player is attacked, create a Gold token. Each opponent attacking that player does the same. (A Gold token is an artifact with "Sacrifice this token: Add one mana of any color.")
Jingling coins beckon many an eager hand.
Uncommon · Illustrated by Kieran Yanner
Format legality
Commander Legal
Duel Legal
Legacy Legal
Oathbreaker Legal
Tlr Legal
Vintage Legal
Alchemy Not Legal
Brawl Not Legal
Competitive Brawl Not Legal
Future Not Legal
Gladiator Not Legal
Historic Not Legal
Modern Not Legal
Old School Not Legal
Pauper Not Legal
Pauper Commander Not Legal
Penny Not Legal
Pioneer Not Legal
PreDH Not Legal
Premodern 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
A player is attacking another player if they control a creature that's attacking that player. If no creatures are attacking the enchanted player as a Curse's ability resolves (most likely because they've left the battlefield), only the Curse's controller performs its actions.
Each Curse's ability triggers only once, no matter how many creatures are attacking the enchanted player.
The triggered ability of these Curses won't trigger if only a planeswalker controlled by the enchanted player is attacked.
If you enchant yourself with one of these Curses, you'll get its effects whenever another player attacks you.