current position:Home>How to use different users to call contract functions in truffle console

How to use different users to call contract functions in truffle console

2022-02-03 20:51:42 Q & A of Denglian community

Man Ask for help How does this work Novice Xiaobai asks for help




Take the answer 1:

What are you doing here truffle console Call the contract function in ? The way is this :

> qqq.withdraw(100, {from: "0x...."}) 

100: Is the parameter to call the contract function , Parameters must be entered first .{from: xxx}: This is an additional option ,from Indicates which address , This address needs to be console The address loaded in , For example ganache The address in will be loaded in .to: Represents an interactive object , The object here must be a contract , So there's no need to specify .value: It means that the transaction is attached eth Number , You don't have to .

You can also refer to the documentation Truffle Interact with contracts




copyright notice
author[Q & A of Denglian community],Please bring the original link to reprint, thank you.
https://en.netfreeman.com/2022/02/202202032051405493.html

Random recommended