sherlock-audit / 2023-01-optimism-judging

24 stars 10 forks source link

Chom - L1ERC721Bridge _initiateBridgeERC721 is not using safeTransferFrom. Necessary hooks and checks wouldn't be performed. #301

Closed github-actions[bot] closed 1 year ago

github-actions[bot] commented 1 year ago

Chom

low

L1ERC721Bridge _initiateBridgeERC721 is not using safeTransferFrom. Necessary hooks and checks wouldn't be performed.

Summary

L1ERC721Bridge _initiateBridgeERC721 is not using safeTransferFrom. Necessary hooks and checks wouldn't be performed.

Vulnerability Detail

L1ERC721Bridge _initiateBridgeERC721 is not using safeTransferFrom.

Impact

Necessary hooks and checks wouldn't be performed.

Necessary checks include

If these checks fail, the transaction will be reverted. This is done to prevent the loss of NFT because of transferring into a contract that cannot receive ERC721.

Moreover, it won't perform onERC721Received hook.

Code Snippet

https://github.com/sherlock-audit/2023-01-optimism/blob/main/optimism/packages/contracts-bedrock/contracts/L1/L1ERC721Bridge.sol#L101

Tool used

Manual Review

Recommendation

Use safeTransferFrom instead of transferFrom