Notional x Index Coop - cloudjunky's results

A collaboration between Notional and Index Coop to create fixed rate yield index tokens.

General Information

Platform: Code4rena

Start Date: 07/06/2022

Pot Size: $75,000 USDC

Total HM: 11

Participants: 77

Period: 7 days

Judge: gzeon

Total Solo HM: 7

Id: 124

League: ETH

Notional

Findings Distribution

Researcher Performance

Rank: 53/77

Findings: 1

Award: $89.19

🌟 Selected for report: 0

🚀 Solo Findings: 0

Inconsistent Pragma Definitions and floating pragma

Issue

There are multiple different pragma versions across the contracts in notional-wrapped-fcash/contracts. Namely;

This is a weakness identified in SWC-103 e.g. "Contracts should be deployed with the same compiler version and flags that they have been tested with thoroughly."

Remediation

Lock pragmas to a specified compiler version e.g. pragma solidity 0.8.11 on all contracts unless they are intended to be consumed by other developers.

Require with empty error messages

Issue

There are a series of require statements that have no message so it's difficult to understand the reason why it might revert. Often there's also no natspec comments to explain the enclosing function;

Examples;

Remediation

Ensure that each require statement has a clear message for why it failed. This is especially true for _safeUint88 in wfCashLogic which might revert for large values of fCash (e.g. 309485009821345068724781056).

Incomplete or inconsistent natspec

Issue

There's missing natspec documentation on most functions and important fields like @param and @return are often missing. wfCashLogic.sol has the most detailed documentation however it is still incomplete in many areas. Some examples;

Remediation

Propert natspec documentation with @param and @return populated would significantly impreove the readability of the code base and ensure reviewers aren't guessing as to the intent of functions and variables.

Mixed approach to return statements

Issue

There's mixed use of return and option returns across the wrapped fcash codebase. Examples;

Combined with the natspec issue above this dramatically effects code readability and the likelihood of bugs being introduced.

Remediation

Documenting @return would really help if the style guide is to still optionally return. Either way a consistent approach would improve readability.

Deprecated ABIEncoderv2 referenced in ^0.8.0 contracts

Issue

pragma experimental ABIEncoderV2; is referenced in a contract that has a solidity pragma > 0.8.0. ABIEncoderv2 is still valid but is deprecated in Solidity 0.8.0. See the solidity docs. A reference to ABIEncoderv2 was found in contracts/wfCashLogic.sol.

Remediation

Delete the reference to pragma experimental ABIEncoderv2 in contracts/wfCashLogic.sol or if there's still a requirement to be explicit change the reference to pragma abicoder v2; similar to contracts/lib/DateTime.sol.

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