Part 2

Zaros
PerpetualsDEXFoundrySolidity
70,000 USDC
View results
Submission Details
Severity: low
Invalid

Missing `address(0)` check

## Summary
Missing `address(0)` check for `marketMakingEngineConfiguration.referralModule` in `VaultRouterBranch::deposit`.
## Vulnerability Details
Refferal code for first time depositor is registerred if `bytes memory referralCode` is not empty. During this registration,
an external call is made to `IReferral::registerReferral` to register the code. However, there is no check if
`marketMakingEngineConfiguration.referralModule` has been set by the owner.
## Impact
Unexpected behaviour
## Recommendations
Enforce a check for the address of `marketMakingEngineConfiguration.referralModule` before the registration.
```diff
+ error InvalidReferralModuleAddress();
ctx.referralModule = IReferral(marketMakingEngineConfiguration.referralModule);
+ if(ctx.referralModule == address(0)) {
+ revert InvalidReferralModuleAddress();
+ }
```
Updates

Lead Judging Commences

inallhonesty Lead Judge 10 months ago
Submission Judgement Published
Invalidated
Reason: Non-acceptable severity

Support

FAQs

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

Give us feedback!