6

I have a Smart Contract, created / migrated with Truffle to TestRPC. TestRPC provides several default accounts. If I call functions within the Smart Contract from the Truffle console it does that always from the same address, even if when I set web3.eth.defaultAccount = 'anotherAddress';.

What I want is to be able to call functions from different addresses provided by TestRPC. How can I achieve that?

And if I want to use web3.eth.sendTransaction, where I can specify from and to how do I specify the parameters of the function?

Thanks

1
  • instance2.b_fun1(a_address) Commented Mar 29, 2018 at 8:18

1 Answer 1

6

You can pass options object as a last argument of contracts method.

contractInstance.someMethod(arg1, arg2, { from: 'someAddress' }); 
0

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.