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

Add ERC: Simple Permissions Checks #435

Open
wants to merge 41 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
Show all changes
41 commits
Select commit Hold shift + click to select a range
ee8f47d
Move ERC7575 to Last Call
hieronx May 21, 2024
f7c1b04
Simple Permissions Checks
hieronx May 24, 2024
e1d30e2
Update ERCS/erc-x.md
hieronx May 24, 2024
39f3848
Rename file
hieronx May 24, 2024
b0b639c
Clarifications
hieronx May 28, 2024
bc03c9c
Merge branch 'master' of https://github.com/ERC4626-Alliance/ERCs
hieronx May 28, 2024
8ba1288
Fix reference implementation, add pipe explanation
hieronx May 28, 2024
0c7ce18
Fix typo
hieronx May 28, 2024
70faf5e
Merge branch 'master' of https://github.com/ERC4626-Alliance/ERCs
hieronx May 28, 2024
fdec97d
Move ERC7540 to Last Call
hieronx May 28, 2024
8fd590d
requester => controller
hieronx May 29, 2024
c5aa5ff
Merge pull request #34 from ERC4626-Alliance/7540-eomay
hieronx May 29, 2024
749c682
chore: add author
0xTimepunk May 30, 2024
2b9f351
fix: undo status change
0xTimepunk May 30, 2024
34368f6
Merge pull request #35 from 0xTimepunk/addAuthor
hieronx May 30, 2024
a0f6042
Merge branch 'ethereum:master' into master
hieronx May 30, 2024
c8b4caf
Merge branch 'ethereum:master' into master
hieronx May 31, 2024
b4f69a1
comments
Joeysantoro Jun 2, 2024
77dbf29
Merge branch '7540-comments' of https://github.com/ERC4626-Alliance/E…
hieronx Jun 2, 2024
6a0b5d0
Merge pull request #36 from ERC4626-Alliance/7540-comments
hieronx Jun 2, 2024
2813cc0
Merge branch 'ethereum:master' into master
hieronx Jun 2, 2024
e1eff3b
chore: some comments
0xTimepunk Jun 3, 2024
e14c133
Merge pull request #38 from 0xTimepunk/commentsJoao
hieronx Jun 3, 2024
6902153
Merge branch 'ethereum:master' into master
hieronx Jun 11, 2024
66bcb36
Merge branch 'ethereum:master' into master
hieronx Jun 13, 2024
04b4511
Merge branch 'ethereum:master' into master
hieronx Jun 14, 2024
2bed1d0
Clarify request id
hieronx Jun 14, 2024
0c9b237
Merge branch 'ethereum:master' into master
hieronx Jun 17, 2024
b2f8253
Merge branch 'ethereum:master' into master
hieronx Jun 17, 2024
8e50fe5
Merge branch 'ethereum:master' into master
hieronx Jun 17, 2024
d8bffce
fix: explanation on requestRedeem
0xTimepunk Jun 21, 2024
7109115
Merge pull request #40 from 0xTimepunk/master
hieronx Jun 22, 2024
c7e44a1
Merge branch 'ethereum:master' into master
hieronx Jun 22, 2024
6818f01
Merge branch 'ethereum:master' into master
hieronx Jun 23, 2024
04e40bc
Merge branch 'ethereum:master' into master
hieronx Jun 28, 2024
c5c8fd5
Merge branch 'master' of https://github.com/hieronx/ERCs into permiss…
hieronx Jul 4, 2024
72b4320
Simplify
hieronx Jul 4, 2024
5f8e34b
Update ERC165 id
hieronx Jul 4, 2024
042dde0
Add rationale
hieronx Jul 8, 2024
f9f5a74
Add link
hieronx Jul 8, 2024
6ff7a8a
Merge branch 'master' into permissions
hieronx Jul 8, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
68 changes: 68 additions & 0 deletions ERCS/erc-7714.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
---
eip: 7714
title: Simple Permissions Checks
description: Standardized interface for checking user permissions

Check failure on line 4 in ERCS/erc-7714.md

View workflow job for this annotation

GitHub Actions / EIP Walidator

preamble header `description` should not contain `standard` (or similar words.)

