FIAT DAO veFDT contest - 0xSky's results

Unlock liquidity for your DeFi fixed income assets.

General Information

Platform: Code4rena

Start Date: 12/08/2022

Pot Size: $35,000 USDC

Total HM: 10

Participants: 126

Period: 3 days

Judge: Justin Goro

Total Solo HM: 3

Id: 154

League: ETH

FIAT DAO

Findings Distribution

Researcher Performance

Rank: 17/126

Findings: 2

Award: $391.74

🌟 Selected for report: 0

🚀 Solo Findings: 0

Findings Information

Labels

bug
duplicate
3 (High Risk)

Awards

314.0226 USDC - $314.02

External Links

Lines of code

https://github.com/code-423n4/2022-08-fiatdao/blob/fece3bdb79ccacb501099c24b60312cd0b2e4bb2/contracts/VotingEscrow.sol#L425-L428

Vulnerability details

Impact

VotingEscrow will not work for such tokens.

Proof of Concept

This issue is same as a previous contest. https://code4rena.com/reports/2022-05-factorydao/#m-03-safetransferfrom-is-recommended-instead-of-transfer-1

In the implementation of token transfer, the return value is checked after token transfer. But some tokens do not return bool values. After DM, I know you don't use these kinds of tokens, but this contract can be used on top of most of ERC20 tokens, and this can be a problem when we extend the usage.

#0 - lacoop6tu

2022-08-16T14:20:24Z

Duplicate of #231

Findings Information

🌟 Selected for report: Aymen0909

Also found by: 0xSky, 0xf15ers, CertoraInc, JohnSmith, auditor0517, bin2chen, csanuragjain, scaraven, tabish, wagmi, yixxas

Labels

bug
duplicate
2 (Med Risk)

Awards

77.7206 USDC - $77.72

External Links

Lines of code

https://github.com/code-423n4/2022-08-fiatdao/blob/fece3bdb79ccacb501099c24b60312cd0b2e4bb2/contracts/VotingEscrow.sol#L507-L515

Vulnerability details

Checkpoint end time is not correct.

Impact

The user's voting power can be significantly decreased.

Proof of Concept

https://github.com/code-423n4/2022-08-fiatdao/blob/fece3bdb79ccacb501099c24b60312cd0b2e4bb2/contracts/VotingEscrow.sol#L507-L515

At L513 of VotingEscrow.sol, when we increase unlock time, oldLocked.end should be oldUnlockTime instead of unlock_time. We can double-check it from the Checkpoint Math documentation here. https://github.com/code-423n4/2022-08-fiatdao/blob/main/CheckpointMath.md#increaseunlocktime

In the worst senario, if oldUnlockTime is 1 WEEK, and unlock_time is 1 YEAR, there will be some significant decrease of voting power in _checkpoint function. But I think this is very likely to a typo, so I will not add detailed showcase.

Tools Used

Manual Review

- oldLocked.end = unlock_time; + oldLocked.end = oldUnlockTime;

#0 - lacoop6tu

2022-08-16T14:41:53Z

Duplicate of #217

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