The MartenitsaEvent
contract is designed to work with ERC721 MartenitsaToken
but instead of initializing it in constructor the contract inherits MartenitsaToken
creating a new token contract with address of MartenitsaEvent
which is not the same as the original MartenitsaToken
contract, rendering this contract unable to interact with MartenitsaMarketplace
or MartenitsaToken
The MartenistaEvent::isProducer
(it has one since it inherited MartenitsaToken
) is not same as MartenitsaToken::isProducer
hence all the producers can join event.
Users who joins the event using MartenitsaEvent::joinEvent
function cannot list martenitsas using MartenitsaNarketplace::listMartenitsaForSale
function.
The MartenitsaEvent::_addProducer
internal function which is called inside MartenitsaEvent::joinEvent
adds a user to MartenitsaEvent::isProducer
mapping not MartenitsaToken::isProducer
mapping.
Add the following PoC's to MartenitsaEvent.t.sol
Any producer can join the event
Users who join event cannot list martenitsas
The MartenitsaEvent::_addProducer
internal function adds a user to MartenitsaEvent::isProducer
mapping not MartenitsaToken::isProducer
mapping
There are two possible mitigations and both demand major changes
The MartenitsaEvent
contract requires an entire archhitectural rework since the assumption about the inheritance is wrongly implemented and also the test suites use MartenitsaToken
as the base token contract , the changes should be implemented in such a way that MartenitsaEvent
contract doesn't inherit MartenitsaToken
but initialises its address in constructor as a state variable and rest of the changes in all contracts and test suites must be done with this assumption.
Using MartenitsaEvent
contract as the base token contract can work but it requires several changes in all other contracts and test suites rewritten.
The contest is live. Earn rewards by submitting a finding.
This is your time to appeal against judgements on your submissions.
Appeals are being carefully reviewed by our judges.