Platform: Code4rena
Start Date: 21/11/2022
Pot Size: $90,500 USDC
Total HM: 18
Participants: 101
Period: 7 days
Judge: Picodes
Total Solo HM: 4
Id: 183
League: ETH
Rank: 68/101
Findings: 1
Award: $53.49
🌟 Selected for report: 0
🚀 Solo Findings: 0
🌟 Selected for report: 0xSmartContract
Also found by: 0xAgro, 0xNazgul, 0xPanda, 0xbepresent, 0xfuje, Awesome, B2, Bnke0x0, Deivitto, Diana, Funen, Jeiwan, JohnSmith, Josiah, R2, RaymondFam, Rolezn, Sathish9098, Waze, adriro, aphak5010, brgltd, btk, carrotsmuggler, ch0bu, chaduke, codeislight, codexploder, cryptostellar5, csanuragjain, danyams, datapunk, delfin454000, deliriusz, eierina, erictee, fatherOfBlocks, gz627, gzeon, hansfriese, hihen, jadezti, joestakey, keccak123, martin, nameruse, oyc_109, pedr02b2, perseverancesuccess, rbserver, rotcivegaf, rvierdiiev, sakshamguruji, shark, simon135, subtle77, unforgiven, xiaoming90, yixxas
53.4851 USDC - $53.49
src/interfaces/IPirexRewards.sol
src/interfaces/IProducer.sol
src/vaults/AutoPxGmx.sol
L60 - The AlreadySet error is created, but it is never used, so it should be removed.
L185/213 - The _totalSupply - shares operation is performed, but shares is an input to the function, therefore it is very possible to generate overflows, this should be validated in order to show a correct error so that it is easy for users to understand.
src/vaults/AutoPxGlp.sol
The AutoPxGlp and AutoPxGmx contracts have a lot of shared code, therefore it would be very possible to modularize the code by creating an abstract contract or simply create two contracts that inherit from one that has everything shared implemented. For example: constants, inheritance, variables in storages and default values, events, errors, setters and functions.
L163/191 - The _totalSupply - shares operation is performed, but shares is an input to the function, therefore it is very possible to generate overflows, this should be validated in order to show a correct error so that it is easy for users to understand.
#0 - c4-judge
2022-12-05T09:56:16Z
Picodes marked the issue as grade-b