Ajna Protocol - Eurovickk's results

A peer to peer, oracleless, permissionless lending protocol with no governance, accepting both fungible and non fungible tokens as collateral.

General Information

Platform: Code4rena

Start Date: 03/05/2023

Pot Size: $60,500 USDC

Total HM: 25

Participants: 114

Period: 8 days

Judge: Picodes

Total Solo HM: 6

Id: 234

League: ETH

Ajna Protocol

Findings Distribution

Researcher Performance

Rank: 103/114

Findings: 1

Award: $22.28

Gas:
grade-b

🌟 Selected for report: 0

🚀 Solo Findings: 0

Awards

22.2767 USDC - $22.28

Labels

bug
G (Gas Optimization)
grade-b
G-30

External Links

https://github.com/code-423n4/2023-05-ajna/blob/main/ajna-grants/src/grants/GrantFund.sol

1)Consider using the immutable keyword for variables that do not change during the execution of the contract, such as ajnaTokenAddress. This can save gas by allowing the compiler to replace variable references with their constant values during compilation.

2)Instead of using the + operator to update the treasury balance in the fundTreasury function, consider using the += operator, which can save some gas by avoiding the need to read the current value of treasury from storage before updating it.

3)In the fundTreasury function, the contract transfers tokens using the safeTransferFrom function from the SafeERC20 library. While this is a good practice to ensure the safe handling of ERC20 tokens, it can be expensive in terms of gas. If gas optimization is a concern, consider using the transferFrom function instead and perform the necessary checks manually to ensure the safe transfer of tokens.

4)In the fundTreasury function, the contract transfers tokens using the safeTransferFrom function from the SafeERC20 library. While this is a good practice to ensure the safe handling of ERC20 tokens, it can be expensive in terms of gas. If gas optimization is a concern, consider using the transferFrom function instead and perform the necessary checks manually to ensure the safe transfer of tokens.

#0 - c4-judge

2023-05-17T12:28:25Z

Picodes 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