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

Create eip-1538 #1567

Closed
wants to merge 139 commits into from
Closed
Changes from 1 commit
Commits
Show all changes
139 commits
Select commit Hold shift + click to select a range
ddf8c79
Create eip-173.md
mudgen Jun 7, 2018
f32e334
Merge branch 'master' into master
mudgen Jun 8, 2018
262a22b
Removed "review-period-end"
mudgen Jun 8, 2018
91e8a96
Merge branch 'master' into master
mudgen Jun 8, 2018
9d25378
Update eip-173.md
mudgen Jun 8, 2018
9b8ae04
Update eip-173.md
mudgen Jun 8, 2018
120db79
Update eip-173.md
mudgen Jun 9, 2018
2d49707
Merge branch 'master' into master
mudgen Jun 9, 2018
3152c37
Merge pull request #1 from ethereum/master
mudgen Jul 6, 2018
c3e8ebe
Create eip-998.md
mudgen Jul 6, 2018
2eb6741
Update eip-998.md
mudgen Jul 7, 2018
75ea064
Update eip-998.md
mudgen Jul 7, 2018
329c9fb
Update eip-998.md
mudgen Jul 7, 2018
b204c45
Update eip-998.md
mudgen Jul 7, 2018
75d9d3a
Update eip-998.md
mudgen Jul 7, 2018
1855496
Update eip-998.md
mudgen Jul 7, 2018
40022ed
Update eip-998.md
mudgen Jul 7, 2018
9532553
Update eip-998.md
mudgen Jul 9, 2018
dd67da2
Update eip-998.md
mudgen Jul 9, 2018
c99ef91
Update eip-998.md
mudgen Jul 9, 2018
4da3c88
Update eip-998.md
mudgen Jul 9, 2018
6777883
Update eip-998.md
mudgen Jul 9, 2018
ba2ec3d
Update eip-998.md
mudgen Jul 9, 2018
003c3d7
Update eip-998.md
mudgen Jul 9, 2018
70df6d3
Update eip-998.md
mudgen Jul 9, 2018
0a44992
Update eip-998.md
mudgen Jul 9, 2018
01db870
Update eip-998.md
mudgen Jul 12, 2018
1c896ee
Update eip-998.md
mudgen Jul 12, 2018
a8d9a24
Update eip-998.md
mudgen Jul 12, 2018
c4de1b8
Update eip-998.md
mudgen Jul 12, 2018
3ddd1f5
Update eip-998.md
mudgen Jul 12, 2018
d98608e
Update eip-998.md
mudgen Jul 12, 2018
ae3d993
Update eip-998.md
mudgen Jul 12, 2018
37baef2
Update eip-998.md
mudgen Jul 12, 2018
2fe7526
Update eip-998.md
mudgen Jul 12, 2018
ecb01bf
Update eip-998.md
mudgen Jul 12, 2018
f21ba8b
Update eip-998.md
mudgen Jul 12, 2018
e821a41
Update eip-998.md
mudgen Jul 17, 2018
78f5804
Update eip-998.md
mudgen Jul 17, 2018
ce02d89
Update eip-998.md
mudgen Jul 17, 2018
29cddef
Update eip-998.md
mudgen Jul 17, 2018
2e752a9
Update eip-998.md
mudgen Jul 17, 2018
1504b00
Update eip-998.md
mudgen Jul 17, 2018
8796d06
Update eip-998.md
mudgen Jul 17, 2018
cf8b67b
Update eip-998.md
mudgen Jul 17, 2018
3eb0dd4
Update eip-998.md
mudgen Jul 17, 2018
c859c82
Update eip-998.md
mudgen Jul 17, 2018
e3ffc62
Update eip-998.md
mudgen Jul 17, 2018
c6f5ddd
Update eip-998.md
mudgen Jul 17, 2018
2a15e51
Update eip-998.md
mudgen Jul 17, 2018
d0f8de3
Update eip-998.md
mudgen Jul 17, 2018
9905884
Update eip-998.md
mudgen Jul 18, 2018
06f7616
Update eip-998.md
mudgen Jul 18, 2018
6b0d0ea
Update eip-998.md
mudgen Jul 18, 2018
3d5d99e
Update eip-998.md
mudgen Jul 18, 2018
45bdf8e
Update eip-998.md
mudgen Jul 18, 2018
2f3f6e5
Update eip-998.md
mudgen Jul 18, 2018
f7179a0
Update eip-998.md
mudgen Jul 18, 2018
b1c3012
Update eip-998.md
mudgen Jul 18, 2018
32f8737
Update eip-998.md
mudgen Jul 18, 2018
ad6aa8d
Update eip-998.md
mudgen Jul 18, 2018
f3027fd
Update eip-998.md
mudgen Jul 18, 2018
1e38ec3
Update eip-998.md
mudgen Jul 18, 2018
1c43231
Update eip-998.md
mudgen Jul 18, 2018
e0a3dbf
Update eip-998.md
mudgen Jul 18, 2018
d20c987
Update eip-998.md
mudgen Jul 18, 2018
2d2cb7a
Update eip-998.md
mudgen Jul 18, 2018
2fbb7bb
Update eip-998.md
mudgen Jul 19, 2018
b71ad48
Update eip-998.md
mudgen Jul 24, 2018
c1e0026
Merge branch 'master' into master
mudgen Jul 24, 2018
43c5c41
Update eip-998.md
Arachnid Jul 24, 2018
30a7c16
Update eip-998, removed bytes _data parameter from the onERC998Remove…
mudgen Jul 25, 2018
4a956bb
Merge branch 'master' into master
mudgen Jul 25, 2018
2e1caf9
Update eip-998
mudgen Jul 25, 2018
737b39d
Merge branch 'master' into master
mudgen Jul 25, 2018
dcbbe8a
EIP-998 Added _data parameter to onERC998Removed
mudgen Jul 25, 2018
2bb3339
Merge branch 'master' into master
mudgen Jul 25, 2018
bdef624
Update eip-998.md
mudgen Jul 27, 2018
6cc5332
Update eip-998.md
mudgen Jul 27, 2018
a5c9381
Update eip-998.md
mudgen Jul 27, 2018
79a1d5c
Update eip-998.md
mudgen Jul 27, 2018
8989b27
Update eip-998.md
mudgen Jul 27, 2018
7de6e45
Update eip-998.md
mudgen Jul 27, 2018
3c4cc9c
Update eip-998.md
mudgen Jul 27, 2018
84486c3
Update eip-998.md
mudgen Jul 27, 2018
5e2d30c
Update eip-998.md
mudgen Jul 27, 2018
9200568
Update eip-998.md
mudgen Jul 27, 2018
306528d
Update eip-998.md
mudgen Jul 27, 2018
dbdb003
Update eip-998.md
mudgen Jul 27, 2018
2522652
Update eip-998.md
mudgen Jul 27, 2018
c31831e
Update eip-998.md
mudgen Jul 27, 2018
416c41f
Update eip-998.md
mudgen Jul 27, 2018
168cd1b
Update eip-998.md
mudgen Jul 27, 2018
60315e9
Update eip-998.md
mudgen Jul 27, 2018
0f5150b
Update eip-998.md
mudgen Jul 27, 2018
7dd5839
Update eip-998.md
mudgen Jul 27, 2018
2e589d2
Update eip-998.md
mudgen Jul 27, 2018
08d2d1b
Merge branch 'master' into master
mudgen Jul 27, 2018
c55e2e6
Update eip-998.md
mudgen Jul 27, 2018
0654af3
Merge branch 'master' into master
mudgen Jul 27, 2018
7c2a51e
Update eip-998.md
mudgen Jul 27, 2018
b606607
Merge branch 'master' into master
mudgen Jul 27, 2018
0fcc6e6
Update eip-998.md
mudgen Jul 30, 2018
4fe8c44
Update eip-998.md
mudgen Jul 30, 2018
c317870
Merge pull request #2 from ethereum/master
mudgen Jul 30, 2018
99858ba
Update eip-998.md
mudgen Jul 30, 2018
b6cc13f
Merge branch 'master' into master
Arachnid Jul 31, 2018
d3946fe
Update eip-998.md
mudgen Jul 31, 2018
5cbfda3
Update eip-998.md
mudgen Jul 31, 2018
b86a2fa
Update eip-998.md
mudgen Jul 31, 2018
38a81d1
Merge branch 'master' into master
mudgen Jul 31, 2018
7d44b2e
Update eip-998.md
mudgen Jul 31, 2018
39ca49b
Update eip-998.md
mudgen Aug 7, 2018
39cc5b4
Update eip-998.md
mudgen Aug 7, 2018
3fdbd8b
Merge branch 'master' into master
mudgen Aug 7, 2018
9ab767f
Merge pull request #3 from ethereum/master
mudgen Aug 14, 2018
a0a0d67
Update eip-998.md
mudgen Aug 14, 2018
93604dc
Update eip-998.md
mudgen Aug 14, 2018
f2aedca
Update eip-998.md
mudgen Aug 14, 2018
287f3cf
Update eip-998.md
mudgen Aug 14, 2018
cbb76c1
Update eip-998.md
mudgen Aug 14, 2018
6b832a1
Update eip-998.md
mudgen Aug 14, 2018
60d8cb5
Merge pull request #4 from ethereum/master
mudgen Aug 20, 2018
611ef19
ERC998, Clarified interfaces to use
mudgen Aug 20, 2018
d2f476c
Update eip-998.md
mudgen Aug 24, 2018
7400803
Merge branch 'master' into master
mudgen Aug 24, 2018
5a1741d
Update eip-998.md
mudgen Sep 19, 2018
9d55bd1
Merge branch 'master' into master
mudgen Sep 19, 2018
ad01568
Merge pull request #5 from ethereum/master
mudgen Nov 8, 2018
15a7894
Create eip-1538
mudgen Nov 8, 2018
d65b65a
Delete eip-1538.md
mudgen Nov 15, 2018
01fc299
Create eip-1538.md
mudgen Nov 15, 2018
5cb9e08
Merge pull request #6 from ethereum/master
mudgen Nov 16, 2018
7f9efc2
eip-1538, added a solution for inherited storage
mudgen Nov 16, 2018
eac50b4
Merge pull request #7 from ethereum/master
mudgen Mar 27, 2019
64354f9
Update eip-1538.md
mudgen Mar 27, 2019
60511f4
Update eip-1538.md
mudgen Mar 27, 2019
36bac8e
Update eip-1538.md
mudgen Mar 27, 2019
f21ebc7
Update eip-1538.md
mudgen Mar 27, 2019
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
Prev Previous commit
Next Next commit
Update eip-998.md
  • Loading branch information
