Need help with burn mechanism in BEP20 contract

2021.09.28 18:54 William_cpu Need help with burn mechanism in BEP20 contract

I am trying to modify an existing contract that only reduces token circulation. It doesn't reduce supply.
I added the _tTotal = _tTotal.sub(burnAmt);line that reduces total supply, but someone was saying that I should also reduce the _rTotal, _tOwned and _rOwned.
The contract is deployed here: https://testnet.bscscan.com/address/0xEFD27A640223394cE0159568B94e5c82099B667A#code
Can anybody help me figure out how to get this done? I don't really understand what _rTotal, _tOwned and _rOwned do.
This is how _rTotal is set in the contract. I modify it after the burn.
uint256 private _rTotal = (MAX - (MAX % _tTotal));
These two values ... I have no idea how to change. If anybody can help, this is where I'm stuck.
_rOwned[sender] = _rOwned[sender].sub(burnAmt);
_tOwned[sender] = _tOwned[sender].sub(burnAmt);


//burn START
_transferStandard(sender, address(0), burnAmt); //this was already in the contract
_tTotal = _tTotal.sub(burnAmt);//I changed the total supply based on the burn amount. This works, supply decreases after transactions.
_rTotal = (MAX - (MAX % _tTotal.sub(burnAmt)));
// _rOwned[sender] = _rOwned[sender].sub(burnAmt);
// _tOwned[sender] = _tOwned[sender].sub(burnAmt);
//burn END

```
function _tokenTransfer(address sender, address recipient, uint256 amount) private {
if(_isExcludedFromFee[sender] || _isExcludedFromFee[recipient]){
removeAllFee();
}
//Calculate burn amount and charity amount
uint256 burnAmt = amount.mul(_burnFee).div(100);
uint256 charityAmt = amount.mul(_charityFee).div(100);

if (_isExcluded[sender] && !_isExcluded[recipient]) {
_transferFromExcluded(sender, recipient, (amount.sub(burnAmt).sub(charityAmt)));
} else if (!_isExcluded[sender] && _isExcluded[recipient]) {
_transferToExcluded(sender, recipient, (amount.sub(burnAmt).sub(charityAmt)));
} else if (!_isExcluded[sender] && !_isExcluded[recipient]) {
_transferStandard(sender, recipient, (amount.sub(burnAmt).sub(charityAmt)));
} else if (_isExcluded[sender] && _isExcluded[recipient]) {
_transferBothExcluded(sender, recipient, (amount.sub(burnAmt).sub(charityAmt)));
} else {
_transferStandard(sender, recipient, (amount.sub(burnAmt).sub(charityAmt)));
}
//Temporarily remove fees to transfer to burn address and charity wallet
_taxFee = 0;
_liquidityFee = 0;

//burn START
_transferStandard(sender, address(0), burnAmt);
_tTotal = _tTotal.sub(burnAmt);
_rTotal = (MAX - (MAX % _tTotal.sub(burnAmt)));
// _rOwned[sender] = _rOwned[sender].sub(burnAmt);
// _tOwned[sender] = _tOwned[sender].sub(burnAmt);
//burn END

_transferStandard(sender, charityWallet, charityAmt);

//Restore tax and liquidity fees
_taxFee = _previousTaxFee;
_liquidityFee = _previousLiquidityFee;

if(_isExcludedFromFee[sender] || _isExcludedFromFee[recipient])
restoreAllFee();
}
```
submitted by William_cpu to BNBinance [link] [comments]


2021.09.28 18:54 prawnbiryani πŸ’—β˜πŸ¦πŸŒΈπŸ§πŸ€πŸ¦©

πŸ’—β˜πŸ¦πŸŒΈπŸ§πŸ€πŸ¦© submitted by prawnbiryani to 11hr11min [link] [comments]


2021.09.28 18:54 TheOneAndOnlyEmil (18+) Welcome to Bonfire! This is a server to make all kinds of friends in. Join quick, we are growing fast and will need more moderators. We are going to do giveaways (steam games and nitro) every two weeks. Movie nights are coming and we have verified channels!

(18+) Welcome to Bonfire! This is a server to make all kinds of friends in. Join quick, we are growing fast and will need more moderators. We are going to do giveaways (steam games and nitro) every two weeks. Movie nights are coming and we have verified channels! submitted by TheOneAndOnlyEmil to DiscordAdvertising [link] [comments]


2021.09.28 18:54 NoSoupForYou___ Likely - James Blake

New album? Check
Significant time since last Coachella appearance? Check
Tour before and immediately after Coachella? check
Schedule gap during Coachella dates? Check
No SoCal shows within the radius clause? Check
Just feels like a LOT of indicators pointing to him being there, along with a few people in this channel who have predicted him as well. Maybe an Outdoor stage late evening set?
submitted by NoSoupForYou___ to Coachella [link] [comments]


