Function: requestBurn(uint256 amount)
The function can be called by a user who wants to burn tokens or reduce the amount of tokens to be burned from a previous request. The difference of amount is sent either to the contract or to the user.
Inputs
amount
Control: The amount is checked to be nonzero.
Impact: Prevents a user from completely canceling a previous burn request or sending a nonexisting request with zero amount.
Branches and code coverage (including function calls)
Intended branches
Tokens are correctly transferred to the contract when a request is created.
Tokens are successfully transferred to the contract when the requested amount is increased.
Tokens are successfully transferred to the user when the requested amount is decreased.
Negative behavior
The function reverts when the amount exceeds user balance.
The function reverts when the amount is zero.
Function call analysis
requestBurn -> _transfer(address(this), _msgSender(), currentBurnAmount - amount)
External/Internal? Internal.
Argument control?
amount
.Impact: Transfers tokens' difference to the contract.
_transfer(_msgSender(), address(this), amount - currentBurnAmount)
External/Internal? Internal.
Argument control?
amount
.Impact: Transfers tokens' difference to the user.