Smart Contract - Read
Read data from a smart contract using its Read functions
Last updated
Read data from a smart contract using its Read functions
Last updated
Contract address
Text
Smart Contract Address
ABI
Text
Action name
Text
Optional parameters
In some cases to read a contract you need to indicate additional parameters
Parameter 1 - Parameter 3
Text
All are optional, if the contract requires 1 parameter, for example a wallet address, set it in the Parameter 1 and leave the rest empty
Contract read
Triggered when the reading data is available in the state.
Unknown Error Occurred
Triggers when reading a contract and something went wrong
Contract Read - Result
Text
All results will be converted to text, for example if it is JSON, you will have to parse it using regex or if it is number you will have to convert it to number type
This demo works on BSC chain, it reads the Pancakeswap contract to get the swap price for CAKE to BUSD
Simply copy and paste it, do not make changes, make sure the double quotes are of standard type and it is not auto replaced by single quote or other types.
Similar to how we found the Contract ABI demonstrated above, while you are in the Contract section on etherscan, open the Read Contract You will see a list of all functions available to read from the contract. Each can be opened and see what parameters it needs if any.
If a parameter is an array type with multiple data, set it all in one parameter by indicating the square brackets, make sure to use double quotes when it is string type. For example: Parameter 1:
Contract ABI. After contract deployment the ABI doesn't change, therefore it can be saved in your database and get it from there when needed. More about ABI see
This is the function name from the contract that you want to use. Case sensitive, make sure it is exactly as in the contract, for example: isOwner or balanceOf See where to find all contract functions and its parameters
The easiest way is to go directly to (or other blockchain scanner depends on where the contract is deployed) and search for it using the contract address. Then go to Contract section and search for the Contract ABI and just copy all of that text that you see in the ABI section.