Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Upgraded Q -> M from 131 [1654475029272] #339

Closed
code423n4 opened this issue Jun 6, 2022 · 1 comment
Closed

Upgraded Q -> M from 131 [1654475029272] #339

code423n4 opened this issue Jun 6, 2022 · 1 comment
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 duplicate This issue or pull request already exists upgraded by judge

Comments

@code423n4
Copy link
Contributor

code423n4 commented Jun 6, 2022

Judge has assessed an item in Issue #131 as Medium risk. The relevant finding follows:

Recommend using safeTransferFrom() instead of transferFrom() for NFTs
The EIP-721 standard states:

/// @notice Transfer ownership of an NFT -- THE CALLER IS RESPONSIBLE
///  TO CONFIRM THAT `_to` IS CAPABLE OF RECEIVING NFTS OR ELSE
///  THEY MAY BE PERMANENTLY LOST

Cally.sol uses transferFrom() to facillitate the transfer of ERC721 NFTs from the contract to users, as shown below.

In exercise():

Cally.sol:295 ? ERC721(vault.token).transferFrom(address(this), msg.sender, vault.tokenIdOrAmount)
In withdraw():

Cally.sol:344 ? ERC721(vault.token).transferFrom(address(this), msg.sender, vault.tokenIdOrAmount)
To prevent a permanent loss of NFTs, there should be checks in place to ensure msg.sender is capable of receiving NFTs. Otherwise, consider using safeTransferFrom() instead of transferFrom().

@code423n4 code423n4 added 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 upgraded by judge labels Jun 6, 2022
code423n4 added a commit that referenced this issue Jun 6, 2022
@HardlyDifficult HardlyDifficult added the duplicate This issue or pull request already exists label Jun 6, 2022
@HardlyDifficult
Copy link
Collaborator

Dupe of #38

# for free to join this conversation on GitHub. Already have an account? # to comment
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 duplicate This issue or pull request already exists upgraded by judge
Projects
None yet
Development

No branches or pull requests

2 participants