Badger-Vested-Aura contest - gzeon's results

Bringing BTC to DeFi

General Information

Platform: Code4rena

Start Date: 15/06/2022

Pot Size: $30,000 USDC

Total HM: 5

Participants: 55

Period: 3 days

Judge: Jack the Pug

Id: 138

League: ETH

BadgerDAO

Findings Distribution

Researcher Performance

Rank: 35/55

Findings: 2

Award: $80.58

🌟 Selected for report: 0

🚀 Solo Findings: 0

Awards

51.2645 USDC - $51.26

Labels

bug
QA (Quality Assurance)
sponsor acknowledged
valid

External Links

#0 - GalloDaSballo

2022-06-19T00:24:42Z

Disagree, I think assert here is fine as it would cancel the deployment

Setting delegate to 0 means no-one is voting, it's actually potentially good

Awards

29.3239 USDC - $29.32

Labels

bug
G (Gas Optimization)
sponsor acknowledged
valid

External Links

For loop optimization

Use the following pattern to save gas

for(){ ... unchecked{++i;} }

Float multiplication optimization

We can use the following function to save gas on float multiplications

// out = x * y unchecked{/} z function fmul(uint256 x, uint256 y, uint256 z) internal pure returns(uint256 out){ assembly{ if iszero(eq(div(mul(x,y),x),y)) {revert(0,0)} out := div(mul(x,y),z) } }

https://github.com/Badger-Finance/vested-aura/blob/d504684e4f9b56660a9e6c6dfb839dcebac3c174/contracts/MyStrategy.sol#L205

#0 - GalloDaSballo

2022-06-19T00:25:31Z

I'd like to see Gzeon show proper math on the actual code, I think these submissions are a waste of your talent

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