Beginner FriendlyFoundryGameFi
100 EXP
View results
Submission Details
Severity: medium
Valid

Wrong inheritance method used in `MartenitsaEvent` which leads to DOS of `MartenitsaMarketplace`

Summary

Wrong inheritance method used in MartenitsaEvent contract which leads to DOS of MartenitsaMarketplace

Vulnerability Details

In MartenitsaEvent contract, isProducer and producers variable are different from already the variable present in the existing MartenitsaToken contract as MartenitsaEvent contract is inheriting from MartenitsaToken contract and it does not point or refer or link to the existing MartenitsaToken contract.

That means, all the state variables referring to MartenitsaToken contract and all the MartenitsaToken contract's state variables used in MartenitsaEvent contract are different from the already existing MartenitsaToken contract.

This also means that all the variables in MartenitsaEvent contract will have different states from the existing MartenitsaToken contract.

Impact

Here are the 2 major impacts:

  1. Users cannot use any of the functions and features of MartenitsaMarketplace contract.

  2. Due to the difference in the state variables in the existing MartenitsaToken contract and the one in MartenitsaEvent contract, malicious actors who are producers in the existing MartenitsaToken contract can become producer again in MartenitsaEvent contract using joinEvent function which is not intended by the protocol.

Tools Used

Manual Review

Recommendations

Add code in MartenitsaEvent contract:

- contract MartenitsaEvent is MartenitsaToken {
+ contract MartenitsaEvent {
+ MartenitsaToken public _martenitsaToken;
- constructor(address healthToken) onlyOwner {
+ constructor(address healthToken, address martenitsaToken) onlyOwner {
_healthToken = HealthToken(healthToken);
+ _martenitsaToken = MartenitsaToken(martenitsaToken);
}
Updates

Lead Judging Commences

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

MartenitsaToken and MartenitsaEvent have different addresses

Support

FAQs

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