# Extra minting after `yield()` function causes iPT supply inflation and skewed accounting

Lender.lend and swivelLendPremium call yield() which already swaps PTs for iPTs to Lender, then mint extra iPTs to the user, inflating iPT supply and diluting redemption accounting.

- Payout: Contest reward
- Severity: medium
- Program: Illuminate
- Credited: kenzo
- Disclosed: 2022-10-15
- Write-up quality: 6/10
- Original: https://github.com/sherlock-audit/2022-10-illuminate-judging/issues/27
- Library page: https://bugbountylibrary.com/r/sherlock%3A2022-10-illuminate%3AM-18
- Tags: domain:web3 impact:funds-loss kind:contest platform:sherlock sev:medium tech:solidity technique:source-review vuln:accounting-error vuln:share-inflation

**Target:** Lender.sol lend/swivelLendPremium and yield() in Illuminate/Swivel integration
**Root cause:** yield() already purchases iPTs from the YieldPool into Lender's address, but the caller then calls authMint to mint additional iPTs to the user instead of transferring the swapped ones, so supply is inflated beyond backing.
**Steps:**
1. Call Lender.lend for Illuminate principal; observe `yield(u, y, a - a/feenominator, address(this), principal, minimum)` swaps PTs for iPTs held by Lender.
2. Observe subsequent `IERC5095(principalToken(u,m)).authMint(msg.sender, returned)` mints new iPTs to the user.
3. Same pattern in swivelLendPremium: `yield(...)` then `authMint(msg.sender, swapped)`.
4. Result: Lender retains swapped iPTs while user receives freshly minted iPTs, inflating total iPT supply.
5. On Redeemer.redeem, per-iPT payout is computed against inflated total supply, so each user receives less underlying than deserved.
**How found:** Code reading of the lend flow: noticed yield() already swaps PTs into iPTs at address(this), then spotted the follow-up authMint to msg.sender, concluding the mint is redundant and inflates supply.
**Exploitation:** Any legitimate lend/swivelLendPremium call triggers the double-mint; no attacker capital needed. Repeated normal usage inflates iPT supply, and redemption distributes underlying pro-rata against the inflated supply, shortchanging all redeemers until the team manually withdraws Lender's stranded iPTs and redistributes.
**Insight:** When a helper (yield/swap) already delivers the target asset to the contract, check whether the caller still mints or transfers a fresh amount to the user; double-counting of shares/tokens silently dilutes pro-rata redemption math.
