code-423n4 / 2022-01-yield-findings

1 stars 0 forks source link

double update on storage pointer #121

Closed code423n4 closed 2 years ago

code423n4 commented 2 years ago

Handle

Fitraldys

Vulnerability details

Impact

In the https://github.com/code-423n4/2022-01-yield/blob/main/contracts/ConvexYieldWrapper.sol#L67, the contract already make a storage pointer therefore any changes on vaults will save it to the storage, remove vaults[account] = vaults; can save ~900 gas.

Proof of Concept

https://github.com/code-423n4/2022-01-yield/blob/main/contracts/ConvexYieldWrapper.sol#L67 https://github.com/code-423n4/2022-01-yield/blob/main/contracts/ConvexYieldWrapper.sol#L93

alcueca commented 2 years ago

Duplicate #107