Once Ali purchased a plot of land from a person in Madina. When the plot was dug a treasure was found therein. Ali would not except the treasure, as it did not come from a part of his transaction with the original owner. He offered the treasure to the original owner, but he did not except it. Thereupon Ali distributed the entire treasure in charity.
"When a person dies, his works end, except for three: ongoing charity, knowledge that is benefited from, and a righteous child who prays for him."
Prophet Mohammed (PBUH)
"The best of what a man leaves behind are three: a righteous child who supplicates for him, ongoing charity the reward of which reaches him, and knowledge that is acted upon after him."
Sunan Ibn Mājah
"Every day two angels come down from Heaven and one of them says, 'O Allah! Compensate every person who spends in Your Cause,' and the other (angel) says, 'O Allah! Destroy every miser.'"
Sahih Bukhari