Skip to content

Commit

Permalink
Merge pull request #25 from OriumNetwork/refactor-sft-roles-registry
Browse files Browse the repository at this point in the history
SFT Roles Registry
  • Loading branch information
karacurt authored Jan 9, 2024
2 parents 2aaff2c + 59e8bc2 commit ccf0ac6
Show file tree
Hide file tree
Showing 21 changed files with 1,702 additions and 1,672 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/all.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@ jobs:
NODE_AUTH_TOKEN: ${{ secrets.GHB_TOKEN }}
- name: Lint
run: npm run lint
- name: Run Foundry tests
run: forge test --verbosity -vvv
# - name: Run Foundry tests
# run: forge test --verbosity -vvv
- name: Compile Smart Contracts
run: npm run compile
env:
Expand Down
28 changes: 21 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,21 +7,35 @@
[![Discord](https://img.shields.io/discord/1009147970832322632?label=discord&logo=discord&logoColor=white)](https://discord.gg/NaNTgPK5rx)
[![Twitter Follow](https://img.shields.io/twitter/follow/oriumnetwork?label=Follow&style=social)](https://twitter.com/OriumNetwork)

This repository contains a minimal implementation of ERC-7432 (Non-Fungible Token Roles).
ERC-7432 introduces role management for NFTs. Each role assignment is associated with a single NFT and expires automatically at a given timestamp.
This repository contains multiple implementations of two EIPs (Ethereum Improvement Proposals):
* ERC-7432 (Non-Fungible Token Roles).
* ERC-7589 (Semi-Fungible Token Roles).

ERC-7432 can be deeply integrated with dApps to create a utility-sharing mechanism. A good example is in digital real estate. A user can create a digital property NFT and grant a `keccak256("PROPERTY_MANAGER")` role to another user, allowing them to delegate specific utility without compromising ownership. The same user could also grant multiple `keccak256("PROPERTY_TENANT")` roles, allowing the grantees to access and interact with the digital property.
The goal of these EIPs is to introduce role management for NFTs. Each role assignment is associated with one or more
NFTs and expire automatically at a given timestamp. Token Roles can be deeply integrated with dApps to create a
utility-sharing mechanism. A good example is in digital real estate. A user can create a digital property NFT and grant
a `keccak256("PROPERTY_MANAGER")` role to another user, allowing them to delegate specific utility without compromising
ownership. The same user could also grant multiple `keccak256("PROPERTY_TENANT")` roles, allowing additional users to
access the digital property.

You can find the full specification [here](https://github.com/ethereum/EIPs/blob/master/EIPS/eip-7432.md).
You can find the full specification here: [ERC-721 Token Roles](https://eips.ethereum.org/EIPS/eip-7432) and
[ERC-1155 Token Roles](https://eips.ethereum.org/EIPS/eip-7589).

# Build
## Implementations

* [ERC-7432 NFT Roles Registry](./contracts/RolesRegistry.sol): ERC-721 NFT Owners can grant roles without depositing NFTs.
* [ERC-7589 SFT Roles Registry](./contracts/RolesRegistry/SftRolesRegistry.sol): ERC-1155 NFT Owners can grant roles after depositing NFTs.
* [ERC-7589 Single-Role SFT Roles Registry](./contracts/RolesRegistry/SftRolesRegistrySingleRole.sol): ERC-1155 NFT Owners can grant a single pre-defined role after depositing
NFTs.

## Build

```bash
npm install
npm ci
npm run build
```

# Test
## Test

```bash
npm run test
Expand Down
Loading

0 comments on commit ccf0ac6

Please sign in to comment.