code-423n4 / 2021-08-yield-findings

1 stars 0 forks source link

Unchecked return value from transfer() #20

Open code423n4 opened 3 years ago

code423n4 commented 3 years ago

Handle

JMukesh

Vulnerability details

Impact

It is usually good to add a require-statement that checks the return value or to use something like safeTransfer; unless one is sure the given token reverts in case of a failure.

https://consensys.net/diligence/audits/2021/01/fei-protocol/#unchecked-return-value-for-iweth-transfer-call

Proof of Concept

https://github.com/code-423n4/2021-08-yield/blob/4dc46470e616dd0cbd9db9b4742e36c4d809e02c/contracts/utils/token/ERC20Rewards.sol#L175

Tools Used

manual review

Recommended Mitigation Steps

check return value from transfer()

alcueca commented 3 years ago

Duplicate with #31

alcueca commented 3 years ago

Fix