From: Rabbi Moshe Sofer
To: Rabbi Leib Hersh
A deathbed testator designated 200 gold coins via a guardian to fund a specific poor girl's marriage, stipulating the funds be given only at her wedding; she died unmarried. The Chasam Sofer rules that the girl's heirs have no claim, relying on the majority of Rishonim following R. Chaim Kohen's umdena principle that the pledge was made solely to marry her off. The surplus reverts to the testator's Torah heirs, not to his wife, since the 8,000 coins were never part of her bequest.
Source: Shu"t Chasam Sofer YD §238