Clever Fern Rooster
Medium
The burn of the tokens is only reserved to the core contracts:
function burn(uint256 value) public override onlyCoreContracts {
super.burn(value);
}
function burnFrom(
address account,
uint256 value
) public override onlyCoreContracts {
super.burnFrom(account, value);
}
Any user could bypass this by burning tokens with contractBurnFrom
that miss the onlyCoreContracts
modifier:
function contractBurnFrom(
address owner,
uint256 amount
) public returns (bool) {
uint256 currentAllowance = contractAllowances[owner][msg.sender];
if (currentAllowance != type(uint256).max) {
if (currentAllowance < amount) revert ERC20InsufficientAllowance(msg.sender, currentAllowance, amount);
_contractApprove(owner, msg.sender, currentAllowance - amount);
_burn(owner, amount);
return true;
} else {
return false;
}
}
Missing access control on the contractBurnFrom
function.
No response
No response
- Address A gives
x
allowance to address B. - Address B call
contractBurnFrom
to burnx
tokens of address A.
Breaks core contract functionality.
No response
Add the onlyCoreContracts
modifier to the contractBurnFrom
function.