I opened truffle console and when I type my contract's name, I see a very long message on the console but not sure How do I deploy the contract and find the deployed contract address. Kindly advise.
$truffle console
truffle(development)>compile
truffle(development)>migrate
truffle(development)>contract_name.new().then(function(res) { sc = contract_name.at(res.address) })
truffle(development)>sc.address
For anyone coming here and using Truffle v5+, use .address
after a call to await ContractName.new()
. For example:
some_erc20_contract_instance = await ERC20.new()
console.log(`address: ${some_erc20_contract_instance.address}`)