Example - Write a function
In this example we will interact with a simple smart contract deployed by us for demo purpose.
We will use a smart contract from Goerli testnet. If you don't have any ETH on Goerli, get some from our faucet for fees. Contract used
0x399F1A6D5f2e67978E1D36B9F093A34526ed720F
This demo is available here
To get started, open the contract on Goerli etherscan It has a function called samplePay, this is the one we need

All these parameters doesn't do anything, it is needed only for our demo.
Parameter 1
It requires a string that represents a name
Alex
Parameter 2
It is a number, all parameters fields in plugin are of string type but it will auto convert to number if it detects one.
30
Parameter 3
It requires a bool (true,false), again the plugin will detect if this is a true false parameter and will convert it to bool automatically.
true
Transaction Value
Min payment for this contract is 0.001 ETH, so just set this number without converting to wei
0.001
This is how it looks:

Result
First thing you have to do to make sure the tx was sent successfully is to save the transaction hash as soon as it is available, to avoid situations when the user refresh or closes the page. Use the event "Transaction ID is ready" and get the transaction hash from state "Transaction Hash ID"
Example:

To check if a transaction was successfully confirmed use the Get Transaction confirmation action from the Utils element.
Additionally, you can use the event "Transaction Sent Successfully" for the cases when user doesn't close or refresh the page.
Last updated