How to do it...

  1. Create and store migration scripts in the ./mirations directory. You can find the directory at the root of your project.
  2. Each file follows a naming convention that includes a number and description. The number denotes the order of execution and is used to record the status of migration. The suffix includes a human-readable description of the scripts:
2_token_migration.js
  1. In the migration script file, include the required import statements followed by the deployment steps:
// Import statementvar contract = artifacts.require("contract"); module.exports = function(deployer) {     // Deployment statement    deployer.deploy(contract); };
  1. Reference the contract using artifacts.require(). It is similar to require and import in JavaScript, ...

Get Ethereum Cookbook now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.