Deploying Smart Contracts

Learn how the Truffle Framework deploys smart contracts and how to write deployment scripts for it.

Now that we know how to install Truffle and create a Truffle project, we'll look into smart contract deployment, one of the most powerful Truffle features. In a previous chapter, we deployed a smart contract to test the Ethereum network using the web3.js library. While that worked, it was cumbersome and required writing a lot of boilerplate code.

In this lesson, we'll see how to deploy smart contracts with Truffle and how a deployment process is organized. In the next lesson, we'll deploy the Auction smart contract using Truffle.

Migration steps

This process of smart contract deployment in Truffle draws inspiration from the migrations in the database world. Every Truffle project defines a smart contract deployment as a series of migration steps. Every migration step is a JavaScript file located in the migrations directory of the project.

Get hands-on with 1200+ tech skills courses.