Getting a variable from a deployed contract #1534
-
Hey, i nearly googled for an hour but i didnt found a way to get a public variable value of a existing deployed contract. I created a contract object with address and abi and tried then to call a getter or smt but id didnt worked. |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 8 replies
-
Can you share what error do you get? |
Beta Was this translation helpful? Give feedback.
-
Done found the solution myself. |
Beta Was this translation helpful? Give feedback.
-
Solidity example:
then abi should look like this: let abi = [
"function startBlock() view returns (uint256)",
"function lastRewardBlock() view returns (uint256)",
"function rewardToken() view returns (IBEP20)"
] Solidity variables are basically async functions (without any arguments) |
Beta Was this translation helpful? Give feedback.
Done found the solution myself.