Swivel v3 contest - caventa's results

The Capital-Efficient Protocol For Fixed-Rate Lending.

General Information

Platform: Code4rena

Start Date: 12/07/2022

Pot Size: $35,000 USDC

Total HM: 13

Participants: 78

Period: 3 days

Judge: 0xean

Total Solo HM: 6

Id: 135

League: ETH

Swivel

Findings Distribution

Researcher Performance

Rank: 55/78

Findings: 1

Award: $48.55

🌟 Selected for report: 0

🚀 Solo Findings: 0

Findings Information

Labels

bug
duplicate
2 (Med Risk)

Awards

48.5491 USDC - $48.55

External Links

Lines of code

https://github.com/code-423n4/2022-07-swivel/blob/main/Creator/ZcToken.sol#L111-L115 https://github.com/code-423n4/2022-07-swivel/blob/main/Creator/ZcToken.sol#L132-L134 https://github.com/code-423n4/2022-07-swivel/blob/main/Tokens/ZcToken.sol#L111-L115 https://github.com/code-423n4/2022-07-swivel/blob/main/Tokens/ZcToken.sol#L111-L115

Vulnerability details

Impact

Detailed description of the impact of this finding.

Wrong operators are set.

Proof of Concept

Provide direct links to all referenced code in GitHub. Add screenshots, logs, or any other relevant proof that illustrates the concept.

[Line 111 - 115]

if (allowed >= previewAmount) { revert Approvals(allowed, previewAmount);}

should be changed to

if (allowed < previewAmount) { revert Approvals(allowed, previewAmount);}

[Line 132 - 134]

if (allowed >= principalAmount) { revert Approvals(allowed, principalAmount); }

should be changed to

if (allowed < principalAmount) { revert Approvals(allowed, principalAmount); }

Tools Used

Manual

Using the current code, If allowance < value, code will be reverted because of underflow after substraction if allowance >= value, code will be reverted because of the if statement

which is not what we want

#0 - scaraven

2022-07-17T08:44:22Z

duplicate of #180

#1 - JTraversa

2022-07-20T07:24:10Z

Duplicate of #129

#2 - bghughes

2022-07-31T19:58:15Z

Duplicate of #129

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