Skip to main content
Share Your Experience: Take the 2024 Developer Survey
9 votes
Accepted

Does using a very high gas limit somehow get your transactions executed slower?

In short: It's exactly as you suspect, a higher gas limit means your transaction is less likely to be included by miners. The reasoning: miners seek to maximize their profit within each block. Calls ...
iamdefinitelyahuman's user avatar
5 votes

web3, nodejs - How to put decimals values ‚Äčinto the toBn function

Just don't use BN. You need to convert ETH to WEI. This is a very simple proccess. Web3 has some buildt in functions for this: const val = 0.15; // this guy var weiAmount = web3.toWei(val);
cqx's user avatar
  • 3,462
4 votes
Accepted

Getting TX is not defined when trying to send signed transaction

You most probably miss the ethereumjs-tx node module. After you npm install ethereumjs-tx --save in your project, add this to the beginning of your script: const TX = require("ethereumjs-tx"); ...
Tudor Constantin's user avatar
4 votes
Accepted

Getting the warning Served eth_sendRawTransaction err="already known" on local blockchain with metamask

Thank you Ismael for your comment after much time spent with this error I have found that this error occurs when I reset my local geth node to the genesis block without resetting the account in meta ...
JegHeterSatoshi's user avatar
3 votes
Accepted

How to call write functions via Python web3.py, w3.eth.sendRawTransaction()

Your problem could be that you are using a wrong nonce, instead of setting it manually, you can use in web3py: nonce = w3.eth.getTransactionCount('your account address') hope this helps
Jaime's user avatar
  • 8,350
3 votes
Accepted

How can I properly set the gas / value for sending a transaction with web3.js?

Javascript doesn't support numbers with arbitrary precision that are required when doing calculation with ether values (ether has 18 decimals!). Web3 v1.0 it will wrap numeric values in bn.js objects....
Ismael's user avatar
  • 30.5k
3 votes
Accepted

Send more than one raw transaction quickly will throw an error

Most probably this is because when you send two raw transactions quickly, both of your transactions get the same nonce value as you are passing the transaction count of the address as nonce. So in ...
Aniket's user avatar
  • 3,545
2 votes

Transaction Hash after deploying contract with Web3.py too long

Function sendRawTransaction returns transaction hash rather than smart contract address. In order to get smart contract address, you have basically two options: Wait until transaction is mined, ...
Mikhail Vladimirov's user avatar
2 votes

Sending Signed Transaction returns pending and event:undefined

