Swivel contest - pauliax's results

The Decentralized Protocol For Fixed-Rate Lending & Tokenized Cash-Flows.

General Information

Platform: Code4rena

Start Date: 30/09/2021

Pot Size: $75,000 ETH

Total HM: 9

Participants: 15

Period: 7 days

Judge: 0xean

Total Solo HM: 2

Id: 39

League: ETH

Swivel

Findings Distribution

Researcher Performance

Rank: 6/15

Findings: 4

Award: $4,340.54

🌟 Selected for report: 6

🚀 Solo Findings: 0

Findings Information

🌟 Selected for report: 0xsanson

Also found by: 0xRajeev, GalloDaSballo, JMukesh, cmichel, defsec, leastwood, loop, nikitastupin, pants, pauliax

Labels

bug
duplicate
3 (High Risk)

Awards

0.1048 ETH - $310.65

External Links

Handle

pauliax

Vulnerability details

Impact

Not every ERC20 token returns true on transfer success. To support different tokens, the current best practice is to use SafeERC20 (safeTransfer, safeTransferFrom, etc): https://github.com/OpenZeppelin/openzeppelin-contracts/blob/master/contracts/token/ERC20/utils/SafeERC20.sol Similarly, some ERC20 tokens like USDT require resetting the approval to 0 first before being able to reset it to another value, so you should also consider replacing: uToken.approve(cTokenAddr, a); with: uToken.safeApprove(cTokenAddr, 0); uToken.safeApprove(cTokenAddr, a);

Consider using SafeERC20 library.

#0 - 0xean

2021-10-16T23:24:59Z

dupe of #155

Findings Information

🌟 Selected for report: 0xRajeev

Also found by: 0xsanson, cmichel, gpersoon, itsmeSTYJ, pauliax

Labels

bug
duplicate
2 (Med Risk)

Awards

0.0976 ETH - $289.35

External Links

Handle

pauliax

Vulnerability details

Impact

When calling function createMarket an admin can override an existing market by specifying the same underlying and maturity: markets[u][m] = Market(c, zctAddr, vAddr); it does not check if the market for these parameters already exists, so technically it is possible to re-create it but this function is only callable by admin so I am not sure if that's a supposed behavior or a potential bug, but because a track of old zcTokenAddr and vaultAddr is not kept, values and tokens held in them may become inaccessible forever.

Consider adding a check that the market does not exist before creating it.

#0 - 0xean

2021-10-16T23:17:31Z

dupe of #97

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