Skip to content

Transaction failure at first time, but succeed in second time with forge script. #10968

@Supeeerpower

Description

@Supeeerpower

Component

Forge

Have you ensured that all of these are up to date?

  • Foundry
  • Foundryup

What version of Foundry are you on?

1.2.3-stable

What version of Foundryup are you on?

1.1.0

What command(s) is the bug in?

No response

Operating System

Linux

Describe the bug

Actually I am running some command, but failing at first time, succeed in second time.

https://github.com/Lay3rLabs/wavs-middleware/tree/169-script-to-deregister-operator

I am running this command, which only passes in second time.

forge script script/eigenlayer/ecdsa/WavsDeregisterOperator.s.sol -vvv --rpc-url http://localhost:8545 --private-key "$OPERATOR_KEY" --broadcast

First output (Fail)

{
  "transactions": [
    {
      "hash": "0x548a129dc738aa4c89003d9448b7480eba71ede5556e6a3d21dcd2ef6732a05a",
      "transactionType": "CALL",
      "contractName": null,
      "contractAddress": "0xfe4eae5d84412b70b1f04b3f78351a654d28da25",
      "function": "deregisterOperator()",
      "arguments": [],
      "transaction": {
        "from": "0x7e8d0ec39584da6aa0d18eda9dc6a3a4870bc325",
        "to": "0xfe4eae5d84412b70b1f04b3f78351a654d28da25",
        "gas": "0x1f3ea",
        "value": "0x0",
        "input": "0x857dc190",
        "nonce": "0x6",
        "chainId": "0x4268"
      },
      "additionalContracts": [],
      "isFixedGasLimit": false
    }
  ],
  "receipts": [],
  "libraries": [],
  "pending": [],
  "returns": {},
  "timestamp": 1752026387,
  "chain": 17000,
  "commit": "c840f74"
}

Second output (success)

