Platform: Code4rena
Start Date: 03/05/2022
Pot Size: $50,000 USDC
Total HM: 4
Participants: 46
Period: 5 days
Judge: gzeon
Total Solo HM: 2
Id: 117
League: ETH
Rank: 2/46
Findings: 1
Award: $13,743.24
π Selected for report: 1
π Solo Findings: 1
π Selected for report: hubble
13743.2396 USDC - $13,743.24
The function safeTransferFrom is a standard interface in ERC1155, and its expected to succeed if all the parametes are valid, and revert on error, which is not the case here so its a deviation.
Refer to the EIP-1155 safeTransferFrom rules:
MUST revert if _to is the zero address. MUST revert if balance of holder for token _id is lower than the _value sent to the recipient. MUST revert on any other error.
There is no loss of assets, but the assets or tokens and CNft contract can be unusable by other protocols, and likelihood & impact of this issue is high.
If other protocols want to integrate CNft, then in that case just for CNft Contract / tokens, they have to take exception and use safeBatchTransferFrom, instead of safeTransferFrom. If they dont take care of this exception, then their protocol functions will fail while using CNft, even if valid values are given.
Contract : CNft.sol Function : safeTransferFrom
Line 204 revert("CNFT: Use safeBatchTransferFrom instead");
Instead of revert, call function safeBatchTransferFrom with 1 item in the array, e.g.,
safeBatchTransferFrom(from, to, [id], [amount], data)
#0 - bunkerfinance-dev
2022-05-18T06:28:29Z
We can fix this, but we do not feel like this is high severity at all.
#1 - gzeoneth
2022-05-29T11:40:33Z
I think this is a Med Risk issue as it impact the function of the protocol.