Concur Finance contest - bitbopper's results

Incentives vote-and-rewards sharing protocol

General Information

Platform: Code4rena

Start Date: 03/02/2022

Pot Size: $75,000 USDC

Total HM: 42

Participants: 52

Period: 7 days

Judge: GalloDaSballo

Total Solo HM: 21

Id: 83

League: ETH

Concur Finance

Findings Distribution

Researcher Performance

Rank: 35/52

Findings: 3

Award: $223.07

🌟 Selected for report: 0

🚀 Solo Findings: 0

Findings Information

Awards

31.0722 USDC - $31.07

Labels

bug
duplicate
3 (High Risk)

External Links

Lines of code

https://github.com/code-423n4/2022-02-concur/blob/main/contracts/Shelter.sol#L52:L58

Vulnerability details

Impact

Multiple withdraws can reduce total supply in shelter

Proof of Concept

The shelter saves that a users have withdrawn - but never checks it to prevent multiple withdraws.

  • saved at: https://github.com/code-423n4/2022-02-concur/blob/72b5216bfeaa7c52983060ebfc56e72e0aa8e3b0/contracts/Shelter.sol#L55
  • check not happening at: https://github.com/code-423n4/2022-02-concur/blob/72b5216bfeaa7c52983060ebfc56e72e0aa8e3b0/contracts/Shelter.sol#L53

Check if user has withdrawn from shelter already in mentioned line L53

Notes

I am assuming here, that the shelter client is not backstopping multiple withdraws. Multiple reasons for me to believe so:

  • Adhoc implementation (https://github.com/code-423n4/2022-02-concur/tree/shelter-client) given by leekt216 in discord does not backstop multiple withdraw
  • The withdraw is saved in L55. Saving in an unreleased ShelterClient and in Shelter.sol plus emitting an Event in https://github.com/code-423n4/2022-02-concur/blob/72b5216bfeaa7c52983060ebfc56e72e0aa8e3b0/contracts/Shelter.sol#L56 would be wasteful.

#1 - GalloDaSballo

2022-04-19T01:08:42Z

Dup of #246

Awards

125.0194 USDC - $125.02

Labels

bug
QA (Quality Assurance)

External Links

Function performing important changes to contract state should emit events to facilitate monitoring of the protocol operation

https://github.com/code-423n4/2022-02-concur/blob/72b5216bfeaa7c52983060ebfc56e72e0aa8e3b0/contracts/VoteProxy.sol#L28:L36

#0 - GalloDaSballo

2022-04-21T16:55:54Z

Agree as non-critical / informational finding

#1 - GalloDaSballo

2022-04-27T14:55:00Z

0.5

Awards

66.977 USDC - $66.98

Labels

bug
G (Gas Optimization)

External Links

Removable Variable (miniscule gas cost reduction at deploy time)

  • Variable is only written to in the constructor but never used anywhere https://github.com/code-423n4/2022-02-concur/blob/72b5216bfeaa7c52983060ebfc56e72e0aa8e3b0/contracts/USDMPegRecovery.sol#L24

Variables that should be immutable (safe costly sloads)

  • https://github.com/code-423n4/2022-02-concur/blob/72b5216bfeaa7c52983060ebfc56e72e0aa8e3b0/contracts/USDMPegRecovery.sol#L22
  • https://github.com/code-423n4/2022-02-concur/blob/72b5216bfeaa7c52983060ebfc56e72e0aa8e3b0/contracts/StakingRewards.sol#L19
  • https://github.com/code-423n4/2022-02-concur/blob/72b5216bfeaa7c52983060ebfc56e72e0aa8e3b0/contracts/StakingRewards.sol#L20

#0 - GalloDaSballo

2022-03-30T00:26:43Z

  1. Remove variable Should save the cost of one SSTORE which is 20k gas

  2. Make variable immutable The warden could have made a killing here had they spent the extra time linking all the instances Because they just linked the variables, so will give each of the findings one SLOAD value. 2100 * 3

Total Gas saved: 26300

Due to the simplicity, the report doesn't require formatting

#1 - GalloDaSballo

2022-04-02T13:26:06Z

Am changing the way I calculate gas savings to mostly run-time so am removing the 20k gas New total is 6300

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