Solidity function:
function abc(address x, address y, address z) external payable returns (uint256 x) {
// something
}
In web3.py (python), I have called it successfully after deploying using following code:
w3.eth.call({
'value':1*10**18,
'gas':200000,
'gasPrice':25*10**9,
'to':contract_address,
'from':myaddress,
'data':data
})
data
is created by combining the addresses appropriately.
I tried the following in truffle:
ex = await Example.deployed()
ex.abc('0x...', '0x...', '0x...').call({'from':'0x...', 'to':'0x...', 'value':1*10**18,'gas':200000, 'gasPrice':20})
I'm getting error: Uncaught TypeError: ex.abc(...).call is not a function
But when I run ex.abc
, I get below output:
[Function (anonymous)] {
call: [Function (anonymous)],
sendTransaction: [Function (anonymous)],
estimateGas: [Function (anonymous)],
request: [Function (anonymous)]
}
So, how do I call this function in truffle?