Hey guys, greetings. I am working on an erc20 contract, problem is, when I try to take a sell fee, the swap to sell transaction fails on pancake swap.

My sample code looks like this

[
inside of transferFrom ,
_isSuper checks if an address equals router or pair
]


if(_isSuper(from) && msg.sender != owner()) {

// Take buy fee, and it works

} else if (_isSuper(to)) {

/* problem occurs here the moment I add this line of code */

amount -= sellfee*amount/100;

/* but if comment it out sell swap works */

}


please how do I bypass this, what could be going on

Sep 3, 2023, 9:04 AM

© 2024 Draquery.com All rights reserved.