Part 2

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

Incorrect logic

## Summary
Incorrect logic in `VaultRouterBranch::deposit`.
## Vulnerability Details
If an EOA calls `VaultRouterBranch::deposit` directly to deposit a given amount of collateral assets into the provided vault
in exchange for index tokens, during this deposition a referral code is registered if the referral code is not custom. During
the referral code registration, an external call is made to `Referral::registerReferral` which is channel through the
interface `IReferral::registerReferral`.
However, the function `Referral::registerReferral` has the modifier check `onlyRegisteredEngines` meaning only registered
engine can call `Referral::registerReferral`. Due to the modifier check the function call to `Referral::registerReferral`
will fail since EOA is not a registered engine.
```javascript
function registerReferral(
bytes calldata referrerCode,
address referrerAddress,
bytes calldata referralCode,
bool isCustomReferralCode
)
external
onlyRegisteredEngines
{
```
## Impact
EOA (`msg.sender`) will not be able to register a refferal code during its first time deposit.
## Recommendations
Add the `onlyRegisteredEngines` modifier check to `VaultRouterBranch::deposit` so that depositing of a given amount of
collateral assets into the provided vault in exchange for index tokens will be channeled through only registered engines
Updates

Lead Judging Commences

inallhonesty Lead Judge
10 months ago
inallhonesty Lead Judge 10 months ago
Submission Judgement Published
Invalidated
Reason: Incorrect statement

Support

FAQs

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

Give us feedback!