2021.09.28 18:54 Adr1enb Quests in solo/duo/squads vs quests in TR ?

So..
Before this update, you could start quests in solo/duo/squads when you talk to an NPC not present in Team Rumble, and finish those quests in Team Rumble, even if it's not displayed in your quests tab while you're playing.
Since this update, you cannot finish those quests in team rumble, it doesn't count anymore ?
submitted by Adr1enb to FortNiteBR [link] [comments]


2021.09.28 18:54 FizVic Anybody else excited for or at least interested in the Campaign?

I know CoD campaigns nowadays are a 7-8 hours thing, but they are still a blast the first few times - well, I enjoyed WWII...
Personally it's probably the only thing I care about, CoD multi is not my cup of cake and this year in particular it doesn't look too inviting, with that weird choice of having no factions...yet what we have seen of the campaign seemed promising, at least in terms of settings.
From the trailers, you can tell that at least seven levels will be set during the war, in a time period spanning from 1942 to 1944 apparently and showing all four fronts (I counted two Stalingrad levels, two North Africa levels, two Pacific levels and a Normandy level, at the very least). If there are some more fictional levels sets "immediately after", I'm ok with it. It is probably nostalgia, but I'm always in for a big blockbuster campaign set in WWII, like in the good old days especially if it shows different areas of the war (it was one of the things that set the earlier CoDs apart from most other WWII shooters).
submitted by FizVic to CODVanguard [link] [comments]


2021.09.28 18:54 gettheskrap Can someone please explain to me the differences and similarities between hemidesmosomes, desmosomes, macula adherins, zona occludens, and zona adherins?

Hey guys. I am not sure if this is the appropriate sub. But can someone please help with an explanation for this? Can you explain the structure of each and how they differ? I have gone down a Google rabbit hole and still do not understand. Thanks!
submitted by gettheskrap to Biochemistry [link] [comments]


2021.09.28 18:54 AutoNewspaperAdmin [National] - WATCH LIVE: Jen Psaki holds White House news briefing | PBS

[National] - WATCH LIVE: Jen Psaki holds White House news briefing | PBS submitted by AutoNewspaperAdmin to AutoNewspaper [link] [comments]


2021.09.28 18:54 illusionofchaos How malware gets into the App Store and why Apple can't stop that

How malware gets into the App Store and why Apple can't stop that submitted by illusionofchaos to gadgets [link] [comments]


2021.09.28 18:54 -0live-bluu How did you come out to your spouse?? (M 25)

Hello, i have recently discovered that i am trans. And i have absolutely zero idea on how to tell my wife. I havent came out to anyone i know yet and im planning to tell her on are vacation but its still a few weeks away so i am trying to come up with the right words but i am honestly terrified.
submitted by -0live-bluu to trans [link] [comments]


2021.09.28 18:54 AutoNewspaperAdmin [Education] - Here are this year's MacArthur fellows and 'genius grant' recipients | PBS

[Education] - Here are this year's MacArthur fellows and 'genius grant' recipients | PBS submitted by AutoNewspaperAdmin to AutoNewspaper [link] [comments]


2021.09.28 18:54 HexR1se Just let me play my round

Just let me play my round submitted by HexR1se to battlefield_one [link] [comments]


2021.09.28 18:54 ShortAlgo $AKAM Awaiting Short Signal 🐻. Stock Trading Ideas by UltraAlgo.

$AKAM Awaiting Short Signal 🐻. Stock Trading Ideas by UltraAlgo. submitted by ShortAlgo to UltraAlgo [link] [comments]


2021.09.28 18:54 Tripimir Franz Schubert - Impromptu No. 1, D 935

Franz Schubert - Impromptu No. 1, D 935 submitted by Tripimir to classicalmusic [link] [comments]


2021.09.28 18:54 Away-Competition-659 [M30] Foot Pain/Inflammation

