In the huff version, only the first user can mint horses, the second user onwards is unable to mint horses as TOTAL_SUPPLY is not updated.
At no point is the TOTAL_SUPPLY updated, and when mint_horse() is called which uses total_supply to mint the horse for the next tokenId, will throw an error as the TOTAL_SUPPLY is still 0.
Here is a POC to test more than user minting the nft where the solidity works fine and the huff will revert as it is ALREADY_MINTED:
Protocol cannot function properly as it is only possible to mint NFT making all the equestrian lovers unhappy. High as a core functionality of protocol does not work as intended.
Foundry
https://github.com/Cyfrin/2024-01-horse-store/blob/8255173c9340c12501881c9ecdd4175ff7350f5d/src/HorseStore.huff#L73-L78
add sload// [totalSupply]
to line 75.
and
https://github.com/Cyfrin/2024-01-horse-store/blob/8255173c9340c12501881c9ecdd4175ff7350f5d/src/HorseStore.huff#L318-L352
add
to the mint function like so:
Sorry I'm not sure whats the correct markdown for this. Also I'm not sure if thats the correct implementation to update TOTAL_SUPPLY
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.