Get contract functions

From UBot Studio
(Difference between revisions)
Jump to: navigation, search
(Created page with "'''$get contract functions''' is a function that returns a list of all functions on a particular smart contract. Smart contracts are self-executing contracts written in code,...")
 
 
(4 intermediate revisions by one user not shown)
Line 1: Line 1:
'''$get contract functions''' is a function that returns a list of all functions on a particular smart contract.
+
'''$get contract functions''' is a function in UBot Studio that returns a list of functions accessible on a specific smart contract on a specified blockchain chain.
 
+
Smart contracts are self-executing contracts written in code, and they reside on the blockchain. They have functions that can be executed to perform actions such as transferring tokens, interacting with other smart contracts, and so on.
+
  
 
== Parameters ==
 
== Parameters ==
  
'''Chain:''' The blockchain network (like Avalanche or BinanceSmartChain) where the smart contract resides.
+
'''Chain:''' The blockchain on which the smart contract resides.
  
'''Contract Address:''' The address of the smart contract. This is a unique identifier associated with the smart contract on the blockchain.
+
'''Contract Address:''' The address of the smart contract for which you want to get the list of functions.
  
 
== Return Value ==
 
== Return Value ==
  
This function returns a string that includes a list of all functions that are present in the specified smart contract.
+
This function returns a yaml object with a list of functions and their parameters in the following format:
 +
<pre>
 +
first_function_name:
 +
    - first_parameter_name
 +
    - second_parameter_name
 +
second_function_name:
 +
    - first_parameter_name
 +
    - second_parameter_name
 +
</pre>
  
== Example ==
+
== Usage Example ==
  
 
<pre>
 
<pre>
log("Contract Functions: {$get contract functions("Avalanche", "0x.....")}")
+
ui console view
 +
log object($get contract functions("BinanceSmartChain", "0x8965349fb649A33a30cbFDa057D8eC2C48AbE2A2"))
 
</pre>
 
</pre>
  
In the example above, the '''$get contract functions''' function fetches a list of all functions present in the specified smart contract on the Avalanche blockchain network. The output is then logged to the console.
+
This script retrieves and logs all functions available on the specified smart contract. The contract address in the example is USDC token.
 
+
**Please note:**
+
 
+
The correctness and authenticity of the contract address are vital for this function to return the expected output. Any error in providing the accurate contract address may result in erroneous outputs or failures.
+

Latest revision as of 00:07, 5 July 2023

$get contract functions is a function in UBot Studio that returns a list of functions accessible on a specific smart contract on a specified blockchain chain.

[edit] Parameters

Chain: The blockchain on which the smart contract resides.

Contract Address: The address of the smart contract for which you want to get the list of functions.

[edit] Return Value

This function returns a yaml object with a list of functions and their parameters in the following format:

first_function_name:
    - first_parameter_name
    - second_parameter_name
second_function_name:
    - first_parameter_name
    - second_parameter_name

[edit] Usage Example

ui console view
log object($get contract functions("BinanceSmartChain", "0x8965349fb649A33a30cbFDa057D8eC2C48AbE2A2"))

This script retrieves and logs all functions available on the specified smart contract. The contract address in the example is USDC token.

Personal tools
Namespaces

Variants
Actions
Navigation
Toolbox