Sturdy contest - GimelSec's results

The first protocol for interest-free borrowing and high yield lending.

General Information

Platform: Code4rena

Start Date: 13/05/2022

Pot Size: $30,000 USDC

Total HM: 8

Participants: 65

Period: 3 days

Judge: hickuphh3

Total Solo HM: 1

Id: 125

League: ETH

Sturdy

Findings Distribution

Researcher Performance

Rank: 31/65

Findings: 3

Award: $83.10

🌟 Selected for report: 0

πŸš€ Solo Findings: 0

Awards

14.8433 USDC - $14.84

Labels

bug
duplicate
3 (High Risk)

External Links

Lines of code

https://github.com/code-423n4/2022-05-sturdy/blob/main/smart-contracts/LidoVault.sol#L140-L142

Vulnerability details

Impact

It should check require before return, but _withdrawFromYieldPool function just return before require, resulting in not checking the result of the call, users may lose their collateral.

Proof of Concept

The _withdrawFromYieldPool function in LidoVault.sol:

(bool sent, bytes memory data) = address(_to).call{value: receivedETHAmount}(''); return receivedETHAmount; require(sent, Errors.VT_COLLATERAL_WITHDRAW_INVALID);

Tools Used

vim

(bool sent, bytes memory data) = address(_to).call{value: receivedETHAmount}(''); require(sent, Errors.VT_COLLATERAL_WITHDRAW_INVALID); return receivedETHAmount;

#0 - sforman2000

2022-05-18T03:10:45Z

Summary

We list 2 low-critical findings and 1 non-critical findings:

  • (Low) GeneralVault\initialize() should check the address of _provider != address(0)
  • (Low) setConfiguration should check the address of _lpToken != address(0)
  • (Non) It’s better to emit an events In YieldManager.sol setter functions

(Low) GeneralVault\initialize() should check the address of _provider != address(0)

Impact

In GeneralVault.sol, initialize() should check the address of _provider != address(0)

Proof of Concept

https://github.com/code-423n4/2022-05-sturdy/blob/main/smart-contracts/GeneralVault.sol#L61-L63

Tools Used

vim

Check address(_provider) != address(0).

(Low) setConfiguration should check the address of _lpToken != address(0)

Impact

In ConvexCurveLPVault.sol, setConfiguration should check the address of _lpToken != address(0)

Proof of Concept

https://github.com/code-423n4/2022-05-sturdy/blob/main/smart-contracts/ConvexCurveLPVault.sol#L37-L49

Tools Used

vim

Check address(_lpToken) != address(0).

(Non) It’s better to emit an events In YieldManager.sol setter functions

Impact

It’s better to have events in setter functions.

Proof of Concept

https://github.com/code-423n4/2022-05-sturdy/blob/main/smart-contracts/YieldManager.sol#L92

https://github.com/code-423n4/2022-05-sturdy/blob/main/smart-contracts/YieldManager.sol#L64

Tools Used

vim

Add events for setter functions.

#0 - HickupHH3

2022-06-06T06:17:22Z

Both are NC.

Awards

23.4569 USDC - $23.46

Labels

bug
G (Gas Optimization)

External Links

Save gas in for loops by ++i rather than i++

In for loops, using ++i rather than i++ to save gas.

Proof of Concept

GeneralVault.sol 218: for (uint256 i = 0; i < length; i++) { ConvexCurveLPVault.sol 106: for (uint256 i = 0; i < extraRewardsLength; i++) { YieldManager.sol 120: for (uint256 i = 0; i < _count; i++) { 130: for (uint256 i = 0; i < assetYields.length; i++) { 156: for (uint256 i = 0; i < length; i++) {

Recommendation

Use ++i rather than i++ to save gas.

Use constant to save gas

Proof of Concept

https://github.com/code-423n4/2022-05-sturdy/blob/main/smart-contracts/ConvexCurveLPVault.sol#L40

Recommendation

address public constant convexBooster = 0xF403C135812408BFbE8713b5A23a04b3D48AAE31;
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