Y2k Finance contest - 0xc0ffEE's results

A suite of structured products for assessing pegged asset risk.

General Information

Platform: Code4rena

Start Date: 14/09/2022

Pot Size: $50,000 USDC

Total HM: 25

Participants: 110

Period: 5 days

Judge: hickuphh3

Total Solo HM: 9

Id: 162

League: ETH

Y2k Finance

Findings Distribution

Researcher Performance

Rank: 78/110

Findings: 2

Award: $52.80

🌟 Selected for report: 0

🚀 Solo Findings: 0

  1. Return values ignored below: https://github.com/code-423n4/2022-09-y2k-finance/blob/2175c044af98509261e4147edeb48e1036773771/src/Vault.sol#L167 https://github.com/code-423n4/2022-09-y2k-finance/blob/2175c044af98509261e4147edeb48e1036773771/src/Vault.sol#L228 https://github.com/code-423n4/2022-09-y2k-finance/blob/2175c044af98509261e4147edeb48e1036773771/src/Vault.sol#L231 https://github.com/code-423n4/2022-09-y2k-finance/blob/2175c044af98509261e4147edeb48e1036773771/src/Vault.sol#L365 Should check return values or use OpenZeppelin's SafeERC20 wrapper functions

  2. The Vault.depositETH() function has a bad UX. It will always fail if msg.sender has not approved WETH allowance to the Vault. So the number of transaction needed to depositETH is still 2 transactions. Also, with this flow, it still costs more gas than just call to WETH.approve() and then call Vault.deposit() Consider change the logic of this function for better UX

#0 - HickupHH3

2022-11-05T01:52:53Z

Good point about bad UX for depositETH()!

  1. Could use unchecked here https://github.com/code-423n4/2022-09-y2k-finance/blob/2175c044af98509261e4147edeb48e1036773771/src/Vault.sol#L227 because feeValue can not exceed entitledShares
  2. Could use unchecked here https://github.com/code-423n4/2022-09-y2k-finance/blob/2175c044af98509261e4147edeb48e1036773771/src/rewards/StakingRewards.sol#L192 since the periodFinish > block.timestamp here
  3. The contract StakingRewards could remove the usage of SafeMath since compiler version is 0.8.15 which has default overflow/underflow checks for better readability and removing unnecessary extra checks
AuditHub

A portfolio for auditors, a security profile for protocols, a hub for web3 security.

Built bymalatrax © 2024

Auditors

Browse

Contests

Browse

Get in touch

ContactTwitter