#๐Ÿ”’ VM Exception while processing transaction: invalid opcode

16 messages ยท Page 1 of 1 (latest)

serene hearth
#

Hello , i'm developing an cryptocurrency token with python , and when i run my code , it give me this error : VM Exception while processing transaction: invalid opcode

obsidian escarpBOT
#

@serene hearth

Python help channel opened

Remember to:

  • Ask your Python question, not if you can ask or if there's an expert who can help.
  • Show a code sample as text (rather than a screenshot) and the error message, if you've got one.
  • Explain what you expect to happen and what actually happens.

:warning: Do not pip install anything that isn't related to your question, especially if asked to over DMs.

undone relic
#

full traceback?

serene hearth
#

sure

#
from web3 import Web3
import json

web3 = Web3(Web3.HTTPProvider('http://127.0.0.1:8545'))

with open("sol_QveriumToken.abi", "r") as abi_file:
    abi = json.load(abi_file)

with open("sol_QveriumToken.bin", "r") as bytecode_file:
    bytecode = "0x" + bytecode_file.read().strip()

contract = web3.eth.contract(abi=abi,bytecode=bytecode)

from_address = web3.eth.accounts[0]

gas_price = 2098119904

gas_limit = 6721975


deployed_token = contract.constructor().transact({
    "from": from_address,
    "gas": gas_limit,
    "gasPrice": gas_price
    }
)

tx_receipt = web3.eth.wait_for_transaction_receipt(deployed_token)

contract_address = tx_receipt.contractAddress

print(f"Token smart contract deployed at address: {contract_address}")
#

@undone relic

undone relic
#

i think you have to put something inside constructor()

#

as they mention in the docs

serene hearth
#

aw

#

lemme see

#

i don't understand what arguments constructor needed

#

each argument i use , it says excepted 0 arguments but using more argument than 0

obsidian escarpBOT
#
Python help channel closed

This help channel has been closed and it's no longer possible to send messages here. If your question wasn't answered, feel free to create a new post in #1035199133436354600. To maximize your chances of getting a response, check out this guide on asking good questions.