I am trying to figure out how to return the address of a contract when I deploy it with truffle's deployer.deploy. So the goal is that when I deploy a contract that is a custom token, I want to return that address once it's deployed and pass that address to my CrowdSale contract constructor. I am getting undefined for the instance of the deployed contract when doing this like so:
1_initial_migration.js
module.exports = function(deployer) {
deployer.deploy(Migrations);
deployer.deploy(CrowdTestToken).then((instance) => {
console.log(instance);
deployer.deploy(CrowdSale, instance.address);
});
};
In the above example, instance is undefined. Does anybody know how I can get the address of the CrowdTestToken contract in the deployment script?