var Bank = artifacts.require("Bank") var ATM = artifacts.require("ATM") module.exports = function(_deployer) { // Use deployer to state migration tasks. _deployer.deploy(Bank).then((bank) => { return bank.sendTransaction({value: "2000000000000000000"}).then(() => { return _deployer.deploy(ATM, bank.address).then((atm1) => { return Bank.deployed().then((instance) => { return instance.addATM(atm1.address); }).then(() => { return atm1.sendTransaction({value: "100000000000000000"}); }) }) }).then(() => { return _deployer.deploy(ATM, bank.address).then((atm2) => { return Bank.deployed().then((instance) => { return instance.addATM(atm2.address); }).then(() => { return atm2.sendTransaction({value: "100000000000000000"}); }) }) }) }) };