-
Notifications
You must be signed in to change notification settings - Fork 5.3k
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
Weighted NFTs #874
Closed
Closed
Weighted NFTs #874
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,77 @@ | ||
## Preamble | ||
|
||
eip: 874 | ||
title: Weighted NFTs | ||
author: Alex Sherbuck <Alex@igave.io> | ||
type: Standard Track | ||
category: ERC | ||
status: Draft | ||
created: 2018-02-06 | ||
|
||
## Summary | ||
Not all NFTs are created equal. Nothing exists to distinguish one NFT from another. Weight allows a DAO or other external actors to recognize some value for unique asset holdings. | ||
|
||
## Motivation | ||
This allows DAOs to form based on asset/NFT holdings instead of just ERC-20 token holdings. Asset holders may decide how to set their token weight. | ||
|
||
## Specification | ||
The Weighted Digital Asset Registry is an extension for ERC-821 that tracks asset weight. This follows the standard set in [ERC821](https://github.com/ethereum/EIPs/issues/821) and adds: | ||
|
||
## Weighted DAR | ||
Extension to ERC-821 | ||
|
||
#### totalWeight | ||
`function totalWeight() public view returns (uint256);` | ||
Returns the total weight tracked by the DAR | ||
|
||
#### isWeighted | ||
`function isWeighted() public view returns (bool);` | ||
This method returns true. | ||
|
||
#### weightOfAsset | ||
`function weightOfAsset(uint256 assetId) public view returns (uint64);` | ||
Returns the total weight of an individual asset. | ||
|
||
#### weightOfHolder | ||
`function weightOfHolder(address holder) public view returns (uint256);` | ||
Returns the total weight of the assets controlled by the holder. | ||
|
||
#### changeWeight | ||
`function changeWeight(uint256 assetId, uint64 weight) public;` | ||
Changes the weight of the asset to the given value. | ||
|
||
#### Events | ||
``` | ||
event TransferWeight( | ||
address indexed from, | ||
address indexed to, | ||
uint256 indexed assetId, | ||
uint64 weight | ||
); | ||
event ChangeWeight( | ||
uint256 indexed assetId, | ||
uint64 weight | ||
); | ||
``` | ||
|
||
## DAR Adapter | ||
An adapter that exposes a `balanceOf`. | ||
|
||
#### voteWeightAddress | ||
`function voteWeightAddress() public view returns (address);` | ||
Returns the address of the Weighted DAR. | ||
|
||
#### balanceOf | ||
`function balanceOf(address holder) public view returns (uint256);` | ||
Calls the `weightOfHolder` function of the Weighted DAR. | ||
|
||
## Implementation | ||
This will be updated to the most recent ERC-721 standard. | ||
|
||
[Weighted Digital Asset Registry](https://github.com/I-Gave/erc821/tree/weighted-registry/contracts) - w/ DAO voting | ||
|
||
## Rationale | ||
Including an adapter for the DAO to reference holder weight minimizes the impact on current DAO code that references an ERC-20's `balanceOf` | ||
|
||
## Copyright | ||
Copyright and related rights waived via [CC0](https://creativecommons.org/publicdomain/zero/1.0/). |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
What is a DAR?
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.
DAR was the 821 standard that was contentious with 721 before everyone decide to merge 821 Digital Asset Registry into 721 a while back.