Can someone explain to me briefly how liquidity tax works? For example when a coin has these 2 fields set, what does it do, how does it work, where does the liquidity go, does it get added to pancake swap, if so, how?
uint256 public _liquidityFee = 5;uint256 private numTokensSellToAddToLiquidity = 1 * 10**11;

Apr 26, 2021, 8:08 PM
I'm looking at the "OnlyOneToken" contract code on bscscan for reference
0x6cfeb2d07623fd884f525e7c33b6fc97147c4f41
anyone? pls :(
Apr 26, 2021, 9:03 PM
I'm guessing its one of those safemoon forks. That 5 denotes 5% fee and on each transfer function call, 5% is deducted and added to pancake pool
Apr 26, 2021, 9:06 PM
Okay that was my understanding. I’m looking to fork this token but trying to understand how exactly it adds it to pancake pool because when you create a token a pancake pool doesn’t even exist until you create it right?
Apr 26, 2021, 9:07 PM
Createpair is called on the constructor
Apr 26, 2021, 9:08 PM
it uses Reflective finance source
You can find in the source the hard coded pancakeswap router address
Safemoon devs save this address as uniswaprouterV2
Btw pay attention to the router address because Pancakeswap migrate to V2 few days ago
Apr 26, 2021, 9:19 PM
Ohhh I didn’t see this. How do I get the pancakeswap v2 address to set in the code?
How do I get the pancake address for my own coin?
Apr 26, 2021, 9:23 PM
no you need pancakeswap router v2 address
Apr 26, 2021, 9:24 PM
I think that's also in the constructor itself. Just replace the router address with V2
Apr 26, 2021, 9:24 PM
Is there a way for me to name the pool it creates? Doesn’t it by default go to a contract looking address?
Whereas other coins the liquidity address has pancake in its name?
And to be clear, when I create this token I don’t even have to add it to pancake swap or create the pair? Is there also a spot in the code to set the initial supply in liquidity?
Apr 26, 2021, 9:27 PM
You don't have to. Don't know about the initial liquidity though
Apr 26, 2021, 9:29 PM
Thank you guys, I’m a dev but brand new to solidity and tokens
This isn’t a dev question but when you release a coin do you keep your team wallet amount and then send the entire rest of the supply to pancake liquidity?
Apr 26, 2021, 9:30 PM
Depends on the tokenomics I guess. Some tokens have initial burns and things like that
Apr 26, 2021, 9:32 PM
I plan to do no initial burn, just 2% redistribution and 2% to liquidity and a 4% team wallet
So would I create the token, keep 4% in my wallet, then send 96% to pancake liquidity? Should I then lock the liquidity? Or does that have possible detrimental effects?
Except With the code I sent it will automatically send the liquidity to pancakeswap
Apr 26, 2021, 9:34 PM
yes in the constructor
when you send to pancakeswap for liquidity you must send also bnb
Apr 26, 2021, 9:39 PM
Do you know how that works since it is sending to liquidity in the constructor? How do I pay the BNB?
Apr 26, 2021, 9:40 PM
in the constructor you set the token supply
Apr 26, 2021, 9:41 PM
Token supply meaning the total number of tokens released or something else?
Apr 26, 2021, 9:42 PM
then when you have created your token go to pancakeswap, on liquidity section and add liquidity
there you put your token address and it will shows you the amount of bnb that you must add too
total number of tokens
Apr 26, 2021, 9:42 PM
But remember in the fork of the code I supplied above doesn’t it automatically create the liquidity pool and pair in the constructor? Since the coin has a liquidity tax
Apr 26, 2021, 9:47 PM
if you don't give bnb you can't create LP
for Bnb- pair obv
Apr 26, 2021, 9:48 PM
Right but the part I’m confused about is since the LP is made and pair created in the token’s constructor then when I create the token isn’t it going to automatically create LP and the pair? How would I provide BNB if those attempt to execute automatically upon token creation
Apr 26, 2021, 10:04 PM
I don' t remember the source exactly buy I think that for each transaction it takes fee and send it to pancakeswap
Apr 26, 2021, 10:08 PM

© 2024 Draquery.com All rights reserved.