Saffron Epoch 1 Recovery

psykeeper
saffron.finance
Published in
3 min readDec 4, 2020

As most are already aware, Saffron’s Epoch 1 came to an end on November 29th, and instead of withdrawing liquidity from the pool as usual users were met with transactions unexpectedly reverted.

It is the worst nightmare for any developer to see that their system isn’t working as intended — and this was the scenario unfolding before my eyes at that time.

We were able to identify the issue quickly and resolve it within 3 days by creating a rescue contract and deploying it successfully to return almost all of the funds.

What happened, exactly?

The long story is technical, but the short story is this: there was a function exposed to the public that could be called to create a new epoch on the contract. Saffron is close to becoming fully decentralized and having as many functions publicly accessible as possible is key to creating a decentralized autonomous system. That function had a bug such that writing specific inputs into it would lead to a contract state where no one could withdraw funds from epoch 1. At that point, everything was stuck in the contract, and would remain there until we were able to recover what we could.

There were 3 affected contracts:

  • The Saffron DAI pool (~15,000 SFI)
  • The Saffron DAI/Compound Adapter (~$53,000,000 worth of cDAI)
  • The Saffron SFI/ETH Uniswap LP Staking Pool (~$4,000,000 UniV2)

Using emergency governance functions the DAI/Compound Adapter and the Uniswap LP Staking pool were able to be swept and funds returned via our epoch 1 recovery UI. If your funds are still stuck then please visit this page to recover them: https://app.saffron.finance/#recover

The code used to recover the funds and the tests we built to ensure safe fund re-delivery can be found on our public GitHub: https://github.com/saffron-finance/epoch1-recovery

SFI Locked

The SFI locked in the epoch 1 DAI pool (which includes all rewards from S and A tranche participation as well as A tranche principal) are stuck for 8 weeks. This is because there is a time lock on the governance function that disallows governance from sweeping funds from the DAI pool. We wrote a section on governance risks in a previous blog post going over these functions in detail.

The current plan is to airdrop rSFI (redeemable SFI) to all holders of locked-up SFI. These rSFI will have their own staking pool with rewards similar to the SFI staking pool that exists right now. The rSFI airdrop should be completed by the end of this weekend and the rSFI staking pool should be available as usual with new pools rolled out at the beginning of epoch 3.

Governance

In the future, decisions like this and rescue missions that preclude them will be executed by a decentralized on-chain governance structure. Our network is still young, but as it grows, it will have to fit in with the rest of its decentralized ecosystem peers and become fully permissionless. Removing central points of failure and handing over decision making to motivated stakeholders is the most optimal outcome possible for Saffron to increase efficiency, reduce risk, and ensure incentives remain aligned.

AMA & FAQ

There are some resources available to the community to learn more about this. I held an AMA on our Discord, a transcript of which can be found here. There is also an #epoch-1-faq channel on Discord with more facts and information about epoch 1 in case there are any remaining questions.

Community

Web3 app: https://saffron.finance
Telegram: https://t.me/saffronfinance
Discord: https://discord.gg/pDXpXKY
Twitter: https://twitter.com/saffronfinance_
Github: https://github.com/saffron-finance/saffron

--

--