Run smart contract function
(Created page with "'''$run smart contract function''' is a function that allows you to execute a function on a specific smart contract. Smart contracts are programmable contracts on the blockch...") |
|||
Line 1: | Line 1: | ||
− | '''$run | + | '''$defi contract run''' is a function that runs a specified function on a smart contract. |
− | + | Designed for enterprise users, this function is particularly useful for interacting with DeFi protocols on Avalanche and Binance Smart Chain. | |
+ | |||
+ | == User Level == | ||
+ | |||
+ | This function is exclusively available for enterprise users. | ||
== Parameters == | == Parameters == | ||
− | '''Chain:''' The blockchain | + | '''Chain:''' The blockchain where the smart contract is located. The options are "Avalanche" or "BinanceSmartChain". |
− | '''Contract Address:''' The address of the smart contract | + | '''Contract Address:''' The address of the smart contract. |
− | '''Function Name:''' The | + | '''Function Name:''' The specific function that you want to run on the smart contract. |
− | '''Parameters:''' | + | '''Parameters:''' Additional parameters to be included when running the function on the smart contract. |
− | == Return Value == | + | == Return Value == |
− | This function | + | This function returns a string value that represents the output of the function that's run on the smart contract. |
== Example == | == Example == | ||
<pre> | <pre> | ||
− | + | define areacode | |
+ | ui text msg("Function Output: {$defi contract run("BinanceSmartChain", "0x...", "swapExactETHForTokens", "['500', '0x...', '0x...', '1600396754']")}") | ||
</pre> | </pre> | ||
− | In | + | In this example, the function "swapExactETHForTokens" is run on a smart contract located on the Binance Smart Chain. The smart contract address, function name, and parameters have been anonymized for security reasons. Replace these with your actual details. |
− | + | ||
− | + | ||
− | + | ||
− | + |
Revision as of 18:29, 4 July 2023
$defi contract run is a function that runs a specified function on a smart contract.
Designed for enterprise users, this function is particularly useful for interacting with DeFi protocols on Avalanche and Binance Smart Chain.
Contents |
User Level
This function is exclusively available for enterprise users.
Parameters
Chain: The blockchain where the smart contract is located. The options are "Avalanche" or "BinanceSmartChain".
Contract Address: The address of the smart contract.
Function Name: The specific function that you want to run on the smart contract.
Parameters: Additional parameters to be included when running the function on the smart contract.
Return Value
This function returns a string value that represents the output of the function that's run on the smart contract.
Example
define areacode ui text msg("Function Output: {$defi contract run("BinanceSmartChain", "0x...", "swapExactETHForTokens", "['500', '0x...', '0x...', '1600396754']")}")
In this example, the function "swapExactETHForTokens" is run on a smart contract located on the Binance Smart Chain. The smart contract address, function name, and parameters have been anonymized for security reasons. Replace these with your actual details.