Trader Joe contest - cccz's results

One-stop-shop decentralized trading on Avalanche.

General Information

Platform: Code4rena

Start Date: 25/01/2022

Pot Size: $50,000 USDT

Total HM: 17

Participants: 39

Period: 3 days

Judge: LSDan

Total Solo HM: 9

Id: 79

League: ETH

Trader Joe

Findings Distribution

Researcher Performance

Rank: 17/39

Findings: 2

Award: $952.01

🌟 Selected for report: 5

πŸš€ Solo Findings: 0

Findings Information

Labels

bug
2 (Med Risk)
sponsor confirmed

Awards

60.3184 USDT - $60.32

External Links

Handle

cccz

Vulnerability details

Impact

It is good to add a require() statement that checks the return value of token transfers or to use something like OpenZeppelin’s safeTransfer/safeTransferFrom unless one is sure the given token reverts in case of a failure. Failure to do so will cause silent failures of transfers and affect token accounting in contract.

Proof of Concept

https://github.com/code-423n4/2022-01-trader-joe/blob/main/contracts/LaunchEvent.sol#L457

https://github.com/code-423n4/2022-01-trader-joe/blob/main/contracts/LaunchEvent.sol#L463

https://github.com/code-423n4/2022-01-trader-joe/blob/main/contracts/LaunchEvent.sol#L489

https://github.com/code-423n4/2022-01-trader-joe/blob/main/contracts/LaunchEvent.sol#L513

https://github.com/code-423n4/2022-01-trader-joe/blob/main/contracts/LaunchEvent.sol#L537

Tools Used

Manual analysis

Consider using safeTransfer/safeTransferFrom or require() consistently.

#1 - dmvt

2022-02-21T12:25:09Z

This could result in a loss of funds given the right external conditions.

2 β€” Med (M): vulns have a risk of 2 and are considered β€œMedium” severity when assets are not at direct risk, but the function of the protocol or its availability could be impacted, or leak value with a hypothetical attack path with stated assumptions, but external requirements.

#2 - amarpatel

2023-03-17T19:56:13Z

To test, I did this:

on package.json add test:TEMP to scripts:

...
"test:TEMP": "NODE_ENV=test ETHERNAL_ENABLED=false hardhat test --grep \"should process subsequent withdrawals of all supported tokens successfully\" --parallel",
...

Every vault fails: <img width="134" alt="image" src="https://user-images.githubusercontent.com/5858247/226017325-b8bd2185-071f-485a-9a6b-f4ab5e81ac8d.png">

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