# BondDepository.deposit double-charges partial native-ETH payments on WETH-quoted markets

**URL:** <https://ghostforum.org/t/bonddepository-deposit-double-charges-partial-native-eth-payments-on-weth-quoted-markets/86>\
**Category:** Resolved\
**Tags:** ghost-dao-contracts, duplicate\
**Created:** [October 2, 2026, 8:09am UTC](https://ghostforum.org/t/bonddepository-deposit-double-charges-partial-native-eth-payments-on-weth-quoted-markets/86 "2026-10-02T08:09:32Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![sus1lo](https://ghostforum.org/user_avatar/ghostforum.org/sus1lo/32/130_2.png) [@sus1lo](https://ghostforum.org/u/sus1lo)\
**Post date:** [October 2, 2026, 8:09am UTC](https://ghostforum.org/t/bonddepository-deposit-double-charges-partial-native-eth-payments-on-weth-quoted-markets/86/1 "2026-10-02T08:09:32Z")

</div>

**# [ghost-dao-contracts] `BondDepository.deposit` double-charges partial native-ETH payments on WETH-quoted markets**

`deposit()` in `src/BondDepository.sol` supports paying bonds with native ETH

on WETH-quoted markets. Sending partial ETH (`0 \< msg.value \< amount`) charges

the depositor twice: the ETH is wrapped and forwarded to the treasury, then the

full `amount` is pulled via `transferFrom` on top of it. The overpaid ETH is

unrecoverable.

```solidity

IWETH9(WETH).deposit{value: msg.value}();

IERC20(WETH).safeTransfer(TREASURY, msg.value);

if (msg.value \< amount || market.quoteToken != WETH) {

```
IERC20(market.quoteToken).safeTransferFrom(msg.sender, TREASURY, amount);

```

}

```

The `transferFrom` should pull `amount - msg.value` on a WETH market. It

currently pulls the full `amount` whenever `msg.value \< amount`.

This native-payment path was added by the ghostchain team in `6fec7ed`

(“ability to purchase bond with native coin”), replacing a plain

`transferFrom(amount)` — the double-charge is a bug in that custom feature,

not inherited behavior.

**## Reproduction**

Foundry test against `ghost-dao-contracts @ b87dff4`. WETH-quoted market, bond

amount 7 ether, `msg.value` 3 ether:

```solidity

uint256 tBefore = weth.balanceOf(address(treasury));

depository.deposit{value: 3 ether}(0, 7 ether, type(uint256).max, ALICE);

uint256 gain = weth.balanceOf(address(treasury)) - tBefore;

```

```

treasury gain: 10000000000000000000 // 10 ether credited for a 7-ether bond

alice ETH spent: 3000000000000000000

alice WETH spent: 7000000000000000000 // full amount pulled via transferFrom

```

Control cases (correct behavior): exact ETH (`msg.value == amount`) forwards

exactly `amount` with no `transferFrom`; pure WETH (`msg.value == 0`) pulls

exactly `amount`.

**## Impact**

Permanent overpayment of `msg.value` for any depositor attaching partial ETH.

Requires the victim’s own transaction; the surplus goes to the treasury, not

an attacker. Severity: Medium.

**## Fix**

```solidity

IWETH9(WETH).deposit{value: msg.value}();

IERC20(WETH).safeTransfer(TREASURY, msg.value);

if (market.quoteToken == WETH) {

```
if (msg.value < amount) {

    IERC20(WETH).safeTransferFrom(msg.sender, TREASURY, amount - msg.value);

} else if (msg.value > amount) {

    IWETH9(WETH).withdraw(msg.value - amount);

    payable(msg.sender).transfer(msg.value - amount);

}

```

} else {

```
if (msg.value > 0) revert DepositoryNoEthForTokenMarket();

IERC20(market.quoteToken).safeTransferFrom(msg.sender, TREASURY, amount);

```

}

```

---

<div class="post-metadata">

**Author:** ![VoidDragon](https://ghostforum.org/user_avatar/ghostforum.org/voiddragon/32/16_2.png) [@VoidDragon](https://ghostforum.org/u/VoidDragon)\
**Post date:** [October 3, 2026, 11:15pm UTC](https://ghostforum.org/t/bonddepository-deposit-double-charges-partial-native-eth-payments-on-weth-quoted-markets/86/2 "2026-10-03T23:15:32Z")

</div>

Thank you for your report!

For some reason markdown was completely broken for you post but I get what you are saying.

Take a look into [similar issue and answer for it](https://ghostforum.org/t/h9-bonddepository-deposit-mishandles-native-collateral-unrefunded-overpayment-double-pay-paths-getkvalue-underflow-bricks-valuation/122) please. In short, we do not think this somehow affects the protocol.

---

<div class="post-metadata">

**Author:** ![Colossus](https://ghostforum.org/user_avatar/ghostforum.org/colossus/32/10_2.png) [@Colossus](https://ghostforum.org/u/Colossus)\
**Post date:** [October 4, 2026, 6:34am UTC](https://ghostforum.org/t/bonddepository-deposit-double-charges-partial-native-eth-payments-on-weth-quoted-markets/86/3 "2026-10-04T06:34:52Z")

</div>

Closed on October 4, 2026, 6:34am UTC



---

<div class="post-metadata">

**Author:** ![Cosmos](https://ghostforum.org/user_avatar/ghostforum.org/cosmos/32/9_2.png) [@Cosmos](https://ghostforum.org/u/Cosmos)\
**Post date:** [October 12, 2026, 7:34pm UTC](https://ghostforum.org/t/bonddepository-deposit-double-charges-partial-native-eth-payments-on-weth-quoted-markets/86/4 "2026-10-12T19:34:11Z")

</div>

Opened on October 12, 2026, 7:34pm UTC


