Beginner FriendlyFoundryNFT
100 EXP
View results
Submission Details
Severity: low
Invalid

Difference in huff and sol behaviour

Summary

Huff don't consider 0x0...0 a valid ERC 721 recipient while Solidity does.

Vulnerability Details

Error received

Failing tests:
Encountered 1 failing test in test/HorseStoreHuff.t.sol:HorseStoreHuff
[FAIL. Reason: revert: INVALID_RECIPIENT; counterexample: calldata=0xf6c69c590000000000000000000000000000000000000000000000000000000000000000 args=[0x0000000000000000000000000000000000000000]] testMintingHorseIncrementsTotalSupply(address) (runs: 0, μ: 0, ~: 0)

for following test

function testMintingHorseIncrementsTotalSupply(address randomOwner) public {
uint256 totalHorses = horseStore.totalSupply();
vm.prank(randomOwner);
horseStore.mintHorse();
assertEq(horseStore.totalSupply(), totalHorses + 1);
}

Edit 1:
After multiple runs some error was seen in sol file too.

[FAIL. Reason: unknown selector `0x150b7a02` for VmCalls; counterexample: calldata=0xf6c69c590000000000000000000000007109709ecfa91a80626ff3989d68f67f5b1dd12d args=[0x7109709ECfa91a80626fF3989D68f67F5b1DD12D]] testMintingHorseIncrementsTotalSupply(address) (runs: 168, μ: 89449, ~: 89449)

Edit 2:
More errors were seen after adding another tests.

[FAIL. Reason: ERC721InvalidReceiver(0x5615dEB798BB3E4dFa0139dFa1b3D433Cc23b72f); counterexample: calldata=0xf6c69c590000000000000000000000005615deb798bb3e4dfa0139dfa1b3d433cc23b72f args=[0x5615dEB798BB3E4dFa0139dFa1b3D433Cc23b72f]] testMintingHorseIncrementsTotalSupply(address) (runs: 187, μ: 89449, ~: 89449)

Impact

Inconsistencies in huff and solidity contract

Tools Used

foundry

Recommendations

Updates

Lead Judging Commences

inallhonesty Lead Judge over 1 year ago
Submission Judgement Published
Invalidated
Reason: Too generic

Support

FAQs

Can't find an answer? Chat with us on Discord, Twitter or Linkedin.