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
Rank: 103/114
Findings: 1
Award: $22.28
🌟 Selected for report: 0
🚀 Solo Findings: 0
🌟 Selected for report: JCN
Also found by: 0x73696d616f, 0xSmartContract, 0xnev, Audit_Avengers, Aymen0909, Blckhv, Eurovickk, K42, Kenshin, Rageur, Raihan, ReyAdmirado, SAAJ, SAQ, Shubham, Tomio, Walter, ayden, codeslide, descharre, dicethedev, hunter_w3b, j4ld1na, kaveyjoe, okolicodes, patitonar, petrichor, pontifex, yongskiws
22.2767 USDC - $22.28
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