Royalties cannot be collected for many ERC20 tokens (USDT, BNB and many more) due to use of transfer function. #457
Labels
2 (Med Risk)
Assets not at direct risk, but function/availability of the protocol could be impacted or leak value
bug
Something isn't working
disagree with severity
Sponsor confirms validity, but disagrees with warden’s risk assessment (sponsor explain in comments)
duplicate
This issue or pull request already exists
responded
The Holograph team has reviewed and responded
sponsor confirmed
Sponsor agrees this is a problem and intends to fix it (OK to use w/ "disagree with severity")
Lines of code
https://github.com/code-423n4/2022-10-holograph/blob/f8c2eae866280a1acfdc8a8352401ed031be1373/contracts/enforcer/PA1D.sol#L416
https://github.com/code-423n4/2022-10-holograph/blob/f8c2eae866280a1acfdc8a8352401ed031be1373/contracts/enforcer/PA1D.sol#L439
Vulnerability details
Description
ERC20 royalties are paid using _payoutTokens and _payoutToken functions in PA1D.sol. Unfortunately these functions use ERC20's transfer() instead of implementing safeTransfer:
The transfer signature includes a bool return value:
Therefore, the calling code discovers there is no bool return parameter, it will revert. The impact is any non conforming ERC20 tokens will be forever stuck in the Holographer contract. There are hundreds of such tokens, such as USDT, BNB etc.
Because of the likelihood of non-conforming ERC20 tokens being a royalty token, this represents a high severity threat.
Impact
USDT, BNB and any other no-return-value coin will be stuck in the Holographer contract.
Tools Used
Manual audit
Recommended Mitigation Steps
Use OpenZeppelin's SafeERC20 library to interact with ERC20 tokens.
The text was updated successfully, but these errors were encountered: