Platform: Code4rena
Start Date: 28/01/2022
Pot Size: $30,000 USDC
Total HM: 4
Participants: 22
Period: 3 days
Judge: GalloDaSballo
Total Solo HM: 2
Id: 80
League: ETH
Rank: 11/22
Findings: 1
Award: $137.76
🌟 Selected for report: 1
🚀 Solo Findings: 0
42.7547 USDC - $42.75
Fitraldys
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.
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
#0 - alcueca
2022-02-02T16:51:07Z
Duplicate #107
🌟 Selected for report: Fitraldys
95.0104 USDC - $95.01
Fitraldys
In the _calcCvxIntegral() and _calcRewardIntegral() it has an inputed parameter that using memory, since this function didnt change the _accounts
and _balances
parameter,
its cheaper to use calldata instead, because this function only need to read _accounts
and _balances
parameter, by changing it to calldata can save +- 700 gas.
https://github.com/code-423n4/2022-01-yield/blob/main/contracts/ConvexStakingWrapper.sol#L155 https://github.com/code-423n4/2022-01-yield/blob/main/contracts/ConvexStakingWrapper.sol#L156 https://github.com/code-423n4/2022-01-yield/blob/main/contracts/ConvexStakingWrapper.sol#L208 https://github.com/code-423n4/2022-01-yield/blob/main/contracts/ConvexStakingWrapper.sol#L209
#0 - devtooligan
2022-02-02T15:48:30Z
I don't think this work because the calling fn creates the array in memory? At least it wouldn't compile when I tried this change
#1 - GalloDaSballo
2022-02-13T23:02:24Z
I believe memory here should cost more than calldata, but not 700 gas.
I'd love to see the warden's work. But in lack of any POC, with my doubts and the sponsor disputing, am going to mark the finding invalid.
Would recommend the warden to provide their work to give them a better chance when their finding is contested