13

I am using testrpc and truffle to test my contract.

When I type truffle migrate , this will deploy my contract to the testrpc network.

My question is , which account (from testrpc accounts) has been used to deploy the contract.

In other word, whose the contract owner?

Thank you in advance

sheemar
  • 467
  • 3
  • 13

1 Answers1

23

By default the owner is accounts[0] so the first account on the list but you can set the owner by adding "from" in the truffle.js config file

module.exports = {
  networks: {
    development: {
      host: "localhost",
      port: 8545,
      network_id: "*",
      from: "0xda9b1a939350dc7198165ff84c43ce77a723ef73"
    }
  }
};

for more information about migration see this https://github.com/trufflesuite/truffle/issues/138

0xCrema.eth
  • 887
  • 1
  • 9
  • 22
  • @Crema thanks for the answer. I am also wandering how to set the custom account to execute transaction? For example in truffle console i have something like Hello.deployed().then(function(){h = instance}), and then h.exetuceTransaction() will burn gas from the accounts[0] by default. How can I specify the account from which I want to send this transaction (for example accouts[1])? – branko terzic Jun 29 '17 at 15:16
  • 1
    @brankoterzic I think you just have to specify the `from`parameter when calling `executeTransaction({"from" : "0x..." })` check [The doc](https://github.com/ethereum/wiki/wiki/JavaScript-API#web3ethsendtransaction) – 0xCrema.eth Jun 29 '17 at 15:27