Skip to content

Commit

Permalink
Update ERC-7832: Update interface and constructor requirements
Browse files Browse the repository at this point in the history
  • Loading branch information
Gustavo committed Dec 20, 2024
1 parent c564161 commit f0d91a5
Showing 1 changed file with 33 additions and 3 deletions.
36 changes: 33 additions & 3 deletions ERCS/erc-7832.md
Original file line number Diff line number Diff line change
Expand Up @@ -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**:
Expand All @@ -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**:
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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.
Expand Down

0 comments on commit f0d91a5

Please sign in to comment.