         err = new Error("Compilation failed. See above.")
       callback(err)
 
+  @write_contracts: (config, description="contracts", callback) ->
+    mkdirp config.environments.current.directory, (err, result) ->
+      if err?
+        callback(err)
+        return 
+
+      display_directory = "." + config.environments.current.contracts_filename.replace(config.working_dir, "")
+      console.log "Writing #{description} to #{display_directory}" unless config.grunt.option("quiet-deploy")
+      fs.writeFileSync(config.environments.current.contracts_filename, JSON.stringify(config.contracts.classes, null, 2), {flag: "w+"})
+      callback()
+
+
   @compile: (config, callback) ->
     async.series [
       (c) ->


        interval = setInterval verify, 1000

    ], (err) ->
      if err?
        done_deploying(err)
        return
      
      mkdirp config.environments.current.directory, (err, result) ->
        if err?
          done_deploying(err)
          return 

        display_directory = "." + config.environments.current.contracts_filename.replace(config.working_dir, "")
        console.log "Writing contracts to #{display_directory}" unless config.grunt.option("quiet-deploy")
        fs.writeFileSync(config.environments.current.contracts_filename, JSON.stringify(config.contracts.classes, null, 2), {flag: "w+"})

        done_deploying()


module.exports = Contracts
          else
            c()
      (c) =>
        @compile_all(config, c)
      (c) =>
        @write_contracts(config, "contracts", c)
    ], callback

  @deploy: (config, compile=true, done_deploying) ->
    coinbase = null
