Skip to content
Smart contracts Audit finding Intermediate

IERC20.transfer does not support all ERC20 token

VAD37 Follow

Originally disclosed on Code4rena

Submitted by VAD37, also found by AuditsAreUS, IllIllI, MaratCerby, rfa, and sorrynotsorry

ForgottenRunesWarriorsGuild.sol#L173-L176 ForgottenRunesWarriorsMinter.sol#L627-L630

Token like USDT known for using non-standard ERC20. (Missing return boolean on transfer).

Contract function forwardERC20 will always revert when try to transfer this kind of tokens.

Impact

Cannot withdraw some special ERC20 token through contract call. Unexpected contract functionality = Medium severity

Recommended Mitigation Steps

Use SafeTransferLib.safeTransfer instead of IERC20 transfer. This accepts ERC20 token with no boolean return like USDT.

cryppadotta (Forgotten Runes) confirmed and commented:

Ah nice. You learn something new every day. Thanks!

KenzoAgada (warden) commented:

Description is pretty much invalid as ”forwardERC20 will always revert when try to transfer this kind of tokens” is simply not true. Same with impact - “Cannot withdraw some special ERC20 token through contract call” - that’s not the impact, using SafeERC20’s transfer will not help to transfer tokens. It will just revert on failure. But generally the issue of not using SafeERC20 is kinda-correct. Duplicate of #2.

gzeon (judge) commented:

This is not a duplicate of #2. #2 describes the silent failure of ERC20 transfer, while this describes a ERC20 that return void instead of bool. The call will revert even if the transfer is successful because Solidity expected a return value. Judging as Med Risk because unlike #2, here you can actually do something to fix the function.

KenzoAgada (warden) commented:

I apologize, my mistake.


The original report as published on Code4rena, by VAD37. Images and videos are our own copies; raw HTML is shown as text. View it on Code4rena.

Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.

What is known

A medium-severity smart contracts bug in Forgotten Runes Warrior Guild contest. Code4rena made it public on 4 August 2022. Found in the 2022-05-runes audit contest (finding M-01).

About Smart contracts

Flaws in on-chain code that let an attacker drain funds, freeze them or break the protocol's accounting.

Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.

What is Smart contracts?

Flaws in on-chain code that let an attacker drain funds, freeze them or break the protocol's accounting.

More by VAD37

View all

3 more disclosed reports, best first.

More from Forgotten Runes Warrior Guild contest

View all

The newest disclosed reports for this program.

Similar reports

View all

Same bug class and techniques, clearest first.

Smart contract vulnerabilities

The lesson behind this report.

Flaws in on-chain code that let an attacker drain funds, freeze them or break the protocol's accounting.