Hey guys happy sunday. Any way to say that all tokens sent to an adress should be swapped in bnb (in solidity)

Jun 27, 2021, 7:47 AM
A contract is not always notified when it receives tokens - I think in most cases, it isn't, it depends on the token. You would probably want an external script monitoring events of each token of interest. The script could then notify the contract when to convert some token. You should keep in mind that it may not actually be efficient to convert every time, e.g., if the value of the token is less than the cost of gas to convert it.
Jun 27, 2021, 8:03 AM
Yes very good point mate
I understand that projects manage their sales using external scripts. I never saw calls to Pancakeswap API within Tthe SC.
Jun 27, 2021, 8:10 AM
Yes, or simply have a dev authorized to take actions on behalf of the community. Really gotta trust the dev in projects like that. These are not trustless systems.
Jun 27, 2021, 8:14 AM
thanks buddy, a dev ? in my language dev = script
Jun 27, 2021, 8:17 AM
Well, I was referring to an actual person. The developer and manager of the project.
Jun 27, 2021, 8:19 AM
OHHH YES , sorry you were clear, my bad. I am tired today 😃😃😃
Other interesting question : For distinguish between sell and buys in SC, we should check the source ? If it comes from Pancakeswap it is a buy. Is it correct?
Jun 27, 2021, 9:24 AM
if its to pancakeswap its a sell
if its from pancakeswap its a buy
ye
Jun 27, 2021, 9:25 AM
Should we test Pancakeswap router or token contract ?
Jun 27, 2021, 9:25 AM
the message got deleted
Jun 27, 2021, 9:31 AM
Every group is going to get rando spammers, it's unavoidable. But I think most people that come here are legit and seeking at least blockchain related help and many are willing to pay for help.
Jun 27, 2021, 9:31 AM
Ye :>
Jun 27, 2021, 9:32 AM
thanks buddy : Should we test Pancakeswap router or token contract ?
Jun 27, 2021, 9:32 AM
maybe try on testnet
with your token
Jun 27, 2021, 9:32 AM
You haven't seen jobs group have you :)
Jun 27, 2021, 9:32 AM
and the already deployed pancake swap router
lol, that's $500 for an erc20
Jun 27, 2021, 9:33 AM
thanks buddy
Jun 27, 2021, 9:33 AM
> copy and pastes the same code
Jun 27, 2021, 9:33 AM
Well, I think swaps (pairs) don't really have a concept of buy/sell, it's a swap from token0 to token1, whether you consider it a buy or a sell depends on which token you refer to. You can check if amountOut token is your token and consider that someone bought that token. And you could check if amountIn token is your token and consider that someone sold your token.
Yes. I keep an eye on that group too.
Jun 27, 2021, 9:36 AM
yesssss good idea
thanks
Jun 27, 2021, 9:38 AM

© 2024 Draquery.com All rights reserved.