The safeMInt function in Solidity version will verify whether the address is an EOA or an contract address, if it is the latter one, the mint operation should check the return value of onERC721Received in receiving contract to safety.
Add a mock contract that implement the onERC721Received function.
Add the following test in the Base_Test, run forge test --match-test testMintHorseContract
It will both succeed in solidity version and huff version. However, if we remove the onERC721Received function in the receiving contract, the anticipated behavior is to revert the transaction since the receiving contract does not follow the IERC721Receiver pattern.
Not implementing the IERC721Receiver validation is dangerous since the receiving contract might not be able to withdraw or do operation to the received NFT, in this case, the NFT will be locked in the contract forever, and the difference between the two version is also an issue.
Foundry
Implement the validation of onERC721Received in the mint operation and check whether contract address has the ability to handle the NFT.
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.