Platform: Code4rena
Start Date: 20/01/2022
Pot Size: $50,000 USDC
Total HM: 3
Participants: 35
Period: 7 days
Judge: GalloDaSballo
Total Solo HM: 2
Id: 77
League: ETH
Rank: 16/35
Findings: 2
Award: $106.54
🌟 Selected for report: 1
🚀 Solo Findings: 0
🌟 Selected for report: UncleGrandpa925
106.5364 USDC - $106.54
UncleGrandpa925
Saving gas-cost for all transactions interacting with the pools.
Currently the bytecode size of the Exchange is 10.99KB. Making the entire MathLib internal (therefore embedding it into the Exchange) will only make the bytecode size grows to 14.45KB, which is well below the limit of 24576 bytes. Doing this will save at least 2300 gas for every transaction since that the cost for cold-load the bytecode of the library, and also saving the gas cost of doing delegate call to the library instead of doing internal call.
Converting all public properties in the MathLib to internal.
Normally I'm not into farming gas-optimization issues, but I think this is worth doing.
#0 - 0xean
2022-01-27T13:46:58Z
interesting, will look into this.
#1 - GalloDaSballo
2022-02-04T23:01:35Z
Would have preferred some more details from the warden, to show their work. That said, because the sponsor confirmed, we'll mark as valid
#2 - 0xean
2022-02-16T12:48:27Z
Opting to not go with this optimization as it does increase the gas costs to deploy the exchange significantly and requires a fair bit of restructuring of code, sdk.