Skip to content

fix: parse the address from cast create2 output on foundry >= 1.8 - #267

Merged
Ekleog-Polygon merged 3 commits into
mainfrom
fix/cast-create2-foundry-18
Sep 1, 2026
Merged

fix: parse the address from cast create2 output on foundry >= 1.8#267
Ekleog-Polygon merged 3 commits into
mainfrom
fix/cast-create2-foundry-18

Conversation

@Ekleog-Polygon

@Ekleog-Polygon Ekleog-Polygon commented Sep 1, 2026

Copy link
Copy Markdown
Contributor

Description

Contains two commits:

  1. @hadjiszs's foundryup/foundry bump (c209ac9, cherry-picked as-is): the old pinned foundryup broke upstream (foundryup: cannot execute binary file), and this moves installation to foundryup 1.9.1 / foundry stable (currently 1.8.1).

  2. A follow-up fix that bump exposes: since foundry 1.8, cast create2 prints <address>\t<salt> instead of just the address, so every script capturing its stdout breaks. First seen in the agglayer/agglayer merge queue (fix(deps): address RUSTSEC-2026-0253/0258 and CI toolchain drift agglayer#1772):

    not ok 3 bridge L2 originated ERC20 from L2 to L1
    (in tests/agglayer/bridges.bats, line 127)
    cast code ... failed with status 2
    error: invalid value '0x41D5...C88A	0x0000...0000' for '<WHO>': odd number of digits
    

    All six capture sites (bridges.bats, prover-stress.bats, lxly.bats, multi-chain-bridge.bats, bridge-tests-suite.bats, bridge-tests-helper.bash) now pipe through awk '{ print $1 }', which yields the same address on both old and new cast — verified empirically against cast 1.7.1 and 1.8.1 (cast create2 --json is not supported, so plain-output parsing it is).

agglayer/agglayer#1772 will pin its agglayer-e2e-ref to this branch's sha to get the merge queue through; landing this PR keeps main consistent with that pin.

🤖 Generated with Claude Code

hadjiszs and others added 2 commits September 1, 2026 16:33
Since foundry 1.8, cast create2 prints "<address>\t<salt>" instead of
just the address. Scripts capturing its stdout then fail, e.g. in the
agglayer-node-e2e job:

  not ok 3 bridge L2 originated ERC20 from L2 to L1
  cast code ... failed: invalid value '0x41D5...\t0x0000...' for '<WHO>'

Keep only the first field at every capture site. awk '{ print $1 }'
yields the same address on both old and new cast (verified against
1.7.1 and 1.8.1).

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Ekleog-Polygon added a commit to agglayer/agglayer that referenced this pull request Sep 1, 2026
foundry >= 1.8 (installed as 'stable' by the bumped foundryup) prints
'<address>\t<salt>' from cast create2, breaking the ERC20 bridge e2e
test in the merge queue. Point at agglayer/e2e#267, which parses the
address on both old and new cast.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@Ekleog-Polygon
Ekleog-Polygon requested review from jhkimqd and praetoriansentry and removed request for jhkimqd September 1, 2026 14:56
@Ekleog-Polygon Ekleog-Polygon assigned hadjiszs and unassigned hadjiszs Sep 1, 2026
@Ekleog-Polygon
Ekleog-Polygon merged commit 349cb52 into main Sep 1, 2026
7 checks passed
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.

3 participants