mirror of
https://github.com/status-im/EIPs.git
synced 2025-03-04 08:30:49 +00:00
Automatically merged updates to draft EIP(s) 998
Hi, I'm a bot! This change was automatically merged because: - It only modifies existing Draft or Last Call EIP(s) - The PR was approved or written by at least one author of each modified EIP - The build is passing
This commit is contained in:
parent
d087ea8910
commit
0298d97d09
@ -15,7 +15,6 @@ An extension of the [ERC721 standard](https://eips.ethereum.org/EIPS/eip-721) to
|
||||
|
||||
An extension of the [ERC20](https://eips.ethereum.org/EIPS/eip-20) and [ERC223](https://github.com/ethereum/EIPs/issues/223) standards to enable ERC20 and ERC223 tokens to be owned by ERC721 tokens.
|
||||
|
||||
|
||||
This specification covers four different kinds of composable tokens:
|
||||
|
||||
1. [ERC998ERC721 top-down composable tokens that receive, hold and transfer ERC721 tokens](#erc721-top-down-composable)
|
||||
@ -23,7 +22,6 @@ This specification covers four different kinds of composable tokens:
|
||||
3. [ERC998ERC721 bottom-up composable tokens that attach themselves to other ERC721 tokens.](#erc721-bottom-up-composable)
|
||||
4. [ERC998ERC20 bottom-up composable tokens that attach themselves to ERC721 tokens.](#erc20-bottom-up-composable)
|
||||
|
||||
|
||||
## Abstract
|
||||
|
||||
1. An ERC988ERC721 top-down composable is an ERC721 token with additional functionality for owning other ERC721 tokens.
|
||||
@ -146,19 +144,19 @@ interface ERC998ERC721TopDown {
|
||||
|
||||
/// @dev This emits when a token receives a child token.
|
||||
/// @param _from The prior owner of the token.
|
||||
/// @param _tokenId The token that receives the child token.
|
||||
/// @param _toTokenId The token that receives the child token.
|
||||
event ReceivedChild(
|
||||
address indexed _from,
|
||||
uint256 indexed _tokenId,
|
||||
uint256 indexed _toTokenId,
|
||||
address indexed _childContract,
|
||||
uint256 _childTokenId
|
||||
);
|
||||
|
||||
/// @dev This emits when a child token is transferred from a token to an address.
|
||||
/// @param _tokenId The parent token that the child token is being transferred from.
|
||||
/// @param _fromTokenId The parent token that the child token is being transferred from.
|
||||
/// @param _to The new owner address of the child token.
|
||||
event TransferChild(
|
||||
uint256 indexed tokenId,
|
||||
uint256 indexed _fromTokenId,
|
||||
address indexed _to,
|
||||
address indexed _childContract,
|
||||
uint256 _childTokenId
|
||||
@ -212,10 +210,12 @@ interface ERC998ERC721TopDown {
|
||||
returns(bytes4);
|
||||
|
||||
/// @notice Transfer child token from top-down composable to address.
|
||||
/// @param _fromTokenId The owning token to transfer from.
|
||||
/// @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(
|
||||
uint256 _fromTokenId,
|
||||
address _to,
|
||||
address _childContract,
|
||||
uint256 _childTokenId
|
||||
@ -223,10 +223,12 @@ interface ERC998ERC721TopDown {
|
||||
external;
|
||||
|
||||
/// @notice Transfer child token from top-down composable to address.
|
||||
/// @param _fromTokenId The owning token to transfer from.
|
||||
/// @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(
|
||||
uint256 _fromTokenId,
|
||||
address _to,
|
||||
address _childContract,
|
||||
uint256 _childTokenId
|
||||
@ -234,11 +236,13 @@ interface ERC998ERC721TopDown {
|
||||
external;
|
||||
|
||||
/// @notice Transfer child token from top-down composable to address.
|
||||
/// @param _fromTokenId The owning token to transfer from.
|
||||
/// @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(
|
||||
uint256 _fromTokenId,
|
||||
address _to,
|
||||
address _childContract,
|
||||
uint256 _childTokenId,
|
||||
@ -380,10 +384,12 @@ The return value for `onERC721Received` is the magic value `0x150b7a02` which is
|
||||
#### transferChild
|
||||
```solidity
|
||||
/// @notice Transfer child token from top-down composable to address.
|
||||
/// @param _fromTokenId The owning token to transfer from.
|
||||
/// @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(
|
||||
uint256 _fromTokenId,
|
||||
address _to,
|
||||
address _childContract,
|
||||
uint256 _childTokenId
|
||||
@ -401,10 +407,12 @@ ERC721(_childContract).transferFrom(this, _to, _childTokenId);
|
||||
#### safeTransferChild
|
||||
```solidity
|
||||
/// @notice Transfer child token from top-down composable to address.
|
||||
/// @param _fromTokenId The owning token to transfer from.
|
||||
/// @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(
|
||||
uint256 _fromTokenId,
|
||||
address _to,
|
||||
address _childContract,
|
||||
uint256 _childTokenId
|
||||
@ -422,11 +430,13 @@ ERC721(_childContract).safeTransferFrom(this, _to, _childTokenId);
|
||||
#### safeTransferChild
|
||||
```solidity
|
||||
/// @notice Transfer child token from top-down composable to address or other top-down composable.
|
||||
/// @param _fromTokenId The owning token to transfer from.
|
||||
/// @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, can be used to specify tokenId to transfer to
|
||||
function safeTransferChild(
|
||||
uint256 _fromTokenId,
|
||||
address _to,
|
||||
address _childContract,
|
||||
uint256 _childTokenId,
|
||||
@ -493,7 +503,7 @@ function getChild(
|
||||
external;
|
||||
```
|
||||
|
||||
This function is used to transfer an ERC721 token when its contract does not have a `safeTransferChild(address _to, address _childContract, uint256 _childTokenId, bytes _data)` function.
|
||||
This function is used to transfer an ERC721 token when its contract does not have a `safeTransferChild(uint256 _fromTokenId, address _to, address _childContract, uint256 _childTokenId, bytes _data)` function.
|
||||
|
||||
A transfer with this function is done in two steps:
|
||||
1. The owner of the ERC721 token calls `approve` or `setApprovalForAll` in the ERC721 contract for the top-down composable contract.
|
||||
@ -576,12 +586,12 @@ interface ERC998ERC20TopDown {
|
||||
|
||||
/// @dev This emits when a token receives ERC20 tokens.
|
||||
/// @param _from The prior owner of the token.
|
||||
/// @param _tokenId The token that receives the ERC20 tokens.
|
||||
/// @param _toTokenId The token that receives the ERC20 tokens.
|
||||
/// @param _erc20Contract The ERC20 contract.
|
||||
/// @param _value The number of ERC20 tokens received.
|
||||
event ReceivedERC20(
|
||||
address indexed _from,
|
||||
uint256 indexed _tokenId,
|
||||
uint256 indexed _toTokenId,
|
||||
address indexed _erc20Contract,
|
||||
uint256 _value
|
||||
);
|
||||
@ -592,7 +602,7 @@ interface ERC998ERC20TopDown {
|
||||
/// @param _erc20Contract The ERC20 contract.
|
||||
/// @param _value The number of ERC20 tokens transferred.
|
||||
event TransferERC20(
|
||||
uint256 indexed _tokenId,
|
||||
uint256 indexed _fromTokenId,
|
||||
address indexed _to,
|
||||
address indexed _erc20Contract,
|
||||
uint256 _value
|
||||
|
Loading…
x
Reference in New Issue
Block a user