3

I've started the Ethernaut challenge. I have a problem with forever pending transaction on Goerli, here is the link : https://goerli.etherscan.io/tx/0x93d1d44d7270ec53874751d20ebe65ba2f9c53249562c3e263cb5cb6d01baeae

What I don't understand is that my transaction is not on the mempool of pending transaction here : https://goerli.etherscan.io/txsPending

I'm probably doing something wrong on the signing?

I'm using hardhat to submit my transaction Here is my test file :

import { Contract, Signer } from "ethers";
import { ethers } from "hardhat";
import { formatEtherscanTx } from "./utils";

let accounts: Signer[];
let eoa: Signer;
let attacker: Contract;
let challenge: Contract; // challenge contract
let tx: any;

before(async () => {
    accounts = await ethers.getSigners();
    [eoa] = accounts;
    const challengeFactory = await ethers.getContractFactory("Fallback");
    challenge = challengeFactory.attach(
        `0xA6D6a254309C58273C02CE3D4312151609E977b6`
    );
    console.log("Initialiazed!");
});

it("solves the challenge", async function () {
    console.log("contribute");
    tx = await challenge.contribute({
        value: ethers.utils.parseUnits(`1`, `wei`),
    });
    console.log(formatEtherscanTx(tx.hash));
    await tx.wait();

    console.log("sendTransaction");
    tx = await eoa.sendTransaction({
        to: challenge.address,
        value: ethers.utils.parseUnits(`1`, `wei`),
    });
    console.log(formatEtherscanTx(tx.hash));
    await tx.wait();

    console.log("withdraw");
    tx = await challenge.withdraw();
    console.log(formatEtherscanTx(tx.hash));
    await tx.wait();
    console.log("withdrawn !");
});

Hardhat config :

networks: {
        goerli: {
            url: ARCHIVE_URL,
            accounts,
            gasPrice: 120000000000,
        },
        hardhat: {
            accounts,
            forking: {
                url: ARCHIVE_URL,
                blockNumber: 7760124,
            },
        },
    },

With ARCHIVE_URL my Infura endpoint.

Here is the same transaction with Gwei auto calculation, which is still pending too.

2 Answers 2

1

Those pass and took a long time. My advice is to put high gasFee (200 Gwei works well) on testnet. Happy coding everyone

1

I also had forever pending transactions on mumbai, but it was because I was playing with nonces.

I sent a transaction with much higher nonce, and it was stuck because providers are required to process nonces sequentially. Meaning, if your last transaction nonce was 9, and you send a new tx with 11 it will be stuck until the tx with nonce=10 will be sent.

Just saying this in case someone stumbles upon this problem too :))

2
  • THIS IS MY PROBLEM THANK YOU
    – Bruce
    Commented Mar 17, 2023 at 1:34
  • Indirectly, but my local deploy scripts are increasing the nonce even if the transaction is not confirmed on the chain. and currently I have a buuuunch of them waiting behind one with a low gas price value.
    – Bruce
    Commented Mar 17, 2023 at 1:41

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.