Skip to content

Commit

Permalink
update documentation and prep for release
Browse files Browse the repository at this point in the history
  • Loading branch information
FrankNFT-labs committed Sep 25, 2024

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
1 parent 41f4878 commit 862825a
Showing 5 changed files with 66 additions and 1 deletion.
15 changes: 15 additions & 0 deletions contracts/token/ERC721/ERC721FCOMMON.sol
Original file line number Diff line number Diff line change
@@ -5,6 +5,21 @@ import "./ERC721F.sol";
import "../../utils/Payable.sol";
import "@openzeppelin/contracts/token/common/ERC2981.sol";

/**
* @title ERC721FCOMMON
* @dev Extends ERC721F with additional functionality including royalties and payment handling.
* This contract combines ERC721F, Payable, and ERC2981 to create a more feature-rich NFT implementation.
*
* Key features:
* - Royalty support (ERC2981)
* - Payment handling (Payable)
* - Customizable royalty percentage and receiver
*
* @notice This contract inherits from ERC721F, Payable, and ERC2981, providing a comprehensive
* solution for NFT creators who want to include royalty and payment functionalities.
* @author @FrankNFT.eth
*/

contract ERC721FCOMMON is ERC721F, Payable, ERC2981 {
uint16 private royalties = 500;
address private royaltyReceiver;
12 changes: 12 additions & 0 deletions contracts/token/ERC721/extensions/ERC721FEnumerable.sol
Original file line number Diff line number Diff line change
@@ -4,6 +4,18 @@ pragma solidity ^0.8.20 <0.9.0;
import "../ERC721F.sol";
import "@openzeppelin/contracts/token/ERC721/extensions/IERC721Enumerable.sol";

/**
* @title ERC721FEnumerable
* @dev This contract extends ERC721F to implement the IERC721Enumerable interface.
* It provides functions to enumerate over all tokens and tokens owned by a specific address.
*
* @notice This implementation uses O(n) time complexity for enumeration operations,
* where n is the total supply of tokens. This may become inefficient for large collections.
* Consider using alternative data structures for better performance in such cases.
*
* @dev Implementation of the {IERC721Enumerable} interface.
*/

abstract contract ERC721FEnumerable is ERC721F, IERC721Enumerable {
/**
* @dev See {IERC721Enumerable-tokenOfOwnerByIndex}
19 changes: 19 additions & 0 deletions contracts/token/soulbound/Soulbound.sol
Original file line number Diff line number Diff line change
@@ -5,6 +5,25 @@ import "../ERC721/ERC721F.sol";
import "../../interfaces/IERC5192.sol";
import "../../interfaces/IERC6454.sol";

/**
* @title Soulbound
* @dev Implementation of a soulbound token, which is a non-transferable ERC721 token.
* This contract implements the IERC5192 and IERC6454 interfaces for locked tokens and transfer validation.
* It extends the ERC721F contract to provide additional functionality specific to soulbound tokens.
*
* Key features:
* - Tokens are non-transferable by default (locked)
* - Owner can set individual tokens to be unlocked
* - Implements ERC5192 for querying locked status
* - Implements ERC6454 for transfer validation
* - Optionally allows token holders to burn their own tokens
*
* @notice This contract creates non-transferable tokens that can be selectively unlocked by the contract owner.
* It's suitable for use cases where tokens represent non-transferable rights, credentials, or identities.
*
* @author @FrankNFT.eth
*/

contract Soulbound is IERC5192, IERC6454, ERC721F {
// Mapping from owner to operator approvals
mapping(address => mapping(address => bool)) private _operatorApprovals;
19 changes: 19 additions & 0 deletions contracts/utils/AllowList.sol
Original file line number Diff line number Diff line change
@@ -3,6 +3,25 @@ pragma solidity ^0.8.20 <0.9.0;

import "@openzeppelin/contracts/access/Ownable.sol";

/**
* @title AllowList
* @dev This contract provides functionality for managing an allow list of addresses.
* It extends the Ownable contract from OpenZeppelin, allowing only the owner to modify the allow list.
*
* The contract includes functions to:
* - Add single or multiple addresses to the allow list
* - Remove addresses from the allow list
* - Check if an address is on the allow list
*
* It also provides a modifier `onlyAllowList` that can be used to restrict function access
* to only addresses on the allow list.
*
* @notice This contract is useful for implementing access control mechanisms where certain
* operations should be restricted to a pre-approved set of addresses.
*
* @author @FrankNFT.eth
*/

abstract contract AllowList is Ownable {
mapping(address => bool) private allowList;

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@franknft.eth/erc721-f",
"description": "ERC721F contract for Solidity",
"version": "5.0.3",
"version": "5.0.4",
"workspaces": [
"./examples/EIP-2535"
],

0 comments on commit 862825a

Please sign in to comment.