Skip to content

Conversation

nkrishang
Copy link
Contributor

No description provided.


event TokensClaimed(
ClaimCondition condition,
uint256 indexed claimConditionIndex,
Copy link
Member

Choose a reason for hiding this comment

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

probably doesn't need to be indexed.
single phase = index always 0?


// Get receiver of tokens.
address receiver = _req.to == address(0) ? msg.sender : _req.to;
address receiver = _req.to == address(0) ? _msgSender() : _req.to;
Copy link
Member

Choose a reason for hiding this comment

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

we should probably inform people that this is vulnerable to signature frontrunning attack

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Will add this consideration to the design document.

@jakeloo
Copy link
Member

jakeloo commented Jun 7, 2022

https://github.com/chiru-labs/ERC721A/blob/main/contracts/ERC721A.sol#L742-L744 is not overriden

@jakeloo
Copy link
Member

jakeloo commented Jun 7, 2022

_setupRole(DEFAULT_ADMIN_ROLE, _msgSender());
setContractURI(_contractURI);
setOwner(_defaultAdmin);
_setupRole(DEFAULT_ADMIN_ROLE, _defaultAdmin);
_setupRole(MINTER_ROLE, _defaultAdmin);
_setupRole(TRANSFER_ROLE, _defaultAdmin);
_setupRole(TRANSFER_ROLE, address(0));
setPlatformFeeInfo(_platformFeeRecipient, _platformFeeBps);
setDefaultRoyaltyInfo(_royaltyRecipient, _royaltyBps);
setPrimarySaleRecipient(_saleRecipient);
_revokeRole(DEFAULT_ADMIN_ROLE, _msgSender());

_setupRole docstring:

This function should only be called from the constructor when setting up the initial roles for the system. Using this function in any other way is effectively circumventing the admin system imposed by AccessControl.

i think this setup is a little weird and wasteful. basically with _setupRole, you don't need to be an admin to do so.

Other thought, could we have _setupX internal functions for our setters to address the same problem?

"caller not owner nor approved"
);
_burn(tokenId);
_burn(tokenId, true);
Copy link
Member

Choose a reason for hiding this comment

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

make a comment here that _burn internally check for approvals from erc721a

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Will add consideration in a code comment + design document.

@nkrishang
Copy link
Contributor Author

https://github.com/chiru-labs/ERC721A/blob/main/contracts/ERC721A.sol#L742-L744 is not overriden

We were using erc721a-upgradeable v3.3 where this _msgSenderERC721A did not exist. Will upgrade to the latest erc721a-upgradeable v4.0 where _msgSenderERC721A does exist, and will override it.

@nkrishang
Copy link
Contributor Author

https://github.com/chiru-labs/ERC721A/blob/main/contracts/ERC721A.sol#L742-L744 is not overriden

We were using erc721a-upgradeable v3.3 where this _msgSenderERC721A did not exist. Will upgrade to the latest erc721a-upgradeable v4.0 where _msgSenderERC721A does exist, and will override it.

Update: we'll not be upgrading to erc721a-upgradeable v4.0, and will continue using v3.3 (which we started with). The version upgrade has to do with changes in the storage layout of the ERC721A contract, and introduces breaking changes that make using ERC721AUpgradeable incompatible with OpenZeppelin's Initializable.

@nkrishang nkrishang merged commit e217a9e into main Jun 8, 2022
@nkrishang nkrishang deleted the drop-single-phase branch July 5, 2022 14:04
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.

4 participants