# CompoundHandler#topUp() Using the wrong function selector makes native token topUp() always revert

Backd's CompoundHandler.topUp() called CEther.mint(uint256) but native cToken mint() takes no args, so selector mismatched and native topUp always reverted.

- Payout: Audit contest
- Severity: medium
- Program: Backd
- Credited: WatchPug
- Disclosed: 2022-06-02
- Write-up quality: 6/10
- Original: https://github.com/code-423n4/2022-04-backd-findings/issues/120
- Library page: https://bugbountylibrary.com/r/c4%3A2022-04-backd%3AM-12
- Tags: domain:web3 impact:dos kind:contest platform:code4rena sev:medium tech:evm tech:solidity technique:source-review vuln:misconfiguration

**Target:** CompoundHandler.topUp() in Backd actions contract interacting with Compound CEther
**Root cause:** A single CToken interface with mint(uint256) was used for both CErc20 and CEther, but CEther.mint() is payable with no parameters, so the encoded selector does not match any CEther function.
**Steps:**
1. Note CEther.mint() is `function mint() external payable` with no args.
2. Note Backd interface declares `mint(uint256 mintAmount)` and topUp calls `ctoken.mint{value: amount}(amount)` for underlying == address(0).
3. Call topUp with native token (address(0)); the 4-byte selector for mint(uint256) does not exist on CEther, so the call reverts.
4. Fix: use a separate CEther interface with parameterless mint() for native token path.
**How found:** Code reading: compared Compound's CEther.mint signature against Backd's shared CToken interface and noticed the parameter mismatch producing an invalid function selector.
**Insight:** When one interface abstracts both native and ERC20 variants of a contract (e.g. CEther vs CErc20), verify each variant's actual ABI; payable no-arg functions like mint() will silently break if you reuse an ERC20-shaped signature.
