re-al-Foundation / rwa-contracts

0 stars 0 forks source link

[VEV-02C] Optimization of Deposit Enumeration Removal #103

Closed chasebrownn closed 5 months ago

chasebrownn commented 5 months ago

VEV-02C: Optimization of Deposit Enumeration Removal

Type Severity Location
Gas Optimization VotingEscrowVesting.sol:L158, L190, L263-L281

Description:

The invocation of the VotingEscrowVesting::_removeTokenFromDepositorEnumeration function is always followed by a delete of the vestingSchedules entry associated with the tokenId.

Example:

_removeTokenFromDepositorEnumeration(msg.sender, tokenId);

delete vestingSchedules[tokenId];

Recommendation:

We advise the delete statement to be relocated to the VotingEscrowVesting::_removeTokenFromDepositorEnumeration function, optimizing the bytecode size of the contract.

chasebrownn commented 5 months ago

Resolved