Get contract functions
Line 1: | Line 1: | ||
− | '''$ | + | '''$contract functions''' is a function that returns a list of functions on a specific smart contract. |
+ | |||
+ | This command retrieves all function signatures from the smart contract of a specific chain. | ||
== Parameters == | == Parameters == | ||
− | '''Chain:''' The specific blockchain | + | '''Chain:''' The specific blockchain chain where the smart contract resides. It can be either "Avalanche" or "BinanceSmartChain". |
− | '''Contract Address:''' The address of the | + | '''Contract Address:''' The address of the smart contract from which function details are to be fetched. |
== Return Value == | == Return Value == | ||
− | + | This function returns a list of function names available in the smart contract as a string. | |
− | This function returns | + | |
== Example == | == Example == | ||
<pre> | <pre> | ||
− | + | log("Functions in Smart Contract: {$contract functions("BinanceSmartChain","0x000...")}") | |
− | + | ||
− | log(" | + | |
</pre> | </pre> | ||
− | + | The output will be a list of strings where each string represents a function present in the smart contract. | |
− | + | Please remember to replace "0x000..." with the actual address of the smart contract you are interacting with. | |
+ | Example Output: | ||
<blockquote> | <blockquote> | ||
− | + | <p>Functions in Smart Contract: ["balanceOf", "transfer", "approve", "allowance", "transferFrom", "safeTransferFrom", "mint", "burn"]</p> | |
</blockquote> | </blockquote> |
Revision as of 19:06, 4 July 2023
$contract functions is a function that returns a list of functions on a specific smart contract.
This command retrieves all function signatures from the smart contract of a specific chain.
Parameters
Chain: The specific blockchain chain where the smart contract resides. It can be either "Avalanche" or "BinanceSmartChain".
Contract Address: The address of the smart contract from which function details are to be fetched.
Return Value
This function returns a list of function names available in the smart contract as a string.
Example
log("Functions in Smart Contract: {$contract functions("BinanceSmartChain","0x000...")}")
The output will be a list of strings where each string represents a function present in the smart contract.
Please remember to replace "0x000..." with the actual address of the smart contract you are interacting with.
Example Output:
Functions in Smart Contract: ["balanceOf", "transfer", "approve", "allowance", "transferFrom", "safeTransferFrom", "mint", "burn"]