1

How can I send tron to a smart contract function in tronlink web. I am trying the below method, but not working.

var contract = await tronweb.contract().at('{{env('CONTRACT_ADDRESS')}}')
await contract.Invest({{session('member_id')}}).address.send(amount);

it's calling the smart contract function but not sending tron.

Haren Sarma
  • 2,267
  • 6
  • 43
  • 72

1 Answers1

2

callValue - Amount of SUN transferred to the contract with this transaction. (1TRX = 1,000,000 SUN)

await contract.Invest({{session('member_id')}}).send({callValue: amount})

You can check tronweb documentation for send () parameters.

Ming
  • 729
  • 3
  • 10