# what is the role of Migrations.sol contract in truffle project?

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?

• this is a good reason I am not using truffle , it pollutes my testing environment, debug logs, and also spends unnecessary money on deployment. Not everybody can make a perfect product, it takes discipline and customer oriented mentality to be the first. – Nulik Aug 13 '18 at 21:01

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 The 1 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 called 2_name_of_migration.js. Once the migration is done, Truffle will store that 2 reference number in the Migrations contract

• but in prod it will consume gas that I'm not supposed to pay it. – maroodb Aug 13 '18 at 11:41
• Yeah, correct. I'm not a fan of this system because of that – Henk Aug 13 '18 at 11:47