Hi guys, can anyone please explain in layman terms about what an ERC777 token is? How is it different from ERC20?
Jun 27, 2021, 1:47 PM
It adds extra features which enhances erc20
that is there are operators
who can act on behalf of the token holder or contract
function defaultOperators() external view returns (address[] memory);
function isOperatorFor(
address operator,
address holder
) external view returns (bool);
function authorizeOperator(address operator) external;
function revokeOperator(address operator) external;
function isOperatorFor(
address operator,
address holder
) external view returns (bool);
function authorizeOperator(address operator) external;
function revokeOperator(address operator) external;
but its adoption is very low
as operators such as defaultOperator when not set to 0x0 or nobody can do harm to all the holders
they can send anyone's token
burn anyone's token
or even spend anyone's token
Jun 27, 2021, 1:51 PM
So basically, it's a role that everybody has approved without actually approving, correct?
Jun 27, 2021, 1:53 PM
The defaultOperator yes
but user can approve other operators
Jun 27, 2021, 1:54 PM
That does sound a very attractive feature.
Jun 27, 2021, 1:54 PM
Yes, thats the most riskiest part
Jun 27, 2021, 1:54 PM
Best difference I saw is the token fallback implementation
Jun 27, 2021, 1:54 PM
nope very risky if not set to nobody, why must deployer have control over someone's token
Jun 27, 2021, 1:55 PM
In DApps, I bet there must be one contract every new user would have to approve using ERC20.
In ERC777, if this smart contract is set as the operator, that does save many approve function calls, no?
Jun 27, 2021, 1:56 PM
Not every one needs that
Also check permit which dai and uniswap uses for gasless approval
There is a reason the big dapps didn't opt to use that eip
Jun 27, 2021, 1:59 PM
I don't see a fallback implementation in ERC777.
I noticed this, and wonder who pays the gas fees then.
I understand the caller does not pay for gas fees, and when the signed messages are executed, the receivers pay the gas fees?
Jun 27, 2021, 2:00 PM
I also looked into it when I was building my token, I later ignored it
Jun 27, 2021, 2:00 PM
dai and uniswap pay the fees?
Jun 27, 2021, 2:01 PM
Nono
User
See let's say you want to call a method called deposit
you will add the signed data to the deposit function, then you will permit from deposit function
So indirectly when user calls deposit, he pays for the gas but it's a one call instead of
Approve and deposit
Jun 27, 2021, 2:02 PM
I think what you are saying is permit here: https://github.com/OpenZeppelin/openzeppelin-contracts/blob/master/contracts/token/ERC20/extensions/draft-ERC20Permit.sol
Jun 27, 2021, 2:04 PM
Yes
Jun 27, 2021, 2:04 PM
There is one, you may have missed it. There is also a registry, which keeps record of all the tokens deployed as erc777
Jun 27, 2021, 2:04 PM
I know but consider the extra gas involved
I read somewhere that it has a gas issue
Jun 27, 2021, 2:05 PM
I think this is the fallback function in your mind, but it is called a different name: _callTokensReceived
Jun 27, 2021, 2:06 PM
You may check the function definition🙂
tokensReceived()
Its not a unique feature of 777, was proposed in 223 or something. But looks neat
Jun 27, 2021, 2:08 PM
That would be something all erc20 must have
The callback
Jun 27, 2021, 2:09 PM
It is a similar implementation to IERC165 and ERC721.
Jun 27, 2021, 2:09 PM
All those lost tokens in contracts...
Jun 27, 2021, 2:09 PM
Works for my dapp though
Jun 27, 2021, 2:10 PM
approve and transfer does take two steps, however, once an address is approved with a very high allowance, all future transactions take a much simpler one step, transfer. permit is a big one step across the life time of the token.
There is a trade-off to consider.
Jun 27, 2021, 2:12 PM
https://github.com/ethers-io/ethers.js/issues/814
Try upgrading ethers to 5.xx
Jun 27, 2021, 2:13 PM
Does anyone know or have practical experience with MiniMeToken contract? I think it was an interesting idea.
Jun 27, 2021, 2:21 PM
PCS is a fork of uniswap v2, so if its the swap you need go to uniswap
besides what are you facing with pcs code
these are basic stuff
Jun 27, 2021, 3:43 PM