Summary

On Dec-28–2020 at 08:08:12 AM +UTC an exploit was abused on Cover Protocol’s shield mining contract (Blacksmith). The core Cover Protocol product is not affected and is functioning as intended. This exploit only affected the mining contract and the $COVER token.

What was the root cause?

The Bug

As many have explained, this line of code caused the updating of the pool state to be ineffective on the miner’s state when depositing. This misalignment will cause the Blacksmith to mint more rewards to the miner. This bug has been present (unknown to devs) in the Cover Protocol Blacksmith contract since the day it was deployed after being audited.

  • Starting a cron job to run every 20 mins to update any pool that hadn’t been updated recently.

The Amplifier

The missed amplifier was the difference between the amount the miner deposits and the total lpTokens existing in the pool pre-deposit. The greater the difference(1wei v.s. 1e18 wei for example), the bigger the above bug caused extra rewards. If the difference is big enough, the time passed does not matter, miners can still gain ~infinity amount of COVER tokens.

Timeline for Exploiter 1

Dec-28–2020 04:09:27 AM +UTC

Timeline for Grap Finance

Dec-28–2020 11:54:47 AM +UTC

Timeline of Cover Protocol team

Dec-28–2020 at 08:11:16 AM +UTC

Moving Forward

We hope this post-mortem allows users to get a better grasp and understanding of the exploit that took place today.

Acknowledgements

We would like to thank the whole Yearn Ecosystem and also everyone who reached out to offer their support. The amount of information gathered in the time from the attack to this post would have not been achievable without the below individuals.

Disclaimer

COVER is a completely valueless governance token and has 0 financial value. Please exercise proper due diligence before interacting with Cover smart contracts, staking contracts, and all subsequent deployed contracts associated with Cover.

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store