# Read-only reentrancy in BondFixedTermTeller

BondFixedTermTeller mints ERC1155 bonds before updating supply, letting a recipient reenter and read stale supply to misprice bonds.

- Payout: Contest reward
- Severity: medium
- Program: Bond
- Credited: Zarf
- Disclosed: 2022-11-05
- Write-up quality: 6/10
- Original: https://github.com/sherlock-audit/2022-11-bond-judging/issues/23
- Library page: https://bugbountylibrary.com/r/sherlock%3A2022-11-bond%3AM-3
- Tags: domain:web3 impact:integrity kind:contest platform:sherlock sev:medium tech:evm tech:solidity technique:source-review vuln:accounting-error vuln:reentrancy

**Target:** BondFixedTermTeller ERC1155 minting (_mintToken/create/_handlePayout)
**Root cause:** _mintToken updates tokenMetadata[tokenId_].supply after _mint, so the ERC1155 receiver callback fires while supply is stale relative to minted tokens.
**Steps:**
1. Deploy a contract implementing ERC1155TokenReceiver as the bond recipient.
2. Call `create()` or trigger `_handlePayout()` so `_mintToken` mints bonds to the receiver.
3. In `onERC1155Received`, call an integrating contract that reads `tokenMetadata[tokenId_].supply` to price the bond.
4. Observe supply not yet incremented while tokens already exist, yielding a mispriced quote.
**How found:** Code reading of _mintToken ordering: noticed supply increment placed after _mint, and that ERC1155 mints invoke a receiver callback, enabling a read of stale supply.
**Exploitation:** Recipient contract reenters during the ERC1155 mint callback to query an integrator that derives price from the stale public `tokenMetadata` supply mapping, obtaining an incorrect price; no direct loss to BondFixedTermTeller itself.
**Insight:** For ERC1155/ERC721 mints, check whether any public supply/accounting mapping is read by integrators; ordering the state update after _mint creates a read-only reentrancy window even without a vulnerable function in the contract itself.
