Frontrunning possible with contest creation in ProxyFactory.sol
Issue 1:
In ProxyFactory.sol, setContest() is used to set the new contest which can be accessed by owner only.
Here the salt is a bytes32 value that is used in contest creation call i.e setContest() by the owner. It has used _calculateSalt()
function to get the bytes32 salt value,
Notice here, it has only used arguments such as organizer, contestId, implementation for calculating the salt, however such implementation is susceptible to front runnning. The frontrunning can occur in the following way:
When the contest creation is called by owner. An attacker monitors the mempool for pending transactions that involve cloning a contract with a provided "salt".
Upon spotting such a transaction, the attacker extracts the "salt" value.
The attacker quickly submits their own transaction with a higher gas price, attempting to clone the contract with the same "salt" before the original transaction is mined.
If the transaction got successful, the attacker's transaction is mined first, and the contract clone is created at the expected address.
The original transaction will likely fail, as the contract with the expected address has already been deployed.
Issue 2:
In similar way, attacker can front run the creation of getProxyAddress(),
Here salt and implementation is passed as an argument but as mentioned above this can also be front run in similar way. Check the recommendations to mitigate this issue.
Issue 3:
As discussed in Issue 1 about _calculateSalt(). This function is also used in _deployProxy().
Since this has used _calculateSalt() as an internal function for which the front running prevention is already taken care in _calculateSalt() in recommendation. _deployProxy() has used create2 for contract creation with salt is provided as an argument. Create2 has common issue of front running or DOS however with the provided recommendation it is already prevented.
Manual review
Use a salt that includes the msg.sender. That way it is not possible to front-run the transaction.
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.