Trader Joe contest - csanuragjain'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: 27/39

Findings: 2

Award: $138.27

🌟 Selected for report: 1

🚀 Solo Findings: 0

Findings Information

🌟 Selected for report: cccz

Also found by: csanuragjain, defsec, robee

Labels

bug
duplicate
1 (Low Risk)

Awards

94.5831 USDT - $94.58

External Links

Handle

csanuragjain

Vulnerability details

Impact

Some tokens (like USDT) do not work when changing the allowance from an existing non-zero allowance value.They must first be approved by zero and then the actual allowance must be approved. In this case allowance was not set to 0 first

Proof of Concept

  1. Navigate to contract at https://github.com/code-423n4/2022-01-trader-joe/blob/main/contracts/LaunchEvent.sol

  2. Observe the createPair function

function createPair() external isStopped(false) atPhase(Phase.PhaseThree) { token.approve(address(router), tokenAllocated); }
  1. As we can see approval was not set to 0 before setting it to tokenAllocated

Add below line

token.approve(address(router), 0); token.approve(address(router), tokenAllocated);

#0 - cryptofish7

2022-02-11T00:52:16Z

Duplicate of #22

Findings Information

🌟 Selected for report: gzeon

Also found by: 0x1f8b, Ruhum, WatchPug, bobi, csanuragjain

Labels

bug
duplicate
G (Gas Optimization)

Awards

3.9149 USDT - $3.91

External Links

Handle

csanuragjain

Vulnerability details

Impact

Gas savings

Proof of Concept

  1. Navigate to contract https://github.com/code-423n4/2022-01-trader-joe/blob/main/contracts/RocketJoeFactory.sol

  2. Observe that _eventImplementation, _wavax is meant to be declared only once and hence can be declared immutable

#0 - cryptofish7

2022-02-11T00:56:56Z

Duplicate of #284

Findings Information

🌟 Selected for report: csanuragjain

Labels

bug
G (Gas Optimization)
sponsor acknowledged

Awards

39.7792 USDT - $39.78

External Links

Handle

csanuragjain

Vulnerability details

Impact

Gas savings

Proof of Concept

  1. Navigate to contract https://github.com/code-423n4/2022-01-trader-joe/blob/main/contracts/LaunchEvent.sol

  2. Observe that _issuer is meant to be declared only once and hence can be declared immutable

  3. In getPenalty function timeElapsed < PHASE_ONE_NO_FEE_DURATION could be changed to timeElapsed <= PHASE_ONE_NO_FEE_DURATION since penalty will be 0 in both cases

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