DeFiFoundry
20,000 USDC
View results
Submission Details
Severity: high
Invalid

`FjordAuction::bid` dooes not check for return values neither revert in failed transactions

**Description:** The `FjordAuction::bid` function does not check for return values in `transferFrom` call, either way not all tokens return value here.
**Impact:** Transfer can fail but the bid will be put in place.
```javascript
function bid(uint256 amount) external {
if (block.timestamp > auctionEndTime) {
revert AuctionAlreadyEnded();
}
bids[msg.sender] = bids[msg.sender].add(amount);
totalBids = totalBids.add(amount);
@> fjordPoints.transferFrom(msg.sender, address(this), amount);
emit BidAdded(msg.sender, amount);
}
```
**Recommended Mitigation:** Use the SafeERC20 library from openzeppelin
```diff
+ import {SafeERC20} from "lib/openzeppelin-contracts/contracts/token/ERC20/utils/SafeERC20.sol";
.
.
.
contract FjordAuction {
+ using SafeERC20 for ERC20;
.
.
.
function bid(uint256 amount) external {
if (block.timestamp > auctionEndTime) {
revert AuctionAlreadyEnded();
}
bids[msg.sender] = bids[msg.sender].add(amount);
totalBids = totalBids.add(amount);
- fjordPoints.transferFrom(msg.sender, address(this), amount);
+ fjordPoints.safeTransferFrom(msg.sender, address(this), amount);
emit BidAdded(msg.sender, amount);
}
```
Updates

Lead Judging Commences

inallhonesty Lead Judge about 1 year ago
Submission Judgement Published
Invalidated
Reason: Known issue

Support

FAQs

Can't find an answer? Chat with us on Discord, Twitter or Linkedin.