From 68aae3398fcbb96c18904f39c84e53e6a4d7f778 Mon Sep 17 00:00:00 2001 From: tenthirtyone Date: Tue, 6 Feb 2018 18:19:15 -0500 Subject: [PATCH 1/4] dar voting weight --- EIPS/DAR-vote-weight.md | 47 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 47 insertions(+) create mode 100644 EIPS/DAR-vote-weight.md diff --git a/EIPS/DAR-vote-weight.md b/EIPS/DAR-vote-weight.md new file mode 100644 index 0000000000000..1111250235457 --- /dev/null +++ b/EIPS/DAR-vote-weight.md @@ -0,0 +1,47 @@ + + +## Preamble + + EIP: + Title: NFT Extension for DAO Voting Weight + Author: Alex Sherbuck + Type: Standard Track + Category: ERC + Status: Draft + Created: 2018-02-06 + Requires EIP 821 + + +## Summary +The ERC-721 NFT `balanceOf` returns the count of assets owned by an address. ERC-821 moved this functionality into `assetCount` and maintains `balanceOf` as an alias to `assetCount`. This change proposes `balanceOf` return an abstract weight representing the NFTs value in the system. + +## Abstract +A DAO shareholder association relies on the ERC-20 `balanceOf` to obtain the number of votes controlled by an address. Replacing an ERC-20 address with an ERC-721/821 permits the DAO to use the NFT `balanceOf` as votes. The nature of NFTs is that their values are distinct from one another. This change allows for a unique weight to represent this distinction for each NFT. + +## Motivation +The ERC-20 `balanceOf` works well for DAO voting. A fungible tokens value corresponds 1:1 with its asset count. The NFT `balanceOf` should represent the tokens value. + +E.g. Each Cryptokitty has a generation. Each plot of LAND has an auction price. An NFT is like a receipt for that value. 'Weight' is the abstraction of that property. + +Voting based on asset weight permits DAOs to form around NFC voting or a combination of ERC-20 and NFC voting. Instead of associations of token holders this permits associations of LAND holders, for instance. + +## Specification + +An ERC-721 example exists but the recent ERC-821 DAR is better suited for this extension. The ERC-721 example is included at the end, the ERC-821 rework is taking place. This spec will be updated to reflect the completion of that work. + +## Rationale +Changing `balanceOf` to a weight requires no changes to the current DAOs relying on ERC-20's `balanceOf` function. DAOs may reference an individual ERC-721 contract or array of shareHolder addresses, mixing both ERC-20 and ERC-721. + +Changing balanceOf of the ERC-721 is favorable to creating a comparable voteWeight function as that would complicate the DAO executeProposal code - it would require duplicate existing ERC-20 logic due to function naming. + +## Backwards Compatibility +While `balanceOf` requires no changes to its function signature. Apps and contracts that previously relied on some combination of `totalSupply` and `balanceOf` will have breaking issues as this will represent a different ratio. + +## Implementation + +This is being re-worked into the ERC-821 Digital Asset Registry. For now an example lives as part of an ERC-721 contract + +[ERC-721 Example](https://github.com/tenthirtyone/zeppelin-solidity/tree/voting-weight) + +## Copyright +Copyright and related rights waived via [CC0](https://creativecommons.org/publicdomain/zero/1.0/). From 3b81da144772bbfff574a52e5c738ef29c361cfb Mon Sep 17 00:00:00 2001 From: tenthirtyone Date: Thu, 8 Feb 2018 08:02:00 -0500 Subject: [PATCH 2/4] updated spec --- EIPS/DAR-vote-weight.md | 67 ++++++++++++++++++++++++----------------- 1 file changed, 40 insertions(+), 27 deletions(-) diff --git a/EIPS/DAR-vote-weight.md b/EIPS/DAR-vote-weight.md index 1111250235457..7d885cf3bc48f 100644 --- a/EIPS/DAR-vote-weight.md +++ b/EIPS/DAR-vote-weight.md @@ -1,9 +1,7 @@ - - ## Preamble EIP: - Title: NFT Extension for DAO Voting Weight + Title: Weighted Distinguishable Asset Registry Author: Alex Sherbuck Type: Standard Track Category: ERC @@ -13,35 +11,50 @@ ## Summary -The ERC-721 NFT `balanceOf` returns the count of assets owned by an address. ERC-821 moved this functionality into `assetCount` and maintains `balanceOf` as an alias to `assetCount`. This change proposes `balanceOf` return an abstract weight representing the NFTs value in the system. - -## Abstract -A DAO shareholder association relies on the ERC-20 `balanceOf` to obtain the number of votes controlled by an address. Replacing an ERC-20 address with an ERC-721/821 permits the DAO to use the NFT `balanceOf` as votes. The nature of NFTs is that their values are distinct from one another. This change allows for a unique weight to represent this distinction for each NFT. - -## Motivation -The ERC-20 `balanceOf` works well for DAO voting. A fungible tokens value corresponds 1:1 with its asset count. The NFT `balanceOf` should represent the tokens value. - -E.g. Each Cryptokitty has a generation. Each plot of LAND has an auction price. An NFT is like a receipt for that value. 'Weight' is the abstraction of that property. - -Voting based on asset weight permits DAOs to form around NFC voting or a combination of ERC-20 and NFC voting. Instead of associations of token holders this permits associations of LAND holders, for instance. - -## Specification - -An ERC-721 example exists but the recent ERC-821 DAR is better suited for this extension. The ERC-721 example is included at the end, the ERC-821 rework is taking place. This spec will be updated to reflect the completion of that work. +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. ## Rationale -Changing `balanceOf` to a weight requires no changes to the current DAOs relying on ERC-20's `balanceOf` function. DAOs may reference an individual ERC-721 contract or array of shareHolder addresses, mixing both ERC-20 and ERC-721. - -Changing balanceOf of the ERC-721 is favorable to creating a comparable voteWeight function as that would complicate the DAO executeProposal code - it would require duplicate existing ERC-20 logic due to function naming. - -## Backwards Compatibility -While `balanceOf` requires no changes to its function signature. Apps and contracts that previously relied on some combination of `totalSupply` and `balanceOf` will have breaking issues as this will represent a different ratio. +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: + +#### 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 + ); +``` ## Implementation -This is being re-worked into the ERC-821 Digital Asset Registry. For now an example lives as part of an ERC-721 contract - -[ERC-721 Example](https://github.com/tenthirtyone/zeppelin-solidity/tree/voting-weight) +[Weighted Digital Asset Registry](https://github.com/I-Gave/erc821/tree/weighted-registry/contracts) ## Copyright Copyright and related rights waived via [CC0](https://creativecommons.org/publicdomain/zero/1.0/). From 0f2169c48ecf7f8d28823d8bb163dce33ec1adb3 Mon Sep 17 00:00:00 2001 From: tenthirtyone Date: Fri, 9 Feb 2018 17:52:08 -0500 Subject: [PATCH 3/4] Added DAP Adapter and DAO voting tests --- EIPS/DAR-vote-weight.md | 22 ++++++++++++++++++++-- 1 file changed, 20 insertions(+), 2 deletions(-) diff --git a/EIPS/DAR-vote-weight.md b/EIPS/DAR-vote-weight.md index 7d885cf3bc48f..23eaa0e3455df 100644 --- a/EIPS/DAR-vote-weight.md +++ b/EIPS/DAR-vote-weight.md @@ -13,12 +13,15 @@ ## 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. -## Rationale +## 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 @@ -52,9 +55,24 @@ event ChangeWeight( 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 -[Weighted Digital Asset Registry](https://github.com/I-Gave/erc821/tree/weighted-registry/contracts) +[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/). From 6772eadb12581fdcd80bc00ae46da55bd999b5c5 Mon Sep 17 00:00:00 2001 From: tenthirtyone Date: Wed, 28 Mar 2018 02:17:53 -0400 Subject: [PATCH 4/4] update for new governance formatting. --- EIPS/DAR-vote-weight.md | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/EIPS/DAR-vote-weight.md b/EIPS/DAR-vote-weight.md index 23eaa0e3455df..f2143225358fd 100644 --- a/EIPS/DAR-vote-weight.md +++ b/EIPS/DAR-vote-weight.md @@ -1,14 +1,12 @@ ## Preamble - EIP: - Title: Weighted Distinguishable Asset Registry - Author: Alex Sherbuck - Type: Standard Track - Category: ERC - Status: Draft - Created: 2018-02-06 - Requires EIP 821 - +eip: 874 +title: Weighted NFTs +author: Alex Sherbuck +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. @@ -68,6 +66,7 @@ Returns the address of the Weighted DAR. 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