Function: bridgeEtherToChia(byte[32] _receiver, uint256 _maxMessageToll)
This function is used to bridge native Ether to Chia by first wrapping it into milliETH (or WETH). This function wraps Ether into an ERC-20, sends the portal tip, and sends a message to mint tokens on Chia.
Inputs
_receiverControl: Arbitrary.
Constraints: None.
Impact: Receiver puzzle hash for the tokens.
_maxMessageTollControl: Arbitrary.
Constraints: None.
Impact: Value of the maximum message toll.
Branches and code coverage
Intended branches
Call the deposit function of IWETH to wrap the Ether.
Call the decimals function of IWETH and update the factor.
Invoke the
_handleBridgingfunction.
Negative behavior
Check if the message toll is less than the maximum message toll.
Check if the amount after toll is greater than
wethToEthRatioand divisible bywethToEthRatio.