3 ms·
>The premise of the Salmonella contract is very simple. It’s a regular ERC20 token, which behaves exactly like any other ERC20 token in normal use-cases. Howeve
by tyrust 6y ago
>The premise of the Salmonella contract is very simple. It’s a regular ERC20 token, which behaves exactly like any other ERC20 token in normal use-cases. However, it has some special logic to detect when anyone other than the specified owner is transacting it, and in these situations it only returns 10% of the specified amount - despite emitting event logs which match a trade of the full amount.
Does the ERC20 spec allow such a transfer function to let token creators implement transfer fees?
And I guess uniswap doesn't care (or maybe even know) how high these fees are?
- spuz 6y agoGood question. The ERC20 spec defines only what methods a contract should implement. It does not specify how those methods should be implemented. To have a transfer function that doesn't actually transfer any balance is perfectly valid (and as a user you should be sure that the contract you are calling actually does what you expect). The spec does require that a Transfer event is created however. https://eips.ethereum.org/EIPS/eip-20#methods https://eips.ethereum.org/EIPS/eip-20#methods
- deleted 6y ago[deleted]
- andypants 6y agoThere are real tokens meant to be used by real people that have some kind of 'tax' per transfer which is implemented similarly. Uniswap doesn't care, it just needs to update its reserves before every swap.