I am very new to developing smart contracts. I have a simple question, do i need to write migration file separately for each contract i deploy from an account using truffle or can i deploy multiple contracts using a single migration file. How to write such file?

Any help please.

var Oracle = artifacts.require("./Oracle.sol");
var Test_Oracle = artifacts.require("./Test_Oracle.sol");

module.exports = function(deployer){

or if you have dependencies...like a constructor argument that takes an address of another deployed contract:

var Factory = artifacts.require("./Factory.sol");
var Tokendeployer = artifacts.require("./Tokendeployer.sol");

module.exports = function(deployer) {
        return deployer.deploy(Tokendeployer, Factory.address)

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.