Omniscia Xcaliswap Audit
VotingDist Code Style Findings
VotingDist Code Style Findings
VDT-01C: Repetitive Value Literal
Type | Severity | Location |
---|---|---|
Code Style | ![]() | VotingDist.sol:L30, L36 |
Description:
The linked value literal is repeated across the codebase multiple times.
Example:
contracts/periphery/VotingDist.sol
30uint[1000000000000000] public tokens_per_week;
Recommendation:
We advise it to be set to a constant
variable instead optimizing the legibility of the codebase.
Alleviation:
The Xcaliswap team evaluated this exhibit but opted not to apply any changes for it in the current iteration of the protocol.
VDT-02C: Variable Mutability Specifiers (Immutable)
Type | Severity | Location |
---|---|---|
Gas Optimization | ![]() | VotingDist.sol:L24, L32, L33 |
Description:
The linked variables are assigned to only once during the contract's constructor
.
Example:
contracts/periphery/VotingDist.sol
40constructor(address _voting_escrow) {41 uint _t = block.timestamp / WEEK * WEEK;42 start_time = _t;43 last_token_time = _t;44 time_cursor = _t;45 address _token = IVotingEscrow(_voting_escrow).token();46 token = _token;47 voting_escrow = _voting_escrow;48 depositor = msg.sender;49 IERC20(_token).approve(_voting_escrow, type(uint).max);50}
Recommendation:
We advise them to be set as immutable
greatly optimizing their read-access gas cost.
Alleviation:
The Xcaliswap team evaluated this exhibit but opted not to apply any changes for it in the current iteration of the protocol.