Get contract functions

From UBot Studio
(Difference between revisions)
Jump to: navigation, search
 
(2 intermediate revisions by one user not shown)
Line 1: Line 1:
'''$list contract functions''' is a function that returns a list of functions available on a specified smart contract. This is specifically designed for enterprise users managing a series of interactions on the blockchain.
+
'''$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.
  
 
== Parameters ==
 
== Parameters ==
  
'''Chain:''' The specific blockchain network where the smart contract is located. The options in the dropdown include Avalanche and Binance Smart Chain.
+
'''Chain:''' The blockchain on which the smart contract resides.
  
'''Contract Address:''' The address of the particular smart contract for which the list of functions will be retrieved.
+
'''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 represents a list of functions available on 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>
 
ui console view
 
ui console view
config defi wallet("your private key here")
+
log object($get contract functions("BinanceSmartChain", "0x8965349fb649A33a30cbFDa057D8eC2C48AbE2A2"))
log("List of Contract Functions: {$list contract functions("BinanceSmartChain","0xBCfCcbde45cE874adCB698cC183deBcF17952812")}")
+
 
</pre>
 
</pre>
  
Please replace "your private key here" with your actual private key. Because private keys are extremely sensitive, exercise caution in handling them.
+
This script retrieves and logs all functions available on the specified smart contract. The contract address in the example is USDC token.
 
+
The output of this script will display a list of functions available on the specified smart contract (at address "0xBCfCcbde45cE874adCB698cC183deBcF17952812" on the "BinanceSmartChain"). An example of the output could look something like:
+
 
+
<blockquote>
+
List of Contract Functions: getReserves,swapExactTokensForTokensSupportingFeeOnTransferTokens,swapExactETHForTokensSupportingFeeOnTransferTokens,swapExactTokensForETHSupportingFeeOnTransferTokens
+
</blockquote>
+

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