Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update EIP-6366: Move to Review #6770

Merged
merged 10 commits into from
Oct 24, 2023
Merged
67 changes: 7 additions & 60 deletions EIPS/eip-6366.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
---
eip: 6366
title: Permission Token
description: A new token that held the permission of an address in an ecosystem
description: A token that holds the permission of an address in an ecosystem
author: Chiro (@chiro-hiro), Victor Dusart (@vdusart)
discussions-to: https://ethereum-magicians.org/t/eip-6366-a-standard-for-permission-token/9105
status: Stagnant
status: Review
type: Standards Track
category: ERC
created: 2022-01-19
chiro-hiro marked this conversation as resolved.
Show resolved Hide resolved
Expand All @@ -13,13 +13,13 @@ requires: 6617

## Abstract

This EIP offers an alternative to Access Control Lists (ACLs) for granting authorization and enhancing security. An `uint256` is used to store permission of given address in a ecosystem. Each permission is represented by a single bit in `uint256` as described in [ERC-6617](./eip-6617.md). Bitwise operators and bitmasks are used to determine the access right which is much more efficient and flexible than `string` or `keccak256` comparison.
This EIP offers an alternative to Access Control Lists (ACLs) for granting authorization and enhancing security. A `uint256` is used to store permission of given address in a ecosystem. Each permission is represented by a single bit in a `uint256` as described in [ERC-6617](./eip-6617.md). Bitwise operators and bitmasks are used to determine the access right which is much more efficient and flexible than `string` or `keccak256` comparison.

## Motivation

Special roles like `Owner`, `Operator`, `Manager`, `Validator` are common for many smart contracts because permissioned addresses are used to administer and manage them. It is difficult to audit and maintain these system since these permissions are not managed in a single smart contract.

Since permission and role are reflected by the permission token balance of the relevant account in the given ecosystem, cross-interactivity between many ecosystems will be made simpler.
Since permissions and roles are reflected by the permission token balance of the relevant account in the given ecosystem, cross-interactivity between many ecosystems will be made simpler.

## Specification

Expand Down Expand Up @@ -65,7 +65,7 @@ interface IEIP6366Core {
* Allows `_delegatee` to act for the permission owner's behalf, up to the `_permission`.
* If this function is called again it overwrites the current granted with `_permission`.
* `approve()` method SHOULD `revert` if granting `_permission` permission is not
* a subset of all available permission of permission owner.
* a subset of all available permissions of permission owner.
* @param _delegatee Delegatee
* @param _permission Subset permission of permission owner
*/
Expand Down Expand Up @@ -103,67 +103,15 @@ interface IEIP6366Core {

### Metadata Interface

It is RECOMMENDED for compliant contracts to implement the optional extension `IEIP6366Meta`.
It is RECOMMENDED for compliant contracts to implement the optional extension `IEIP6617Meta`.

SHOULD define a description for the base permissions and main combinaison.

SHOULD NOT define a description for every subcombinaison of permissions possible.

```solidity
interface IEIP6366Meta {
/**
* Structure of permission description
* @param _permission Permission
* @param _name Name of the permission
* @param _description Description of the permission
*/
struct PermissionDescription {
uint256 permission;
string name;
string description;
}

/**
* MUST trigger when the description is updated.
* @param _permission Permission
* @param _name Name of the permission
* @param _description Description of the permission
*/
event UpdatePermissionDescription(uint256 indexed _permission, string indexed _name, string indexed _description);

/**
* Returns the name of the token - e.g. `"OpenPermissionToken"`.
*/
function name() external view returns (string memory);

/**
* Returns the symbol of the token. E.g. `"OPT"`.
*/
function symbol() external view returns (string memory);

/**
* Returns the description of a given `_permission`.
* @param _permission Permission
*/
function getDescription(uint256 _permission) external view returns (PermissionDescription memory description);

/**
* Return `true` if the description was set otherwise return `false`. It MUST emit `UpdatePermissionDescription` event.
* @param _permission Permission
* @param _name Name of the permission
* @param _description Description of the permission
*/
function setDescription(
uint256 _permission,
string memory _name,
string memory _description
) external returns (bool success);
}
```

### Error Interface

SHOULD NOT expected `IEIP6366Error` interface was implemented.
Compatible tokens MAY implement `IEIP6366Error` as defined below:

```solidity
interface IEIP6366Error {
Expand Down Expand Up @@ -193,7 +141,6 @@ Needs discussion.
First implementation could be found here:

- [ERC-6366 Core implementation](../assets/eip-6366/contracts/EIP6366Core.sol)
- [ERC-6366 Meta implementation](../assets/eip-6366/contracts/EIP6366Meta.sol)

## Security Considerations

Expand Down
102 changes: 0 additions & 102 deletions assets/eip-6366/contracts/EIP6366Meta.sol

This file was deleted.

33 changes: 0 additions & 33 deletions assets/eip-6366/contracts/interfaces/IEIP6366Meta.sol

This file was deleted.

33 changes: 0 additions & 33 deletions assets/eip-6366/example/AEcosystem.sol

This file was deleted.

Loading