Function: executeMessage(bytes memory message)
The function processes incoming cross-chain messages, updating the total supply and user positions accordingly.
Inputs
message
Control: Arbitrary.
Constraints: Must be a properly formatted message containing encoded
msgTime
,supply
, and optionaluserData
.Impact: The parameter contains the data needed for updating the total supply and user positions.
Branches and code coverage
Intended branches
Decode
message
to accessmsgTime
,supply
, anduserData
.Call
_setNewTotalSupply
to update the total supply atmsgTime
.Call
_setNewUserPosition
to update the user's position ifuserData
is not empty.
Negative behavior
Revert if
msgTime
is older thanlastTotalSupplyReceivedAt
.