Send request to smart contract

Learn how to utilize smart contracts deployed using chain requests.

Before to start

  • In order to use Chain Request, the network selected by the user's project must exist.
    For information on the network selected by Project, refer to Project.
  • To use Chain Request, EQ Hub Wallet must be installed. For information related to EQ Hub Wallet, check EQ Hub Wallet (Extension).
  • In order to send a transaction, you must have more than the transaction fee of the network you wish to send the transaction.

Chain request service is a service that provides the ability to utilize various smart contracts deployed on EQ Hub's blockchain network. Check the smart contract information deployed through chain request and send the transaction!

This guide explains how to:

  • Utilizing smart contracts through chain requests

❗️

While using Chain request service, please note the following.

If a transaction is sent through a chain request, the data of the actually deployed smart contract may be changed.
Please note that this may result in the deployed smart contract not operating as intended by the distributor.


Utilizing smart contracts through chain request

Click [ Developer ] - [ Chain Request ] in the menu to enter the Chain Request page

Choosing a smart contract

Select the network and contract to check the smart contracts you have deployed.

DataDescriptionExample
Network / MicrochainSelect the network where the smart contract is deployed.EQ Hub Mainnet
ContractA smart contract deployed on the network of your choice.-

Connecting wallet

  1. Click the ‘Connect’ button displayed on the page.
  2. Click the ‘Connect’ button shown on the EQ Hub Wallet screen.
  3. When the connection is complete, the button displays the wallet address along with the phrase ‘Disconnect’, and the area where you can interact with the smart contract is displayed on the screen.

Choosing a function to implement

The types of smart contract functions that can be used in chain requests are as follows.

For information on the types of smart contract functions, refer to Smart Contract.

  • Call
    • You can inquire the value stored in the smart contract.
  • Transaction
    • You can change the value stored in the smart contract.

Entering arguments to run the function

Input of arguments may be required to execute functions defined in Call and Transaction.
If a separate argument is not required, the input field is not displayed on the screen, and if an argument is required, the type of value to be entered for each argument is displayed together.

For information related to smart contract arguments, refer to Smart Contract.

📘

Notes

When entering an array type (Type[]) value, separate them with commas.
ex) 0xF2… .4A, 0xAC... ..V1, 0xB2... .C2

  • For Payable Transaction
    When a transaction is executed, if the contract can receive coins, that label will be displayed.
    If you enter the amount of coins to be transferred while executing a transaction, coins will be sent as much as the amount entered when the transaction occurs.

Checking the Execution Result

After entering all required parameters, click the Call / Send button to execute the function.

  • You can check the result without a separate process when executing the Call function.

  • A signature is required to generate a transaction when executing the Transaction function. After clicking the button, click the Certificate button in the EQ Hub Wallet to sign the transaction and wait for a while to check the transaction result.


Concluding

So far, we have learned how to utilize smart contracts using the Chain Request service. Through the above process, you can view the data stored in the smart contract or change specific data to a desired value.

If you want to use smart contracts using APIs provided by EQ Hub without using EQ Hub's chain request service, Please refer to Web3.