<!-- canonical: https://0xsimao.com/findings/orange-authorized-required-indexes-stores -->

# authorized mapping is not required if the indexes mapping stores the indexes + 1

Low/Info · Three Sigma · Cross-chain bridge · 15th July, 2024

Finding 3S-OB-N06 of the Orange Bridge security review.

- Protocol: https://www.orangeweb3.com/
- Report: /reports/orange
- Source: https://cdn.sanity.io/files/qoqld077/production/686ad4e1d5035d69002f5f97e281e3c5a8b7ce00.pdf

---

### Description

BRC20Factory and Vault store the signers array, the authorized and indexes mapping.
The authorized mapping can be removed if the indexes mapping stores index + 1
instead, so the check for existing signers can be made as indexes[signer] != 0.

### Recommendation

Delete the authorized mapping, store the index as index + 1 in the indexes mapping and
check if the signer exists by doing indexes[signer] != 0.

### Status

Addressed in [#dcd6efe](https://github.com/orangecryptohq/orange-bridge-contract/commit/dcd6efe365c1c437b8a6f362c9b5497a4bfccb6c).
