Shell Protocol - epistkr's results

A set of EVM-based smart contracts on Arbitrum One. In a nutshell it is DeFi made simple.

General Information

Platform: Code4rena

Start Date: 21/08/2023

Pot Size: $36,500 USDC

Total HM: 1

Participants: 43

Period: 7 days

Judge: Dravee

Id: 277

League: ETH

Shell Protocol

Findings Distribution

Researcher Performance

Rank: 32/43

Findings: 1

Award: $22.46

Gas:
grade-b

🌟 Selected for report: 0

🚀 Solo Findings: 0

Findings Information

Labels

bug
G (Gas Optimization)
grade-b
sufficient quality report
G-13

Awards

22.4575 USDC - $22.46

External Links

I found there are multiple call of t(self). so I use tValue and using it in function.

EvolvingProteus.sol

/** @notice The minimum price (at the x asymptote) at the current block @param self config instance */ // function p_min(Config storage self) public view returns (int128) { // if (t(self) > ABDK_ONE) return self.px_final; // else return self.px_init.mul(ABDK_ONE.sub(t(self))).add(self.px_final.mul(t(self))); // } function p_min(Config storage self) public view returns (int128) { int128 tValue = t(self); if (tValue > ABDK_ONE) return self.px_final; else return self.px_init.mul(ABDK_ONE.sub(tValue)).add(self.px_final.mul(tValue)); } /** @notice The maximum price (at the y asymptote) at the current block @param self config instance */ // function p_max(Config storage self) public view returns (int128) { // if (t(self) > ABDK_ONE) return self.py_final; // else return self.py_init.mul(ABDK_ONE.sub(t(self))).add(self.py_final.mul(t(self))); // } function p_max(Config storage self) public view returns (int128) { int128 tValue = t(self); if (tValue > ABDK_ONE) return self.py_final; else return self.py_init.mul(ABDK_ONE.sub(tValue)).add(self.py_final.mul(tValue)); }

This is original result.

$ forge test --gas-report ... | Function Name | min | avg | median | max | # calls | ... | p_max | 4594 | 6830 | 4594 | 15094 | 93 | | p_min | 4696 | 4696 | 4696 | 4696 | 93 |

This is after result.

$ forge test --gas-report ... | Function Name | min | avg | median | max | # calls | ... | p_max | 2003 | 4799 | 2800 | 13300 | 96 | | p_min | 2088 | 2885 | 2902 | 2902 | 96 |

#0 - c4-pre-sort

2023-08-30T01:11:32Z

0xRobocop marked the issue as sufficient quality report

#1 - c4-judge

2023-09-11T20:12:58Z

JustDravee marked the issue as grade-b

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