Forgotten Runes Warrior Guild contest - Cr4ckM3's results

16,000 Warrior NFTs sold in a phased Dutch Auction.

General Information

Platform: Code4rena

Start Date: 03/05/2022

Pot Size: $30,000 USDC

Total HM: 6

Participants: 93

Period: 3 days

Judge: gzeon

Id: 118

League: ETH

Forgotten Runes

Findings Distribution

Researcher Performance

Rank: 70/93

Findings: 2

Award: $45.73

🌟 Selected for report: 0

πŸš€ Solo Findings: 0

Lines of code

https://github.com/code-423n4/2022-05-runes/blob/main/contracts/ForgottenRunesWarriorsMinter.sol#L400

Vulnerability details

Impact

For customized minter contract who does not implement ERC20 withdraw interface, the WETH transferred can be locked forever, in other words, lost.

Proof of Concept

_safeTransferETHWithFallback is used to refund ETH to the minters. If ETH is rejected, WETH ERC20 transfer will be used. However I suggest that we should not assume that the all the users implement the minter contract properly. An ERC20 receiver is unable to reject the transfer like they do to the ETH transfer, thus, if minter contracts do not implement the ERC20 withdraw method, the transferred tokens are lost. Or they may have their own self-refund logic we have no idea how to cooperate with.

Maybe skipping such refunding cases is a better idea as the minter can find other way to get their fund back, like self-refund or just contact your team to withdraw the ETH for them.

Tools Used

Code review.

Just skip minters who reject ETH, leave them to do their self-refund business.

A sample:

function _refundAddress(address minter) private { uint256 owed = refundOwed(minter); if (owed > 0 && _safeTransferETH(minter, owed)) { daAmountRefunded[minter] += owed; } }

#1 - gzeoneth

2022-06-18T16:31:03Z

It is very unlikely a smart contract wallet don't support ERC20 withdrawal and any custom contract used to mint this nft should be responsible to make sure it is compatible with the refund mechanism. Downgrading to Low / QA.

#2 - gzeoneth

2022-06-18T19:26:35Z

As warden's QA report.

Redundant check

Code

require can be removed as msg.sender can never be zero address. Or do you mean to check require(address(token) != address(0)); ?

AuditHub

A portfolio for auditors, a security profile for protocols, a hub for web3 security.

Built bymalatrax Β© 2024

Auditors

Browse

Contests

Browse

Get in touch

ContactTwitter