1

The smart contract was written and deployed on Kovan using Remix IDE and injected Metamask Kovan test network account. However, I'll need python to deal with large input of a function in the smart contract. How can I do this? I have tried to register an Infura account and use it to interact with the function, the python code runs smoothly, but I can't see any changes to the smart contract. So I'm wondering how I can realize this goal. Thanks in advance.

My code logic is as follows.

w3 = Web3(Web3.HTTPProvider('https://kovan.infura.io/v3/...(my address)'))
ctr = w3.eth.contract(address=address, abi=abi) # address and abi are both specified previously
ctr.functions.my_func(input).call()

1 Answer 1

0

Any smart contract call cannot change the Ethereum state.

You need to perform a transaction and pay the gas fee to make any state changes. There are no free state changes.

Use transact() instead of call(). You will also need to set up a local private key.

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.