-
-
Notifications
You must be signed in to change notification settings - Fork 15
Description
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.solAllPayAuction.solEnglishAuction.solVickreyAuction.solLinearReverseDutchAuction.solExponentialReverseDutchAuction.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, andcommitBidfunctionspayable - Update
receiveERC20andsendERC20helpers 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