Advertisement
Guest User

Untitled

a guest
Aug 17th, 2017
268
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. var SafeMath = artifacts.require("./SafeMath.sol");
  2. var TahaCoin = artifacts.require("./TahaCoin.sol");
  3. var Crowdsale = artifacts.require("./Crowdsale.sol");
  4. module.exports = function(deployer) {
  5. var owner = web3.eth.accounts[0];
  6. var wallet = web3.eth.accounts[1];
  7.  
  8. //var owner = '0x398DB5039aA7f064a8cBDe5c302E09E2cAc46487';
  9. //var wallet = '0x6A0a14e7aAF404D0E5Cc118ECA740568d936fC9F';
  10.  
  11. console.log("Owner address: " + owner);
  12. console.log("Wallet address: " + wallet);  
  13.  
  14. deployer.deploy(SafeMath, { from: owner });
  15. deployer.link(SafeMath, TahaCoin);
  16. deployer.deploy(TahaCoin, { from: owner }).then(function(instance) {
  17.  
  18. console.log("TahaCoin address: " + TahaCoin.address);
  19. return deployer.deploy(Crowdsale, TahaCoin.address, wallet, { from: owner }).then(function(instance) {
  20.         console.log("Crowdsale address: " + Crowdsale.address);
  21.         return TahaCoin.deployed().then(function(coin) {
  22.             return coin.owner.call().then(function(owner) {
  23.                 console.log("TahaCoin owner : " + owner);
  24.                 return coin.transferOwnership(Crowdsale.address, {from: owner}).then(function(txn) {
  25.                     console.log("TahaCoin owner was changed: " + Crowdsale.address);        
  26.                 });
  27.             })
  28.         });
  29.     });
  30. });
  31. };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement