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?
Environment
Remix pragma solidity ^0.6.0
https://github.com/OpenZeppelin/openzeppelin-contracts/blob/master/contracts/token/ERC777/ERC777.sol
Details
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