diff --git a/ERCS/erc-7832.md b/ERCS/erc-7832.md index 397a747758..a0de73964e 100644 --- a/ERCS/erc-7832.md +++ b/ERCS/erc-7832.md @@ -191,7 +191,7 @@ The keywords "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", "SHOULD", "SH Allows a user to acquire a creator's signature by paying the required fee. ```solidity - function getCreatorSignature() public payable onlyIfNotPaused + function getCreatorSignature() public payable onlyIfNotPaused; ``` **Requirements**: @@ -218,7 +218,7 @@ The keywords "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", "SHOULD", "SH Allows the `DEFAULT_ADMIN_ROLE` to withdraw ETH from the contract. ```solidity - function withdraw(uint256 amount) public onlyRole(DEFAULT_ADMIN_ROLE) nonReentrant + function withdraw(uint256 amount) public onlyRole(DEFAULT_ADMIN_ROLE) nonReentrant; ``` **Requirements**: @@ -280,7 +280,9 @@ This EIP is fully compatible with 721. Extensions like dynamic minting fees, don --- -### Reference Implementation +### Reference Implementation + +The following interface and constructor **MUST** be implemented. ```solidity pragma solidity ^0.8.20; @@ -327,6 +329,34 @@ interface IERC7832 { } ``` +```solidity +/// @notice Contract constructor +/// @param _tokenName The name of the token. +/// @param _tokenSymbol The symbol of the token. +/// @param _mintBaseFee The initial base fee for minting tokens. +/// @param _creatorSignatureFee The fee required to become a member. +/// @param _maxMintsPerUserInCycle Maximum of mints per user in cycle +constructor( + string memory _tokenName, + string memory _tokenSymbol, + uint256 _mintBaseFee, + uint256 _creatorSignatureFee, + uint256 _maxMintsPerUserInCycle +) + ERC721(_tokenName, _tokenSymbol) +{ + _grantRole(DEFAULT_ADMIN_ROLE, msg.sender); + _grantRole(CREATOR_ROLE, msg.sender); + _grantRole(CONTRIBUTOR_ROLE, msg.sender); + + updateTerms( + _mintBaseFee, + _creatorSignatureFee, + _maxMintsPerUserInCycle + ); +} +``` + ## Security Considerations OpenZeppelin contracts such as `ReentrancyGuard`, `Burnable`, `AccessControl`, `Pausable` are **RECOMMENDED** for implementations.