I am trying to call a contract function deployed in Ganache. I am pretty sure the contract is deployed because I can transact() and work with other functions. But when I call() it, I get this error:
Could not transact with/call contract function, is contract deployed
correctly and chain synced?
this is my function call:
updated_card = magic_ideas.functions.get_card('731759').call()
Previously, I have to "deploy an exam" with this code and it works correctly:
t_hash1 = magic_ideas.functions.new_card('title', 'example_text', 'www.card.com', '731759').transact()
I get a t_hash1. Then when I try to get_card
using .call()
I get the error. What am I missing?
EDIT
This is the contract declaration:
magic_ideas = w3.eth.contract(address="0x246eCb1dA50199FD7FcC20Ad08C617C52e34b128", abi=abi)
The abi is a copy & paste from remix.
Best Answer
use:
updated_card = magic_ideas.functions.get_card('731759').transact()
instead of
updated_card = magic_ideas.functions.get_card('731759').call()