0

for some reason my web3.eth.sendtransaction is stuck. I can only "flush" it by connecting to meta mask by sending myself $1 AVAX. I already set the gasLimit to block maximum and gas price to be 10% more than market. Am I missing anything?

  data: '{my contract ABI}',
  from: '0x8A8Dc9f4459D19A5A15C2E0C1A74494D5D0fd0AA',
  gasLimit: 8000000,
  gasPrice: 27500000000,
  nonce: 27

1 Answer 1

0

Without looking into the details of your implementation, these are several errors that may cause your transaction stuck.

  1. the data field should be the data sent to the smart contract, not '{my contract ABI}'.
  2. You may want to check the nonce too. Nonce has to be +1 of your last successful transaction in order for it to work.
  3. Increase your gasPrice. Your current setting seems to be fine since I checked the confirmed transactions, 27.5 GWEI looks reasonable.
5
  • I know, i put {} to indicate that is my ABI data because it is too long to post here. I have tried 2 & 3. It still hangs.
    – agoodname
    Commented Mar 25, 2023 at 20:45
  • Not to mention that you also need fill in the "to" address right? It would be helpful if you can share a sample transaction. If it didn't go through, it will probably show up in etherscan.io/txsPending. If it doesn't exist as a pending transaction, then there is probably something wrong with your dapp code. Commented Mar 27, 2023 at 5:56
  • {my contract ABI} in your example is actually the call data/parameters. It is a hex string. 🤔 Just want to make sure this part is correct. Commented Mar 27, 2023 at 6:02
  • it is the ABI of the contract. I am trying to create a contract there is why there is no "to"
    – agoodname
    Commented Mar 27, 2023 at 23:52
  • If you want to deploy a smart contract, the to address is the target address and the data field is the contract initialization code not the ABI. I don't have knowledge of how the contract init code is generated from Solidity. Perhaps you should evaluate an IDE like Remix to do this for you. You can find more about the tooling here: ethereum.org/en/developers/docs/smart-contracts/deploying. Commented Mar 29, 2023 at 2:28

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.