Unnecessary address iteration which will become way to expensive over time.
In Bridge::_whiteListCollection
, we have a while statement which iterates through the whole array of addresses _collections
:
However, that iteration may result in DOS if a lot of people whitelist their addresses because the array _collections
will become to large and gas expensive to iterate through which is likely to happen.
Large of number of users whitelist collections, thus the array holding the addresses of the collections becomes extremely expensive to iterate through.
Someone tries to whitelist a new collection.
Impact: High
Likelihood: Medium
Manual Review
Instead of using address[] _collections
use a map such as mapping(address => bool) _collections
. Thus, look up is faster and there is no need to iterate through the map resulting in huge gas savings and no DOS.
LightChaser: Low-19, Gas-10
The contest is live. Earn rewards by submitting a finding.
This is your time to appeal against judgements on your submissions.
Appeals are being carefully reviewed by our judges.