CONTRACTFIX: A Framework for Automatically Fixing Vulnerabilities in Smart Contracts