JPEG'd contest - Cr4ckM3's results

Bridging the gap between DeFi and NFTs.

General Information

Platform: Code4rena

Start Date: 07/04/2022

Pot Size: $100,000 USDC

Total HM: 20

Participants: 62

Period: 7 days

Judge: LSDan

Total Solo HM: 11

Id: 107

League: ETH

JPEG'd

Findings Distribution

Researcher Performance

Rank: 26/62

Findings: 3

Award: $339.14

🌟 Selected for report: 0

🚀 Solo Findings: 0

Findings Information

🌟 Selected for report: Wayne

Also found by: Cr4ckM3, PPrieditis, hyh, rayn, smiling_heretic

Labels

bug
duplicate
2 (Med Risk)

Awards

232.7669 USDC - $232.77

External Links

Better noContract

noContract modifier is used in farming/LPFarming.sol#L85 to prevent non-whitelisted contracts to interact with the LP farm. But isContract check can be bypassed with a contract executing constructor code.

require(msg.sender == tx.origin) may be a better choice.

#0 - spaghettieth

2022-04-11T17:27:46Z

Duplicate of #11

Findings Information

Awards

25.7805 USDC - $25.78

Labels

bug
duplicate
2 (Med Risk)

External Links

Lines of code

https://github.com/code-423n4/2022-04-jpegd/blob/main/contracts/vaults/NFTVault.sol#L459

Vulnerability details

Impact

According to Chainlink's documentation, the latestAnswer function is deprecated. This function does not error if no answer has been reached but returns 0.

Proof of Concept

NFTVault.sol#L459

It's same as a medium risk issue in other C4 contest

Tools Used

N/A

Use the new latestRoundData function to get the price instead. Add checks on the return data with proper revert messages if the price is stale or the round is uncompleted, for example:

(uint80 roundID, int256 price, , uint256 timeStamp, uint80 answeredInRound) = oracle.latestRoundData(); require(answeredInRound >= roundID, "..."); require(timeStamp != 0, "...");

#0 - spaghettieth

2022-04-11T15:33:51Z

Duplicate of #4

Awards

80.5853 USDC - $80.59

Labels

bug
G (Gas Optimization)
sponsor acknowledged

External Links

Redundant onlyOwner

https://github.com/code-423n4/2022-04-jpegd/blob/main/contracts/farming/LPFarming.sol#L363

As we always revert in renounceOwnership(), onlyOwner check can be removed.

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