MarketOrderKeeper::performUpkeep function is protected using onlyForwarder modifier which uses the BaseKeeperStorage::forwarder variable to validate the execution to be only done by the forwarder that is set by the owner in BaseKeeper.setForwarder function that is protected by onlyOwner modifier. Along with centralization issues, this could result in unfilled marketOrders.
MarketOrderKeeper::performUpkeep function is protected and access controlled using onlyForwarder modifier. This is against the instructions given in the natspec of ILogAutomation::performUpkeep. It is clearly instructed that, the caller of the method should not even be restricted to any single registry and anyone should be able call it.
In Zaros, all marketOrders are filled using the Chainlink Smart Contract Automation ecosystem. In current implementation the SettlementBranch.fillMarketOrder can only be called by the marketOrderKeeper because onlyMarketOrderKeeper modifier is implemented. The MarketOrderKeeper is using MarketOrderKeeper::performUpkeep function to fill the order. This function is also protected by onlyForwarder modifier and BaseKeeperStorage::forwarder variable is set by the owner in BaseKeeper::setForwarder function.
In this scenario only the BaseKeeperStorage::forwarder is authorized to invoke SettlementBranch.fillMarketOrder function. The forwarder is also a part of the Chainlink Smart Contract Automation ecosystem. What if due to any reason the forwarder stops responding? There is no way to fill the orders manually.
Source:
MarketOrderKeeper::performUpkeep
BaseKeeperStorage::onlyForwarder
BaseKeeper::setForwarder
SettlementBranch::fillMarketOrder
If the forwarder is down or due to any reason stops responding then market orders will stop filling that could result into financial losses to the protocol.
Source: (ILogAutomation.sol#L50C1-L66C65)[https://github.com/Cyfrin/2024-07-zaros/blob/d687fe96bb7ace8652778797052a38763fbcbb1b/src/external/chainlink/interfaces/ILogAutomation.sol#L50C1-L66C65]
Manual Review
We should implement all the external services as instructed in the official docs. We should make the SettlementBranch.fillMarketOrder function public and implement required input data validations and process checks as instructed by the natspec.
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.