You get to keep only enough to maintain a very modest lifestyle in a low-cost-of-living area, the rest of it has to go towards improving the world in some way.
Edit: Given the previous rules that you must maintain a very modest lifestyle in a low-cost-of-living area, would you rather choose to opt out and not have the money at all?
I set up a for profit corporation whose stated goal is to make the world a better play. I donate all the money to that corporation.
As the sole owner, I now have 5 billion dollars so I change the mission to something else because I don’t have time to deal with the poors who did work as hard as me to become this successful.