Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feat/nft collection #1568

Open
wants to merge 46 commits into
base: master
Choose a base branch
from
Open

Feat/nft collection #1568

wants to merge 46 commits into from

Conversation

adjisb
Copy link
Contributor

@adjisb adjisb commented Aug 5, 2024

Description

NFT Collection

Copy link

openzeppelin-code bot commented Aug 5, 2024

Feat/nft collection

Generated at commit: 17c49f2de13cf2f43fb7c10edaee4e6ddef557b4

🚨 Report Summary

Severity Level Results
Contracts Critical
High
Medium
Low
Note
Total
3
1
0
6
28
38

For more details view the full report in OpenZeppelin Code Inspector

@adjisb adjisb force-pushed the feat/nft-collection branch 4 times, most recently from 658133a to 201b6e8 Compare August 9, 2024 14:57
@adjisb adjisb force-pushed the feat/nft-collection branch from 1e9d2d9 to f8cd396 Compare August 22, 2024 18:36
@adjisb adjisb force-pushed the feat/nft-collection branch 2 times, most recently from b44d0d7 to 2259967 Compare September 11, 2024 16:45
@adjisb adjisb force-pushed the feat/nft-collection branch from 684024e to 17c49f2 Compare October 16, 2024 13:18
@adjisb adjisb force-pushed the feat/nft-collection branch 2 times, most recently from 212ca09 to a268b9b Compare December 9, 2024 15:00
@adjisb adjisb force-pushed the feat/nft-collection branch from 2d2404c to 4291ff9 Compare December 16, 2024 16:46
Andres Adjimann added 3 commits December 16, 2024 13:55
- Use fully qualified names for contracts
- Add constructor arguments for verification
@adjisb adjisb marked this pull request as ready for review December 17, 2024 15:50
@adjisb adjisb requested a review from a team as a code owner December 17, 2024 15:50
Copy link
Member

@wojciech-turek wojciech-turek left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A few questions and comments.

* @dev based on: https://github.com/OpenZeppelin/openzeppelin-contracts/blob/v4.6.0/contracts/metatx/ERC2771Context.sol
* with an initializer for proxies and a mutable forwarder
*/
abstract contract ERC2771HandlerUpgradeable is ContextUpgradeable {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should this file be in this folder or in dependency-metatx?
We may want to re-use this for other contracts right?

Copy link
Contributor Author

@adjisb adjisb Dec 20, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This package has a collection of different implementations of groups of tokens and each has it own code, compiler version and style.
I think that to reuse code we must do a cleanup first (the problem is that most of the contracts are already deployed, so we must be careful about how we manage the versions). I tried to keep NFTCollection free of dependencies.

* @param allowedToExecuteMint token address that is used for payments and that is allowed to execute mint
* @param maxSupply max supply of tokens to be allowed to be minted per contract
*/
event ContractInitialized(
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Whats the point of this event when its emitted only once?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It was already there in AvatarCollection, this contract is used with a factory and maybe somebody wants the arguments used for the creation of a new collection.

event WaveSetup(
address indexed operator,
uint256 waveMaxTokens,
uint256 waveMaxTokensToBuy,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

waveMaxTokensToBuy is not very clear, can we change to waveMaxTokensPerWallet?
Also update the comment.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It was already there in AvatarCollection, we can ask.

- ERC2981 compliant
- ERC4906 compliant
- ERC165 compliant
- supports ERC2771 for services like Biconomy
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Biconomy no more! Maybe just say for meta transactions

* @param waveIndex the index of the wave used to mint
* @param wallets list of destination wallets and amounts
*/
function batchMint(uint256 waveIndex, BatchMintingData[] calldata wallets) external whenNotPaused onlyOwner {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I feel like the owner should be able to batch mint tokens without setting up a wave.
If we want to just mint internally we need to setup a wave for 1000 tokens to mint 1000 tokens all for ourselves.

Is there a reason why we would do it that way?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I also think batch minting should not be so restrictive, we may want to be able to mint all to same wallet etc.
I think we should just check if we are not minting more than the total supply of the collection.

import {ZeroAddress} from 'ethers';

describe('NFTCollection batch transfer', function () {
function check(method, data) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Smart!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants