Hunt prep
Before you test Union Finance Update #2
What 9 disclosed reports say about Union Finance Update #2: 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 | 6 | 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.
-
Minimum borrow amount can be surpassed and borrower can be treated as being overdue earlier than their actual overdue time
The protocol team fixed this issue by moving the minimum borrow check to after the withdrawal, so it applies to the effective amount borrowed.
Disclosed
-
`ERC1155Voucher.onERC1155BatchReceived()` does not check the caller is the valid token therefore any unregistered token can invoke `onERC1155BatchReceived()`
Add a require statement checking isValidToken[msg.sender] in onERC1155BatchReceived, as recommended.
Disclosed
-
VouchFaucet can be immediately drained by anyone
The claimTokens function should update the claimedTokens mapping before transferring tokens, and the require statement should check the new total against maxClaimable.
Disclosed
-
Wrong calculation of Accure Reward in Comptroller.sol
The fix is to read the global total staked after updating the user's frozen amounts, and the protocol team has fixed this issue.
Disclosed
-
Repaying a Loan with Permit in UErc20.sol Wrongly calculates the interest to be paid this Reduce/Increase profits for the protocol as interest calculations are not performed correctly
The interest should be scaled correctly according to the token's decimal places, for example by using a scaled interest calculation function.
Disclosed
-
Any user can claim an unlimited amount of vouch in `VouchFaucet.sol`
The function should be restricted to approved users and should enforce that each user cannot claim more than TRUST_AMOUNT in total.
Disclosed
-
`updateLocked()` locks a rounded down value
The issue was fixed by introducing an option to round up in `decimalReducing()` and using it when locking.
Disclosed
-
Possible loss of funds, transfer functions can silently fail
Use OpenZeppelin's SafeERC20 library with safeTransfer() instead of transfer().
Disclosed
-
The _totalStaked tracker calculation is incorrect and will be inflated due to the improper logic in the writeOffDebt function of the UserManager contract, leading to wrong Comptroller gInflationIndex being calculated and wrong user rewards being issued
The fix is to subtract actualAmount instead of amount from _totalStaked in debtWriteOff; the protocol team fixed this issue.
Disclosed