Hi .how to change these functions

function setTaxFeePercent(uint256 taxFee) external onlyOwner() {
_taxFee = taxFee;
}
function setDevelopmentFeePercent(uint256 developmentFee) external onlyOwner() {
_developmentFee = developmentFee;
}
function setLiquidityFeePercent(uint256 liquidityFee) external onlyOwner() {
_liquidityFee = liquidityFee;
}
function setMaxTxPercent(uint256 maxTxPercent) external onlyOwner() {
_maxTxAmount = _tTotal.mul(maxTxPercent).div(
10**3

THE AUDIT SHOWS HIGH RISK
Owner can set buy/sell fees without limit up to 100%.
This might lead to inability to sell.
When fees are above 0, there will be certain amount of tokens that will
be deducted from every transaction that users make.
Deducted amount will be as much as the fees % from total amount
that user had bought, sold and/or transferred.
Owner can set max transaction limit without limitation.
If set to 0 or very low number, it will become impossible to sell.
When such restrictions are in place, the users can transfer token
amounts up to said restriction value.

include a maximum in the function so the owner cant se it too high, that should satify the audit.


function setTaxFeePercent(uint256 taxFee) external onlyOwner() {
 require(taxFee < 10,'tax too high');
_taxFee = taxFee;
}

(fixed typo, should be taxFee, not _taxFee)

1 Like

What about these functions

_taxFee = taxFee;
}
function setDevelopmentFeePercent(uint256 developmentFee) external onlyOwner() {
_developmentFee = developmentFee;
}
function setLiquidityFeePercent(uint256 liquidityFee) external onlyOwner() {
_liquidityFee = liquidityFee;
}

You would do the same except you change the variable and "error message. so you add a require statement in each function..

function setTaxFeePercent(uint256 taxFee) external onlyOwner() {
 require(taxFee < 10,'tax too high');
 _taxFee = taxFee;
}

function setDevelopmentFeePercent(uint256 developmentFee) external onlyOwner() {
 require(developmentFee < 10,'development fee too high');
 _developmentFee = developmentFee;
}

function setLiquidityFeePercent(uint256 liquidityFee) external onlyOwner() {
 require(liquidityFee < 10,'liquidity fee too high');
 _liquidityFee = liquidityFee;
}

etc

1 Like

OK. That's great. I will redeploy new contract. Thank you.

how to change this function?

function setMaxTxPercent(uint256 maxTxPercent) external onlyOwner() {
_maxTxAmount = _tTotal.mul(maxTxPercent).div(
10**3

how to change this function?

function setMaxTxPercent(uint256 maxTxPercent) external onlyOwner() {
_maxTxAmount = _tTotal.mul(maxTxPercent).div(
10**3

Is this alright?

function setMaxTxPercent(uint256 maxTxPercent) external onlyOwner() {
require(maxTxPercent > 0.1, "Cannot set transaction amount less than 0.1 percent!");
_maxTxAmount = _tTotal.mul(maxTxPercent).div(
10**2

Recommendation from Audit company

○ Considered as good practice is that transaction amount restrictions
not to be below 0.1% of total supply per transaction.

TypeError: Operator > not compatible with types uint256 and rational_const 1 / 10
--> Test1.sol:536:18:
|
536 | require (maxTxPercent > 0.1, "Cannot set transaction amount less than 0.1 percent

im not sure how to change this function?

Solidity works with integers not decimals. uint256 is an integer so you have to check whole numbers and not fractions like 0.1

function setMaxTxAmount(uint256 maxTxPPT) external onlyOwner() {
require(maxTxPPT > 0, "Cannot set transaction amount less than 1 PPT!");
_maxTxAmount = _tTotal.mul(maxTxPPT).div(10**3);

This works for me.
I deployed token on BSC testnet. Testing right now.
Thank you for help.