veToken Finance contest - asutorufos's results

Lock more veAsset permanently.

General Information

Platform: Code4rena

Start Date: 26/05/2022

Pot Size: $75,000 USDT

Total HM: 31

Participants: 71

Period: 7 days

Judge: GalloDaSballo

Total Solo HM: 18

Id: 126

League: ETH

veToken Finance

Findings Distribution

Researcher Performance

Rank: 50/71

Findings: 2

Award: $151.99

🌟 Selected for report: 0

🚀 Solo Findings: 0

#0 - GalloDaSballo

2022-07-06T23:28:55Z

L-1 address(0) checks

Valid Low

N-1 Multiple address mapping can combined into single mapping of an address to a struct.

More like a gas finding, also without POC the advice is not actionable

N-2 Events is missing indexed fields. Each event use three indexed fields if there are three or more fields.

Disagree with the events linked, 1 is for settings, the other has indexed

#1 - GalloDaSballo

2022-07-06T23:29:03Z

1L

C4 finding submitted: (risk = G (Gas Optimization)) Wallet address: 0xB4EBA2c82c248584a2DA0c75e1168D3b931D18af

G-1 Variables: No need to initialize variables that have default variables. Variables that are not set or initialize variables will have default variables like bool with false and address(0) for address. https://github.com/code-423n4/2022-05-vetoken/blob/main/contracts/VE3DLocker.sol#:~:text=bool%20public%20isShutdown%20%3D%20false%3B

G-2 ++1 cost less gas compared to i++ or i+= 1 I suggest using ++i instead of i++ to increment the value of an uint variable.

G-3 != 0 is a cheaper operation compared to > 0, when dealing with uint. https://github.com/code-423n4/2022-05-vetoken/blob/main/contracts/VE3DRewardPool.sol#:~:text=.sender)%20%7B-,require(_amount%20%3E%200%2C%20%22RewardPool%20%3A%20Cannot%20stake%200%22)%3B,-//also%20stake%20to

G-4 Loops can be implement more efficient. Saving gas by caching the length. If the length of the array doesn't change inside the loop. Example of recommended implementation. uint length = arr.length;

for (uint i; i < length; i++) {

//Operations not effecting the length of the array.

} https://github.com/code-423n4/2022-05-vetoken/blob/main/contracts/BaseRewardPool.sol#:~:text=also%20stake%20to%20linked%20rewards-,for%20(uint256%20i%20%3D%200%3B%20i%20%3C%20extraRewards.length%3B%20i,%7D,-_totalSupply%20%3D%20_totalSupply.add

G-5 Avoid Initialization of Loop Index If It Is 0 to Save Gas The local variable used as for loop index doesn't need to be initialized to 0 because the default value is 0.

https://github.com/code-423n4/2022-05-vetoken/blob/main/contracts/BaseRewardPool.sol#:~:text=//also%20stake%20to%20linked%20rewards-,for%20(uint256%20i%20%3D%200%3B%20i%20%3C%20extraRewards.length%3B%20i%2B%2B)%20%7B,-IRewards(extraRewards%5Bi%5D).stake(msg

https://github.com/code-423n4/2022-05-vetoken/blob/main/contracts/BaseRewardPool.sol#:~:text=//also%20stake%20to%20linked%20rewards-,for%20(uint256%20i%20%3D%200%3B%20i%20%3C%20extraRewards.length%3B%20i%2B%2B)%20%7B,-IRewards(extraRewards%5Bi%5D).stake(_for

https://github.com/code-423n4/2022-05-vetoken/blob/main/contracts/Booster.sol#:~:text=for%20(uint256%20i%20%3D%200%3B%20i%20%3C%20poolInfo.length%3B%20i%2B%2B)%20%7B

#0 - GalloDaSballo

2022-07-14T01:49:20Z

Saves at most 500g

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