Frankencoin - lukris02's results

A decentralized and fully collateralized stablecoin.

General Information

Platform: Code4rena

Start Date: 12/04/2023

Pot Size: $60,500 USDC

Total HM: 21

Participants: 199

Period: 7 days

Judge: hansfriese

Total Solo HM: 5

Id: 231

League: ETH

Frankencoin

Findings Distribution

Researcher Performance

Rank: 116/199

Findings: 1

Award: $22.60

QA:
grade-b

🌟 Selected for report: 0

🚀 Solo Findings: 0

QA Report for Frankencoin contest

Overview

During the audit, 3 low and 7 non-critical issues were found.

â„–TitleRisk RatingInstance Count
L-1Function transferAndCall is not safeLow1
L-2Use SafeCast LibraryLow1
L-3Check that amount to mint > 0Low5
NC-1Order of LayoutNon-Critical7
NC-2Inconsistency when using the number 1000_000Non-Critical7
NC-3Inconsistency when using uint and uint256Non-Critical3
NC-4Prevent zero transfersNon-Critical2
NC-5Natspec is incompleteNon-Critical1
NC-6No space between the control structuresNon-Critical1
NC-7Missing leading underscoreNon-Critical33

Low Risk Findings(3)

L-1. Function transferAndCall is not safe

Description

The function transferAndCall is vulnerable to reentrancy.

Instances
Recommendation

Avoid using it.

L-2. Use SafeCast Library

Description

Downcasting from uint256/int256 in Solidity does not revert on overflow. This can easily result in undesired exploitation or bugs, since developers usually assume that overflows raise errors. SafeCast restores this intuition by reverting the transaction when such an operation overflows.

Instances
Recommendation

It is better to use safe casting library.

L-3. Check that amount to mint > 0

Instances
Recommendation

For example, add the check:

if (usableMint == 0) revert ZeroAmount(); _mint(_target, usableMint);

Non-Critical Risk Findings(7)

NC-1. Order of Layout

Description

According to Order of Layout, inside each contract, library or interface, use the following order:

  1. Type declarations
  2. State variables
  3. Events
  4. Modifiers
  5. Functions
Instances
Recommendation

Place modifiers before constructor.

NC-2. Inconsistency when using the number 1000_000

Description

In some cases, 1000000 is used, and in some - 1000_000.

Instances

1000000:

1000_000:

Recommendation

Stick to one style.

NC-3. Inconsistency when using uint and uint256

Description

Some variables is declared as uint and some as uint256.

Instances

There are 4 cases with uint when the rest are with uint256:

Recommendation

Stick to one style.

NC-4. Prevent zero transfers

Description

Check that amount to transfer > 0.

Instances

NC-5. Natspec is incomplete

Instances

Parameter roundingLoss is missing.

* @notice Decrease the total votes anchor when tokens lose their voting power due to being moved * @param from sender * @param amount amount to be sent */
Recommendation

Add the description for the roundingLoss.

NC-6. No space between the control structures

Description

According to Style Guide, there should be a single space between the control structures if, while, and for and the parenthetic block representing the conditional.

Instances
Recommendation

Change:

if(...) { ... }

to:

if (...) { ... }

NC-7. Missing leading underscores

Description

Internal and private constants, immutables and functions should have a leading underscore.

Instances
Recommendation

Add leading underscores where needed.

#0 - 0xA5DF

2023-04-27T10:52:00Z

L2 is dupe of #393 L1 auotmated

#1 - c4-judge

2023-05-17T03:50:03Z

hansfriese marked the issue as grade-b

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