Lost property should be announced for one full year
Question

I found some lost gold and sold it, and gave the money in charity. My intention if I find the owner and he does not like what I did is to give him the value of the gold, because I found it in the middle of a big city. Is there any sin on me for what I did?
Praise be to Allah.What you and anyone else who finds valuable lost property should do is to announce it for one full year in the places where people gather, two or three times each month. If it is identified by the owner, then hand it over to him, otherwise the finder can keep it after one year, because the Prophet (peace and blessings of Allah be upon him) gave instructions to this effect. An exception is made in the case of lost property found in Al-Haramayn (Makkah and Madeenah) – the finder cannot keep it, and it should be announced indefinitely until its owner is found, or the finder can hand it over to the authorities in charge of the Haramayn so that they can keep it for the owner, because the Prophet (peace and blessings of Allah be upon him) said concerning Makkah, “Property lost in Makkah is not permissible for anyone except its owner.” And the Prophet (peace and blessings of Allah be upon him) said: “I have made Madeenah sacred just as Ibraaheem made Makkah sacred.” The authenticity of the hadith is agreed upon.
But if the property is of insignificant value and the owner will not be bothered about it, such as a rope or shoelace or a small amount of money, then the finder does not have to announce it, and he can make use of it or give it in charity on behalf of the owner. This does not apply in the case of lost camels and other animals that are safe from small predators such as wolves etc.. It is not permissible to keep these animals, because the Prophet (peace and blessings of Allah be upon him) said to the one who asked him about that: “Leave it alone, for it has its feet and its water, and it can eat the trees until it finds its owner.” (Agreed upon).
And Allah is the source of strength.