Hunt prep
Before you test Unlock Protocol contest
What 18 disclosed reports say about Unlock Protocol contest: what was found and paid, what was fixed, and where it may be worth looking next.
- with a public bounty
- 0
- median public bounty
- –
- highest public bounty
- –
Gaps worth testing
Not written yet for this program. The numbers below are up to date.
What was found and what it paid
Public bounties only; many reports disclose without the amount.
| Class | Reports | Paid | Median | Highest | In all |
|---|---|---|---|---|---|
| Business logic lesson | 15 | 0 | – | – | $0 |
| Access control lesson | 2 | 0 | – | – | $0 |
What was fixed
All reportsThe newest fixes, in our words. A fixed bug is not worth re-reporting, but a sibling feature, an older API version or a regression may be.
-
Unlock: free UDT arbitrage opportunity
The protocol should use the average of multiple oracle sources and distribute UDT tokens based on the duration of key ownership; the team later said they would mitigate by moving to Uniswap v3 for their oracles.
Disclosed
-
Refund mechanism doesn’t take into account that key price can change
The protocol should save the amount each user paid and calculate refunds based on that, or use a price snapshot/version mechanism.
Disclosed
-
MixinPurchase:shareKey allows to generate keys without purchasing
The shareKey function should be redesigned to prevent generating keys beyond the maximum supply, for example by checking the recipient's existing keys and enforcing the maxNumberOfKeys limit.
Disclosed
-
Inaccurate fees computation
The first if condition should be changed to less-than-or-equal, and the else branch should compute the time without fee using the correct formula.
Disclosed
-
Missing maxNumberOfKeys checks in shareKey and grantKey
Add a check in _assignNewTokenId that reverts when a new key would exceed maxNumberOfKeys, or at least apply this check in the shareKey flow.
Disclosed
-
Approvals not cleared after key transfer
The transferFrom function should always call _clearApproval when the recipient's previous key has expired, and _setKeyManagerOf should not handle clearing single-token approvals.
Disclosed
-
MEV miner can mint larger than expected UDT total supply
The gas price used in the reimbursement calculation should be determined by an oracle that provides an average over a number of blocks, and the value should be bounded to prevent arbitrary manipulation.
Disclosed
-
MixinTransfer.sol#transferFrom Wrong implementation can potentially allows attackers to reverse transfer and cause fund loss to the users
The key manager should be reset regardless of the recipient's key status.
Disclosed
-
Potential economic attack on UDT grants to the referrer
The protocol should set a global daily upper limit on total UDT grants to referrers and an upper limit per purchase, and eventually use the actual gas spent instead of a hardcoded estimate.
Disclosed
-
Support of different ERC20 tokens
Use SafeERC20 for token transfers and check the actual balance change, or clearly document that deflationary/rebasing tokens are not supported.
Disclosed
-
Key buyers will not be able to get refund if lock manager withdraws profits
The contract should be modified to ensure that enough funds remain in the lock to cover refunds, for example by implementing a shares system or limiting withdrawals.
Disclosed
-
Key transfer will destroy key if from==to
The issue was fixed by adding a require statement at the beginning of transferFrom to prevent transfers to self.
Disclosed
-
Frontrunning PublicLock.initialize() can prevent upgrades due to insufficient access control
Implement valid access control on the PublicLock contract to ensure only the relevant deployer can initialize it.
Disclosed
-
Referrer discount token amount can be manipulated
The amount minted should be based on a trusted average gas price rather than the user's gas price.
Disclosed
-
Missing scaling factor in recordKeyPurchase ?
Consider adding a scaling factor to the term and dividing by it at the end of the computation.
Disclosed