estarriolvetch / ERC721Psi

MIT License
116 stars 28 forks source link

_processRandomnessFulfillment in ERC721PsiRandomSeed missing virtual keyword #5

Closed lucaventura closed 2 years ago

lucaventura commented 2 years ago

Not sure if it is intentional or not, but _processRandomnessFulfillment in ERC721PsiRandomSeed can't be overwritten because it's missing the virtual keyword. Is there any sample code to show the expected use of the seed extension function? Since the seed function reverts if the randomness hasn't been fulfilled, how will we know when to call seed without the ability to access _processRandomnessFulfillment?

Example use case: User mints 2 NFTs, and once randomness is fulfilled the seed is used to assign a random trait on-chain.

estarriolvetch commented 2 years ago

Ohhh good catch! Yeah I forgot to add the virtual keyword. If you send a PR, I will be happy to accept that.

lucaventura commented 2 years ago

@estarriolvetch Yeah sure thing. Is the idea to use the seed function from within _processRandomnessFulfillment? Curious to know if you have any example implementations you could share.

estarriolvetch commented 2 years ago

I never use _processRandomnessFulfillment myself

I add this function as a hook in case someone wants to do something when the randomness is fulfilled.

Mostly, I use seed to derive the traits of the token. Here is an example.

https://rinkeby.etherscan.io/address/0x7c0044396b9c77499baea85698b74350de7b8733#code