Change the sender address in Truffle console

Does anyone know how to change the sender address in Truffle? I need to test with more than one account.

Thanks

Truffle uses web3.js under the hood, so whenever you send a tx, you can add a { from: '0x...'} option at the end. For instance:

erc20.transfer(to, value, { from: sender })

That said, for truffle-specific questions, I’d suggest you ask directly on their zenhub, gitter, or spectrum: https://www.trufflesuite.com/community

1 Like