saveContracts

Save wallet contract state to the database. Called by saveWalletTo