stake.link

stake.link
DeFiHardhatBridge
27,500 USDC
View results
Submission Details
Severity: low
Invalid

Unprotected `performUkeep` Function

Summary

The performUpkeep function is unprotected and does not follow best practices. When using Chainlink Automation it is best practice to check that an upkeep is still needed within the performUpkeep function and require it can only be called by the Forwarder.

From the Chainlink Docs: "If your upkeep performs sensitive functions in your protocol, consider using the Forwarder to lock it down so performUpkeep can only be called by the Forwarder. Add other permissible addresses if you need to call it yourself. Note the forwarder is only determined after registration so make this a mutable variable and ensure you add a setter function with permissions for you to set it."

Tools Used

Manual Review

Recommendations

Create a modifier that only allows performUpkeep to be called by the forwarder

modifier onlyForwader(){
if (msg.sender != forwader){
revert CannotCall();
}
_
}

Check that upkeep is still needed within performUpkeep

Updates

Lead Judging Commences

0kage Lead Judge over 1 year ago
Submission Judgement Published
Invalidated
Reason: Non-acceptable severity

Support

FAQs

Can't find an answer? Chat with us on Discord, Twitter or Linkedin.