Error while sending a transaction from Web3py to a Smart Contract in Remix

+1 vote

Ok, so I am trying to make a transaction by myself and send it to the contract compiled in the Remix IDE. I am using Ganache and Remix IDE. ( and the Python Code is being written in Jupyter Notebook )

here's the code I am using;

tx = {
    'nonce': nonce,
    'to': address_of_smart_contract,
    'value': web3.toWei(1, 'ether'),
    'gas': 2000000,
    'gasPrice': : web3.toWei('50', 'gwei'),
}

signed_tx = web3.eth.account.signTransaction(tx, private_key)


tx_hash = web3.eth.sendRawTransaction(signed_tx.rawTransaction)

This is the error message i'm getting ;

'message': 'VM Exception while processing transaction: revert', 'code': -32000

Please help me out!

Aug 5, 2019 in Blockchain by Yaxir

edited Aug 5, 2019 by Omkar 172 views

1 answer to this question.

0 votes
You get the revert error when a condition that is supposed to meet hasn't. Which will lead to the incorrect signing of the transaction.
answered Dec 12, 2019 by Vivek

Related Questions In Blockchain

0 votes
1 answer

Error in sending value to an Ethereum Smart Contract.

It is stated in Solidity 4.0 documentation ...READ MORE

answered Jul 23, 2018 in Blockchain by Perry
• 17,090 points
105 views
0 votes
1 answer

How do I send back ethers to the sender of the tokens in a smart contract?

Whenever a smart contract receives ether via ...READ MORE

answered May 30, 2018 in Blockchain by Perry
• 17,090 points
642 views
0 votes
1 answer

How is a request sent from an app to a smart contract?

Yes, the contract is distributed by every node ...READ MORE

answered Jun 4, 2018 in Blockchain by Perry
• 17,090 points
78 views
0 votes
1 answer

How to prevent the smart contract from being modified and deployed in the blockchain network?

To expand on Matthew's answer, each state ...READ MORE

answered Jul 5, 2018 in Blockchain by aryya
• 7,350 points
83 views
0 votes
1 answer

Truffle tests not running after truffle init

This was a bug. They've fixed it. ...READ MORE

answered Sep 11, 2018 in Blockchain by Christine
• 15,810 points
250 views
0 votes
1 answer
+3 votes
2 answers

How to run ethereumjs using Node.JS

You need to install testrpc globally on ...READ MORE

answered Mar 27, 2018 in Blockchain by ned_crew
• 1,620 points
213 views
0 votes
1 answer
+1 vote
3 answers

Removing double quotes from a string from JSON response in PHP

Just remove the json_encode call, and it should work: $resp ...READ MORE

answered Sep 12, 2018 in Blockchain by digger
• 26,660 points
9,988 views