error[preamble-re-description]: preamble header `description` should not contain `standard` (or similar words.) --> ERCS/erc-7714.md:4:13 | 4 | description: Standardized interface for checking user permissions | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ prohibited pattern was matched | = info: the pattern in question: `(?i)standar\w*\b` = help: see https://ethereum.github.io/eipw/preamble-re-description/
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Your description could be a bit more detailed. What is a permission? What makes this proposal "simple"?

author: Jeroen Offerijns (@hieronx)
discussions-to: https://ethereum-magicians.org/t/erc-7714-simple-permissions-checks/20495
status: Draft
type: Standards Track
category: ERC
created: 2024-05-24
requires: 165
---

## Abstract

The following standard provides a generic method for checking whether a given account has permissions on a contract

This can be used for permissions such as token blacklists, minimum token holdings, vaults with allowlists built in, and any other permissions relevant to smart contract execution.

## Motivation

While there has been standards focused on defining permissions for ERC20 token transfers (e.g. ERC-1404), there is no standard that enables any permission for any arbitrary contract to be retrieved.

Check failure on line 22 in ERCS/erc-7714.md

View workflow job for this annotation

GitHub Actions / EIP Walidator

the first match of the given pattern must be a link

error[markdown-link-first]: the first match of the given pattern must be a link --> ERCS/erc-7714.md | 22 | While there has been standards focused on defining permissions for ERC20 token transfers (e.g. ERC-1404), there is no standard that enables any permission for any arbitrary contract to be retrieved. | = info: the pattern in question: `(?i)(?:eip|erc)-[0-9]+` = help: see https://ethereum.github.io/eipw/markdown-link-first/

Check failure on line 22 in ERCS/erc-7714.md

View workflow job for this annotation

GitHub Actions / EIP Walidator

proposals must be referenced with the form `ERC-N` (not `ERCN` or `ERC N`)

error[markdown-re-erc-dash]: proposals must be referenced with the form `ERC-N` (not `ERCN` or `ERC N`) --> ERCS/erc-7714.md | 22 | While there has been standards focused on defining permissions for ERC20 token transfers (e.g. ERC-1404), there is no standard that enables any permission for any arbitrary contract to be retrieved. | = info: the pattern in question: `(?i)erc[\s]*[0-9]+` = help: see https://ethereum.github.io/eipw/markdown-re-erc-dash/

## Specification

### Methods

#### `isPermissioned(address)`

Returns `true` if the `user` is permissioned to interact with the contract.

```yaml
- name: isPermissioned
type: function
stateMutability: view

inputs:
- name: user
type: address

outputs:
- name: status
type: bool
```

### [ERC-165](./eip-165.md) support

Smart contracts implementing this Vault standard MUST implement the [ERC-165](./eip-165.md) `supportsInterface` function.

Contracts MUST return the constant value `true` if `0x78d77ecb` is passed through the `interfaceID` argument.

## Rationale

### Contract-level check

The standard only supports a contract-level check, where permission for a user is either granted on the contract level or not. Contracts may implement more granular permissions, e.g. for token transfers on an ERC-20 implementation where a user can receive tokens but not send them. In this case, it is up to the contracts to decide how to expose these permissions to integrations. This can be done by implementing additional permission checks that are not standardized.

Check failure on line 56 in ERCS/erc-7714.md

View workflow job for this annotation

GitHub Actions / EIP Walidator

the first match of the given pattern must be a link

error[markdown-link-first]: the first match of the given pattern must be a link --> ERCS/erc-7714.md | 56 | The standard only supports a contract-level check, where permission for a user is either granted on the contract level or not. Contracts may implement more granular permissions, e.g. for token transfers on an ERC-20 implementation where a user can receive tokens but not send them. In this case, it is up to the contracts to decide how to expose these permissions to integrations. This can be done by implementing additional permission checks that are not standardized. | = info: the pattern in question: `(?i)(?:eip|erc)-[0-9]+`

### Mandated Support for [ERC-165](./eip-165.md)

Implementing support for [ERC-165](./eip-165.md) is mandated because it simplifies integrations, which can check in a gas efficient manner whether the permissions standard is implemented by a contract.

## Security Considerations

Users should not assume having a permission ensures their calls will be guaranteed to succeed.

## Copyright

Copyright and related rights waived via [CC0](../LICENSE.md).
Loading