Paladin - Warden Pledges contest - halden'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: 87/96

Findings: 1

Award: $11.52

Gas:
grade-b

🌟 Selected for report: 0

🚀 Solo Findings: 0

[G-01] Using msg.sender will always be cheaper than using a local variable.

The CALLER operation which is reading the msg.sender global variable costs 2. While MLOAD/MSTORE operations which are memory operations (storage where local variables are stored) costs 3.

308

[G-02] Optimizations with assembly

[G-02.1] Use assembly for math (add, sub, mul, div)

263, 265, 327-328, 387-388,432-433

[G-02.2] Use assembly to check for address(0)

310, 460, 492, 527, 571, 586, 600

[G-03] Use Add unchecked {} where the operands can not underflow/overflow because of a previous check

431

[G-04] Cache storage values in memory to minimize SLOADs

pledgeParams.endTimestamp 380, 382, 426, 430

minAmountRewardToken[rewardToken] 312-313

[G-05] X += Y or X -= Y costs more gas than X = X + Y or X = X - Y for state variables

268, 340, 401, 445

[G-05] Use modifier to decrease deployment cost

pledgeId >= pledgesIndex() 223, 374, 420, 457, 489

to -> modifier validPledgeID

address creator = pledgeOwner[pledgeId]; if(msg.sender != creator) revert Errors.NotPledgeCreator();

to -> modifier onlyPledgeCreator 458, 490

#0 - c4-judge

2022-11-12T00:33:51Z

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