Skip to content

Fix WearablesConfig create reentrancy#42

Open
cinnabarhorse wants to merge 1 commit intomasterfrom
codex/fix-wearables-config-reentrancy
Open

Fix WearablesConfig create reentrancy#42
cinnabarhorse wants to merge 1 commit intomasterfrom
codex/fix-wearables-config-reentrancy

Conversation

@cinnabarhorse
Copy link
Member

Moves WearablesConfigFacet.createWearablesConfig state updates (push + slotsUsed increment) before any ETH transfers.

Why:

  • The previous ordering allowed a reentrant owner/treasury contract to create another config before the outer call had persisted its slot usage, leading to slot/id desync (outer call returns id 0 but stores at index 1).

Tests:

  • npx hardhat test test/wearablesConfigReentrancy.test.ts

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.

1 participant