Fierce Pecan Swallow
Medium
Zero address missing check in AutomationMaster contract
This will be the main issue if oracle calls the function with zero address by mistake after the deployment. It can be reverted later but it will already do the damage.
If we call registerOracle(_tokens, _oracles) function and pass zero address in the first variable array. Then all oracles will get overridden and store under the first element of _tokens array
for (uint i = 0; i < _tokens.length; i++) {
oracles[_tokens[i]] = _oracles[i];
}
Before registering the oracles, do a zero address checks
There is no major attack path. The only thing is orders will lead to unexpected/ unseen behaviours in the protocol.
No Orders can be created and even if they are created it will not give correct token pricing until the owner updates these addresses
Use the require function before registering the oracles and tokens. Please do the same thing in other places wherever we are registering new addresses
for (uint i = 0; i < _tokens.length; i++) {
require(_tokens[i] != 0x0 && _oracles[i] != 0x0, "zero address found");
oracles[_tokens[i]] = _oracles[i];
}