Skip to content

Introduce Full Native ETH Support for Auctions Including Bidding, Withdrawals, and Final Settlement #37

@aniket866

Description

@aniket866

Issue:
All auction contracts assume biddingToken is an ERC20 and rely exclusively on IERC20 / SafeERC20 for value transfers.
There is no support for native ETH (or the chain’s native currency), and token addresses are assumed to always be contracts.

Why It’s Critical:
Users commonly want to bid using native ETH rather than wrapped tokens (e.g., WETH).
The current design prevents ETH-based auctions and incorrectly treats address(0) as an invalid token.

Affected Areas

Files:

  • Auction.sol
  • AllPayAuction.sol
  • EnglishAuction.sol
  • VickreyAuction.sol
  • LinearReverseDutchAuction.sol
  • ExponentialReverseDutchAuction.sol

Repeated Assumption (example):

receiveERC20(auction.biddingToken, msg.sender, bidAmount);

Required Refactor;

Fix Overview:

  • If the token address is address(0), interpret it as native ETH, not an ERC20 token.

Key Changes Required:

  • Make createAuction, bid, and commitBid functions payable
  • Update receiveERC20 and sendERC20 helpers to branch on token type

Example Direction:

if (token == address(0)) {
    require(msg.value == amount, "Invalid ETH value");
} else {
    IERC20(token).safeTransferFrom(from, address(this), amount);
}
if (token == address(0)) {
    (bool ok, ) = to.call{ value: amount }("");
    require(ok, "ETH transfer failed");
} else {
    IERC20(token).safeTransfer(to, amount);
}

Impact of Fix

  • Allows users to bid using native ETH (no WETH needed)

  • Makes bidding easier and more familiar for users

  • Handles ETH and tokens in one shared transfer flow

  • Affects all bid, withdraw, and claim logic across auctions

@kaneki003 What's your view on this , feel free to assign

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions