-
Notifications
You must be signed in to change notification settings - Fork 467
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
base: master
Are you sure you want to change the base?
Changes from all commits
ee8f47d
f7c1b04
e1d30e2
39f3848
b0b639c
bc03c9c
8ba1288
0c7ce18
70faf5e
fdec97d
8fd590d
c5aa5ff
749c682
2b9f351
34368f6
a0f6042
c8b4caf
b4f69a1
77dbf29
6a0b5d0
2813cc0
e1eff3b
e14c133
6902153
66bcb36
04b4511
2bed1d0
0c9b237
b2f8253
8e50fe5
d8bffce
7109115
c7e44a1
6818f01
04e40bc
c5c8fd5
72b4320
5f8e34b
042dde0
f9f5a74
6ff7a8a
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
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 GitHub Actions / EIP Walidatorpreamble header `description` should not contain `standard` (or similar words.)
|
||
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 GitHub Actions / EIP Walidatorthe first match of the given pattern must be a link
Check failure on line 22 in ERCS/erc-7714.md GitHub Actions / EIP Walidatorproposals must be referenced with the form `ERC-N` (not `ERCN` or `ERC N`)
|
||
|
||
## 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 GitHub Actions / EIP Walidatorthe first match of the given pattern must be a link
|
||
|
||
### 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). |
There was a problem hiding this comment.
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"?