I'm a bit confused about migrations. I've just been told to use 1_migration.js file per contract, except maybe in the case of imports. I am going to change these migrations back to one per migration, but what about the first 2 contracts-- Do I need that first line and corresponding first call to .deploy(Ownable). Thank you for helping.


var Ownable = artifacts.require("./Ownable.sol");
var OmniCAT = artifacts.require("./OmniCAT.sol");
var IronLevels = artifacts.require("./IronLevels.sol");
var Dass42 = artifacts.require("./Dass42.sol");

// Make sure Ownable migrates first since OmniCat inherits
module.exports = function(deployer) {

contract OmniCAT is Ownable // imports Ownable
contract IronLevels is OmniCAT
contract Dass42 is OmniCAT

You do not need to explicitly deploy any contracts you inherit from, or any contracts that are deployed during the deployment of another contract. For instance, if you have:

contract A is B {


Contract B does not need to be deployed at all.

Additionally, if you have:

contract A is B {
    C cInstance = new C();

Then C will be deployed automatically as part of A's deployment.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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