The RAACReleaseOrchestrator contract manages vesting schedules for RAAC tokens, allowing beneficiaries to release their vested tokens via the release function and enabling administrators to revoke vesting via the emergencyRevoke function. Both functions call the RAACToken’s transfer method to move tokens. However, since the RAACToken contract applies transfer taxes (as seen in its internal _update function), the actual amount received by the beneficiary (or the contract in the case of a revocation) is lower than the nominal amount passed to transfer. Despite this, the events emitted by release and emergencyRevoke report the full nominal amounts. This discrepancy results in off-chain event logs that do not accurately reflect the net tokens transferred, potentially leading to misreporting in indexing, auditing, or accounting systems.
Token Transfer Taxation:
In the RAACToken contract, the internal _update function deducts taxes from transfers:
Therefore, when transfer is called, the recipient receives only amount - totalTax.
Event Emission Mismatch:
In both the release and emergencyRevoke functions, the contract emits events using the nominal amount specified in the function call:
Since the actual transferred amount is lower due to tax deductions, the emitted events overstate the amount of tokens moved. This misrepresentation can lead to inconsistencies in off-chain systems that rely on these events for tracking token flows.
Off-Chain Accounting Errors:
Systems that index events to monitor vesting releases or emergency revocations may record incorrect token flows, leading to erroneous financial reports and audit discrepancies.
Misleading Analytics:
Investors and stakeholders relying on event logs for transparency may be misled about the actual token distribution, affecting trust and decision-making.
Audit Inconsistencies:
Discrepancies between on-chain token balances and event-reported amounts could trigger audit issues and regulatory concerns.
The provided test suite demonstrates the vulnerability by:
Creating a vesting schedule for a beneficiary (ALICE).
Fast-forwarding time to allow the full vesting amount to become releasable.
Calling the release function and then comparing the emitted event amount with the actual net amount received (which is lower due to token transfer taxes).
Below is the PoC test suite:
Initialize a Foundry Project:
Place Contract Files:
Ensure that RAACToken.sol and RAACReleaseOrchestrator.sol are in their respective directories under src/core/tokens and src/core/minters/RAACReleaseOrchestrator.
Create Test Directory:
Create a test directory adjacent to src and add the above test file (e.g., RAACReleaseOrchestratorTest.t.sol).
Run the Test:
Expected Outcome:
The logs will indicate that the event emitted in release reports the nominal amount (totalAmount) while the actual token balance received by ALICE is lower due to tax deductions, highlighting the inconsistency.
Inaccurate Off-Chain Reporting:
Event logs are used by off-chain indexing and auditing systems. Emitting the nominal amount rather than the net transferred amount (after tax deductions) may lead to incorrect calculations and misleading analytics.
Potential Misinterpretation:
Stakeholders relying on event data to assess token vesting and distribution may be misled about the actual amount of tokens released, undermining trust in the protocol’s transparency.
Audit and Compliance Issues:
Discrepancies between on-chain balances and event logs could trigger audit flags or regulatory scrutiny, as financial data would not accurately reflect true token flows.
Manual Review
Foundry
To address this vulnerability, the release and emergencyRevoke functions should be updated to capture the net amount transferred (i.e., after token transfer taxes) and emit that value in the corresponding events.
release FunctionemergencyRevoke FunctionThe 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.