I deployed something in the test-net(ropsten). Later, realized that one of my contracts needs some amendments. In such cases how to compile specific contracts and deploy only that contract using truffle command?

1 Answer 1


When you compile your contracts inside a truffle project, only the modified ones get compiled, if a build exists yet (if you want to recompile all contracts, run truffle compile --all).

From the command line, there is no options to just deploy one specific contract, but you can use the flags --f <number> and --to <number> to specify which contracts from specific migrations file(s) should be deployed (this also force the deployment). The number is the number prefix of the migration files inside the migrations folder.

So you have to modify your deployment script if you don't have 1 specific migrations file for the contract you want to deploy.

source truffle-docs

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.