T_B1
May 21, 2021, 11:02am
1
-but limit it to onlyOwner and only the contract address!
Environment
truffle
Details
Code to reproduce
function burnFrom(address account, uint256 amount) onlyOwner {
uint256 decreasedAllowance = _allowances[account][_msgSender()].sub(amount, "BEP20: burn amount exceeds allowance");
_approve(account, _msgSender(), decreasedAllowance);
_burn(account, amount);
}
Skyge
May 21, 2021, 12:00pm
2
Hi, welcome!
Why would you want to add the modifier onlyOwner
for this function? And what is your purpose?
T_B1
May 21, 2021, 9:22pm
5
so my Audi is not finished yet I have another possibility to burn my lp fee with the function!
function _burnFrom (uint256 value) external onlyOwner {
_burn (address (this), amount);
}
but I get an error when compiling
truffle
Skyge
May 22, 2021, 10:03am
6
Ohhh, I see, maybe you should rename the this function name, such as burnFee()
or something else, _burnFrom()
is really a confusing function name for your actual purpose.
Could you please share the whole source code?
T_B1
May 22, 2021, 4:14pm
9
https://file.io/v8CQbfVYMRNm
i new user / i can only 2 links hm
thx for the help
Skyge
May 23, 2021, 12:53am
10
T_B1:
i new user
Never mind, we all grew from baby.
And for your shared code, it can not be compiled, there are some errors, if you write this contract, try to fix the errors, if not, so what is the original source code?
you can raise up your rank in league of legends using proboosting.net