mudgen authored Jul 9, 2018
commit 95325537ac6fd87724648c68b927459cdda81b13
66 changes: 47 additions & 19 deletions EIPS/eip-998.md
Original file line number Diff line number Diff line change
Expand Up @@ -87,10 +87,12 @@ The `ownerOf(uint256 _tokenId)` is a standard ERC721 function. It works differen

*Contracts/tokens that implement the above authentication and traversal functionality are "composable aware".*

### Top-Down Composables
### Top-Down Composable

Every ERC-998 Top-Down Composable compliant contract must implement the ERC998ERC721TopDown interface and/or the ERC998ERC20TopDown interface.

The ERC998ERC721TopDownEnumerable and ERC998ERC20TopDownEnumerable interfaces are optional.

```solidity
pragma solidity ^0.4.24;

Expand All @@ -109,42 +111,68 @@ interface ERC998ERC721TopDown {
event TransferChild(uint256 indexed tokenId, address indexed _to, address indexed _childContract, uint256 _childTokenId);

/// @notice Get the address and parent tokenId that owns the supplied tokenId.
/// @dev If _tokenId has no parent token then the first byte of isParent is 0, otherwise the first byte is 1.
/// The next four bytes of isParent are the magic value 0x89885a59, which is equal to
/// bytes4(keccak256(abi.encodePacked("tokenOwnerOf(uint256)")))
/// If a call to tokenOwnerOf throws or the magic value is not correct then the transaction does not have to revert.
/// Instead the tokenOwnerOf function is considered to not be supported by the address it was called on
/// and there is no parent token and a call to the ownerOf function should be made to get the rootOwner address.
/// @param _tokenId The token to query for an owner address and owner token
/// @return tokenOwner The owner address of _tokenId
/// @return parentTokenId The parent tokenId of _tokenId
/// @return isParent Determines if parentTokenId is a parent tokenId and contains a magic value.
/// @return isParent Determines if parentTokenId is a parent tokenId and contains a magic value to ensure return values are valid.
function tokenOwnerOf(uint256 _tokenId) external view returns (address tokenOwner, uint256 parentTokenId, uint256 isParent);

/// @notice Get the parent tokenId of a child token.
/// @dev If the child token has no parent token then the first byte of isParent is 0, otherwise the first byte is 1.
/// The next four bytes of isParent are the magic value 0xeadb80b8, which is equal to
/// bytes4(keccak256(abi.encodePacked("ownerOfChild(address,uint256)")))
/// If a call to ownerOfChild throws or the magic value is not correct then the transaction does not have to revert.
/// Instead the ownerOfChild function is considered to not be supported by the address it was called on
/// and there is no parent token.
/// @param _childContract The contract address of the child token.
/// @param _childTokenId The tokenId of the child.
/// @return parentTokenId The parent tokenId of _tokenId
/// @return isParent Determines if parentTokenId is a parent tokenId and contains a magic value.
/// @return isParent Determines if parentTokenId is a parent tokenId and contains a magic value to ensure return values are valid.
function ownerOfChild(address _childContract, uint256 _childTokenId) external view returns (uint256 parentTokenId, uint256 isParent);


/// @notice A token receives a child token
/// @param _operator The address that caused the transfer.
/// @param _from The owner of the child token.
/// @param _childTokenId The token that is being transferred to the parent.
/// @param _data Up to the first 32 bytes contains an integer which is the receiving parent tokenId.
function onERC721Received(address _operator, address _from, uint256 _childTokenId, bytes _data) external returns(bytes4);
function onERC998Removed(address _operator, address _toContract, uint256 _tokenId, bytes _data) external;

/// @notice Let's an owning contract know that a specified token is transferred out
/// @param The address that caused the transfer.
/// @param _toContract The contract that receives the child token
/// @param _childTokenId The child tokenId that is being removed.
/// @param _data Additional data with no specified format
function onERC998Removed(address _operator, address _toContract, uint256 _childTokenId, bytes _data) external;

/// @notice Transfer child token from top-down composable to address.
/// @param _to The address that receives the child token
/// @param _childContract The ERC721 contract of the child token.
/// @param _childTokenId The tokenId of the token that is being transferred.
function transferChild(address _to, address _childContract, uint256 _childTokenId) external;

/// @notice Transfer child token from top-down composable to address.
/// @param _to The address that receives the child token
/// @param _childContract The ERC721 contract of the child token.
/// @param _childTokenId The tokenId of the token that is being transferred.
function safeTransferChild(address _to, address _childContract, uint256 _childTokenId) external;

/// @notice Transfer child token from top-down composable to address.
/// @param _to The address that receives the child token
/// @param _childContract The ERC721 contract of the child token.
/// @param _childTokenId The tokenId of the token that is being transferred.
/// @param _data Additional data with no specified format
function safeTransferChild(address _to, address _childContract, uint256 _childTokenId, bytes _data) external;
// getChild function enables older contracts like cryptokitties to be transferred into a composable
// The _childContract must approve this contract. Then getChild can be called.

/// @notice Get a child token from an ERC721 contract.
/// @param _from The address that owns the child token.
/// @param _tokenId The token that becomes the parent owner
/// @param _childContract The ERC721 contract of the child token
/// @param _childTokenId The tokenId of the child token
function getChild(address _from, uint256 _tokenId, address _childContract, uint256 _childTokenId) external;
}

######



// getChild function enables older contracts like cryptokitties to be transferred into a composable
// The _childContract must approve this contract. Then getChild can be called.


interface ERC998ERC721TopDownEnumerable {
function totalChildContracts(uint256 _tokenId) external view returns(uint256);
function childContractByIndex(uint256 _tokenId, uint256 _index) external view returns (address childContract);
Expand Down