5

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.

0

2 Answers 2

13
$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 
2

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}`) 

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.