Aura Finance contest - JDeryl's results

Providing optimal incentives for VotingEscrow systems.

General Information

Platform: Code4rena

Start Date: 11/05/2022

Pot Size: $150,000 USDC

Total HM: 23

Participants: 93

Period: 14 days

Judge: LSDan

Total Solo HM: 18

Id: 123

League: ETH

Aura Finance

Findings Distribution

Researcher Performance

Rank: 80/93

Findings: 1

Award: $149.87

🌟 Selected for report: 0

🚀 Solo Findings: 0

QA Report (Low/Non-Critical)

File AuraVestedEscrow.sol

Issue: checks-effects-interactions pattern missing

Description: Lines: 123-125 Though the function cancel(address _recipient) ensures using the non-reentrant modifier, it is however suggested based on best practices that the checks-effects-interactions pattern be implemented for all functions containing external calls.

Current Code:

function cancel(address _recipient) external nonReentrant { require(msg.sender == admin, "!auth"); require(totalLocked[_recipient] > 0, "!funding"); _claim(_recipient, false); uint256 delta = remaining(_recipient); rewardToken.safeTransfer(admin, delta); totalLocked[_recipient] = 0; emit Cancelled(_recipient); }

Suggestion: Hence the lines of code can be swapped to ensure the best practice remain intact as follows.

function cancel(address _recipient) external nonReentrant { require(msg.sender == admin, "!auth"); require(totalLocked[_recipient] > 0, "!funding"); _claim(_recipient, false); uint256 delta = remaining(_recipient); totalLocked[_recipient] = 0; rewardToken.safeTransfer(admin, delta); emit Cancelled(_recipient); }
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