Male, 30years old | 300lbs
Injury: Having foot pain for about a month now. This image https://i.imgur.com/QLJorq4.png shows what hurts. It's my right foot, my left foot has no pain. The lines on the anatomical picture hurt also, but not so much. I feel like this has healed over time somewhat. Sometimes the circle on the anatomical picture hurts but not so much. The most pain is the side of my foot.
Current/Past History: As for my past and current medical history its been nothing but trying to lose weight and using my cpap. My doctor says if I lost the rest of my weight I'll be OK and I don't have any other conditions or anything like that besides sleep apnea. My doctor says this is foot inflammation and he took x rays to confirm. He have me naproxen to take every 12 hours. He suggested that I stopped wearing flats and I have shoes now, with a good heel and arch support for big/heavy men.
Meds: I'm taking Wellbutrin right now, to lower my appetite. Naproxen for the foot.
I think my right foots (old) shoe was not made correctly and my right foot never properly placed down on the shoe when I walked. I thought the pain would go away, so I walked like that for about a week until it became too much one day and walking on it felt wrong.
How do I heal this? Do I just stay off my foot? I work at home a lot and I try to move around. I hate sitting inside. I used to be 365 lbs and I never had any foot pain this bad. I went from 365lbs to 250, by walking and getting out and its hard for me to lose weight and be inside so much. Especially with COVID, I'm inside a lot more. I dont know what to do besides just not use my foot? Sit inside all day? For how long? I feel like I can ride my bike ok because I never really feel any pain doing that, but that's about all I can do for exercise.
submitted by Away-Competition-659 to AskDocs [link] [comments]


2021.09.28 18:54 Traditional-Judge-32 How much dht does Nizoral shampoo block?

Hi! I was wondering if there is any study regarding how much Nizoral blocks of dht in scalp? Say you for exaple used NIzoral shampoo for 5 minutes twice a week.
We know the inhibition of finasterid and dutasterid, but I was wondering the combination of say Finasterid 1mg everyday and 2-3 times a week nizoral.
Finasterid would be 65% (inhibition) + ?% nizoral = ? (total inhibiton)
submitted by Traditional-Judge-32 to tressless [link] [comments]


2021.09.28 18:54 Walkersrcool2017 I want some advice.

Im 18 and living with my mother and i want to start hrt, is there anyway to start without her knowing?
submitted by Walkersrcool2017 to trans [link] [comments]


2021.09.28 18:54 ShortAlgo $NURO Awaiting Buy Signal πŸš€. Stock Trading Ideas by UltraAlgo.

$NURO Awaiting Buy Signal πŸš€. Stock Trading Ideas by UltraAlgo. submitted by ShortAlgo to UltraAlgo [link] [comments]


2021.09.28 18:54 Dry-Tax8487 Giving $100 to the eloteros. Hispanic heritage month video.

Giving $100 to the eloteros. Hispanic heritage month video. submitted by Dry-Tax8487 to Hispanic [link] [comments]


2021.09.28 18:54 AutoNewspaperAdmin [National] - WATCH LIVE: Obama presidential library groundbreaking ceremony in Chicago | PBS

[National] - WATCH LIVE: Obama presidential library groundbreaking ceremony in Chicago | PBS submitted by AutoNewspaperAdmin to AutoNewspaper [link] [comments]


2021.09.28 18:54 dltMOBI Community Corner: World Economic Forum

Community Corner: World Economic Forum submitted by dltMOBI to dltmobi [link] [comments]


2021.09.28 18:54 OliverMarkusMalloy What is love?

What is love? submitted by OliverMarkusMalloy to OliverMarkusMalloy [link] [comments]


2021.09.28 18:54 Limp-Appointment-721 Should I give up?

Me and my boyfriend have been dating for over a year now. But almost half of it has been long distance due to him moving for a job. Our plan was in may, when his lease ends, we would move in together and I could help him start college. But now he says that he wants to stay because he makes more money over there. What should I do? I want to be with him but I don’t want to leave, especially cause if o move over there, I’m gonna get paid less than where I am now.
submitted by Limp-Appointment-721 to relationship_advice [link] [comments]


2021.09.28 18:54 George_S285 Has anyone ever accidentally received crypto?

I’m wondering whether anyone has ever received any cryptocurrency by accident because someone typed in the wrong address. Is it that common? Did you send it back? Or has anyone ever sent money to the wrong address themselves. Do you get any of it back? Would you send any crypto back if you got sent some by accident, would you send all of it back or something like 50%? I’m wondering this after that Ethereum miner sent back most of the millions of dollars he was sent by accident, and only kept around 50 ETH for themselves.
submitted by George_S285 to CryptoCurrency [link] [comments]


2021.09.28 18:54 AceVillin Should I just quit

Hello. So after a long fruitless job search, i found a new job and i was excited as the environment looked really nice and the HR guy was very welcoming. They placed me in the place of a guy who'd just left with no one to train me, and this is absolutely my first job ever asides from a two month internship. No one is willing to train me, my boss yells at me for literally everything, and won't understand me and is assigning me to important deadlines about stuff I don't even understand yet. The job includes a 3 month period before a contract becomes official so both an employee and a manager can test it out and see if they want the other one. My boss is just treating me like crap and my mental health is taking a bad turn and i feel so lost. Should i just quit and be done with it?
submitted by AceVillin to Vent [link] [comments]


http://iqlv.ru