Olas - trachev's results

Olas is a unified network for off-chain services like automation, oracles, co-owned AI. It offers a stack for building services and a protocol for incentivizing their creation and their operation in a co-owned and decentralized way.

General Information

Platform: Code4rena

Start Date: 21/12/2023

Pot Size: $90,500 USDC

Total HM: 10

Participants: 39

Period: 18 days

Judge: LSDan

Total Solo HM: 5

Id: 315

League: ETH

Olas

Findings Distribution

Researcher Performance

Rank: 31/39

Findings: 1

Award: $21.90

QA:
grade-b

🌟 Selected for report: 0

🚀 Solo Findings: 0

Awards

21.8971 USDC - $21.90

Labels

bug
downgraded by judge
grade-b
insufficient quality report
primary issue
QA (Quality Assurance)
Q-14

External Links

Lines of code

https://github.com/code-423n4/2023-12-autonolas/blob/2a095eb1f8359be349d23af67089795fb0be4ed1/tokenomics/contracts/Tokenomics.sol#L1138-L1142

Vulnerability details

Impact

In the accountOwnerIncentives function of Tokenomics.sol pending rewards are only finalized if lastEpoch < curEpoch. Furthermore, through the checkpoint function, the current epoch cannot be updated if diffNumSeconds < curEpochLen || diffNumSeconds > ONE_YEAR. Therefore, in the edge case that checkpoint has not been called for a year, all of the donations from the last epoch will be lost as the if check in accountOwnerIncentives, responsible for finalizing pending donations, will always return false. As the chances of this happening are low but the impact would be high, due to the loss of funds, I have decided to mark this issue with medium severity.

Proof of Concept

Here we can see that _finalizeIncentivesForUnitId will only get called if the epoch has been updated:

if (lastEpoch > 0 && lastEpoch < curEpoch) { _finalizeIncentivesForUnitId(lastEpoch, unitTypes[i], unitIds[i]); // Change the last epoch number mapUnitIncentives[unitTypes[i]][unitIds[i]].lastEpoch = 0; }

Tools Used

Manual review

Implement a recovery mechanism in accountOwnerIncentives that checks if the difference of seconds since the last epoch is more than one year. In that case, a call to _finalizeIncentivesForUnitId` should also be made.

Assessed type

Other

#0 - c4-pre-sort

2024-01-10T15:22:39Z

alex-ppg marked the issue as primary issue

#1 - c4-pre-sort

2024-01-10T15:22:43Z

alex-ppg marked the issue as insufficient quality report

#2 - c4-judge

2024-01-19T22:44:23Z

dmvt changed the severity to QA (Quality Assurance)

#3 - c4-judge

2024-01-19T22:44:53Z

dmvt 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