Paladin - Warden Pledges contest - sakman's results

A governance lending protocol transforming users voting power into a new money lego.

General Information

Platform: Code4rena

Start Date: 27/10/2022

Pot Size: $33,500 USDC

Total HM: 8

Participants: 96

Period: 3 days

Judge: kirk-baird

Total Solo HM: 1

Id: 176

League: ETH

Paladin

Findings Distribution

Researcher Performance

Rank: 86/96

Findings: 1

Award: $11.52

Gas:
grade-b

🌟 Selected for report: 0

🚀 Solo Findings: 0

1. Explicitly assingning default values to variables is a waste of gas

Use uint256 i; instead of uint256 i = 0;

contracts/WardenPledge.sol: L547

2. When comparing variables of type uint, use require(x != 0) instead of require(x > 0)

contracts/WardenPledge.sol: L471 L504

3. Cache storage variables in function call stack to save gas

contracts/WardenPledge.sol: L240-L248

4. Use constant and immutable for constants

contracts/WardenPledge.sol: L60 L62

5. public storage constant(and immutable) variable should be private

saves tons of gas on deployment

contracts/WardenPledge.sol: L22 L23 L24

6. Use x < y + 1 in stead of x <= y

contracts/WardenPledge.sol: L223 L229 L374 L380 L426 L429 L489

7. use x = x + y instead of x+= y

contracts/WardenPledge.sol: L268 L340 L401

8. Place i++ in an unchecked blocks in for-loops

contracts/WardenPledge.sol: L550

#0 - c4-judge

2022-11-12T01:13:37Z

kirk-baird 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