tokens with transfer taxes, they usually sell themselves (swap for eth) and add that eth (plus the other half of tokens) to liquidity

since the token works with uniswap, it needs to know the functions available

but any erc20 can swap, no need for the uniswap imports

Oct 14, 2021, 5:54 AM
ohh, got it thanks
Today going to explore tokens only😅
function _beforeTokenTransfer(
address from,
address to,
uint256 amount
) internal virtual {}
Why these kind of functions in standard ERC20?
I want to keep it as clean as possible
Oct 14, 2021, 6:23 AM
The underscore functions in the ERC20 Zeppelin code are private functions that are kept internal. Meaning only another contract within that file can access it. They kept “before transfer” and “after transfer” functions so that no one can externally manipulate the data they hold
Well get acquainted with AMMs
Read up on Uniswap v2 and staking protocols on DeFi
Does it have the “is” keyword followed by a function in a contract from open zeppelin?
Oct 14, 2021, 1:19 PM
How does it actually prevent external functions to manipulate the data?
Oct 14, 2021, 2:18 PM
My understanding is that an external account can input whatever parameters they want when they call a contract. its in a dev’s best interest to avoid negative user interactions. Those internal functions allow for independent track of tokens while still allowing the user to get all the normal functions from an ERC20 contract
Oct 14, 2021, 2:39 PM

© 2024 Draquery.com All rights reserved.