Function: _credit(address _to, uint256 _amountLD, uint32 /* _srcEid */)
This is an internal function that handles the token credit logic during cross-chain token receipt.
Inputs
_toControl: Decoded from cross-chain--message data.
Constraints: N/A.
Impact: The address of the token receiver for tokens transferred across chain.
_amountLDControl: Decoded from cross-chain--message data.
Constraints: N/A.
Impact: The amount of tokens to be minted to the receiver address.
Branches and code coverage
Intended branches
The expected amount of tokens are minted.
The
innerTokenbalance of the contract is not changed.The
_tobalance is increased by the_amountLD.
Function call analysis
IMintSelfBurnToken(address(innerToken)).mint(_to, _amountLD);What is controllable? N/A.
If the return value is controllable, how is it used and how can it go wrong? There is no return value here.
What happens if it reverts, reenters or does other unusual control flow? Mints the specified amount of tokens to the
_toaccount balance. The function reverts if_tois the zero address; however, in this implementation,_tois replaced with the0xdeadaddress in such cases, ensuring the zero address is never passed to the mint function.