Olympus DAO contest - karanctf's results

Version 3 of Olympus protocol, a decentralized floating currency.

General Information

Platform: Code4rena

Start Date: 25/08/2022

Pot Size: $75,000 USDC

Total HM: 35

Participants: 147

Period: 7 days

Judge: 0xean

Total Solo HM: 15

Id: 156

League: ETH

Olympus DAO

Findings Distribution

Researcher Performance

Rank: 136/147

Findings: 1

Award: $32.58

🌟 Selected for report: 0

🚀 Solo Findings: 0

[G-1] No need to explicitly initialize variables with default values

If a variable is not set/initialized, it is assumed to have the default value (0 for uint, false for bool, address(0) for address...).

Kernel.sol#L397			for (uint256 i = 0; i < reqLength; ) {
utils/KernelUtils.sol#L43		for (uint256 i = 0; i < 5; ) {
utils/KernelUtils.sol#L58		for (uint256 i = 0; i < 5; ) {

[G-02] Declaring variable inside the loop cost more gas

Most likely because the variable gets reallocated

src/Kernel.sol:
	417:	uint256 origIndex = getDependentIndex[keycode][policy_];
	
src/utils/KernelUtils.sol
	44:		 bytes1 char = unwrapped[i];
	59:		 bytes1 char = unwrapped[i];

[G-3] Variable packing order

src/policies/interfaces/IOperator.sol
	31:		uint32 count; // current number of price points that count towards regeneration
				uint48 lastRegen; // timestamp of the last regeneration
				uint32 nextObservation; // index of the next observation in the observations array

Should be

	uint32
	uint32
	uint48
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