Absence of checks and validations to ensure that the ERC-20 and ERC-721 complies with token and contract standards in the divideNft
function on ln. 109
Firstly the divideNft
function is heavily dependent on unverified and unchecked assumptions about the validity of newly created ERC-20 contract and there are no checks to confirm that ERC-20 contract adheres with token standards.
Secondly, the divideNft
function relies on the onlyNftOwner
modifier, which checks if the caller of the contract is the owner of the NFT. This assumes that the NFT is compliant to ERC-721 standards and that ownership cannot be spoofed and/or circumvented
If the token and NFT contract do not strictly follow ERC-20 and ERC-721 standards, bad actors and malicious users will have free run and call the divideNft
function indiscriminately
Manual code review and analysis
First, use and implement a vetted factory pattern to create ERC-20 tokens and ensure that newly created contracts conform and adhere to ERC-20 token standards.
Secondly, add proper validation, like checking interface support using supportsInterface
to ensure compatibility with ERC-721 NFT standards
The contest is live. Earn rewards by submitting a finding.
This is your time to appeal against judgements on your submissions.
Appeals are being carefully reviewed by our judges.