code-423n4 / 2021-09-swivel-findings

0 stars 0 forks source link

Magic Number 1e26 would best replace by a constant in `VaultTracker` #131

Open code423n4 opened 3 years ago

code423n4 commented 3 years ago

Handle

GalloDaSballo

Vulnerability details

Impact

While not a vulnerability, the usage of 1e26 in VaultTracker resembles the usage of a constant

This will improve readability and potentially reduce bytecode size It also has the convenience that if / when changed, it will be changed in a single place

Recommended Mitigation Steps

Declare uin256 constant MAX = 1e26 and use it

JTraversa commented 3 years ago

https://github.com/Swivel-Finance/gost/commit/f7df79f92946851d4157db91fadcb283596e40f7