I have started working with truffle since 4 months and I don't give importance to Migrations.sol, I thought it's just a "get started" contract.
But when I removed it caused a problem.
can anyone explains the role of this contract?
[Ethereum] what is the role of Migrations.sol contract in truffle project
truffletruffle-migration
Best Answer
The
Migrations
contract keeps track of which migrations were done on the current network.Inside the migrations folder, you'll see a file called
1_initial_migration.js
The1
in the filename is the reference number of a migration.Once you've created a couple of contracts, and want to deploy them using
truffle migrate
, you can create another migration file called2_name_of_migration.js
. Once the migration is done, Truffle will store that2
reference number in theMigrations
contract