Function: burn(address from, address receiverOfUnderlying, uint256 amount, uint256 index)
This function burns tokens from a specified address and may transfer an equivalent amount of another asset to a different address.
Inputs
from
Constraints: N/A.
Impact: This is the address of the account from which the tokens will be burned.
receiverOfUnderlying
Constraints: N/A.
Impact: This is the address that might receive an equivalent amount of another underlying asset, if it is not the contract itself.
amount
Constraints: N/A.
Impact: The amount getting burned.
index
Constraints: N/A.
Impact: The variable debt index of the reserve.
Branches and code coverage (including function calls)
Intended branches
Burns tokens and transfers the same amount of tokens to another address successfully.
Negative behavior
Revert due to invalid burn amount.
Function call analysis
burn -> _burnScaled(from, receiverOfUnderlying, amount, index)
External/Internal? Internal.
Argument control?
from
,receiverOfUnderlying
,amount
, andindex
.Impact: Burn a scaled balance token.
burn -> IERC20(_underlyingAsset).safeTransfer(receiverOfUnderlying, amount)
External/Internal? External.
Argument control?
receiverOfUnderlying
andamount
.Impact: Transfer tokens to an address.