Function _burnToken(address from,uint256 tokenId_,uint256 amount_) internal
INTERNAL FUNCTION
Intended behavior.
The internal function, which allows burning
amount_
of BondtokenId_
tokens fromfrom
address and decreasessupply
value for thistokenId_
.
Negative behavior.
users should not have unrestricted access to this function. The caller function should control from parameter, not allowing users to burn other user's tokens.
shouldn’t allow burning tokens if the user does not have enough tokens, partial burn should be impossible. should reject in this case
Preconditions.
user
from
should have ≥amount
oftokenId_
tokens.the caller function should not allow to user pass any
from
address.
Postconditions.
the supply pf the
bondToken
should decrease byamount
the balance of the user in terms of
bondTokens
should decrease byamount
.
Inputs.
Examine all function calls the function makes.
a. Call to
burn(from, tokenId_, amount_)
What is controllable? (callee, params, return value): the calling function should not allow the user to control the
from
valueIf return value controllable, how is it used and how can it go wrong? there is no return value
What happens if it reverts or tries to reenter? N/A