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

Difference in huff and sol behaviour

Summary

A contract which can't receive ERC721 token, can't mint in solidity but can mint horses in Huff.

Vulnerability Details

Encountered 1 failing test in test/HorseStoreSolidity.t.sol:HorseStoreSolidity
[FAIL. Reason: ERC721InvalidReceiver(0x7FA9385bE102ac3EAc297483Dd6233D62b3e1496)] testMintingHorseFailsAssigningContractAsOwner() (gas: 89149)

Error is as expected in solidity but no error for huff is seen
Following is the test

function testMintingHorseFailsAssigningContractAsOwner() public {
uint256 horseId = horseStore.totalSupply();
vm.prank(address(this));
horseStore.mintHorse();
// assertEq(horseStore.totalSupply(), horseId+1);
assertEq(horseStore.ownerOf(horseId), address(this));
}

Impact

Difference in behaviour

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.