Timeswap contest - pavankv's results

Like Uniswap, but for lending & borrowing.

General Information

Platform: Code4rena

Start Date: 20/01/2023

Pot Size: $90,500 USDC

Total HM: 10

Participants: 59

Period: 7 days

Judge: Picodes

Total Solo HM: 4

Id: 206

League: ETH

Timeswap

Findings Distribution

Researcher Performance

Rank: 23/59

Findings: 1

Award: $212.75

🌟 Selected for report: 0

🚀 Solo Findings: 0

Findings Information

🌟 Selected for report: RaymondFam

Also found by: Rolezn, SaeedAlipoor01988, kaden, mert_eren, nadin, pavankv, rbserver

Labels

bug
2 (Med Risk)
satisfactory
duplicate-247

Awards

212.7503 USDC - $212.75

External Links

Lines of code

https://github.com/code-423n4/2023-01-timeswap/blob/main/packages/v2-option/src/TimeswapV2Option.sol#L172

Vulnerability details

Impact

A transfer-on-fee token or a deflationary/rebasing token, causing the received amount to be less than the accounted amount. For instance, a deflationary tokens might charge a certain fee for every transfer() or transferFrom() / safeTransfer() or safeTransferFrom().

Summary :-

Situation 1 :- In swap() it just transfer to recipient. If any user try to deals with transfer-on-fee token it will charge fee on transfer. Like user try to swap 100 tokens deflationary tokens , opposite party will receive 99 but user thought like 100 sent and he also gets 100 transfer-on-fee tokens equal number of other tokens. In last checkEnough() just check whether transfered or not but some of tokens paid as fee-on transfer .

Situation 2 :- Same as in collect() also .

Proof of Concept

swap():- https://github.com/code-423n4/2023-01-timeswap/blob/main/packages/v2-option/src/TimeswapV2Option.sol#L220

collect() :- https://github.com/code-423n4/2023-01-timeswap/blob/main/packages/v2-option/src/TimeswapV2Option.sol#L259 https://github.com/code-423n4/2023-01-timeswap/blob/main/packages/v2-option/src/TimeswapV2Option.sol#L262

Tools Used

Manual View

Maintain before and after balance while dealing with transfer-on-fee tokens .

#0 - c4-judge

2023-02-02T21:22:55Z

Picodes marked the issue as duplicate of #52

#1 - c4-judge

2023-02-12T22:37:33Z

Picodes marked the issue as satisfactory

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