# Token return shape assumption reverts

Calls assuming a fixed return type or size from tokens or external contracts; check returndata handling and interface versions.

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

## How it works
A contract calls an external contract (a token, a rebasing token, a Safe) through an interface that declares a specific return type. Solidity's ABI decoder then enforces the exact returndata shape: a `bool` return requires 1 byte, a `uint256` requires 32 bytes, and a mismatched or empty return reverts the whole call. The broken assumption is that the target returns what your interface says. Real targets often return nothing (USDT `approve`), return a different type (Blast `configure` returns `uint256` balance, not `YieldMode`), or add new interface requirements in a version bump (Safe v1.4.0+ requires EIP-165 in `setGuard`). The call reverts, and any path through it is dead.

## Where it shows up
- Hand-written token interfaces cast onto arbitrary or user-supplied token addresses.
- `approve`/`transfer` called directly instead of via a safe-transfer library.
- Integrations with rebasing tokens (Blast) where the interface return type was copied from docs, not source.
- Guard/module registration against Safe or similar, where the target version added an interface check.
- Any external call whose return value is decoded but never used.

## How to review
For every external call, confirm the declared return type and size match the deployed target's actual source, not its docs. The invariant: the call must succeed for every token/contract the system claims to support, including ones returning zero bytes or a different type. Check that token transfers and approvals go through `SafeTransferLib`/`safeApprove`-style helpers that tolerate empty returndata. For ecosystem integrations, read the target's changelog for the version range you support and verify your contract satisfies any new interface requirement (e.g. `supportsInterface`).

## How finders spotted it
- Compared the local interface signature against the deployed source and noticed the return type mismatch (`YieldMode` vs `uint256` balance) [E1](https://bugbountylibrary.com/r/c4%3A2024-03-abracadabra-money%3AM-02.md).
- Noticed USDT's `approve` lacks a return value versus solmate's `bool`, reasoned about the compiler's returndata length check, confirmed with a fork PoC [E2](https://bugbountylibrary.com/r/c4%3A2023-09-maia%3AM-06.md).
- Read Safe's CHANGELOG for v1.4.0, found the new EIP-165 require in `setGuard`, then compared against the guard contract that only implements `IGuard` [E3](https://bugbountylibrary.com/r/c4%3A2023-10-brahma%3AM-01.md).

## Variants seen
- Wrong return type: interface says enum, target returns `uint256` balance; decode fails once balance exceeds 2 [E1](https://bugbountylibrary.com/r/c4%3A2024-03-abracadabra-money%3AM-02.md).
- Missing return data: target returns nothing, interface expects `bool` [E2](https://bugbountylibrary.com/r/c4%3A2023-09-maia%3AM-06.md).
- New interface requirement in a target version bump: guard lacks EIP-165, `setGuard` reverts with GS300 [E3](https://bugbountylibrary.com/r/c4%3A2023-10-brahma%3AM-01.md).

## Impact and severity
Each case permanently or conditionally blocks a core path: yield-claimable configuration can never be set [E1](https://bugbountylibrary.com/r/c4%3A2024-03-abracadabra-money%3AM-02.md); bridging with USDT reverts [E2](https://bugbountylibrary.com/r/c4%3A2023-09-maia%3AM-06.md); externally created Safes on v1.4.0+ cannot be integrated [E3](https://bugbountylibrary.com/r/c4%3A2023-10-brahma%3AM-01.md). Severity is medium in the evidence: functionality is broken but no funds are directly lost. Impact rises with how central the blocked path is and how many supported tokens or versions it covers.

## Evidence
- E1: https://bugbountylibrary.com/r/c4%3A2024-03-abracadabra-money%3AM-02.md
- E2: https://bugbountylibrary.com/r/c4%3A2023-09-maia%3AM-06.md
- E3: https://bugbountylibrary.com/r/c4%3A2023-10-brahma%3AM-01.md
