code-423n4 / 2021-04-vader-findings

1 stars 0 forks source link

Use immutable for constant variables #286

Open code423n4 opened 3 years ago

code423n4 commented 3 years ago

Handle

paulius.eth

Vulnerability details

Impact

There are variables that are only assigned once (e.g. in a constructor). You should mark such variables with the keyword "immutable", this greatly reduces the gas costs. A concrete example of such a variable is "VADER" which is only initialized once and cannot be changed later: VADER = _vader; There are plenty of such variables across the contracts.

0xBrian commented 3 years ago

Most likely addressed in one of https://github.com/vetherasset/vaderprotocol-contracts/commit/66ce8d72bcd91544f5f1b0382d5e809aa6b71a44 https://github.com/vetherasset/vaderprotocol-contracts/commit/2dacdc3716706c8f635e7173b3fc5f1b42869a35