the sendSignedTransaction(...) returns a Promise (the same as getTransactionCount(...) above it). One way to get its result is to do it like: web3.eth.sendSignedTransaction('0x' + serializedTx....
Tudor Constantin's user avatar
2 votes
Accepted

Trying to send signed transaction through web browser using ethereum-tx

I see two elements that could help solving your problem: You are calling new TX(txData) instead of the recommended way new EthereumTx(txParams). Now, this might be to simple different naming of ...
Thomas Vanderstraeten's user avatar
2 votes
Accepted

How to pay gas fee for new addresses of ERC20 tokens that initially have 0 Eth balance?

ERC20 tokens consist of smart contracts which are built on top of the Ethereum network. This mean you must comply with the protocol specific pillars of this network, i.e. paying fees for network ...
6egic's user avatar
  • 1,327
2 votes

Sending a raw transaction

You can also sign a transaction using ethereumjs-tx. Give this try, const Tx = require('ethereumjs-tx'); const rawTx = { from: 'Your account address, to: 'Recipient account address', value: '...
Meet Siraja's user avatar
2 votes

web3, nodejs - How to put decimals values ‚Äčinto the toBn function

From the official documentation of BN: Note: decimals are not supported in this library. Here, the term decimals refers to numeric values with digits after the decimal point (i.e., non-integers). ...
goodvibration's user avatar
2 votes

How can I send ethers from my smart contract to another address using transfer?

Without seeing your code, this is just a guess, but maybe you're using Solidity 0.5.x and recievers_address is declared as an address rather than an address payable?
user19510's user avatar
  • 28.1k
2 votes

Ethereum Transaction Using cUrl and web3.php, I get a Receipt but the Transaction is not sent to the Network

It looks to me that your nonce is not right. Nonce should be an incrementing transaction counter, not derives from unixtimestamp. Also it seems you are missing gasLimit parameter?
Florian's user avatar
  • 21
2 votes
Accepted

sendRawTransaction error in web3.js

The error: Cannot convert string to buffer. toBuffer only supports 0x-prefixed hex strings and this string was given: [object Promise]1 Tells you that you have somewhere passed a Promise object ...
goodvibration's user avatar
2 votes

Raw transaction with web3j, tx hash is always null

Self answering my question for interested people: I found in web3j doc ethSendTransaction.getError() : EthSendTransaction ethSendTransaction = web3j.ethSendRawTransaction(hexValue).send(); if(...
avl's user avatar
  • 31
1 vote
Accepted

Gas issue on sendRawTransaction on the rinkeby network

From your code, you are checking the balance of an address and creating a new private key to sign the raw transaction. // Original balance let existingBalance = web3.fromWei(web3.eth.getBalance(...
Ismael's user avatar
  • 30.5k
1 vote

Web3 0.20 contract deployment

Constructor argument shall be part of the data. A quick check to see if you have prepared the correct data is to check if the two addresses that you would pass to the constructor is part of var data = ...
QYuQianchen's user avatar
1 vote
Accepted

Get return data from sendSignedTransaction

It will be much easier if you emit an event with the name and address, then you can just watch ContractInstance.allEvents when the transaction is mined. The other option is to wait for the ...
KNK's user avatar
  • 679
1 vote

Transaction does not get processed

I found the answer to my problem. I was submitting transaction with nonce=1 in some case and nonce=0 in some other. The case with nonce=1 cannot go forward because the case with nonce=0 need to be ...
Mathieu Dutour Sikiric's user avatar
1 vote

Sending transaction with web3.js

You are not providing too much informations for me to give you an easy way to do that :) , anyway this is one way to how you can send transaction: Better to use web3 1.0, you need also install ...
Majd TL's user avatar
  • 3,237
1 vote

Promise not resolved for web3eth.sendSignedTransaction

i had the same problem here and i found a temporary issue: The problem was with the web3 patch, i was using the version "1.0.0-beta.52". So, i returned to "1.0.0-beta.37" and everything worked. I ...
Danilo's user avatar
  • 111
1 vote
Accepted

Is it possible for a smart contract to relay raw signed transaction

Unfortunately a contract can't handle raw transactions. We would face all sorts of new issues if it was possible (such as who pays for the gas). Nothing prevents you from creating your own contract ...
Lauri Peltonen's user avatar
1 vote

Help with signTransaction

Nonce is basically the number of transactions published from the same address before. You may find correct value using web3.eth.getTransactionCount function. Note that for some old test networks, ...
Mikhail Vladimirov's user avatar
1 vote

Help with signTransaction

{ gas: web3.utils.toHex(3000000), gasPrice: web3.utils.toHex(await web3.eth.getGasPrice()), data: contractData, nonce: web3.utils.toHex(await web3.eth.getTransactionCount(...
Hamza Ahmed's user avatar
1 vote

Help with signTransaction

1.) Nonce is basically the amount of transactions sent from that account. You don't have to set it manually, you get it using web3.eth.getTransactionCount() 2.) Gas is the amount of gas to be used ...
Sumit Hotchandani's user avatar
1 vote

sending signed transactions from contract

Implement gas station network, paymaster will pay gas fees for sender user. You can implement gas station network on any chain.
naveen's user avatar
  • 11
1 vote

Using json RPC without any libraries besides js

In order to call a function in a contract you need to encode the function name and parameters following Solidity ABI specification. If you want to do that for any functions and parameters it can be ...
Ismael's user avatar
  • 30.5k
1 vote

Transaction Hash after deploying contract with Web3.py too long

sendRawTransaction returns a transaction hash, and you need the contract address. Transaction hashes are 32 bytes and addresses are 20 bytes. To get the address you have to examine the transaction ...
Ismael's user avatar
  • 30.5k

Only top scored, non community-wiki answers of a minimum length are eligible