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
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.
You can find the contract address in your build . json files. For example build/contracts/deployedContract. json Just search the file for address.
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
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With