General Question around bytes

ERC777 uses bytes quite a bit. Are bytes just a form of signature to prove/keep track of transactions for accounting purposes or is there a deeper meaning to bytes?

:computer: Environment
Remix pragma solidity ^0.6.0

:memo:Details

:1234: Code to reproduce

function send(address recipient, uint256 amount, bytes memory data) public override  {
    _send(_msgSender(), recipient, amount, data, "", true);
}
1 Like

Hi @DuckSoldier,

ERC777 is a richer standard for fungible tokens (though you need to handle reentrancy)

data and operatorData bytes fields are used to pass data, e.g. to recipients.

See https://eips.ethereum.org/EIPS/eip-777 for details on data and operatorData bytes fields:

Every token transaction contains data and operatorData bytes fields to be used freely to pass data from the holder and the operator, respectively.

Also see https://docs.openzeppelin.com/contracts/2.x/erc777

I also recommend looking at: Simple ERC777 token example especially the recipient.

1 Like