Skip to content

fix: merge duplicate contract entries in convertOverridesToJSON#161

Merged
jackchuma merged 2 commits intomainfrom
jack/fix-overrides
Feb 24, 2026
Merged

fix: merge duplicate contract entries in convertOverridesToJSON#161
jackchuma merged 2 commits intomainfrom
jack/fix-overrides

Conversation

@jackchuma
Copy link
Collaborator

When Forge simulation produces multiple StateOverrideDecoded tuples for the same contract address, the previous code naively pushed one output entry per input tuple, yielding duplicate addresses in the stateOverride array. Replace the simple push loop with a two-phase aggregate-then-emit approach: phase 1 collects all storage slots into a Map keyed by lowercase address (last-wins on key collision), phase 2 emits one StateOverride entry per unique address in sorted order.

@cb-heimdall
Copy link
Collaborator

cb-heimdall commented Feb 24, 2026

✅ Heimdall Review Status

Requirement Status More Info
Reviews 1/1
Denominator calculation
Show calculation
1 if user is bot 0
1 if user is external 0
2 if repo is sensitive 0
From .codeflow.yml 1
Additional review requirements
Show calculation
Max 0
0
From CODEOWNERS 0
Global minimum 0
Max 1
1
1 if commit is unverified 0
Sum 1

@jackchuma jackchuma merged commit 7fb52f6 into main Feb 24, 2026
6 checks passed
@jackchuma jackchuma deleted the jack/fix-overrides branch February 24, 2026 22:11
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