Badger Citadel contest - z3s's results

Bringing BTC to DeFi

General Information

Platform: Code4rena

Start Date: 14/04/2022

Pot Size: $75,000 USDC

Total HM: 8

Participants: 72

Period: 7 days

Judge: Jack the Pug

Total Solo HM: 2

Id: 110

League: ETH

BadgerDAO

Findings Distribution

Researcher Performance

Rank: 48/72

Findings: 2

Award: $143.56

🌟 Selected for report: 0

🚀 Solo Findings: 0

Non Critical

ABIEncoderV2 is activated by default from version 0.8.0:

These can be deleted:

Use of Floating Pragma:

Contracts should be deployed with the same compiler version and flags that they have been tested with thoroughly. Locking the pragma helps to ensure that contracts do not accidentally get deployed using, for example, an outdated compiler version that might introduce bugs that affect the contract system negatively.

Lock the pragma version: use 0.8.12 instead of ^0.8.0.

Open TODOs:

Open TODOs can point to architecture or programming issues that still need to be resolved.

./src/Funding.sol 15: * TODO: Better revert strings 61: // TODO: we should conform to some interface here 183: // TODO: Check gas costs. How does this relate to market buying if you do want to deposit to xCTDL? ./src/GlobalAccessControl.sol 106: /// TODO: Add string -> hash EnumerableSet to a new RoleRegistry contract for easy on-chain viewing. ./src/KnightingRound.sol 14: * TODO: Better revert strings

Consider resolving the TODO before deploying.

Gas Optimizations

Use calldata instead of memory:

For external function's dynamic params, calldata is the cheapest location to use.

Change params memory to calldata

Use Custom Errors to save Gas:

Custom errors from Solidity 0.8.4 are cheaper than require messages. https://blog.soliditylang.org/2021/04/21/custom-errors/

++i use less gas than i++:

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