Skip to content

fix: correct vesting schedule boundary and silent ETH transfer failure#242

Open
saddam92 wants to merge 1 commit intobase:mainfrom
saddam92:fix/smart-escrow-vesting-schedule-and-recovery-silent-failure
Open

fix: correct vesting schedule boundary and silent ETH transfer failure#242
saddam92 wants to merge 1 commit intobase:mainfrom
saddam92:fix/smart-escrow-vesting-schedule-and-recovery-silent-failure

Conversation

@saddam92
Copy link
Copy Markdown

@saddam92 saddam92 commented Apr 7, 2026

Summary

Two bugs fixed across SmartEscrow and Recovery contracts.

Bug 1 – SmartEscrow: incorrect total vested amount after end

The _vestingSchedule function used OP_TOKEN.balanceOf(address(this)) + released
when timestamp > end. Because the token balance decreases as tokens are released,
this makes releasable() return a progressively lower (and eventually underflowing)
amount, potentially stranding tokens in the contract permanently.

Fixed by computing total vested tokens from immutable schedule parameters only.
Also corrected > to >= to include the exact end timestamp.

Bug 2 – Recovery: silent ETH transfer failure

withdrawETH used if (!success) continue which silently skips failed transfers,
permanently losing ETH with no revert or event emitted.

Fixed by replacing with require(success, ...) to revert the entire batch on failure.

@cb-heimdall
Copy link
Copy Markdown
Collaborator

🟡 Heimdall Review Status

Requirement Status More Info
Reviews 🟡 0/1
Denominator calculation
Show calculation
1 if user is bot 0
1 if user is external 0
2 if repo is sensitive 0
From .codeflow.yml 1
Additional review requirements
Show calculation
Max 0
0
From CODEOWNERS 0
Global minimum 0
Max 1
1
1 if commit is unverified 1
Sum 2

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants