Tracer contest - Lucius's results

Build and trade with Tracerโ€™s Perpetual Swaps and gain leveraged exposure to any market in the world.

General Information

Platform: Code4rena

Start Date: 24/06/2021

Pot Size: $80,000 USDC

Total HM: 18

Participants: 12

Period: 7 days

Judge: cemozer

Total Solo HM: 11

Id: 16

League: ETH

Tracer

Findings Distribution

Researcher Performance

Rank: 12/12

Findings: 1

Award: $152.83

๐ŸŒŸ Selected for report: 0

๐Ÿš€ Solo Findings: 0

Findings Information

๐ŸŒŸ Selected for report: s1m0

Also found by: 0xRajeev, JMukesh, Lucius, cmichel, pauliax, shw

Labels

bug
duplicate
2 (Med Risk)

Awards

152.8313 USDC - $152.83

External Links

Handle

Lucius

Vulnerability details

Impact

The functions transerFrom()/transer() do not revert on failure and instead simply return false. Without checks on the return values, the transfers could potentially fail silently allowing unexpected issues with certain token pools. E.G. If a user calls deposit() function on a swap pool or insurance pool which uses a non-reverting token, the transferFrom() could fail and the user balance would still be updated resulting in the user getting free tokens. If a user calls the withdraw() function on a swap or insurance pool the same failure could occur resulting in the user not receiving their tokens.

Proof of Concept

Insurance.sol: https://github.com/code-423n4/2021-06-tracer/blob/74e720ee100fd027c592ea44f272231ad4dfa2ab/src/contracts/Insurance.sol#L51

https://github.com/code-423n4/2021-06-tracer/blob/74e720ee100fd027c592ea44f272231ad4dfa2ab/src/contracts/Insurance.sol#L97

TracerPerpetualSwaps.sol: https://github.com/code-423n4/2021-06-tracer/blob/74e720ee100fd027c592ea44f272231ad4dfa2ab/src/contracts/TracerPerpetualSwaps.sol#L151

https://github.com/code-423n4/2021-06-tracer/blob/74e720ee100fd027c592ea44f272231ad4dfa2ab/src/contracts/TracerPerpetualSwaps.sol#L203

https://github.com/code-423n4/2021-06-tracer/blob/74e720ee100fd027c592ea44f272231ad4dfa2ab/src/contracts/TracerPerpetualSwaps.sol#L514

Use openzeppelins safeERC20 library safeTransfer()/safeTransferFrom() instead to revert on failure. Alternatively, manually use require() to check return value and revert if return value is false.

#0 - raymogg

2021-07-05T03:25:37Z

Duplicate of #115

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