Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

QA Report #119

Open
code423n4 opened this issue May 13, 2022 · 2 comments
Open

QA Report #119

code423n4 opened this issue May 13, 2022 · 2 comments
Labels
bug Something isn't working QA (Quality Assurance) Assets are not at risk. State handling, function incorrect as to spec, issues with clarity, syntax

Comments

@code423n4
Copy link
Contributor

  1. Duration issue

The user may accidently set the durationDays to be max of uint8 (255 days) and has his asset locked up for a very long time if the option's buyer does not exercise the option. I think that it would be in the best interest of the user if the locked-up period is fixed to a reasonable period like 30 days and the contract's owner should cleary communicate about the risk of user's asset unintentionally getting locked up if the option is not exercised.

  1. Two-step authorization in transferOwnership()

Transfering ownership should be two step processes. The contract relies on openzeppelin's ownable which maybe problematic. Even when the function checks for zero address, it overlooks the case that the current owner may accidently input wrong address. To add additional security layer, the contract should add the acceptOwnership() that the nominated account will have to call

  1. Checking whether the receiver is capable of holding ERC721

The contract usessafeTransfer() for ERC20 but uses transferFrom() for ERC721 in both exercise() and withdraw() which may lead to the loss of ERC721 if the receiving contract does not have onERC721Received(). To prevent this unintended circumstance, the contract should replace this function with safeTransferFrom() for ERC721 to check whether the receiving contract is IERC721Receiver.

@code423n4 code423n4 added bug Something isn't working QA (Quality Assurance) Assets are not at risk. State handling, function incorrect as to spec, issues with clarity, syntax labels May 13, 2022
code423n4 added a commit that referenced this issue May 13, 2022
@outdoteth
Copy link
Collaborator

this can be bumped to medium severity:

Checking whether the receiver is capable of holding ERC721; #38

@HardlyDifficult
Copy link
Collaborator

Moved receiver check to #317

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working QA (Quality Assurance) Assets are not at risk. State handling, function incorrect as to spec, issues with clarity, syntax
Projects
None yet
Development

No branches or pull requests

3 participants