ERC721R.sol; are there any problems here?


This is not my Smart Contract, but I wanted to open a discussion on it since it's pretty cool.

Those familiar with NFTs will know that a major pain point is randomizing the mint order. Without random mint order, it is very easy to figure out how to mint the rare NFTs within a collection.

This ERC721R contract developed by Roger Wu tries to solve this. It does so by using information about the block used to mint from the collection to mimic a random number generator. I've tried it a few times on testnet contracts and it works great.

Few questions/comments:

  • I understand Chainlink can be used to generate random numbers but is very expensive from a gas perspective. Can anyone confirm?

  • Does Solidity really not have a random number generating function?

  • Are there any issues with the ERC721R structure regarding safety?

Thanks in advance!

Chainlink disadvantages are the LINK fee and the higher gas usage.

It is not a solidity issue but a on-chain one. You could use block difficulty or other things but you will always get a pseudo randomness.

Personally I never used it so wait for someone that had.

1 Like