code-423n4 / 2022-03-paladin-findings

0 stars 0 forks source link

Gas Optimizations #10

Open code423n4 opened 2 years ago

code423n4 commented 2 years ago

g01:

use immutable on non changing constants to save gas HolyPaladinToken.sol

g02:

use uint256 instead of other uint variants to save gas HolyPaladinToken.sol L#83

g03:

use -- as also as prefix to save gas, prefer prefix over suffix HolyPaladinToken.sol L#272,288,350,456

        uint256 currentUserLockIndex = userLocks[msg.sender].length - 1;
    to
    ```
    uint256 currentUserLockIndex = --userLocks[msg.sender].length;
    ```

g04:

change public to exernal to save gas