Run smart contract function
Line 1: | Line 1: | ||
− | '''$run contract function''' is a function that runs a | + | '''$run contract function''' is a function that runs a specified function on a smart contract residing on a specific blockchain. |
+ | |||
+ | This function interacts with smart contracts and can execute functionality like transferring tokens or calling view functions. | ||
== Parameters == | == Parameters == | ||
− | '''Chain:''' The blockchain | + | '''Chain:''' The blockchain chain where the smart contract resides. It can either be "Avalanche" or "BinanceSmartChain". |
− | '''Contract Address:''' The address of the smart contract | + | '''Contract Address:''' The address of the smart contract from which you are calling the function. |
− | '''Function Name:''' The | + | '''Function Name:''' The name of the function you are calling on the smart contract. |
− | '''Parameters:''' The parameters that are to be passed to the | + | '''Parameters:''' The parameters that are to be passed to the function. They must match the parameters expected by the smart contract function. |
== Return Value == | == Return Value == | ||
− | + | This function returns a string value, which depends on the output of the function being called on the smart contract. | |
== Example == | == Example == | ||
<pre> | <pre> | ||
− | + | log("Smart Contract Function Output: {$run contract function("BinanceSmartChain","0x000...","swapExactTokensForETH","[\"1000000000000000000\",\"0\",\"[0x00...,0x...]\",\"clientAddress\",\"1636575577\"]")}") | |
− | + | ||
− | log("Smart Contract Function | + | |
</pre> | </pre> | ||
− | + | The output of this function will vary significantly depending on the smart contract and function being called. | |
− | + | Always remember to replace "0x000..." and other placeholders with actual addresses and values. Also, the parameters must be passed in a correct format; otherwise, the function call will fail. | |
− | + | NOTE: Interacting with smart contracts can lead to irreversible actions. Please make sure to understand what function you are running fully. | |
− | + | ||
− | + |
Revision as of 19:06, 4 July 2023
$run contract function is a function that runs a specified function on a smart contract residing on a specific blockchain.
This function interacts with smart contracts and can execute functionality like transferring tokens or calling view functions.
Parameters
Chain: The blockchain chain where the smart contract resides. It can either be "Avalanche" or "BinanceSmartChain".
Contract Address: The address of the smart contract from which you are calling the function.
Function Name: The name of the function you are calling on the smart contract.
Parameters: The parameters that are to be passed to the function. They must match the parameters expected by the smart contract function.
Return Value
This function returns a string value, which depends on the output of the function being called on the smart contract.
Example
log("Smart Contract Function Output: {$run contract function("BinanceSmartChain","0x000...","swapExactTokensForETH","[\"1000000000000000000\",\"0\",\"[0x00...,0x...]\",\"clientAddress\",\"1636575577\"]")}")
The output of this function will vary significantly depending on the smart contract and function being called.
Always remember to replace "0x000..." and other placeholders with actual addresses and values. Also, the parameters must be passed in a correct format; otherwise, the function call will fail.
NOTE: Interacting with smart contracts can lead to irreversible actions. Please make sure to understand what function you are running fully.