Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

who is the owner of the contracts deployed using truffle?

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

like image 781
sheemar Avatar asked May 12 '17 10:05

sheemar


People also ask

How do truffles deploy contracts?

Truffle migrations are basically scripts that help us deploy our contracts to the blockchain. The first line is there to import the HelloWorld. sol file from the contracts folder, and line 4 deploys it to the blockchain.

How do you get the deployed contract address in Truffle?

You can find the contract address in your build . json files. For example build/contracts/deployedContract. json Just search the file for address.


1 Answers

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

like image 54
Crema Avatar answered Sep 24 '22 09:09

Crema