Users cannot create or sell MartenitsaTokens
after joining the event
The issue arises within the MartenitsaEvent.sol
contract, which inherits the MartenitsaToken.sol
contract. When a user invokes the joinEvent()
function to participate in the event, they are assigned the producer role, enabling them to execute createMartenitsa()
and listMartenitsaForSale()
. However, the isProducer
mapping and the producers
arrays are called in a way that confines their existence solely within the MartenitsaEvent.sol
contract. Consequently, the user assumes the producer role only within the context of the MartenitsaEvent.sol
contract and not within MartenitsaToken.sol
or MartenitsaMarketplace.sol
. To create a token, the user must hold the producer status in MartenitsaToken.sol
, otherwise, it triggers an error message stating, "You are not a producer!". The main issue lies in the _addProducer( )
function that assigns the producer role to the users only within the MartenitsaEvent.sol
contract
add this code to the MartenitsaEvent.t.sol
testsuite
impact : High
Likelihood: High
Since every user that joins the event loses a healthToken
and doesnt recieve the producer role this is marked as a high vulnerability
Manual Review, foundry
Rewrite the addProducer( )
function such that the user is added as a producer in the MartenitsaToken.sol
contract
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.