Call Write Function of Contract

Hi again :slight_smile:

i am almost done with all my coding, and it works great… moralis really is awesome. I have one last problem before i am finally done…

I need to call the Claim Function of an bep20 Contract. On Bscscan if i click the claimbutton, i need to pay some gas, and the rewards are sent to me… but on moralis if i call the claim function , nothing happens… no metamask popup or anything… as i already use some other functions of the contract, i know my calls are working… but them all read functions… this is the first write function. what do i have to do?

can you please share me an example or help me?


You’ll have to use .send function instead of .call in order to make a transaction.

yeah just figured it out, and had to add from address xD Thank you very much <3

Hey @Hydracoder

Also you can use our new SDK feature Moralis.executeFunction() . It makes calls to contracts easier :man_factory_worker:

It automatically detects is your contract method .call() or .send()

ohh thats nice to know! thank you for that info!

1 Like

You are welcome!

Happy BUIDLing :man_factory_worker: