MorpheusAI

MorpheusAI
Foundry
22,500 USDC
View results
Submission Details
Severity: low
Valid

Do not hardcode `adapterParamers` to `bytes("")`

Summary

Do not hardcode adapterParamers to bytes("")

Vulnerability Details

When claiming the rewards, the function sendMintMessage perfom an external call using a hardcoded value of adapterParamers.

function sendMintMessage(address user_, uint256 amount_, address refundTo_) external payable onlyDistribution {
RewardTokenConfig storage config = rewardTokenConfig;
bytes memory receiverAndSenderAddresses_ = abi.encodePacked(config.receiver, address(this));
bytes memory payload_ = abi.encode(user_, amount_);
ILayerZeroEndpoint(config.gateway).send{value: msg.value}(
config.receiverChainId, // communicator LayerZero chainId
receiverAndSenderAddresses_, // send to this address to the communicator
payload_, // bytes payload
payable(refundTo_), // refund address
address(0x0), // future parameter
bytes("") // adapterParams (see "Advanced Features") <== @audit
);
}

According to the Layerzero Integration Documentation, this field should not be hardcoded.

Do not hardcode zero bytes (bytes(0)) as adapterParamers. Pass them as a parameter instead.

Impact

If for any reason the field adapterParamers become required, then the contract will not function correctly.

Tools Used

Manual audit

Recommendations

For more flexibility pass the adapterParamers as a parameter

Updates

Lead Judging Commences

inallhonesty Lead Judge over 1 year ago
Submission Judgement Published
Validated
Assigned finding tags:

LayerZero Integration: Do not hardcode zero bytes (bytes(0)) as adapterParamers.

Support

FAQs

Can't find an answer? Chat with us on Discord, Twitter or Linkedin.