Reproduce and Verify a Transaction in Virtual TestNet

Fork a fixed block, execute a repeatable WETH deposit through RPC and Foundry, and verify the reset result.

Case objective

Create a Virtual TestNet from a fixed Ethereum block, execute the same WETH deposit() with the same inputs, and verify that rebuilding the network restores a consistent starting state.

Example transaction and context

This case forks block 19850321 and uses Foundry's cast to send 1 ETH to the Ethereum WETH contract:

InputValue
Source chainEthereum
Fork block19850321
Test account0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266
WETH0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2
Calldeposit() with 1 ether value

Use these commands only against a Virtual TestNet. Use a test key and never place a production wallet key in shell history or documentation.

Questions to answer

  1. Does the RPC point to the expected fork block?
  2. Does deposit() increase the WETH balance by exactly 1 WETH?
  3. After deleting and rebuilding from the same block, do the initial state and result remain consistent?

Investigation steps

  1. Create an Ethereum Virtual TestNet with Block number set to 19850321.

  2. Copy the Public RPC URL from its detail page and define temporary local variables:

    export SKYLENS_RPC_URL="<YOUR_RPC_URL>"
    export SKYLENS_TEST_KEY="<TEST_PRIVATE_KEY>"
    export SKYLENS_TEST_ACCOUNT="0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266"
    export WETH_ADDRESS="0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2"
  3. Verify the height and record the WETH balance before execution:

    cast block-number --rpc-url "$SKYLENS_RPC_URL"
    cast call "$WETH_ADDRESS" \
      "balanceOf(address)(uint256)" "$SKYLENS_TEST_ACCOUNT" \
      --rpc-url "$SKYLENS_RPC_URL"
  4. Use Fund wallet to provide gas on the test network, then send the deposit:

    cast send "$WETH_ADDRESS" "deposit()" \
      --value 1ether \
      --private-key "$SKYLENS_TEST_KEY" \
      --rpc-url "$SKYLENS_RPC_URL"
  5. Query the WETH balance again, then open the transaction from Operations in Skylens.

  6. Delete the network, rebuild it from block 19850321, repeat steps 2–5, and compare both records.

Key evidence

Preserve at least the following evidence for every run:

CheckExpected result
cast block-numberInitial height corresponds to the fork block; it advances according to test-network behavior after transactions
cast send receiptSuccessful status and a transaction hash visible in Operations
WETH balance deltaafter - before = 1000000000000000000 wei
Balance ChangesApproximately -1 ETH and +1 WETH for the test account, plus gas
Balance after rebuildRestored to the value at the fork block
Second balance deltaAgain 1000000000000000000 wei

Use a balance delta instead of assuming the account starts with zero WETH. The result remains verifiable even if the forked account already has a balance.

Conclusion

Both Virtual TestNets start from block 19850321 and use the same account, contract, value, and calldata. Each deposit() increases WETH by exactly 1e18 wei. Rebuilding restores the same starting state, making the scenario repeatable and directly comparable.

Caveats

  • Treat a Virtual TestNet RPC as an external service and never use a production private key.
  • To reproduce a mainnet transaction, usually fork from the block immediately before it.
  • Record and fix Warp time for time-dependent behavior; this WETH deposit is not time-dependent.
  • Funding wallets, deploying contracts, and sending transactions mutate the current network, so reset or rebuild before another clean run.