re-al-Foundation / rwa-contracts

0 stars 0 forks source link

[VEV-03C] Optimization of Storage Space #104

Closed chasebrownn closed 5 months ago

chasebrownn commented 5 months ago

VEV-03C: Optimization of Storage Space

Type Severity Location
Gas Optimization VotingEscrowVesting.sol:L40, L42

Description:

The VestingSchedule structure will reserve two 256-bit slots for storing a timestamp in each which is guaranteed to fit in a smaller value of bits.

Example:

struct VestingSchedule {
    /// @dev lock epoch start time.
    uint256 startTime;
    /// @dev lock epoch end time.
    uint256 endTime;
    ///@dev amount of tokens locked.
    uint256 amount;
}

Recommendation:

We advise the code to reduce the storage needs of the referenced variables, optimizing the code's gas cost when creating and deleting vesting schedule entries.

chasebrownn commented 5 months ago

Acknowledged