code-423n4 / 2022-06-badger-findings

0 stars 0 forks source link

QA Report #105

Closed code423n4 closed 2 years ago

code423n4 commented 2 years ago

The MyStrategy.sol contract has defined correctly the 2 functions to be compatible with the chainlink upkeep network, checkUpkeep and performUpkeep (from line 385 to 394).

function checkUpkeep(bytes calldata checkData) external view returns (bool upkeepNeeded, bytes memory performData) {
    (, uint256 unlockable, ,) = LOCKER.lockedBalances(address(this));
    upkeepNeeded = unlockable > 0;
}

/// @dev Function for ChainLink Keepers to automatically process expired locks
function performUpkeep(bytes calldata performData) external {
     // Works like this because it reverts if lock is not expired
     LOCKER.processExpiredLocks(false);
}

But following the official chainlink guidelines, a contract needs to also import the KeepersCompatible.sol to meet all requirements, it imports the functions from both KeeperBase.sol and KeeperCompatibleInterface.sol. During an upkeep contract registration, the contract doesn't need to be validated on-chain, but for keepers to work it needs to be keepers-compatible.

Keeper compatible contract -> (https://docs.chain.link/docs/chainlink-keepers/compatible-contracts/) Register upkeep -> (https://docs.chain.link/docs/chainlink-keepers/register-upkeep/)

GalloDaSballo commented 2 years ago

We have successfully integrated with Chainlink, the base contracts just force you to extend the two functions we have on our own contract.

Another integration with the exact code underscope is live now and being served by keepers.

For those reasons, I must dispute