Skip to content

raise ValueError(response["error"]) ValueError: {'message': 'VM Exception while processing transaction: invalid opcode', 'code': -32000, 'data': {'stack': 'RuntimeError: VM Exception while processing transaction: invalid opcode\n #1717

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
duaa99 opened this issue Aug 25, 2020 · 2 comments

Comments

@duaa99
Copy link

duaa99 commented Aug 25, 2020

ganache_url = "HTTP://127.0.0.1:7545"

web3 = Web3(Web3.HTTPProvider(ganache_url))



abi =json.loads('')

bytecode=''




print(web3.isConnected())

web3.eth.defaultAccount = web3.eth.accounts[0]
Courses = web3.eth.contract(abi=abi, bytecode=bytecode)


rusalt = Courses.constructor().transact()
rusalt_receipt = web3.eth.waitForTransactionReceipt(rusalt)
contract = web3.eth.contract(address=rusalt_receipt.contractAddress,abi=abi,)

web3.eth.waitForTransactionReceipt(contract.functions.set_data(1,i,lis1[i]).transact({'from':'0x343A55f7792f6a355CD8f9109C869F9c6DA7b3a8'}))

Gives me an error on this
``web3.eth.waitForTransactionReceipt(contract.functions.set_data(1,i,lis1[i]).transact({'from':'0x343A55f7792f6a355CD8f9109C869F9c6DA7b3a8'}))

  raise ValueError(response["error"])
ValueError: {'message': 'VM Exception while processing transaction: invalid opcode', 'code': -32000, 'data': {'stack': 'RuntimeError: VM Exception while processing transaction: invalid opcode\n    at Function.RuntimeError.fromResults (/tmp/.mount_ganachTA7rCW/resources/static/node/node_modules/ganache-core/lib/utils/runtimeerror.js:89:13)\n    at module.exports (/tmp/.mount_ganachTA7rCW/resources/static/node/node_modules/ganache-core/lib/utils/gas/guestimation.js:142:32)', 'name': 'RuntimeError'}}

can help me .....

@kclowes
Copy link
Collaborator

kclowes commented Aug 26, 2020

@duaa99 my first guess is that it might be your bytecode. Is your bytecode correct?

@fselmo
Copy link
Collaborator

fselmo commented Jul 7, 2022

Invalid opcode seems related to bytecode as mentioned in this issue, please reference similar answers that point this is not a library issue. If it is believed to be, please feel free to reopen or ask to reopen.

@fselmo fselmo closed this as completed Jul 7, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants