Example - Write a function
In this example we will interact with a simple smart contract deployed by us for demo purpose.
Last updated
In this example we will interact with a simple smart contract deployed by us for demo purpose.
Last updated
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
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.
It requires a string that represents a name
It is a number, all parameters fields in plugin are of string type but it will auto convert to number if it detects one.
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.
Min payment for this contract is 0.001 ETH, so just set this number without converting to wei
This is how it looks:
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.