MorpheusAI

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

Hardcording of Layerzero parameters

Vulnerability Details

According to the Layerzero integration checklist, zroPaymentAddress and adapterParamers
should not be hardcoded in a Layerzero send operation, rather they should be passed as parameters to the function.

https://layerzero.gitbook.io/docs/troubleshooting/layerzero-integration-checklist

Impact

Not following Layerzero integration best practices

Tools Used

Manual Analysis

Recommendations

Pass the zroPaymentAddress and adapterParamers as parameters rather than hardcoding them

- function sendMintMessage(address user_, uint256 amount_, address refundTo_) external payable onlyDistribution {
+ function sendMintMessage(address user_, uint256 amount_, address refundTo_, address _zroPaymentAddress, bytes memory _adapterParamers) 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
+ _zroPaymentAddress,
- bytes("") // adapterParams (see "Advanced Features")
+ _adapterParamers
);
}
Updates

Lead Judging Commences

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

LayerZero Integration: Do not hardcode address zero (address(0)) as zroPaymentAddress

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.