# Wrong address passed to settlement

Check every address argument in settlement, event and cross-contract calls against the role it must hold

_Area: Smart contract access control and control flow. Seen in 3 disclosed reports; latest 2026-08-20. Updated 2026-11-17._

## How it works
A function builds a settlement record, event, or downstream call and fills an address field with the wrong value: the executing contract (`address(this)`), the current caller (`msg.sender`), or a locally-authenticated admin, where a configured token, the original sender, or the callee's expected contract identity belongs. The code compiles and often runs; the wrong identity is silently recorded or forwarded, so the record is corrupt or the downstream authorization check rejects it. The broken assumption is that "the address I have in scope" equals "the address this field means".

## Where it shows up
- Struct construction or event emission where an address field is set to `address(this)` or `msg.sender` instead of a stored/config state variable [E1](https://bugbountylibrary.com/r/c4%3A2024-08-chakra%3AH-01.md).
- Cross-contract calls that forward the caller or an admin EOA where the callee authenticates a specific contract address [E2](https://bugbountylibrary.com/r/c4%3A2026-04-k2%3AM-34.md).
- Wrappers around messaging primitives (retryable tickets, bridges) passing `msg.sender` into role parameters like refund/cancel/owner [E3](https://bugbountylibrary.com/r/c4%3A2022-12-pooltogether%3AM-01.md).
- Parallel implementations in two languages (Solidity vs Cairo, Rust) with equivalent functions [E1](https://bugbountylibrary.com/r/c4%3A2024-08-chakra%3AH-01.md).
- Any field named `from_*`, `caller`, `refundAddress`, `owner` populated from local scope rather than configuration.

## How to review
For each address argument, name the role it must hold (token being moved, original sender, authorized contract, refund recipient) and confirm the value's source matches that role. Invariant: every address written to a settlement record, emitted event, or forwarded call must be the entity that logically owns that right, not merely the entity currently executing. Trace the identity across each contract boundary and check it against the callee's authorization predicate [E2](https://bugbountylibrary.com/r/c4%3A2026-04-k2%3AM-34.md). Diff parallel implementations field-by-field [E1](https://bugbountylibrary.com/r/c4%3A2024-08-chakra%3AH-01.md).

## How finders spotted it
- Compared the Solidity handler against the Cairo reference, spotting `address(this)` where the token state variable was expected in both struct and event [E1](https://bugbountylibrary.com/r/c4%3A2024-08-chakra%3AH-01.md).
- Traced the configurator-to-router handoff, comparing the forwarded actor against the router's `validate_pool_configurator` check [E2](https://bugbountylibrary.com/r/c4%3A2026-04-k2%3AM-34.md).
- Read the messaging primitive's docs to learn which address gets the cancel right, then checked the relayer's call and saw `msg.sender` (the processor) instead of the original sender [E3](https://bugbountylibrary.com/r/c4%3A2022-12-pooltogether%3AM-01.md).

## Variants seen
- Self-address substituted for token address in settlement struct and event [E1](https://bugbountylibrary.com/r/c4%3A2024-08-chakra%3AH-01.md).
- Admin EOA forwarded instead of configurator contract, breaking upgrades [E2](https://bugbountylibrary.com/r/c4%3A2026-04-k2%3AM-34.md).
- Processor's `msg.sender` used as refund/cancel address, stripping the original caller's right [E3](https://bugbountylibrary.com/r/c4%3A2022-12-pooltogether%3AM-01.md).

## Impact and severity
Corrupt bridge transactions and misleading events [E1](https://bugbountylibrary.com/r/c4%3A2024-08-chakra%3AH-01.md); token upgrades permanently reverting `Unauthorized` [E2](https://bugbountylibrary.com/r/c4%3A2026-04-k2%3AM-34.md); users losing the ability to cancel their L1 calls, enabling griefing [E3](https://bugbountylibrary.com/r/c4%3A2022-12-pooltogether%3AM-01.md). Severity rises when the wrong address grants a right to the wrong party (E3) or blocks a privileged flow entirely (E2).

## Evidence
- E1: https://bugbountylibrary.com/r/c4%3A2024-08-chakra%3AH-01.md
- E2: https://bugbountylibrary.com/r/c4%3A2026-04-k2%3AM-34.md
- E3: https://bugbountylibrary.com/r/c4%3A2022-12-pooltogether%3AM-01.md
