0xsequence / erc-1155

Ethereum Semi Fungible Standard (ERC-1155)
https://sequence.build
Other
321 stars 118 forks source link

L2 - Noncompliant with `_operator` definitions by ERC-1155 #27

Open PhABC opened 4 years ago

PhABC commented 4 years ago

image

by @Agusx1211

PhABC commented 4 years ago

One can't replace msg.sender with _from for the _operator since the operator is not always "from" and is meant to represent who initiated the transfer. A dex could be the operator, like 0x or Uniswap, for instance.

You can see a slightly different definition of what is meant by operator here ;

/**
    Note: The ERC-165 identifier for this interface is 0x4e2312e0.
*/
interface ERC1155TokenReceiver {
    /**
     * @notice Handle the receipt of a single ERC1155 token type.
     * @param _operator  The address which initiated the transfer (i.e. msg.sender)
     * @param _from        The address which previously owned the token
     */
    function onERC1155Received(address _operator, address _from, uint256 _id, uint256 _value, bytes calldata _data) external returns(bytes4);

    /**
     * @notice Handle the receipt of multiple ERC1155 token types.
     * @param _operator  The address which initiated the batch transfer (i.e. msg.sender)
     * @param _from         The address which previously owned the tokens
     */
    function onERC1155BatchReceived(address _operator, address _from, uint256[] calldata _ids, uint256[] calldata _values, bytes calldata _data) external returns(bytes4);       
}
Agusx1211 commented 4 years ago

The ERC-1155 specification seems to have a conflicting definition of _operator, because The address which initiated the transfer is not always authorized to move the coins.

PhABC commented 4 years ago

Indeed. I discussed with other ERC-1155 devs and we agree that this is a bit subjective and what operator might represent could vary. Need to ponder this a bit more.