Organizer can deploy Proxy pointing to custom implementation.
NOTE: It is understood & acknowledged that the SPARKN team plans to implement off-chain KYC, reputation rating system etc for the organizers to avoid malicious behaviour. While that is a good step, multiple steps can be taken to avoid organizers' malicious behaviour on-chain.
These steps are detailed in the last section under Recommendations
.
Once the owner starts a contest via setContest()
, there is nothing to stop a malicious organizer deploying a proxy pointing to his custom implementation instead of Distributor.sol
. This FakeDistributor (custom implementation contract) can be used to steal funds or behave not as intended by the protocol.
Please note that it is not clear how the unique contestId
generated off-chain (and hence the contest started via setContest()
by the owner) links to the proxy contract being deployed by the organizer and if there is any constraint applied on the organizer to prevent such behaviour.
The following PoC can be run via forge test --mt test_OrganizerCanDeployProxyPointingToCustomImplementation -vv
:
Custom behaviour/loss of sponsor's funds due to malicious contract deployment by the organizer.
Bypasses protocol's intended behaviour.
Manual review, forge test.
While the SPARKN team will have more visibility of the on-ground business case challenges, the following flow seems strong enough to deter a malicious organizer. This is inspired in part by SPARKN's approach towards distributeByOwner()
functionality, where they charge 5% fee to deter any casual requests. Imposing a financial cost to an attack works well :
Making them pay upfront (a registration fee of sorts), before the contest starts.
Control for proxy deployment stays with the owner.
Contest is only 'registered' via setContest()
, NOT started.
Contest is started only after proxy deployment by owner which is after organizer/sponsor transfers total funds to the proxy address.
Distribution of rewards needs owner's approval.
Below is a recommendation of one such workflow -
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.