How to interact with contract in Truffle Console?

I successfully deployed a contract on Ropsten https://ropsten.etherscan.io/token/0xf1a12f3aaa5a1055c9516e49d5848a9bc9513ee6. How do I interact with the contract on truffle console? I have tried

truffle console --network ropsten --verbose-rpc

let contract = await MyContract()
or
let contract = await MyContract.deployed()

Then try to call any methods but I keep getting

Uncaught TypeError: instance.getBalance is not a function

Thanks

1 Like

Hi @jirosaito,

For an example see: https://docs.openzeppelin.com/learn/deploying-and-interacting?pref=truffle#interacting-from-the-console

1 Like

Thank you, exactly what Iā€™m looking for. I was trying to find commands in the console but looks like I can just write a js script to run with console.log()

1 Like