exo-digital-labs / ERC721R

https://erc721r.super.site/
MIT License
240 stars 60 forks source link

Question: Why do we need notContract() modifier? #22

Closed z0rats closed 2 years ago

z0rats commented 2 years ago

Hi!

Could you please help me understand why in this contract we need to check that publicSale and preSale are not called by the contracts? Is it to prevent some kind of attack?

Also, after a bit research, I found out that the isContract function from the OZ package does not guarantee that the address is not a contract and shouldn't be used for that purpose.

Related links:

elie222 commented 2 years ago

Thanks. It definitely shouldn't be used on presale. But we're removing it from public sale regardless.

The intention was prevent certain attacks on the mint as refundable mints will be especially interesting to bots.

Thanks for the OZ link. If you'd like to open an issue to remove notContract you're welcome to but should happen soon regardless