Hi Titans, what does this code on pancakeswap factory mean


// if fee is on, mint liquidity equivalent to 1/6th of the growth in sqrt(k)
function _mintFee(uint112 _reserve0, uint112 _reserve1) private returns (bool feeOn) {
address feeTo = IPancakeFactory(factory).feeTo();
feeOn = feeTo != address(0);
uint _kLast = kLast; // gas savings
if (feeOn) {
if (_kLast != 0) {
uint rootK = Math.sqrt(uint(_reserve0).mul(_reserve1));
uint rootKLast = Math.sqrt(_kLast);
if (rootK > rootKLast) {
uint numerator = totalSupply.mul(rootK.sub(rootKLast));
uint denominator = rootK.mul(3).add(rootKLast);
uint liquidity = numerator / denominator;
if (liquidity > 0) _mint(feeTo, liquidity);
}
}
} else if (_kLast != 0) {
kLast = 0;
}
}

I am looking for where to change the trading fee and the percentage allocated to liquidity providers.

May 8, 2021, 12:41 PM
This is on pair contract
And this is not where you should make changes
May 8, 2021, 12:55 PM
Oh really..pls can you share the address?
May 8, 2021, 12:56 PM
Check pancakepair contract on github
May 8, 2021, 12:57 PM
Alright. Thanks
May 8, 2021, 12:58 PM
And on the swap function, you'll see something like 2/1000
That is the fee being calculated
May 8, 2021, 12:59 PM
Alright..I will look at that now
May 8, 2021, 12:59 PM
Not only that, you have to change library contract too
You can see some multiplications with 997.
May 8, 2021, 1:00 PM
Wow
May 8, 2021, 1:00 PM
998 for pancake
May 8, 2021, 1:00 PM
This is on the library contract in periphery folder?
May 8, 2021, 1:02 PM
Yes
May 8, 2021, 1:03 PM
What does this mean? I can see that in the library contract
I mean the 998
May 8, 2021, 1:03 PM
1000-2
2/1000 = 0.2%
May 8, 2021, 1:03 PM
I want to take 0.25% trade fee then the platform treasury takes 50% and 50% to go to the liquidity provider
Cool
What does this mean in the library contract?
May 8, 2021, 1:31 PM
I don't remember correctly, but I think its for the amount - fees
amount * 998/1000
= amount - amount * 2/1000
May 8, 2021, 1:44 PM
I get the fee part now, I am looking for where they slit the fee into two to share with the treasury and liquidity provider
May 8, 2021, 1:44 PM
That's not on the contract
Its in the website
May 8, 2021, 1:45 PM
Oh ok.
Oh nice..thanks buddy
Pls where in the website would this be?
May 8, 2021, 2:05 PM
That, I am not sure of. There are lots of typescript files in frontend and it will be in one of them😅
May 8, 2021, 3:45 PM
do you know why bscscan doesn't let import Openzeppelin
May 8, 2021, 3:48 PM
Because bscscan is a website and openzepplin is an npm library
I don't think it even imports direct web urls
Can't blame them, it isn't safe to do so
May 8, 2021, 3:51 PM
Alright..thanks man
May 8, 2021, 3:53 PM
I think thats why solidity developers creating complex contracts use truffle instead remix
May 8, 2021, 3:53 PM
That's what I do now
Running a local remix copy along with remixd
Or atleast the one I use
Think I already have it
Anyway local remix is pain free, so I'll keep using that🙂
May 8, 2021, 3:59 PM
or etherescan if you are on ether
what is remixd?
yes
ypu must be the owner obviosly
guys how can I change autoSwapandLiquify to send to a private wallet instead of pancake?
just change router address?
I don't knoe if this will influence the swapping feature
May 8, 2021, 6:02 PM
Its used to create a websocket between remix and local file system
Simply put, it allows you to access files on your pc directly and modify it
May 8, 2021, 6:05 PM
oh i need to check it thanks
guys I have this error
May 8, 2021, 8:23 PM
Add this statement in the beginiing of your SC
May 8, 2021, 8:27 PM
already done
I can't fix this
May 8, 2021, 8:30 PM
I'd suggest you to use the ^0.8.0 version
May 8, 2021, 8:49 PM
already tried
May 8, 2021, 8:56 PM
@freezyEXchange @1715540247 @mrrobot3_3 I got the contract verification at BSC Scan testnet. I flattened the contract at remix concatenating all the contracts in a unique, which exclude the import need. Thanks for helping.
May 8, 2021, 8:57 PM
no problem
now I need help😂😂
May 8, 2021, 8:57 PM
Send a print of the compiler and the beginning of your SC
May 8, 2021, 9:01 PM
do you know where can i find pancake for testnet=
May 8, 2021, 9:06 PM
I don't know if it exists, but i'm very interested to know
I'm gonna serch
May 8, 2021, 9:07 PM
someone has pancake testnet router?
May 8, 2021, 9:10 PM
I'm launching my first soon, but i'm not experienced
Actually it's a token, not a coin
May 8, 2021, 9:20 PM
no you can't test on vm i think
because on vm there is no ROuter
May 8, 2021, 10:44 PM
Yup
What are the charges
May 9, 2021, 7:26 AM
pm
May 9, 2021, 7:27 AM
Haha that was interesting
You guys have a bot problem? I have a bot solution
May 9, 2021, 7:49 AM
@mrrobot3_3 to use Remixd should I have to open 65520 port?
May 9, 2021, 7:50 AM
Made a token literally named antibot, put 5 bnb on liquidity. Within 2 mins a purchase of 1 bnb total happened. Pulled liquidity
Easiest BNB I ever made🙂
May 9, 2021, 7:51 AM
because I started the session but it gives this error
May 9, 2021, 7:51 AM
Yeah you have to enable remix plugin I think
May 9, 2021, 7:52 AM
lol
it says
Cannot connect to the remixd daemon.
Please make sure you have the remixd running in the background.
May 9, 2021, 7:52 AM
I am running local remix on 8080, so that's where I point remixd
May 9, 2021, 7:52 AM
so what should I do?
I followed the docs
this is the command right?
remixd -s absolute-path-to-the-shared-folder --remix-ide your-remix-ide-URL-instance
May 9, 2021, 7:55 AM
Yup that's the one
There's a remixd plugin in remix. Try enabling that
May 9, 2021, 7:56 AM
fuck I am stupid
it was on http not https
So basically, now that I can use Remix on local what can I do? Yesterday we were talking about import right?
May 9, 2021, 7:58 AM
Now you can interact with all your files on file system directly on remix
Just like you open vscode in a folder
May 9, 2021, 8:00 AM
ok and how can this fix the problem of importing files?
that bsc doesn't verify the code
May 9, 2021, 8:01 AM
That... won't be fixed😅
This will just allow you work on code without flattening
May 9, 2021, 8:02 AM
oh😳
Tell me if I am wrong
On remix ide if I import packages it works fine no?
May 9, 2021, 8:04 AM
Local imports will work. Openzepplin imports won't
Actually, I was mistaken. Openzepplin imports do work
It wasn't working before. Maybe they made some updates
May 9, 2021, 8:07 AM
yes infact if you use @openzeppelin it improts the packages to
if you use github no I think
May 9, 2021, 8:10 AM
From the docs
"Remix will go and check npm for a library"
It wasn't there before🙃
May 9, 2021, 8:14 AM
nice
no I mean
May 9, 2021, 8:40 AM
Hi all, what does this code mean?

// if fee is on, mint liquidity equivalent to 8/25 of the growth in sqrt(k)
function _mintFee(uint112 _reserve0, uint112 _reserve1) private returns (bool feeOn) {
address feeTo = IPancakeFactory(factory).feeTo();
feeOn = feeTo != address(0);
uint _kLast = kLast; // gas savings
if (feeOn) {
if (_kLast != 0) {
uint rootK = Math.sqrt(uint(_reserve0).mul(_reserve1));
uint rootKLast = Math.sqrt(_kLast);
if (rootK > rootKLast) {
uint numerator = totalSupply.mul(rootK.sub(rootKLast)).mul(8);
uint denominator = rootK.mul(17).add(rootKLast.mul(8));
uint liquidity = numerator / denominator;
if (liquidity > 0) _mint(feeTo, liquidity);
}
}
} else if (_kLast != 0) {
kLast = 0;
}
}
I am try to figure out how to give liquidity providers 50% of the 0.20% trading fee on pancakeswap codes
May 9, 2021, 9:05 AM
Yeah that'll be the best solution
May 9, 2021, 9:31 AM
thankS I will try
here what do you see?
May 9, 2021, 5:09 PM

© 2024 Draquery.com All rights reserved.