{
  "transactions": [
    {
      "hash": "0x6c862df83e0cd4953ea36b1616fc929ad10b248d0afad971959464da386a5c96",
      "transactionType": "CALL",
      "contractName": null,
      "contractAddress": "0xfe4eae5d84412b70b1f04b3f78351a654d28da25",
      "function": "deregisterOperator()",
      "arguments": [],
      "transaction": {
        "from": "0x7e8d0ec39584da6aa0d18eda9dc6a3a4870bc325",
        "to": "0xfe4eae5d84412b70b1f04b3f78351a654d28da25",
        "gas": "0x35df9",
        "value": "0x0",
        "input": "0x857dc190",
        "nonce": "0x7",
        "chainId": "0x4268"
      },
      "additionalContracts": [],
      "isFixedGasLimit": false
    }
  ],
  "receipts": [
    {
      "status": "0x1",
      "cumulativeGasUsed": "0x2700f",
      "logs": [
        {
          "address": "0xfe4eae5d84412b70b1f04b3f78351a654d28da25",
          "topics": [
            "0x88770dc862e47a7ed586907857eb1b75e4c5ffc8b707c7ee10eb74d6885fe594",
            "0x0000000000000000000000007e8d0ec39584da6aa0d18eda9dc6a3a4870bc325"
          ],
          "data": "0x000000000000000000000000000000000000000000000000000059acebaf51550000000000000000000000000000000000000000000000000000000000000000",
          "blockHash": "0x5ca3417f8c8e7f246c08b45e13ad0d3158a228117af214093d52056b6eb4b0d1",
          "blockNumber": "0x3f1096",
          "blockTimestamp": "0x686dcd0e",
          "transactionHash": "0x6c862df83e0cd4953ea36b1616fc929ad10b248d0afad971959464da386a5c96",
          "transactionIndex": "0x0",
          "logIndex": "0x0",
          "removed": false
        },
        {
          "address": "0xfe4eae5d84412b70b1f04b3f78351a654d28da25",
          "topics": [
            "0x86dcf86b12dfeedea74ae9300dbdaa193bcce5809369c8177ea2f4eaaa65729b"
          ],
          "data": "0x000000000000000000000000000000000000000000000000000059acebaf51550000000000000000000000000000000000000000000000000000000000000000",
          "blockHash": "0x5ca3417f8c8e7f246c08b45e13ad0d3158a228117af214093d52056b6eb4b0d1",
          "blockNumber": "0x3f1096",
          "blockTimestamp": "0x686dcd0e",
          "transactionHash": "0x6c862df83e0cd4953ea36b1616fc929ad10b248d0afad971959464da386a5c96",
          "transactionIndex": "0x0",
          "logIndex": "0x1",
          "removed": false
        },
        {
          "address": "0x055733000064333caddbc92763c58bf0192ffebf",
          "topics": [
            "0xf0952b1c65271d819d39983d2abb044b9cace59bcc4d4dd389f586ebdcb15b41",
            "0x0000000000000000000000007e8d0ec39584da6aa0d18eda9dc6a3a4870bc325",
            "0x0000000000000000000000007078df561cf252bdda2bfc987dabb476dec31b17"
          ],
          "data": "0x0000000000000000000000000000000000000000000000000000000000000000",
          "blockHash": "0x5ca3417f8c8e7f246c08b45e13ad0d3158a228117af214093d52056b6eb4b0d1",
          "blockNumber": "0x3f1096",
          "blockTimestamp": "0x686dcd0e",
          "transactionHash": "0x6c862df83e0cd4953ea36b1616fc929ad10b248d0afad971959464da386a5c96",
          "transactionIndex": "0x0",
          "logIndex": "0x2",
          "removed": false
        },
        {
          "address": "0xfe4eae5d84412b70b1f04b3f78351a654d28da25",
          "topics": [
            "0x31e0adfec71bccee37b6e83a90c2fedb17d8f1693fee863c4771e7bfe2aed580",
            "0x0000000000000000000000007e8d0ec39584da6aa0d18eda9dc6a3a4870bc325",
            "0x0000000000000000000000007078df561cf252bdda2bfc987dabb476dec31b17"
          ],
          "data": "0x",
          "blockHash": "0x5ca3417f8c8e7f246c08b45e13ad0d3158a228117af214093d52056b6eb4b0d1",
          "blockNumber": "0x3f1096",
          "blockTimestamp": "0x686dcd0e",
          "transactionHash": "0x6c862df83e0cd4953ea36b1616fc929ad10b248d0afad971959464da386a5c96",
          "transactionIndex": "0x0",
          "logIndex": "0x3",
          "removed": false
        }
      ],
      "logsBloom": "0x00000000000000000000000000000000000000000020000000000000010000000000002000080000000000000000000020000000000000000000000000020000000000000000000000000000000000000000000000000000000000000000000000000000800000000000008000000000000000000000000000000000400000000000000000000004000000000000000000001000000000000000000000801000080000000000000000000000000000200000000000000000000000000080000100000000000000000000000004400000000000000000000000000000000000008000000000000080000000004000800000000000000000000020000000000000",
      "type": "0x2",
      "transactionHash": "0x6c862df83e0cd4953ea36b1616fc929ad10b248d0afad971959464da386a5c96",
      "transactionIndex": "0x0",
      "blockHash": "0x5ca3417f8c8e7f246c08b45e13ad0d3158a228117af214093d52056b6eb4b0d1",
      "blockNumber": "0x3f1096",
      "gasUsed": "0x2700f",
      "effectiveGasPrice": "0xf4248",
      "blobGasPrice": "0x1",
      "from": "0x7e8d0ec39584da6aa0d18eda9dc6a3a4870bc325",
      "to": "0xfe4eae5d84412b70b1f04b3f78351a654d28da25",
      "contractAddress": null
    }
  ],
  "libraries": [],
  "pending": [],
  "returns": {},
  "timestamp": 1752026394,
  "chain": 17000,
  "commit": "c840f74"
}

To run this, need to deploy and register operator first.
Please check README, or I can share the script from build image to registering to reproduce this error.

Metadata

Metadata

Assignees

Type

No type

Projects

Status

Backlog

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions