Facts :
you have received money from a project. You did you due diligence and the project was ok.
You do the work, and technically are entitled to payment for the work done.
Then you find out that the project is a scam. you halt your work and you are in a limbo situation
Thinking out loud :
Keeping the extra money for yourself could be considered as being part of the Scam (what if the money from 'project' came from a "victim')
Keeping a share based on the work done before you came aware of the scam situation is fine by me IF you then do a post to warn users about this project.
Especially if you explain that you refused to keep the funds.
If it is not you, someone else would have done the work.
I like Suchmoon analogy :
This would be more like a suspected bank robber trying to buy a ski mask and the store refusing to give him change from a $100. You either refuse to do business at all, or do business like you would with any other customer, and/or call the cops if you have a reason to.
If you don't sell the ski mask, someone else will.
As a seller, i would maybe take a picture of the credit card and contact the local police office to tell then what i noticed and provide my cctv footage.
But the tricky part, is that if you return the funds, they can use them to pay someone else to do some work and organise a new scam.
And finally if you give the money to some kind a charity you are at risk of someone coming later and claiming that those funds (project's fund) were actually stolen from them (aka a Victim) by the scammers and that it should have been returned to them.
Well, there is no prefect solution.
If the total sum was less than $1000 i would do as following :
If it was me, i'll keep my share, ditch the remaining to a charity.
But i would also be ready to give back the usd value donated to a charity if a victim finds me and ask for his funds.
Odds are that a bull market might come back and that a small % of the money kept as payment for the work will pay more than the money donated to the charity (usd equivalent).