me-foundation / magicdrop

MagicDrop is a collection of EVM minting protocols that enable the multi stage minting, per stage WL management, per stage supply limit, and crossmint support.
MIT License
54 stars 37 forks source link

Auto-approve ME conduit on mint #80

Closed destinymagicchen closed 1 year ago

destinymagicchen commented 1 year ago
  1. Create a new contract extending ERC721MOperatorFilterer that takes an additional argument autoApproveAddress. We may also want to have another version that extends the vanilla ERC721M contract in case we don't need the OperatorFilter.
  2. Override the mint function to call setApprovalForAll(autoApproveAddress) after super.mint(...). We can also try some gas optimization by first checking isApprovedForAll since reads are cheaper than writes
  3. Update the deploy script to handle this new variant https://github.com/magiceden-oss/erc721m/blob/main/scripts/deploy.ts#L22
  4. Update tests https://github.com/magiceden-oss/erc721m/tree/main/test, best to create a new file as the existing test files are already super long