The emergencyRevoke function in the RAACReleaseOrchestrator
contract incorrectly attempts to transfer unreleased tokens to the contract’s own address (address(this)) instead of the beneficiary. This redundant transfer is ineffective since the tokens are already held by the contract and may lead to transfer failures if the contract’s balance is insufficient, thereby preventing proper token recovery.
In the emergencyRevoke function, after calculating the unreleased tokens from a vesting schedule, the contract deletes the schedule and then executes the following logic:
Issue:
The function transfers unreleased tokens to address(this), which is the contract itself. This is redundant because:
The tokens are already held in the contract.
If the contract’s token balance is insufficient (due to previous transfers or other reasons), the transfer will fail.
Expected Behavior:
The unreleased tokens should be transferred to the beneficiary or an appropriate recovery address to ensure that the tokens are effectively recovered in an emergency scenario.
Initial Conditions:
A vesting schedule is created for a beneficiary with:
totalAmount = 100e18
tokens.
releasedAmount = 40e18
tokens.
The calculated unreleased amount is:
Execution in emergencyRevoke:
The function deletes the vesting schedule.
It then attempts to transfer 60e18
tokens to address(this)
:
Since the tokens are already held by the contract, this transfer is redundant. Moreover, if the contract does not have an adequate balance (perhaps due to previous distributions), the transfer will fail.
Outcome:
The emergency revoke process fails to properly recover and reassign the unreleased tokens, potentially leaving stakeholders without access to their due tokens during emergencies.
The erroneous transfer prevents the intended recovery of unreleased tokens in emergency scenarios.
Manual Review
Change the transfer destination in the emergencyRevoke function from address(this)
to the beneficiary, e.g., replace:
with
The contest is live. Earn rewards by submitting a finding.
This is your time to appeal against judgements on your submissions.
Appeals are being carefully reviewed by our judges.