Closed code423n4 closed 1 year ago
QA might be more appropriate.
PowVT marked the issue as sponsor acknowledged
PowVT marked the issue as disagree with severity
QA, duplicate of #240 . Not intended to be re-used for a user and there is a easy workaround if needed.
0xean changed the severity to QA (Quality Assurance)
0xean marked the issue as grade-c
Lines of code
https://github.com/code-423n4/2023-07-arcade/blob/main/contracts/ARCDVestingVault.sol#L122 https://github.com/code-423n4/2023-07-arcade/blob/main/contracts/ARCDVestingVault.sol#L228-L253
Vulnerability details
Impact
The ImmutableVestingVault contract does not support sending multiple grants to the same recipient, which is functionality that should be supported. This is because the
addGrantAndDelegate
function will revert ifgrant.allocation != 0
for a given user. However,grant.allocation
is never set to 0, even when the recipient has claimed all their tokens from the grant (by callingclaim
). This is improper behavior and will break all logic which relies on granting the same recipient address multiple grants.Proof of Concept
The ImmutableVestingVault contract inherits almost all functionality from the ARCDVestingVault contract, with the exception that the
revokeGrant
function will revert on all calls. This is an issue because therevokeGrant
function is the only place in whichgrant.allocation
is set to 0.This in turn is an issue because the
addGrantAndDelegate
function, which is used to create a grant for a recipient, has the following check:There is also no other place in which
grant.allocation
is set to 0, even if the recipient has claimed all the tokens from the grant. For example, theclaim
function is defined as follows:Even when a user has withdrawn all of their tokens from the grant (
grant.withdrawn
==grant.allocation
), the grant will never be deleted (grant.allocation
= 0). Thus, a recipient can never get more than a single grant, which is invalid behavior.Tools Used
Manual review
Recommended Mitigation Steps
In the
claim
function of the ARCDVestingVault contract, when the recipient has withdrawn all tokens from the grant, the grant should be deleted similar to how it is done at the bottom of therevokeGrant
function of the ARCDVestingVault contract.Assessed type
Other