Skip to content

fix(chains): correct multicall3 blockCreated for nine chains - #5518

Closed
gomesalexandre wants to merge 2 commits into
wevm:mainfrom
gomesalexandre:fix-multicall3-block-created
Closed

gomesalexandre wants to merge 2 commits into
wevm:mainfrom
gomesalexandre:fix-multicall3-block-created

Conversation

@gomesalexandre

@gomesalexandre gomesalexandre commented Nov 15, 2026 •

Copy link
Copy Markdown
Contributor

Fix Multicall3 blockCreated for Core Dao, Atleta Olympia, BOB, Shape, Soneium, Celo Sepolia and XDC Apothem

Seven chain definitions give a Multicall3 blockCreated that is later than the block where the contract appeared, and two more (added below) are wrong in either direction. Because of that, getChainContractAddress refuses blocks where Multicall3 already exists. An explicit multicall({ blockNumber }) throws ChainDoesNotSupportContract, and a batched call/readContract quietly falls back to one eth_call per read.

Core Dao has Avalanche's 11_907_934, copied over when the chain was added in #1255. Multicall3 was actually deployed on Core by the keyless deployer at block 6988931 (tx 0x07471adfe8f4ec553c1199f495be97fc8be8e0626ae307281c22534460184ed1). eth_getCode returns 0x at 6988930 and the bytecode at 6988931, on both core.drpc.org and rpc.ankr.com/core, and an aggregate3 call at block 7000000 succeeds. That covers the ~4.9M blocks between the real deployment and block 11907934.

Atleta Olympia's testnet was re-genesised after it was added. The declared contract 0x1472…7115 was created at block 70742 (tx 0xba6d0d30802ba16d48a303a8d86d9ef54e80a5dd9339a2bab0c82a65fae32b73). Both the default RPC and blockscout.testnet-v2.atleta.network show this, and eth_getCode returns 0x at 70741.

BOB, Shape, Shape Sepolia, Soneium and Soneium Minato have Multicall3 as an OP Stack genesis preinstall, so it should be 0 like Unichain, Ink and Katana. eth_getCode at 0x0 returns the bytecode on each default RPC and on a second provider (drpc or Alchemy). Those providers serve real genesis state, since the 0x4200…0011 fee vault holds 0x0 at block 0 and a non-zero balance at latest. The keyless deployer's nonce is still 0 on these chains. For BOB the old value blocked its first ~23k blocks. For the others it only blocks genesis. That started with #5474, which now checks block 0n against blockCreated.

Added on 2026-11-18, two testnets with the same class of error:

Celo Sepolia also has Multicall3 as a genesis preinstall. eth_getCode at 0x0 returns the 3808-byte canonical bytecode on rpc.ankr.com/celo_sepolia and celo-sepolia.drpc.org, the fee vault is empty at block 0, and the keyless deployer's nonce is 0, so 1 becomes 0.

XDC Apothem goes the other way: the declared 59765389 is too early. The keyless deploy at block 58910314 reverted (status 0, gas used 1000000), and eth_getCode returns 0x at 59765389 and at 84332999 and the bytecode from 84333000 on, on ankr, drpc and earpc.apothem.network. Block 84333000 is empty, so the code looks like it was put in at a fork. Before this, a multicall at any block in between hit an empty address. #4753 reported the missing code on Apothem back in June.

Like #5512, this only changes data, so it adds no test. getChainContractAddress.test.ts already covers the boundary.

🤖 Generated with Claude Code

Core Dao had Avalanche's 11907934 copied in. Multicall3 actually landed at
6988931 (keyless deployer tx 0x07471adf...84ed1). eth_getCode on
core.drpc.org and rpc.ankr.com/core is 0x at 6988930 and the bytecode at
6988931, and aggregate3 eth_call at 7000000 works on ankr. So multicall()
was refusing about 4.9M blocks where the contract exists.

Atleta Olympia's testnet was re-genesised after it was added. The declared
contract 0x1472...7115 was created at 70742 by tx 0xba6d0d30...2b73
(default RPC receipt, plus blockscout.testnet-v2.atleta.network).
eth_getCode is 0x at 70741 and code at 70742.

BOB (23131), Shape, Shape Sepolia, Soneium and Soneium Minato (all 1) get
Multicall3 as an OP Stack genesis preinstall. eth_getCode at 0x0 returns the
bytecode on each default RPC and on drpc/alchemy, those providers serve real
genesis state (fee vault 0x42..11 balance 0x0 at block 0, non-zero latest),
and the keyless deployer nonce is 0. So 0, same as unichain/ink/katana.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@vercel

vercel Bot commented Nov 15, 2026

Copy link
Copy Markdown

Someone is attempting to deploy a commit to the Wevm Team on Vercel.

A member of the Team first needs to authorize it.

@changeset-bot

changeset-bot Bot commented Nov 15, 2026 •

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 4c8e08d

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
viem Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

… apothem

Celo Sepolia ships Multicall3 as a genesis preinstall, so blockCreated is 0.
On XDC Apothem the keyless deploy at 58910314 reverted, and the bytecode first
appears at block 84333000.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@gomesalexandre gomesalexandre changed the title Fix Multicall3 blockCreated for Core Dao, Atleta Olympia, BOB, Shape and Soneium fix(chains): correct multicall3 blockCreated for nine chains Nov 18, 2026

jxom commented Nov 18, 2026

Copy link
Copy Markdown
Member

Thanks @gomesalexandre! I've carried this forward in #5581 with your commits intact. The Atleta Olympia change was dropped because the address configured there isn't Multicall3 (it has no aggregate3 and calls revert), so an earlier blockCreated would make more batched reads fail.

@jxom jxom closed this Nov 18, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants