code-423n4 / 2021-10-union-findings

0 stars 0 forks source link

Unbounded loops #85

Closed code423n4 closed 2 years ago

code423n4 commented 2 years ago

Handle

pauliax

Vulnerability details

Impact

There are several loops in the contract which can eventually grow so large as to make future operations of the contract cost too much gas to fit in a block. An example of this is moneyMarkets in AssetManager. New markets can be added by calling function addAdapter and there are many for loops that iterate over all the markets. Similarly with supportedTokensList and other unbounded arrays.

Recommended Mitigation Steps

Consider either introducing an upper boundary (max) limit for such values or adding removal functions to avoid the aforementioned "disaster".

GalloDaSballo commented 2 years ago

Duplicate of #65