code: def compile_contracts(self, target_path: Path) -> ContractManager:
          
          self.checksum_contracts()
  
          if self.overall_checksum is None:
              raise ContractSourceManagerCompilationError('Checksumming failed.')
  
          contracts_compiled = self._compile_all_contracts()
  
          target_path.parent.mkdir(parents=True, exist_ok=True)
          with target_path.open(mode='w') as target_file:
              target_file.write(
                  json.dumps(
                      dict(
                          contracts=contracts_compiled,
                          contracts_checksums=self.contracts_checksums,
                          overall_checksum=self.overall_checksum,
                          contracts_version=None,
                      ),
                      sort_keys=True,
                      indent=4,
                  ),
              )
  
          return ContractManager(target_path)
docs: Store compiled contracts JSON at `target_path`.