It is foolish to do "contract work" with no contract, period.
The other key deterrent is to keep a handle on your deliverables until the client pays you. That does not mean "kill switch" in an app running on someone else's servers, it means (whenever possible) don't put the deliverables on someone else's servers until they pay you.
If the work depends on their pre-existing code or assets, get the dependencies into your private and properly secured development environment (with a tightly scoped license and NDA to protect the client).
And make sure your contract says that until they pay you, everything you create is your property. You can't claw fees out of a bankrupt client, but you can at least keep exclusive rights to your work.
The other key deterrent is to keep a handle on your deliverables until the client pays you. That does not mean "kill switch" in an app running on someone else's servers, it means (whenever possible) don't put the deliverables on someone else's servers until they pay you.
If the work depends on their pre-existing code or assets, get the dependencies into your private and properly secured development environment (with a tightly scoped license and NDA to protect the client).
And make sure your contract says that until they pay you, everything you create is your property. You can't claw fees out of a bankrupt client, but you can at least keep exclusive rights to your work.